From c0dca351ff6202f4fe9e4d71e0a93fe8c892f1f5 Mon Sep 17 00:00:00 2001 From: feisenhu Date: Wed, 25 Mar 2026 16:36:03 +0100 Subject: [PATCH 1/5] Add TOF nsigma pi, K, p histos to study structure in TOFnSigEle due to effect of TOF recalculation --- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index b000ee4ba28..33575d84e7d 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -317,6 +317,9 @@ struct SingleTrackQCMC { 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/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/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/PID/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/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); @@ -671,6 +674,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); } } else { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight); @@ -717,6 +723,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); } } } From cdcd3a8f1450108c8b81c847585f3702eb4eb3de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:12:10 +0000 Subject: [PATCH 2/5] Initial plan From 76e64b5a27322a158e7e562a81fd745b1552c39d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:13:48 +0000 Subject: [PATCH 3/5] Fix cfgRequireTrueAssociation not applied in fillTrackWeightMap Agent-Logs-Url: https://github.com/feisenhu/O2Physics/sessions/299261dd-7222-4d31-bfbe-51b8e64993ce Co-authored-by: feisenhu <53603353+feisenhu@users.noreply.github.com> --- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 33575d84e7d..39a0ca5fad6 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -1051,6 +1051,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)) { @@ -1070,6 +1073,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; } From 7f42156feb99bd402b9fe48ffe208fcf8ab22ea2 Mon Sep 17 00:00:00 2001 From: feisenhu Date: Wed, 25 Mar 2026 16:36:03 +0100 Subject: [PATCH 4/5] Add TOF nsigma pi, K, p histos to study structure in TOFnSigEle due to effect of TOF recalculation --- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index bde658f6c28..1c374520cd4 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -684,6 +684,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); + fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); } } else { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight); @@ -730,6 +733,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); + fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); } } } From eed13730a7df75ffd14ffa2780ab3e61ba575006 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:33:15 +0000 Subject: [PATCH 5/5] Revert "Merge origin/master: resolve conflict in SingleTrackQCMC.h" This reverts commit f47268b808e69027b6f77ee01f9541aa89c87590, reversing changes made to 76e64b5a27322a158e7e562a81fd745b1552c39d. Co-authored-by: feisenhu <53603353+feisenhu@users.noreply.github.com> --- .github/workflows/o2-linter.yml | 11 +- 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 | 30 +- 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/drawFastTracker.C | 13 +- ALICE3/Macros/testFastTracker.C | 7 +- ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx | 17 +- .../OTF/onTheFlyDetectorGeometryProvider.cxx | 13 +- ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx | 25 +- ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx | 32 +- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 49 +- .../TableProducer/OTF/onTheFlyTrackerPid.cxx | 32 +- ALICE3/TableProducer/alice3-centrality.cxx | 23 +- .../TableProducer/alice3-correlatorDDbar.cxx | 25 +- ALICE3/TableProducer/alice3-decayfinder.cxx | 56 +- .../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 | 322 +- 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 | 26 +- 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 | 33 +- ALICE3/Tasks/alice3TrackingPerformance.cxx | 18 +- ALICE3/Tasks/pidFTOFqa.cxx | 19 +- ALICE3/Tasks/pidRICHqa.cxx | 24 +- ALICE3/Utils/utilsHfAlice3.h | 5 - CODEOWNERS | 6 +- Common/CCDB/macros/ctpRateF.C | 6 +- .../macros/upload_event_selection_params.C | 30 +- Common/Core/macros/testMetadataHelper.C | 5 +- Common/DataModel/Multiplicity.h | 36 +- Common/DataModel/PIDResponseTOF.h | 154 +- Common/Tasks/centralityStudy.cxx | 34 +- Common/Tools/Multiplicity/MultModule.h | 12 +- .../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 | 24 +- DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h | 4 +- DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx | 27 +- DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt | 5 - DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx | 24 +- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx | 21 +- .../AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx | 16 +- .../AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx | 822 ---- 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 - 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 | 8 +- EventFiltering/PWGHF/HFFilterHelpers.h | 11 +- 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 +- PWGCF/DataModel/CorrelationsDerived.h | 11 +- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 5 - .../EbyEFluctuations/Tasks/nchCumulantsId.cxx | 1097 +---- .../Tasks/netprotcumulants.cxx | 2994 ------------- PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx | 1059 +++-- 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 | 30 +- 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 | 26 +- PWGCF/Femto/Core/pairCleaner.h | 2 +- PWGCF/Femto/Core/pairHistManager.h | 265 +- PWGCF/Femto/Core/pairProcessHelpers.h | 24 +- 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 | 30 +- 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 +- .../TableProducer/HadNucleiFemto.cxx | 245 +- 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 +- .../Core/FemtoUniverseDetaDphiStar.h | 208 +- .../Core/FemtoUniverseParticleHisto.h | 37 +- .../Core/FemtoUniverseSelection.h | 2 +- .../femtoUniverseProducerTask.cxx | 12 +- .../Tasks/femtoUniverseEfficiencyBase.cxx | 97 +- ...toUniversePairTaskTrackCascadeExtended.cxx | 180 +- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 36 +- .../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 | 92 +- .../femtoUniversePairTaskTrackV0Extended.cxx | 54 +- .../femtoUniversePairTaskTrackV0Helicity.cxx | 62 +- ...femtoUniversePairTaskV0CascadeExtended.cxx | 4 +- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 41 +- PWGCF/Flow/Tasks/flowEventPlane.cxx | 131 +- PWGCF/Flow/Tasks/flowSP.cxx | 521 +-- PWGCF/Flow/Tasks/flowZdcEnergy.cxx | 40 +- PWGCF/GenericFramework/Core/FlowContainer.cxx | 2 +- .../Tasks/flowGenericFramework.cxx | 437 +- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 84 +- PWGCF/TableProducer/filter2Prong.cxx | 104 - PWGCF/TableProducer/filterCorrelations.cxx | 15 +- PWGCF/Tasks/correlations.cxx | 31 +- .../DataModel/LongRangeDerived.h | 96 +- .../TableProducer/longrangeMaker.cxx | 102 +- .../Tasks/CMakeLists.txt | 13 +- .../Tasks/Lambdacascadecorrelation.cxx | 3704 ----------------- .../Tasks/corrSparse.cxx | 173 +- .../Tasks/flowDecorrelation.cxx | 238 +- .../Tasks/lambdaR2Correlation.cxx | 477 ++- .../Tasks/lambdaSpinPolarization.cxx | 610 +-- .../Tasks/longRangeDihadronCor.cxx | 233 -- .../Tasks/longrangecorrDerived.cxx | 58 +- .../Tasks/particleOriginAnalysis.cxx | 361 -- PWGDQ/Core/AnalysisCompositeCut.cxx | 6 - PWGDQ/Core/AnalysisCompositeCut.h | 10 +- PWGDQ/Core/AnalysisCut.cxx | 4 - PWGDQ/Core/AnalysisCut.h | 10 +- PWGDQ/Core/CutsLibrary.cxx | 23 +- PWGDQ/Core/CutsLibrary.h | 7 +- PWGDQ/Core/DQMlResponse.h | 7 +- PWGDQ/Core/HistogramManager.cxx | 35 +- PWGDQ/Core/HistogramManager.h | 25 +- PWGDQ/Core/HistogramsLibrary.cxx | 45 +- 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 | 45 +- PWGDQ/Core/VarManager.h | 160 +- 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 | 48 +- .../tableMakerMuonMchTrkEfficiency.cxx | 51 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 112 +- 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 | 56 +- PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx | 45 +- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 123 +- PWGDQ/Tasks/dqFlow.cxx | 90 +- 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 | 449 +- PWGDQ/Tasks/qaMatching.cxx | 65 +- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 58 +- PWGDQ/Tasks/tableReader.cxx | 45 +- PWGDQ/Tasks/tableReader_withAssoc.cxx | 131 +- PWGDQ/Tasks/tableReader_withAssoc_direct.cxx | 53 +- PWGDQ/Tasks/taskFwdTrackPid.cxx | 36 +- PWGDQ/Tasks/taskJpsiHf.cxx | 24 +- PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx | 16 +- PWGDQ/Tasks/v0selector.cxx | 41 +- PWGEM/Dilepton/Core/CMakeLists.txt | 2 +- PWGEM/Dilepton/Core/DielectronCut.cxx | 6 +- PWGEM/Dilepton/Core/DielectronCut.h | 30 +- PWGEM/Dilepton/Core/Dilepton.h | 856 ++-- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 664 ++- PWGEM/Dilepton/Core/DileptonMC.h | 868 ++-- PWGEM/Dilepton/Core/DileptonProducer.h | 590 +-- 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 | 613 ++- PWGEM/Dilepton/DataModel/dileptonTables.h | 142 +- 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 | 48 +- 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 | 43 +- PWGEM/Dilepton/Utils/EventHistograms.h | 302 +- 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 | 23 +- 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 | 5 +- 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 | 325 +- .../Tasks/gammaConversionsTruthOnlyMc.cxx | 5 +- .../PhotonMeson/Tasks/mcGeneratorStudies.cxx | 15 +- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 11 +- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 18 +- PWGEM/PhotonMeson/Tasks/phosQC.cxx | 6 +- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 97 +- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 1984 ++++----- PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx | 2 +- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 2 +- PWGEM/PhotonMeson/Utils/ClusterHistograms.h | 1 - PWGEM/PhotonMeson/Utils/EventHistograms.h | 69 +- 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 +- .../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 | 34 +- PWGHF/D2H/DataModel/ReducedDataModel.h | 14 - PWGHF/D2H/Macros/compute_fraction_cutvar.py | 65 +- PWGHF/D2H/Macros/config_cutvar_example.json | 14 - PWGHF/D2H/Macros/cut_variation.py | 13 +- PWGHF/D2H/TableProducer/CMakeLists.txt | 5 - .../dataCreatorHiddenCharmReduced.cxx | 355 -- PWGHF/D2H/Tasks/CMakeLists.txt | 5 - PWGHF/D2H/Tasks/taskCd.cxx | 101 +- PWGHF/D2H/Tasks/taskD0.cxx | 247 +- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 264 +- PWGHF/D2H/Tasks/taskHiddenCharm.cxx | 148 - PWGHF/D2H/Tasks/taskLc.cxx | 26 +- .../DataModel/CandidateReconstructionTables.h | 2 +- PWGHF/DataModel/DerivedTables.h | 7 +- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 8 +- .../TableProducer/correlatorDplusHadrons.cxx | 256 +- .../derivedDataCreatorCorrelationsReduced.cxx | 1 - .../producerCharmHadronsTrackFemtoDream.cxx | 1 - .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 42 +- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 1 - PWGHF/HFL/Tasks/taskSingleElectron.cxx | 1 + PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 251 +- .../TableProducer/candidateCreator3Prong.cxx | 4 +- PWGHF/TableProducer/candidateCreatorDstar.cxx | 2 +- .../candidateCreatorXic0Omegac0Qa.cxx | 59 +- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 12 +- .../candidateSelectorToXiPiQa.cxx | 2 - .../derivedDataCreatorDplusToPiKPi.cxx | 5 +- .../derivedDataCreatorLcToK0sP.cxx | 1 + PWGHF/TableProducer/mcPidTof.cxx | 1 - PWGHF/TableProducer/pidCreator.cxx | 2 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 1 + .../treeCreatorSigmacCorrBkg.cxx | 1 - .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 11 +- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 166 +- 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/EMCALClusters.h | 5 +- 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/CMakeLists.txt | 4 - PWGJE/Tasks/bjetCentMult.cxx | 12 +- PWGJE/Tasks/bjetTaggingGnn.cxx | 25 +- PWGJE/Tasks/bjetTaggingML.cxx | 6 +- PWGJE/Tasks/bjetTreeCreator.cxx | 10 +- PWGJE/Tasks/chargedJetHadron.cxx | 403 +- 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 | 46 +- PWGJE/Tasks/jetBackgroundAnalysis.cxx | 2 +- PWGJE/Tasks/jetChCorr.cxx | 26 +- PWGJE/Tasks/jetChargedV2.cxx | 45 +- PWGJE/Tasks/jetCorrelationD0.cxx | 195 +- 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/jetFinderQA.cxx | 75 +- PWGJE/Tasks/jetFinderV0QA.cxx | 6 +- PWGJE/Tasks/jetFormationTimeReclustering.cxx | 18 +- PWGJE/Tasks/jetFragmentation.cxx | 1 + PWGJE/Tasks/jetHadronRecoil.cxx | 34 +- PWGJE/Tasks/jetLundPlane.cxx | 804 ---- PWGJE/Tasks/jetLundReclustering.cxx | 10 +- PWGJE/Tasks/jetMatchingQA.cxx | 4 +- PWGJE/Tasks/jetOutlierQA.cxx | 11 +- PWGJE/Tasks/jetPlanarFlow.cxx | 9 +- PWGJE/Tasks/jetShape.cxx | 202 +- PWGJE/Tasks/jetSpectraCharged.cxx | 26 +- PWGJE/Tasks/jetSpectraEseTask.cxx | 240 +- 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 | 54 +- PWGJE/Tasks/trackJetQA.cxx | 8 +- PWGJE/Tasks/triggerCorrelations.cxx | 6 +- PWGJE/Tasks/v0JetSpectra.cxx | 4 +- PWGJE/Tasks/v0QA.cxx | 7 +- PWGLF/DataModel/LFNonPromptCascadeTables.h | 29 +- PWGLF/DataModel/LFResonanceTables.h | 8 - PWGLF/DataModel/LFSigmaTables.h | 73 +- PWGLF/DataModel/LFStrangenessTables.h | 19 +- PWGLF/TableProducer/Common/zdcvector.cxx | 60 +- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 43 +- PWGLF/TableProducer/QC/nucleiQC.cxx | 148 +- .../Resonances/resonanceInitializer.cxx | 20 +- .../Resonances/resonanceModuleInitializer.cxx | 5 - .../TableProducer/Strangeness/CMakeLists.txt | 2 +- .../Strangeness/Converters/CMakeLists.txt | 5 - .../Converters/stracentconverter2.cxx | 44 - .../Strangeness/cascqaanalysis.cxx | 128 +- .../Strangeness/hStrangeCorrelationFilter.cxx | 8 +- .../Strangeness/sigma0builder.cxx | 931 +---- PWGLF/TableProducer/Strangeness/stracents.cxx | 9 +- .../Strangeness/strangederivedbuilder.cxx | 96 +- .../GlobalEventProperties/CMakeLists.txt | 9 +- .../PseudorapidityDensityMFT.cxx | 3004 ------------- .../GlobalEventProperties/dndeta-mft-pp.cxx | 1223 ++++++ .../GlobalEventProperties/flattenictyPikp.cxx | 1336 +++--- .../heavyionMultiplicity.cxx | 458 +- .../GlobalEventProperties/nchStudypp.cxx | 602 --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 96 +- PWGLF/Tasks/Nuspex/CMakeLists.txt | 14 +- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 37 +- PWGLF/Tasks/Nuspex/MultiplicityPt.cxx | 1481 +++++++ .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 1761 +++++--- PWGLF/Tasks/Nuspex/multiplicityPt.cxx | 837 ---- PWGLF/Tasks/QC/CMakeLists.txt | 2 +- PWGLF/Tasks/QC/v0cascadesqa.cxx | 1878 +++------ .../Tasks/Resonances/chargedkstaranalysis.cxx | 1367 +++--- PWGLF/Tasks/Resonances/kstarqa.cxx | 6 +- PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx | 162 +- .../Resonances/lambda1520analysisinpp.cxx | 340 +- PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx | 98 +- .../Tasks/Strangeness/cascpostprocessing.cxx | 2 - .../derivedlambdakzeroanalysis.cxx | 106 +- .../Tasks/Strangeness/derivedupcanalysis.cxx | 240 +- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 8 +- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 116 +- .../Strangeness/lambdaspincorrderived.cxx | 437 +- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 88 +- .../Strangeness/phiStrangeCorrelation.cxx | 254 +- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 413 +- PWGLF/Tasks/Strangeness/strangeCascTrack.cxx | 840 ++-- .../Strangeness/strangenessInJetsIons.cxx | 27 +- PWGMM/Lumi/Tasks/CMakeLists.txt | 5 - 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 | 151 +- PWGMM/Lumi/Tasks/lumiStabilityPP.cxx | 38 +- PWGMM/Lumi/Tasks/lumiZdcQa.cxx | 158 - 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 | 2867 ++++--------- 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 | 515 +-- 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 | 39 +- 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 | 87 +- 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 | 292 +- PWGUD/TableProducer/upcCandProducerMuon.cxx | 47 +- PWGUD/Tasks/CMakeLists.txt | 7 +- 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 | 52 +- PWGUD/Tasks/flowCumulantsUpc.cxx | 149 +- PWGUD/Tasks/flowMcUpc.cxx | 196 - 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 +- 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 - 869 files changed, 20803 insertions(+), 44231 deletions(-) delete mode 100644 DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx delete mode 100644 PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx delete mode 100644 PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx delete mode 100644 PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx mode change 100644 => 100755 PWGDQ/Macros/fit_library/ExpPdf.cxx mode change 100644 => 100755 PWGDQ/Macros/fit_library/ExpPdf.h mode change 100644 => 100755 PWGDQ/Macros/fit_library/GausPdf.cxx mode change 100644 => 100755 PWGDQ/Macros/fit_library/GausPdf.h mode change 100644 => 100755 PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx mode change 100644 => 100755 PWGDQ/Macros/fit_library/Pol4ExpPdf.h delete mode 100644 PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx delete mode 100644 PWGHF/D2H/Tasks/taskHiddenCharm.cxx delete mode 100644 PWGJE/Tasks/jetLundPlane.cxx delete mode 100644 PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx delete mode 100644 PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx create mode 100644 PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx delete mode 100644 PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx create mode 100644 PWGLF/Tasks/Nuspex/MultiplicityPt.cxx delete mode 100644 PWGLF/Tasks/Nuspex/multiplicityPt.cxx delete mode 100644 PWGMM/Lumi/Tasks/lumiZdcQa.cxx delete mode 100644 PWGUD/Tasks/flowMcUpc.cxx diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index f5a1b39a950..0ab7211d487 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" || "${{ github.event_name }}" == "pull_request" ]]; then + if [[ "${{ github.event_name }}" == "push" ]]; then branch_head="${{ github.ref }}" - branch_base="origin/${{ env.BRANCH_MAIN }}" + branch_base="${{ env.BRANCH_MAIN }}" else branch_head="refs/pull/${{ github.event.pull_request.number }}/merge" - branch_base="origin/${{ github.event.pull_request.base.ref }}" + branch_base="${{ github.event.pull_request.base.ref }}" fi echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV" echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV" @@ -37,10 +37,9 @@ 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 ${{ env.BRANCH_BASE }}...) + readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...) if [ ${#files[@]} -eq 0 ]; then echo "::notice::No files to lint." echo "linter_ran=0" >> "$GITHUB_OUTPUT" diff --git a/ALICE3/Core/Decayer.h b/ALICE3/Core/Decayer.h index bec6b9506d9..33696b19683 100644 --- a/ALICE3/Core/Decayer.h +++ b/ALICE3/Core/Decayer.h @@ -21,18 +21,18 @@ #include "ALICE3/Core/TrackUtilities.h" -#include -#include -#include +#include "ReconstructionDataFormats/Track.h" -#include // IWYU pragma: keep +#include +#include #include #include +#include #include #include #include -#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2LutWriter.cxx b/ALICE3/Core/DelphesO2LutWriter.cxx index c2df9431ef4..987383092ec 100644 --- a/ALICE3/Core/DelphesO2LutWriter.cxx +++ b/ALICE3/Core/DelphesO2LutWriter.cxx @@ -25,27 +25,14 @@ #include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.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 "TAxis.h" +#include "TDatabasePDG.h" +#include "TLorentzVector.h" +#include "TMatrixD.h" +#include "TMatrixDSymEigen.h" +#include "TVectorD.h" + #include -#include -#include #include // #define USE_FWD_PARAM diff --git a/ALICE3/Core/DelphesO2LutWriter.h b/ALICE3/Core/DelphesO2LutWriter.h index e234efd3bdb..1528ab80bac 100644 --- a/ALICE3/Core/DelphesO2LutWriter.h +++ b/ALICE3/Core/DelphesO2LutWriter.h @@ -23,13 +23,10 @@ #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/FastTracker.h" -#include +#include "ReconstructionDataFormats/PID.h" -#include +#include "TGraph.h" -#include - -#include #include namespace o2::fastsim diff --git a/ALICE3/Core/DelphesO2TrackSmearer.cxx b/ALICE3/Core/DelphesO2TrackSmearer.cxx index 7d7f6fc6077..7fca0dc19be 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.cxx +++ b/ALICE3/Core/DelphesO2TrackSmearer.cxx @@ -28,6 +28,12 @@ /// @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" @@ -35,11 +41,7 @@ #include #include -#include - -#include -#include -#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2TrackSmearer.h b/ALICE3/Core/DelphesO2TrackSmearer.h index 6d941f336ca..afb0c7690cf 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.h +++ b/ALICE3/Core/DelphesO2TrackSmearer.h @@ -27,14 +27,22 @@ #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 { @@ -146,6 +154,17 @@ 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 @@ -250,9 +269,10 @@ 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 d93fd77373f..2e72d641a2b 100644 --- a/ALICE3/Core/DetLayer.cxx +++ b/ALICE3/Core/DetLayer.cxx @@ -21,10 +21,8 @@ #include #include -#include -#include - #include +#include namespace o2::fastsim { diff --git a/ALICE3/Core/DetLayer.h b/ALICE3/Core/DetLayer.h index b3ed3ed6b34..32c5a839684 100644 --- a/ALICE3/Core/DetLayer.h +++ b/ALICE3/Core/DetLayer.h @@ -22,7 +22,6 @@ #include #include -#include #include namespace o2::fastsim diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index 254ab8d6643..be4ef7d2a12 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -11,37 +11,24 @@ #include "FastTracker.h" -#include "DetLayer.h" -#include "GeometryContainer.h" - -#include -#include -#include -#include -#include +#include "Common/Core/TableHelper.h" + #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 +#include #include +#include #include namespace o2 diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index d593c568fb9..d361e261603 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -16,14 +16,11 @@ #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 aee8e36ebd8..f58c9b80926 100644 --- a/ALICE3/Core/GeometryContainer.cxx +++ b/ALICE3/Core/GeometryContainer.cxx @@ -19,19 +19,13 @@ #include "Common/Core/TableHelper.h" -#include -#include -#include - #include #include -#include #include #include #include -#include #include #include #include @@ -41,7 +35,6 @@ #include #include -#include #include namespace o2::fastsim diff --git a/ALICE3/Core/GeometryContainer.h b/ALICE3/Core/GeometryContainer.h index d5892b5b97b..b3e9e23a538 100644 --- a/ALICE3/Core/GeometryContainer.h +++ b/ALICE3/Core/GeometryContainer.h @@ -18,6 +18,8 @@ #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 6d3bdd40383..ebd5247230b 100644 --- a/ALICE3/Core/TOFResoALICE3.cxx +++ b/ALICE3/Core/TOFResoALICE3.cxx @@ -18,10 +18,6 @@ #include "ALICE3/Core/TOFResoALICE3.h" -#include - -#include - namespace o2::pid::tof { diff --git a/ALICE3/Core/TOFResoALICE3.h b/ALICE3/Core/TOFResoALICE3.h index e392d120ecf..b102091f756 100644 --- a/ALICE3/Core/TOFResoALICE3.h +++ b/ALICE3/Core/TOFResoALICE3.h @@ -16,18 +16,14 @@ /// \brief Implementation for the TOF PID response of the expected times resolution /// -#ifndef ALICE3_CORE_TOFRESOALICE3_H_ -#define ALICE3_CORE_TOFRESOALICE3_H_ +#ifndef O2_ANALYSIS_PID_TOFRESOALICE3_H_ +#define O2_ANALYSIS_PID_TOFRESOALICE3_H_ -#include -#include - -#include - -#include -#include - -#include +// O2 includes +#include "PID/ParamBase.h" +#include "PID/DetectorResponse.h" +#include "PID/PIDTOF.h" +#include "ReconstructionDataFormats/PID.h" namespace o2::pid::tof { @@ -76,4 +72,4 @@ float TOFResoALICE3ParamTrack(const T& track, const Parameters& parameters) } // namespace o2::pid::tof -#endif // ALICE3_CORE_TOFRESOALICE3_H_ +#endif diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx index 739e1df28ae..c07fe145ccf 100644 --- a/ALICE3/Core/TrackUtilities.cxx +++ b/ALICE3/Core/TrackUtilities.cxx @@ -17,13 +17,6 @@ #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 d883a0d2dc8..edf92224edb 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 +#include "ReconstructionDataFormats/Track.h" -#include +#include "TLorentzVector.h" #include diff --git a/ALICE3/DataModel/A3DecayFinderTables.h b/ALICE3/DataModel/A3DecayFinderTables.h index bd9aa5592b3..f6e3eba8cc6 100644 --- a/ALICE3/DataModel/A3DecayFinderTables.h +++ b/ALICE3/DataModel/A3DecayFinderTables.h @@ -18,12 +18,11 @@ #ifndef ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ #define ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ +// O2 includes #include "Common/Core/RecoDecay.h" -#include - -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisDataModel.h" enum a3selectionBit : uint32_t { kDCAxy = 0, kInnerTOFPion, diff --git a/ALICE3/DataModel/ECAL.h b/ALICE3/DataModel/ECAL.h index 9ef1e8a3391..1e029d24174 100644 --- a/ALICE3/DataModel/ECAL.h +++ b/ALICE3/DataModel/ECAL.h @@ -16,10 +16,11 @@ /// \brief Set of tables for the ALICE3 ECAL information /// -#ifndef ALICE3_DATAMODEL_ECAL_H_ -#define ALICE3_DATAMODEL_ECAL_H_ +#ifndef O2_ANALYSIS_ALICE3_ECAL_H_ +#define O2_ANALYSIS_ALICE3_ECAL_H_ -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -52,4 +53,4 @@ using ECAL = ECALs::iterator; } // namespace o2::aod -#endif // ALICE3_DATAMODEL_ECAL_H_ +#endif // O2_ANALYSIS_ALICE3_ECAL_H_ diff --git a/ALICE3/DataModel/FTOF.h b/ALICE3/DataModel/FTOF.h index 3d047c21fd5..e24c1c0585d 100644 --- a/ALICE3/DataModel/FTOF.h +++ b/ALICE3/DataModel/FTOF.h @@ -16,10 +16,11 @@ /// \brief Set of tables for the ALICE3 FTOF information /// -#ifndef ALICE3_DATAMODEL_FTOF_H_ -#define ALICE3_DATAMODEL_FTOF_H_ +#ifndef O2_ANALYSIS_ALICE3_FTOF_H_ +#define O2_ANALYSIS_ALICE3_FTOF_H_ -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -60,4 +61,4 @@ using FTOF = FTOFs::iterator; } // namespace o2::aod -#endif // ALICE3_DATAMODEL_FTOF_H_ +#endif // O2_ANALYSIS_ALICE3_FTOF_H_ diff --git a/ALICE3/DataModel/MID.h b/ALICE3/DataModel/MID.h index 7357e689eda..7d932b90802 100644 --- a/ALICE3/DataModel/MID.h +++ b/ALICE3/DataModel/MID.h @@ -16,12 +16,11 @@ /// \brief Set of tables for the ALICE3 MID information /// -#ifndef ALICE3_DATAMODEL_MID_H_ -#define ALICE3_DATAMODEL_MID_H_ +#ifndef O2_ANALYSIS_ALICE3_MID_H_ +#define O2_ANALYSIS_ALICE3_MID_H_ -#include - -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -42,4 +41,4 @@ using MID = MIDs::iterator; } // namespace o2::aod -#endif // ALICE3_DATAMODEL_MID_H_ +#endif // O2_ANALYSIS_ALICE3_MID_H_ diff --git a/ALICE3/DataModel/OTFCollision.h b/ALICE3/DataModel/OTFCollision.h index e146515f89b..933bceab62c 100644 --- a/ALICE3/DataModel/OTFCollision.h +++ b/ALICE3/DataModel/OTFCollision.h @@ -19,7 +19,8 @@ #ifndef ALICE3_DATAMODEL_OTFCOLLISION_H_ #define ALICE3_DATAMODEL_OTFCOLLISION_H_ -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/OTFMCParticle.h b/ALICE3/DataModel/OTFMCParticle.h index 56a1400a2e9..987ed28b858 100644 --- a/ALICE3/DataModel/OTFMCParticle.h +++ b/ALICE3/DataModel/OTFMCParticle.h @@ -19,9 +19,8 @@ #ifndef ALICE3_DATAMODEL_OTFMCPARTICLE_H_ #define ALICE3_DATAMODEL_OTFMCPARTICLE_H_ -#include - -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -36,22 +35,16 @@ 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(McPartWithDaus, "McPartWithDaus", "AOD", "MCPARTSWITHDAU", +DECLARE_SOA_TABLE_FULL(McPartsWithDau, "McPartsWithDau", "AOD", "MCPARTSWITHDAU", o2::soa::Index<>, mcparticle::McCollisionId, mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags, - otfmcparticle::MothersIds, - otfmcparticle::DaughtersIdSlice, + mcparticle::MothersIds, + mcparticle::DaughtersIdSlice, mcparticle::Weight, mcparticle::Px, mcparticle::Py, @@ -76,18 +69,7 @@ DECLARE_SOA_TABLE_FULL(McPartWithDaus, "McPartWithDaus", "AOD", "MCPARTSWITHDAU" mcparticle::GetProcess, mcparticle::IsPhysicalPrimary); -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; +using McPartWithDau = McPartsWithDau::iterator; } // namespace o2::aod diff --git a/ALICE3/DataModel/OTFMulticharm.h b/ALICE3/DataModel/OTFMulticharm.h index 643d36c0adb..5c4224bdce5 100644 --- a/ALICE3/DataModel/OTFMulticharm.h +++ b/ALICE3/DataModel/OTFMulticharm.h @@ -20,9 +20,10 @@ #ifndef ALICE3_DATAMODEL_OTFMULTICHARM_H_ #define ALICE3_DATAMODEL_OTFMULTICHARM_H_ +// O2 includes #include "ALICE3/DataModel/OTFStrangeness.h" -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/OTFPIDTrk.h b/ALICE3/DataModel/OTFPIDTrk.h index c07a0d6579c..ce8a5d07a4f 100644 --- a/ALICE3/DataModel/OTFPIDTrk.h +++ b/ALICE3/DataModel/OTFPIDTrk.h @@ -20,10 +20,8 @@ #ifndef ALICE3_DATAMODEL_OTFPIDTRK_H_ #define ALICE3_DATAMODEL_OTFPIDTRK_H_ -#include -#include - -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/OTFRICH.h b/ALICE3/DataModel/OTFRICH.h index bcd42d585ed..05771dda57b 100644 --- a/ALICE3/DataModel/OTFRICH.h +++ b/ALICE3/DataModel/OTFRICH.h @@ -19,10 +19,8 @@ #ifndef ALICE3_DATAMODEL_OTFRICH_H_ #define ALICE3_DATAMODEL_OTFRICH_H_ -#include -#include - -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/OTFStrangeness.h b/ALICE3/DataModel/OTFStrangeness.h index 395f1ab8681..7ee5c862313 100644 --- a/ALICE3/DataModel/OTFStrangeness.h +++ b/ALICE3/DataModel/OTFStrangeness.h @@ -19,13 +19,10 @@ #ifndef ALICE3_DATAMODEL_OTFSTRANGENESS_H_ #define ALICE3_DATAMODEL_OTFSTRANGENESS_H_ +// O2 includes #include "Common/Core/RecoDecay.h" -#include -#include - -#include -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/OTFTOF.h b/ALICE3/DataModel/OTFTOF.h index b4bf1f26670..150efc91f5e 100644 --- a/ALICE3/DataModel/OTFTOF.h +++ b/ALICE3/DataModel/OTFTOF.h @@ -20,10 +20,8 @@ #ifndef ALICE3_DATAMODEL_OTFTOF_H_ #define ALICE3_DATAMODEL_OTFTOF_H_ -#include -#include - -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/RICH.h b/ALICE3/DataModel/RICH.h index a1fc7c7c692..ab670002078 100644 --- a/ALICE3/DataModel/RICH.h +++ b/ALICE3/DataModel/RICH.h @@ -16,11 +16,12 @@ /// \brief Set of tables for the ALICE3 RICH information /// -#ifndef ALICE3_DATAMODEL_RICH_H_ -#define ALICE3_DATAMODEL_RICH_H_ +#ifndef O2_ANALYSIS_ALICE3_RICH_H_ +#define O2_ANALYSIS_ALICE3_RICH_H_ -#include -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" +#include "ReconstructionDataFormats/PID.h" namespace o2::aod { @@ -175,4 +176,4 @@ using FRICH = FRICHs::iterator; } // namespace o2::aod -#endif // ALICE3_DATAMODEL_RICH_H_ +#endif // O2_ANALYSIS_ALICE3_RICH_H_ diff --git a/ALICE3/DataModel/collisionAlice3.h b/ALICE3/DataModel/collisionAlice3.h index a1238e9e1d9..ddb10ca9f1d 100644 --- a/ALICE3/DataModel/collisionAlice3.h +++ b/ALICE3/DataModel/collisionAlice3.h @@ -19,7 +19,8 @@ #ifndef ALICE3_DATAMODEL_COLLISIONALICE3_H_ #define ALICE3_DATAMODEL_COLLISIONALICE3_H_ -#include +// O2 includes +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/ALICE3/DataModel/tracksAlice3.h b/ALICE3/DataModel/tracksAlice3.h index 04cb2d1a9d4..6e03e5e68ba 100644 --- a/ALICE3/DataModel/tracksAlice3.h +++ b/ALICE3/DataModel/tracksAlice3.h @@ -19,8 +19,9 @@ #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 7c360634d37..24c7b479213 100644 --- a/ALICE3/ML/HfMlResponse3Prong.h +++ b/ALICE3/ML/HfMlResponse3Prong.h @@ -19,6 +19,8 @@ #include "Tools/ML/MlResponse.h" #include +#include +#include #include // Fill the map of available input features diff --git a/ALICE3/Macros/drawFastTracker.C b/ALICE3/Macros/drawFastTracker.C index 79978eac997..f15ebaacc68 100644 --- a/ALICE3/Macros/drawFastTracker.C +++ b/ALICE3/Macros/drawFastTracker.C @@ -14,8 +14,6 @@ #include #include -#include -#include #include #include @@ -23,16 +21,9 @@ #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 @@ -84,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); // FIXME + fastTracker.AddSiliconALICE3v4(pixelRes); } fastTracker.Print(); diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index 857ff416919..f9ec72e0765 100644 --- a/ALICE3/Macros/testFastTracker.C +++ b/ALICE3/Macros/testFastTracker.C @@ -15,9 +15,10 @@ #include "ALICE3/Core/FastTracker.h" -#include +#include +#include -#include +#include void testFastTracker(std::string geometryFile = "a3geo.ini") { @@ -27,7 +28,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); // FIXME + fastTracker.AddGenericDetector(geometryFile); // fastTracker.AddGenericDetector(geometryFile, &ccdb); fastTracker.Print(); } diff --git a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx index da4988d5648..366ffb6a290 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx @@ -20,30 +20,17 @@ #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 @@ -72,7 +59,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/onTheFlyDetectorGeometryProvider.cxx b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx index c4caf97f17a..293745458c9 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx @@ -16,23 +16,14 @@ /// \author Nicolò Jacazio , Universita del Piemonte Orientale (IT) /// -#include "GeometryContainer.h" +#include "ALICE3/Core/FastTracker.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 42c9a022fe6..c11327e9f03 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx @@ -30,41 +30,42 @@ /// \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 731bc940b5b..75e9d41d5c2 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx @@ -24,50 +24,44 @@ /// \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 0be208dbdb7..5989f9d3965 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -23,8 +23,6 @@ /// \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" @@ -37,73 +35,37 @@ #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; @@ -124,7 +86,6 @@ struct OnTheFlyTracker { Produces tableStoredTracksCov; Produces tableTracksCovExtension; Produces tableMcTrackLabels; - Produces tableMcTrackWithDauLabels; Produces tableTracksDCA; Produces tableTracksDCACov; Produces tableCollisionsAlice3; @@ -1872,7 +1833,7 @@ struct OnTheFlyTracker { } } - void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles, const int icfg) + void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartsWithDau 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) + "/"; @@ -2066,7 +2027,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()); - tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); + tableMcTrackLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2112,7 +2073,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()); - tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); + tableMcTrackLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2130,7 +2091,7 @@ struct OnTheFlyTracker { } } - void processDecayer(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles) + void processDecayer(aod::McCollision const& mcCollision, aod::McPartsWithDau const& mcParticles) { for (size_t icfg = 0; icfg < mSmearer.size(); ++icfg) { processConfigurationDev(mcCollision, mcParticles, static_cast(icfg)); diff --git a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx index fdb0e72afe2..78db04bba62 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx @@ -20,39 +20,43 @@ /// \since May 22, 2025 /// -#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/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 bc06a838697..48c7ae617bf 100644 --- a/ALICE3/TableProducer/alice3-centrality.cxx +++ b/ALICE3/TableProducer/alice3-centrality.cxx @@ -11,26 +11,13 @@ /// \author Nicolo' Jacazio , CERN /// \author David Dobrigkeit Chinellato , UNICAMP/CERN -#include "Common/DataModel/Centrality.h" +// 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 - -#include -#include - -#include -#include +#include "Common/DataModel/Centrality.h" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx index 0e27bec4476..b17216e9b76 100644 --- a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx +++ b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx @@ -14,26 +14,19 @@ /// /// \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/RecoDecay.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#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 using namespace o2; diff --git a/ALICE3/TableProducer/alice3-decayfinder.cxx b/ALICE3/TableProducer/alice3-decayfinder.cxx index f828ee5fbff..a78a2ce252c 100644 --- a/ALICE3/TableProducer/alice3-decayfinder.cxx +++ b/ALICE3/TableProducer/alice3-decayfinder.cxx @@ -21,36 +21,34 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#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 using namespace o2; @@ -66,8 +64,7 @@ using std::array; // #define bitcheck(var, nbit) ((var) & (static_cast(1) << (nbit))) // For MC association in pre-selection -using Alice3TracksWPid = soa::Join; -using Alice3TracksWTrkPid = soa::Join; +using Alice3TracksWPid = soa::Join; struct alice3decayFinder { SliceCache cache; @@ -186,17 +183,18 @@ 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); - Partition tracksPiMinusFromLc = + // partitions for Lc baryons + 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 +1066,7 @@ struct alice3decayFinder { void processFindLc(aod::Collision const& collision, aod::McParticles const& mcParticles, - Alice3TracksWTrkPid const& tracks) + Alice3TracksWPid const& tracks) { LOG(debug) << "Processing Lc candidates for collision " << collision.globalIndex() << " with " << tracks.size() << " tracks"; for (auto const& track : tracks) { diff --git a/ALICE3/TableProducer/alice3-decaypreselector.cxx b/ALICE3/TableProducer/alice3-decaypreselector.cxx index 3b138ad03b7..7c28a51d118 100644 --- a/ALICE3/TableProducer/alice3-decaypreselector.cxx +++ b/ALICE3/TableProducer/alice3-decaypreselector.cxx @@ -17,30 +17,43 @@ // 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 a6f36151732..9fdc1cd2953 100644 --- a/ALICE3/TableProducer/alice3-dq-table-maker.cxx +++ b/ALICE3/TableProducer/alice3-dq-table-maker.cxx @@ -22,35 +22,34 @@ #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/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.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 -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include +#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 diff --git a/ALICE3/TableProducer/alice3-trackextension.cxx b/ALICE3/TableProducer/alice3-trackextension.cxx index 384810ffdeb..578d1979310 100644 --- a/ALICE3/TableProducer/alice3-trackextension.cxx +++ b/ALICE3/TableProducer/alice3-trackextension.cxx @@ -13,16 +13,11 @@ // Task performing basic track selection for the ALICE3. // -#include "Common/Core/trackUtilities.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include -#include -#include -#include -#include - -#include +#include "Common/Core/trackUtilities.h" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-trackselection.cxx b/ALICE3/TableProducer/alice3-trackselection.cxx index 1a621f81df7..58f3a4f33ce 100644 --- a/ALICE3/TableProducer/alice3-trackselection.cxx +++ b/ALICE3/TableProducer/alice3-trackselection.cxx @@ -14,23 +14,11 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include +#include "Common/Core/trackUtilities.h" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx index 89c34ff1cf3..d075b56b0c9 100644 --- a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx @@ -16,9 +16,12 @@ #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" @@ -33,14 +36,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 7a97f1420ff..b74a75ad29b 100644 --- a/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx @@ -16,9 +16,14 @@ /// \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 @@ -27,9 +32,8 @@ #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 fd4a7a47881..16e0e9571c7 100644 --- a/ALICE3/TableProducer/alice3MulticharmFinder.cxx +++ b/ALICE3/TableProducer/alice3MulticharmFinder.cxx @@ -23,44 +23,40 @@ #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 -#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 "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 using namespace o2; diff --git a/ALICE3/TableProducer/alice3TrackingTranslator.cxx b/ALICE3/TableProducer/alice3TrackingTranslator.cxx index c68cb2adbe3..706d5cba462 100644 --- a/ALICE3/TableProducer/alice3TrackingTranslator.cxx +++ b/ALICE3/TableProducer/alice3TrackingTranslator.cxx @@ -24,29 +24,20 @@ #include #include #include -#include -#include #include -#include +#include #include #include +#include -#include #include #include -#include #include #include #include #include -#include - -#include -#include #include -#include -#include #include #include #include @@ -322,7 +313,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 e96db585c25..f2a60b5ab8c 100644 --- a/ALICE3/TableProducer/alice3strangenessFinder.cxx +++ b/ALICE3/TableProducer/alice3strangenessFinder.cxx @@ -22,7 +22,6 @@ #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" @@ -32,30 +31,18 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include +#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 @@ -65,10 +52,8 @@ using namespace o2::framework; using namespace o2::constants::physics; using Alice3TracksWPid = soa::Join; -using Alice3TracksACTS = soa::Join; -using Alice3TracksOTF = soa::Join; +using Alice3Tracks = soa::Join; using Alice3MCParticles = soa::Join; - struct Alice3strangenessFinder { SliceCache cache; @@ -84,13 +69,6 @@ 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"}; @@ -98,36 +76,26 @@ struct Alice3strangenessFinder { Configurable bachMinConstDCAz{"bachMinConstDCAz", -1.0f, "[0] in |DCAz| > [0]+[1]/pT"}; Configurable bachMinPtDepDCAz{"bachMinPtDepDCAz", 0.0, "[1] in |DCAz| > [0]+[1]/pT"}; - 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; - + // 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 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"}; @@ -140,32 +108,15 @@ struct Alice3strangenessFinder { Service pdgDB; - // partitions for v0/casc dau tracks - Partition positiveSecondaryTracksACTS = + // partitions for D mesons + Partition positiveSecondaryTracks = aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition negativeSecondaryTracksACTS = + Partition negativeSecondaryTracks = aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition bachelorTracksACTS = + Partition bachelorTracks = 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); @@ -188,18 +139,18 @@ struct Alice3strangenessFinder { { // Initialization code here fitter.setBz(magneticField); - 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.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.setMatCorrType(o2::base::Propagator::MatCorrType::USEMatCorrNONE); histos.add("hFitterQA", "", kTH1D, {{10, 0, 10}}); // For QA reasons, counting found candidates at different stages @@ -235,29 +186,14 @@ 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(); } @@ -270,34 +206,22 @@ struct Alice3strangenessFinder { template bool checkSameMother(TTrackType const& track1, TTrackType const& track2) { - // 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; - } + 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; } } } } - return returnValue; - } + } // end association check + return returnValue; } template @@ -323,13 +247,13 @@ struct Alice3strangenessFinder { histos.fill(HIST("hFitterStatusCode"), fitterStatusCode); histos.fill(HIST("hFitterQA"), 1.5); if (nCand == 0) { - LOG(debug) << "0 candidates found by fitter"; + LOG(info) << "0 candidates found by fitter"; return false; } histos.fill(HIST("hFitterQA"), 2.5); //}-{}-{}-{}-{}-{}-{}-{}-{}-{} if (!fitter.isPropagateTracksToVertexDone() && !fitter.propagateTracksToVertex()) { - LOG(debug) << "RejProp failed"; + LOG(info) << "RejProp failed"; return false; } histos.fill(HIST("hFitterQA"), 3.5); @@ -406,88 +330,40 @@ struct Alice3strangenessFinder { } } - void processGenerated(aod::McParticles const&) - { - 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) + void processFindV0CandidateNoPid(aod::Collision const& collision, Alice3Tracks const&, 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()}; + histos.fill(HIST("hEventCounter"), 1.0); - for (auto const& posTrack : posTracksGrouped) { + for (auto const& posTrack : positiveSecondaryTracksGrouped) { if (!posTrack.isReconstructed()) { continue; // no ghost tracks } o2::track::TrackParCov pos = getTrackParCov(posTrack); - for (auto const& negTrack : negTracksGrouped) { + for (auto const& negTrack : negativeSecondaryTracksGrouped) { if (!negTrack.isReconstructed()) { continue; // no ghost tracks } - histos.fill(HIST("hV0Building"), 1.0); if (mcSameMotherCheck && !checkSameMother(posTrack, negTrack)) { continue; // keep only if same mother } - - // 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); + if ((posTrack.pdgCode() != kPiPlus && negTrack.pdgCode() != kPiMinus) && isK0Gun) + continue; + if ((posTrack.pdgCode() != kProton && negTrack.pdgCode() != kPiMinus) && isLambdaGun) + continue; 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) { @@ -520,22 +396,19 @@ 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 : bachTracksGrouped) { + for (const auto& bachTrack : bachelorTracksGrouped) { 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 } @@ -544,8 +417,6 @@ struct Alice3strangenessFinder { continue; // only consider anti-lambda and pos bach track } - histos.fill(HIST("hCascadeBuilding"), 2.0); - // TODO mc same mother check Candidate cascCand; @@ -553,7 +424,6 @@ 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]}}, @@ -563,6 +433,12 @@ 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]); @@ -575,12 +451,6 @@ 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], @@ -591,11 +461,23 @@ 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&) { @@ -673,31 +555,13 @@ struct Alice3strangenessFinder { // auto secondaryProtonsGrouped = secondaryProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // auto secondaryAntiProtonsGrouped = secondaryAntiProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // } - - 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, processFindV0CandidateNoPid, "find V0 without PID", true); 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/ECALqa.cxx b/ALICE3/Tasks/ECALqa.cxx index 73a73ca32a3..5e337cefdbd 100644 --- a/ALICE3/Tasks/ECALqa.cxx +++ b/ALICE3/Tasks/ECALqa.cxx @@ -16,24 +16,16 @@ /// \brief Task to use the ALICE3 ECAL table /// +// O2 includes #include "ALICE3/DataModel/ECAL.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/PID.h" 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 6dc574189f2..c3c67e2efdb 100644 --- a/ALICE3/Tasks/alice3-cdeuteron.cxx +++ b/ALICE3/Tasks/alice3-cdeuteron.cxx @@ -12,30 +12,18 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include +#include "DCAFitter/DCAFitterN.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/PID.h" + +#include "TLorentzVector.h" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index 099e6205262..4ed9ee35a87 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -23,23 +23,13 @@ #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; diff --git a/ALICE3/Tasks/alice3-dq-efficiency.cxx b/ALICE3/Tasks/alice3-dq-efficiency.cxx index 99dcd281727..87b782e62cb 100644 --- a/ALICE3/Tasks/alice3-dq-efficiency.cxx +++ b/ALICE3/Tasks/alice3-dq-efficiency.cxx @@ -26,23 +26,26 @@ #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 -#include -#include -#include -#include -#include -#include -#include +#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 @@ -55,7 +58,6 @@ 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 de28c90583c..8b1fddb95df 100644 --- a/ALICE3/Tasks/alice3-lutmaker.cxx +++ b/ALICE3/Tasks/alice3-lutmaker.cxx @@ -13,28 +13,10 @@ /// \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 a5440ff8d53..b798209dfde 100644 --- a/ALICE3/Tasks/alice3-qa-multiplicity.cxx +++ b/ALICE3/Tasks/alice3-qa-multiplicity.cxx @@ -10,22 +10,12 @@ // 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 fcd3f92bbc9..70559fdd33c 100644 --- a/ALICE3/Tasks/alice3-qa-singleparticle.cxx +++ b/ALICE3/Tasks/alice3-qa-singleparticle.cxx @@ -15,29 +15,14 @@ /// \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 67ada10b571..b6c8058f747 100644 --- a/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx +++ b/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx @@ -14,26 +14,17 @@ /// /// \author Fabio Colamaria , INFN Bari -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/HFC/DataModel/CorrelationTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" - -#include "Common/Core/RecoDecay.h" - -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" -#include -#include +#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" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/alice3DecayerQa.cxx b/ALICE3/Tasks/alice3DecayerQa.cxx index cf1c369d17f..ea02c5cb29e 100644 --- a/ALICE3/Tasks/alice3DecayerQa.cxx +++ b/ALICE3/Tasks/alice3DecayerQa.cxx @@ -19,18 +19,16 @@ #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; @@ -62,11 +60,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 +123,7 @@ struct Alice3DecayerQA { } } - void processMCWithDau(const aod::McCollision&, const aod::McPartWithDaus& particles) + void processMCWithDau(const aod::McCollision&, const aod::McPartsWithDau& particles) { for (const auto& particle : trueElWithDau) { histos.fill(HIST("MCWithDau/hElPt"), particle.pt()); diff --git a/ALICE3/Tasks/alice3Efficiency.cxx b/ALICE3/Tasks/alice3Efficiency.cxx index bb44f33a6e2..7741ea24696 100644 --- a/ALICE3/Tasks/alice3Efficiency.cxx +++ b/ALICE3/Tasks/alice3Efficiency.cxx @@ -17,24 +17,16 @@ /// \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 4f21bada994..b962c368932 100644 --- a/ALICE3/Tasks/alice3HfTask3Prong.cxx +++ b/ALICE3/Tasks/alice3HfTask3Prong.cxx @@ -14,11 +14,16 @@ /// \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 @@ -28,12 +33,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 56689b48530..41ff2f2b38a 100644 --- a/ALICE3/Tasks/alice3Multicharm.cxx +++ b/ALICE3/Tasks/alice3Multicharm.cxx @@ -20,28 +20,43 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - +#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 using namespace o2; diff --git a/ALICE3/Tasks/alice3PidEvaluation.cxx b/ALICE3/Tasks/alice3PidEvaluation.cxx index 888b7a27dde..2ee64ea7623 100644 --- a/ALICE3/Tasks/alice3PidEvaluation.cxx +++ b/ALICE3/Tasks/alice3PidEvaluation.cxx @@ -23,24 +23,23 @@ #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#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 diff --git a/ALICE3/Tasks/alice3SeparationPower.cxx b/ALICE3/Tasks/alice3SeparationPower.cxx index 77f425d36d4..2c7a829f5bb 100644 --- a/ALICE3/Tasks/alice3SeparationPower.cxx +++ b/ALICE3/Tasks/alice3SeparationPower.cxx @@ -17,25 +17,21 @@ /// \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 7527db49495..3b539616fab 100644 --- a/ALICE3/Tasks/alice3Strangeness.cxx +++ b/ALICE3/Tasks/alice3Strangeness.cxx @@ -20,37 +20,44 @@ #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" +#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; 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; diff --git a/ALICE3/Tasks/alice3TrackingPerformance.cxx b/ALICE3/Tasks/alice3TrackingPerformance.cxx index fe903bf6176..a5958bab772 100644 --- a/ALICE3/Tasks/alice3TrackingPerformance.cxx +++ b/ALICE3/Tasks/alice3TrackingPerformance.cxx @@ -19,24 +19,14 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/ConfigParamRegistry.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" #include #include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/pidFTOFqa.cxx b/ALICE3/Tasks/pidFTOFqa.cxx index ba899e4dc85..52dbaf8dcfa 100644 --- a/ALICE3/Tasks/pidFTOFqa.cxx +++ b/ALICE3/Tasks/pidFTOFqa.cxx @@ -9,19 +9,14 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "Common/DataModel/TrackSelectionTables.h" using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/pidRICHqa.cxx b/ALICE3/Tasks/pidRICHqa.cxx index 4a420ffe34f..3a8a960b4ed 100644 --- a/ALICE3/Tasks/pidRICHqa.cxx +++ b/ALICE3/Tasks/pidRICHqa.cxx @@ -15,28 +15,12 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "ReconstructionDataFormats/PID.h" using namespace o2; using namespace o2::track; @@ -52,7 +36,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include +#include "Framework/runDataProcessing.h" namespace o2::aod { diff --git a/ALICE3/Utils/utilsHfAlice3.h b/ALICE3/Utils/utilsHfAlice3.h index 04d089f8a58..b0106f739e4 100644 --- a/ALICE3/Utils/utilsHfAlice3.h +++ b/ALICE3/Utils/utilsHfAlice3.h @@ -19,11 +19,6 @@ #include "PWGHF/Core/HfHelper.h" -#include "Common/Core/RecoDecay.h" - -#include -#include - namespace o2::analysis { diff --git a/CODEOWNERS b/CODEOWNERS index a24c1eefbb0..f2ea6f38a0b 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 @jokonig @hscheid -/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @feisenhu @hscheid @jokonig -/PWGEM/PhotonMeson @alibuild @mhemmer-cern @dsekihat @jokonig @hscheid @amaringarcia +/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 /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 diff --git a/Common/CCDB/macros/ctpRateF.C b/Common/CCDB/macros/ctpRateF.C index 7890033cb3a..32b93e4aa6b 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 cb137bacbfd..cafc863ab03 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 fcd79f0a491..27371aaf0e3 100644 --- a/Common/Core/macros/testMetadataHelper.C +++ b/Common/Core/macros/testMetadataHelper.C @@ -120,9 +120,8 @@ 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; diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 023282d5b12..5337d5ffd59 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -26,19 +26,20 @@ namespace o2::aod { namespace mult { -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, //! +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, //! [](float multFV0A, float multFV0C) -> float { return multFV0A + multFV0C; }); DECLARE_SOA_DYNAMIC_COLUMN(MultFT0M, multFT0M, //! [](float multFT0A, float multFT0C) -> float { return multFT0A + multFT0C; }); @@ -99,10 +100,6 @@ 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, @@ -129,11 +126,6 @@ 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/DataModel/PIDResponseTOF.h b/Common/DataModel/PIDResponseTOF.h index 212dfd8bf51..72007579e70 100644 --- a/Common/DataModel/PIDResponseTOF.h +++ b/Common/DataModel/PIDResponseTOF.h @@ -57,38 +57,33 @@ 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(); \ - } \ - LOGF(fatal, "%s %i (%s) is not available", #functionName, index, o2::track::PID::getName(index)); \ - return 0.f; \ +#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(); \ + } \ } perSpeciesWrapper(tofNSigma); perSpeciesWrapper(tofExpSigma); -perSpeciesWrapper(tofExpSignalDiff); -#undef perSpeciesWrapper - template auto tofExpSignal(const TrackType& track) { @@ -111,35 +106,10 @@ 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); -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; -} +#undef perSpeciesWrapper // PID index as function argument for TOF #define perSpeciesWrapper(functionName) \ @@ -191,9 +161,6 @@ auto tofExpTime(const TrackType& track) perSpeciesWrapper(tofNSigma); perSpeciesWrapper(tofExpSigma); -perSpeciesWrapper(tofExpSignalDiff); -#undef perSpeciesWrapper - template auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) { @@ -239,6 +206,9 @@ auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) return 0.f; } } +perSpeciesWrapper(tofExpSignalDiff); + +#undef perSpeciesWrapper } // namespace pidutils @@ -394,38 +364,6 @@ 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, \ @@ -455,43 +393,8 @@ 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; @@ -502,7 +405,6 @@ using TOFExpSigmaDynTr = pidtof::TOFExpSigmaTrImp; using TOFExpSigmaDynAl = pidtof::TOFExpSigmaAlImp; -using TOFNSigmaDyn = pidtof::TOFNSigmaImp; using TOFNSigmaDynEl = pidtof::TOFNSigmaElImp; using TOFNSigmaDynMu = pidtof::TOFNSigmaMuImp; using TOFNSigmaDynPi = pidtof::TOFNSigmaPiImp; diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 2b9ed353d6c..e4a99dedb88 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -20,7 +20,6 @@ #include "Common/DataModel/Multiplicity.h" #include -#include #include #include #include @@ -92,7 +91,6 @@ 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)"}; @@ -203,12 +201,8 @@ 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", "hFT0A_Collisions", kTH1D, {axisMultUltraFineFT0A}); + histos.add("hFT0A_Collisions", "hFT0C_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}); @@ -378,10 +372,6 @@ 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}}})}); @@ -618,7 +608,7 @@ struct centralityStudy { if (!passRejectCollInTimeRangeNarrow) { return; } - histos.fill(HIST("hCollisionSelection"), 14 /* Reject collision in narrow time range */); + histos.fill(HIST("hCollisionSelection"), 14 /* Not ITS ROF pileup (strict) */); getHist(TH1, histPath + "hCollisionSelection")->Fill(14); if (collision.multFT0C() < upcRejection.maxFT0CforZNACselection && @@ -637,18 +627,6 @@ 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); @@ -811,22 +789,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 94c9deec697..3fc13db0d7f 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 - kFITExtraMults, // standard + kFV0AOuterMults, // standard kFT0Mults, // standard kFDDMults, // standard kZDCMults, // standard @@ -191,8 +191,7 @@ struct products : o2::framework::ProducesGroup { //__________________________________________________ // multiplicity tables o2::framework::Produces tableFV0; - o2::framework::Produces tableFITExtraMults; - o2::framework::Produces tableFV0AOuterMults; + o2::framework::Produces tableFV0AOuter; o2::framework::Produces tableFT0; o2::framework::Produces tableFDD; o2::framework::Produces tableZDC; @@ -257,7 +256,6 @@ 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 @@ -707,7 +705,6 @@ class MultModule } if (collision.has_foundFT0()) { const auto& ft0 = collision.foundFT0(); - mults.fitTriggerMask = ft0.triggerMask(); for (const auto& amplitude : ft0.amplitudeA()) { mults.multFT0A += amplitude; } @@ -753,9 +750,8 @@ class MultModule if (internalOpts.mEnabledTables[kFV0Mults]) { cursors.tableFV0(mults.multFV0A, mults.multFV0C); } - if (internalOpts.mEnabledTables[kFITExtraMults]) { - cursors.tableFITExtraMults(mults.multFV0AOuter, mults.fitTriggerMask); - cursors.tableFV0AOuterMults(mults.multFV0AOuter); // Keep for backwards compatibility + if (internalOpts.mEnabledTables[kFV0AOuterMults]) { + cursors.tableFV0AOuter(mults.multFV0AOuter); } if (internalOpts.mEnabledTables[kFT0Mults]) { cursors.tableFT0(mults.multFT0A, mults.multFT0C); diff --git a/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx index 444406a6c42..c87fd48bc99 100644 --- a/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx +++ b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx @@ -14,29 +14,30 @@ /// /// \author Igor Altsybeev -#include "Common/CCDB/ctpRateFetcher.h" +#include +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.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/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "DataFormatsParameters/AggregatedRunInfo.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include "TH1F.h" +#include "TH2F.h" +#include "TH3.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx index a79bd82a5c3..3fc293c7e84 100644 --- a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx @@ -16,32 +16,27 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include +#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 diff --git a/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx index b85b1d3b42c..e87ca9c73f3 100644 --- a/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx +++ b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx @@ -15,28 +15,30 @@ /// \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 f03419fff52..35ef282650b 100644 --- a/DPG/Tasks/AOTEvent/lumiQa.cxx +++ b/DPG/Tasks/AOTEvent/lumiQa.cxx @@ -9,31 +9,17 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include -#include -#include +#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 -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include + +#include "TH1.h" +#include "TList.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/matchingQa.cxx b/DPG/Tasks/AOTEvent/matchingQa.cxx index 62bece530f7..3b266f047e9 100644 --- a/DPG/Tasks/AOTEvent/matchingQa.cxx +++ b/DPG/Tasks/AOTEvent/matchingQa.cxx @@ -9,34 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#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 +#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" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx index af9e0697922..cbc8d7d56d1 100644 --- a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx @@ -14,28 +14,21 @@ /// /// \author Igor Altsybeev -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #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" + using namespace o2; using namespace o2::framework; using namespace o2::aod::evsel; diff --git a/DPG/Tasks/AOTTrack/D0CalibTables.h b/DPG/Tasks/AOTTrack/D0CalibTables.h index 81e16201b63..973582d8ba2 100644 --- a/DPG/Tasks/AOTTrack/D0CalibTables.h +++ b/DPG/Tasks/AOTTrack/D0CalibTables.h @@ -16,14 +16,16 @@ #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 648c1258127..b8fb6679b1c 100644 --- a/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx +++ b/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx @@ -15,29 +15,12 @@ /// \brief Task performing basic checks on filter-bit selections. /// -#include "Common/Core/RecoDecay.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include +#include "Common/Core/RecoDecay.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/ASoA.h" 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 8ff792a860b..9b1d4f9c692 100644 --- a/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx +++ b/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx @@ -18,21 +18,19 @@ #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 -#include -#include -#include -#include -#include -#include - -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" 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 27451cff7e3..98ea08f7add 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx @@ -12,17 +12,10 @@ #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 50059151aab..5a1f821cda2 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx @@ -11,29 +11,31 @@ #include "tableHMPID.h" -#include +#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 - 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 1b6cea53ef5..f2865d65be9 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,10 +141,6 @@ 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++) { diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h b/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h index 6844da6c519..dff3a00ed4f 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx index 03dfe30779b..8b74a7beb77 100644 --- a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx +++ b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx @@ -20,30 +20,11 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt b/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt index 894163330df..87af80a68dd 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt +++ b/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt @@ -15,11 +15,6 @@ 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/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index bbe18f83730..95f9016d388 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -16,27 +16,15 @@ /// #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 "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" 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 2a9d59a71b0..a1461cb0509 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx @@ -16,24 +16,15 @@ /// #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 "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" 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 8a83649dbc7..2bcccc5a67b 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx @@ -16,26 +16,16 @@ /// #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/qaPIDTOFDynamic.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx deleted file mode 100644 index 67695354168..00000000000 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx +++ /dev/null @@ -1,822 +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. - -/// -/// \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/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; -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)}; -} diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx index c0b4e628fe2..b9ead03b14f 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx @@ -21,25 +21,15 @@ #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 "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" 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 d9ef9cd278b..3a0f2de652f 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx @@ -18,29 +18,10 @@ #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 cbc4084e922..53c03e6c338 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx @@ -20,25 +20,10 @@ #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 "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" 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 8ff86797176..e05023b4b3a 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx @@ -15,24 +15,13 @@ /// \brief Task to produce QA output of the PID with TPC running on the MC. /// +// O2 includes #include "Common/DataModel/PIDResponseTPC.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" 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 2c0501963b5..bf8492b8036 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx @@ -16,29 +16,12 @@ /// \brief Implementation for QA tasks of the TPC signal (lite task, refer to qaPIDTPC.cxx for full TPC QA for PID) /// -#include "Common/DataModel/EventSelection.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StaticFor.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 "Common/DataModel/EventSelection.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx index aa2f13ba744..1ab36ad9f71 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx @@ -20,12 +20,10 @@ #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" @@ -39,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -47,13 +44,15 @@ #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 be37adc3943..2513ad92a91 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx @@ -18,17 +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/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 "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx index ff6236ec9a9..a728b252007 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx @@ -17,26 +17,23 @@ /// 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" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include +// ROOT includes +#include "TPDGCode.h" +#include "TEfficiency.h" +#include "THashList.h" 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 2765e7e87d9..64b84711d90 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx @@ -11,24 +11,19 @@ #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 -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx index 33a4a2a9ed7..04db9d2fd1c 100644 --- a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx +++ b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx @@ -25,26 +25,18 @@ #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/OccupancyTables.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include -#include +#include "CommonDataFormat/InteractionRecord.h" #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include +#include #include #include #include @@ -54,12 +46,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 28b65bfa304..4054c59b33a 100644 --- a/DPG/Tasks/AOTTrack/qaDcaMC.cxx +++ b/DPG/Tasks/AOTTrack/qaDcaMC.cxx @@ -15,29 +15,23 @@ /// \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" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include +// ROOT includes +#include "TPDGCode.h" +#include "TEfficiency.h" +#include "THashList.h" using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaEventTrack.h b/DPG/Tasks/AOTTrack/qaEventTrack.h index edd9512c5ec..42cbe5455ca 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrack.h +++ b/DPG/Tasks/AOTTrack/qaEventTrack.h @@ -17,14 +17,10 @@ /// \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 - -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" // Output table declaration namespace o2::aod @@ -169,5 +165,3 @@ 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 61938e1d348..f6812f35a8e 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx @@ -20,34 +20,25 @@ #include "qaEventTrack.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include +#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" 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 8e41e7a24cc..2c2ab18a49d 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx @@ -19,27 +19,29 @@ #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 -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/DCA.h" -#include +#include "TRandom.h" -#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 b0dc3c553cc..4005b0834c9 100644 --- a/DPG/Tasks/AOTTrack/qaFakeHits.cxx +++ b/DPG/Tasks/AOTTrack/qaFakeHits.cxx @@ -16,26 +16,19 @@ /// \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 d34c897ac55..4b6d3e87d13 100644 --- a/DPG/Tasks/AOTTrack/qaMatchEff.cxx +++ b/DPG/Tasks/AOTTrack/qaMatchEff.cxx @@ -80,6 +80,7 @@ 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 2c1d251b710..dd66692a4e2 100644 --- a/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx +++ b/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx @@ -10,21 +10,18 @@ // or submit itself to any jurisdiction. /// \author Mattia Faggin , Padova University and INFN -#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 "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" using namespace o2::framework; using namespace o2; diff --git a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx index 1de78d081a2..e40dd0e76e9 100644 --- a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx +++ b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx @@ -16,19 +16,11 @@ /// \since 08/05/2024 /// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +// O2 includes +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx index 6cb389b8608..f7ea3dd2f53 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx @@ -16,27 +16,15 @@ /// \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/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelectionDefaults.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 680cb819b34..3125f1e7c03 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx @@ -15,28 +15,13 @@ /// \brief Task to analyse the numbers of particles reconstructed more than once /// -#include "TrackSelection.h" - -#include "Common/Core/TrackSelectionDefaults.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" #include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelectionDefaults.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 842f167d7d2..dd5a969e458 100644 --- a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx +++ b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx @@ -16,7 +16,6 @@ #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" @@ -27,39 +26,17 @@ #include "Common/DataModel/TrackSelectionTables.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 "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 diff --git a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx index b5f44d9c311..a5e6016d9fb 100644 --- a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx +++ b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx @@ -15,17 +15,21 @@ /// \author Alberto Caliva (alberto.caliva@cern.ch), Catalin-Lucian Ristea (catalin.ristea@cern.ch) /// \since September 9, 2025 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/DPG/Tasks/FDD/qaFDD.cxx b/DPG/Tasks/FDD/qaFDD.cxx index 96f4d31dcab..c985d7dbb9d 100644 --- a/DPG/Tasks/FDD/qaFDD.cxx +++ b/DPG/Tasks/FDD/qaFDD.cxx @@ -9,35 +9,21 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include +#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" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/FT0/qaFT0TrgBased.cxx b/DPG/Tasks/FT0/qaFT0TrgBased.cxx index c42b839087a..35a2c2cc884 100644 --- a/DPG/Tasks/FT0/qaFT0TrgBased.cxx +++ b/DPG/Tasks/FT0/qaFT0TrgBased.cxx @@ -13,29 +13,27 @@ /// \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 1e21e679f1a..295f981b0b7 100644 --- a/DPG/Tasks/FV0/qaFV0.cxx +++ b/DPG/Tasks/FV0/qaFV0.cxx @@ -13,27 +13,28 @@ /// \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 6a9ee148142..446a792e3f4 100644 --- a/DPG/Tasks/ITS/filterTracks.cxx +++ b/DPG/Tasks/ITS/filterTracks.cxx @@ -14,26 +14,22 @@ /// /// \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 -#include -#include -#include -#include -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include -#include -#include #include using namespace o2; diff --git a/DPG/Tasks/MFT/aQCMFTTracks.cxx b/DPG/Tasks/MFT/aQCMFTTracks.cxx index be34d97fe69..5b5f4a71aa4 100644 --- a/DPG/Tasks/MFT/aQCMFTTracks.cxx +++ b/DPG/Tasks/MFT/aQCMFTTracks.cxx @@ -16,17 +16,24 @@ /// \author David Grund /// \since -#include -#include -#include -#include -#include -#include -#include +#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 using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx index fc38e305938..5f285fcc2b4 100644 --- a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx +++ b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx @@ -12,16 +12,13 @@ /// \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; @@ -39,7 +36,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; @@ -87,4 +84,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 f3b6aed8ab8..950efc83e07 100644 --- a/DPG/Tasks/TOF/tofOfflineCalib.cxx +++ b/DPG/Tasks/TOF/tofOfflineCalib.cxx @@ -24,33 +24,9 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.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 "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx index 4fcdc3fb7cb..c61a3336982 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx @@ -20,24 +20,12 @@ #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 -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.h b/DPG/Tasks/TOF/tofSkimsTableCreator.h index f3a6f63bb9b..f1dd4ccfb3e 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.h +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.h @@ -23,9 +23,7 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx index 85607d41636..c91afe4734f 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx @@ -45,7 +45,6 @@ #include #include -#include #include #include diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.h b/DPG/Tasks/TPC/tpcSkimsTableCreator.h index 61017c27d1c..0d05ce33348 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.h @@ -20,6 +20,7 @@ #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 7d9ae11ea1b..a0871336051 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx @@ -18,27 +18,28 @@ #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 a9b7af27966..2af95cf2256 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.h +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.h @@ -17,9 +17,10 @@ #ifndef DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ #define DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ -#include +#include "Common/Core/trackUtilities.h" -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" enum ParticleSpecies { kPionTrack = BIT(0), diff --git a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h index 32c27233067..e32cee320fc 100644 --- a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h @@ -24,8 +24,6 @@ #include "Common/DataModel/OccupancyTables.h" -#include - #include #include diff --git a/EventFiltering/PWGCF/CFFilterAll.cxx b/EventFiltering/PWGCF/CFFilterAll.cxx index 3f2540f27b0..8e0bfe2e119 100644 --- a/EventFiltering/PWGCF/CFFilterAll.cxx +++ b/EventFiltering/PWGCF/CFFilterAll.cxx @@ -18,9 +18,7 @@ #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" @@ -28,35 +26,22 @@ #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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include -#include - -#include -#include -#include -#include +#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 diff --git a/EventFiltering/PWGEM/EMPhotonFilter.cxx b/EventFiltering/PWGEM/EMPhotonFilter.cxx index 7a78c6485b1..3e88524a89b 100644 --- a/EventFiltering/PWGEM/EMPhotonFilter.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilter.cxx @@ -14,29 +14,17 @@ #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 -#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 "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" using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx index d805ac673cf..de4d59f00da 100644 --- a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx @@ -12,31 +12,18 @@ // \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 "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" +#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" #include "EventFiltering/filterTables.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 +#include "Framework/HistogramRegistry.h" using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx index 763b3a70bb2..ff6a7f9e833 100644 --- a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx +++ b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx @@ -14,7 +14,6 @@ /// \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" @@ -45,7 +44,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include #include diff --git a/EventFiltering/PWGEM/globalDimuonFilter.cxx b/EventFiltering/PWGEM/globalDimuonFilter.cxx index be71fc72cd6..d58faa6fc3f 100644 --- a/EventFiltering/PWGEM/globalDimuonFilter.cxx +++ b/EventFiltering/PWGEM/globalDimuonFilter.cxx @@ -12,51 +12,37 @@ // \brief software trigger for global dimuons // \author daiki.sekihata@cern.ch -#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include -#include +#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 - using namespace o2; using namespace o2::soa; using namespace o2::aod; diff --git a/EventFiltering/PWGHF/H2fromLbFilter.cxx b/EventFiltering/PWGHF/H2fromLbFilter.cxx index 85fc65df1fa..f99e0f3cde7 100644 --- a/EventFiltering/PWGHF/H2fromLbFilter.cxx +++ b/EventFiltering/PWGHF/H2fromLbFilter.cxx @@ -16,7 +16,8 @@ #include "../filterTables.h" -#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" @@ -25,23 +26,20 @@ #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 "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 struct H2fromLbFilter { diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index aedd6d3c7ce..f13d9b685ff 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -19,7 +19,6 @@ /// \author Federica Zanone , Heidelberg University /// \author Antonio Palasciano , INFN Bari -#include "Common/CCDB/EventSelectionParams.h" #include "EventFiltering/PWGHF/HFFilterHelpers.h" #include "EventFiltering/filterTables.h" // @@ -302,7 +301,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 @@ -482,9 +481,6 @@ 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; @@ -531,6 +527,8 @@ 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 d215fb0df8d..fa577f33d6f 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) @@ -640,15 +640,6 @@ 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()); } diff --git a/EventFiltering/PWGJE/fullJetFilter.cxx b/EventFiltering/PWGJE/fullJetFilter.cxx index b47b9354eb3..25096b7bb7a 100644 --- a/EventFiltering/PWGJE/fullJetFilter.cxx +++ b/EventFiltering/PWGJE/fullJetFilter.cxx @@ -12,50 +12,35 @@ // Full Jet Filter // Author: Gijs van Weelden -#include "../filterTables.h" - -#include "PWGJE/DataModel/EMCALClusterDefinition.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetReducedData.h" - -#include "Common/CCDB/TriggerAliases.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 "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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/EMCALClusters.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/Core/FastJetUtilities.h" + +#include "../filterTables.h" using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGJE/jetFilter.cxx b/EventFiltering/PWGJE/jetFilter.cxx index d9f9f153333..47761d62c1e 100644 --- a/EventFiltering/PWGJE/jetFilter.cxx +++ b/EventFiltering/PWGJE/jetFilter.cxx @@ -13,23 +13,26 @@ #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 "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include + +#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 #include diff --git a/EventFiltering/PWGJE/jetHFFilter.cxx b/EventFiltering/PWGJE/jetHFFilter.cxx index f5a3aebdf40..6657e785751 100644 --- a/EventFiltering/PWGJE/jetHFFilter.cxx +++ b/EventFiltering/PWGJE/jetHFFilter.cxx @@ -11,24 +11,31 @@ // Author: Nima Zardoshti -#include "../filterTables.h" +#include +#include +#include -#include "PWGJE/DataModel/Jet.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 "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 "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 "../filterTables.h" + +#include "Framework/HistogramRegistry.h" using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGLF/filterdoublephi.cxx b/EventFiltering/PWGLF/filterdoublephi.cxx index ac4b0fe5327..7671402b5c5 100644 --- a/EventFiltering/PWGLF/filterdoublephi.cxx +++ b/EventFiltering/PWGLF/filterdoublephi.cxx @@ -16,30 +16,36 @@ #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 -#include -#include -#include +#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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include +#include +#include +#include //FIXME #include +#include // FIXME + +#include -#include +#include #include #include #include diff --git a/EventFiltering/PWGLF/filterf1proton.cxx b/EventFiltering/PWGLF/filterf1proton.cxx index 9d345cc9194..64fe2761e18 100644 --- a/EventFiltering/PWGLF/filterf1proton.cxx +++ b/EventFiltering/PWGLF/filterf1proton.cxx @@ -16,43 +16,44 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include +#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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#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 0a50f17cd0a..c336bf381c6 100644 --- a/EventFiltering/PWGLF/nucleiFilter.cxx +++ b/EventFiltering/PWGLF/nucleiFilter.cxx @@ -8,54 +8,41 @@ // 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 -#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 "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 diff --git a/EventFiltering/PWGLF/strangenessFilter.cxx b/EventFiltering/PWGLF/strangenessFilter.cxx index dde0d18f4c8..07e36121586 100644 --- a/EventFiltering/PWGLF/strangenessFilter.cxx +++ b/EventFiltering/PWGLF/strangenessFilter.cxx @@ -21,48 +21,33 @@ #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 -#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/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 using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGMM/multFilter.cxx b/EventFiltering/PWGMM/multFilter.cxx index 7ab341b4591..fe641438a43 100644 --- a/EventFiltering/PWGMM/multFilter.cxx +++ b/EventFiltering/PWGMM/multFilter.cxx @@ -8,42 +8,23 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include +#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 using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionBCFilter.cxx b/EventFiltering/PWGUD/diffractionBCFilter.cxx index a2c8f8c2ed9..c6ce85ec845 100644 --- a/EventFiltering/PWGUD/diffractionBCFilter.cxx +++ b/EventFiltering/PWGUD/diffractionBCFilter.cxx @@ -8,39 +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. +// O2 includes // // \brief A filter task for diffractive BCs // \author P. Buehler, paul.buehler@oeaw.ac.at // \since December, 2022 -#include "../filterTables.h" - +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "PWGUD/TableProducer/DGBCCandProducer.h" #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.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 +#include "../filterTables.h" using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionFilter.cxx b/EventFiltering/PWGUD/diffractionFilter.cxx index 946f95026e0..c5adfcf90c5 100644 --- a/EventFiltering/PWGUD/diffractionFilter.cxx +++ b/EventFiltering/PWGUD/diffractionFilter.cxx @@ -8,39 +8,20 @@ // 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 "../filterTables.h" - +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/StaticFor.h" +#include "Common/DataModel/EventSelection.h" #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.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 +#include "../filterTables.h" using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/cefpTask.cxx b/EventFiltering/cefpTask.cxx index eb64a60db54..64cf4435b85 100644 --- a/EventFiltering/cefpTask.cxx +++ b/EventFiltering/cefpTask.cxx @@ -8,47 +8,31 @@ // 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 "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 -#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" // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) @@ -59,7 +43,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/EventFiltering/filterTables.h b/EventFiltering/filterTables.h index cd4ad719297..c814c5d871f 100644 --- a/EventFiltering/filterTables.h +++ b/EventFiltering/filterTables.h @@ -8,19 +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. - #ifndef EVENTFILTERING_FILTERTABLES_H_ #define EVENTFILTERING_FILTERTABLES_H_ -#include - #include -#include -#include -#include -#include #include +#include #include +#include namespace o2::aod { @@ -28,6 +23,8 @@ template struct Hash; } +#include "Framework/ASoA.h" + namespace o2::soa { template diff --git a/EventFiltering/macros/cefpOutputChecker.C b/EventFiltering/macros/cefpOutputChecker.C index 48295a1746e..d053cedf866 100644 --- a/EventFiltering/macros/cefpOutputChecker.C +++ b/EventFiltering/macros/cefpOutputChecker.C @@ -8,16 +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. +// 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 413e223bdff..9bcc14981f4 100644 --- a/EventFiltering/macros/checkBCRange.C +++ b/EventFiltering/macros/checkBCRange.C @@ -8,21 +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 -#include - -#include -#include -#include +#include "CommonDataFormat/InteractionRecord.h" +#include "CommonDataFormat/IRFrame.h" using o2::InteractionRecord; using o2::dataformats::IRFrame; diff --git a/EventFiltering/macros/checkBCrangesSkimming.C b/EventFiltering/macros/checkBCrangesSkimming.C index db58d7d9848..f71212238c3 100644 --- a/EventFiltering/macros/checkBCrangesSkimming.C +++ b/EventFiltering/macros/checkBCrangesSkimming.C @@ -8,25 +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 -#include - +#include +#include +#include +#include #include #include #include #include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include "CommonDataFormat/InteractionRecord.h" +#include "CommonDataFormat/IRFrame.h" using o2::InteractionRecord; using o2::dataformats::IRFrame; @@ -194,7 +187,7 @@ std::string getRunNumber(std::string fileName) } // Detailed checks for specific trigger, not enabled by default -void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, std::string runNumber, std::string triggerLabel) +void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, string runNumber, string triggerLabel) { TH1D hTriggerCounter("hTriggerCounter", (runNumber + " " + triggerLabel + ";;Total number of trigger").data(), 2, -0.5, 1.5); @@ -335,7 +328,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) { - std::string runNumber = getRunNumber(originalFileName); + string runNumber = getRunNumber(originalFileName); if (useAlien) { TGrid::Connect("alien://"); AnaFileName = "alien://" + AnaFileName; @@ -372,7 +365,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) { - std::string runNumber = getRunNumber(originalFileName); + 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 a69f9d5d129..5496f303873 100644 --- a/EventFiltering/macros/checkSkimming.C +++ b/EventFiltering/macros/checkSkimming.C @@ -10,17 +10,15 @@ // 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) { @@ -131,4 +129,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 f1674d14539..02386a68870 100644 --- a/EventFiltering/macros/getMenu.C +++ b/EventFiltering/macros/getMenu.C @@ -9,20 +9,17 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include +#include "CCDB/BasicCCDBManager.h" #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 344101a0984..56215bcd3e6 100644 --- a/EventFiltering/macros/selectivityPlot.C +++ b/EventFiltering/macros/selectivityPlot.C @@ -9,20 +9,6 @@ // 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 b3c182e3c82..b38149dca42 100644 --- a/EventFiltering/macros/splitFile.C +++ b/EventFiltering/macros/splitFile.C @@ -8,14 +8,13 @@ // 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 +// O2 includes #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 b1703a6ba45..ec60c44ec0a 100644 --- a/EventFiltering/macros/uploadOTSobjects.C +++ b/EventFiltering/macros/uploadOTSobjects.C @@ -12,29 +12,22 @@ #include "Common/Core/ZorroHelper.h" -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/LHCConstants.h" -#include -#include -#include -#include -#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 constexpr uint32_t chunkSize = 1000000; diff --git a/EventFiltering/selectBCRange.cxx b/EventFiltering/selectBCRange.cxx index a52127fe32e..8a2d200e8e6 100644 --- a/EventFiltering/selectBCRange.cxx +++ b/EventFiltering/selectBCRange.cxx @@ -9,28 +9,15 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include "filterTables.h" using namespace o2; using namespace o2::framework; diff --git a/PWGCF/DataModel/CorrelationsDerived.h b/PWGCF/DataModel/CorrelationsDerived.h index dbe807c165d..8af9d7fef71 100644 --- a/PWGCF/DataModel/CorrelationsDerived.h +++ b/PWGCF/DataModel/CorrelationsDerived.h @@ -46,14 +46,6 @@ 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 @@ -165,8 +157,7 @@ enum ParticleDecay { LambdaToPPiTight, AntiLambdaToPiPLoose, AntiLambdaToPiPTight, - D0barToKPiExclusive, - PhiToKKPID3Mixed + D0barToKPiExclusive }; } // namespace cf2prongtrack DECLARE_SOA_TABLE(CF2ProngTracks, "AOD", "CF2PRONGTRACK", //! Reduced track table diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index a10cc46db09..b10c105e3c0 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -78,8 +78,3 @@ 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/nchCumulantsId.cxx b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx index 3cfea59e573..3f683b99589 100644 --- a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx @@ -20,7 +20,6 @@ #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" @@ -29,10 +28,7 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" -#include - #include -#include #include using namespace o2; @@ -41,59 +37,9 @@ 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; @@ -104,17 +50,6 @@ 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"}; @@ -166,60 +101,12 @@ 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 axisRapidity{200, -5, 5, "Rapidity (y)"}; - const AxisSpec axisPt{100, 0., 5., "p_{T} (GeV/c)"}; + const AxisSpec axisPt{100, 0., 3., "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}"}); @@ -236,16 +123,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(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"); + 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"); 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}}); @@ -266,8 +153,6 @@ 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}); @@ -337,137 +222,8 @@ 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, @@ -499,7 +255,7 @@ struct NchCumulantsId { qaEventPostSel, qaTracksPreSel, qaTracksPostSel, - qaTracksIdfd, + qaTracksIdfd }; static constexpr std::string_view HistRegDire[] = { @@ -509,14 +265,21 @@ struct NchCumulantsId { "QA/tracks/postSel/", "QA/tracks/Idfd/"}; - enum ProcessTypeEnum { - doDataProcessing = 0, - doRecoProcessing, - doPurityProcessing, - doGenProcessing, - doSimProcessing + enum PidEnum { + kPi = 0, // dont use kPion, kKaon, as these enumeration + kKa, // are already defined in $ROOTSYS/root/include/TPDGCode.h + kPr, + kEl, + kDe }; + static constexpr std::string_view PidDire[] = { + "Pi/", + "Ka/", + "Pr/", + "El/", + "De/"}; + // particle identifications // tpc Selections @@ -885,145 +648,10 @@ struct NchCumulantsId { fillIdentificationQA(hist, track); // Look at Proton } - 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 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; @@ -1036,639 +664,94 @@ 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; - template - void executeAnalysis(const C& collisions, const T& tracks) + void process(MyFilteredCol const& collisions, MyFilteredTracks const& tracks) { - 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); + 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++; + } + int idMethod; + // pion + if (selPion(track, idMethod)) { if (track.sign() == 1) { - // nP++; - nP += hPtEtaForEffCorrection[kCh][kPos]->GetBinContent(ptEtaBin); + nPi++; } if (track.sign() == -1) { - nM += hPtEtaForEffCorrection[kCh][kNeg]->GetBinContent(ptEtaBin); + nAPi++; } - 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); - } - // 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); + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); + } + // kaon + if (selKaon(track, idMethod)) { + if (track.sign() == 1) { + nKa++; } - // 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); + if (track.sign() == -1) { + nAKa++; } - } // track loop 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 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; + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } - 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; - } - - 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); + // proton + if (selProton(track, idMethod)) { + if (track.sign() == 1) { + nPr++; } - - 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; - } - } + if (track.sign() == -1) { + nAPr++; } - executeTrackAnalysisPart(track, trackIdTag, nP, nM, - idMethodPi, trackIsPion, nAPi, nPi, - idMethodKa, trackIsKaon, nAKa, nKa, - idMethodPr, trackIsProton, nPr, nAPr, recoAnalysis); - - } // 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; + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } - 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); - } - } + } // 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 - } - 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); + } // collision ends + } // process ends }; // structure ends WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx deleted file mode 100644 index c8d37967512..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx +++ /dev/null @@ -1,2994 +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. - -/// \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"}; - Configurable cfgEvSelkIsGoodZvtxFT0vsPV{"cfgEvSelkIsGoodZvtxFT0vsPV", false, "Apply kIsGoodZvtxFT0vsPV event selection"}; - 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", true); - - 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; - } - if (cfgEvSelkIsGoodZvtxFT0vsPV && !(collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) { - 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", true); - - 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; - } - - if (cfgEvSelkIsGoodZvtxFT0vsPV && !(coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) { - 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", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; - return workflow; -} diff --git a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx index eb5ec1866a7..fbb529fbb52 100644 --- a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -450,6 +449,236 @@ 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, @@ -551,180 +780,11 @@ struct PartNumFluc { Service pdg; Service ccdb; - 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; + HolderCcdb holderCcdb; + HolderMcEvent holderMcEvent; + HolderEvent holderEvent; + HolderMcParticle holderMcParticle; + HolderTrack holderTrack; std::unique_ptr fluctuationCalculatorTrackChP; std::unique_ptr fluctuationCalculatorTrackChM; @@ -755,8 +815,8 @@ struct PartNumFluc { HistogramRegistry hrCounter{"hrCounter", {}, OutputObjHandlingPolicy::AnalysisObject}; Filter filterCollision = (aod::evsel::sel8 == true); - Filter filterTrack = requireQualityTracksInFilter(); - Filter filterMcCollision = (aod::mccollisionprop::numRecoCollision > 0); + Filter filterfTrack = requireQualityTracksInFilter(); + Filter filterfMcCollision = (aod::mccollisionprop::numRecoCollision > 0); Preslice presliceTracksPerCollision = aod::track::collisionId; @@ -790,7 +850,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!"; } @@ -854,42 +914,6 @@ 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."; @@ -902,47 +926,157 @@ 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 = 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); + 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") << "\""; } } if (groupTrack.cfgFlagRecalibrationNSigmaPi.value || groupTrack.cfgFlagRecalibrationNSigmaKa.value || groupTrack.cfgFlagRecalibrationNSigmaPr.value) { - 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 = readListRunGroup(iRunGroup + 1); - for (const auto& [vectorH3, nameBase] : pairsVectorH3NameBase) { - (*vectorH3)[iRunGroup] = readH3(lRunGroup, nameBase, doprocessMc.value, iRunGroup + 1); - } - } - }; - if (groupTrack.cfgFlagRecalibrationNSigmaPi.value) { LOG(info) << "Enabling nSigmaPi recalibration."; - readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP, "hCentralityPtEtaShiftTpcNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM, "hCentralityPtEtaShiftTpcNSigmaPiM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP, "hCentralityPtEtaShiftTofNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM, "hCentralityPtEtaShiftTofNSigmaPiM"}}); + holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP.resize(nRunGroups); + holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM.resize(nRunGroups); + holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP.resize(nRunGroups); + holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM.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) << "!"; + } + 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.cfgFlagRecalibrationNSigmaKa.value) { LOG(info) << "Enabling nSigmaKa recalibration."; - readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP, "hCentralityPtEtaShiftTpcNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM, "hCentralityPtEtaShiftTpcNSigmaKaM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP, "hCentralityPtEtaShiftTofNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM, "hCentralityPtEtaShiftTofNSigmaKaM"}}); + 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(); + } } if (groupTrack.cfgFlagRecalibrationNSigmaPr.value) { LOG(info) << "Enabling nSigmaPr recalibration."; - readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP, "hCentralityPtEtaShiftTpcNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM, "hCentralityPtEtaShiftTpcNSigmaPrM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP, "hCentralityPtEtaShiftTofNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM, "hCentralityPtEtaShiftTofNSigmaPrM"}}); + 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(); + } } } @@ -1442,6 +1576,8 @@ 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"}}); @@ -1512,34 +1648,109 @@ struct PartNumFluc { hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrN", "", hcsFluctuationCalculator); } - const auto readHnEfficiency = [&](std::initializer_list*, const char*>> pairsVectorHnNameBase) { - for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { - vectorHn->resize(nRunGroups); - } + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP.resize(nRunGroups); + holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM.resize(nRunGroups); + holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP.resize(nRunGroups); + holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM.resize(nRunGroups); for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); - for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { - (*vectorHn)[iRunGroup] = readHn(lRunGroup, nameBase, false, iRunGroup + 1, 4); + 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.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) { - readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP, "hVzCentralityPtEtaEfficiencyTpcKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM, "hVzCentralityPtEtaEfficiencyTpcKaM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP, "hVzCentralityPtEtaEfficiencyTpcTofKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM, "hVzCentralityPtEtaEfficiencyTpcTofKaM"}}); + 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(); + } } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP, "hVzCentralityPtEtaEfficiencyTpcPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM, "hVzCentralityPtEtaEfficiencyTpcPrM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP, "hVzCentralityPtEtaEfficiencyTpcTofPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM, "hVzCentralityPtEtaEfficiencyTpcTofPrM"}}); + 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(); + } } } } template - double getEfficiency(const bool doUsingMcParticleMomentum) + double getEfficiency() { static_assert(particleSpecies == ParticleSpecies::kPi || particleSpecies == ParticleSpecies::kKa || particleSpecies == ParticleSpecies::kPr); static_assert(pidStrategy == PidStrategy::kTpc || pidStrategy == PidStrategy::kTpcTof); @@ -1551,7 +1762,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 ? (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.; + return hVzCentralityPtEtaEfficiency ? hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta}.data())) : 0.; } if (holderTrack.sign == 0) { @@ -1651,9 +1862,10 @@ struct PartNumFluc { return holderTrack.sign; } - bool isGoodMomentum(const bool doUsingMcParticleMomentum) + template + bool isGoodMomentum() { - if (doUsingMcParticleMomentum) { + if constexpr (doProcessingMc) { if (!(groupTrack.cfgCutMinPt.value < holderMcParticle.pt && holderMcParticle.pt < groupTrack.cfgCutMaxPt.value)) { return false; } @@ -1739,59 +1951,6 @@ 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) { @@ -2259,6 +2418,236 @@ 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) { @@ -2286,7 +2675,7 @@ struct PartNumFluc { return false; } - if (groupEvent.cfgFlagInelEventMc.value && !mcCollision.isInelGt0()) { + if (groupEvent.cfgFlagInelEvent.value && !mcCollision.isInelGt0()) { hrCounter.fill(HIST("hNMcEvents"), 3.); return false; } @@ -2663,8 +3052,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(true)) { - holderMcEvent.nChP++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChPMc++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); @@ -2677,8 +3066,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(true)) { - holderMcEvent.nChM++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChMMc++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); @@ -2691,14 +3080,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(true)) { - holderMcEvent.nChP++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChPMc++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { - holderMcEvent.nKaP++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { + holderEvent.nKaPMc++; fluctuationCalculatorTrackKaP->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(1., 1.); @@ -2711,14 +3100,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(true)) { - holderMcEvent.nChM++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChMMc++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { - holderMcEvent.nKaM++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { + holderEvent.nKaMMc++; fluctuationCalculatorTrackKaM->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(-1., 1.); @@ -2731,14 +3120,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(true)) { - holderMcEvent.nChP++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChPMc++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { - holderMcEvent.nPrP++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { + holderEvent.nPrPMc++; fluctuationCalculatorTrackPrP->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(1., 1.); @@ -2751,14 +3140,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(true)) { - holderMcEvent.nChM++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { + holderEvent.nChMMc++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { - holderMcEvent.nPrM++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { + holderEvent.nPrMMc++; fluctuationCalculatorTrackPrM->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(-1., 1.); @@ -2769,7 +3158,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderMcEvent.nChP, holderMcEvent.nChM); + 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)); @@ -2778,7 +3167,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderMcEvent.nKaP, holderMcEvent.nKaM); + 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)); @@ -2787,7 +3176,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderMcEvent.nPrP, holderMcEvent.nPrM); + 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)); @@ -3239,7 +3628,11 @@ struct PartNumFluc { } if ((groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) && (!groupTrack.cfgFlagMcParticlePhysicalPrimary.value || mcParticle.isPhysicalPrimary())) { - calculateFluctuation(); + if (groupTrack.cfgFlagMcParticleMomentum.value) { + calculateFluctuation(); + } else { + calculateFluctuation(); + } } } diff --git a/PWGCF/Femto/Core/baseSelection.h b/PWGCF/Femto/Core/baseSelection.h index 5bc9a598c1f..fcce0c11c13 100644 --- a/PWGCF/Femto/Core/baseSelection.h +++ b/PWGCF/Femto/Core/baseSelection.h @@ -18,11 +18,9 @@ #include "PWGCF/Femto/Core/selectionContainer.h" -#include -#include -#include +#include "Framework/HistogramRegistry.h" -#include +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index 2de7099ee6f..f787543f945 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 -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" + +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index d1218ec4e8e..3944dcd761a 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -20,17 +20,12 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include -#include -#include -#include -#include - -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include -#include #include #include #include diff --git a/PWGCF/Femto/Core/closePairRejection.h b/PWGCF/Femto/Core/closePairRejection.h index 3edc198aba9..63a707f9ad8 100644 --- a/PWGCF/Femto/Core/closePairRejection.h +++ b/PWGCF/Femto/Core/closePairRejection.h @@ -16,24 +16,20 @@ #ifndef PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ #define PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ -#include "PWGCF/Femto/Core/histManager.h" +#include "RecoDecay.h" -#include +#include "PWGCF/Femto/Core/histManager.h" -#include -#include -#include -#include -#include +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #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 dd1bd0182c0..5bb006e04ab 100644 --- a/PWGCF/Femto/Core/closeTripletRejection.h +++ b/PWGCF/Femto/Core/closeTripletRejection.h @@ -18,8 +18,8 @@ #include "PWGCF/Femto/Core/closePairRejection.h" -#include -#include +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include #include diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index e6b77102023..2d0aa6b532d 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 -#include -#include - -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Core/collisionHistManager.h b/PWGCF/Femto/Core/collisionHistManager.h index a4bbda81b6f..5233c4799e0 100644 --- a/PWGCF/Femto/Core/collisionHistManager.h +++ b/PWGCF/Femto/Core/collisionHistManager.h @@ -19,13 +19,11 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include -#include -#include +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include -#include -#include #include #include #include diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index 1da7fde8635..26e7649776d 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -16,19 +16,22 @@ #ifndef PWGCF_FEMTO_CORE_FEMTOUTILS_H_ #define PWGCF_FEMTO_CORE_FEMTOUTILS_H_ -#include +#include "Common/Core/TableHelper.h" -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/InitContext.h" -#include +#include "TPDGCode.h" + +#include "fairlogger/Logger.h" #include -#include #include +#include #include #include +#include namespace o2::analysis::femto { @@ -63,7 +66,7 @@ float itsSignal(T const& track) return static_cast(signal); }; -inline double getPdgMass(int pdgCode) +inline double getMass(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 +122,7 @@ inline double getPdgMass(int pdgCode) mass = o2::constants::physics::MassOmegaMinus; break; default: - LOG(warn) << "PDG code is not suppored. Return 0..."; + LOG(fatal) << "PDG code is not suppored"; } return mass; } @@ -206,16 +209,11 @@ inline bool enableTable(const char* tableName, int userSetting, o2::framework::I return required; } -// template -// using HasMass = decltype(std::declval().mass()); -// -// template -// using HasSign = decltype(std::declval().sign()); +template +using HasMass = decltype(std::declval().mass()); template -concept HasMass = requires(T t) { - { t.mass() } -> std::convertible_to; // or double, whatever mass() returns -}; +using HasSign = decltype(std::declval().sign()); template inline int signum(T x) diff --git a/PWGCF/Femto/Core/histManager.h b/PWGCF/Femto/Core/histManager.h index ceadf18f38a..19b1b0ce502 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 +#include "Framework/HistogramSpec.h" #include #include diff --git a/PWGCF/Femto/Core/kinkBuilder.h b/PWGCF/Femto/Core/kinkBuilder.h index 728197f049f..acf74690337 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 +#include "Common/Core/RecoDecay.h" -#include -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" + +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/kinkHistManager.h b/PWGCF/Femto/Core/kinkHistManager.h index b3f27e3f4e0..f6c672c3200 100644 --- a/PWGCF/Femto/Core/kinkHistManager.h +++ b/PWGCF/Femto/Core/kinkHistManager.h @@ -21,17 +21,12 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include -#include -#include -#include -#include - -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include -#include #include #include #include diff --git a/PWGCF/Femto/Core/mcBuilder.h b/PWGCF/Femto/Core/mcBuilder.h index 30f6210c027..038ad432df8 100644 --- a/PWGCF/Femto/Core/mcBuilder.h +++ b/PWGCF/Femto/Core/mcBuilder.h @@ -21,11 +21,10 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" -#include +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/modes.h b/PWGCF/Femto/Core/modes.h index 45c0db54f63..bf337fab232 100644 --- a/PWGCF/Femto/Core/modes.h +++ b/PWGCF/Femto/Core/modes.h @@ -118,6 +118,20 @@ 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 af6e9aa51bb..34c360f4943 100644 --- a/PWGCF/Femto/Core/pairBuilder.h +++ b/PWGCF/Femto/Core/pairBuilder.h @@ -30,11 +30,10 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" -#include +#include "fairlogger/Logger.h" #include #include @@ -597,28 +596,13 @@ 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, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); + mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); 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, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); + mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); mCprMe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); mPc.template init(confPairCuts); diff --git a/PWGCF/Femto/Core/pairCleaner.h b/PWGCF/Femto/Core/pairCleaner.h index 0d66be6721f..506a9dbc9a4 100644 --- a/PWGCF/Femto/Core/pairCleaner.h +++ b/PWGCF/Femto/Core/pairCleaner.h @@ -18,7 +18,7 @@ #include "PWGCF/Femto/Core/modes.h" -#include +#include "fairlogger/Logger.h" namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index 31efc4779a4..30c0916b67e 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -20,14 +20,12 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include -#include -#include -#include +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include +#include #include #include @@ -77,8 +75,6 @@ enum PairHist { kKstarVsMtVsMass1VsMass2VsPt1VsPt2, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, - // dalitz plots - kDalitz, // between a track and pos/neg daughter of another particle // mc kTrueKstarVsKstar, kTrueKtVsKt, @@ -110,7 +106,6 @@ 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)"}; @@ -124,7 +119,6 @@ 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"}; @@ -132,11 +126,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, 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::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::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)"}; }; @@ -177,21 +168,20 @@ 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 (%);"}, - {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};"}, + {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 (%)"}, {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})"}, @@ -199,36 +189,35 @@ 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}}, \ - {kDalitz, {conf.kstar, conf.dalitzMtot, conf.dalitzM12, conf.dalitzM13}}, +#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_MC_MAP(conf) \ {kTrueKstarVsKstar, {conf.kstar, conf.kstar}}, \ @@ -294,8 +283,6 @@ class PairHistManager { mHistogramRegistry = registry; - mUsePdgMass = ConfPairBinning.usePdgMass.value; - // flags for histograms mPlot1d = ConfPairBinning.plot1D.value; mPlot2d = ConfPairBinning.plot2D.value; @@ -314,8 +301,6 @@ class PairHistManager mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult.value; mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent.value; - mPlotDalitz = ConfPairBinning.plotDalitz.value; - // transverse mass type mMtType = static_cast(ConfPairBinning.transverseMassType.value); @@ -338,18 +323,8 @@ class PairHistManager void setMass(int PdgParticle1, int 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); + mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); + mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2) { @@ -358,37 +333,13 @@ class PairHistManager mAbsCharge2 = std::abs(chargeAbsParticle2); } - template - void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable) + template + void setPair(const T1& particle1, const T2& particle2) { - // 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(), mass1); - mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mass2); + mParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * particle1.pt(), particle1.eta(), particle1.phi(), mPdgMass1); + mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mPdgMass2); // set kT mKt = getKt(mParticle1, mParticle2); @@ -399,37 +350,36 @@ class PairHistManager // set kstar mKstar = getKstar(mParticle1, mParticle2); - 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(); - } + // 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)) { + mMass1 = particle1.mass(); + } + mMass2 = mPdgMass2; + if constexpr (modes::hasMass(particleType2)) { + mMass2 = particle2.mass(); } } - template - void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col) + template + void setPair(const T1& particle1, const T2& particle2, const T3& col) { - setPair(particle1, particle2, trackTable); + setPair(particle1, particle2); mMult = col.mult(); mCent = col.cent(); } - template - void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col1, T5 const& col2) + template + void setPair(const T1& particle1, const T2& particle2, const T3& col1, const T4& col2) { - setPair(particle1, particle2, trackTable); + setPair(particle1, particle2); 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(T1 const& particle1, T2 const& particle2, const T3& /*mcParticles*/) + void setPairMc(const T1& particle1, const T2& particle2, const T3& /*mcParticles*/) { if (!particle1.has_fMcParticle() || !particle2.has_fMcParticle()) { mHasMcPair = false; @@ -452,33 +402,33 @@ class PairHistManager mTrueKstar = getKstar(mTrueParticle1, mTrueParticle2); } - template - void setPairMc(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col, T6 const& /*mcCols*/) + template + void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col, const T5& /*mcCols*/) { - setPair(particle1, particle2, trackTable, col); + setPair(particle1, particle2, 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(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col1, T6 const& col2, T7 const& /*mcCols*/) + template + void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col1, const T5& col2, const T6& /*mcCols*/) { - setPair(particle1, particle2, trackTable, col1, col2); + setPair(particle1, particle2, 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()); } @@ -528,9 +478,17 @@ 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)}); - 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)}); + + // 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)}); + } } // higher dimensional histograms @@ -569,9 +527,6 @@ 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) @@ -604,9 +559,16 @@ 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, 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); + // // 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); + } } // n-D histograms are only filled if enabled @@ -628,25 +590,22 @@ 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, mRecoMass1, mRecoMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2, HistTable)), mKstar, mMt, mMass1, mMass2); } if (mPlotKstarVsMtVsMass1VsMass2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsMultVsCent) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult, mCent); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mMult, mCent); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt()); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt()); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent) { - 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); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); } } @@ -700,7 +659,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(part1); + auto particle1Prf = ROOT::Math::PtEtaPhiMVector(mParticle1); // 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* @@ -708,13 +667,8 @@ 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; @@ -722,16 +676,13 @@ class PairHistManager int mAbsCharge2 = 1; ROOT::Math::PtEtaPhiMVector mParticle1{}; ROOT::Math::PtEtaPhiMVector mParticle2{}; - float mRecoMass1 = 0.f; - float mRecoMass2 = 0.f; + float mMass1 = 0.f; + float mMass2 = 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{}; @@ -770,8 +721,6 @@ 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 9279921b00b..8a70283e9c6 100644 --- a/PWGCF/Femto/Core/pairProcessHelpers.h +++ b/PWGCF/Femto/Core/pairProcessHelpers.h @@ -19,9 +19,7 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include - -#include +#include "Framework/ASoAHelpers.h" namespace o2::analysis::femto { @@ -67,13 +65,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPair(p1, p2, TrackTable, Collision); + PairHistManager.setPair(p1, p2, Collision); break; case kOrder21: - PairHistManager.setPair(p2, p1, TrackTable, Collision); + PairHistManager.setPair(p2, p1, Collision); break; default: - PairHistManager.setPair(p1, p2, TrackTable, Collision); + PairHistManager.setPair(p1, p2, Collision); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -136,13 +134,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); break; case kOrder21: - PairHistManager.setPairMc(p2, p1, TrackTable, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p2, p1, mcParticles, Collision, mcCollisions); break; default: - PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -191,7 +189,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, TrackTable, Collision); + PairHistManager.setPair(p1, p2, Collision); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -260,7 +258,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -311,7 +309,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, TrackTable, collision1, collision2); + PairHistManager.setPair(p1, p2, collision1, collision2); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -380,7 +378,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, collision1, collision2, mcCollisions); + PairHistManager.setPairMc(p1, p2, mcParticles, collision1, collision2, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index 045f3dea785..8c158198192 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 +#include "Framework/Configurable.h" #include #include diff --git a/PWGCF/Femto/Core/partitions.h b/PWGCF/Femto/Core/partitions.h index 52f2d7bb135..ae2ee46a3f9 100644 --- a/PWGCF/Femto/Core/partitions.h +++ b/PWGCF/Femto/Core/partitions.h @@ -44,12 +44,6 @@ 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 fe5616f8302..d67819b6f8d 100644 --- a/PWGCF/Femto/Core/selectionContainer.h +++ b/PWGCF/Femto/Core/selectionContainer.h @@ -16,10 +16,11 @@ #ifndef PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ #define PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ -#include -#include +#include "CommonConstants/MathConstants.h" -#include +#include "TF1.h" + +#include "fairlogger/Logger.h" #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/PWGCF/Femto/Core/trackBuilder.h b/PWGCF/Femto/Core/trackBuilder.h index 7971c7fe34e..ffb5df80c37 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 -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" + +#include "fairlogger/Logger.h" #include #include @@ -143,8 +143,6 @@ 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"}; @@ -462,7 +460,6 @@ class TrackSelection : public BaseSelection producedTracks; - o2::framework::Produces producedTrackMass; o2::framework::Produces producedTrackMasks; o2::framework::Produces producedTrackDcas; o2::framework::Produces producedTrackExtras; @@ -479,7 +476,6 @@ 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)"}; @@ -505,7 +501,6 @@ 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); @@ -516,7 +511,7 @@ class TrackBuilder mProduceTritonPids = utils::enableTable("FTritonPids_001", table.produceTritonPids.value, initContext); mProduceHeliumPids = utils::enableTable("FHeliumPids_001", table.produceHeliumPids.value, initContext); - if (mProduceTracks || mProduceTrackMasks || mProduceTrackMass || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { + if (mProduceTracks || mProduceTrackMasks || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { mFillAnyTable = true; } else { LOG(info) << "No tables configured, Selection object will not be configured..."; @@ -565,9 +560,6 @@ class TrackBuilder trackProducts.producedTrackMasks(static_cast(0u)); } } - if (mProduceTrackMass) { - trackProducts.producedTrackMass(track.mass()); - } if (mProduceTrackDcas) { trackProducts.producedTrackDcas(track.dcaXY(), track.dcaZ()); } @@ -582,7 +574,8 @@ class TrackBuilder track.tpcNClsFound(), track.tpcNClsCrossedRows(), track.tpcNClsShared(), - track.beta()); + track.beta(), + track.mass()); } if (mProduceElectronPids) { trackProducts.producedElectronPids(track.itsNSigmaEl(), track.tpcNSigmaEl(), track.tofNSigmaEl()); @@ -677,7 +670,6 @@ 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 dbff8bb2dd1..a0eb858e07a 100644 --- a/PWGCF/Femto/Core/trackHistManager.h +++ b/PWGCF/Femto/Core/trackHistManager.h @@ -20,16 +20,14 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" -#include +#include "TH1.h" #include -#include #include #include #include @@ -47,7 +45,6 @@ enum TrackHist { kEta, kPhi, kSign, - kMass, // qa variables kPAtPv, kPTpc, @@ -148,7 +145,6 @@ 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"}; }; @@ -272,8 +268,7 @@ 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"}, - {kMass, o2::framework::kTH1F, "hMass", "Mass; m (GeV/#it{c}^{2}); Entries"}, + {kSign, o2::framework::kTH1F, "hSign", "Sign of charge ; Sign; 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"}, @@ -358,8 +353,7 @@ constexpr std::array, kTrackHistLast> {kPt, {conf.pt}}, \ {kEta, {conf.eta}}, \ {kPhi, {conf.phi}}, \ - {kSign, {conf.sign}}, \ - {kMass, {conf.mass}}, + {kSign, {conf.sign}}, #define TRACK_HIST_QA_MAP(confAnalysis, confQa) \ {kPAtPv, {confQa.p}}, \ @@ -643,7 +637,6 @@ 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) @@ -791,11 +784,6 @@ 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::getPdgMass(mPdgCode)); - } } template @@ -843,7 +831,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.mass()); + mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofMass, HistTable)), momentum, track.tofMass()); 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 1857f6a3996..26b618441f9 100644 --- a/PWGCF/Femto/Core/tripletBuilder.h +++ b/PWGCF/Femto/Core/tripletBuilder.h @@ -19,17 +19,16 @@ #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 -#include -#include +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" + +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/tripletCleaner.h b/PWGCF/Femto/Core/tripletCleaner.h index d6f38c78709..690c9d526b7 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/pairCleaner.h" +#include "PWGCF/Femto/Core/pairBuilder.h" namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index 672e9f68055..1af18cd8783 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 -#include -#include -#include +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include +#include +#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, 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::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::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)"}; }; @@ -252,9 +252,9 @@ class TripletHistManager void setMass(int PdgParticle1, int PdgParticle2, int PdgParticle3) { - mPdgMass1 = utils::getPdgMass(PdgParticle1); - mPdgMass2 = utils::getPdgMass(PdgParticle2); - mPdgMass3 = utils::getPdgMass(PdgParticle3); + mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); + mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); + mPdgMass3 = o2::analysis::femto::utils::getMass(PdgParticle3); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2, int chargeAbsParticle3) { @@ -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 (utils::HasMass) { + if constexpr (modes::hasMass(particleType1)) { mMass1 = particle1.mass(); } - if constexpr (utils::HasMass) { + if constexpr (modes::hasMass(particleType2)) { mMass2 = particle2.mass(); } - if constexpr (utils::HasMass) { + if constexpr (modes::hasMass(particleType3)) { mMass3 = particle3.mass(); } } diff --git a/PWGCF/Femto/Core/tripletProcessHelpers.h b/PWGCF/Femto/Core/tripletProcessHelpers.h index 75538ae024d..fc52c62da0e 100644 --- a/PWGCF/Femto/Core/tripletProcessHelpers.h +++ b/PWGCF/Femto/Core/tripletProcessHelpers.h @@ -19,9 +19,7 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include - -#include +#include "Framework/ASoAHelpers.h" namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h index 3a5aca2c5e6..9183527b890 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h +++ b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h @@ -16,6 +16,8 @@ #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" @@ -23,18 +25,15 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include +#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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h index de5317ff34c..7de7d7c3c04 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h +++ b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h @@ -20,14 +20,10 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include -#include -#include -#include -#include -#include - -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include #include diff --git a/PWGCF/Femto/Core/v0Builder.h b/PWGCF/Femto/Core/v0Builder.h index 91465cb99ab..16de0ea04cc 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 -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/AnalysisHelpers.h" +#include "Framework/Configurable.h" + +#include "fairlogger/Logger.h" #include #include diff --git a/PWGCF/Femto/Core/v0HistManager.h b/PWGCF/Femto/Core/v0HistManager.h index b6cb832579f..1fd7eba0b5c 100644 --- a/PWGCF/Femto/Core/v0HistManager.h +++ b/PWGCF/Femto/Core/v0HistManager.h @@ -20,17 +20,12 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include -#include -#include -#include -#include - -#include -#include +#include "CommonConstants/MathConstants.h" +#include "Framework/Configurable.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" #include -#include #include #include #include diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index 080e014ba30..4c890bdb4e6 100644 --- a/PWGCF/Femto/DataModel/FemtoTables.h +++ b/PWGCF/Femto/DataModel/FemtoTables.h @@ -18,13 +18,13 @@ #include "PWGCF/Femto/Core/dataTypes.h" -#include -#include -#include +#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 @@ -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, //! collision masks +DECLARE_SOA_TABLE_STAGED_VERSIONED(FColMasks_001, "FCOLMASK", 1, //! track masks femtocollisions::Mask); using FColMasks = FColMasks_001; using StoredFColMasks = StoredFColMasks_001; @@ -106,6 +106,7 @@ 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 @@ -174,7 +175,7 @@ DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //! Tpc chi2 // tof related information DECLARE_SOA_COLUMN(TofBeta, tofBeta, float); //! Tof beta -// tof mass will be stored in mass column +DECLARE_SOA_COLUMN(TofMass, tofMass, float); //! Tof mass // PID information // ITS PID information @@ -246,11 +247,6 @@ 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, @@ -271,6 +267,7 @@ 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; @@ -404,10 +401,9 @@ namespace femtov0s DECLARE_SOA_COLUMN(Mask, mask, femtodatatypes::V0MaskType); //! Bitmask for v0 selections // columns for debug information -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(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(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 @@ -451,7 +447,7 @@ using FLambdaMasks = FLambdaMasks_001; using StoredFLambdaMasks = StoredFLambdaMasks_001; DECLARE_SOA_TABLE_STAGED_VERSIONED(FLambdaExtras_001, "FLAMBDAEXTRA", 1, //! lambda extra information - femtov0s::MassAnti, // put mass of antiparticle, i.e. antilambda mass for lambdas and vice versa + femtobase::stored::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/FemtoNuclei/TableProducer/HadNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx index 71594142229..255f7674f1d 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx @@ -161,52 +161,56 @@ struct HadNucleiFemto { Produces mOutputHyperDataTable; Produces mOutputMultiplicityTable; - // Particle species configuration + // Selections 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 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 settingFillTable{"settingFillTable", false, "Enable table filling"}; 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 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 settingCutDeDCAzMin{"settingCutDeDCAzMin", 0.2f, "DCAxy Min for De"}; 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"}; - // 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 settingSaveUSandLS{"settingSaveUSandLS", true, "Save All Pairs"}; 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"}; @@ -233,6 +237,7 @@ struct HadNucleiFemto { // Pair hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache}; std::array mBBparamsDe; + std::vector mRecoCollisionIDs; std::vector mGoodCollisions; std::vector mTrackPairs; @@ -247,89 +252,68 @@ struct HadNucleiFemto { HistogramRegistry mQaRegistry{ "QA", - {// Event-level - {"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, + {{"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}}}}, - {"hNuEta", "eta distribution; #eta(Nu)", {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}}}}, + {"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}}}}, {"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}}}}, - {"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}}}}, + {"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}}}}, - // 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}}}}, - {"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 + {"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}}}}, {"hisBkgEM", "; isBkgEM;", {HistType::kTH1F, {{3, -1, 2}}}}}, OutputObjHandlingPolicy::AnalysisObject, false, @@ -517,12 +501,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 (std::abs(candidate.dcaXY()) > DeDCAxyMin || std::abs(candidate.dcaZ()) > DeDCAzMin) + if (abs(candidate.dcaXY()) > DeDCAxyMin || 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; @@ -568,11 +552,13 @@ struct HadNucleiFemto { template bool selectionPIDPion(const Ttrack& candidate) { - if (std::abs(candidate.dcaXY()) > settingCutHadDCAxyMin || std::abs(candidate.dcaZ()) > settingCutHadDCAzMin) + if (candidate.tpcChi2NCl() > settingCutChi2tpcHighPion || candidate.tpcChi2NCl() < settingCutChi2tpcLowPion || candidate.itsChi2NCl() > settingCutChi2NClITSPion) + return false; + if (abs(candidate.dcaXY()) > settingCutHadDCAxyMin || abs(candidate.dcaZ()) > settingCutHadDCAzMin) return false; auto tpcNSigmaPi = candidate.tpcNSigmaPi(); - mQaRegistry.fill(HIST("h2NsigmaHadTPC_preselection"), candidate.sign() * candidate.tpcInnerParam(), tpcNSigmaPi); + mQaRegistry.fill(HIST("h2NsigmaHadTPC_preselection"), candidate.tpcInnerParam(), tpcNSigmaPi); if (std::abs(candidate.pt()) < settingCutHadptMin || std::abs(candidate.pt()) > settingCutHadptMax) return false; // reject protons @@ -588,6 +574,9 @@ 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; } @@ -641,7 +630,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 (std::abs(candidate.dcaXY()) > DeDCAxyMin || std::abs(candidate.dcaZ()) > settingCutDeDCAzMin) + if (abs(candidate.dcaXY()) > DeDCAxyMin || abs(candidate.dcaXY()) > settingCutDeDCAzMin) return false; if (std::abs(tpcInnerParam) < settingCutPinMinDe) { @@ -661,7 +650,6 @@ 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; } @@ -682,6 +670,7 @@ 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; } @@ -776,6 +765,15 @@ 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(); @@ -793,7 +791,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(); @@ -864,6 +862,9 @@ 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()) { @@ -1103,29 +1104,33 @@ 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"), (std::abs(hadNucand.dcazNu) - settingCutDeDCAzMin)); + mQaRegistry.fill(HIST("hdcazNu_min"), (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); } } @@ -1353,74 +1358,6 @@ 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) diff --git a/PWGCF/Femto/TableProducer/femtoProducer.cxx b/PWGCF/Femto/TableProducer/femtoProducer.cxx index 8d47b4a3730..2bfe13acdbf 100644 --- a/PWGCF/Femto/TableProducer/femtoProducer.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducer.cxx @@ -24,24 +24,25 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx index 64a3ede4696..42fd008417c 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 -#include -#include -#include -#include -#include -#include +#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" using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx index f710e4ac194..e8642fe53a4 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx @@ -16,20 +16,11 @@ #include "PWGCF/Femto/Core/femtoUtils.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx index ea60ae07ab2..74bedd879d7 100644 --- a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx +++ b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx @@ -23,16 +23,15 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -51,7 +50,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 82ba5c380c8..fa1c977c494 100644 --- a/PWGCF/Femto/Tasks/femtoKinkQa.cxx +++ b/PWGCF/Femto/Tasks/femtoKinkQa.cxx @@ -25,16 +25,15 @@ #include "PWGCF/Femto/DataModel/FemtoTables.h" #include "PWGLF/DataModel/LFKinkDecayTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -55,7 +54,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 9430fa71eef..9181a00d20d 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx @@ -27,17 +27,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx index 2132de4073e..df79897eefc 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx @@ -28,17 +28,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx index deb7c1164d8..48c4fed92aa 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx @@ -25,17 +25,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -55,10 +54,7 @@ struct FemtoPairTrackTrack { using FemtoTracks = 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; + using FemtoTracksWithLabel = o2::soa::Join; o2::framework::SliceCache cache; @@ -80,12 +76,8 @@ struct FemtoPairTrackTrack { o2::framework::Partition trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Preslice perColtracks = o2::aod::femtobase::stored::fColId; - 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::Partition trackWithLabelPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1); + o2::framework::Partition trackWithLabelPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Preslice perColtracksWithLabel = o2::aod::femtobase::stored::fColId; // setup pairs @@ -116,10 +108,10 @@ struct FemtoPairTrackTrack { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventWithMass + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventWithMass + doprocessMixedEventMc) > 1) { + if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } - bool processData = doprocessSameEvent || doprocessMixedEvent || doprocessSameEventWithMass || doprocessMixedEventWithMass; + bool processData = doprocessSameEvent || doprocessMixedEvent; bool processMc = doprocessSameEventMc || doprocessMixedEventMc; if (processData && processMc) { LOG(fatal) << "Both data and mc processing is activated. Breaking..."; @@ -160,12 +152,6 @@ 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); @@ -178,12 +164,6 @@ 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 db7e18ba53b..1bf895ffb4f 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx index f112f60b973..f6891b3b670 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx @@ -27,17 +27,16 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx index 1cf6ffaf677..d1783be7075 100644 --- a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx @@ -26,17 +26,16 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoTrackQa.cxx b/PWGCF/Femto/Tasks/femtoTrackQa.cxx index 25916affb95..ca196b85185 100644 --- a/PWGCF/Femto/Tasks/femtoTrackQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTrackQa.cxx @@ -22,16 +22,14 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -49,7 +47,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 05dcdd5b153..8ab8dc46d2d 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx @@ -13,7 +13,6 @@ /// \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" @@ -25,17 +24,16 @@ #include "PWGCF/Femto/Core/tripletHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx index 370cee244a3..ccbe794f3c1 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx @@ -13,7 +13,6 @@ /// \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" @@ -27,17 +26,16 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -92,6 +90,7 @@ 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 5d2e3348c16..7faff356fd2 100644 --- a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx @@ -22,16 +22,17 @@ #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#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 @@ -52,7 +53,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 5ed29d305ba..a3587aaca95 100644 --- a/PWGCF/Femto/Tasks/femtoV0Qa.cxx +++ b/PWGCF/Femto/Tasks/femtoV0Qa.cxx @@ -23,16 +23,15 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 @@ -52,7 +51,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; diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 92ee2401b6a..3a7738b2cc1 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -50,8 +50,7 @@ class FemtoUniverseDetaDphiStar /// Destructor virtual ~FemtoUniverseDetaDphiStar() = default; /// Initialization of the histograms and setting required values - 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) + 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) { chosenRadii = lchosenradii; cutDeltaPhiStarMax = ldeltaphistarcutmax; @@ -67,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, {{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}}); + 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}}); - 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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } 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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -100,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -115,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -130,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -145,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -159,14 +158,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } @@ -174,22 +173,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, {{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}}); + 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}}); 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, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + 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}}); } } } } } - 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) + template + void init_kT(HistogramRegistry* registry, t1& ktbins, std::vector ldeltaphistarcutmin, std::vector ldeltaphistarcutmax, std::vector ldeltaetacutmin, std::vector ldeltaetacutmax) { mHistogramRegistry = registry; ktBins = ktbins; @@ -199,27 +198,16 @@ 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++) { 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, {{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}}); - } + 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}}); } } } @@ -655,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 IsDphiAvgOrDist, float lmagfield, float DistMax, float FracMax, bool filldEtadPhiTPCcls, float fPairTPCFracShared) + bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut) { /// Track-Track combination // check if provided particles are in agreement with the class instantiation @@ -675,11 +663,8 @@ 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]); @@ -687,92 +672,21 @@ 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."; } - 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 (((deta > DeltaEtaMin) && (deta < DeltaEtaMax)) && (distfrac > FracMax)) { - 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; - } - } - } - - /// 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)) { + 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; } else { if (ChosenEventType == femto_universe_container::EventType::same) { - histdetadphisameafterFractionkT[ktbinval]->Fill(deta, dphiAvg); + histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); } else if (ChosenEventType == femto_universe_container::EventType::mixed) { - histdetadphimixedafterFractionkT[ktbinval]->Fill(deta, dphiAvg); + 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."; } @@ -859,11 +773,6 @@ class FemtoUniverseDetaDphiStar std::vector cutDeltaEtaMaxVector; std::vector cutDeltaEtaMinVector; - std::vector cutDeltaPhiStarFractionMaxVector; - std::vector cutDeltaPhiStarFractionMinVector; - std::vector cutDeltaEtaFractionMaxVector; - std::vector cutDeltaEtaFractionMinVector; - float magfield; bool plotForEveryRadii = false; float cutPhiInvMassLow; @@ -877,14 +786,9 @@ 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{}; - std::array, 4> histdetadphiVsPairTPCFracSharedsamebefore{}; - std::array, 4> histdetadphiVsPairTPCFracSharedmixedbefore{}; - std::shared_ptr histdetadpiqlcmssame{}; std::shared_ptr histdetadpiqlcmsmixed{}; @@ -973,7 +877,7 @@ class FemtoUniverseDetaDphiStar badpoints++; } } - return (static_cast(badpoints) / static_cast(entries)); + return badpoints / entries; } // Get particle charge from mask diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 508cb8994c4..8a48e540c74 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& tempFitVarpTAxis) // 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, {{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}}); + 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}}); } 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,7 +238,6 @@ 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(); @@ -247,7 +246,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, tempFitVarpTAxis); } if (isMC) { init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h index 5bee5c8940b..63d9646cdde 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, std::size_t& counter) + void checkSelectionSetBit(selValDataType observable, T& cutContainer, 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)) { diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index d73fc6794e5..c4186b34d83 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 fillCorrBkgsD0{"fillCorrBkgsD0", false, "Flag to fill derived tables with correlated background candidates"}; + Configurable> classMlD0D0bar{"classMlD0D0bar", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; } ConfD0Selection; // PID bitmask configurables @@ -1835,10 +1835,8 @@ struct FemtoUniverseProducerTask { for (const auto& hfCand : hfCands) { - if (!ConfD0Selection.fillCorrBkgsD0) { - if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; - } + if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; } if (ConfD0Selection.useYCutD0Cand && std::abs(hfHelper.yD0(hfCand)) > ConfD0Selection.yD0CandMax) { @@ -1855,11 +1853,11 @@ struct FemtoUniverseProducerTask { auto arrayDaughters = std::array{postrack, negtrack}; indexMcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); - if (!ConfD0Selection.fillCorrBkgsD0 && !(indexMcRec > -1)) { + if (!(indexMcRec > -1)) { continue; } - if ((std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (ConfD0Selection.fillCorrBkgsD0 && hfCand.flagMcMatchRec() != 0)) { + if (std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { 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 865e4db500d..2f90a0c4e52 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", false, "Enable to check if TOF is available 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)"}; @@ -72,15 +72,8 @@ 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; + } ConfBothTracks; /// Lambda cuts Configurable confV0InvMassLowLimit{"confV0InvMassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; @@ -93,10 +86,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 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"}; + 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"}; // 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."}; @@ -251,7 +244,6 @@ struct FemtoUniverseEfficiencyBase { return true; } - // if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; @@ -494,50 +486,6 @@ 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)) { @@ -603,19 +551,13 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 2); - 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 (!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; + } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { @@ -662,19 +604,12 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 2); - 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; - } + 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; } - registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 9166d4dc0e7..6417529d529 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -58,6 +58,10 @@ 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"}; @@ -104,11 +108,6 @@ 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"}; @@ -153,7 +152,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseDetaDphiStar pairCloseRejectionCasc; - HistogramRegistry CascQAExtra{"CascQAExtra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rXiQA{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registryMCgen{"MCgenHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -201,24 +200,10 @@ struct femtoUniversePairTaskTrackCascadeExtended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom) { + if (mom <= confmom || hasTOF == 0) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } 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; + return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); } } @@ -264,23 +249,23 @@ struct femtoUniversePairTaskTrackCascadeExtended { AxisSpec multAxis = {multBinning, "Multiplicity"}; // Histograms - 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}}); + 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}}); eventHisto.init(&qaRegistry); /// nSigma debug histograms for the selected particle species only i.e. not sigmas of all particles mixed together @@ -339,9 +324,9 @@ struct femtoUniversePairTaskTrackCascadeExtended { pairCleanerCasc.init(&qaRegistry); if (confIsCPR.value) { if (doprocessSameEvent || doprocessSameEventBitmask || doprocessMixedEvent || doprocessMixedEventBitmask) - pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejectionCasc.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); } if (!confLocalEfficiency.value.empty()) { @@ -376,68 +361,44 @@ struct femtoUniversePairTaskTrackCascadeExtended { } } - 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) + void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs) { - auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - - // Basic particle loop - for (const auto& part : groupPartsTwo) { - CascQAExtra.fill(HIST("hMassXi"), part.mLambda()); + for (const auto& casc : fdcascs) { + const auto& part = casc.fdParticle_as(); + rXiQA.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()); - 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; - - 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(); - - 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; + 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(posChildExt, CascChildTable[confCascType1][0], &posChildTOFExt) || !isParticleTOF(negChildExt, CascChildTable[confCascType1][1], &negChildTOFExt) || !isParticleTOF(bachelorExt, CascChildTable[confCascType1][2], &bachelorTOFExt)) - continue; + if (!isParticleTOF(posChild, CascChildTable[confCascType1][0], &posChildTOF) || !isParticleTOF(negChild, CascChildTable[confCascType1][1], &negChildTOF) || !isParticleTOF(bachelor, CascChildTable[confCascType1][2], &bachelorTOF)) + 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()); - } + 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()); } } + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascadeQA, "Enable processing cascades", false); + + template + using hasSigma = decltype(std::declval().tpcNSigmaStorePr()); /// track - cascade correlations template @@ -498,7 +459,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { bachHistos.fillQABase(bachelor, HIST("hBachelor")); cascQAHistos.fillQA(part); } - CascQAExtra.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol); + rXiQA.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol); } for (const auto& part : groupPartsOne) { @@ -520,7 +481,10 @@ struct femtoUniversePairTaskTrackCascadeExtended { trackHistoPartOneNeg.fillQA(part); } } else { - if (!isNSigmaCombinedBitmask(part.p(), part)) { + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & (64u << confTrackChoicePartOne)) == 0) + continue; + } else if ((part.pidCut() & (1u << confTrackChoicePartOne)) == 0) { continue; } if (part.mAntiLambda() > 0) { @@ -540,7 +504,10 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if (!isNSigmaCombinedBitmask(p1.p(), p1)) { + if ((p1.pidCut() & 512u) != 0) { + if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) + continue; + } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { continue; } } @@ -581,12 +548,6 @@ 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); @@ -790,7 +751,10 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if (!isNSigmaCombinedBitmask(p1.p(), p1)) { + if ((p1.pidCut() & 512u) != 0) { + if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) + continue; + } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { continue; } } @@ -1204,7 +1168,10 @@ 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 (!isNSigmaCombinedBitmask(part.p(), part)) { + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & 64u) == 0) + continue; + } else if ((part.pidCut() & 1u) == 0) { continue; } } @@ -1218,7 +1185,10 @@ 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 (!isNSigmaCombinedBitmask(part.p(), part)) { + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & 64u) == 0) + continue; + } else if ((part.pidCut() & 1u) == 0) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 0311b48b560..12ea6f27d68 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -94,8 +94,6 @@ 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 @@ -560,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("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})"}}}); + 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}}}); @@ -626,7 +624,7 @@ struct FemtoUniversePairTaskTrackD0 { softPionRemoval.init(&qaRegistry); pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfBothTracks.confDeltaEtaAxis, ConfBothTracks.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDTrack = ConfTrack.confPIDTrack.value; @@ -1503,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("hMassVsPtD0ToPiKaPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0ToPiPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0ToPiPiPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); } } if (part.tpcNClsFound() == 0) { // prompt candidates @@ -1527,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("hMassVsPtD0barToPiKaPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0barToPiPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0barToPiPiPi"), part.mLambda(), part.pt(), weight); + 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("hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); } } if (part.tpcNClsFound() == 0) { // prompt candidates diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index b194a5aec31..e133de72efe 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -194,8 +194,6 @@ 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)"}; @@ -472,7 +470,7 @@ struct FemtoUniversePairTaskTrackNucleus { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRDeltaPhiCutMin.value, confCPRDeltaPhiCutMax.value, confCPRDeltaEtaCutMin.value, confCPRDeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 96f1b7ca865..98a697434ac 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -83,8 +83,6 @@ 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"}; @@ -482,7 +480,7 @@ struct FemtoUniversePairTaskTrackPhi { pairCleaner.init(&qaRegistry); if (ConfCPRIsEnabled) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, ConfCPRdeltaPhiCutMin, ConfCPRdeltaPhiCutMax, ConfCPRdeltaEtaCutMin, ConfCPRdeltaEtaCutMax, ConfCPRChosenRadii, ConfCPRPlotPerRadii, ConfCPRInvMassCutMin, ConfCPRInvMassCutMax); + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin, ConfCPRdeltaPhiCutMax, ConfCPRdeltaEtaCutMin, ConfCPRdeltaEtaCutMax, ConfCPRChosenRadii, ConfCPRPlotPerRadii, ConfCPRInvMassCutMin, ConfCPRInvMassCutMax); } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx index 6538be22a7f..e672064bd59 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx @@ -129,9 +129,6 @@ 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; @@ -168,7 +165,7 @@ struct FemtoUniversePairTaskTrackTrack { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 6a7bda27d00..5de02b3c346 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -78,8 +78,6 @@ 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; @@ -428,7 +426,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 559d308f63b..7760a8f2451 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx @@ -165,9 +165,6 @@ 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; @@ -339,7 +336,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { mixedEventCont.setPDGCodes(trackonefilter.confPDGCodePartOne, tracktwofilter.confPDGCodePartTwo); pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 62d856c8f7f..5cff8c72cf9 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx @@ -39,7 +39,6 @@ #include "TDatabasePDG.h" -#include #include using namespace o2; @@ -169,9 +168,6 @@ 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; @@ -392,7 +388,7 @@ struct femtoUniversePairTaskTrackTrackMC { pairCleaner.init(&qaRegistry); if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 cf31b851958..840f66fc56e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -189,9 +189,6 @@ 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; @@ -415,7 +412,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, 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 a1891f20ecf..f5a4409a2e7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -86,23 +86,16 @@ 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.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 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 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"}; - 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 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"}; @@ -112,37 +105,15 @@ 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"}; 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"}; - - 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"}; - - 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; // Filters for selecting particles (both p1 and p2) - Filter trackAdditionalfilter = ((nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax) && - (aod::track::dcaXY <= twotracksconfigs.confTrkDCAxyMax) && - (aod::track::dcaZ <= twotracksconfigs.confTrkDCAzMax) && - (aod::femtouniverseparticle::tpcNClsCrossedRows >= static_cast(twotracksconfigs.confTrkTPCcRowsMin)) && - (aod::femtouniverseparticle::tpcFractionSharedCls <= twotracksconfigs.confTrkTPCfracsClsMax) && - (aod::femtouniverseparticle::tpcNClsFound >= static_cast(twotracksconfigs.confTrkTPCnClsMin)) && - (aod::track::tpcNClsShared <= static_cast(twotracksconfigs.confTrkTPCsClsMax))); - + Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax); // example filtering on Configurable using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT using FemtoRecoParticles = soa::Join; @@ -499,8 +470,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { pairCleaner.init(&qaRegistry); if (twotracksconfigs.confIsCPR.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); + 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); } vPIDPartOne = trackonefilter.confPIDPartOne.value; @@ -571,23 +542,19 @@ 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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { - continue; - } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } 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(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { continue; } } @@ -618,11 +585,6 @@ 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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { - continue; - } - double rand; rand = randgen->Rndm(); @@ -635,22 +597,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, 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.confCPRDphiAvgOrDist)) { continue; } - if (twotracksconfigs.confIsCPRFraction) { - if (pairCloseRejection.isClosePairFractionkT(part1, part2, 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)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { continue; } } @@ -986,12 +943,6 @@ 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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { - continue; - } - double rand; rand = randgen->Rndm(); auto part1 = p1; @@ -1003,22 +954,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, 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.confCPRDphiAvgOrDist)) { continue; } - if (twotracksconfigs.confIsCPRFraction) { - if (pairCloseRejection.isClosePairFractionkT(part1, part2, 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)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 01e918cfe4e..283f9b463d0 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -176,8 +176,6 @@ 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 @@ -212,24 +210,10 @@ struct FemtoUniversePairTaskTrackV0Extended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom) { + if (mom <= confmom || hasTOF == 0) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } 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; + return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); } } @@ -389,8 +373,8 @@ struct FemtoUniversePairTaskTrackV0Extended { pairCleaner.init(&qaRegistry); pairCleanerV0.init(&qaRegistry); if (ConfCPR.confIsCPR.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); + 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); } if (!confLocalEfficiency.value.empty()) { @@ -504,8 +488,12 @@ struct FemtoUniversePairTaskTrackV0Extended { trackHistoPartOneNeg.fillQA(part); } } else { - if (!isNSigmaCombinedBitmask(part.p(), part)) + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) + continue; + } else if ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { continue; + } if (ConfTrkSelection.confChargePart1 > 0) trackHistoPartOnePos.fillQA(part); if (ConfTrkSelection.confChargePart1 < 0) @@ -523,8 +511,12 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if (!isNSigmaCombinedBitmask(p1.p(), p1)) + if ((p1.pidCut() & 512u) != 0) { + if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) + continue; + } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { continue; + } } // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { @@ -994,8 +986,12 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if (!isNSigmaCombinedBitmask(p1.p(), p1)) + if ((p1.pidCut() & 512u) != 0) { + if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) + continue; + } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { continue; + } } const auto& posChild = parts.iteratorAt(p2.globalIndex() - 2 - parts.begin().globalIndex()); @@ -1688,8 +1684,12 @@ 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 (!isNSigmaCombinedBitmask(part.p(), part)) + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & 64u) == 0) // 64 for proton combined + continue; + } else if ((part.pidCut() & 1u) == 0) { continue; + } } registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); @@ -1715,8 +1715,12 @@ 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 (!isNSigmaCombinedBitmask(part.p(), part)) + if ((part.pidCut() & 512u) != 0) { + if ((part.pidCut() & 64u) == 0) // 64 for proton combined + continue; + } else if ((part.pidCut() & 1u) == 0) { continue; + } } registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt()); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index ecb3e242b6f..afee000d7d6 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -111,7 +111,6 @@ 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 @@ -160,19 +159,12 @@ 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 + /// Helicity ranges (approximate) 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"}; - 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"}; @@ -226,17 +218,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { } } - bool invMLambda(float invMassLambda, float invMassAntiLambda, int V0Type) + bool invMLambda(float invMassLambda, float invMassAntiLambda) { - 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; - } + if ((invMassLambda < V0configs.confV0InvMassLowLimit || invMassLambda > V0configs.confV0InvMassUpLimit) && (invMassAntiLambda < V0configs.confV0InvMassLowLimit || invMassAntiLambda > V0configs.confV0InvMassUpLimit)) { + return false; } return true; } @@ -302,10 +287,6 @@ 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} (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}}}); @@ -414,8 +395,8 @@ struct FemtoUniversePairTaskTrackV0Helicity { pairCleaner.init(&qaRegistry); pairCleanerV0.init(&qaRegistry); if (confIsCPR.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); + 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); } if (!confLocalEfficiency.value.empty()) { @@ -446,7 +427,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type1)) + if (!invMLambda(part.mLambda(), part.mAntiLambda())) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -472,15 +453,6 @@ 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) { @@ -504,7 +476,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(), V0configs.confV0Type1)) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -545,7 +517,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; @@ -620,7 +592,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type2)) + if (!invMLambda(part.mLambda(), part.mAntiLambda())) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -641,10 +613,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) + if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) return; // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) return; // track cleaning if (!pairCleanerV0.isCleanPair(p1, p2, parts)) { @@ -801,7 +773,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut - if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type1)) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -843,7 +815,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; @@ -935,11 +907,11 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) { + if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) { continue; } // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) { + if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) { continue; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx index 520b910d497..739128780ea 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx @@ -81,8 +81,6 @@ 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"}; @@ -216,7 +214,7 @@ struct FemtoUniversePairTaskV0CascadeExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); } } diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 8dd974cf75f..9adde113460 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -230,9 +230,7 @@ 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}}}); @@ -308,16 +306,12 @@ 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/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/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/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}}); registry.add("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}}); @@ -1168,15 +1162,12 @@ struct ZdcQVectors { psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift)); if (cfgFillHistRegistry && !cfgFillNothing) { - 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); + 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); } double qXaShift = std::hypot(qRec[1], qRec[0]) * std::cos(psiZDCAshift); @@ -1187,10 +1178,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), 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); + 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]); } spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, isSelected, eventSelectionFlags); diff --git a/PWGCF/Flow/Tasks/flowEventPlane.cxx b/PWGCF/Flow/Tasks/flowEventPlane.cxx index 73d8d84904e..510ba5c5b89 100644 --- a/PWGCF/Flow/Tasks/flowEventPlane.cxx +++ b/PWGCF/Flow/Tasks/flowEventPlane.cxx @@ -355,70 +355,17 @@ struct SpectatorPlaneTableProducer { return true; } - // Load Gain Calibrations and ZDC Q-Vector Recentering Corrections - void loadCorrections() + void gainCalib(bool const& loadGainCalib, float const& vz, std::array& eA, std::array& eC) { - // Load ZDC gain calibration - if (cDoGainCalib) { + // Store gain calibration histograms per run number + if (loadGainCalib) { 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")); } - // 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) - { + // Apply gain calibration 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)); @@ -459,11 +406,12 @@ struct SpectatorPlaneTableProducer { return vAvgOutput; } - void applyCorrection(std::array const& inputParam, std::array& outputParam) + void applyCorrection(bool const& loadShiftCorr, 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) { @@ -479,6 +427,37 @@ 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); @@ -518,8 +497,8 @@ struct SpectatorPlaneTableProducer { histos.fill(HIST("CorrHist/hYZNCVsVz"), vCollParam[kVz], vSP[kYc]); } - template - bool analyzeCollision(B const& bc, C const& collision, std::array& vSP) + template + bool analyzeCollision(C const& collision, std::array& vSP) { // Event selection if (!selCollision(collision)) { @@ -536,6 +515,17 @@ 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; @@ -562,7 +552,7 @@ struct SpectatorPlaneTableProducer { // Do gain calibration if (cDoGainCalib) { - gainCalib(vCollParam[kVz], znaEnergy, zncEnergy); + gainCalib(loadGainCalib, vCollParam[kVz], znaEnergy, zncEnergy); } // Fill zdc signal @@ -609,7 +599,7 @@ struct SpectatorPlaneTableProducer { // Do corrections if (cApplyRecentCorr) { - applyCorrection(vCollParam, vSP); + applyCorrection(loadShiftCorr, vCollParam, vSP); } // Fill X and Y histograms for corrections after each iteration @@ -685,17 +675,9 @@ 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(bc, collision, vSP); + bool colSPExtFlag = analyzeCollision(collision, vSP); // Update run number lRunNum = cRunNum; @@ -888,7 +870,6 @@ 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}); @@ -1227,9 +1208,6 @@ 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 @@ -1238,9 +1216,6 @@ 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); } } } diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 2880cd75b7b..a323867eb6b 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -127,9 +127,8 @@ 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 < 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(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(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 @@ -155,11 +154,9 @@ 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 UnfilteredTracksPID = soa::Join; - using UnfilteredTracks = soa::Join; + using UnfilteredTracks = soa::Join; using UsedTracks = soa::Filtered; - using UsedTracksPID = soa::Filtered; using ZDCCollisions = soa::Filtered>; // For MC Reco and Gen @@ -233,8 +230,6 @@ struct FlowSP { double psiFull = 0; double trackPxA = 0; double trackPxC = 0; - double meanPxA = 0; - double meanPxC = 0; } spm; OutputObj fWeights{GFWWeights("weights")}; @@ -346,7 +341,6 @@ 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}"}; @@ -431,7 +425,6 @@ 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) { @@ -439,7 +432,7 @@ struct FlowSP { } } - if (doprocessData || doprocessMCReco || doprocessDataPID) { + if (doprocessData || doprocessMCReco) { if (cfgFillTrackQA) { histos.add("incl/QA/after/pt_phi", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); @@ -466,7 +459,7 @@ struct FlowSP { histos.addClone("incl/QA/after/", "incl/QA/before/"); } - if (cfgFillPIDQA && doprocessDataPID) { + if (cfgFillPIDQA) { histos.add("hPIDcounts", "", kTH2D, {{{4, 0, 4}, axisPt}}); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(1, "UFO"); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(2, "Pion"); @@ -506,10 +499,6 @@ 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}}); @@ -525,7 +514,6 @@ 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}); @@ -536,12 +524,8 @@ 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}); @@ -550,33 +534,41 @@ 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}); - 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 (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/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}); @@ -593,53 +585,21 @@ 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}); } - - } // end of doProcessData - - if (cfgFillChargeDependence || cfgFillChargeDependenceQA) { - LOGF(info, "Cloning charge dependence histograms"); + 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/"); 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}}); @@ -1001,12 +961,12 @@ struct FlowSP { if (track.dcaZ() > cfgTrackSelsDCAz) return false; - if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCAptConsMin + (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1)))) + if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1))) return false; histos.fill(HIST("hTrackCount"), trackSel_DCAz); - if (track.tpcNClsCrossedRows() < cfgTrackSelsNcls) + if (track.tpcNClsFound() < cfgTrackSelsNcls) return false; histos.fill(HIST("hTrackCount"), trackSel_NCls); @@ -1079,7 +1039,6 @@ 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; @@ -1089,18 +1048,10 @@ 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) { @@ -1128,18 +1079,6 @@ 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); } } @@ -1166,26 +1105,25 @@ 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.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("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("hMeanPtEta"), track.eta(), spm.centrality, track.pt(), spm.wacc[ct][par] * spm.weff[ct][par]); } template inline void fillPIDQA(TrackObject track) { - if (!cfgFillTrackQA) + if (!cfgFillPIDQA || !cfgFillTrackQA) return; - 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()); - } + + 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 @@ -1401,12 +1339,13 @@ struct FlowSP { TProfile* relPxCNeg = new TProfile("relPxCNeg", "relPxCNeg", 8, -0.8, 0.8); TProfile* relPxCPos = new TProfile("relPxCPos", "relPxCPos", 8, -0.8, 0.8); - double sumPxAEvent = 0; - int meanPxEventCount = 0; - double sumPxCEvent = 0; - for (const auto& track : tracks) { + ParticleType trackPID = (cfgFillPID || cfgFillPIDQA) ? getTrackPID(track) : kUnidentified; + + if (cfgFillPIDQA) + histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); + if (track.sign() == 0) continue; @@ -1416,6 +1355,21 @@ 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)) @@ -1465,6 +1419,21 @@ 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); @@ -1480,9 +1449,6 @@ 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) { @@ -1496,41 +1462,79 @@ 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))); - 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); + 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); if (spm.charge == kPositive) { - meanPTMapPos->Fill(track.eta(), track.pt(), weightPos); - relPxAPos->Fill(track.eta(), drelPxA, weightPos); - relPxCPos->Fill(track.eta(), drelPxC, weightPos); + 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); } if (spm.charge == kNegative) { - meanPTMapNeg->Fill(track.eta(), track.pt(), weightNeg); - relPxANeg->Fill(track.eta(), drelPxA, weightNeg); - relPxCNeg->Fill(track.eta(), drelPxC, weightNeg); + 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); } } // 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) { @@ -1552,14 +1556,11 @@ 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); - - 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); - } + 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); } } } @@ -1577,230 +1578,6 @@ 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(); diff --git a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx index 87f129a6b8f..fb868177af1 100644 --- a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx +++ b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx @@ -52,7 +52,6 @@ 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"}; @@ -121,21 +120,6 @@ 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 @@ -144,6 +128,9 @@ 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()) { @@ -167,7 +154,7 @@ struct flowZdcEnergy { // Helper: fill ZDC observables template - void fillZDCObservables(TCollision const& collision, float centrality, float multiTPC) + void fillZDCObservables(TCollision const& collision, float centrality) { const auto& foundBC = collision.template foundBC_as(); if (!foundBC.has_zdc()) { @@ -211,26 +198,11 @@ 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); } } @@ -250,7 +222,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, multiTPC); + fillZDCObservables(collision, centrality); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); @@ -274,7 +246,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, multiTPC); + fillZDCObservables(collision, centrality); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); diff --git a/PWGCF/GenericFramework/Core/FlowContainer.cxx b/PWGCF/GenericFramework/Core/FlowContainer.cxx index 338c6de9cf1..532eb35c80c 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 0e2e5f9e069..c540448709a 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -89,9 +89,7 @@ std::vector centbinning(90); int nBootstrap = 10; GFWRegions regions; GFWCorrConfigs configs; -GFWCorrConfigs configsV02; -GFWCorrConfigs configsV0; -std::vector> etagapsPtPt; +GFWCorrConfigs configsradial; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; std::vector multGlobalPVCorrCutPars; @@ -123,7 +121,6 @@ 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 { @@ -147,8 +144,6 @@ 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 { @@ -208,26 +203,17 @@ 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"); - 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"); + 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"}; 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 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"}; + 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"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; @@ -246,7 +232,10 @@ struct FlowGenericFramework { // Define output OutputObj fFC{FlowContainer("FlowContainer")}; - OutputObj fFCpt{FlowPtContainer("FlowPtContainer")}; + 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 fFCgen{FlowContainer("FlowContainer_gen")}; HistogramRegistry registry{"registry"}; @@ -256,6 +245,8 @@ 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; @@ -327,13 +318,6 @@ struct FlowGenericFramework { KAONS, PROTONS }; - enum ParticleIDs { - CHARGEDID, - PIONID, - KAONID, - PROTONID, - SPECIESCOUNT - }; enum OutputSpecies { K0 = 0, LAMBDA = 1, @@ -364,7 +348,7 @@ struct FlowGenericFramework { kUseV0Radius }; enum V0Selection { - kFillCandidate = 1, + kFillCandidate = 0, kFillDaughterPt, kFillMassCut, kFillRapidityCut, @@ -381,8 +365,7 @@ struct FlowGenericFramework { GFW* fGFW = new GFW(); std::vector corrconfigs; - std::vector corrconfigsV02; - std::vector corrconfigsV0; + std::vector corrconfigsradial; TRandom3* fRndm = new TRandom3(0); TAxis* fPtAxis; @@ -435,16 +418,11 @@ struct FlowGenericFramework { o2::analysis::gfw::configs.SetpTCorrMasks(cfgCorrConfig->GetpTCorrMasks()); o2::analysis::gfw::regions.Print(); o2::analysis::gfw::configs.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::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::ptbinning = cfgGFWBinning->GetPtBinning(); o2::analysis::gfw::ptpoilow = cfgGFWBinning->GetPtPOImin(); o2::analysis::gfw::ptpoiup = cfgGFWBinning->GetPtPOImax(); @@ -471,17 +449,7 @@ struct FlowGenericFramework { projectMatrix(cfgPIDCuts.nSigmas->getData(), tpcNsigmaCut, tofNsigmaCut, itsNsigmaCut); readMatrix(cfgPIDCuts.resonanceCuts->getData(), resoCutVals); 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); - } + 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)"}; @@ -604,7 +572,6 @@ 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"); @@ -635,7 +602,6 @@ 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"); @@ -663,22 +629,16 @@ 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::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 (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])); + 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])); } - if (corrconfigsV0.empty()) - LOGF(error, "Radial (V0) configuration contains vectors of different size - check the GFWCorrConfig configurable"); + if (corrconfigsradial.empty()) + LOGF(error, "Radial configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); addConfigObjectsToObjArray(oba, corrconfigs); - addConfigObjectsToObjArray(oba, corrconfigsV02); - addConfigObjectsToObjArray(oba, corrconfigsV0); + addConfigObjectsToObjArray(oba, corrconfigsradial); if (doprocessData || doprocessRun2 || doprocessMCReco) { fFC->SetName("FlowContainer"); @@ -691,11 +651,11 @@ struct FlowGenericFramework { fFCgen->Initialize(oba, multAxis, cfgNbootstrap); } delete oba; - - 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); + for (auto& container : fFCpts) { + container->setUseCentralMoments(cfgUseCentralMoments); + container->setUseGapMethod(cfgUseGapMethod); + container->initialise(multAxis, cfgMpar, o2::analysis::gfw::configs, cfgNbootstrap); + } // Multiplicity correlation cuts if (cfgMultCut) { @@ -768,7 +728,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()); @@ -895,7 +855,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"}; + 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) @@ -1029,7 +989,7 @@ struct FlowGenericFramework { th1sList[run][hEventSel]->Fill(kTVXinTRD); } // Cut on event selection flags - for (const auto& cut : eventcutflags) { + for (auto& cut : eventcutflags) { if (!cut.enabled) continue; if (!collision.selection_bit(cut.flag)) @@ -1127,7 +1087,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)); // o2-linter: disable=magic-number (hard coded default cuts) + return ((track.tpcNClsCrossedRows() >= 70) && (track.tpcNClsFound() >= 50) && (track.itsNCls() >= 5)); } enum DataType { @@ -1231,7 +1191,7 @@ struct FlowGenericFramework { } float total = 0; - unsigned int totaluncorr = 0; + unsigned int total_uncorr = 0; std::vector pidtotal; std::vector nch; @@ -1243,15 +1203,13 @@ struct FlowGenericFramework { template 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); - + for (auto container : fFCpts) { + container->calculateCorrelations(); + container->fillPtProfiles(centmult, rndm); + container->fillCMProfiles(centmult, rndm); + 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(); @@ -1261,7 +1219,9 @@ 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) { - fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); + for (auto container : fFCpts) { + container->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); + } } } continue; @@ -1275,20 +1235,20 @@ 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.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 (auto& vec : inputs) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) + for (const auto& vec : inputs) { fractions.emplace_back(); fractions.back().reserve(vec.size()); - double total = chtotal; + float total = chtotal; if (cfgUsePIDTotal) - total = (pidcounter) ? acceptedtracks.pidtotal[pidcounter - 1] : chtotal; + (pidcounter) ? acceptedtracks.pidtotal[pidcounter] : chtotal; if (total == 0.) { ++pidcounter; @@ -1299,7 +1259,6 @@ 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) @@ -1308,33 +1267,14 @@ 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 (corrconfigsV02.size() < SPECIESCOUNT) // - return; - - for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { + for (uint l_ind = 0; l_ind < 4; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; + 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", 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() < SPECIESCOUNT) - return; - 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) { - 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); + (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; @@ -1359,7 +1299,8 @@ struct FlowGenericFramework { th1sList[run][hCent]->Fill(centrality); } fGFW->Clear(); - fFCpt->clearVector(); + for (auto& container : fFCpts) + container->clearVector(); float lRandom = fRndm->Rndm(); // be cautious, this only works for Pb-Pb @@ -1402,75 +1343,57 @@ 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.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; - } + registry.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.total_uncorr); - if (!cfgFillWeights) - fillOutputContainers
((cfgUseNch) ? multiplicity : centrality, lRandom, acceptedTracks); - - std::vector> nptResonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); + std::vector> npt_resonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); // Process V0s for (const auto& v0 : v0s) { if (resoSwitchVals[K0][kUseParticle]) { - double weff = 1; - if (selectK0(collision, v0, centrality, weff)) { + 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.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) - nptResonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) - nptResonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) - nptResonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + 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]) { - double weff = 1.; - if (selectLambda(collision, v0, centrality, weff)) { + 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.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) - nptResonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) - nptResonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) - nptResonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + 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); } } } } - double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.totaluncorr; + float chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; // calculate fractions - std::vector> fractions_resonances = nptResonances; + std::vector> fractions_resonances = npt_resonances; int pidcounter = 0; - for (auto& vec : fractions_resonances) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) - double total = chtotal; + for (const auto& vec : fractions_resonances) { + float total = chtotal; if (cfgUsePIDTotal) - total = (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0.f) : chtotal; + (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0) : chtotal; if (total == 0.) { ++pidcounter; continue; } - std::transform(vec.begin(), vec.end(), vec.begin(), - [&](float x) { return x / total; }); + 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) @@ -1485,31 +1408,34 @@ 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 (uint l_ind = 4; l_ind < corrconfigsradial.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; + 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", 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); + (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); } } - - 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) { - 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 @@ -1532,11 +1458,9 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; - double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - if (weffCh > 0) - acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; - ++acceptedTracks.totaluncorr; + acceptedTracks.total += getEfficiency(track, 0); + ++acceptedTracks.total_uncorr; } if (!trackSelected(track, field)) @@ -1545,36 +1469,33 @@ struct FlowGenericFramework { int pidIndex = 0; if (cfgUsePID) { if (std::abs(mcParticle.pdgCode()) == kPiPlus) - pidIndex = PIONID; + pidIndex = 1; if (std::abs(mcParticle.pdgCode()) == kKPlus) - pidIndex = KAONID; + pidIndex = 2; if (std::abs(mcParticle.pdgCode()) == kProton) - pidIndex = PROTONID; + pidIndex = 3; } if (std::abs(track.eta()) < cfgEtaNch) { - double weff = getEfficiency(track, pidIndex); - - if (pidIndex && weff > 0) - acceptedTracks.pidtotal[pidIndex - 1] += weff; + 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()))) { - if (weffCh > 0) - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - if (pidIndex == PIONID && weff > 0) - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (pidIndex == KAONID && weff > 0) - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (pidIndex == PROTONID && weff > 0) - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + 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) { fillWeights(mcParticle, vtxz, 0, run); } else { - fillPtSums(track, vtxz); + fillPtSums(track, vtxz, pidIndex); fillGFW(mcParticle, vtxz, pidIndex, densitycorrections); } @@ -1607,7 +1528,7 @@ struct FlowGenericFramework { if (std::abs(track.eta()) < cfgEtaNch) { ++acceptedTracks.total; - ++acceptedTracks.totaluncorr; + ++acceptedTracks.total_uncorr; if (pidIndex) acceptedTracks.pidtotal[pidIndex - 1] += 1; @@ -1615,16 +1536,16 @@ struct FlowGenericFramework { if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { acceptedTracks.nch[ptBinIndex] += 1.0; - if (pidIndex == PIONID) + if (pidIndex == 1) acceptedTracks.npi[ptBinIndex] += 1.0; - if (pidIndex == KAONID) + if (pidIndex == 2) acceptedTracks.nka[ptBinIndex] += 1.0; - if (pidIndex == PROTONID) + if (pidIndex == 3) acceptedTracks.npr[ptBinIndex] += 1.0; } } - fillPtSums(track, vtxz); + fillPtSums(track, vtxz, pidIndex); fillGFW(track, vtxz, pidIndex, densitycorrections); if (cfgFillQA) @@ -1636,11 +1557,9 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; - double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - if (weffCh > 0) - acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; - ++acceptedTracks.totaluncorr; + acceptedTracks.total += getEfficiency(track, 0); + ++acceptedTracks.total_uncorr; } if (!trackSelected(track, field)) @@ -1650,23 +1569,23 @@ struct FlowGenericFramework { int pidIndex = getNsigmaPID(track); if (std::abs(track.eta()) < cfgEtaNch) { - double weff = getEfficiency(track, pidIndex); - if (pidIndex && weff > 0) - acceptedTracks.pidtotal[pidIndex - 1] += weff; + 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 (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (weffCh > 0) - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - if (pidIndex == PIONID && weff > 0) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; + if (pidIndex == 1) { + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; } - if (pidIndex == KAONID && weff > 0) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 2) { + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; } - if (pidIndex == PROTONID && weff > 0) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 3) { + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; } } } @@ -1674,7 +1593,7 @@ struct FlowGenericFramework { if (cfgFillWeights) { fillWeights(track, vtxz, pidIndex, run); } else { - fillPtSums(track, vtxz); + fillPtSums(track, vtxz, pidIndex); fillGFW(track, vtxz, pidIndex, densitycorrections); } if (cfgFillQA) { @@ -1713,18 +1632,14 @@ 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; } template - bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) + bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality) { - double massK0s = v0.mK0Short(); + double mass_K0s = v0.mK0Short(); auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); @@ -1733,7 +1648,7 @@ struct FlowGenericFramework { if (postrack.pt() < resoCutVals[K0][kPosTrackPt] || negtrack.pt() < resoCutVals[K0][kNegTrackPt]) return false; registry.fill(HIST("K0/hK0Count"), kFillDaughterPt); - if (massK0s < resoCutVals[K0][kMassMin] && massK0s > resoCutVals[K0][kMassMax]) + if (mass_K0s < resoCutVals[K0][kMassMin] && mass_K0s > resoCutVals[K0][kMassMax]) return false; registry.fill(HIST("K0/hK0Count"), kFillMassCut); // Rapidity correction @@ -1763,7 +1678,7 @@ struct FlowGenericFramework { return false; registry.fill(HIST("K0/hK0Count"), kFillDaughterTrackSelection); - registry.fill(HIST("K0/hK0Mass_sparse"), massK0s, v0.pt(), centrality); + 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()); @@ -1771,20 +1686,11 @@ 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 weffDaughter1 = getEfficiency(postrack, 1); - double weffDaughter2 = getEfficiency(negtrack, 1); - weff = weffDaughter1 * weffDaughter2; - if (weff > 0) - registry.fill(HIST("K0/hK0s_corrected"), weff); - } - return true; } template - bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) + bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality) { bool isL = false; // Is lambda candidate bool isAL = false; // Is anti-lambda candidate @@ -1858,15 +1764,6 @@ 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 weffDaughter1 = getEfficiency(postrack, 3); - double weffDaughter2 = getEfficiency(negtrack, 1); - weff = weffDaughter1 * weffDaughter2; - if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), weff); - } } if (isAL) { registry.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); @@ -1876,44 +1773,27 @@ 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 weffDaughter1 = getEfficiency(postrack, 1); - double weffDaughter2 = getEfficiency(negtrack, 3); - weff = weffDaughter1 * weffDaughter2; - if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), weff); - } } return true; } template - inline void fillPtSums(TTrack track, const double& vtxz) + inline void fillPtSums(TTrack track, const double& vtxz, const int pidIndex) { double wacc = (dt == kGen) ? 1. : getAcceptance(track, vtxz, 0); 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 (std::abs(track.eta()) < cfgEtaPtPt) { + fFCpt_ch->fill(weff, track.pt()); + if (pidIndex) + fFCpts[pidIndex]->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->fillArray(q2p, q2n, weff * track.pt(), weff); - fFCpt->fillArray(weff * wacc, weff * wacc, weff, weff); + fFCpt_ch->fillArray(q2p, q2n, weff * track.pt(), weff); + fFCpt_ch->fillArray(weff * wacc, weff * wacc, weff, weff); } } @@ -1928,22 +1808,25 @@ 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); @@ -2107,7 +1990,7 @@ struct FlowGenericFramework { registry.fill(HIST("eventQA/after/multiplicity"), tracks.size()); // Get magnetic field polarity - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, v0s, centrality, field, run); } @@ -2157,7 +2040,7 @@ struct FlowGenericFramework { if (!cfgFillWeights) loadCorrections(bc); - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processMCReco, "Process analysis for MC reconstructed events", false); @@ -2199,7 +2082,7 @@ struct FlowGenericFramework { if (!cfgFillWeights) loadCorrections(bc); - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processRun2, "Process analysis for Run 2 converted data", false); diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 35931370294..395cd59148b 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -158,12 +158,11 @@ struct FlowGfwV02 { } cfgTrackCuts; struct : ConfigurableGroup { - 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"}; + 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 @@ -244,22 +243,22 @@ struct FlowGfwV02 { std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; - std::array, 4> hPtMid{}; + TH1D* hPtMid[4] = {nullptr, nullptr, nullptr, nullptr}; }; PIDState pidStates; // Event selection cuts - Alex - 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; + 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>; @@ -316,15 +315,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::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.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/"); } @@ -361,10 +360,10 @@ struct FlowGfwV02 { o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; // Initialise pt spectra histograms for different particles - 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] = 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); @@ -466,7 +465,6 @@ 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"); @@ -502,19 +500,19 @@ struct FlowGfwV02 { } if (cfgUseAdditionalEventCut) { - fMultPVCutLow = std::make_unique("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultPVCutLow = new TF1("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultPVCutHigh = std::make_unique("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultPVCutHigh = new TF1("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultCutLow = std::make_unique("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultCutLow = new TF1("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultCutHigh = std::make_unique("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultCutHigh = new TF1("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultPVGlobalCutHigh = std::make_unique("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); + fMultPVGlobalCutHigh = new TF1("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0])); } // Set DCAxy cut - fPtDepDCAxy = std::make_unique("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); + fPtDepDCAxy = new TF1("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma); } @@ -1008,7 +1006,7 @@ struct FlowGfwV02 { if (!withinPtPOI && !withinPtRef) return; - double weff = getEfficiency(track, PidCharged); + double weff = getJTrackEfficiency(track); if (weff < 0) return; @@ -1017,13 +1015,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, 1); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 0); if (withinPtPOI && pidInd == PidPions) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions + 1); + 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 + 1); + 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 + 1); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons); return; } diff --git a/PWGCF/TableProducer/filter2Prong.cxx b/PWGCF/TableProducer/filter2Prong.cxx index 739eb424b40..c57427a92c5 100644 --- a/PWGCF/TableProducer/filter2Prong.cxx +++ b/PWGCF/TableProducer/filter2Prong.cxx @@ -45,8 +45,6 @@ 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") @@ -148,10 +146,6 @@ 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; @@ -778,104 +772,6 @@ 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 79dd72d4e67..6ceaaa6c815 100644 --- a/PWGCF/TableProducer/filterCorrelations.cxx +++ b/PWGCF/TableProducer/filterCorrelations.cxx @@ -42,6 +42,17 @@ 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; @@ -95,7 +106,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; @@ -559,7 +570,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&) { diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 0460b80886f..6044510a562 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -109,7 +109,6 @@ 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"}; @@ -175,14 +174,8 @@ struct CorrelationTask { void init(o2::framework::InitContext&) { - 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."); - } + 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."); 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) { @@ -333,15 +326,7 @@ struct CorrelationTask { { auto it = std::lower_bound(cfgPtDepMLbkg->begin(), cfgPtDepMLbkg->end(), track.pt()); int idx = std::distance(cfgPtDepMLbkg->begin(), it) - 1; - 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 + return !((track.decay() == 0 && track.mlProbD0()[0] > cfgPtCentDepMLbkgSel->at(idx)) || (track.decay() == 1 && track.mlProbD0bar()[0] > cfgPtCentDepMLbkgSel->at(idx))); } template @@ -586,7 +571,7 @@ struct CorrelationTask { } if constexpr (std::experimental::is_detected::value) { - if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (!cfgPtCentDepMLpromptSel->empty() && (track1.decay() & aod::cf2prongmcpart::Prompt) == 0)) + if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (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) { @@ -669,7 +654,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)) || (!cfgPtCentDepMLpromptSel->empty() && (track2.decay() & aod::cf2prongmcpart::Prompt) == 0)) + if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPiExclusive)) || (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) { @@ -1211,12 +1196,8 @@ 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)) + if (((mcParticle.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (mcParticle.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (mcParticle.decay() & aod::cf2prongmcpart::Prompt) == 0) 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) diff --git a/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h b/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h index 8dd31e82aa1..f9b79242ac0 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(LRCollisions, "AOD", "LRCOLLISION", +DECLARE_SOA_TABLE(CollLRTables, "AOD", "COLLLRTABLE", o2::soa::Index<>, bc::RunNumber, lrcorrcolltable::Zvtx, lrcorrcolltable::Multiplicity, lrcorrcolltable::Centrality, timestamp::Timestamp); -using LRCollision = LRCollisions::iterator; +using CollLRTable = CollLRTables::iterator; -DECLARE_SOA_TABLE(UpcLRCollisions, "AOD", "UPCLRCOLLISION", +DECLARE_SOA_TABLE(UpcCollLRTables, "AOD", "UPCCOLLLRTABLE", o2::soa::Index<>, bc::GlobalBC, bc::RunNumber, @@ -52,30 +52,30 @@ DECLARE_SOA_TABLE(UpcLRCollisions, "AOD", "UPCLRCOLLISION", lrcorrcolltable::TotalFT0AmplitudeA, lrcorrcolltable::TotalFT0AmplitudeC, lrcorrcolltable::TotalFV0AmplitudeA); -using UpcLRCollision = UpcLRCollisions::iterator; +using UpcCollLRTable = UpcCollLRTables::iterator; -DECLARE_SOA_TABLE(UpcSgLRCollisions, "AOD", "UPCSGLRCOLLISION", +DECLARE_SOA_TABLE(UpcSgCollLRTables, "AOD", "UPCSGCOLLLRTABLE", lrcorrcolltable::GapSide); -using UpcSgLRCollision = UpcSgLRCollisions::iterator; +using UpcSgCollLRTable = UpcSgCollLRTables::iterator; namespace lrcorrzdctable { -DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); +DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); } // namespace lrcorrzdctable -DECLARE_SOA_TABLE(LRZdcs, "AOD", "LRZDC", +DECLARE_SOA_TABLE(ZdcLRTables, "AOD", "ZDCLRTABLE", o2::soa::Index<>, - lrcorrzdctable::UpcLRCollisionId, + lrcorrzdctable::UpcCollLRTableId, lrcorrzdctable::EnergyCommonZNA, lrcorrzdctable::EnergyCommonZNC); -using LRZdc = LRZdcs::iterator; +using ZdcLRTable = ZdcLRTables::iterator; namespace lrcorrtrktable { -DECLARE_SOA_INDEX_COLUMN(LRCollision, lrCollision); -DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); +DECLARE_SOA_INDEX_COLUMN(CollLRTable, collLRTable); +DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); 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(LRMidTracks, "AOD", "LRMIDTRACK", +DECLARE_SOA_TABLE(TrkLRTables, "AOD", "TRKLRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using LRMidTrack = LRMidTracks::iterator; +using TrkLRTable = TrkLRTables::iterator; -DECLARE_SOA_TABLE(LRFt0aTracks, "AOD", "LRFT0ATRACK", +DECLARE_SOA_TABLE(Ft0aLRTables, "AOD", "FT0ALRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using LRFt0aTrack = LRFt0aTracks::iterator; +using Ft0aLRTable = Ft0aLRTables::iterator; -DECLARE_SOA_TABLE(LRFt0cTracks, "AOD", "LRFT0CTRACK", +DECLARE_SOA_TABLE(Ft0cLRTables, "AOD", "FT0CLRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using LRFt0cTrack = LRFt0cTracks::iterator; +using Ft0cLRTable = Ft0cLRTables::iterator; -DECLARE_SOA_TABLE(LRV0Tracks, "AOD", "LRV0TRACK", +DECLARE_SOA_TABLE(V0TrkLRTables, "AOD", "V0TRKLRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -136,54 +136,54 @@ DECLARE_SOA_TABLE(LRV0Tracks, "AOD", "LRV0TRACK", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using LRV0Track = LRV0Tracks::iterator; +using V0TrkLRTable = V0TrkLRTables::iterator; -DECLARE_SOA_TABLE(LRMftTracks, "AOD", "LRMFTTRACK", +DECLARE_SOA_TABLE(MftTrkLRTables, "AOD", "MFTTRKLRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using LRMftTrack = LRMftTracks::iterator; +using MftTrkLRTable = MftTrkLRTables::iterator; -DECLARE_SOA_TABLE(LRMftBestTracks, "AOD", "LRMFTBESTTRACK", +DECLARE_SOA_TABLE(MftBestTrkLRTables, "AOD", "MFTBESTTRKLRTABLE", o2::soa::Index<>, - lrcorrtrktable::LRCollisionId, + lrcorrtrktable::CollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using LRMftBestTrack = LRMftBestTracks::iterator; +using MftBestTrkLRTable = MftBestTrkLRTables::iterator; -DECLARE_SOA_TABLE(UpcLRMidTracks, "AOD", "UPCLRMIDTRACK", +DECLARE_SOA_TABLE(TrkLRUpcTables, "AOD", "TRKLRUPCTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using UpcLRMidTrack = UpcLRMidTracks::iterator; +using TrkLRUpcTable = TrkLRUpcTables::iterator; -DECLARE_SOA_TABLE(UpcLRFt0aTracks, "AOD", "UPCLRFT0ATRACK", +DECLARE_SOA_TABLE(Ft0aLRUpcTables, "AOD", "FT0ALRUpcTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using UpcLRFt0aTrack = UpcLRFt0aTracks::iterator; +using Ft0aLRUpcTable = Ft0aLRUpcTables::iterator; -DECLARE_SOA_TABLE(UpcLRFt0cTracks, "AOD", "UPCLRFT0CTRACK", +DECLARE_SOA_TABLE(Ft0cLRUpcTables, "AOD", "FT0CLRUpcTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using UpcLRFt0cTrack = UpcLRFt0cTracks::iterator; +using Ft0cLRUpcTable = Ft0cLRUpcTables::iterator; -DECLARE_SOA_TABLE(UpcLRV0Tracks, "AOD", "UPCLRV0TRACK", +DECLARE_SOA_TABLE(V0TrkLRUpcTables, "AOD", "V0TRKLRUPCTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -191,23 +191,23 @@ DECLARE_SOA_TABLE(UpcLRV0Tracks, "AOD", "UPCLRV0TRACK", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using UpcLRV0Track = UpcLRV0Tracks::iterator; +using V0TrkLRUpcTable = V0TrkLRUpcTables::iterator; -DECLARE_SOA_TABLE(UpcLRMftTracks, "AOD", "UPCLRMFTTRACK", +DECLARE_SOA_TABLE(MftTrkLRUpcTables, "AOD", "MFTTRKLRUPCTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using UpcLRMftTrack = UpcLRMftTracks::iterator; +using MftTrkLRUpcTable = MftTrkLRUpcTables::iterator; -DECLARE_SOA_TABLE(UpcLRMftBestTracks, "AOD", "UPCLRMFTBESTTRACK", +DECLARE_SOA_TABLE(MftBestTrkLRUpcTables, "AOD", "MFTBESTTRKLRUPCTABLE", o2::soa::Index<>, - lrcorrtrktable::UpcLRCollisionId, + lrcorrtrktable::UpcCollLRTableId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using UpcLRMftBestTrack = UpcLRMftBestTracks::iterator; +using MftBestTrkLRUpcTable = MftBestTrkLRUpcTables::iterator; } // namespace o2::aod diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx index 816eb4da038..a7d90746265 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx @@ -233,24 +233,24 @@ struct LongrangeMaker { cfgSgCuts = (SGCutParHolder)sgCuts; } - 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; + 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; 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(); - lrcollision(bc.runNumber(), col.posZ(), multiplicity, centrality, bc.timestamp()); + collisionLRTable(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; - lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + tracksLRTable(collisionLRTable.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); - lrft0atracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); + ft0aLRTable(collisionLRTable.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); - lrft0ctracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); + ft0cLRTable(collisionLRTable.lastIndex(), chanelid, ampl, eta, phi); } } @@ -315,7 +315,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - lrmfttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); + mftLRTable(collisionLRTable.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); - lrmftbesttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); + mftbestLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), phi); } } @@ -344,8 +344,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + v0LRTable(collisionLRTable.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(); - lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + v0LRTable(collisionLRTable.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); - upclrcollision(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); - upcsglrcollision(issgevent); + outupccol(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); + outsgupccol(issgevent); if (newbc.has_zdc()) { auto zdc = newbc.zdc(); - lrzdcs(upclrcollision.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); + outzdctable(outupccol.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); } else { - lrzdcs(upclrcollision.lastIndex(), -999, -999); + outzdctable(outupccol.lastIndex(), -999, -999); } // track loop @@ -413,13 +413,13 @@ struct LongrangeMaker { continue; if (!myTrackFilter.IsSelected(track)) continue; - upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + tracksLRUpcTable(outupccol.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); - upclrft0atracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); + ft0aLRUpcTable(outupccol.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); - upclrft0ctracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); + ft0cLRUpcTable(outupccol.lastIndex(), chanelid, ampl, eta, phi); } } @@ -447,7 +447,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - upclrmfttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); + mftLRUpcTable(outupccol.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); - upclrmftbesttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); + mftbestLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), phi); } } @@ -476,8 +476,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + v0LRUpcTable(outupccol.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(); - upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + v0LRUpcTable(outupccol.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/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 0a12a77b2fe..7584e824e6a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -96,15 +96,4 @@ 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) - -o2physics_add_dpl_workflow(lambdacascadecorrelation - SOURCES Lambdacascadecorrelation.cxx - 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) - + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx deleted file mode 100644 index dfcb3182d43..00000000000 --- a/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx +++ /dev/null @@ -1,3704 +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. - -/// \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) - - }; -} diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 1497bf7520e..6c6e7464216 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, false, "Use gain for FT0A and FT0C") + O2_DEFINE_CONFIGURABLE(withGain, bool, true, "Use gain for FT0A and FT0C") } cfgDetectorConfig; @@ -216,7 +216,6 @@ 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"}; @@ -344,7 +343,7 @@ struct CorrSparse { LOGF(info, "Starting init"); // Event Counter - if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) && cfgUseAdditionalEventCut) { + if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) && 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"); @@ -361,7 +360,7 @@ struct CorrSparse { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } - if (doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || 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"); @@ -374,12 +373,12 @@ struct CorrSparse { } // Make histograms to check the distributions after cuts - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) { registry.add("Phi", "Phi", {HistType::kTH1D, {axisPhi}}); if (doprocessSameMFTFIT) { registry.add("Eta", "EtaMFT", {HistType::kTH1D, {axisEtaMft}}); } - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { registry.add("Eta", "Eta", {HistType::kTH1D, {axisEta}}); } registry.add("EtaCorrected", "EtaCorrected", {HistType::kTH1D, {axisEta}}); @@ -390,7 +389,7 @@ struct CorrSparse { registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}}); registry.add("zVtx_used", "zVtx_used", {HistType::kTH1D, {axisVertex}}); - if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { + if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT) { registry.add("FT0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FV0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FT0AmpCorrect", "", {HistType::kTH2F, {axisChID, axisFit}}); @@ -447,7 +446,7 @@ struct CorrSparse { } } - if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D) { + if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { 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}}}); @@ -459,12 +458,6 @@ 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"); @@ -535,13 +528,6 @@ 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)); @@ -602,9 +588,9 @@ struct CorrSparse { mixed.setObject(new CorrelationContainer("mixedEvent_TPC_MFT_Reassociated2D", "mixedEvent_TPC_MFT_Reassociated2D", 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)); + 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)); } LOGF(info, "End of init"); } @@ -785,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) { @@ -1507,64 +1493,6 @@ 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 ///////// ////////////////////////////////////// @@ -1812,37 +1740,29 @@ struct CorrSparse { } PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated2D, "Process same event for TPC-MFT correlation with reassociated tracks", false); - void processSameFT0s(AodCollisions::iterator const& collision, AodTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) + void processSameTpcMftReassociated3D(AodCollisions::iterator const& collision, AodTracks const& tracks, + soa::SmallGroups const& reassociatedMftTracks, + aod::BCsWithTimestamps const&) { if (!collision.sel8()) return; - auto bc = collision.bc_as(); - if (cfgUseAdditionalEventCut && !eventSelected(collision, 0, true)) - return; - - if (!collision.has_foundFT0()) + if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), true)) return; - loadAlignParam(bc.timestamp()); - if (cfgDetectorConfig.withGain) { - loadGain(bc); - } + 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)) { + if (tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult) { return; } - 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); + fillCorrelationsMftReassociatedTracks(tracks, reassociatedMftTracks, tracks.size(), collision.posZ(), SameEvent, getMagneticField(bc.timestamp()), false); } - PROCESS_SWITCH(CorrSparse, processSameFT0s, "Process same event for FT0 correlation", false); + PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated3D, "Process same event for TPC-MFT correlation with reassociated tracks", false); + //////////////////////////////////// ////// Mixed event processing ////// //////////////////////////////////// @@ -2063,57 +1983,6 @@ 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) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx index 692a6583f5c..89bb63cc0cd 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx @@ -100,24 +100,13 @@ 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") - 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; + 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(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"); @@ -158,8 +147,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, -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 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 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"}; @@ -182,17 +171,6 @@ 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{}; @@ -265,7 +243,6 @@ 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); @@ -291,23 +268,7 @@ 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; @@ -460,10 +421,6 @@ 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"); } @@ -471,13 +428,13 @@ struct FlowDecorrelation { bool isAcceptedMftTrack(TTrackAssoc const& mftTrack) { // cut on the number of clusters of the reconstructed MFT track - if (mftTrack.nClusters() < cfgMftCuts.nClustersMftTrack) + if (mftTrack.nClusters() < nClustersMftTrack) return false; - if (cfgMftCuts.cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgMftCuts.cfgCutChi2Mft) + if (cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgCutChi2Mft) return false; - if (cfgMftCuts.cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgMftCuts.cfgCutTrackTimeMft) + if (cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgCutTrackTimeMft) return false; return true; @@ -772,11 +729,11 @@ struct FlowDecorrelation { float ampl = 0.; getChannel(ft0, iCh, chanelid, ampl, corType); if (corType == kFT0C) { - if ((cfgFt0RingRejections.cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { + if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { continue; } } else if (corType == kFT0A) { - if ((cfgFt0RingRejections.cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { + if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { continue; } } @@ -829,7 +786,7 @@ struct FlowDecorrelation { int channelIdA = 0; float amplA = 0.f; getChannel(ft0Trig, iChA, channelIdA, amplA, kFT0A); - if ((cfgFt0RingRejections.cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { + if ((cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { continue; } @@ -844,7 +801,7 @@ struct FlowDecorrelation { int channelIdC = 0; float amplC = 0.f; getChannel(ft0Assoc, iChC, channelIdC, amplC, kFT0C); - if ((cfgFt0RingRejections.cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { + if ((cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { continue; } @@ -1026,24 +983,6 @@ 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()) @@ -1619,149 +1558,6 @@ 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) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index d4a6304e172..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,21 +239,18 @@ 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 cMinCent{"cMinCent", 0., "Minumum Centrality"}; - Configurable cMaxCent{"cMaxCent", 100.0, "Maximum Centrality"}; + 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"}; Configurable cInt7Trig{"cInt7Trig", false, "kINT7 MB Trigger"}; Configurable cSel7Trig{"cSel7Trig", false, "Sel7 (V0A + V0C) Selection Run2"}; @@ -256,10 +263,13 @@ 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"}; @@ -279,33 +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; @@ -325,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&) { @@ -335,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"); @@ -358,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})"); @@ -369,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}); @@ -377,8 +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_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}); @@ -397,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}); @@ -426,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}); @@ -513,7 +515,7 @@ struct LambdaTableProducer { } } - if (cent <= cMinCent || cent >= cMaxCent) { // select centrality percentile class + if (cent <= cMinMult || cent >= cMaxMult) { // select centrality percentile class return false; } @@ -546,7 +548,7 @@ struct LambdaTableProducer { } // Set Multiplicity - mult = col.multTPC(); + mult = col.multNTracksPV(); return true; } @@ -573,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; } @@ -679,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; } @@ -828,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) { @@ -846,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 @@ -886,32 +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; - delete histMatchEff; - } - - 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 @@ -949,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()); @@ -980,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) @@ -1015,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()); @@ -1027,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; } } @@ -1055,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) @@ -1067,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) { @@ -1083,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()); @@ -1107,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); } @@ -1124,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) { @@ -1165,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()); @@ -1172,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) { @@ -1188,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()); @@ -1201,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()); @@ -1217,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.); } } @@ -1246,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) { @@ -1276,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&) { @@ -1312,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, @@ -1407,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) { @@ -1509,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 { @@ -1530,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}; @@ -1564,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})"); @@ -1579,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}); @@ -1594,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) { @@ -1625,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) { @@ -1644,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) { @@ -1693,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 @@ -1711,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 @@ -1757,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()); @@ -1803,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; @@ -1864,5 +1984,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx index d079b483981..e0eefb67fad 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx @@ -30,8 +30,6 @@ #include "Framework/runDataProcessing.h" #include -#include -#include #include #include @@ -121,13 +119,11 @@ 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::FakeFlag); + lambdatrackext::TrueLambdaFlag); using LambdaTrackExt = LambdaTracksExt::iterator; @@ -243,22 +239,13 @@ enum RunType { enum ParticleType { kLambda = 0, - kAntiLambda, - kFakeLambda, - kFakeAntiLambda + kAntiLambda }; enum ParticlePairType { - // ----------------------------------------------------------------------- kLambdaAntiLambda = 0, - kAntiLambdaLambda = 1, - kLambdaLambda = 2, - kAntiLambdaAntiLambda = 3, - // ----------------------------------------------------------------------- - kLambdaFakeAntiLambda = 4, - kAntiLambdaFakeLambda = 5, - kLambdaFakeLambda = 6, - kAntiLambdaFakeAntiLambda = 7 + kLambdaLambda, + kAntiLambdaAntiLambda }; enum ShareDauLambda { @@ -328,13 +315,6 @@ 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"}; @@ -450,9 +430,6 @@ 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}); @@ -1039,45 +1016,6 @@ 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) @@ -1209,117 +1147,7 @@ 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 @@ -1485,6 +1313,37 @@ 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, @@ -1537,10 +1396,9 @@ 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} #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}); + 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}); @@ -1586,10 +1444,7 @@ struct LambdaTracksExtProducer { ++nTotAntiLambda; } - 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.)); - } + 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 !!!) @@ -1602,16 +1457,13 @@ struct LambdaTracksExtProducer { vSharedDauLambdaIndex.push_back(track.index()); lambdaSharingDauFlag = true; - 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)); - } + // 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 @@ -1620,35 +1472,14 @@ struct LambdaTracksExtProducer { } // decisions based on t-score - // 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; - } + tTrack = (cA * std::abs(track.mass() - MassLambda0)) + (cB * track.dcaDau()) + (cC * std::abs(track.cosPA() - 1.)); + if (tLambda > tTrack) { + lambdaMinTScoreFlag = false; } } } - 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) + // fill QA histograms if (lambdaSharingDauFlag) { fillHistos(lambda); } else { @@ -1674,8 +1505,8 @@ struct LambdaTracksExtProducer { } } - // fill LambdaTrackExt table (fakeFlag = false for all real V0 candidates) - lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag, false); + // fill LambdaTrackExt table + lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag); } // fill multiplicity histograms @@ -1705,21 +1536,15 @@ struct LambdaSpinPolarization { // Global Configurables Configurable cNPtBins{"cNPtBins", 30, "N pT Bins"}; Configurable cMinPt{"cMinPt", 0.5, "pT Min"}; - Configurable cMaxPt{"cMaxPt", 4.5, "pT Max"}; + 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", 20, "N CosTS Bins"}; - Configurable cNBinsDeltaR{"cNBinsDeltaR", 20, "DeltaR Bins"}; + Configurable cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS 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 (%)"}; @@ -1738,11 +1563,11 @@ struct LambdaSpinPolarization { void init(InitContext const&) { const AxisSpec axisCheck(1, 0, 1, ""); - const AxisSpec axisPosZ(220, -7, 7, "V_{z} (cm)"); + 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.08, 1.2, "M_{#Lambda} (GeV/#it{c}^{2})"); + 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"); @@ -1750,7 +1575,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(cNBinsDeltaR, 0, 4, "#DeltaR"); + const AxisSpec axisDR(10, 0, 2, "#DeltaR"); // Pool occupancy histos.add("QA/ME/hPoolCentVz", "ME pool occupancy;centrality (%);V_{z} (cm)", kTH2F, {axisCentME, axisVtxZME}); @@ -1759,36 +1584,18 @@ 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: four separate signal pair types + // inv mass vs pt for Lambda and AntiLambda 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}); - 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}); - + // rho2 for C2 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) @@ -1819,179 +1626,82 @@ struct LambdaSpinPolarization { template void fillPairHistos(U& p1, U& p2) { - 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()); - } + 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); 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}; - 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 vPair; + getBoostVector(llpair, vPair, cInvBoostFlag); - if (cDoStarMethod) { - std::array pr1Star = pr1; - std::array pr2Star = pr2; + boost(l1, vPair); + boost(l2, vPair); - std::array v1Lab, v2Lab; - getBoostVector(l1, v1Lab, cInvBoostFlag); - getBoostVector(l2, v2Lab, cInvBoostFlag); - boost(pr1Star, v1Lab); - boost(pr2Star, v2Lab); + boost(pr1, vPair); + boost(pr2, vPair); - 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])); + std::array v1_pair, v2_pair; + getBoostVector(l1, v1_pair, cInvBoostFlag); + getBoostVector(l2, v2_pair, cInvBoostFlag); - 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); - } - } + boost(pr1, v1_pair); + boost(pr2, v2_pair); + + 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])); + + 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); } - template - void analyzePairsStandard(T const& trks_1, T const& trks_2) + template + void analyzePairs(T const& trks_1, T const& trks_2) { for (auto const& trk_1 : trks_1) { for (auto const& trk_2 : trks_2) { - - if constexpr (samelambda) { - if (trk_1.index() == trk_2.index()) - continue; + // check for same index for Lambda-Lambda / AntiLambda-AntiLambda + if (samelambda && ((trk_1.index() == trk_2.index()))) { + continue; } - - fillPairHistos(trk_1, trk_2); + fillPairHistos(trk_1, trk_2); } } } template - void analyzePairsSequential(T const& trks_1, T const& trks_2) + void analyzePairsWithKinematicMatching(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) { - - 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; + for (auto const& trk_2 : trks_2) { + if (samelambda && ((trk_1.index() == trk_2.index()))) { continue; } - 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()); + // 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()); - if (dPt < cMaxDeltaPt && dPhi < cMaxDeltaPhi && dRap < cMaxDeltaRap) { - currentPartner = trk_2; + if (deltaPt < cMaxDeltaPt && deltaPhi < cMaxDeltaPhi && deltaRap < cMaxDeltaRap) { + fillPairHistos(trk_1, 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!"); } } @@ -2002,44 +1712,27 @@ struct LambdaSpinPolarization { Preslice perCollisionLambda = aod::lambdatrack::lambdaCollisionId; SliceCache cache; - // 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); + 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(LambdaSpinPolarization, processDummy, "Dummy process", false); + PROCESS_SWITCH(LambdaSpinPolarization, 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); - 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); + // Add QA for single Lambds - analyzePairsStandard(lambdaTracks, fakeLambdaTracks); - analyzePairsStandard(fakeLambdaTracks, lambdaTracks); - analyzePairsStandard(antiLambdaTracks, fakeAntiLambdaTracks); - analyzePairsStandard(fakeAntiLambdaTracks, antiLambdaTracks); + // Analyze pairs + analyzePairs(lambdaTracks, antiLambdaTracks); + analyzePairs(lambdaTracks, lambdaTracks); + analyzePairs(antiLambdaTracks, antiLambdaTracks); } PROCESS_SWITCH(LambdaSpinPolarization, processDataReco, "Process for Data and MCReco", true); @@ -2071,83 +1764,40 @@ struct LambdaSpinPolarization { histos.fill(HIST("QA/ME/hPoolCentVz"), col1.cent(), col1.posZ()); // Lambda slices - auto lambdaTracksCol1 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); - auto lambdaTracksCol2 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); + auto lambdaTracks_col1 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); + auto lambdaTracks_col2 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); // Anti-lambda slices - 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); + auto antiLambdaTracks_col1 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); + auto antiLambdaTracks_col2 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); // QA: multiplicities - 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); + histos.fill(HIST("QA/ME/hLambdaMultVsCent"), col1.cent(), lambdaTracks_col1.size()); + histos.fill(HIST("QA/ME/hAntiLambdaMultVsCent"), col1.cent(), antiLambdaTracks_col1.size()); - analyzePairsME(lambdaTracksCol1, fakeLambdaTracksCol2); - analyzePairsME(fakeLambdaTracksCol2, lambdaTracksCol1); - analyzePairsME(antiLambdaTracksCol1, fakeAntiLambdaTracksCol2); - analyzePairsME(fakeAntiLambdaTracksCol2, antiLambdaTracksCol1); + // Mixed-event pairs + analyzePairsWithKinematicMatching(lambdaTracks_col1, antiLambdaTracks_col2); + analyzePairsWithKinematicMatching(antiLambdaTracks_col1, lambdaTracks_col2); + analyzePairsWithKinematicMatching(lambdaTracks_col1, lambdaTracks_col2); + analyzePairsWithKinematicMatching(antiLambdaTracks_col1, antiLambdaTracks_col2); } } PROCESS_SWITCH(LambdaSpinPolarization, processDataRecoMixed, "Process for Data and MCReco for Mixed events", false); - void processDataRecoMixEvent(LambdaCollisions::iterator const& collision, LambdaTracks const&) + void processDataRecoMixEvent(LambdaCollisions::iterator const& collision, LambdaTracks const& tracks) { - // 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 for no lambdas in a collision + if (tracks.size() == 0) { return; } - // Fill collision table once per collision + // fill collision table lambdaMixEvtCol(collision.index(), collision.cent(), collision.posZ(), 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()); + 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()); } } diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index 93210a7968b..b95075d694e 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -17,7 +17,6 @@ #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" @@ -157,19 +156,6 @@ 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; @@ -212,7 +198,6 @@ struct LongRangeDihadronCor { // Corrections TH3D* mEfficiency = nullptr; TH1D* mCentralityWeight = nullptr; - GFWWeights* mAcceptance = nullptr; bool correctionsLoaded = false; // Define the outputs @@ -223,8 +208,6 @@ 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(); @@ -283,10 +266,6 @@ struct LongRangeDihadronCor { kFT0CMirrorChannelEnd = 147, kFT0CMirrorChannelInnerRing = 115 }; - enum DataType { - kReco, - kGen - }; std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; @@ -463,69 +442,6 @@ 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"); } @@ -711,13 +627,6 @@ 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; } @@ -751,80 +660,6 @@ 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. @@ -1186,40 +1021,6 @@ 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; } @@ -1340,40 +1141,6 @@ 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; } diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index 9d759b1695a..977f534729a 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::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; + 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; void init(InitContext const&) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx deleted file mode 100644 index 11df7945ea1..00000000000 --- a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx +++ /dev/null @@ -1,361 +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. - -/// \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; - -/// 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) - -/// the prompt origin label -static constexpr std::string PromptStr = "prompt"; -// ============================================================================ -// 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 */ - 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 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), - kTH1D, {ptAxis}); - - fhDecayVsPt[i] = registry.add( - FORMATSTRING("DecayVsPt_%s", tname), - FORMATSTRING("From decay %s;#it{p}_{T} (GeV/#it{c});counts", tname), - kTH1D, {ptAxis}); - - fhPromptVsCentVsPt[i] = registry.add( - FORMATSTRING("PromptVsCentVsPt_%s", tname), - FORMATSTRING("Prompt %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), - kTH2D, {centAxis, ptAxis}); - - fhDecayVsCentVsPt[i] = registry.add( - FORMATSTRING("DecayVsCentVsPt_%s", tname), - FORMATSTRING("From decay %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), - 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), - 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, {pdgAxis, ptAxis, centAxis}); - - fhMotherPDG[i] = registry.add( - FORMATSTRING("MotherPDG_%s", tname), - FORMATSTRING("Immediate mother PDG of %s from decay;PDG code;counts", tname), - kTH1D, {pdgAxis}); - - fhAncestorPDG[i] = registry.add( - FORMATSTRING("AncestorPDG_%s", tname), - FORMATSTRING("Earliest ancestor PDG of %s from decay;PDG code;counts", tname), - kTH1D, {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); - 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(PromptStr.c_str(), pt, centmult, 1.0); - } - if (isFromDecayFull) { - 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(PromptStr.c_str(), pt, centmult, 1.0); - } - } - - 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)}; -} diff --git a/PWGDQ/Core/AnalysisCompositeCut.cxx b/PWGDQ/Core/AnalysisCompositeCut.cxx index cbf0f328283..5ab08001953 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.cxx +++ b/PWGDQ/Core/AnalysisCompositeCut.cxx @@ -11,12 +11,6 @@ #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 a6b3f6afda4..f3d603909c4 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.h +++ b/PWGDQ/Core/AnalysisCompositeCut.h @@ -14,14 +14,10 @@ // Cut class manipulating groups of cuts // -#ifndef PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ -#define PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ +#ifndef AnalysisCompositeCut_H +#define AnalysisCompositeCut_H #include "PWGDQ/Core/AnalysisCut.h" - -#include -#include - #include //_________________________________________________________________________ @@ -56,4 +52,4 @@ class AnalysisCompositeCut : public AnalysisCut ClassDef(AnalysisCompositeCut, 2); }; -#endif // PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ +#endif diff --git a/PWGDQ/Core/AnalysisCut.cxx b/PWGDQ/Core/AnalysisCut.cxx index a1dae4ce6b0..ecb1ace04e6 100644 --- a/PWGDQ/Core/AnalysisCut.cxx +++ b/PWGDQ/Core/AnalysisCut.cxx @@ -11,10 +11,6 @@ #include "PWGDQ/Core/AnalysisCut.h" -#include - -#include - #include #include diff --git a/PWGDQ/Core/AnalysisCut.h b/PWGDQ/Core/AnalysisCut.h index 16f2916fe93..6c7185b13ec 100644 --- a/PWGDQ/Core/AnalysisCut.h +++ b/PWGDQ/Core/AnalysisCut.h @@ -14,14 +14,10 @@ // Class for analysis cuts applied on the variables defined in the VarManager // -#ifndef PWGDQ_CORE_ANALYSISCUT_H_ -#define PWGDQ_CORE_ANALYSISCUT_H_ +#ifndef AnalysisCut_H +#define AnalysisCut_H #include -#include - -#include - #include //_________________________________________________________________________ @@ -180,4 +176,4 @@ inline bool AnalysisCut::IsSelected(float* values) return true; } -#endif // PWGDQ_CORE_ANALYSISCUT_H_ +#endif diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index d636d4ab7b7..cb9c124d418 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -14,27 +14,20 @@ #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) { // @@ -6329,14 +6322,6 @@ 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/CutsLibrary.h b/PWGDQ/Core/CutsLibrary.h index 51508c3a929..b38577f3c2b 100644 --- a/PWGDQ/Core/CutsLibrary.h +++ b/PWGDQ/Core/CutsLibrary.h @@ -17,12 +17,9 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" - -#include +#include "PWGDQ/Core/VarManager.h" #include -#include -#include #include // /////////////////////////////////////////////// @@ -101,6 +98,8 @@ // 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 9b72e1257b7..64bfe233cc7 100644 --- a/PWGDQ/Core/DQMlResponse.h +++ b/PWGDQ/Core/DQMlResponse.h @@ -17,16 +17,11 @@ #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 ae1c4be3022..4882b7d84f5 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -11,37 +11,28 @@ #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 94aa3ecec00..4b1393b2eb7 100644 --- a/PWGDQ/Core/HistogramManager.h +++ b/PWGDQ/Core/HistogramManager.h @@ -17,20 +17,17 @@ #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 { @@ -106,10 +103,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 8cd67e4b22c..9d12b892322 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,25 +13,11 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" -#include "HistogramManager.h" #include "VarManager.h" -#include -#include - -#include -#include -#include - -#include -#include - -#include +#include "CommonConstants/MathConstants.h" #include -#include -#include -#include #include void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) @@ -263,19 +249,7 @@ 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("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")) { + if (subGroupStr.Contains("qvector")) { int varZNA[3] = {VarManager::kQ1ZNAX, VarManager::kQ1ZNAY, VarManager::kCentFT0C}; int varZNC[3] = {VarManager::kQ1ZNCX, VarManager::kQ1ZNCY, VarManager::kCentFT0C}; @@ -411,6 +385,14 @@ 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); @@ -1189,7 +1171,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, 300, 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, 120, 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); @@ -1351,9 +1333,6 @@ 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); @@ -2558,7 +2537,7 @@ void o2::aod::dqhistograms::AddHistogramsFromJSON(HistogramManager* hm, const ch str += json[i]; } } - LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << std::endl; + LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << endl; return; } diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 99530b1cb6f..869fb3a85f3 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -15,7 +15,11 @@ #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 { @@ -25,7 +29,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 1e50a10fce2..f2fffa9ba55 100644 --- a/PWGDQ/Core/MCProng.cxx +++ b/PWGDQ/Core/MCProng.cxx @@ -11,16 +11,10 @@ #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 4677a995bc7..cd42965d271 100644 --- a/PWGDQ/Core/MCProng.h +++ b/PWGDQ/Core/MCProng.h @@ -57,13 +57,12 @@ 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 +#include "TNamed.h" +#include "TString.h" -#include - -#include -#include #include +#include +#include class MCProng { diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index cb05a02b02c..7a234b65088 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -9,17 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "PWGDQ/Core/MCSignal.h" - -#include "MCProng.h" - -#include - -#include - -#include -#include #include +#include + +#include "PWGDQ/Core/MCSignal.h" using std::cout; using std::endl; diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index f13f9657fbd..42fe0a0a050 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -57,11 +57,10 @@ 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 0bc89619d35..c1c2380c3a4 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -11,24 +11,16 @@ // // Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no // -#include "PWGDQ/Core/MCSignalLibrary.h" +#include +#include +// #include -#include "MCProng.h" -#include "MCSignal.h" +#include "PWGDQ/Core/MCSignalLibrary.h" -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/Logger.h" #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 5b34271a574..f244c7cbbfc 100644 --- a/PWGDQ/Core/MCSignalLibrary.h +++ b/PWGDQ/Core/MCSignalLibrary.h @@ -18,6 +18,9 @@ #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 5fd601f67d0..532b91ea9ac 100644 --- a/PWGDQ/Core/MixingHandler.cxx +++ b/PWGDQ/Core/MixingHandler.cxx @@ -10,19 +10,16 @@ // or submit itself to any jurisdiction. #include "PWGDQ/Core/MixingHandler.h" - #include "PWGDQ/Core/VarManager.h" -#include -#include -#include - -#include -#include - -#include +#include +#include using namespace std; +#include +#include +#include + ClassImp(MixingHandler); //_________________________________________________________________________ diff --git a/PWGDQ/Core/MixingHandler.h b/PWGDQ/Core/MixingHandler.h index f73d5632895..12b4b4dcc1a 100644 --- a/PWGDQ/Core/MixingHandler.h +++ b/PWGDQ/Core/MixingHandler.h @@ -17,12 +17,15 @@ #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 28e453b5479..90fd639464a 100644 --- a/PWGDQ/Core/MixingLibrary.cxx +++ b/PWGDQ/Core/MixingLibrary.cxx @@ -13,16 +13,6 @@ // #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 2372c735cff..c6de5b9ecd3 100644 --- a/PWGDQ/Core/MixingLibrary.h +++ b/PWGDQ/Core/MixingLibrary.h @@ -16,6 +16,11 @@ #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 ee2f419a5f5..236a4f48329 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -18,9 +18,7 @@ #include "Tools/ML/MlResponse.h" -#include - -#include +#include #include #include diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 05375a7b971..ac2902c0f3a 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -8,39 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - #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); @@ -1425,8 +1403,6 @@ 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) "; @@ -1523,14 +1499,6 @@ 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}"; @@ -2249,7 +2217,6 @@ 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; @@ -2347,10 +2314,6 @@ 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; @@ -2449,7 +2412,6 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kPsi2ANEG"] = kPsi2ANEG; fgVarNamesMap["kPsi2B"] = kPsi2B; fgVarNamesMap["kPsi2C"] = kPsi2C; - fgVarNamesMap["kRandomPsi2"] = kRandomPsi2; fgVarNamesMap["kCos2DeltaPhi"] = kCos2DeltaPhi; fgVarNamesMap["kCos2DeltaPhiMu1"] = kCos2DeltaPhiMu1; fgVarNamesMap["kCos2DeltaPhiMu2"] = kCos2DeltaPhiMu2; @@ -2497,7 +2459,6 @@ 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 3b50b989cdd..fa0f694d227 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -22,45 +22,38 @@ #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/RecoDecay.h" +#include "Common/Core/PID/PIDTOFParamService.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include -#include +#include +#include +#include +#include #include #include #include @@ -68,21 +61,22 @@ #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 SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; @@ -675,7 +669,6 @@ class VarManager : public TObject kMCHadronPdgCode, kMCCosTheta, kMCJpsiPt, - kMCAccweight, kMCCosChi, kMCdeltaphi, kMCdeltaeta, @@ -775,10 +768,6 @@ class VarManager : public TObject kCosThetaStarTPC, kCosThetaStarFT0A, kCosThetaStarFT0C, - kAbsCosThetaStarFT0C, - kCos2ThetaStarFT0C, - kCosThetaStarRandom, - kCos2ThetaStarRandom, kCosPhiVP, kPhiVP, kDeltaPhiPair2, @@ -884,7 +873,6 @@ class VarManager : public TObject kPsi2ANEG, kPsi2B, kPsi2C, - kRandomPsi2, kCos2DeltaPhi, kCos2DeltaPhiMu1, // cos(phi - phi1) for muon1 kCos2DeltaPhiMu2, ////cos(phi - phi2) for muon2 @@ -936,7 +924,6 @@ class VarManager : public TObject kCosChi, kEtaDau, kPhiDau, - kWeight, kECWeight, kPtDau, kCosTheta, @@ -1337,14 +1324,12 @@ 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 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, float Accweight = 1.0f); + static void FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3); template static void FillPairPropagateMuon(T1 const& muon1, T2 const& muon2, const C& collision, float* values = nullptr); template @@ -1378,9 +1363,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, float weight = 1.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); 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, float Effweight_rec = 1.f, float Accweight_gen = 1.f); + 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 @@ -2094,9 +2079,6 @@ 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); } @@ -2200,7 +2182,6 @@ 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(); @@ -2791,10 +2772,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); - 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())); + 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())); 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]; @@ -3314,39 +3295,8 @@ 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, float Accweight) +void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values, float Translow, float Transhigh) { // energy correlators float MassHadron; @@ -3363,9 +3313,8 @@ 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 * Accweight; + values[kMCWeight_before] = t1.pt() / o2::constants::physics::MassJPsi; values[kMCCosTheta] = CosTheta; values[kMCdeltaphi] = deltaphi; values[kMCdeltaeta] = deltaeta; @@ -3395,15 +3344,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() * Accweight; + values[kMCWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M(); 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() * Accweight; + values[kMCWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M(); 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() * Accweight; + values[kMCWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M(); 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); @@ -4083,10 +4032,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) { - 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())); + 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())); 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]; @@ -5369,9 +5318,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 - 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); + 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); 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]; @@ -5703,21 +5652,14 @@ 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. if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { - 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())); + 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())); 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]; @@ -5739,8 +5681,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; - 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())); + complex P2plus(TMath::Cos(2 * v1.Phi()), TMath::Sin(2 * v1.Phi())); + 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; @@ -5847,7 +5789,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, float weight) +void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values, float Translow, float Transhigh, bool applyFitMass, float sidebandMass) { float m1 = o2::constants::physics::MassElectron; float m2 = o2::constants::physics::MassElectron; @@ -5870,10 +5812,9 @@ 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[kWeight] = weight; - values[kECWeight] = E_boost / v1.M() * weight; + values[kECWeight] = E_boost / v1.M(); values[kCosTheta] = LorentzTransformJpsihadroncosChi("costheta", v1, v2); - values[kEWeight_before] = v2.Pt() / v1.M() * weight; + values[kEWeight_before] = v2.Pt() / v1.M(); values[kPtDau] = v2.pt(); values[kEtaDau] = v2.eta(); values[kPhiDau] = RecoDecay::constrainAngle(v2.phi(), -o2::constants::math::PIHalf); @@ -5900,14 +5841,15 @@ 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() * weight; + values[kWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M(); 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() * weight; + values[kWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M(); + 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() * weight; + values[kWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M(); 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); @@ -5917,7 +5859,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, float Effweight_rec, float Accweight_gen) +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 @@ -5946,14 +5888,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 * Accweight_gen; + 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(), 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() * Effweight_rec; + values[kMCWeight_rec] = E_boost_rec / v1_rec.M(); values[kMCdeltaeta_rec] = dilepton.eta() - hadron.eta(); } } diff --git a/PWGDQ/DataModel/MchTrkEffTables.h b/PWGDQ/DataModel/MchTrkEffTables.h index a7aa5d1e323..3fbecfb619c 100644 --- a/PWGDQ/DataModel/MchTrkEffTables.h +++ b/PWGDQ/DataModel/MchTrkEffTables.h @@ -17,9 +17,7 @@ #ifndef PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ #define PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ -#include - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 71a15a1ddbd..94c22011d6e 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -20,16 +20,13 @@ #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 -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "MathUtils/Utils.h" #include -#include #include namespace o2::aod @@ -52,24 +49,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 @@ -702,8 +699,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 787d7d38793..e1cad38495b 100644 --- a/PWGDQ/DataModel/ReducedTablesAlice3.h +++ b/PWGDQ/DataModel/ReducedTablesAlice3.h @@ -24,12 +24,8 @@ #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include -#include -#include - -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/PWGDQ/Macros/dqFlowAccWeights.C b/PWGDQ/Macros/dqFlowAccWeights.C index d4786089810..00cb5107d45 100644 --- a/PWGDQ/Macros/dqFlowAccWeights.C +++ b/PWGDQ/Macros/dqFlowAccWeights.C @@ -14,25 +14,23 @@ /// /// \author Chi ZHANG, CEA-Saclay, chi.zhang@cern.ch -#include "PWGCF/GenericFramework/Core/GFWWeights.h" - -#include -#include - -#include -#include - +#include #include -#include -#include -#include #include -#include +#include +#include +#include + +#include +#include +#include "Framework/Logger.h" +#include "CCDB/BasicCCDBManager.h" +#include "PWGCF/GenericFramework/Core/GFWWeights.h" using namespace o2; using namespace std; -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") +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") { if (tmax < tmin) { LOG(fatal) << "Wrong validity syntax!"; diff --git a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx index c59afbb40b8..34610915850 100644 --- a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx +++ b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx @@ -14,21 +14,18 @@ /// /// \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" + 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]); double computeStationEfficiency(double effPerChamber[4], int iStation); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.cxx b/PWGDQ/Macros/fit_library/CB2Pdf.cxx index 05d13210aaa..7f2501825e3 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.cxx +++ b/PWGDQ/Macros/fit_library/CB2Pdf.cxx @@ -11,17 +11,13 @@ /// \author Luca Micheletti , CERN -#include "CB2Pdf.h" - -#include -#include -#include -#include - -#include -#include +#include "Riostream.h" +#include "CB2Pdf.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" #include +#include "TMath.h" ClassImp(CB2Pdf); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.h b/PWGDQ/Macros/fit_library/CB2Pdf.h index 23cb291dcdd..a9e3a87409e 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.h +++ b/PWGDQ/Macros/fit_library/CB2Pdf.h @@ -11,16 +11,14 @@ /// \author Luca Micheletti , CERN -#ifndef PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ -#define PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ +#ifndef CB2PDF +#define CB2PDF -#include -#include -#include -#include - -#include -#include +#include "RooAbsPdf.h" +#include "RooRealProxy.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" class CB2Pdf : public RooAbsPdf { @@ -53,4 +51,4 @@ class CB2Pdf : public RooAbsPdf ClassDef(CB2Pdf, 1) // Your description goes here... }; -#endif // PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ +#endif diff --git a/PWGDQ/Macros/fit_library/ExpPdf.cxx b/PWGDQ/Macros/fit_library/ExpPdf.cxx old mode 100644 new mode 100755 index c4e0d0988c1..1841ccd7cbb --- a/PWGDQ/Macros/fit_library/ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/ExpPdf.cxx @@ -11,16 +11,13 @@ /// \author Luca Micheletti , CERN -#include "ExpPdf.h" - -#include -#include -#include - -#include -#include +#include "Riostream.h" +#include "ExpPdf.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" #include +#include "TMath.h" ClassImp(ExpPdf); diff --git a/PWGDQ/Macros/fit_library/ExpPdf.h b/PWGDQ/Macros/fit_library/ExpPdf.h old mode 100644 new mode 100755 index 306b0aea210..394c73c52e6 --- a/PWGDQ/Macros/fit_library/ExpPdf.h +++ b/PWGDQ/Macros/fit_library/ExpPdf.h @@ -11,16 +11,14 @@ /// \author Luca Micheletti , CERN -#ifndef PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ -#define PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ +#ifndef EXPPDF +#define EXPPDF -#include -#include -#include -#include - -#include -#include +#include "RooAbsPdf.h" +#include "RooRealProxy.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" class ExpPdf : public RooAbsPdf { @@ -45,4 +43,4 @@ class ExpPdf : public RooAbsPdf ClassDef(ExpPdf, 1) // Your description goes here... }; -#endif // PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ +#endif diff --git a/PWGDQ/Macros/fit_library/GausPdf.cxx b/PWGDQ/Macros/fit_library/GausPdf.cxx old mode 100644 new mode 100755 index 2ec58abc577..84d303e3a2b --- a/PWGDQ/Macros/fit_library/GausPdf.cxx +++ b/PWGDQ/Macros/fit_library/GausPdf.cxx @@ -11,16 +11,13 @@ /// \author Luca Micheletti , CERN -#include "GausPdf.h" - -#include -#include -#include - -#include -#include +#include "Riostream.h" +#include "GausPdf.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" #include +#include "TMath.h" ClassImp(GausPdf); diff --git a/PWGDQ/Macros/fit_library/GausPdf.h b/PWGDQ/Macros/fit_library/GausPdf.h old mode 100644 new mode 100755 index 80a1e956817..4edb19ff47c --- a/PWGDQ/Macros/fit_library/GausPdf.h +++ b/PWGDQ/Macros/fit_library/GausPdf.h @@ -11,16 +11,14 @@ /// \author Luca Micheletti , CERN -#ifndef PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ -#define PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ +#ifndef GAUSPDF +#define GAUSPDF -#include -#include -#include -#include - -#include -#include +#include "RooAbsPdf.h" +#include "RooRealProxy.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" class GausPdf : public RooAbsPdf { @@ -45,4 +43,4 @@ class GausPdf : public RooAbsPdf ClassDef(GausPdf, 1) // Your description goes here... }; -#endif // PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ +#endif diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx old mode 100644 new mode 100755 index ff254cc02ae..912406a3b0b --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx @@ -11,16 +11,13 @@ /// \author Luca Micheletti , CERN -#include "Pol4ExpPdf.h" - -#include -#include -#include - -#include -#include +#include "Riostream.h" +#include "Pol4ExpPdf.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" #include +#include "TMath.h" ClassImp(Pol4ExpPdf); diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h old mode 100644 new mode 100755 index 67202dbe5ac..13cd8696c6c --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h @@ -11,17 +11,14 @@ /// \author Luca Micheletti , CERN -#ifndef PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ -#define PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ +#ifndef POL4EXPPDF +#define POL4EXPPDF -#include -#include -#include -#include -#include - -#include -#include +#include "RooAbsPdf.h" +#include "RooRealProxy.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" TString nameParameters[] = {"p0", "p1", "p2", "p3", "p4", "p5", "N_bkg", "N_sig", "mean", "width"}; @@ -56,4 +53,4 @@ class Pol4ExpPdf : public RooAbsPdf ClassDef(Pol4ExpPdf, 1) // Your description goes here... }; -#endif // PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ +#endif diff --git a/PWGDQ/Macros/fit_library/VWGPdf.cxx b/PWGDQ/Macros/fit_library/VWGPdf.cxx index e935afb4150..8cebc90b2f4 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.cxx +++ b/PWGDQ/Macros/fit_library/VWGPdf.cxx @@ -11,16 +11,13 @@ /// \author Luca Micheletti , CERN -#include "VWGPdf.h" - -#include -#include -#include - -#include -#include +#include "Riostream.h" +#include "VWGPdf.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" #include +#include "TMath.h" ClassImp(VWGPdf); diff --git a/PWGDQ/Macros/fit_library/VWGPdf.h b/PWGDQ/Macros/fit_library/VWGPdf.h index 3ed4f2f81e6..9077d43be71 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.h +++ b/PWGDQ/Macros/fit_library/VWGPdf.h @@ -11,16 +11,14 @@ /// \author Luca Micheletti , CERN -#ifndef PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ -#define PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ +#ifndef VWGPDF +#define VWGPDF -#include -#include -#include -#include - -#include -#include +#include "RooAbsPdf.h" +#include "RooRealProxy.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" class VWGPdf : public RooAbsPdf { @@ -47,4 +45,4 @@ class VWGPdf : public RooAbsPdf ClassDef(VWGPdf, 1) // Your description goes here... }; -#endif // PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ +#endif diff --git a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx index 209af151241..22d5d78e6f7 100644 --- a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx +++ b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx @@ -17,40 +17,47 @@ // when dealing with derived data. #include "PWGDQ/DataModel/ReducedInfoTables.h" - -#include "Common/DataModel/Centrality.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/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include +#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 -#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 f2938705e87..5eb39ddd4d4 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -17,7 +17,13 @@ // 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" @@ -38,37 +44,32 @@ #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 -#include +#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; using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx index c5569ae7e14..d5690ab7b78 100644 --- a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx +++ b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx @@ -15,6 +15,7 @@ /// \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" @@ -23,29 +24,13 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" -#include "Common/DataModel/EventSelection.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 diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index 8a2d93f9f89..e2c529a5a7d 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -26,7 +26,6 @@ #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" @@ -36,30 +35,22 @@ #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 "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 diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 39cee24788c..bb0b08895c6 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -27,8 +27,7 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -38,34 +37,24 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.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 "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 @@ -194,7 +183,6 @@ 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; @@ -455,7 +443,7 @@ struct TableMakerMC { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); + rctChecker.init(fConfigRCT.fConfigRCTLabel); } } diff --git a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx index 84d9a42bbbc..11634be2e0d 100644 --- a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx +++ b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx @@ -19,37 +19,34 @@ /// \author Zaida Conesa del Valle /// -#include "PWGDQ/Core/AnalysisCompositeCut.h" +#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/CutsLibrary.h" #include "PWGDQ/Core/VarManager.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 +#include "PWGDQ/DataModel/MchTrkEffTables.h" using namespace o2; using namespace o2::aod; diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index a857be78aa8..7993444ad80 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -17,7 +17,14 @@ // 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" @@ -27,64 +34,44 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.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/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.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 + +#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" using namespace o2; using namespace o2::framework; @@ -130,7 +117,6 @@ 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; @@ -151,7 +137,6 @@ 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; @@ -186,8 +171,6 @@ struct TableMaker { Produces eventExtended; Produces eventVtxCov; Produces eventInfo; - Produces eventQvectorCentr; - Produces eventQvectorCentrExtra; Produces zdc; Produces fit; Produces multPV; @@ -226,7 +209,6 @@ 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; @@ -472,7 +454,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("processPbPbMuonOnlyWithQvect") || context.mOptions.get("processPbPbRealignedMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); + context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbMuonOnly") || context.mOptions.get("processPbPbRealignedMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); if (enableBarrelHistos) { // Barrel track histograms, before selections @@ -530,7 +512,7 @@ struct TableMaker { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); + rctChecker.init(fConfigRCT.fConfigRCTLabel); } } @@ -1058,9 +1040,6 @@ 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 @@ -1176,13 +1155,6 @@ 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 @@ -1973,13 +1945,6 @@ 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) @@ -2032,7 +1997,6 @@ 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); diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index c3768b02918..4312434c2e6 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -21,31 +21,22 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include +#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 @@ -56,6 +47,7 @@ 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 26bca045c2b..3dcbcc4d595 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" -#include //MID track from O2 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include +// 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" using namespace o2; using namespace o2::aod; diff --git a/PWGDQ/Tasks/ModelConverterEventExtended.cxx b/PWGDQ/Tasks/ModelConverterEventExtended.cxx index b73eb3ea581..ec0a6a0c4be 100644 --- a/PWGDQ/Tasks/ModelConverterEventExtended.cxx +++ b/PWGDQ/Tasks/ModelConverterEventExtended.cxx @@ -14,12 +14,18 @@ // 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 -#include -#include -#include +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/ModelConverterMultPv.cxx b/PWGDQ/Tasks/ModelConverterMultPv.cxx index e844a1bd104..088590435b8 100644 --- a/PWGDQ/Tasks/ModelConverterMultPv.cxx +++ b/PWGDQ/Tasks/ModelConverterMultPv.cxx @@ -14,14 +14,17 @@ // 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 634c291cf9e..f4e28daee31 100644 --- a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx +++ b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx @@ -14,12 +14,18 @@ // 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 -#include -#include -#include +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/TagAndProbe.cxx b/PWGDQ/Tasks/TagAndProbe.cxx index b637ec64aad..2a35b33b87e 100644 --- a/PWGDQ/Tasks/TagAndProbe.cxx +++ b/PWGDQ/Tasks/TagAndProbe.cxx @@ -12,41 +12,57 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#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 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 890bdefe46b..f6ba8f3bd39 100644 --- a/PWGDQ/Tasks/dqCorrelation.cxx +++ b/PWGDQ/Tasks/dqCorrelation.cxx @@ -13,43 +13,48 @@ // #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#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/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 +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 45e84b4c3e4..c044d031729 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -23,29 +23,26 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#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 +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 578e161bcdd..daf203e0b29 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -26,40 +26,28 @@ #include "Common/Core/TableHelper.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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 "TGeoGlobalMagField.h" +#include +#include #include #include -#include -#include #include #include -#include - #include -#include -#include -#include -#include -#include -#include #include -#include #include #include #include @@ -74,7 +62,6 @@ 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 @@ -1398,9 +1385,6 @@ struct AnalysisSameEventPairing { Service fCCDB; - // PDG database - Service pdgDB; - // Filter filterEventSelected = aod::dqanalysisflags::isEventSelected & uint32_t(1); Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast(0); @@ -2279,16 +2263,6 @@ 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); diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx index 745e0833de4..2d36e5dd0db 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx @@ -24,47 +24,37 @@ #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 -#include -#include -#include -#include -#include +#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 "TGeoGlobalMagField.h" +#include +#include #include #include -#include #include #include -#include - -#include -#include -#include -#include -#include +#include #include -#include #include #include #include @@ -79,7 +69,6 @@ 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 7084740cac6..eae943e6124 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -33,7 +33,6 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" #include "DetectorsBase/GeometryManager.h" @@ -47,26 +46,23 @@ #include "TGeoGlobalMagField.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; @@ -137,8 +133,6 @@ 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 @@ -147,7 +141,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; @@ -177,12 +171,6 @@ 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; @@ -433,25 +421,14 @@ 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()) { @@ -472,40 +449,13 @@ 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, -1, 1. / Effweight_rec); + VarManager::FillEnergyCorrelatorTriple(track1, track2, hadron, VarManager::fgValues, fTransRange[0], fTransRange[1], fConfigDileptonHadronOptions.fConfigApplyMassEC.value); if (fConfigDileptonHadronOptions.fConfigUsePionMass.value) { - VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value, 1. / Effweight_rec, 1. / Accweight_gen); + 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, 1. / Effweight_rec, 1. / Accweight_gen); + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); } int iHadronCut = 0; @@ -593,7 +543,6 @@ struct AnalysisEnergyCorrelator { // CCDB initialization if (fCurrentRun != bcs.begin().runNumber()) { fCurrentRun = bcs.begin().runNumber(); - initAccFromCCDB(bcs.begin().timestamp()); } if (fConfigEventOptions.fConfigEventQA) { @@ -728,7 +677,7 @@ struct AnalysisEnergyCorrelator { } Filter eventFilter = nabs(aod::collision::posZ) < fConfigEventOptions.fConfigEventfilterVtz && aod::evsel::sel8 == true; - void processBarrelMixedEvent(soa::Filtered const& events, aod::TrackAssoc const& assocs, MyBarrelTracksWithCov const& /*tracks*/, aod::McCollisions const& /*mcCollisions*/, aod::McParticles const& mcParticles, BCsWithTimestamps const& bcs) + void processBarrelMixedEvent(soa::Filtered& events, aod::TrackAssoc const& assocs, MyBarrelTracksWithCov const& /*tracks*/, aod::McCollisions const& /*mcCollisions*/, aod::McParticles const& mcParticles, BCsWithTimestamps const& bcs) { if (events.size() == 0) { return; @@ -737,7 +686,6 @@ struct AnalysisEnergyCorrelator { // CCDB initialization if (fCurrentRun != bcs.begin().runNumber()) { fCurrentRun = bcs.begin().runNumber(); - initAccFromCCDB(bcs.begin().timestamp()); } fSelMap.clear(); @@ -896,17 +844,8 @@ 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], 1. / acceptance); + VarManager::FillEnergyCorrelatorsMC(t1_raw, t2_raw, VarManager::fgValues, fTransRange[0], fTransRange[1]); for (auto& sig : fGenMCSignals) { if (sig->CheckSignal(true, t1_raw)) { if (!MixedEvent && !PionMass) { @@ -927,8 +866,8 @@ struct AnalysisEnergyCorrelator { } } - void processMCGenEnergyCorrelators(soa::Filtered const& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) + void processMCGenEnergyCorrelators(soa::Filtered& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -949,16 +888,12 @@ 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 const& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) + void processMCGenEnergyCorrelatorsME(soa::Filtered& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -983,16 +918,12 @@ 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 const& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) + void processMCGenEnergyCorrelatorsPion(soa::Filtered& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -1013,16 +944,12 @@ 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 const& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) + void processMCGenEnergyCorrelatorsPionME(soa::Filtered& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -1047,10 +974,6 @@ 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); } } diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index 7b2232dcaff..52e3ca8c29c 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -16,51 +16,42 @@ /// 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 "PWGCF/GenericFramework/Core/FlowContainer.h" +#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/GFW.h" #include "PWGCF/GenericFramework/Core/GFWCumulant.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.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/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" - -#include "Common/DataModel/Centrality.h" +#include "PWGCF/GenericFramework/Core/GFWConfig.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Qvectors.h" +#include "Common/Core/TrackSelection.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 "Common/DataModel/Centrality.h" +#include "Common/DataModel/Qvectors.h" using std::complex; +using std::cout; +using std::endl; using std::pow; using std::string; @@ -68,6 +59,7 @@ 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; @@ -112,8 +104,8 @@ struct DQEventQvector { Produces eventQvector; Produces eventQvectorExtra; - // 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 eventQvectorCentr; + Produces eventQvectorCentrExtra; Produces eventRefFlow; Produces eventQvectorZN; @@ -345,12 +337,11 @@ struct DQEventQvector { } // Fill the tree for the reduced event table with Q vector quantities - // 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()); - // } + 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 @@ -539,10 +530,9 @@ struct DQEventQvector { } } if (fEventCut->IsSelected(VarManager::fgValues)) { - // 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()); + 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/filterPP.cxx b/PWGDQ/Tasks/filterPP.cxx index 1bfa487594e..61065f3fc74 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 -#include -#include -#include -#include -#include -#include +#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 +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 5cce787ffd7..850b5811d8a 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -19,33 +19,35 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#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 diff --git a/PWGDQ/Tasks/filterPbPb.cxx b/PWGDQ/Tasks/filterPbPb.cxx index 8132956aa5b..f127a7f3c26 100644 --- a/PWGDQ/Tasks/filterPbPb.cxx +++ b/PWGDQ/Tasks/filterPbPb.cxx @@ -9,27 +9,17 @@ // 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 "Common/DataModel/EventSelection.h" -#include +#include "CommonConstants/LHCConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Vertex.h" #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 e2a9814bd20..c3dbce0865f 100644 --- a/PWGDQ/Tasks/mchAlignRecord.cxx +++ b/PWGDQ/Tasks/mchAlignRecord.cxx @@ -16,45 +16,58 @@ #include "PWGDQ/Core/VarManager.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/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 using namespace o2; @@ -63,6 +76,8 @@ 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 321cacb238d..efabe3b2d51 100644 --- a/PWGDQ/Tasks/mftMchMatcher.cxx +++ b/PWGDQ/Tasks/mftMchMatcher.cxx @@ -14,41 +14,37 @@ #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 -#include -#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 "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 diff --git a/PWGDQ/Tasks/muonDCA.cxx b/PWGDQ/Tasks/muonDCA.cxx index bbb4b63db5e..a607ad16b4b 100644 --- a/PWGDQ/Tasks/muonDCA.cxx +++ b/PWGDQ/Tasks/muonDCA.cxx @@ -16,24 +16,13 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include +#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 using namespace o2; diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index 7ba8a128625..7ffbc5f2c6c 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -16,70 +16,30 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 "rapidjson/document.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::mch; using namespace o2::framework; @@ -154,7 +114,6 @@ 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 @@ -177,10 +136,6 @@ 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 @@ -212,13 +167,6 @@ 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}; @@ -413,26 +361,6 @@ 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)"}; @@ -447,8 +375,6 @@ 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"}; @@ -469,11 +395,6 @@ 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) { @@ -517,9 +438,6 @@ 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", @@ -530,29 +448,6 @@ 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)"}}}); - - 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}}); @@ -561,38 +456,6 @@ 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) @@ -660,8 +523,8 @@ struct muonGlobalAlignment { int getNumDE() { - static int nDE = 0; - if (nDE <= 0) { + static int nDE = -1; + if (nDE < 0) { for (int c = 0; c < 10; c++) { nDE += getNumDEinChamber(c); } @@ -1054,7 +917,7 @@ struct muonGlobalAlignment { return fwdtrack; } - void TransformMFTPar(o2::mch::TrackParam& track) + void TransformMFT(o2::mch::TrackParam& track) { // double zCH10 = -1437.6; double z = track.getZ(); @@ -1087,7 +950,7 @@ struct muonGlobalAlignment { { auto mchTrack = FwdtoMCH(track); - TransformMFTPar(mchTrack); + TransformMFT(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); track.setParameters(transformedTrack.getParameters()); @@ -1104,7 +967,7 @@ struct muonGlobalAlignment { auto mchTrack = FwdtoMCH(track); - TransformMFTPar(mchTrack); + TransformMFT(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); fwdtrack.setParameters(transformedTrack.getParameters()); @@ -1354,11 +1217,11 @@ struct muonGlobalAlignment { return propmuon; } - template - o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const o2::mch::TrackParam& mchTrackPar, const double z) + template + o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const TMCH& mchTrack, const double z) { // extrapolation with MCH tools - auto mchTrackAtMFT = mchTrackPar; + auto mchTrackAtMFT = FwdtoMCH(FwdToTrackPar(mchTrack)); o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrackAtMFT, mftTrack.z()); auto mftTrackPar = FwdToTrackPar(mftTrack); @@ -1369,13 +1232,24 @@ struct muonGlobalAlignment { UpdateTrackMomentum(mftTrackProp, mchTrackAtMFT); if (z < -505.f) { o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -466.f); - UpdateTrackMomentum(mftTrackProp, mchTrackPar); + UpdateTrackMomentum(mftTrackProp, sExtrap.FwdtoMCH(FwdToTrackPar(mchTrack))); } 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, @@ -1472,7 +1346,7 @@ struct muonGlobalAlignment { } if (fEnableVertexShiftAnalysis) { - if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f && mftNclusters >= 6) { + if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f) { 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}; @@ -1482,14 +1356,6 @@ 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); } } } @@ -1520,7 +1386,7 @@ struct muonGlobalAlignment { continue; } - bool isGoodMFT = IsGoodMFT(mftTrack, fTrackChi2MftUp, 5); + bool isGoodMFT = IsGoodMFT(mftTrack, 999.f, 5); if (!isGoodMFT) { continue; } @@ -1543,75 +1409,13 @@ 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, aod::FwdTrkCls const& clusters, const std::map& collisionInfos) { - if (!fEnableMftMchResidualsAnalysis && !fEnableMftMchMatchingAnalysis) { + if (!fEnableMftMchResidualsAnalysis) { return; } @@ -1641,153 +1445,80 @@ 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); - } - - 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; - - 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 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); - } - } + // 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; + int deIndex = getDEindex(deId); - // 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()); + math_utils::Point3D local; + math_utils::Point3D master; - std::array xPos{master.x(), mftTrackAtCluster.getX()}; - std::array yPos{master.y(), mftTrackAtCluster.getY()}; + master.SetXYZ(cluster.x(), cluster.y(), cluster.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]); + if (configRealign.fEnableMCHRealign) { + // Transformation from reference geometry frame to new geometry frame + transformRef[cluster.deId()].MasterToLocal(master, local); + transformNew[cluster.deId()].LocalToMaster(local, master); - 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()); - } + mch::Cluster* clusterMCH = new mch::Cluster(); + clusterMCH->x = master.x(); + clusterMCH->y = master.y(); + clusterMCH->z = master.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()); + 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; - std::array xPos{masterWithCorr.x(), mftTrackAtClusterWithCorr.getX()}; - std::array yPos{masterWithCorr.y(), mftTrackAtClusterWithCorr.getY()}; + // Add transformed cluster into temporary variable + convertedTrack.createParamAtCluster(*clusterMCH); + } - 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]); + auto mftTrackAtCluster = PropagateMFTtoMCH(mftTrack, mchTrack, master.z()); - 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()); - } - } + std::array xPos{master.x(), mftTrackAtCluster.getX()}; + std::array yPos{master.y(), mftTrackAtCluster.getY()}; - 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()); - } - } + 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]); - if (convertedTrackWithCorrOk) { - auto mchTrackAtDCA = PropagateMCHRealigned(convertedTrackWithCorr, collision.posZ()); - auto dcax = mchTrackAtDCA.getX() - collision.posX(); - auto dcay = mchTrackAtDCA.getY() - collision.posY(); + 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("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); + 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()); } } - // 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()); + if (!removable) { + 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()); } } } diff --git a/PWGDQ/Tasks/qaMatching.cxx b/PWGDQ/Tasks/qaMatching.cxx index 9611f690500..ea18c0aa9d7 100644 --- a/PWGDQ/Tasks/qaMatching.cxx +++ b/PWGDQ/Tasks/qaMatching.cxx @@ -15,72 +15,31 @@ // #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 "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 "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 - using namespace o2; using namespace o2::framework; using namespace o2::aod; diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index d4601569e86..77077aeeb75 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -34,46 +34,44 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UPCHelpers.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.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 "Tools/ML/MlResponse.h" #include "Tools/ML/model.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 "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 diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 3c776e2a42d..fdb1c4c0d6f 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -22,39 +22,36 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#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 +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 8fa36edcc28..5a71f06bbce 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -26,48 +26,42 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TableHelper.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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/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 using std::cout; @@ -78,7 +72,6 @@ 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 @@ -1655,8 +1648,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()); } } @@ -2540,12 +2533,6 @@ 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 @@ -2567,7 +2554,6 @@ 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); }; @@ -3340,10 +3326,6 @@ 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; @@ -3377,12 +3359,6 @@ 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"); @@ -3640,22 +3616,6 @@ 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) @@ -3732,21 +3692,8 @@ 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(), 1. / Effweight_rec); + VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom()); // 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], @@ -3851,9 +3798,6 @@ 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) { @@ -3911,14 +3855,6 @@ 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); @@ -3966,25 +3902,8 @@ 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(), 1. / Effweight_rec); + VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom()); // loop over dilepton leg cuts and track cuts and fill histograms separately for each combination for (int icut = 0; icut < fNCuts; icut++) { diff --git a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx index 3fa16a5d80d..1cdf8f65336 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx @@ -22,49 +22,42 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/ctpRateFetcher.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 -#include -#include -#include -#include -#include -#include +#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 "TGeoGlobalMagField.h" +#include +#include #include #include -#include +#include #include -#include - -#include -#include -#include +#include #include -#include #include #include #include @@ -79,7 +72,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; -using namespace o2::common::core; Zorro zorro; @@ -281,7 +273,6 @@ 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; @@ -405,7 +396,7 @@ struct AnalysisEventSelection { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); + rctChecker.init(fConfigRCT.fConfigRCTLabel); } cout << "AnalysisEventSelection::init() completed" << endl; diff --git a/PWGDQ/Tasks/taskFwdTrackPid.cxx b/PWGDQ/Tasks/taskFwdTrackPid.cxx index 8f7febbbf28..33b89b0e745 100644 --- a/PWGDQ/Tasks/taskFwdTrackPid.cxx +++ b/PWGDQ/Tasks/taskFwdTrackPid.cxx @@ -13,27 +13,41 @@ /// \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 -#include -#include -#include -#include -#include - +#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 diff --git a/PWGDQ/Tasks/taskJpsiHf.cxx b/PWGDQ/Tasks/taskJpsiHf.cxx index b41950b4056..fcc78628b20 100644 --- a/PWGDQ/Tasks/taskJpsiHf.cxx +++ b/PWGDQ/Tasks/taskJpsiHf.cxx @@ -15,26 +15,18 @@ /// \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 -#include -#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/runDataProcessing.h" + #include #include #include diff --git a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx index 999b46bd148..ff161fbafc1 100644 --- a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx +++ b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx @@ -21,18 +21,10 @@ #include "PWGDQ/DataModel/MchTrkEffTables.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + #include #include diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index f464459adf0..4a809dc9b86 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -23,37 +23,40 @@ #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 -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include +#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 using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using std::array; /*using FullTracksExt = soa::Join +#include "Framework/Logger.h" -#include - -#include -#include #include #include diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index feba64b0410..b9179122279 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -19,27 +19,21 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/RecoDecay.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/DataTypes.h" +#include "Framework/Logger.h" -#include -#include -#include - -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include - -#include +#include "Math/Vector4D.h" +#include "TNamed.h" #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; class DielectronCut : public TNamed { @@ -114,9 +108,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 = 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()); + 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()); if (v12.M() < mMinMee || mMaxMee < v12.M()) { return false; @@ -463,7 +457,7 @@ class DielectronCut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DielectronCuts::kDCA3Dsigma: - return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < dca3DinSigma(track) && 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 c31d605078a..5238c549445 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -31,292 +31,273 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.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 "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 #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 = o2::soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = o2::soa::Join; +using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = o2::soa::Filtered; +using FilteredMyElectrons = soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = o2::soa::Join; +using MyMuons = soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = o2::soa::Filtered; +using FilteredMyMuons = soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -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_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; +using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMFwdTrack>; template struct Dilepton { // Configurables - 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, 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 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> - - o2::framework::Configurable cfgNumBootstrapSamples{"cfgNumBootstrapSamples", 1, "Number of Bootstrap Samples"}; + 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> EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; + 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"}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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"}; + 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"}; } dimuoncuts; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "zorroGroup"; - o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + 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"}; - o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -326,11 +307,11 @@ struct Dilepton { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber; float d_bz; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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/"}; @@ -352,7 +333,7 @@ struct Dilepton { float beamP2 = 0.f; // beam momentum TH2D* h2sp_resolution = nullptr; - void init(o2::framework::InitContext& /*context*/) + void init(InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -366,11 +347,11 @@ struct Dilepton { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -383,11 +364,11 @@ struct Dilepton { } } - if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -400,11 +381,11 @@ struct Dilepton { } } - if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -418,11 +399,11 @@ struct Dilepton { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -450,23 +431,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}|", 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}", 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 } 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)", 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", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -599,27 +580,27 @@ struct Dilepton { } // pair info - 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}; + 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}; 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", 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); 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})", 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.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 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_l_ll{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; + 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.)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -629,25 +610,25 @@ struct Dilepton { } else { 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); + 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); 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::kFlowV2SP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { - if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2SP)) { + } 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)) { nmod = 2; - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { nmod = 3; } - 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 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", 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", 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/"); @@ -661,51 +642,23 @@ struct Dilepton { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - 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); + 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); 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 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); + 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); 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 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.add("Pair/same/uls/hs", "dilepton", 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 +672,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()), 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); } void DefineEMEventCut() @@ -875,7 +828,7 @@ struct Dilepton { } template - bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector weightvector) + bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) { if constexpr (ev_id == 0) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -930,25 +883,25 @@ struct Dilepton { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgUseSignedDCA) { - 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()); + pair_dca = pairDCASignQuadSum(dca3DinSigma(t1), dca3DinSigma(t2), t1.sign(), t2.sign()); } else { - 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)); + pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); } if (cfgDCAType == 1) { if (cfgUseSignedDCA) { - 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()); + pair_dca = pairDCASignQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2), t1.sign(), t2.sign()); } else { - 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)); + pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); } } else if (cfgDCAType == 2) { if (cfgUseSignedDCA) { - 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()); + pair_dca = pairDCASignQuadSum(dcaZinSigma(t1), dcaZinSigma(t2), t1.sign(), t2.sign()); } else { - 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)); + pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); } } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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)); + pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { @@ -966,9 +919,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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - 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); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); } } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ @@ -978,9 +931,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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - 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); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); } } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- @@ -990,9 +943,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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - 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); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); } } } @@ -1001,8 +954,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_l_ll = v1.Phi() - v12.Phi(); - o2::math_utils::bringToPMPi(dphi_l_ll); + float dphi_e_ee = v1.Phi() - v12.Phi(); + o2::math_utils::bringToPMPi(dphi_e_ee); 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())}; @@ -1017,13 +970,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_l_ll), 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_e_ee), 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_l_ll), 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_e_ee), 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_l_ll), 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_e_ee), cos_thetaPol, weight); } - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2SP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; @@ -1088,6 +1041,7 @@ 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); @@ -1101,80 +1055,6 @@ 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 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][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))); - - 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); @@ -1194,9 +1074,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -1204,9 +1084,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -1215,9 +1095,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -1225,9 +1105,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -1236,48 +1116,48 @@ struct Dilepton { return true; } - 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); + 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); TEMH* emh_pos = nullptr; TEMH* emh_neg = nullptr; @@ -1370,20 +1250,6 @@ 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) { @@ -1403,20 +1269,20 @@ 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, bootstrapweights); + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks, bootstrapweights); + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks, bootstrapweights); + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks); if (is_pair_ok) { nlsmm++; } @@ -1498,25 +1364,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, bootstrapweights); + fillPairInfo<1>(collision, pos, neg, cut, nullptr); } } 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, bootstrapweights); + fillPairInfo<1>(collision, neg, pos, cut, nullptr); } } 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, bootstrapweights); + fillPairInfo<1>(collision, pos1, pos2, cut, nullptr); } } 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, bootstrapweights); + fillPairInfo<1>(collision, neg1, neg2, cut, nullptr); } } } // end of loop over mixed event pool @@ -1628,17 +1494,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(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())); } @@ -1690,7 +1556,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1712,7 +1578,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1724,7 +1590,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false); - void processNorm(o2::aod::EMEventNormInfos const& collisions) + void processNorm(aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { if (collision.centFT0C() < eventcuts.cfgCentMin || eventcuts.cfgCentMax < collision.centFT0C()) { @@ -1798,7 +1664,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processNorm, "process normalization info", false); - void processBC(o2::aod::EMBCs const& bcs) + void processBC(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 d93d829ecdb..e6d7eb0960e 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -32,291 +32,281 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.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 "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 -#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 = o2::soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = o2::soa::Join; +using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = o2::soa::Filtered; +using FilteredMyElectrons = soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = o2::soa::Join; +using MyMuons = soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = o2::soa::Filtered; +using FilteredMyMuons = soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -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 +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 template struct DileptonHadronMPC { // Configurables - 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 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"}; // Configurable cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"}; // Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; - 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"}; + 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::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 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 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"}; + 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"}; EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; + 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"}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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"}; + 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"}; } dimuoncuts; EMTrackCut fEMTrackCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "trackcut_group"; - 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. + 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. } trackcuts; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "zorroGroup"; - o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + 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"}; - o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber; float d_bz; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; Zorro zorro; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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/"}; @@ -327,7 +317,7 @@ struct DileptonHadronMPC { float leptonM1 = 0.f; float leptonM2 = 0.f; - void init(o2::framework::InitContext& /*context*/) + void init(InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -338,11 +328,11 @@ struct DileptonHadronMPC { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -355,11 +345,11 @@ struct DileptonHadronMPC { } } - if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -372,11 +362,11 @@ struct DileptonHadronMPC { } } - if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -390,11 +380,11 @@ struct DileptonHadronMPC { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == 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, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -426,10 +416,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}", 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); hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); } @@ -504,7 +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", 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", 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)"; @@ -538,59 +528,59 @@ struct DileptonHadronMPC { } // dilepton info - 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}; + 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}; // dilepton-hadron info - const o2::framework::AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; + const AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; // hadron-hadron info - const o2::framework::AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; + const AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; - 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); + 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); - 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", 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 o2::framework::AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; + const 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", 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}|", 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); + 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); 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}|", 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}; + const 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", 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); + 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); } - 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}|", 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()), 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); } void DefineEMEventCut() @@ -772,14 +762,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - 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)); + pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); if (cfgDCAType == 1) { - 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)); + pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - 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)); + pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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)); + pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); } if (t1.sign() * t2.sign() < 0) { // ULS @@ -799,9 +789,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -809,9 +799,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -820,9 +810,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -830,9 +820,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - 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())); + 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())); } else { - 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())); + 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())); } } } @@ -912,14 +902,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - 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)); + pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); if (cfgDCAType == 1) { - 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)); + pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - 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)); + pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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)); + pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { @@ -1005,53 +995,53 @@ struct DileptonHadronMPC { return true; } - 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; + 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; using RefTrack = RefTracks::iterator; - 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; + 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; using FilteredRefTrack = FilteredRefTracks::iterator; TEMH* emh_pos = nullptr; @@ -1106,7 +1096,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillDilepton<0>(collision, pos, neg, cut); if (is_pair_ok) { nuls++; @@ -1115,7 +1105,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); if (is_pair_ok) { nlspp++; @@ -1124,7 +1114,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); if (is_pair_ok) { nlsmm++; @@ -1147,13 +1137,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, o2::aod::pwgem::dilepton::utils::EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); + emh_ref->AddTrackToEventPool(key_df_collision, 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(o2::soa::CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { + 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); } @@ -1447,17 +1437,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -1511,7 +1501,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1533,7 +1523,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = 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 83a56821628..0c00de8bec5 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -28,78 +28,60 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.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 "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 #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; -using MyCollisions = o2::soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = o2::soa::Join; +using MyMCCollisions = soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = o2::soa::Join; +using MyMCElectrons = soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = o2::soa::Filtered; +using FilteredMyMCElectrons = soa::Filtered; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; -using MyMCMuons = o2::soa::Join; +using MyMCMuons = soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = o2::soa::Filtered; +using FilteredMyMCMuons = soa::Filtered; using FilteredMyMCMuon = FilteredMyMCMuons::iterator; -using MySmearedElectrons = o2::soa::Join; +using MySmearedElectrons = soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = o2::soa::Join; +using MySmearedMuons = soa::Join; using MySmearedMuon = MySmearedMuons::iterator; // template @@ -107,230 +89,230 @@ template 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> + 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 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> EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; + 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"}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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. + 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. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; int mRunNumber; float d_bz; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "mctrackcut_group"; - 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"}; + 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"}; } mctrackcuts; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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] = { @@ -363,8 +345,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)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; @@ -389,17 +371,17 @@ struct DileptonMC { } // pair info - 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)"}; + 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)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -410,17 +392,17 @@ struct DileptonMC { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - 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 + 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 // 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", 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 +422,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", 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 +466,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", 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 +474,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", 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 +496,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})", 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); 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})", 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/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})", 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/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}", 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("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", 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,26 +548,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", 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", 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", 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 } if (cfgFillUnfolding) { // for 2D unfolding - 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. + 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. fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lspp/"); fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lsmm/"); fRegistry.addClone("Unfold/sm/", "Unfold/ccbar/"); @@ -603,7 +585,7 @@ struct DileptonMC { float leptonM1 = 0.f; float leptonM2 = 0.f; int pdg_lepton = 0; - void init(o2::framework::InitContext&) + void init(InitContext&) { if (doprocessAnalysis && doprocessAnalysis_Smeared) { LOGF(fatal, "Cannot enable doprocessAnalysis and doprocessAnalysis_Smeared at the same time. Please choose one."); @@ -636,7 +618,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", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -819,18 +801,18 @@ struct DileptonMC { int FindSMULS(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - 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) + 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) }; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); @@ -841,12 +823,12 @@ struct DileptonMC { int FindSMLSPP(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - 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)}; + 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)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -856,12 +838,12 @@ struct DileptonMC { int FindSMLSMM(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - 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)}; + 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)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -1526,14 +1508,14 @@ struct DileptonMC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - 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)); + pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); if (cfgDCAType == 1) { - 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)); + pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - 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)); + pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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)); + pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), 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); @@ -1558,10 +1540,10 @@ struct DileptonMC { o2::math_utils::bringToPMPi(phiPol); float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f; - 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 + 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 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); @@ -1599,7 +1581,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 = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); + int hfee_type = IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1612,21 +1594,21 @@ struct DileptonMC { float deltaPt2 = t2mc.pt() - t2.pt(); switch (std::abs(mcmother.pdgCode())) { case 111: - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 + if (IsFromCharm(mcmother, mcparticles) < 0 && 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); } } } else { // non-prompt pi0 @@ -1635,15 +1617,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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); } } } @@ -1674,18 +1656,18 @@ struct DileptonMC { } break; case 443: - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { + if (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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); } } } else { @@ -1693,19 +1675,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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), 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"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); } } } break; case 100443: - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { + if (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 @@ -1734,19 +1716,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1mc.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2mc.mothersIds()[0]); switch (hfee_type) { - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): + case static_cast(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: @@ -1768,7 +1750,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 = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1, t2, mcparticles); + int hfee_type = IsHF(t1, t2, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1869,10 +1851,10 @@ struct DileptonMC { if (mcmother.isPhysicalPrimary() || mcmother.producedByGenerator()) { switch (std::abs(mcmother.pdgCode())) { case 111: - 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 + 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 } break; case 221: @@ -1897,14 +1879,14 @@ struct DileptonMC { } break; case 443: - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { + if (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 (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { + if (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 @@ -1918,19 +1900,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2.mothersIds()[0]); switch (hfee_type) { - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): + case static_cast(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(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): + case static_cast(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: @@ -2026,7 +2008,7 @@ struct DileptonMC { } break; case 443: - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcParticle, mcParticles) > 0) { + if (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); @@ -2072,15 +2054,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillTruePairInfo(collision, mccollisions, neg1, neg2, cut, tracks, mcparticles); } // end of LS-- pair loop @@ -2113,18 +2095,18 @@ struct DileptonMC { } fRegistry.fill(HIST("MCEvent/after/hZvtx"), mccollision.posZ()); - 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); + auto posTracks_per_coll = posTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); + auto negTracks_per_coll = negTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); - for (const auto& [t1, t2] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillGenPairInfo(t1, t2, mcparticles); } // end of true ULS pair loop - for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillGenPairInfo(t1, t2, mcparticles); } // end of true LS++ pair loop - for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillGenPairInfo(t1, t2, mcparticles); } // end of true LS-- pair loop @@ -2211,7 +2193,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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) { @@ -2227,7 +2209,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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) { @@ -2243,7 +2225,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(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) { @@ -2401,7 +2383,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 = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); + int hfee_type = IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -2439,19 +2421,19 @@ struct DileptonMC { } } else if (hfee_type > -1) { switch (hfee_type) { - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): + case static_cast(EM_HFeeType::kCe_Ce): fillHistogramsUnfolding<1>(t1, t2, mcparticles); break; - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): + case static_cast(EM_HFeeType::kBe_Be): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): + case static_cast(EM_HFeeType::kBCe_BCe): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): + case static_cast(EM_HFeeType::kBCe_Be_SameB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): + case static_cast(EM_HFeeType::kBCe_Be_DiffB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; default: @@ -2481,13 +2463,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillPairUnfolding(neg1, neg2, tracks, cut, mcCollisions, mcparticles); } // end of LS-- pairing } // end of collision loop @@ -2495,57 +2477,57 @@ struct DileptonMC { std::unordered_map map_best_match_globalmuon; - 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) + 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) { // 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) { @@ -2558,7 +2540,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles); } @@ -2573,10 +2555,10 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis, "run dilepton mc analysis", true); - 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- + 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- void processAnalysis_Smeared(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, TLeptons const& leptons, TSmeardMCParitlces const& mcparticles_smeared) { @@ -2591,7 +2573,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles_smeared); } @@ -2606,7 +2588,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis_Smeared, "run dilepton mc analysis with smearing", false); - void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, o2::aod::EMMCGenVectorMesons const& mcparticles) + void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, aod::EMMCGenVectorMesons const& mcparticles) { // for oemga, phi efficiency for (const auto& collision : collisions) { @@ -2658,7 +2640,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processGen_VM, "process generated info for vector mesons", false); - void processNorm(o2::aod::EMEventNormInfos const& collisions) + void processNorm(aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -2727,7 +2709,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processNorm, "process normalization info", false); - void processBC(o2::aod::EMBCs const& bcs) + void processBC(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 93077f63c32..69327c1b068 100644 --- a/PWGEM/Dilepton/Core/DileptonProducer.h +++ b/PWGEM/Dilepton/Core/DileptonProducer.h @@ -21,261 +21,266 @@ #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/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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include +#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 -#include -#include -#include +#include +#include #include +#include +#include #include -#include +#include #include #include -using MyCollisions = o2::soa::Join; +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 MyCollision = MyCollisions::iterator; -using MyElectrons = o2::soa::Join; +using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = o2::soa::Filtered; +using FilteredMyElectrons = soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = o2::soa::Join; +using MyMuons = soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = o2::soa::Filtered; +using FilteredMyMuons = soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct DileptonProducer { - o2::framework::Produces eventTable; - o2::framework::Produces normTable; - o2::framework::Produces dileptonTable; + Produces eventTable; + Produces normTable; + Produces dileptonTable; // Configurables - 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"}; + 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"}; EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; + 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"}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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"}; + 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"}; } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber; float d_bz; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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(o2::framework::InitContext& /*context*/) + void init(InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -286,7 +291,11 @@ 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(); + addhistograms(); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { DefineDielectronCut(); leptonM1 = o2::constants::physics::MassElectron; @@ -341,7 +350,13 @@ struct DileptonProducer { fDielectronCut.SetTrackPhiPositionRange(dielectroncuts.cfg_min_phiposition_track, dielectroncuts.cfg_max_phiposition_track, dielectroncuts.cfgRefR, d_bz, dielectroncuts.cfg_mirror_phi_track); } - ~DileptonProducer() {} + ~DileptonProducer() + { + } + + void addhistograms() + { + } void DefineEMEventCut() { @@ -365,6 +380,7 @@ struct DileptonProducer { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } + o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; void DefineDielectronCut() { fDielectronCut = DielectronCut("fDielectronCut", "fDielectronCut"); @@ -444,8 +460,7 @@ 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.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.SetMatchingChi2MCHMFT(0.f, dimuoncuts.cfg_max_matching_chi2_mftmch); 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); @@ -455,7 +470,7 @@ struct DileptonProducer { } template - bool fillPairInfo(TCollision const&, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) + bool fillPairInfo(TCollision const&, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { @@ -471,16 +486,13 @@ struct DileptonProducer { if (!cut.template IsSelectedTrack(t1) || !cut.template IsSelectedTrack(t2)) { return false; } - if (!map_best_match_globalmuon[t1.globalIndex()] || !map_best_match_globalmuon[t2.globalIndex()]) { + + 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 (!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) { @@ -504,18 +516,18 @@ struct DileptonProducer { float dca1 = 999.f, dca2 = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1); - dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2); + dca1 = dca3DinSigma(t1); + dca2 = dca3DinSigma(t2); if (cfgDCAType == 1) { - dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1); - dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2); + dca1 = dcaXYinSigma(t1); + dca2 = dcaXYinSigma(t2); } else if (cfgDCAType == 2) { - dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1); - dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2); + dca1 = dcaZinSigma(t1); + dca2 = dcaZinSigma(t2); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); - dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); + dca1 = fwdDcaXYinSigma(t1); + dca2 = fwdDcaXYinSigma(t2); } // fill table here @@ -527,48 +539,48 @@ struct DileptonProducer { return true; } - 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 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) && - 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); - + 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); + + int ndf = 0; template void runPairing(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TAllTracks const& tracks) { @@ -580,7 +592,7 @@ struct DileptonProducer { continue; } - float eventplanes_2_for_mix[7] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg(), collision.ep2fv0a()}; + float eventplanes_2_for_mix[6] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; float ep2 = eventplanes_2_for_mix[cfgEP2Estimator_for_Mix]; if (!fEMEventCut.IsSelected(collision)) { @@ -596,7 +608,7 @@ struct DileptonProducer { int nuls = 0, nlspp = 0, nlsmm = 0; if (cfgStoreULS) { - for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillPairInfo(collision, pos, neg, cut, tracks); if (is_pair_ok) { nuls++; @@ -604,13 +616,13 @@ struct DileptonProducer { } } if (cfgStoreLS) { - for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillPairInfo(collision, neg1, neg2, cut, tracks); if (is_pair_ok) { nlsmm++; @@ -619,13 +631,13 @@ struct DileptonProducer { } if (nuls > 0 || nlspp > 0 || nlsmm > 0) { - eventTable(collision.runNumber(), collision.globalBC(), collision.timestamp(), collision.posZ(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), centralities[cfgCentEstimator], ep2); + eventTable(collision.runNumber(), collision.globalBC(), collision.timestamp(), collision.posZ(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), ep2); } } // end of collision loop } // end of DF template - bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) + bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { @@ -641,16 +653,13 @@ struct DileptonProducer { if (!cut.IsSelectedTrack(t1) || !cut.IsSelectedTrack(t2)) { return false; } - if (!map_best_match_globalmuon[t1.globalIndex()] || !map_best_match_globalmuon[t2.globalIndex()]) { + + 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 (!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) { @@ -689,17 +698,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(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(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(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(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())); } @@ -742,8 +751,6 @@ 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) { @@ -754,18 +761,17 @@ 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(); - map_best_match_globalmuon.clear(); + ndf++; } PROCESS_SWITCH(DileptonProducer, processAnalysis, "run dilepton analysis", true); - void processNorm(o2::aod::EMEventNormInfos const& collisions) + void processNorm(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 f3a67d06d4a..c5e9743bf10 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.cxx +++ b/PWGEM/Dilepton/Core/DimuonCut.cxx @@ -15,11 +15,8 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" -#include +#include "Framework/Logger.h" -#include - -#include #include ClassImp(DimuonCut); diff --git a/PWGEM/Dilepton/Core/DimuonCut.h b/PWGEM/Dilepton/Core/DimuonCut.h index 4f009b456db..dd10561196d 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.h +++ b/PWGEM/Dilepton/Core/DimuonCut.h @@ -18,22 +18,21 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include -#include -#include - -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include - -#include - -#include -#include -#include +#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 +using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; class DimuonCut : public TNamed { @@ -93,8 +92,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); - float dca_xy_t2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); + float dca_xy_t1 = fwdDcaXYinSigma(t1); + float dca_xy_t2 = 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()) { @@ -229,7 +228,7 @@ class DimuonCut : public TNamed return mEnableTTCA ? true : track.isAssociatedToMPC(); case DimuonCuts::kMFTHitMap: { - 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)}; + std::vector mftHitMap{checkMFTHitMap<0, 1>(track), checkMFTHitMap<2, 3>(track), checkMFTHitMap<4, 5>(track), checkMFTHitMap<6, 7>(track), 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 fd418c45abb..58e3c5be4e8 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.cxx +++ b/PWGEM/Dilepton/Core/EMEventCut.cxx @@ -15,9 +15,7 @@ #include "PWGEM/Dilepton/Core/EMEventCut.h" -#include - -#include +#include "Framework/Logger.h" ClassImp(EMEventCut); diff --git a/PWGEM/Dilepton/Core/EMEventCut.h b/PWGEM/Dilepton/Core/EMEventCut.h index b0450f5b575..3cc785e80a8 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.h +++ b/PWGEM/Dilepton/Core/EMEventCut.h @@ -18,9 +18,12 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" -#include +#include "TNamed.h" + +using namespace std; class EMEventCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/EMTrackCut.cxx b/PWGEM/Dilepton/Core/EMTrackCut.cxx index fda35ac925f..cd995e08836 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.cxx +++ b/PWGEM/Dilepton/Core/EMTrackCut.cxx @@ -15,11 +15,7 @@ #include "PWGEM/Dilepton/Core/EMTrackCut.h" -#include - -#include - -#include +#include "Framework/Logger.h" ClassImp(EMTrackCut); diff --git a/PWGEM/Dilepton/Core/EMTrackCut.h b/PWGEM/Dilepton/Core/EMTrackCut.h index e338aaa2140..118c462cbf7 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.h +++ b/PWGEM/Dilepton/Core/EMTrackCut.h @@ -16,11 +16,9 @@ #ifndef PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ #define PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ -#include +#include "Framework/Logger.h" -#include - -#include +#include "TNamed.h" class EMTrackCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 06cd401f60c..3aeb5f44893 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -21,215 +21,200 @@ #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 "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 "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 -#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 MyCollisions = o2::soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = o2::soa::Join; +using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = o2::soa::Filtered; +using FilteredMyElectrons = soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = o2::soa::Join; +using MyMuons = soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = o2::soa::Filtered; +using FilteredMyMuons = soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct SingleTrackQC { // Configurables - 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"}; + 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"}; EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; + 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"}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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"}; + 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"}; } dimuoncuts; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "zorroGroup"; - o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + 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"}; - o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -239,11 +224,11 @@ struct SingleTrackQC { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber = 0; float d_bz = 0; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms + HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; ~SingleTrackQC() {} @@ -254,91 +239,91 @@ struct SingleTrackQC { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - 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)"}; + 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)"}; // 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", 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.addClone("Track/positive/", "Track/negative/"); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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 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)"}; // 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}, {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.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.addClone("Track/positive/", "Track/negative/"); } } - void init(o2::framework::InitContext&) + void init(InitContext&) { ccdb->setURL(ccdburl); ccdb->setCaching(true); @@ -358,18 +343,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}", 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 } 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", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -541,9 +526,9 @@ struct SingleTrackQC { weight = map_weight[track.globalIndex()]; } - 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 dca3D = dca3DinSigma(track); + float dcaXY = dcaXYinSigma(track); + float dcaZ = 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); @@ -553,9 +538,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::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(), 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()); @@ -593,9 +578,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::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(), 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()); @@ -637,7 +622,7 @@ struct SingleTrackQC { if (cfgApplyWeightTTCA) { weight = map_weight[track.globalIndex()]; } - float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); + float dca_xy = fwdDcaXYinSigma(track); float reldpt = (track.ptMatchedMCHMID() - track.pt()) / track.pt(); float deta = track.etaMatchedMCHMID() - track.eta(); @@ -654,7 +639,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), 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()); @@ -678,7 +663,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), 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()); @@ -862,21 +847,21 @@ struct SingleTrackQC { std::unordered_map map_best_match_globalmuon; - 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); + 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::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); + 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::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; + 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; void processQC(FilteredMyCollisions const& collisions, Types const&... args) { @@ -888,7 +873,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -909,7 +894,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -920,7 +905,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processQC_TriggeredData, "run single track QC on triggered data", false); - void processNorm(o2::aod::EMEventNormInfos const& collisions) + void processNorm(aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -989,7 +974,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processNorm, "process normalization info", false); - void processBC(o2::aod::EMBCs const& bcs) + void processBC(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 76360d6682d..39a0ca5fad6 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -21,234 +21,221 @@ #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 "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 "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 -#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 MyCollisions = o2::soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = o2::soa::Join; +using MyMCCollisions = soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = o2::soa::Join; +using MyMCElectrons = soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = o2::soa::Filtered; +using FilteredMyMCElectrons = soa::Filtered; -using MyMCMuons = o2::soa::Join; +using MyMCMuons = soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = o2::soa::Filtered; +using FilteredMyMCMuons = soa::Filtered; -using MySmearedElectrons = o2::soa::Join; +using MySmearedElectrons = soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = o2::soa::Join; +using MySmearedMuons = soa::Join; using MySmearedMuon = MySmearedMuons::iterator; template struct SingleTrackQCMC { // Configurables - 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"}; + 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"}; EMEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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 "}; + 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 "}; // for RCT - 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"}; + 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"}; } eventcuts; DielectronCut fDielectronCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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."}; + 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."}; // configuration for PID ML - 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)"}; + 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)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dimuoncut_group"; - 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. + 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. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "mctrackcut_group"; - 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"}; + 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"}; } mctrackcuts; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms + HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 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/"}; @@ -258,22 +245,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)", 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)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - 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)"}; + 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)"}; // 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", 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 +269,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", 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", 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), 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.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -318,35 +305,35 @@ 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);", 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/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/PID/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/PID/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/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.)", 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/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/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/PID/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/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.addClone("Track/PID/positive/", "Track/PID/negative/"); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - 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"}; + 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"}; // 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", 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/"); @@ -355,37 +342,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", 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", 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/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, {{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); - 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/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.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -400,7 +387,7 @@ struct SingleTrackQCMC { bool fillGenValuesForRec = false; int pdg_lepton = 0; - void init(o2::framework::InitContext&) + void init(InitContext&) { if (doprocessQCMC && doprocessQCMC_Smeared) { LOGF(fatal, "Cannot enable processQCMC and processQCMC_Smeared at the same time. Please choose one."); @@ -432,7 +419,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", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -629,9 +616,9 @@ struct SingleTrackQCMC { void fillElectronInfo(TTrack const& track) { auto mctrack = track.template emmcparticle_as(); - 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 dca3D = dca3DinSigma(track); + float dcaXY = dcaXYinSigma(track); + float dcaZ = 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); @@ -655,9 +642,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(), 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/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/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()); @@ -704,9 +691,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(), 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/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/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()); @@ -747,7 +734,7 @@ struct SingleTrackQCMC { void fillMuonInfo(TTrack const& track, TCollision const& collision) { auto mctrack = track.template emmcparticle_as(); - float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); + float dca_xy = fwdDcaXYinSigma(track); float deta = track.etaMatchedMCHMID() - track.eta(); float dphi = track.phiMatchedMCHMID() - track.phi(); o2::math_utils::bringToPMPi(dphi); @@ -773,7 +760,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 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/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()); @@ -806,7 +793,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(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 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/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()); @@ -905,21 +892,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 (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { + if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { fillTrackInfo<0, TMCParticles>(track, collision); // PromptLF } else { fillTrackInfo<1, TMCParticles>(track, collision); // NonPromptLF } } else if (pdg_mother == 443) { - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fillTrackInfo<4, TMCParticles>(track, collision); } else { fillTrackInfo<3, TMCParticles>(track, collision); } - } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. + } else if (isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. fillTrackInfo<6, TMCParticles>(track, collision); - } 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) { + } else if (isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain. + if (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. @@ -1005,21 +992,21 @@ struct SingleTrackQCMC { } if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { + if (IsFromCharm(mcmother, mcparticles) < 0 && 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 (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (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 (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found + } else if (isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); - } 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) { + } else if (isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain. + if (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. @@ -1134,29 +1121,29 @@ struct SingleTrackQCMC { } std::unordered_map map_best_match_globalmuon; - 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); + 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::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); + 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::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; + 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::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; + 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::PresliceUnsorted recColperMcCollision = o2::aod::emmceventlabel::emmceventId; + // PresliceUnsorted recColperMcCollision = aod::emmceventlabel::emmceventId; - void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, TLeptons const& tracks) + void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, TLeptons const& tracks) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgApplyWeightTTCA) { @@ -1165,7 +1152,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles); } @@ -1177,8 +1164,8 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC, "run single track QC MC", true); - 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- + Partition electronsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- + 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) { @@ -1189,7 +1176,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 = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles_smeared); } @@ -1201,7 +1188,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC_Smeared, "run single track QC MC with smearing", false); - void processNorm(o2::aod::EMEventNormInfos const& collisions) + void processNorm(aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -1270,7 +1257,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processNorm, "process normalization info", false); - void processBC(o2::aod::EMBCs const& bcs) + void processBC(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 73196abc058..882f714188e 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -16,6 +16,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 @@ -95,7 +96,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint32_t selection_bit) -> bool { retu template uint32_t reduceSelectionBit(TBC const& bc) { - // input should be o2::aod::BcSels or o2::aod::EvSels. + // input should be aod::BcSels or aod::EvSels. uint32_t bitMap = 0; if (bc.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { SETBIT(bitMap, o2::aod::emevsel::kIsTriggerTVX); @@ -156,8 +157,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 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_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_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 @@ -363,7 +364,7 @@ using EMEventCent = EMEventsCent::iterator; // using EMEventsCentBase = EMEventsCentBase_001; // using EMEventCentBase = EMEventsCentBase::iterator; // -// // Extended table with expression columns that can be used for o2::framework::expressions::Filter. +// // Extended table with expression columns that can be used for Filter. // DECLARE_SOA_EXTENDED_TABLE_USER(EMEventsCent, EMEventsCentBase, "EMCENTEXT", // emcent::CentFT0M, emcent::CentFT0A, emcent::CentFT0C, emcent::CentNTPV, emcent::CentNGlobal); // @@ -460,7 +461,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 o2::aod::Collisions +DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to aod::Collisions using EMSWTriggerBitTMP = EMSWTriggerBitsTMP::iterator; DECLARE_SOA_TABLE(EMSWTriggerInfosTMP, "AOD", "EMSWTINFOTMP", bc::RunNumber, emevent::NInspectedTVX, emevent::NScalars, emevent::NSelections, o2::soa::Marker<2>); @@ -476,14 +477,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 o2::aod::Collisions +DECLARE_SOA_TABLE(EMEventsNee, "AOD", "EMEVENTNEE", emevent::NeeULS, emevent::NeeLSpp, emevent::NeeLSmm); // joinable to EMEvents or aod::Collisions using EMEventNee = EMEventsNee::iterator; -DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to o2::aod::Collisions +DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to aod::Collisions emevent::IsSelected); using EMEvSel = EMEvSels::iterator; -DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to o2::aod::Collisions in createEMEventDilepton.cxx +DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to aod::Collisions in createEMEventDilepton.cxx emevent::IsEoI); using EMEoI = EMEoIs::iterator; @@ -535,8 +536,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); }); @@ -637,11 +638,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; @@ -848,7 +849,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, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, + track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, 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, @@ -880,7 +881,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, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, + track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, 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, @@ -913,7 +914,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, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, + track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, 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, @@ -949,40 +950,40 @@ using EMPrimaryElectrons = EMPrimaryElectrons_006; using EMPrimaryElectron = EMPrimaryElectrons::iterator; DECLARE_SOA_TABLE(EMPrimaryElectronsCov_000, "AOD", "EMPRIMARYELCOV", //! - 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>); + 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>); DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectronsCov_001, "AOD", "EMPRIMARYELCOV", 1, //! - 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. + 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. using EMPrimaryElectronsCov = EMPrimaryElectronsCov_001; // iterators @@ -1011,13 +1012,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 @@ -1112,7 +1113,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, o2::aod::fwdtrack::CXX, o2::aod::fwdtrack::CYY, o2::aod::fwdtrack::CXY, + fwdtrack::FwdDcaX, fwdtrack::FwdDcaY, aod::fwdtrack::CXX, aod::fwdtrack::CYY, aod::fwdtrack::CXY, emprimarymuon::PtMatchedMCHMID, emprimarymuon::EtaMatchedMCHMID, emprimarymuon::PhiMatchedMCHMID, // emprimarymuon::EtaMatchedMCHMIDatMP, emprimarymuon::PhiMatchedMCHMIDatMP, // emprimarymuon::EtaMatchedMFTatMP, emprimarymuon::PhiMatchedMFTatMP, @@ -1139,21 +1140,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. - // 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); + // 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); using EMPrimaryMuonsCov = EMPrimaryMuonsCov_002; // iterators using EMPrimaryMuonCov = EMPrimaryMuonsCov::iterator; @@ -1222,11 +1223,10 @@ 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, emthinevent::Centrality, emthinevent::EP2); + evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, cent::CentFT0C, emthinevent::EP2); using EMThinEvents = EMThinEvents_000; using EMThinEvent = EMThinEvents::iterator; diff --git a/PWGEM/Dilepton/DataModel/lmeeMLTables.h b/PWGEM/Dilepton/DataModel/lmeeMLTables.h index 6d877783a38..ebc5309fe00 100644 --- a/PWGEM/Dilepton/DataModel/lmeeMLTables.h +++ b/PWGEM/Dilepton/DataModel/lmeeMLTables.h @@ -9,14 +9,16 @@ // 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 +#include "Framework/AnalysisDataModel.h" -#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 33aed751377..43c3cf43e24 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx index 86ed8dde8bd..4a3af5c4313 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx index c543037fbd1..87e49f9fb5e 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx index e9bc1fd78b2..dcca6b5edc1 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx @@ -16,11 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx index 5367e71f597..60ea4f0db2e 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx @@ -16,11 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx index 7506fe10688..4f4550cccc9 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx index ed040916f03..559c871dd1a 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx index 414241dea5c..791876beb15 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx index 894d3d2984c..77f3e070980 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx index ff12b6a1405..848c24a5c69 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx @@ -16,10 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx index f4298c119c6..59227518b1a 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx @@ -16,10 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx index c1c8cd61a2a..0682d607675 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx index f51122a77a2..2965c836239 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx @@ -16,11 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include - -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx index 79dc86b136c..c782ef2cd4f 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx @@ -16,11 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include - -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx index 92df1709c3d..5f219f459ca 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx index d0f5596f445..527faf7c723 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx index 7bc2a63916b..aea074131e3 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx index 031c853b12d..abbbe47695a 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx @@ -16,11 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include - -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx index 340b74077c9..21342c4468b 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx index 2775c7275f7..cc35b94bec3 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx index bcdce816813..7ae8f3d47da 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx index 2e95f21f5c2..86c8fff432a 100644 --- a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx @@ -16,21 +16,14 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/TableHelper.h" -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index f268cdb066f..d35815b69f3 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -28,12 +28,13 @@ #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 945ac2853c9..ed9b5047afc 100644 --- a/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx @@ -15,12 +15,10 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include -#include - -using namespace o2::framework; +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx index ed298d39c39..32cd1bafa72 100644 --- a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx @@ -15,12 +15,10 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include -#include - -using namespace o2::framework; +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/eventSelection.cxx b/PWGEM/Dilepton/TableProducer/eventSelection.cxx index 7c857fd6743..89acb23000c 100644 --- a/PWGEM/Dilepton/TableProducer/eventSelection.cxx +++ b/PWGEM/Dilepton/TableProducer/eventSelection.cxx @@ -14,24 +14,13 @@ // This code produces event selection table for PWG-EM. // Please write to: daiki.sekihata@cern.ch -#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 +#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" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/filterEoI.cxx b/PWGEM/Dilepton/TableProducer/filterEoI.cxx index 31bf18c40a3..2300cbfb458 100644 --- a/PWGEM/Dilepton/TableProducer/filterEoI.cxx +++ b/PWGEM/Dilepton/TableProducer/filterEoI.cxx @@ -17,26 +17,15 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Common/Core/TableHelper.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" 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 aa8ab7bdc85..d965dde3061 100644 --- a/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx +++ b/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx @@ -17,38 +17,19 @@ #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 "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 "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector4D.h" +#include "TString.h" + #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 3c892ed0e1a..260c6233e79 100644 --- a/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx @@ -16,10 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx index 67f6d5f810c..864c4605462 100644 --- a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx @@ -16,10 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx index bfac1ecf3f3..31dc12982d5 100644 --- a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx @@ -16,10 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include -#include -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx index 0dcca6318c1..d1836d97ad0 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx @@ -16,23 +16,15 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + #include #include diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index e9fe1653412..34c20624a9f 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -19,58 +19,35 @@ #include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include - -#include -#include -#include -#include +#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 - 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 3815e0bc335..b50a0df8bab 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx @@ -16,48 +16,28 @@ #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 -#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 "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 - 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 1cf936a061f..ad27348ba7d 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx @@ -16,42 +16,28 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.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 "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 #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 382dc4a90df..a64ae751244 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -14,47 +14,36 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.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 "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 #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 d5f410eafaa..3ad5171301c 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx @@ -14,39 +14,30 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include - -#include -#include + +#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 -#include #include #include diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx index bc8402d6e7a..b7c6b98824f 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx @@ -16,37 +16,28 @@ #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 "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 "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 - 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 63d41fe1424..f0aa4f1e9aa 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -18,6 +18,8 @@ #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" @@ -25,33 +27,21 @@ #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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include - -#include -#include -#include -#include +#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 diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx index 7e04ba0aa5e..622888f29ae 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx @@ -17,47 +17,35 @@ #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 -#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/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 diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx index 9ece7b19407..ed35f705f3a 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx @@ -16,48 +16,37 @@ #include "PWGEM/Dilepton/DataModel/lmeeMLTables.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/fwdtrackUtilities.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 "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 - 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 d44dd156c62..3288bd2745e 100644 --- a/PWGEM/Dilepton/Tasks/MCtemplates.cxx +++ b/PWGEM/Dilepton/Tasks/MCtemplates.cxx @@ -13,39 +13,29 @@ // // Analysis task to generate Monte Carlo templates of different heavy-flavour dielectron sources // -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" +#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/CutsLibrary.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" -#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; @@ -490,8 +480,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 @@ -587,7 +577,7 @@ struct AnalysisSameEventPairing { } } } // end loop over barrel track pairs - } // end runPairing + } // end runPairing template void runMCGenPair(TTracksMC const& groupedMCTracks) @@ -619,7 +609,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 9d66de55cd5..eb0e7d3bf5c 100644 --- a/PWGEM/Dilepton/Tasks/associateMCcollision.cxx +++ b/PWGEM/Dilepton/Tasks/associateMCcollision.cxx @@ -14,21 +14,11 @@ // 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 91ec19cdacd..83777d2dbc1 100644 --- a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx @@ -24,56 +24,31 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.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 "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 #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 ad299df81f7..8d77e81d15f 100644 --- a/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx @@ -15,55 +15,43 @@ #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 -#include -#include -#include -#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 "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 - 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 71d1d91139b..003b1b6bfa4 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -15,46 +15,36 @@ #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 -#include -#include -#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 "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 @@ -62,8 +52,6 @@ #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 a608e07d79a..f0a35f7c814 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx @@ -20,29 +20,18 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#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 -#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 042831bff30..c8fa31b0e3b 100644 --- a/PWGEM/Dilepton/Tasks/dielectron.cxx +++ b/PWGEM/Dilepton/Tasks/dielectron.cxx @@ -14,13 +14,11 @@ // This code is for dielectron analyses. // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/Dilepton.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/Dilepton.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx index 8e5d04d67c5..42cfa2eac28 100644 --- a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx @@ -15,12 +15,10 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include -#include - -using namespace o2::framework; +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronMC.cxx b/PWGEM/Dilepton/Tasks/dielectronMC.cxx index 794b8a48a45..3c525c29c6e 100644 --- a/PWGEM/Dilepton/Tasks/dielectronMC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronMC.cxx @@ -14,13 +14,11 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/DileptonMC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/DileptonMC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx index 6f650da4771..3afec6f363a 100644 --- a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx +++ b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx @@ -19,48 +19,30 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.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 "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 #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; @@ -490,7 +472,7 @@ struct DileptonPolarization { } // end of pair1 loop } - Filter collisionFilter_centrality = eventcuts.cfgCentMin < o2::aod::emthinevent::centrality && o2::aod::emthinevent::centrality < eventcuts.cfgCentMax; + Filter collisionFilter_centrality = eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < 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 +498,7 @@ struct DileptonPolarization { { for (const auto& collision : collisions) { initCCDB(collision); - float centrality = collision.centrality(); + float centrality = collision.centFT0C(); if (centrality < eventcuts.cfgCentMin || eventcuts.cfgCentMax < centrality) { continue; } @@ -525,7 +507,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"), centrality, ep2); + fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); // event mixing int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1; diff --git a/PWGEM/Dilepton/Tasks/dimuon.cxx b/PWGEM/Dilepton/Tasks/dimuon.cxx index be0a7d8386b..51b92ab81b7 100644 --- a/PWGEM/Dilepton/Tasks/dimuon.cxx +++ b/PWGEM/Dilepton/Tasks/dimuon.cxx @@ -14,13 +14,11 @@ // This code is for dimuon analyses. // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/Dilepton.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/Dilepton.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx index c34d4ba1dbb..2e0cf5f5e59 100644 --- a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx @@ -15,12 +15,10 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include -#include - -using namespace o2::framework; +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonMC.cxx b/PWGEM/Dilepton/Tasks/dimuonMC.cxx index 58e003819ac..f505c073dc3 100644 --- a/PWGEM/Dilepton/Tasks/dimuonMC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonMC.cxx @@ -14,13 +14,11 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/DileptonMC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/DileptonMC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx index d223c5d2c1c..907161d9de2 100644 --- a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx +++ b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx @@ -23,42 +23,38 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#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 +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 6efc22b11c4..5ad4d765e25 100644 --- a/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx +++ b/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx @@ -16,35 +16,26 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.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 "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 - 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 4d52520d119..c21d08c6248 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -14,8 +14,6 @@ // 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" @@ -26,35 +24,21 @@ #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 "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 - 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 8a07ff873da..49d6a823d05 100644 --- a/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx @@ -18,32 +18,14 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MCUtilities.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 "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Task.h" +#include "Framework/runDataProcessing.h" +#include "MathUtils/Utils.h" + +#include "Math/Vector4D.h" + #include using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index 56bd936d9f3..1cac2727e98 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -14,37 +14,16 @@ /// \analysis task for lmee light flavour cocktail /// \author Daniel Samitz, , SMI Vienna -#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 +#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" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/matchingMFT.cxx b/PWGEM/Dilepton/Tasks/matchingMFT.cxx index d962d51b94d..ca2f912594e 100644 --- a/PWGEM/Dilepton/Tasks/matchingMFT.cxx +++ b/PWGEM/Dilepton/Tasks/matchingMFT.cxx @@ -13,7 +13,8 @@ /// \brief a task to study matching MFT-[MCH-MID] in MC /// \author daiki.sekihata@cern.ch -#include "Common/CCDB/EventSelectionParams.h" +#include "TableHelper.h" + #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -21,43 +22,27 @@ #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 -#include -#include -#include - -#include -#include - -#include -#include -#include +#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 - 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 e04151d9c35..9ec7f079712 100644 --- a/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx +++ b/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx @@ -15,19 +15,9 @@ /// \brief Task to build the predictions from the models based on the generated particles /// -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index b35ef08c80f..c2ac0b75d80 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -19,49 +19,29 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include -#include -#include +#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 #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 e7dd129af66..4a687e82217 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQC.cxx @@ -14,13 +14,11 @@ // Analysis task for single electron QC // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/SingleTrackQC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/SingleTrackQC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx index a6a5ece732d..da2617158ec 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx @@ -14,13 +14,11 @@ // Analysis task for single electron QC in MC // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx index f0ebe6e2f23..b9ccb722ea3 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx @@ -14,13 +14,11 @@ // Analysis task for single muon QC // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/SingleTrackQC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/SingleTrackQC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx index 55365013453..7b7176238c1 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx @@ -14,13 +14,11 @@ // Analysis task for single muon QC in MC // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" - -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" -using namespace o2::framework; +#include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/smearing.cxx b/PWGEM/Dilepton/Tasks/smearing.cxx index 3d5a8668244..03d0b272f46 100644 --- a/PWGEM/Dilepton/Tasks/smearing.cxx +++ b/PWGEM/Dilepton/Tasks/smearing.cxx @@ -16,26 +16,17 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MomentumSmearer.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#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 using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx index 7dc849507e2..d1d6452a50a 100644 --- a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx +++ b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx @@ -17,6 +17,7 @@ #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" @@ -24,35 +25,25 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.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 "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 diff --git a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx index 10c634aae02..4204a95a9c4 100644 --- a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx +++ b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx @@ -14,35 +14,20 @@ // 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 47eab1ebafb..9787a5bae04 100644 --- a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx +++ b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx @@ -14,6 +14,7 @@ #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" @@ -23,34 +24,34 @@ #include "Common/CCDB/EventSelectionParams.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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/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 +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 ea169455395..02bce88073e 100644 --- a/PWGEM/Dilepton/Tasks/taggingHFE.cxx +++ b/PWGEM/Dilepton/Tasks/taggingHFE.cxx @@ -17,6 +17,7 @@ #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" @@ -24,43 +25,29 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.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 "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 - 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 e7268360d74..f5f01ae4cfe 100644 --- a/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx +++ b/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx @@ -13,39 +13,45 @@ // 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 -#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 "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 - 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 3b8ec9ec18e..510aa5f3533 100644 --- a/PWGEM/Dilepton/Utils/EMFwdTrack.h +++ b/PWGEM/Dilepton/Utils/EMFwdTrack.h @@ -15,9 +15,6 @@ #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 8efb0c78226..1ac2f442f7e 100644 --- a/PWGEM/Dilepton/Utils/EMTrack.h +++ b/PWGEM/Dilepton/Utils/EMTrack.h @@ -15,13 +15,7 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACK_H_ #define PWGEM_DILEPTON_UTILS_EMTRACK_H_ -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include -#include - -#include +#include "Math/Vector4D.h" namespace o2::aod::pwgem::dilepton::utils { diff --git a/PWGEM/Dilepton/Utils/EMTrackUtilities.h b/PWGEM/Dilepton/Utils/EMTrackUtilities.h index c06903b1eee..47e73e31f96 100644 --- a/PWGEM/Dilepton/Utils/EMTrackUtilities.h +++ b/PWGEM/Dilepton/Utils/EMTrackUtilities.h @@ -15,13 +15,15 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ -#include +#include "Framework/DataTypes.h" +#include "Framework/Logger.h" #include -#include -#include #include +#include +#include #include +#include //_______________________________________________________________________ namespace o2::aod::pwgem::dilepton::utils::emtrackutil @@ -162,7 +164,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 +183,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,5 +213,36 @@ 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_ diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index 154441cd5ba..74dd96bdb84 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -15,29 +15,20 @@ #ifndef PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ #define PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ -#include "PWGEM/Dilepton/DataModel/dileptonTables.h" - #include "Common/Core/RecoDecay.h" -#include -#include - -#include - -#include -#include +#include "Framework/HistogramRegistry.h" -#include +using namespace o2::framework; 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) +void addEventHistograms(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", 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,152 +51,103 @@ 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)", 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); 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}", 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/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/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 } 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}", 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/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/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->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) +void fillEventInfo(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); @@ -234,7 +176,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 (std::abs(collision.posZ()) < 10.0) { + if (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)) { @@ -321,22 +263,6 @@ 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()}; @@ -383,49 +309,7 @@ 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 -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/EventMixingHandler.h b/PWGEM/Dilepton/Utils/EventMixingHandler.h index 4698654be49..20b38399979 100644 --- a/PWGEM/Dilepton/Utils/EventMixingHandler.h +++ b/PWGEM/Dilepton/Utils/EventMixingHandler.h @@ -16,6 +16,7 @@ #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 d0a9a69df0e..f8937f7d1a2 100644 --- a/PWGEM/Dilepton/Utils/MCUtilities.h +++ b/PWGEM/Dilepton/Utils/MCUtilities.h @@ -15,9 +15,10 @@ #ifndef PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/Logger.h" +#include #include #include #include diff --git a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h index e16ddd1b9c3..5ec9756b5a9 100644 --- a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h +++ b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h @@ -19,9 +19,7 @@ #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 0b1bdbbe2be..e526eb9a3db 100644 --- a/PWGEM/Dilepton/Utils/MlResponseO2Track.h +++ b/PWGEM/Dilepton/Utils/MlResponseO2Track.h @@ -18,9 +18,7 @@ #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 59bb41f948c..d0e73ee971f 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 -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Logger.h" +#include "Framework/runDataProcessing.h" -#include #include #include #include @@ -28,12 +28,15 @@ #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: @@ -573,7 +576,7 @@ class MomentumSmearer void setCcdbPathRes(TString ccdbPathRes) { fCcdbPathRes = ccdbPathRes; } void setCcdbPathEff(TString ccdbPathEff) { fCcdbPathEff = ccdbPathEff; } void setCcdbPathDCA(TString ccdbPathDCA) { fCcdbPathDCA = ccdbPathDCA; } - void setCcdb(o2::framework::Service ccdb) + void setCcdb(Service ccdb) { fCcdb = ccdb; fFromCcdb = true; @@ -642,7 +645,7 @@ class MomentumSmearer std::vector fVecDCA; int64_t fTimestamp; bool fFromCcdb = false; - o2::framework::Service fCcdb; + Service fCcdb; float fMinPtGen = -1.f; }; diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index f250ef8aa98..0758289bbee 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -18,20 +18,14 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" -#include +#include "ReconstructionDataFormats/TrackFwd.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 "Math/GenVector/Boost.h" +#include "Math/SMatrix.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" #include -#include -#include #include //_______________________________________________________________________ @@ -45,13 +39,10 @@ enum class DileptonPairType : int { enum class DileptonAnalysisType : int { kQC = 0, kUPC = 1, - kFlowV2SP = 2, - kFlowV3SP = 3, + kFlowV2 = 2, + kFlowV3 = 3, kPolarization = 4, kHFll = 5, - kBootstrapv2 = 6, - kFlowV2EP = 7, - kFlowV3EP = 8, }; enum class DileptonHadronAnalysisType : int { diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index 6aae90e5d3c..aaf16551ba6 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -22,10 +22,10 @@ #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 5647908dd1a..bf4fcfe7037 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.h +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.h @@ -15,12 +15,13 @@ #ifndef PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ #define PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ -#include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.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/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 c0709362278..f129a1ba289 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx @@ -15,7 +15,7 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include +#include "Framework/Logger.h" #include diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.h b/PWGEM/PhotonMeson/Core/DalitzEECut.h index 293a52424c0..9eb6b1a0801 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.h +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.h @@ -22,7 +22,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include @@ -34,6 +34,8 @@ #include #include +using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; + class DalitzEECut : public TNamed { public: @@ -254,7 +256,7 @@ class DalitzEECut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DalitzEECuts::kDCA3Dsigma: - return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < dca3DinSigma(track) && 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 3c262fcb540..3f10f83d55f 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -19,24 +19,17 @@ #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 @@ -287,7 +280,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 o2::framework::HistogramRegistry pointer of the main task + /// \param fRegistry 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 b6fa2594310..d272d9e5593 100644 --- a/PWGEM/PhotonMeson/Core/EMNonLin.h +++ b/PWGEM/PhotonMeson/Core/EMNonLin.h @@ -16,8 +16,9 @@ #ifndef PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ #define PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ -#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) -#include +#include + +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx index 316b01d9563..253020c7d69 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx @@ -13,12 +13,9 @@ // 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 5b14aa8d2ef..1121a6fd922 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 +#include "TNamed.h" -#include +using namespace std; class EMPhotonEventCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h index 72e3b364a46..b46e258353c 100644 --- a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h +++ b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h @@ -20,7 +20,6 @@ #include "Tools/ML/MlResponse.h" -#include #include #include diff --git a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h index 0b9cb24bbf5..094f86ceb8a 100644 --- a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h @@ -18,15 +18,14 @@ #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 3ea3e06acec..be8bee172c7 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.cxx +++ b/PWGEM/PhotonMeson/Core/PairCut.cxx @@ -13,12 +13,9 @@ // 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 c514d8946c8..19ba27c79bf 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.h +++ b/PWGEM/PhotonMeson/Core/PairCut.h @@ -16,9 +16,15 @@ #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 +#include "TNamed.h" +#include "TMath.h" class PairCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index c89fc48990f..1eb74391520 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -20,7 +20,6 @@ #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" @@ -47,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +56,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index ee823b4f4b0..442cf9d13b6 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -20,7 +20,6 @@ #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" @@ -44,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +51,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #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, o2::aod::EMEventsWeight>>; + // using FilteredMyCollisionsWithJJMC = o2::soa::Filtered, 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 ee4f8fc8083..71d7fb9f48b 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -21,6 +21,7 @@ #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" @@ -48,7 +49,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include @@ -63,155 +64,163 @@ #include #include -using MyCollisions = o2::soa::Join; +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 MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = o2::soa::Join; +using MyCollisionsWithJJMC = soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyV0Photons = o2::soa::Join; +using MyV0Photons = soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyPrimaryElectrons = o2::soa::Join; +using MyPrimaryElectrons = soa::Join; using MyPrimaryElectron = MyPrimaryElectrons::iterator; -using MyEMCClusters = o2::soa::Join; +using MyEMCClusters = soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = o2::soa::Join; +// using MyPHOSClusters = soa::Join; // using MyPHOSCluster = MyPHOSClusters::iterator; -template +template struct TaggingPi0 { - 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>; + 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"}; EMPhotonEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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)"}; + 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)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; - 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"}; + 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"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dileptoncut_group"; - 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"}; + 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"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "emccut_group"; - 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"}; + 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"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : o2::framework::ConfigurableGroup { + // struct : ConfigurableGroup { // std::string prefix = "phoscut_group"; - // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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/"}; @@ -221,11 +230,11 @@ struct TaggingPi0 { std::vector occ_bin_edges; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber; float d_bz; - void init(o2::framework::InitContext&) + void init(InitContext&) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); @@ -317,20 +326,20 @@ struct TaggingPi0 { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - 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)"}; + 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)"}; - 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)", 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.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}|", kTH1D, {{10001, -0.5, 10000.5}}, true); } void DefineEMEventCut() @@ -433,15 +442,16 @@ struct TaggingPi0 { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - 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; + SliceCache cache; + Preslice perCollision_pcm = aod::v0photonkf::pmeventId; + Preslice perCollision_emc = aod::emccluster::pmeventId; + // Preslice perCollision_phos = aod::phoscluster::pmeventId; - 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); + 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); + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; MyEMH* emh1 = nullptr; MyEMH* emh2 = nullptr; std::vector used_photonIds_per_col; // @@ -524,7 +534,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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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 @@ -539,7 +549,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(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { + for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; @@ -564,11 +574,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, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, 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, o2::aod::pwgem::dilepton::utils::EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); + emh2->AddTrackToEventPool(key_df_collision, EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); used_dileptonIds_per_col.emplace_back(tuple_tmp_id2); } ndiphoton++; @@ -578,7 +588,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(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -589,11 +599,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, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, 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, o2::aod::pwgem::dilepton::utils::EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); + emh2->AddTrackToEventPool(key_df_collision, EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); used_photonIds_per_col.emplace_back(g2.globalIndex()); } ndiphoton++; @@ -639,7 +649,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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == PairType::kPCMDalitzEE) { v2.SetM(g2.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; @@ -657,29 +667,29 @@ struct TaggingPi0 { } // end of collision loop } - 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; + 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; int ndf = 0; void processAnalysis(FilteredMyCollisions const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { + // else if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { + // } else if constexpr (pairtype == 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...)); @@ -689,24 +699,24 @@ struct TaggingPi0 { } PROCESS_SWITCH(TaggingPi0, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; + using FilteredMyCollisionsWithJJMC = soa::Filtered; void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { + // else if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { + // } else if constexpr (pairtype == 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 17b92c44852..9dda549dc79 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -21,6 +21,7 @@ #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 +50,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include #include @@ -61,164 +62,173 @@ #include #include -using MyCollisions = o2::soa::Join; +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 MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = o2::soa::Join; +using MyCollisionsWithJJMC = soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyMCCollisions = o2::soa::Join; +using MyMCCollisions = soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyV0Photons = o2::soa::Join; +using MyV0Photons = soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyEMCClusters = o2::soa::Join; +using MyEMCClusters = soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = o2::soa::Join; +// using MyPHOSClusters = soa::Join; // using MyPHOSCluster = MyEMCClusters::iterator; -using MyMCV0Legs = o2::soa::Join; +using MyMCV0Legs = soa::Join; using MyMCV0Leg = MyMCV0Legs::iterator; -using MyMCElectrons = o2::soa::Join; +using MyMCElectrons = soa::Join; using MyMCElectron = MyMCElectrons::iterator; -template +template struct TaggingPi0MC { - 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"}; + 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"}; EMPhotonEventCut fEMEventCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - 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)"}; + 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)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; - 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"}; + 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"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "dileptoncut_group"; - 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"}; + 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"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : o2::framework::ConfigurableGroup { + struct : ConfigurableGroup { std::string prefix = "emccut_group"; - 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"}; + 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"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : o2::framework::ConfigurableGroup { + // struct : ConfigurableGroup { // std::string prefix = "phoscut_group"; - // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistry{"output", {}, 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; - o2::framework::Service ccdb; + Service ccdb; int mRunNumber; float d_bz; TF1* f1fd_k0s_to_pi0; - void init(o2::framework::InitContext&) + void init(InitContext&) { o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); addHistogrms(); @@ -286,26 +296,26 @@ struct TaggingPi0MC { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - 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)"}; + 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)"}; - 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("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("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("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 } void DefineEMEventCut() @@ -408,14 +418,14 @@ struct TaggingPi0MC { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - 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; + SliceCache cache; + Preslice perCollision_pcm = aod::v0photonkf::pmeventId; + Preslice perCollision_emc = aod::emccluster::pmeventId; + // Preslice perCollision_phos = aod::phoscluster::pmeventId; - 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); + 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); template void runTruePairing(TCollisions const& collisions, @@ -450,7 +460,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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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); @@ -468,7 +478,7 @@ struct TaggingPi0MC { auto ele1 = g1.template negTrack_as(); auto pos1mc = pos1.template emmcparticle_as(); auto ele1mc = ele1.template emmcparticle_as(); - int photonid1 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); + int photonid1 = FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); if (photonid1 < 0) { continue; } @@ -488,8 +498,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 (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); + } else if (IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { + int motherid_strhad = 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) { @@ -502,8 +512,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(o2::soa::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(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()) { @@ -520,7 +530,7 @@ struct TaggingPi0MC { auto pos2mc = mcparticles.iteratorAt(pos2.emmcparticleId()); auto ele2mc = mcparticles.iteratorAt(ele2.emmcparticleId()); - int pi0id = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); + int pi0id = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); if (pi0id < 0) { continue; } @@ -534,8 +544,8 @@ struct TaggingPi0MC { if (pi0mc.isPhysicalPrimary() || pi0mc.producedByGenerator()) { fRegistry.fill(HIST("Pair/primary/hMvsPt"), veeg.M(), v_gamma.Pt(), weight); - } 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); + } else if (IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles) > 0) { + int motherid_strhad = 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) { @@ -552,7 +562,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(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -568,27 +578,27 @@ struct TaggingPi0MC { } // end of collision loop } - 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; + 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; - void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) + void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { + // else if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { + // } else if constexpr (pairtype == 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...)); @@ -597,23 +607,23 @@ struct TaggingPi0MC { } PROCESS_SWITCH(TaggingPi0MC, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; - void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) + using FilteredMyCollisionsWithJJMC = soa::Filtered; + void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { + if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { + // else if constexpr (pairtype == 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 == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { + // } else if constexpr (pairtype == 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 af9acc7003a..2e98a0396b5 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h @@ -22,9 +22,6 @@ #include -#include -#include - enum CentType : uint8_t { CentFT0M = 0, CentFT0A = 1, @@ -74,7 +71,7 @@ struct V0PhotonCandidate { eleTPCSignal = ele.tpcSignal(); eleITSClusterSizes = ele.itsClusterSizes(); - chi2ndf = v0PV.GetChi2() / v0PV.GetNDF(); + chi2ndf = v0DecayVtx.GetChi2() / v0DecayVtx.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/Core/V0PhotonCut.cxx b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx index e38aed371f9..0511e72d0c7 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx @@ -15,12 +15,9 @@ #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" - +#include #include -#include - #include #include diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 7ea0be9beb3..664981df21e 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -26,21 +26,20 @@ #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 05e1541493b..d902e82562a 100644 --- a/PWGEM/PhotonMeson/DataModel/EventTables.h +++ b/PWGEM/PhotonMeson/DataModel/EventTables.h @@ -16,6 +16,7 @@ #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 79219f35fa4..15e66f8bd96 100644 --- a/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h +++ b/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h @@ -21,7 +21,8 @@ #include #include -#include + +#include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h index 4f64bf08fb0..efd3f9a2007 100644 --- a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h +++ b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h @@ -19,10 +19,8 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ -#include +#include "Framework/AnalysisDataModel.h" -#include -#include #include namespace o2::aod diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 9ef4b45727b..afb88c6694a 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 o2::aod::Collisions +DECLARE_SOA_TABLE(EMEventsNgPCM, "AOD", "EMEVENTNGPCM", emevent::NgPCM); // joinable to EMEvents or 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 95b560a7501..16e8ee911ba 100644 --- a/PWGEM/PhotonMeson/DataModel/mcV0Tables.h +++ b/PWGEM/PhotonMeson/DataModel/mcV0Tables.h @@ -15,9 +15,7 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ -#include - -#include +#include "Framework/ASoA.h" namespace o2::aod { diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx index cd159115d4f..9147873fb71 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 9c7027076de..bdfa1aac27c 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx index d6d188abb96..102907e9547 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx index c3b82a8b204..25230a2512e 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx index 0bfbe804e31..685f5e886fa 100644 --- a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx @@ -20,32 +20,16 @@ #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 75838125d69..dbc8c80c7d2 100644 --- a/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx @@ -18,39 +18,20 @@ #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 01965fc08ae..d9365251277 100644 --- a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx @@ -25,6 +25,9 @@ #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 70457782ae6..138a190f7cd 100644 --- a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx @@ -22,30 +22,20 @@ #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 a371d109e3e..6d235b0db0c 100644 --- a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -17,8 +17,7 @@ #include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" -#include -#include +#include "Framework/runDataProcessing.h" using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx index 57a551a40c1..3e8d6cb146f 100644 --- a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx @@ -30,8 +30,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 1199b2415a2..9b2f9e0c411 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -54,7 +54,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx index 70a96f7ba8a..b67aeb53d41 100644 --- a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx +++ b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx @@ -17,9 +17,8 @@ #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 f522e113386..0d7afd0a63e 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx @@ -16,28 +16,18 @@ #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 (do not replace with Math/Vector4Dfwd.h) -#include -#include +#include // IWYU pragma: keep #include -#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index c0b14051d74..0ebf6f374c8 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -22,48 +22,38 @@ // ************************** // 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 -// todo: remove reduantant information in GammaConversionsInfoTrue +#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 "Common/Core/RecoDecay.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +// includes for the R recalculation +#include "Common/Core/trackUtilities.h" #include "Tools/KFparticle/KFUtilities.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 -#include +#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 using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx index e44600aafaa..509a949b0dd 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx @@ -20,15 +20,11 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" -#include -#include -#include -#include -#include -#include - -#include -#include +#include "TVector3.h" + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx index 0d50b530c08..ef825ca5578 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx @@ -13,21 +13,12 @@ /// dependencies: o2-analysis-calo-cluster /// \author daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" - +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" #include "Common/DataModel/CaloClusters.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "PHOSBase/Geometry.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx index 5efa2817617..cb3452dc177 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx @@ -14,46 +14,33 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/TrackSelection.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include - -#include -#include +#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 -#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 3caa5e5b5aa..5002de0a133 100644 --- a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx +++ b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx @@ -24,34 +24,19 @@ #include #include #include -#include #include #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 cd54adedfb3..961f8b0dfe7 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx b/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx index a8277d122db..1607c30b94a 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 -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx index a92e1888049..4e345a26c02 100644 --- a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx +++ b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx @@ -17,11 +17,9 @@ /// #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" -#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" @@ -29,30 +27,22 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.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 "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 diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx index 2ecfd14711d..0ee3d8e2f3e 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx @@ -37,7 +37,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx index 463bc9045a8..7e5d8d80fc6 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx @@ -22,8 +22,6 @@ #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" @@ -37,9 +35,10 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include +#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx index 587546ff802..556aa96bd6c 100644 --- a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx @@ -19,35 +19,28 @@ #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.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 "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 diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx index 810be128a00..aa9afe80489 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx @@ -18,6 +18,7 @@ #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 818eb101285..ac3f50b594a 100644 --- a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx +++ b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx @@ -43,7 +43,6 @@ #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 89a84ccd2df..ccdc4184568 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx @@ -14,19 +14,16 @@ // 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 4b94c5b4f29..2292faef120 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx @@ -14,19 +14,16 @@ // This code loops over photons and makes pairs for neutral mesons analyses. // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" #include "PWGEM/PhotonMeson/Core/TaggingPi0.h" -#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" -#include -#include - -using namespace o2::framework; -using namespace o2::aod::pwgem::photonmeson::photonpair; +using namespace o2; +using namespace o2::aod; 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 12b03c22cf4..8d0b0ee7b3a 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -48,18 +48,17 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include // IWYU pragma: keep #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 d7046d8832f..22f05b2bec4 100644 --- a/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx +++ b/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx @@ -46,7 +46,6 @@ #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 c3f41633d9b..e42b30e99cc 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -21,40 +21,22 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.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 "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 -#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 084b866da50..7a32eddf6ab 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -21,46 +21,30 @@ #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 1bc980ed4bc..93e89d45c54 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx @@ -19,28 +19,16 @@ #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 // IWYU pragma: keep #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 04f1f09b6e7..0f1d2103db5 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,6 @@ 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 { @@ -97,11 +97,6 @@ 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) @@ -162,7 +157,6 @@ 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; @@ -180,7 +174,6 @@ 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 @@ -205,27 +198,8 @@ 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 (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); + 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"); @@ -234,65 +208,49 @@ 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}}, 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"); + 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}); } if (doprocessAmbiguous) { - 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); + 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"; - 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); + 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}"}}); } // meson related histograms - 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); + 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, {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); + 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}, 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); + 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()) { @@ -320,7 +278,6 @@ struct EmcalPi0Qc { LOG(info) << "mRequireCaloReadout = " << mRequireCaloReadout.value; LOG(info) << "mRequireEMCalCells = " << mRequireEMCalCells.value; LOG(info) << "mSplitEMCalDCal = " << mSplitEMCalDCal.value; - LOG(info) << "mDoSumw2 = " << mDoSumw2.value; } template @@ -329,16 +286,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, mWeight); - mHistManager.fill(HIST(ClusterNcellHistSM[supermoduleID]), NCell, timeSinceSOR, mWeight); - mHistManager.fill(HIST(ClusterM02HistSM[supermoduleID]), m02, timeSinceSOR, mWeight); + 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, mWeight); + mHistManager.fill(HIST(MesonInvMassHistSM[supermoduleID]), minv, timeSinceSOR); } void fillSupermoduleHistogramsPhoton(int supermoduleID, float time, float m02, int NCell, float timeSinceSOR) @@ -499,50 +456,13 @@ 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); - 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 + 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"), 3); // Fill readout @@ -602,138 +522,6 @@ 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) @@ -827,15 +615,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(), 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); + 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 @@ -881,7 +669,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(), mWeight); + mHistManager.fill(HIST("invMassVsPt"), meson.getMass(), meson.getPt()); uint8_t sm1 = mPhotons[ig1].sm; uint8_t sm2 = mPhotons[ig2].sm; @@ -891,9 +679,9 @@ struct EmcalPi0Qc { if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal) { - mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt()); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal) { - mHistManager.fill(HIST("invMassVsPt_DCal"), meson.getMass(), meson.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPt_DCal"), meson.getMass(), meson.getPt()); } } } @@ -901,7 +689,6 @@ 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]); } @@ -950,22 +737,22 @@ struct EmcalPi0Qc { // Fill histograms if (mesonRotated1.getOpeningAngle() > mMinOpenAngleCut) { - mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated1.getMass(), mesonRotated1.getPt()); if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); } } } if (mesonRotated2.getOpeningAngle() > mMinOpenAngleCut) { - mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated2.getMass(), mesonRotated2.getPt()); if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); } } } @@ -1017,7 +804,7 @@ struct EmcalPi0Qc { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - 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) + 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) return workflow; } diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx index 94ad627191a..ae2ad0c548f 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx @@ -20,11 +20,10 @@ #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 fc390c4ce65..889858359ed 100644 --- a/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx +++ b/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx @@ -16,16 +16,13 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt /// -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/HistogramRegistry.h" -#include +#include "TDatabasePDG.h" using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 9530c9401da..7435451a3a6 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -14,7 +14,6 @@ /// \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" @@ -23,26 +22,22 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include -#include +#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 diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index 264808e451a..f35b926e50c 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -15,7 +15,6 @@ #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" @@ -25,29 +24,24 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include -#include +#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 @@ -239,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)", 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/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/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); diff --git a/PWGEM/PhotonMeson/Tasks/phosQC.cxx b/PWGEM/PhotonMeson/Tasks/phosQC.cxx index 56c7adb50b6..f98c5fcfba2 100644 --- a/PWGEM/PhotonMeson/Tasks/phosQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/phosQC.cxx @@ -22,12 +22,12 @@ #include "Common/CCDB/TriggerAliases.h" -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include -#include #include #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index 1396ec31f63..7036c3a30de 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -42,7 +42,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include #include @@ -88,8 +88,6 @@ 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 { @@ -316,12 +314,7 @@ 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 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 thnAxisCent{thnConfigAxisCent, "Centrality (%)"}; const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec thnAxisEtaGen{280, -0.7, 0.7, "#it{#eta}_{Gen}"}; @@ -330,39 +323,25 @@ 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)"}; - 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/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}); - 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/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/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/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/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/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/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/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/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("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/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}); + registry.add("PCM/hPhotonReso", "PCM photon rec pT vs true pT vs ", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCent}); auto hMesonCuts = registry.add("hMesonCuts", "hMesonCuts;;Counts", kTH1D, {{6, 0.5, 6.5}}, false); hMesonCuts->GetXaxis()->SetBinLabel(1, "in"); @@ -408,16 +387,6 @@ 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 @@ -459,8 +428,8 @@ struct PhotonResoTask { // occupancy selection return false; } - float centOrMult = getCentralityOrMultiplicity(collision); - if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { + float cent = getCentrality(collision); + if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { // event selection return false; } @@ -504,7 +473,7 @@ struct PhotonResoTask { initCCDB(collision); isFullEventSelected(collision, true); - float centOrMult = getCentralityOrMultiplicity(collision); + float cent = getCentrality(collision); auto photonsEMCPerCollision = clusters.sliceBy(perCollisionEMC, collision.globalIndex()); auto photonsPCMPerCollision = photons.sliceBy(perCollisionPCM, collision.globalIndex()); @@ -521,18 +490,16 @@ struct PhotonResoTask { mcPhoton1.setCursor(photonEMC.emmcparticleIds()[0]); if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kGamma) { - 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); + 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); } 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(), 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); + 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); } } @@ -560,8 +527,8 @@ struct PhotonResoTask { if (!fV0PhotonCut.IsConversionPointInAcceptance(mcPhoton1, trueConvRadius)) { continue; } - registry.fill(HIST("PCM/hPhotonReso"), photonPCM.pt(), mcPhoton1.pt(), centOrMult); - registry.fill(HIST("PCM/hPrecPmcPhotons"), (photonPCM.p() - mcPhoton1.p()) / mcPhoton1.p(), mcPhoton1.p(), centOrMult); + + registry.fill(HIST("PCM/hPhotonReso"), photonPCM.pt(), mcPhoton1.pt(), cent); } // end of loop over pcm photons @@ -623,15 +590,15 @@ struct PhotonResoTask { if (pi0id >= 0) { const auto pi0mc = mcParticles.iteratorAt(pi0id); - 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); + 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); } if (etaid >= 0) { const auto etamc = mcParticles.iteratorAt(etaid); - 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); + 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); } } } diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 43a37569823..40a6599bb71 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -16,6 +16,7 @@ #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" @@ -39,9 +40,9 @@ #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 #include @@ -49,13 +50,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -63,9 +62,9 @@ /// Single-photon track-type combo. enum class V0Combo : int { Inclusive = 0, - ItstpcItstpc = 1, - ItstpcTpconly = 2, - TpconlyTpconly = 3, + ItstpcItstpc = 1, ///< both legs ITS+TPC + ItstpcTpconly = 2, ///< one ITS+TPC leg, one TPC-only + TpconlyTpconly = 3, ///< both legs TPC-only }; /// Photon-pair track-type combo. @@ -86,10 +85,8 @@ 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>; using MyCollision = MyCollisions::iterator; using MyV0Photons = soa::Join; @@ -100,32 +97,32 @@ using MyMCV0Leg = MyMCV0Legs::iterator; // ─── MC truth classification types ──────────────────────────────────────────── +/// Per-photon MC truth information built from the two V0 legs. struct PhotonMCInfo { - bool hasMC = false; - bool sameMother = false; - bool isTruePhoton = false; - int mcPosId = -1; - int mcNegId = -1; - int motherId = -1; + 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, - TrueTrueSamePhoton, - SharedMcLeg, - TrueFake, - FakeFake, - Pi0Daughters, + 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 }; -static constexpr float kMinMagnitude = 1e-12f; -static constexpr float kMinCosine = 1e-12f; -static constexpr float kMinSigma = 1e-9; - -struct Photonhbt { +struct photonhbt { template static inline V0Combo classifyV0Combo(TGamma const& g) @@ -158,24 +155,33 @@ struct Photonhbt { return static_cast(kTable[lo][hi]); } - // ─── Configurables ──────────────────────────────────────────────────────── + // ─── Configurables: histogram axis bins ─────────────────────────────────── + // HBT physics ConfigurableAxis confQBins{"confQBins", {60, 0, +0.3f}, "q bins for output histograms"}; - 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 confKtBins{"confKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6}, "kT bins"}; + + // 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, 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 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 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)"}; + 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 (%)"}; @@ -200,7 +206,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)"}; + const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; ///< FIX: was missing const AxisSpec axisOccupancy{confOccupancyQA, "occupancy"}; const AxisSpec axisCentQA{confCentQABins, "centrality (%)"}; @@ -210,88 +216,65 @@ 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 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."}; + 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; - // ─── 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; + // ─── Configurables: HBT kind ─────────────────────────────────────────────── - // ─── 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; + 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"}; - struct : ConfigurableGroup { - 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; + // ─── Configurables: events ───────────────────────────────────────────────── - 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"}; - 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"}; - } mctruthSparse; + Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + 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"}; + 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"}; + + // ─── 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"}; - Configurable cfgMaxAsymmetry{"cfgMaxAsymmetry", -1.f, "max |p_{T, 1} - p_{T, 2}|/(p_{T, 1} + p_{T, 2}) asymmetry cut"}; } ggpaircuts; + // ─── Event cut ───────────────────────────────────────────────────────────── + EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -318,6 +301,8 @@ struct Photonhbt { Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "all ITS layers OK"}; } eventcuts; + // ─── PCM cut ─────────────────────────────────────────────────────────────── + V0PhotonCut fV0PhotonCut; struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; @@ -345,7 +330,7 @@ struct Photonhbt { Configurable cfgMaxTPCNsigmaEl{"cfgMaxTPCNsigmaEl", +3.5, "max TPC nsigma electron"}; } pcmcuts; - ~Photonhbt() + ~photonhbt() { delete emh1; emh1 = nullptr; @@ -353,13 +338,9 @@ struct Photonhbt { emh2 = nullptr; mapMixedEventIdToGlobalBC.clear(); usedPhotonIdsPerCol.clear(); - truthGammaPool.clear(); } 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; @@ -371,13 +352,15 @@ struct Photonhbt { std::vector epBinEgdes; std::vector occBinEdges; + // ─── Pair-cut helpers ────────────────────────────────────────────────────── + inline bool isInsideEllipse(float deta, float dphi) const { - if (!ggpaircuts.cfgDoEllipseCut.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; - if (sE < kMinSigma || sP < kMinSigma) + if (sE < 1e-9f || sP < 1e-9f) return false; return (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP) < ggpaircuts.cfgEllipseR2.value; } @@ -391,19 +374,6 @@ 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; @@ -416,12 +386,6 @@ 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) { @@ -431,7 +395,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() < kMinSigma || p1cmDir.R() < kMinSigma) + if (pairDir.R() < 1e-9 || p1cmDir.R() < 1e-9) return -1.f; return static_cast(pairDir.Unit().Dot(p1cmDir.Unit())); } @@ -458,9 +422,11 @@ 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); } + /// ev_id : 0 = same-event, 1 = mixed-event + /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* qaPrefix() { @@ -469,7 +435,7 @@ struct Photonhbt { return "Pair/same/QA/Before/"; if constexpr (step_id == 1) return "Pair/same/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) + if constexpr (step_id == 2) return "Pair/same/QA/AfterRZ/"; return "Pair/same/QA/AfterEllipse/"; } else { @@ -477,7 +443,7 @@ struct Photonhbt { return "Pair/mix/QA/Before/"; if constexpr (step_id == 1) return "Pair/mix/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) + if constexpr (step_id == 2) return "Pair/mix/QA/AfterRZ/"; return "Pair/mix/QA/AfterEllipse/"; } @@ -494,30 +460,27 @@ struct Photonhbt { void init(InitContext& /*context*/) { mRunNumber = 0; - 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); + + 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 @@ -528,46 +491,61 @@ 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 { - 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; + // 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; }; - 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 + "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); + 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};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 + "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) { @@ -577,7 +555,8 @@ 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 @@ -586,42 +565,79 @@ struct Photonhbt { constexpr auto base = fullRangePrefix(); fRegistry.fill(HIST(base) + HIST("hDeltaRCosOAVsQinv"), qinv, drOverCosOA); } + void addQAHistogramsForStep(const std::string& path) { - // Ellipse - fRegistryPairQA.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma)^{2}+(#Delta#phi/#sigma)^{2};value;counts", kTH1D, {axisEllipseVal}, 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 + "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); + // ── 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[mixing.cfgEP2EstimatorForMix].data()), + 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[mixing.cfgEP2EstimatorForMix].data()), + 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/"); @@ -629,55 +645,44 @@ struct Photonhbt { addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterRZ/"); addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterEllipse/"); - if (hbtanalysis.cfgDo3D) { - fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (hbtanalysis.cfgDo2D) - fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + // ── 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); + } } else { - if (hbtanalysis.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); - 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); + 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(); - fRegistryPairQA.addClone("Pair/same/QA/", "Pair/mix/QA/"); - fRegistryPairMC.addClone("Pair/same/MC/", "Pair/mix/MC/"); + + // ── Full-range histograms: always filled, qinv as axis ─────────────────── 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); + // Clone all Pair/same/ histograms to Pair/mix/ + fRegistry.addClone("Pair/same/", "Pair/mix/"); } + // ─── DefineEMEventCut ────────────────────────────────────────────────────── + void DefineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); @@ -699,6 +704,8 @@ struct Photonhbt { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } + // ─── DefinePCMCut ────────────────────────────────────────────────────────── + void DefinePCMCut() { fV0PhotonCut = V0PhotonCut("fV0PhotonCut", "fV0PhotonCut"); @@ -726,6 +733,7 @@ struct Photonhbt { fV0PhotonCut.SetRequireTPConly(pcmcuts.cfgRequireV0WithTPCOnly); } + /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* singlePhotonQAPrefix() { @@ -733,7 +741,7 @@ struct Photonhbt { return "SinglePhoton/Before/"; if constexpr (step_id == 1) return "SinglePhoton/AfterDRCosOA/"; - if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) + if constexpr (step_id == 2) return "SinglePhoton/AfterRZ/"; return "SinglePhoton/AfterEllipse/"; } @@ -745,8 +753,13 @@ 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("hEtaVsPhiPt"), g.phi(), g.eta(), g.pt()); - fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConvPt"), g.vz(), r, g.pt()); + 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 @@ -759,9 +772,11 @@ 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); @@ -771,23 +786,17 @@ 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 (hbtanalysis.cfgDo3D) { + + 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 (hbtanalysis.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"), - 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); + cfgUseLCMS ? qabs_lcms : qinv, kt, weight); } } @@ -797,13 +806,16 @@ 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); @@ -813,6 +825,7 @@ 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) @@ -840,21 +853,17 @@ struct Photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - 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 (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"), 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); + + 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("Pair/mix/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); + fRegistry.fill(HIST(mcDir) + HIST("CF_1D"), + cfgUseLCMS ? qabs_lcms : qinv, kt, weight); } } @@ -862,24 +871,31 @@ 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), cp2(o.x2, o.y2, o.z2); - const float mag1 = std::sqrt(cp1.Mag2()), mag2 = std::sqrt(cp2.Mag2()); - if (mag1 < kMinMagnitude || mag2 < kMinMagnitude) { + + 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; } @@ -890,168 +906,175 @@ 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) < kMinCosine) ? 1e12f : (o.deltaR3D / o.cosOA); + 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); + 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); + 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*/) + inline void fillPairQAStep(PairQAObservables const& o, float cent, float occupancy) { if (!qaflags.doPairQa) return; - constexpr auto base = qaPrefix(); - - ///// 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 + constexpr auto base = qaPrefix(); - 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); + // 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); + } - 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)); + // 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) + 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], mothIdNeg = mcNeg.mothersIds()[0]; + + 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 == kGamma); + 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; - } - 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; - } + 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 || m1.motherId < 0 || m2.motherId < 0) + 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], gm2 = ph2.mothersIds()[0]; + const int gm1 = ph1.mothersIds()[0]; + const int gm2 = ph2.mothersIds()[0]; if (gm1 != gm2) return false; - return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == kPi0); + return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == 111); } static constexpr std::string_view pairTruthLabel(PairTruthType t) @@ -1073,233 +1096,56 @@ 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)"}; - 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 + 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/"}; + "TrueTrueDistinct/", + "TrueTrueSamePhoton/", + "SharedMcLeg/", + "TrueFake/", + "FakeFake/", + "Pi0Daughters/"}; for (const auto& label : kTypes) { const std::string base = std::string("Pair/same/MC/") + std::string(label); - // 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); + 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 { - fRegistryPairMC.add((base + "CF_1D").c_str(), - hbtanalysis.cfgUseLCMS ? "MC CF 1D LCMS" : "MC CF 1D (qinv)", - kTH2D, {hbtanalysis.cfgUseLCMS ? axisQabsLcms : axisQinv, axisKt}, true); + 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); + } } - // 1D observables - fRegistryPairMC.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, 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); - - // 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/") ? 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); - - const bool addDRDZQinv = - (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); + 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); } - 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", - "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", - "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", - "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_kT_fakePairs", - "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", - "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); - - // ─── 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 — 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/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", - "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 (expect all at 0);N(V0 built but legs not found);counts", - kTH1D, {AxisSpec{20, -0.5f, 19.5f, "N_{bad}"}}, 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", - "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: 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 correctly built"}}, 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, bool doSparse, bool doMCQA) + inline void fillMCPairQATyped(PairQAObservables const& obs) { constexpr auto base = []() constexpr -> const char* { if constexpr (!IsMix) { @@ -1328,43 +1174,43 @@ struct Photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - 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("hDeltaR"), obs.deltaR); - fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); - fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); - } - if (doSparse) - fRegistryPairMC.fill(HIST(base) + HIST("hSparse_DEtaDPhi_kT"), obs.deta, obs.dphi, obs.kt); + + 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/"; - if (doMCQA) { - fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, static_cast(TruthT)); - fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, static_cast(TruthT)); - } + 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, bool doSparse, bool doMCQA) + inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs) { switch (truthType) { case PairTruthType::TrueTrueDistinct: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; case PairTruthType::TrueTrueSamePhoton: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; case PairTruthType::SharedMcLeg: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; case PairTruthType::TrueFake: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; case PairTruthType::FakeFake: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; case PairTruthType::Pi0Daughters: - fillMCPairQATyped(obs, doSparse, doMCQA); + fillMCPairQATyped(obs); break; default: break; @@ -1401,23 +1247,12 @@ struct Photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - 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) ? 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) ? 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); + + 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 @@ -1446,36 +1281,6 @@ 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 (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 (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"), hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt); - } - } template epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; - const float ep2 = epArr[mixing.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); - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); + 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 = (mixing.cfgOccupancyEstimator == 1) + + // ── Event mixing bins ───────────────────────────────────────────────── + const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); - 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); + 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()); - if (qaflags.doSinglePhotonQa) - for (const auto& g : photons1Coll) - if (cut1.template IsSelected(g)) - fillSinglePhotonQAStep<0>(g); - std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; + + // ── 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 ────────────────────────────────────────────── 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(), 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; - if (!passAsymmetryCut(g1.pt(), g2.pt())) + + 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); + auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); + + 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); - if (doFR) + + // ── 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; - idsAfterDR.insert(g1.globalIndex()); - idsAfterDR.insert(g2.globalIndex()); + + 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; - idsAfterRZ.insert(g1.globalIndex()); - idsAfterRZ.insert(g2.globalIndex()); + + 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; - idsAfterEllipse.insert(g1.globalIndex()); - idsAfterEllipse.insert(g2.globalIndex()); + + photonIdsAfterEllipse.insert(g1.globalIndex()); + photonIdsAfterEllipse.insert(g2.globalIndex()); + + // ── QA: After ellipse cut = final accepted pairs ────────────────── if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - if (doFR) + + if (doFullRange) 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); @@ -1580,218 +1426,307 @@ struct Photonhbt { }; addToPool(g1); addToPool(g2); - } + } // end same-event pair loop + 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); - } - } + 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(); - if (!mixing.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; + 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 < mixing.ndiffBCMix) + if (diffBC < ndiffBCMix) continue; + auto poolPhotons = emh1->GetTracksPerCollision(mixID); - for (const auto& g1 : selectedPhotons) + + 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); + + 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); - if (doFR) + + // ── 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: 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); - if (doFR) + + // ── Full-range fills ──────────────────────────────────────── + if (doFullRange) fillFullRangeQA<1>(obs, centForQA, occupancy); + + // ── Fill CF histogram — always ────────────────────────────── fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); - fRegistry.fill(HIST("Pair/mix/hPhi_lowerPtV0"), - (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); } - } + } + } // 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++; } - template - void runPairingMC(TCollisions const& collisions, TPhotons const& photons, - TLegs const& /*legs*/, TMCParticles const& mcParticles, - TPreslice const& perCollision, TCut const& cut) + 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[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || centralitySelection.cfgCentMax < cent[mixing.cfgCentEstimator]) + 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[mixing.cfgEP2EstimatorForMix]; + + 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); - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); + 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 = (mixing.cfgOccupancyEstimator == 1) + + const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); - 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); + 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)) - fillSinglePhotonQAStep<0>(g); - std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; + + 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)) + if (!cut.template IsSelected(g1) || + !cut.template IsSelected(g2)) continue; - 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()) + + 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)) + 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; - const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); + + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); + + // ── Pair QA: Before ─────────────────────────────────────────────── if (doQA) fillPairQAStep<0, 0>(obs, centForQA, occupancy); - if (doFR) + + // ── 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; - idsAfterDR.insert(g1.globalIndex()); - idsAfterDR.insert(g2.globalIndex()); + + 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; - idsAfterRZ.insert(g1.globalIndex()); - idsAfterRZ.insert(g2.globalIndex()); + + 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; - idsAfterEllipse.insert(g1.globalIndex()); - idsAfterEllipse.insert(g2.globalIndex()); + + photonIdsAfterEllipse.insert(g1.globalIndex()); + photonIdsAfterEllipse.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - if (doFR) + + // ── Full-range fills ────────────────────────────────────────────── + if (doFullRange) fillFullRangeQA<0>(obs, centForQA, occupancy); + + // ── Fill inclusive CF — always ──────────────────────────────────── 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); - 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); - } - } - 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; - } + 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) { @@ -1803,49 +1738,51 @@ struct Photonhbt { }; addToPool(g1); addToPool(g2); - } + } // end same-event pair loop + 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); - } - } + 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 (!mixing.cfgDoMix || ndiphoton == 0) + + 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 < mixing.ndiffBCMix) + if (diffBC < ndiffBCMix) continue; + auto poolPhotons = emh1->GetTracksPerCollision(mixID); - for (const auto& g1 : selectedPhotons) + 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); + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<1, 0>(obs, centForQA, occupancy); - if (doFR) + if (doFullRange) fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) @@ -1860,450 +1797,37 @@ struct Photonhbt { continue; if (doQA) fillPairQAStep<1, 3>(obs, centForQA, occupancy); - if (doFR) + if (doFullRange) 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) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } - } - } - 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[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || - centralitySelection.cfgCentMax < cent[mixing.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(); - if (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId) - 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() == kGamma && negMother.pdgCode() == kGamma) { - crossBuildMap[posMotherId].insert(negMotherId); - crossBuildMap[negMotherId].insert(posMotherId); - } - continue; - } - const int gammaId = posMotherId; - if (emmcParticles.iteratorAt(gammaId).pdgCode() != kGamma) - continue; - const bool passes = cut.template IsSelected, TLegs>(g); - auto& info = gammaRecoMap[gammaId]; - info.hasV0 = true; - info.passesCut = info.passesCut || passes; - } - - // ─── Build true gamma list ──────────────────────────────────────────────── - std::vector trueGammas; - trueGammas.reserve(32); - - for (const auto& g : emmcPartsColl) { - if (g.pdgCode() != kGamma) - continue; - if (!g.isPhysicalPrimary() && !g.producedByGenerator()) - continue; - if (std::fabs(g.eta()) > pcmcuts.cfgMaxEtaV0.value) - continue; - 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 auto& dId : g.daughtersIds()) { - if (dId < 0) { - continue; - } - const auto d = emmcParticles.iteratorAt(dId); - if (d.pdgCode() == kElectron) { - posId = dId; - rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); - } else if (d.pdgCode() == kPositron) { - negId = dId; - } - } - 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, - deTrE, - dpTrE, - alphaTrue}); - } - - { - 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; - 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); - 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); - 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]; - 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 (mctruth.cfgMCMinKt > 0.f && kt < mctruth.cfgMCMinKt) - continue; - 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 qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); - - if (mctruth.cfgMCMaxQinv > 0.f && qinv_true > mctruth.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); - } - } - } - - // ─── 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>; - - 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 = - (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; - 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, "MC CF + truth efficiency maps for CF correction", false); + + PROCESS_SWITCH(photonhbt, processMC, "pairing with MC truth classification", false); }; +// ============================================================================ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; } diff --git a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx index 4072a74e096..996ce6abdda 100644 --- a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx +++ b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx @@ -44,7 +44,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index a6a6375cb4c..ca6e5a02503 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -50,7 +50,7 @@ #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include #include diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index dbaeebaf1a7..cc3f938e17d 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -26,7 +26,6 @@ #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 dd4c3ca4ac6..e45409dda9e 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -19,7 +19,6 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include #include #include @@ -29,10 +28,10 @@ namespace o2::aod::pwgem::photonmeson::utils::eventhistogram { -inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) +inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) { // 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::kTH1D, {{12, 0.5, 12.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); @@ -67,16 +66,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::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->addClone("Event/before/", "Event/after/"); } @@ -84,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 EventTypes[2] = {"before/", "after/"}; - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); + static constexpr std::string_view kEventTypes[2] = {"before/", "after/"}; + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); if (collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); } if (collision.sel8()) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); } if (std::abs(collision.posZ()) < maxZ) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); } - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); if (collision.alias_bit(kTVXinEMC)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); } if (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); + fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, 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); + 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); } } // namespace o2::aod::pwgem::photonmeson::utils::eventhistogram diff --git a/PWGEM/PhotonMeson/Utils/HNMUtilities.h b/PWGEM/PhotonMeson/Utils/HNMUtilities.h index 956529610a0..2df0680a76c 100644 --- a/PWGEM/PhotonMeson/Utils/HNMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/HNMUtilities.h @@ -23,10 +23,9 @@ #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include -#include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include // IWYU pragma: keep #include #include diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 6eb784df2cf..03c3dcc3f89 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" -#include #include #include diff --git a/PWGEM/PhotonMeson/Utils/PairUtilities.h b/PWGEM/PhotonMeson/Utils/PairUtilities.h index 8a1ff20de88..8110239c0ce 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 "Common/Core/RecoDecay.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index 0ef33364c80..2eb11525278 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -19,26 +19,28 @@ #include #include -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}; +using namespace o2::framework; -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}}}; +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}}}; #endif // PWGEM_PHOTONMESON_UTILS_GAMMACONVDEFINITIONS_H_ diff --git a/PWGEM/Tasks/phosAlign.cxx b/PWGEM/Tasks/phosAlign.cxx index 4345280188c..5e5856518af 100644 --- a/PWGEM/Tasks/phosAlign.cxx +++ b/PWGEM/Tasks/phosAlign.cxx @@ -9,37 +9,33 @@ // 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/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include +#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 diff --git a/PWGEM/Tasks/phosCalibration.cxx b/PWGEM/Tasks/phosCalibration.cxx index 5e62addf7dc..1116f47f0f2 100644 --- a/PWGEM/Tasks/phosCalibration.cxx +++ b/PWGEM/Tasks/phosCalibration.cxx @@ -9,42 +9,35 @@ // 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 178c812750b..710244c1a6d 100644 --- a/PWGEM/Tasks/phosCellQA.cxx +++ b/PWGEM/Tasks/phosCellQA.cxx @@ -9,30 +9,26 @@ // 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 + +#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" /// \struct PHOS QA /// \brief Monitoring task for PHOS related quantities diff --git a/PWGEM/Tasks/phosCluQA.cxx b/PWGEM/Tasks/phosCluQA.cxx index 62d171a7690..e563dc3aebe 100644 --- a/PWGEM/Tasks/phosCluQA.cxx +++ b/PWGEM/Tasks/phosCluQA.cxx @@ -9,38 +9,26 @@ // 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 0334b4084e7..062bbb6271b 100644 --- a/PWGEM/Tasks/phosElId.cxx +++ b/PWGEM/Tasks/phosElId.cxx @@ -16,8 +16,8 @@ /// \author Yeghishe Hambardzumyan, MIPT /// \since Apr, 2024 -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" #include "Common/DataModel/Centrality.h" @@ -28,33 +28,27 @@ #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 "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 diff --git a/PWGEM/Tasks/phosNbar.cxx b/PWGEM/Tasks/phosNbar.cxx index 56447345bc0..51610ec9639 100644 --- a/PWGEM/Tasks/phosNbar.cxx +++ b/PWGEM/Tasks/phosNbar.cxx @@ -8,47 +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 "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 -#include -#include -#include -#include -#include -#include -#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 "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 /// \struct phosNbar /// \brief account Nbar who's clusters appeared within PHOS diff --git a/PWGEM/Tasks/phosNonlin.cxx b/PWGEM/Tasks/phosNonlin.cxx index 71abfb45208..dd3ea3003fb 100644 --- a/PWGEM/Tasks/phosNonlin.cxx +++ b/PWGEM/Tasks/phosNonlin.cxx @@ -14,32 +14,31 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGEM/Tasks/phosPi0.cxx b/PWGEM/Tasks/phosPi0.cxx index 4ba0bc81b40..74536648380 100644 --- a/PWGEM/Tasks/phosPi0.cxx +++ b/PWGEM/Tasks/phosPi0.cxx @@ -14,35 +14,31 @@ /// \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 6cea670f118..b0b0949cfb5 100644 --- a/PWGEM/Tasks/phosTrigQA.cxx +++ b/PWGEM/Tasks/phosTrigQA.cxx @@ -9,38 +9,28 @@ // 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 diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index b03c9bf6952..117fc633098 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 -#include -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "Framework/AnalysisTask.h" +#include "ReconstructionDataFormats/DCA.h" +#include "ReconstructionDataFormats/V0.h" #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include +#include "Framework/runDataProcessing.h" /// Reconstruction of Chic candidates struct HfCandidateCreatorChic { diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index f0dfb8d761c..ee6317aaa27 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -22,11 +22,11 @@ #include "Common/Core/trackUtilities.h" -#include -#include -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "Framework/AnalysisTask.h" +#include "ReconstructionDataFormats/DCA.h" +#include "ReconstructionDataFormats/V0.h" #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include +#include "Framework/runDataProcessing.h" /// Reconstruction of X candidates struct HfCandidateCreatorX { diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx index 0c4b37e21c4..fab70fd5eb5 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx index 5fb93e341f5..0de3e010c44 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx index ab2e05c16e8..00ef9b7d673 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx index 474d0eda059..7a8d6111ee0 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx index 40f8aee3e01..5ca50181673 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 -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" #include @@ -59,7 +59,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(isAlice3); } -#include +#include "Framework/runDataProcessing.h" /// 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 1844f315f28..509ba9bb813 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx index 5fbde221894..6bcc7fc438c 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx index 69ef001ab57..222d8261259 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 589d889fdcb..33af9544284 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx index 2a9c9c49faf..b4ebf84eac2 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 -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/Tasks/taskChic.cxx b/PWGHF/ALICE3/Tasks/taskChic.cxx index f6ed3fbabe0..f7331b7d417 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include @@ -38,7 +38,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include +#include "Framework/runDataProcessing.h" /// chi_c1(1P) analysis task struct HfTaskChic { diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx index a6a79fa2e23..546d7946394 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 -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx index ac528208830..a43dc94d436 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 -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx index 23d160348d8..46387f053a6 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 -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskJpsi.cxx b/PWGHF/ALICE3/Tasks/taskJpsi.cxx index 9390751b7ee..9a20f6f42e9 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include @@ -37,7 +37,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include +#include "Framework/runDataProcessing.h" /// jpsitoee analysis task struct HfTaskJpsi { diff --git a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx index 703ba304092..ec32c52976c 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 -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx index ff8e2aad4a4..b22c531e621 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 -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx b/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx index fe8c1a066f8..1f3cfb9d345 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 +#include "Framework/runDataProcessing.h" /// 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 2391634f8ce..2be307e0f92 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 -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include @@ -39,7 +39,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include +#include "Framework/runDataProcessing.h" /// X(3872) analysis task struct HfTaskX { diff --git a/PWGHF/Core/HfMlResponseB0ToDPi.h b/PWGHF/Core/HfMlResponseB0ToDPi.h index 354d295f7a6..4874b56543b 100644 --- a/PWGHF/Core/HfMlResponseB0ToDPi.h +++ b/PWGHF/Core/HfMlResponseB0ToDPi.h @@ -22,8 +22,6 @@ #include "Tools/ML/MlResponse.h" -#include - #include #include diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h index d3afc762d83..ed78d100b07 100644 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h @@ -16,6 +16,7 @@ #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 475a5ecdbae..fb44dce3b42 100644 --- a/PWGHF/D2H/Core/DataCreationCharmReso.h +++ b/PWGHF/D2H/Core/DataCreationCharmReso.h @@ -22,16 +22,15 @@ #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" @@ -44,9 +43,7 @@ #include #include #include -#include #include -#include #include #include @@ -63,6 +60,8 @@ #include #include #include +#include +#include #include namespace o2::analysis @@ -198,13 +197,9 @@ 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 { @@ -732,22 +727,9 @@ bool isTrackSelected(const Tr& track, const std::array& dDaughtersIds, c if (!track.hasTPC()) { return false; } - // --- 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); - + 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; return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected } diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 09f8bcd2d1b..d70597c8678 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -196,7 +196,6 @@ 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 @@ -1654,19 +1653,6 @@ 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/Macros/compute_fraction_cutvar.py b/PWGHF/D2H/Macros/compute_fraction_cutvar.py index 0099185472b..35f751419fd 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 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") + if(hist_rawy[-1] is None): + sys.exit(f"Fatal error: Histogram with raw yield \"{hist_rawy_name}\" is absent. Exit.") hist_rawy[-1].SetDirectory(0) infile_rawy.Close() @@ -47,43 +47,31 @@ 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 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") + 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.") 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("\33[31mFatal error: pt_bin_to_process must be an integer value. Exit.") + sys.exit("Fatal 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("\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) + sys.exit("Fatal error: pt_bin_to_process must be a positive value up to number of bins in raw yield histogram. Exit.") 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 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") + if(hist_central_effp is None): + sys.exit(f"Fatal error: Histogram with central efficiency for prompt \"{hist_central_effp_name}\" is absent. Exit.") hist_central_effnp_name = cfg["central_efficiency"]["histonames"]["nonprompt"] hist_central_effnp = infile_central_eff.Get(hist_central_effnp_name) - 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") + if(hist_central_effnp is None): + sys.exit(f"Fatal error: Histogram with central efficiency for nonprompt \"{hist_central_effnp_name}\" is absent. Exit.") hist_central_effp.SetDirectory(0) hist_central_effnp.SetDirectory(0) infile_central_eff.Close() @@ -183,10 +171,10 @@ def main(config): if cfg["minimisation"]["correlated"]: if not (np.all(rawy[1:] > rawy[:-1]) or np.all(rawy[1:] < rawy[:-1])): - print("\0\33[33mWARNING! main(): the raw yield vector is not monotonous. Check the input for stability.\0\33[0m") + print("WARNING! main(): the raw yield vector is not monotonous. Check the input for stability.") 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("\0\33[33mWARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.\0\33[0m") + print("WARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.") print(f"raw yield uncertainties vector elements = {unc_rawy}\n") minimiser = CutVarMinimiser(rawy, effp, effnp, unc_rawy, unc_effp, unc_effnp) @@ -223,49 +211,34 @@ def main(config): hist_bin_title = f"bin # {ipt+1}; {pt_axis_title}#in ({pt_min}; {pt_max})" - 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) + canv_rawy, histos_rawy, leg_r = minimiser.plot_result(f"_pt{pt_min}_{pt_max}", hist_bin_title) 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") - 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) + canv_unc, histos_unc, leg_unc = minimiser.plot_uncertainties(f"_pt{pt_min}_{pt_max}", hist_bin_title) 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") - 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) + canv_eff, histos_eff, leg_e = minimiser.plot_efficiencies(f"_pt{pt_min}_{pt_max}", hist_bin_title) 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") - 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) + canv_frac, histos_frac, leg_f = minimiser.plot_fractions(f"_pt{pt_min}_{pt_max}", hist_bin_title) 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") - 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) + canv_cov, histo_cov = minimiser.plot_cov_matrix(True, f"_pt{pt_min}_{pt_max}", hist_bin_title) 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 e1b768b807d..20466b37044 100644 --- a/PWGHF/D2H/Macros/config_cutvar_example.json +++ b/PWGHF/D2H/Macros/config_cutvar_example.json @@ -57,20 +57,6 @@ "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 f9b49f15710..3d862589836 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("33[31mERROR: number of raw yields and efficiencies not consistent! Exit\033[0m") + print("ERROR: number of raw yields and efficiencies not consistent! Exit") sys.exit() if len(self.unc_raw_yields) != self.n_sets: - print("33[31mERROR: number of raw yields and raw-yield uncertainties not consistent! Exit\033[0m") + print("ERROR: number of raw yields and raw-yield uncertainties not consistent! Exit") sys.exit() if len(self.unc_eff_prompt) != self.n_sets or len(self.unc_eff_nonprompt) != self.n_sets: - print("33[31mERROR: number of raw yields and efficiency uncertainties not consistent! Exit\033[0m") + print("ERROR: number of raw yields and efficiency uncertainties not consistent! Exit") 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("\033[33mWARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.\033[0m") + print("WARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.") print(f"residual vector uncertainties elements = {np.sqrt(m_cov_sets_diag)}\n") # chi2 @@ -484,7 +484,6 @@ 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) @@ -605,7 +604,6 @@ 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, @@ -669,7 +667,6 @@ 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) @@ -761,7 +758,6 @@ 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) @@ -848,7 +844,6 @@ 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) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 674bbeeb25c..7ad2570bec7 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -90,11 +90,6 @@ 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 deleted file mode 100644 index ef0171a7fd9..00000000000 --- a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx +++ /dev/null @@ -1,355 +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. - -/// \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/Utils/utilsAnalysis.h" -#include "PWGHF/Utils/utilsEvSelHf.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TPCVDriftManager.h" -#include "Common/Core/ZorroSummary.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 -#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 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"}; - 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})"}}}); - 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 - 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; - } - } - } - - 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 - { - 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) { - 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(); - 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; - 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; - } - if (track.tpcNClsFound() < tpcNClsFoundMin) { - return false; - } - if (track.tpcNClsCrossedRows() < tpcNClsCrossedRowsMin) { - return false; - } - 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; - } - if (track.pt() < ptMinTrack) { - return false; - } - 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); - } - - 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()); - registry.fill(HIST("hDeDxTPCProton"), trk.pt(), trk.tpcSignal()); - 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 608145a8e51..40f2358fdaf 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -153,8 +153,3 @@ 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/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index af4e5960cd9..665e640a87b 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -63,11 +63,8 @@ namespace o2::aod namespace full { // Candidate kinematics -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(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) @@ -78,22 +75,18 @@ 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(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 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, 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(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(NItsSignalsDe, nItsSignalsDe, int8_t); //! 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 @@ -102,11 +95,8 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp fo // Full table: include ALL columns declared above DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", - full::MassCd, - full::MassLc, + full::M, full::Pt, - full::Eta, - full::Phi, full::PtProng0, full::PtProng1, full::PtProng2, @@ -115,17 +105,18 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::ImpactParameter2, full::DecayLength, 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); + full::Cent, + full::GIndexCol, + full::TimeStamp); } // namespace o2::aod struct HfTaskCd { @@ -220,12 +211,9 @@ 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}}}); - 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}}}); @@ -272,8 +260,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)) { @@ -281,8 +269,6 @@ 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(); @@ -292,14 +278,11 @@ 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) { @@ -332,10 +315,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"), eta); - registry.fill(HIST("Data/hEtaVsPt"), eta, pt); - registry.fill(HIST("Data/hPhi"), phi); - registry.fill(HIST("Data/hPhiVsPt"), phi, 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("hSelectionStatus"), candidate.isSelCdToDeKPi(), pt); registry.fill(HIST("hSelectionStatus"), candidate.isSelCdToPiKDe(), pt); registry.fill(HIST("Data/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); @@ -361,16 +344,15 @@ struct HfTaskCd { if (fillTree) { int candFlag = -999; - float nSigmaTpcDe = 0.f, nSigmaTpcKa = 0.f, nSigmaTpcPi = 0.f, nSigmaTpcPr = 0.f; + float nSigmaTpcDe = 0.f, nSigmaTpcKa = 0.f, nSigmaTpcPi = 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; - float tpcSignalsKa = 0.f; - float itsSignalsDe = 0.f; float pSignedDe = -999.f; @@ -389,58 +371,50 @@ 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.tpcInnerParam() * prong0.sign(); - pSignedPi = prong2.tpcInnerParam() * prong2.sign(); + pSignedDe = prong0.p() * prong0.sign(); + pSignedPi = prong2.p() * 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); } else if (selPiKDe) { candFlag = -1; - pSignedDe = prong2.tpcInnerParam() * prong2.sign(); - pSignedPi = prong0.tpcInnerParam() * prong0.sign(); + pSignedDe = prong2.p() * prong2.sign(); + pSignedPi = prong0.p() * 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); } // 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); - registry.fill(HIST("Data/hTPCSignalPiVsP"), pSignedPi, tpcSignalsPi); - 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.tpcInnerParam() * prong1.sign(), nSigmaTpcKa); - registry.fill(HIST("Data/hNsigmaTOFKaVsP"), prong1.tpcInnerParam() * prong1.sign(), nSigmaTofKa); + registry.fill(HIST("Data/hNsigmaTPCKaVsP"), prong1.p() * prong1.sign(), nSigmaTpcKa); + registry.fill(HIST("Data/hNsigmaTOFKaVsP"), prong1.p() * prong1.sign(), nSigmaTofKa); rowCandCd( invMassCd, - invMassLc, pt, - eta, - phi, ptProng0, ptProng1, ptProng2, @@ -449,17 +423,18 @@ struct HfTaskCd { candidate.impactParameter2(), decayLength, cpa, - chi2PCA, nSigmaTpcDe, - nSigmaTpcPr, nSigmaItsDe, nSigmaTofDe, + itsNClusterDe, itsNClusterSizeDe, + tpcNClusterDe, tpcSignalsDe, - tpcSignalsPi, - tpcSignalsKa, + itsSignalsDe, candFlag, - cent); + cent, + collision.globalIndex(), + timeStamp); } } } diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 22225c4a951..e879ba57c9a 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -32,7 +32,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include #include @@ -95,8 +94,6 @@ 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", 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"}; @@ -124,12 +121,10 @@ struct HfTaskD0 { using CollisionsWithMcLabels = soa::Join; using CollisionsWithMcLabelsCent = soa::Join; using TracksSelQuality = 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; + Preslice candD0PerCollision = aod::hf_cand::collisionId; PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; PresliceUnsorted colPerMcCollisionCent = aod::mccollisionlabel::mcCollisionId; @@ -166,7 +161,6 @@ 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", @@ -254,10 +248,7 @@ 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 storeOccupancy without cent process or UPC process"); - } - if ((storeZdcEnergy || storeZdcTime) && !(doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) { - LOGP(fatal, "Can't enable the storeZdcEnergy and storeZdcTime without UPC process"); + LOGP(fatal, "Can't enable the storeCentrality and storeOccupancu without cent process or 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})"}}}); @@ -318,10 +309,8 @@ 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 thnAxisEnergyZNA{thnConfigAxisZN, "ZNA energy"}; - const AxisSpec thnAxisEnergyZNC{thnConfigAxisZN, "ZNC energy"}; - const AxisSpec thnAxisTimeZNA{thnConfigAxisTimeZN, "ZNA Time"}; - const AxisSpec thnAxisTimeZNC{thnConfigAxisTimeZN, "ZNC Time"}; + const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; + const AxisSpec thnAxisZNC{thnConfigAxisZN, "ZNC energy"}; if (doprocessMcWithDCAFitterN || doprocessMcWithDCAFitterNCent || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithDCAFitterNMlCent || doprocessMcWithKFParticleMl) { std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; @@ -378,15 +367,9 @@ 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) { @@ -398,83 +381,10 @@ 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, {{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/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/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.}}}); - 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/hGapVsEta", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); 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); @@ -669,8 +579,7 @@ struct HfTaskD0 { BCsType const& bcs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, - aod::FDDs const& fdds, - TracksWPid const& tracks) + aod::FDDs const& fdds) { for (const auto& collision : collisions) { float centrality{-1.f}; @@ -690,6 +599,7 @@ 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); @@ -698,33 +608,15 @@ 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); - 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); @@ -737,50 +629,6 @@ 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; @@ -789,50 +637,9 @@ struct HfTaskD0 { const float massD0 = HfHelper::invMassD0ToPiK(candidate); const float massD0bar = HfHelper::invMassD0barToKPi(candidate); const auto ptCandidate = candidate.pt(); - - 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/hGapVsEta"), gap, candidate.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); @@ -847,13 +654,11 @@ 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 = 11; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr + constexpr int NAxesBase = 13; // 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 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 nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR; std::vector valuesToFill; valuesToFill.reserve(nAxesTotal); @@ -863,7 +668,7 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(ptCandidate)); if constexpr (FillMl) { auto const& mlScores = candidate.mlProbD0(); - if (mlScores.size() == NAxesMl) { + if (mlScores.size() == 3) { valuesToFill.push_back(mlScores[0]); valuesToFill.push_back(mlScores[1]); valuesToFill.push_back(mlScores[2]); @@ -884,15 +689,10 @@ 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 { @@ -1381,11 +1181,9 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, - TracksWPid const& tracks, - aod::Zdcs const& /*zdcs*/ - ) + aod::Zdcs const& /*zdcs*/) { - runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds, tracks); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNWithUpc, "Process real data with DCAFitterN w/o ML with UPC", false); @@ -1396,10 +1194,9 @@ 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, tracks); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0CandidatesMl, bcs, ft0s, fv0as, fdds); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNMlWithUpc, "Process real data with DCAFitterN and ML with UPC", false); }; diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 64dae9f433c..4fcdf05bb55 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -61,14 +61,15 @@ 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", "", "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 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 yCandDstarRecoMax{"yCandDstarRecoMax", 0.8, "max. candidate Dstar rapidity"}; Configurable yCandDstarGenMax{"yCandDstarGenMax", 0.5, "max. rapidity of Generator level Particle"}; @@ -79,23 +80,9 @@ struct HfTaskDstarToD0Pi { o2::ccdb::CcdbApi ccdbApi; SliceCache cache; - 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 hWeights; std::vector axesPtVsCentVsBDTVsPvContrib; std::vector axesPtVsCentVsPvContrib; - std::vector axesPtVsPvContrib; std::vector axesPtVsBDT; using CandDstarWSelFlag = soa::Join; @@ -127,7 +114,6 @@ 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", {}}; @@ -150,27 +136,10 @@ 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.}}}); @@ -254,14 +223,7 @@ 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); - 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 + // Checking PV contributors from Data as well MC rec for calculation 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); @@ -273,18 +235,10 @@ 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, 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); - } + 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); } // Hists at Reco level W/ ML usefull for efficiency calculation @@ -292,19 +246,11 @@ 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 @@ -314,18 +260,10 @@ 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); - } } } @@ -351,8 +289,8 @@ struct HfTaskDstarToD0Pi { } } - // if weights to be applied for pt shape study - if (ptShapeStudy && useWeightOnline) { + // if weights to be applied + if (useWeight) { ccdbApi.init(ccdbUrl); std::map const metadata; // Retrieve the file from CCDB @@ -362,39 +300,28 @@ struct HfTaskDstarToD0Pi { return; } - // 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!"); + 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()); 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; } } } @@ -546,10 +473,9 @@ 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"), ptMother); // generator level pt - registry.fill(HIST("QA/hPtVsCentSkimDstarGenSig"), ptMother, centrality); + registry.fill(HIST("QA/hPtSkimDstarGenSig"), particleMother.pt()); // generator level pt + registry.fill(HIST("QA/hPtVsCentSkimDstarGenSig"), particleMother.pt(), 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); @@ -561,17 +487,18 @@ struct HfTaskDstarToD0Pi { if (candDstarMcRec.isSelDstarToD0Pi()) { // if all selection passed float weightValue = 1.0; - 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; + 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; + } } - 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); } @@ -581,61 +508,33 @@ 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, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - 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); - } + registry.fill(HIST("Efficiency/hPtNonPrompRectVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); } } 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], ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], weightValue); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - 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); - } + registry.fill(HIST("Efficiency/hPtNonPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], weightValue); } } } 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, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, weightValue); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - 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); - } + registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, weightValue); } } else { registry.fill(HIST("Efficiency/hPtVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - 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); - } + registry.fill(HIST("Efficiency/hPtNonPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); } } } @@ -732,12 +631,6 @@ 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; @@ -775,15 +668,17 @@ struct HfTaskDstarToD0Pi { } float weightValue = 1.0; - 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; + 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; + } } - 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); @@ -798,39 +693,20 @@ struct HfTaskDstarToD0Pi { // Prompt if (mcParticle.originMcGen() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtVsYPromptDstarGen"), ptGen, yGen, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtVsYPromptDstarGen"), ptGen, yGen, weightValue); if (isCentStudy) { - registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, weightValue); } else { - registry.fill(HIST("Efficiency/hPtPromptVsGen"), ptGen, ptShapeWeightValues[weightType::Prompt]); + registry.fill(HIST("Efficiency/hPtPromptVsGen"), ptGen, weightValue); } // Non-Prompt } else if (mcParticle.originMcGen() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtVsYNonPromptDstarGen"), ptGen, yGen, ptShapeWeightValues[weightType::NonPrompt]); + registry.fill(HIST("Efficiency/hPtVsYNonPromptDstarGen"), ptGen, yGen, weightValue); if (isCentStudy) { - registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, ptShapeWeightValues[weightType::NonPrompt]); + registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, weightValue); } else { - 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); - } + registry.fill(HIST("Efficiency/hPtNonPromptVsGen"), ptGen, weightValue); } } } diff --git a/PWGHF/D2H/Tasks/taskHiddenCharm.cxx b/PWGHF/D2H/Tasks/taskHiddenCharm.cxx deleted file mode 100644 index 70fa6f717f2..00000000000 --- a/PWGHF/D2H/Tasks/taskHiddenCharm.cxx +++ /dev/null @@ -1,148 +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. - -/// \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 -#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)}; -} diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index e7144cf505d..ecf59c918af 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -36,7 +36,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include #include @@ -128,7 +127,6 @@ 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.)"}; @@ -271,8 +269,6 @@ 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})"}; @@ -293,7 +289,6 @@ 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"}; @@ -312,7 +307,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, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcStd) { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -324,7 +319,7 @@ struct HfTaskLc { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets}; } if (isDataWithMl && isUpc) { - axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcWithMl) { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -800,10 +795,7 @@ struct HfTaskLc { const auto decayLength = candidate.decayLength(); const auto chi2PCA = candidate.chi2PCA(); const auto cpa = candidate.cpa(); - 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()); - } + const auto rapidity = HfHelper::yLc(candidate); if (fillTHn) { double outputBkg(-1), outputPrompt(-1), outputFD(-1); @@ -821,22 +813,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.ampFV0A), 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.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.ampFV0A), 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.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, 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)}; + 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)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } else { - 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)}; + 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)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } @@ -916,7 +908,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&, @@ -929,7 +921,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&, diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 02c0e0b297b..bd34cc4817a 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; diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 359a2320b3a..3d15683b218 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -18,8 +18,6 @@ #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" @@ -979,11 +977,8 @@ DECLARE_SOA_TABLE_STAGED(HfDplusDaugs, "HFDPDAUG", //! Table to study daughter p hf_cand::PyProng2, hf_cand::PzProng2, hf_cand_par::NSigTpcTofPi0, - hf_cand_par::NSigTpcTofPi1, - hf_cand_par::NSigTpcTofPi2, - hf_cand_par::NSigTpcTofKa0, hf_cand_par::NSigTpcTofKa1, - hf_cand_par::NSigTpcTofKa2, + hf_cand_par::NSigTpcTofPi2, o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfDplusMls, "HFDPML", //! Table with candidate selection ML scores diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 85ec82b5ed9..a53cbd6c862 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, 1100.0f, 1900.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.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,6 +265,8 @@ 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&) @@ -361,7 +363,6 @@ struct HfCorrelatorD0Hadrons { SelectedTracks const& tracks, SelectedCandidatesDataMl const& candidates) { - BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, etaTrackMax.value); @@ -528,7 +529,6 @@ 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,7 +864,6 @@ 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()); @@ -953,7 +952,6 @@ 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; diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 3f7f48f84d3..2005cd9261e 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -186,11 +186,6 @@ 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"}; @@ -215,7 +210,6 @@ 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>; @@ -232,8 +226,6 @@ 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"}; @@ -316,129 +308,9 @@ 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, @@ -664,65 +536,101 @@ 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(CollisionsMc const& mcCollisions, - soa::Join const& collisions, + void processMcGen(SelCollisionsWithDplusMc::iterator const& mcCollision, CandDplusMcGen const& mcParticles) { - BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; - - for (const auto& mcCollision : mcCollisions) { - - int counterDplusHadron = 0; - registry.fill(HIST("hMCEvtCount"), 0); + int counterDplusHadron = 0; + registry.fill(HIST("hMCEvtCount"), 0); - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); - registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); - const auto groupedMcParticles = mcParticles.sliceBy(candMcGenPerMcCollision, mcCollision.globalIndex()); - const auto groupedCollisions = collisions.sliceBy(recoCollisionsPerMcCollision, mcCollision.globalIndex()); + // 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++; - if (removeUnreconstructedGenCollisions) { + 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); - if (groupedCollisions.size() < 1) { - continue; - } + // 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()); + } - if (groupedCollisions.size() > 1 && removeCollWSplitVtx) { + // 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) { 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.); + if (removeDaughters) { + if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { continue; } - - // MC particles with reconstructed-collision selection - runMcGenDplusHadronAnalysis(groupedMcParticles, groupedMcParticles, poolBin, counterDplusHadron); + } + 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; } - } 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()); - } + 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)); } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcGen, "Process MC Gen mode", false); diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 5636a0b8fa6..9ffe580fcf5 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -46,7 +46,6 @@ #include #include -#include #include #include #include diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx index eb197529980..9884ff920e3 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx @@ -60,7 +60,6 @@ #include #include -#include #include #include diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index e14bc59a504..d870eb6731d 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -18,7 +18,6 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/Utils/utilsAnalysis.h" -#include #include #include #include @@ -28,11 +27,8 @@ #include #include -#include -#include #include -#include #include #include #include @@ -118,8 +114,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 +162,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,31 +208,19 @@ struct HfTaskCorrelationDstarHadrons { // if (ptTrack > 10.0) { // ptTrack = 10.5; // } - float netEfficiencyWeight = 1.0, efficiencyWeightDstar = 1.0, efficiencyWeightTracks = 1.0; + float netEfficiencyWeight = 1.0; if (applyEfficiency && !useCcdbEfficiency) { - efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); - efficiencyWeightTracks = efficiencyTracks->at(effBinPtTrack); + float const efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); + // LOG(info)<<"efficiencyWeightDstar "<at(effBinPtTrack); + // 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"); - } - } + float const efficiencyWeightDstar = vecHistEfficiencyDstar[0]->GetBinContent(vecHistEfficiencyDstar[0]->GetXaxis()->FindBin(ptDstar)); + // LOG(info)<<"efficiencyWeightDstar "<GetBinContent(vecHistEfficiencyTracks[0]->GetXaxis()->FindBin(ptTrack)); + // LOG(info)<<"efficiencyWeightTracks "< 1) { // to do diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a172f752afc..a8f03743e4c 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -52,7 +52,6 @@ #include #include -#include #include #include #include diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index c519765e688..b7bb9d7c4be 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 5076aca2541..20c3db63117 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -8,15 +8,15 @@ // 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/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include #include #include #include @@ -25,12 +25,10 @@ #include #include #include -#include #include #include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include +#include #include #include @@ -43,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 @@ -76,21 +74,15 @@ struct HfTaskSingleMuonSource { Produces singleMuonSource; Configurable mcMaskSelection{"mcMaskSelection", 0, "McMask for correct match, valid values are 0 and 128"}; - 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"}; - - 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 - 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 + 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 HistogramRegistry registry{ "registry", @@ -116,25 +108,14 @@ 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 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}}; registry.add("h1ColNumber", "", h1ColNumber); - 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); registry.add(Form("h2%sPtDCA", src.Data()), "", h2PtDCA); @@ -147,8 +128,6 @@ 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 { @@ -167,8 +146,8 @@ struct HfTaskSingleMuonSource { mcPart = *(mcPart.mothers_first_as()); const auto pdgAbs(std::abs(mcPart.pdgCode())); - if (pdgAbs < kElectron || pdgAbs == kGluon) { - break; // Quark and gluon + if (pdgAbs < 10) { + break; // Quark } if (!mcPart.producedByGenerator()) { // Produced in transport code @@ -176,39 +155,37 @@ 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 < kPi0) || (pdgRem >= hadronEdge)) { - continue; - } - if ((pdgRemRem == kDown || pdgRemRem == kStrange) && pdgRem > diquarkEdge) { // diquarks + if ((pdgRem < 100) || (pdgRem >= 10000)) { continue; } // compute the flavor of constituent quark const int flv(pdgRem / std::pow(10, static_cast(std::log10(pdgRem)))); - if (flv > kTop) { + if (flv > 6) { // no more than 6 flavors continue; } - if (flv < kCharm) { + if (flv < 4) { // light flavor SETBIT(mask, HasLightParent); continue; } - auto* pdgData = pdgDB->GetParticle(mcPart.pdgCode()); + + auto* pdgData(TDatabasePDG::Instance()->GetParticle(mcPart.pdgCode())); if ((pdgData != nullptr) && (pdgData->AntiParticle() == nullptr)) { SETBIT(mask, HasQuarkoniumParent); - } else if (flv == kCharm) { + } else if (flv == 4) { SETBIT(mask, HasCharmParent); } else { SETBIT(mask, HasBeautyParent); @@ -281,13 +258,11 @@ 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 == type0 || trackType == type2) { + if (trackType == 0 || trackType == 2) { if (!muon.has_matchMCHTrack()) { return; } @@ -350,122 +325,9 @@ 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; - } - 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()) < hadronStatus) { - break; - } - mcPart = mother; - } - int flv = mcPart.pdgCode() / std::pow(10, static_cast(std::log10(std::abs(mcPart.pdgCode())))); - 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 (const auto& mctrack : mctracks) { - if (mctrack.globalIndex() != i) { - continue; - } - if ((mctrack.pdgCode() != flv) && (std::abs(mctrack.pdgCode()) < std::abs(flv) * 1000)) { - continue; - } - 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; - } - currentTrk = mother; - } - } - } - return 0; - } - bool isCorr(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 (const 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) - { - const int type3 = 3; - if (trackType != type3) { - 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 invMass = 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 invMassGen = dimuVecGen.M(); - - if (isMuon(mask1) && isMuon(mask2)) { - registry.fill(HIST("h1MuonMass"), invMass); - registry.fill(HIST("h1MuonMassGen"), invMassGen); - } - 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"), invMass); - registry.fill(HIST("h1OtherMassGen"), invMassGen); - } - } - void process(MyCollisions::iterator const& collision, McMuons const& muons, - aod::McParticles const& mcParts) + aod::McParticles const&) { // event selections if (std::abs(collision.posZ()) > edgeZ) { @@ -485,68 +347,19 @@ struct HfTaskSingleMuonSource { if ((eta >= etaUp) || (eta < etaLow)) { continue; } - if ((rAbs >= rAbsMid) || (rAbs < rAbsMin)) { - if (pDca >= pDcaMax || pDca < 0) { - continue; - } - } - if ((rAbs >= rAbsMax) || (rAbs < rAbsMid)) { - if (pDca >= pDcaMax2 || pDca < 0) { - continue; - } + if ((rAbs >= rAbsMax) || (rAbs < rAbsMin)) { + continue; } - if (muon.chi2() < 0) { + if (pDca >= pDcaMax) { continue; } - if (muon.chi2MatchMCHMID() < 0) { + if ((muon.chi2() >= 1e6) || (muon.chi2() < 0)) { continue; } if (charge != 0 && muon.sign() != charge) { 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() < 0) { - continue; - } - if (muon2.chi2MatchMCHMID() < 0) { - continue; - } - fillPairs(muon, muon2, mcParts); - } - } } // loop over muons } }; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index b7542c5bbe3..7ae95c956b7 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, alpha)"}; + 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)"}; HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter @@ -267,7 +267,7 @@ struct HfCandidateCreator3Prong { fillProngPid(track2, rowProng2PidKa); /// fill proton PID information only if necessary - if (createLc || createXic || createCharmNuclei) { + if (createLc || createXic) { fillProngPid(track0, rowProng0PidPr); fillProngPid(track1, rowProng1PidPr); fillProngPid(track2, rowProng2PidPr); diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 6e4701bc63b..07fe259219a 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.rawIteratorAt(indexRecDstar); + auto particleDstar = mcParticles.iteratorAt(indexRecDstar); originDstar = RecoDecay::getCharmHadronOrigin(mcParticles, particleDstar, false, &idxBhadMothers); } if (originDstar == RecoDecay::OriginType::NonPrompt) { diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx index 20b4fcaf307..5fea587b563 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx @@ -19,59 +19,44 @@ #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/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Tools/KFparticle/KFUtilities.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#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 using namespace o2; @@ -773,7 +758,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(), cascAodElement.bachelorId(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -802,7 +787,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(), cascAodElement.bachelorId(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -831,7 +816,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(), cascAodElement.bachelorId(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -1256,7 +1241,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(), cascAodElement.bachelorId(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), massLam, massCasc, massCharmBaryon, cosPaV0ToPv, cosPaCascToPv, ctCasc, ctV0, ctCharmBaryon, @@ -1294,7 +1279,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(), cascAodElement.bachelorId(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), massLam, massCasc, massCharmBaryon, cosPaV0ToPv, cosPaCharmBaryonToPv, cosPaCascToPv, cosPaXYV0ToPv, cosPaXYCharmBaryonToPv, cosPaXYCascToPv, ctCharmBaryon, ctCasc, ctV0, @@ -1347,7 +1332,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(), cascAodElement.bachelorId(), trackCharmBachelor.globalIndex()); + cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), cand.cascadeId(), cand.prong0Id(), trackCharmBachelor.globalIndex()); } } // end candidate loop } // end of runCreator diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index b00b7001a31..e1e32120543 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -14,12 +14,6 @@ /// \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" @@ -44,6 +38,12 @@ #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 b6b40705557..55f5e2adae3 100644 --- a/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx @@ -26,13 +26,11 @@ #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/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index ddc56bfaebc..a7a90b507c5 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -208,11 +208,8 @@ struct HfDerivedDataCreatorDplusToPiKPi { candidate.pyProng2(), candidate.pzProng2(), candidate.tpcTofNSigmaPi0(), - candidate.tpcTofNSigmaPi1(), - candidate.tpcTofNSigmaPi2(), - candidate.tpcTofNSigmaKa0(), candidate.tpcTofNSigmaKa1(), - candidate.tpcTofNSigmaKa2()); + candidate.tpcTofNSigmaPi2()); } if (fillCandidateMl) { rowCandidateMl( diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx index 371b9ab9c4c..0386d6afba6 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx @@ -16,6 +16,7 @@ /// \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 c0c6217607c..89dfc8530f9 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -65,7 +65,6 @@ 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 f483d10d001..d108a443539 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 = o2::common::core::isTableRequiredInWorkflow(initContext, table); + auto isNeeded = 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/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 16ca600001b..33e1c3a1669 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, alpha)"}; + 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)"}; // 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 diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 8a952cbea49..5fb90429589 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -16,6 +16,7 @@ /// \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 0b92effcdba..98fbc5f13c3 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -41,7 +41,6 @@ #include #include -#include using namespace o2; using namespace o2::framework; // for Produces, Configuable diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index d4ab4225cdb..e1e8a27e38e 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -38,7 +38,6 @@ using namespace o2; using namespace o2::framework; -using namespace o2::framework::expressions; namespace o2::aod { @@ -146,9 +145,7 @@ 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&) @@ -279,7 +276,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); void processKfMcXic0(MyTrackTable const&, - MyMcCandidates const& candidates) + soa::Join const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -289,7 +286,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); void processKfMCWithFT0C(MyTrackTable const&, - MyMcCandidates const& candidates) + soa::Join const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -299,7 +296,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); void processKfMCWithFT0M(MyTrackTable const&, - MyMcCandidates const& candidates) + soa::Join const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -309,7 +306,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); void processMCLiteWithNTracksPV(MyTrackTable const&, - MyMcCandidates const& candidates) + soa::Join const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index 11fbbf3508b..47748b4c30d 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -34,7 +34,6 @@ #include #include -#include using namespace o2; using namespace o2::framework; @@ -79,9 +78,6 @@ 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", @@ -190,37 +186,6 @@ 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, @@ -378,7 +343,6 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP", struct HfTreeCreatorXicToXiPiPi { Produces rowCandidateLite; Produces rowCandidateLiteKf; - Produces rowCandidateLiteMl; Produces rowCandidateFull; Produces rowCandidateFullKf; Produces rowCandidateFullParticles; @@ -392,14 +356,10 @@ 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; @@ -412,13 +372,9 @@ 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(); @@ -427,7 +383,7 @@ struct HfTreeCreatorXicToXiPiPi { particleFlag = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } - if constexpr (!DoKf && !DoMl) { + if constexpr (!DoKf) { if (fillCandidateLiteTable) { rowCandidateLite( particleFlag, @@ -528,7 +484,7 @@ struct HfTreeCreatorXicToXiPiPi { candidate.nSigTofPiFromLambda(), candidate.nSigTofPrFromLambda()); } - } else if constexpr (DoKf) { + } else { if (fillCandidateLiteTable) { rowCandidateLiteKf( particleFlag, @@ -680,47 +636,6 @@ 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) @@ -738,10 +653,10 @@ struct HfTreeCreatorXicToXiPiPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } - PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", false); + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", true); void processDataKf(SelectedCandidatesKf const& candidates) { @@ -758,22 +673,11 @@ 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) { @@ -785,7 +689,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSig.size()); } for (const auto& candidate : recSig) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -798,7 +702,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -807,7 +711,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -839,7 +743,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSigKf.size()); } for (const auto& candidate : recSigKf) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -852,7 +756,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -861,7 +765,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -881,52 +785,6 @@ 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) diff --git a/PWGJE/Core/FastJetUtilities.h b/PWGJE/Core/FastJetUtilities.h index 506036c222f..2f54f92122b 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 91254ddf7a8..45f79a9fe97 100644 --- a/PWGJE/Core/JetBkgSubUtils.cxx +++ b/PWGJE/Core/JetBkgSubUtils.cxx @@ -15,6 +15,8 @@ #include "PWGJE/Core/JetBkgSubUtils.h" +#include "Common/Core/RecoDecay.h" + #include #include @@ -27,7 +29,6 @@ #include #include -#include #include #include diff --git a/PWGJE/Core/JetFindingUtilities.h b/PWGJE/Core/JetFindingUtilities.h index 37ca4eddaa5..26f00e0e38c 100644 --- a/PWGJE/Core/JetFindingUtilities.h +++ b/PWGJE/Core/JetFindingUtilities.h @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -96,12 +97,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 2285d40b53b..38c5bc29774 100644 --- a/PWGJE/Core/JetMatchingUtilities.h +++ b/PWGJE/Core/JetMatchingUtilities.h @@ -24,8 +24,6 @@ #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 c2f555689ce..eeb18938dba 100644 --- a/PWGJE/Core/JetUtilities.h +++ b/PWGJE/Core/JetUtilities.h @@ -20,10 +20,15 @@ #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 4740a087a79..be16b0cd450 100644 --- a/PWGJE/Core/MlResponseHfTagging.h +++ b/PWGJE/Core/MlResponseHfTagging.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/PWGJE/Core/emcalCrossTalkEmulation.cxx b/PWGJE/Core/emcalCrossTalkEmulation.cxx index ebd6fa0922a..32b08cd13dc 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.cxx +++ b/PWGJE/Core/emcalCrossTalkEmulation.cxx @@ -20,15 +20,12 @@ #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 @@ -37,6 +34,13 @@ #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 e597ebba4b0..fb84ec7c1ad 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.h +++ b/PWGJE/Core/emcalCrossTalkEmulation.h @@ -21,8 +21,9 @@ #include #include #include -#include +#include +#include #include #include diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index 9384ef1a9b6..e28931982b5 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -49,12 +49,11 @@ 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 -inline const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) +const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) { if (clusterDefinitionName == "kV3NoSplit") { return kV3NoSplit; @@ -90,8 +89,6 @@ inline const EMCALClusterDefinition getClusterDefinitionFromString(const std::st return kV3MostSplitSmallerTimeDiff; } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiff") { return kV3MostSplitSmallestTimeDiff; - } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiffLowestSeed") { - return kV3MostSplitSmallestTimeDiffLowestSeed; } else { throw std::invalid_argument("Cluster definition name not recognized"); } diff --git a/PWGJE/DataModel/GammaJetAnalysisTree.h b/PWGJE/DataModel/GammaJetAnalysisTree.h index 1f527ff8137..8b679097c4f 100644 --- a/PWGJE/DataModel/GammaJetAnalysisTree.h +++ b/PWGJE/DataModel/GammaJetAnalysisTree.h @@ -17,12 +17,11 @@ #ifndef PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ #define PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ -#include +#include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/DataModel/EMCALClusters.h" +#include "PWGJE/DataModel/Jet.h" -#include - -#include -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod::gjanalysis { diff --git a/PWGJE/DataModel/JetReducedData.h b/PWGJE/DataModel/JetReducedData.h index 1cd94a96d03..039a1ec46de 100644 --- a/PWGJE/DataModel/JetReducedData.h +++ b/PWGJE/DataModel/JetReducedData.h @@ -22,8 +22,6 @@ #include #include // IWYU pragma: keep -#include -#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataDQ.h b/PWGJE/DataModel/JetReducedDataDQ.h index 1249263a71f..d8e633cf036 100644 --- a/PWGJE/DataModel/JetReducedDataDQ.h +++ b/PWGJE/DataModel/JetReducedDataDQ.h @@ -22,8 +22,6 @@ #include #include // IWYU pragma: keep -#include -#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataV0.h b/PWGJE/DataModel/JetReducedDataV0.h index e9d4e4040c2..ec460d5b186 100644 --- a/PWGJE/DataModel/JetReducedDataV0.h +++ b/PWGJE/DataModel/JetReducedDataV0.h @@ -21,8 +21,6 @@ #include #include // IWYU pragma: keep -#include -#include #include #include diff --git a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h index 9b3eef803a8..8cd65eedcb5 100644 --- a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h +++ b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h @@ -19,10 +19,11 @@ #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 +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/PWGJE/JetFinders/jetFinder.h b/PWGJE/JetFinders/jetFinder.h index d45cfa15506..d664e5781da 100644 --- a/PWGJE/JetFinders/jetFinder.h +++ b/PWGJE/JetFinders/jetFinder.h @@ -21,6 +21,8 @@ #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" @@ -30,6 +32,7 @@ #include #include #include +#include #include #include // IWYU pragma: export @@ -43,8 +46,6 @@ #include #include -#include - template struct JetFinderTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHF.h b/PWGJE/JetFinders/jetFinderHF.h index 3016cdb5265..b5e9a531ff3 100644 --- a/PWGJE/JetFinders/jetFinderHF.h +++ b/PWGJE/JetFinders/jetFinderHF.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include // IWYU pragma: export @@ -44,8 +45,6 @@ #include #include -#include - template struct JetFinderHFTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHFHFBar.h b/PWGJE/JetFinders/jetFinderHFHFBar.h index ec4cfa9d94c..77635798346 100644 --- a/PWGJE/JetFinders/jetFinderHFHFBar.h +++ b/PWGJE/JetFinders/jetFinderHFHFBar.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include // IWYU pragma: export @@ -44,8 +45,6 @@ #include #include -#include - template struct JetFinderHFHFBarTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderV0.h b/PWGJE/JetFinders/jetFinderV0.h index 14c2f977ada..2b9b1d76dbd 100644 --- a/PWGJE/JetFinders/jetFinderV0.h +++ b/PWGJE/JetFinders/jetFinderV0.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include // IWYU pragma: export @@ -40,8 +41,6 @@ #include #include -#include - template struct JetFinderV0Task { diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.h b/PWGJE/TableProducer/Matching/jetMatchingMC.h index 95aceb4f6ed..a78c48a2800 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.h +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.h @@ -28,7 +28,6 @@ #include #include #include -#include #include diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index 6a482f981df..7182fbcec05 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -13,6 +13,9 @@ // /// \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" @@ -22,15 +25,10 @@ #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" @@ -42,26 +40,25 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include +#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 diff --git a/PWGJE/TableProducer/derivedDataSelector.cxx b/PWGJE/TableProducer/derivedDataSelector.cxx index c9a0ca6ca32..371dbc73f34 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx index 2c80e811464..b90495d0bb6 100644 --- a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx +++ b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx @@ -18,10 +18,10 @@ #include "EventFiltering/filterTables.h" -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index 41f4d80d227..e5676af0d58 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include diff --git a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx index 7f9e9dfe7dc..8de689c2ee7 100644 --- a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx @@ -12,18 +12,21 @@ // **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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #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 037f793a0d1..3b7c919b7e2 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -50,12 +50,13 @@ #include #include #include -#include #include #include #include +#include + #include #include diff --git a/PWGJE/TableProducer/emcalMatchedTracksTask.cxx b/PWGJE/TableProducer/emcalMatchedTracksTask.cxx index 14f8cc8b92a..55781eb6bc4 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 -#include -#include -#include +#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 diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index d60275c6fac..33cafe0db0c 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -20,19 +20,18 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include +#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 diff --git a/PWGJE/TableProducer/heavyFlavourDefinition.cxx b/PWGJE/TableProducer/heavyFlavourDefinition.cxx index 57027ad8b13..a9f52f96a35 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCD.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx index f294adc0511..ddb518e1bba 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCP.cxx b/PWGJE/TableProducer/jetEventWeightMCP.cxx index 0bc5728a0e0..7f262e998ea 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 10cbcef6286..6878544163a 100644 --- a/PWGJE/TableProducer/jetTaggerHF.cxx +++ b/PWGJE/TableProducer/jetTaggerHF.cxx @@ -16,6 +16,8 @@ /// \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" @@ -23,13 +25,12 @@ #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 @@ -41,7 +42,6 @@ #include #include -#include #include diff --git a/PWGJE/TableProducer/jetTrackDerived.cxx b/PWGJE/TableProducer/jetTrackDerived.cxx index db9a7f5325b..9111ae36c3c 100644 --- a/PWGJE/TableProducer/jetTrackDerived.cxx +++ b/PWGJE/TableProducer/jetTrackDerived.cxx @@ -16,6 +16,7 @@ /// \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" @@ -25,12 +26,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 c4e9faafc94..93a97aea92d 100644 --- a/PWGJE/TableProducer/luminosityCalculator.cxx +++ b/PWGJE/TableProducer/luminosityCalculator.cxx @@ -16,11 +16,11 @@ #include "PWGJE/DataModel/JetReducedData.h" -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include #include -#include #include #include #include diff --git a/PWGJE/TableProducer/luminosityProducer.cxx b/PWGJE/TableProducer/luminosityProducer.cxx index 31823c7ebb7..cafac8d6d2a 100644 --- a/PWGJE/TableProducer/luminosityProducer.cxx +++ b/PWGJE/TableProducer/luminosityProducer.cxx @@ -21,15 +21,17 @@ #include "Common/CCDB/EventSelectionParams.h" -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include #include +#include #include +#include #include #include diff --git a/PWGJE/TableProducer/mcOutlierRejector.cxx b/PWGJE/TableProducer/mcOutlierRejector.cxx index 32fed7ebbb3..3cdb38aa1c6 100644 --- a/PWGJE/TableProducer/mcOutlierRejector.cxx +++ b/PWGJE/TableProducer/mcOutlierRejector.cxx @@ -13,21 +13,17 @@ // /// \author Nima Zardoshti -#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" #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 c7f11e99b0c..71c183e9e83 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" #include -#include #include #include -#include +#include #include -#include #include #include diff --git a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx index e2f2246b21b..8bab0ea0c05 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/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 0275a7a66ed..55ec23b2c44 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -317,10 +317,6 @@ 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/bjetCentMult.cxx b/PWGJE/Tasks/bjetCentMult.cxx index 576afeb4ac0..d2a17c4708b 100644 --- a/PWGJE/Tasks/bjetCentMult.cxx +++ b/PWGJE/Tasks/bjetCentMult.cxx @@ -19,13 +19,14 @@ #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 @@ -34,8 +35,9 @@ #include #include +#include +#include #include -#include #include #include #include diff --git a/PWGJE/Tasks/bjetTaggingGnn.cxx b/PWGJE/Tasks/bjetTaggingGnn.cxx index 8a48eab4af5..be7ec455b65 100644 --- a/PWGJE/Tasks/bjetTaggingGnn.cxx +++ b/PWGJE/Tasks/bjetTaggingGnn.cxx @@ -15,40 +15,35 @@ /// \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/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.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/TrackSelectionTables.h" - -#include -#include -#include -#include -#include + +#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 -#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 002f3b4bf02..6e1b135b745 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -23,10 +23,10 @@ #include "Common/Core/RecoDecay.h" -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index a5c85560f26..4065a6cf334 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,8 +49,6 @@ #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 c7224f12110..e938a5d8bff 100644 --- a/PWGJE/Tasks/chargedJetHadron.cxx +++ b/PWGJE/Tasks/chargedJetHadron.cxx @@ -21,14 +21,14 @@ #include "Common/Core/RecoDecay.h" -#include -#include +#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 @@ -46,26 +46,26 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::constants::math; -const double assoHadronPtMin = 1.0, assoHadronPtMax = 2.0; +const double assoHadronPtCut = 2.0; +static const float kNaN = std::numeric_limits::quiet_NaN(); 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", 8.0, "maximum associate hadron pt cut"}; + Configurable assoHadronPtMaxCut{"assoHadronPtMaxCut", 10.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", 140.0, "maximum pT acceptance for tracks"}; + Configurable trackPtMax{"trackPtMax", 100.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 doDijetEta{"doDijetEta", true, "0: dijet-hadron Eta axis, 1: dijet-hadron DEta axis"}; + Configurable doDijetRaa{"doDijetRaa", false, "0: all axis fill of thnsparse, 1: partial filling of thnsparse"}; 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 = {20, -1.0, 1.0, "#eta"}; + AxisSpec etaAxis = {40, -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 = {32, -1.6, 1.6, "#Delta#eta"}; + AxisSpec detaAxis = {64, -1.6, 1.6, "#Delta#eta"}; AxisSpec dphiAxis = {70, -1.7, 5.3, "#Delta#varphi"}; - AxisSpec drAxis = {30, 0.0, 1.5, "#Delta#it{R}"}; + AxisSpec drAxis = {60, 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, {{500, 0, 100000}}}); + 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("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 || doprocessLeadingJetHadronMCD) { + if (doprocessLeadingJetHadron || doprocessLeadinJetHadronMCD) { 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,23 +242,20 @@ 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("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}); - } + 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}); } - if (doprocessMixLeadingJetHadron || doprocessMixLeadingJetHadronMCD) { + if (doprocessMixLeadingJetHadron || doprocessMixLeadinJetHadronMCD) { 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}}); @@ -267,20 +264,16 @@ 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("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("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_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"); @@ -291,18 +284,18 @@ struct ChargedJetHadron { } if (doprocessCollisionsQCMCP) { - registry.add("h_mcColl_counts", " number of mc events; event status; entries", {HistType::kTH1F, {{9, 0., 9.}}}); + registry.add("h_mcColl_counts", " number of mc events; event status; entries", {HistType::kTH1F, {{7, 0., 7.}}}); 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, "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.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.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_multFT0", " mcp multiplicity global tracks; entries", {HistType::kTH1F, {{500, 0, 100000}}}); + registry.add("h_mcpColl_mult", " mcp multiplicity global tracks; entries", {HistType::kTH1F, {{300, 0, 60000}}}); 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}}); @@ -362,20 +355,17 @@ 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("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}); - } + 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}); } if (doprocessMixLeadingJetHadronMCP) { @@ -388,20 +378,17 @@ 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("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("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_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"); @@ -442,7 +429,7 @@ struct ChargedJetHadron { template bool isGoodCollision(const TCollision& coll) const { - if (!jetderiveddatautilities::selectCollision(coll, eventSelectionBits, skipMBGapEvents.value, applyRCTSelections.value)) + if (!jetderiveddatautilities::selectCollision(coll, eventSelectionBits, skipMBGapEvents.value)) return false; const auto occ = coll.trackOccupancyInTimeRange(); if (occ < trackOccupancyInTimeRangeMin.value || occ > trackOccupancyInTimeRangeMax.value) @@ -457,7 +444,7 @@ struct ChargedJetHadron { } template - bool applyMCCollisionCuts(const TMcCollision& mccollision, const TCollisions& collisions, bool checkMCPFill = false) + bool applyMCCollisionCuts(const TMcCollision& mccollision, const TCollisions& collisions) const { // MC z-vertex cut, must have associated collisions, split-collision rule if (std::abs(mccollision.posZ()) > vertexZCut.value) @@ -468,46 +455,16 @@ struct ChargedJetHadron { if (acceptSplitCollisions.value == NonSplitOnly && collisions.size() > 1) return false; - bool hasSel8Coll = false; - bool occupancyIsGood = false; - bool centralityIsGood = false; - // 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; + if (acceptSplitCollisions.value == SplitOkCheckFirstAssocCollOnly) + return isGoodCollision(*collisions.begin()); + + for (auto const& collision : collisions) { + if (isGoodCollision(collision)) { + return true; } } - 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; + return false; } template @@ -523,14 +480,12 @@ 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 > leadingTrackPt) { - leadingTrackPt = pt; - } + if (pt >= ptMin && pt <= ptMax) + return true; } - return (leadingTrackPt >= ptMin && leadingTrackPt <= ptMax); + return false; } // ========================================================== template @@ -548,6 +503,17 @@ 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) { @@ -581,17 +547,6 @@ 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) { @@ -852,9 +807,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 (doDijetEta && multEta1Eta2 > 0) + if (multEta1Eta2 > 0) registry.fill(HIST("h2_dijet_TimeEtaThan0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (doDijetEta && multEta1Eta2 < 0) + else if (multEta1Eta2 < 0) registry.fill(HIST("h2_dijet_TimeEtaLess0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& track : tracks) { @@ -871,21 +826,18 @@ 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); - // 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); - } + 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); } } } @@ -901,7 +853,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; @@ -969,9 +921,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 (doDijetEta && multEta1Eta2 > 0) + if (multEta1Eta2 > 0) registry.fill(HIST("h2_mixdijet_TimeEtaThan0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (doDijetEta && multEta1Eta2 < 0) + else if (multEta1Eta2 < 0) registry.fill(HIST("h2_mixdijet_TimeEtaLess0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& track : tracks2) { @@ -991,20 +943,18 @@ 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 (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); - } + 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); } } } @@ -1077,9 +1027,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 (doDijetEta && multEta1Eta2 > 0) + if (multEta1Eta2 > 0) registry.fill(HIST("h2_dijet_TimeEtaThan0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (doDijetEta && multEta1Eta2 < 0) + else if (multEta1Eta2 < 0) registry.fill(HIST("h2_dijet_TimeEtaLess0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& particle : particles) { @@ -1094,20 +1044,18 @@ 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 (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); - } + 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); } } } @@ -1190,9 +1138,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 (doDijetEta && multEta1Eta2 > 0) + if (multEta1Eta2 > 0) registry.fill(HIST("h2_mixdijet_TimeEtaThan0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (doDijetEta && multEta1Eta2 < 0) + else if (multEta1Eta2 < 0) registry.fill(HIST("h2_mixdijet_TimeEtaLess0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& particle : particles2) { @@ -1210,20 +1158,18 @@ 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 (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); - } + 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); } } } @@ -1236,7 +1182,7 @@ struct ChargedJetHadron { FilterJetTracks const& tracks) { registry.fill(HIST("h_collisions"), 0.5); - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections.value)) + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) return; registry.fill(HIST("h_collisions"), 1.5); if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { @@ -1247,7 +1193,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) { @@ -1358,7 +1304,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, applyRCTSelections.value)) + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) return; registry.fill(HIST("h_collisions"), 1.5); registry.fill(HIST("h_collisions_weighted"), 1.5, eventWeight); @@ -1372,7 +1318,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)) @@ -1402,9 +1348,9 @@ struct ChargedJetHadron { } PROCESS_SWITCH(ChargedJetHadron, processSpectraAreaSubMCD, "jet spectra with rho-area subtraction for MCD", false); - void processLeadingJetHadronMCD(FilterCollision const& collision, - CorrChargedMCDJets const& jets, - FilterJetTracks const& tracks) + void processLeadinJetHadronMCD(FilterCollision const& collision, + CorrChargedMCDJets const& jets, + FilterJetTracks const& tracks) { const float eventWeight = doEventWeighted ? collision.weight() : 1.f; if (!isGoodCollision(collision)) { @@ -1412,17 +1358,17 @@ struct ChargedJetHadron { } fillLeadingJetHadronHistograms(collision, jets, tracks, eventWeight); } - PROCESS_SWITCH(ChargedJetHadron, processLeadingJetHadronMCD, "same event leading jet-hadron correlations for MCD", false); + PROCESS_SWITCH(ChargedJetHadron, processLeadinJetHadronMCD, "same event leading jet-hadron correlations for MCD", false); - void processMixLeadingJetHadronMCD(FilterCollisions const& collisions, - CorrChargedMCDJets const& jets, - FilterJetTracks const& tracks) + void processMixLeadinJetHadronMCD(FilterCollisions const& collisions, + CorrChargedMCDJets const& jets, + FilterJetTracks const& tracks) { if (collisions.size() == 0) return; fillMixLeadingJetHadronHistograms(collisions, jets, tracks); } - PROCESS_SWITCH(ChargedJetHadron, processMixLeadingJetHadronMCD, "mixed event leading jet-hadron correlations for MCD", false); + PROCESS_SWITCH(ChargedJetHadron, processMixLeadinJetHadronMCD, "mixed event leading jet-hadron correlations for MCD", false); void processJetHadronMCD(FilterCollision const& collision, CorrChargedMCDJets const& jets, @@ -1465,12 +1411,19 @@ struct ChargedJetHadron { return; registry.fill(HIST("h_mcColl_counts"), 3.5); - if (!applyMCCollisionCuts(mccollision, collisions, true)) + int nGood = 0; + for (auto const& collision : collisions) { + if (isGoodCollision(collision)) { + registry.fill(HIST("h_mcdColl_mult"), getMultiplicity(collision), eventWeight); + nGood++; + } + } + if (nGood == 0) return; - registry.fill(HIST("h_mcColl_counts"), 7.5); - registry.fill(HIST("h_mcpColl_zvertex"), mccollision.posZ(), eventWeight); + registry.fill(HIST("h_mcColl_counts"), 4.5); + registry.fill(HIST("h_mcpColl_Zvertex"), mccollision.posZ(), eventWeight); registry.fill(HIST("h_mcpColl_centrality"), mccollision.centFT0M(), eventWeight); - registry.fill(HIST("h_mcpColl_multFT0"), getMultiplicity(mccollision), eventWeight); + registry.fill(HIST("h_mcpColl_mult"), getMultiplicity(mccollision), eventWeight); for (auto const& particle : particles) { fillParticleHistograms(particle, eventWeight); } diff --git a/PWGJE/Tasks/dijetFinderQA.cxx b/PWGJE/Tasks/dijetFinderQA.cxx index defb8a6c926..5c9f39f1a84 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/emcCellMonitor.cxx b/PWGJE/Tasks/emcCellMonitor.cxx index 0df39215cb2..880ce14e490 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 -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGJE/Tasks/emcClusterMonitor.cxx b/PWGJE/Tasks/emcClusterMonitor.cxx index b014ffae8fb..fbb8885c5be 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 -#include +#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 diff --git a/PWGJE/Tasks/emcEventSelectionQA.cxx b/PWGJE/Tasks/emcEventSelectionQA.cxx index ff39021dce6..8ba3f5168c8 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 -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include #include #include diff --git a/PWGJE/Tasks/emcVertexSelectionQA.cxx b/PWGJE/Tasks/emcVertexSelectionQA.cxx index da45a313015..eb579326966 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 -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/emcalGammaGammaBcWise.cxx b/PWGJE/Tasks/emcalGammaGammaBcWise.cxx index aa5e99fb70b..d9674888aed 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 -#include +#include "TLorentzVector.h" +#include "TVector3.h" #include #include diff --git a/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx b/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx index 61bff6d13e1..273907b8056 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 -#include -#include -#include +#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 "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 0af05f60cac..2c999e26100 100644 --- a/PWGJE/Tasks/fullJetSpectra.cxx +++ b/PWGJE/Tasks/fullJetSpectra.cxx @@ -23,22 +23,20 @@ #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 -#include -#include +#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 @@ -1300,7 +1298,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 4aff2f9ec2e..88255a2dda7 100644 --- a/PWGJE/Tasks/fullJetTriggerQATask.cxx +++ b/PWGJE/Tasks/fullJetTriggerQATask.cxx @@ -22,22 +22,23 @@ #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 de043149abe..656f8233b8d 100644 --- a/PWGJE/Tasks/gammaJetTreeProducer.cxx +++ b/PWGJE/Tasks/gammaJetTreeProducer.cxx @@ -14,49 +14,44 @@ /// \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 -#include -#include -#include -#include -#include -#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/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" // \struct GammaJetTreeProducer /// \brief Task to produce a tree for gamma-jet analysis, including photons (and information of isolation) and charged and full jets @@ -70,6 +65,8 @@ 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 7040898d6d1..f84d69d621e 100644 --- a/PWGJE/Tasks/hadronPhotonCorrelation.cxx +++ b/PWGJE/Tasks/hadronPhotonCorrelation.cxx @@ -26,22 +26,24 @@ #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 "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 diff --git a/PWGJE/Tasks/hfDebug.cxx b/PWGJE/Tasks/hfDebug.cxx index f5c96c13337..4efaf6ce7c9 100644 --- a/PWGJE/Tasks/hfDebug.cxx +++ b/PWGJE/Tasks/hfDebug.cxx @@ -14,32 +14,28 @@ /// \author Nima Zardoshti // -#include "PWGJE/DataModel/JetSubtraction.h" -// -#include "PWGHF/Core/DecayChannels.h" -#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsMcGen.h" +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/DataModel/Jet.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 -#include - -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" 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 abcdcdb28b9..e07dca07775 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 @@ -278,7 +278,7 @@ struct HfFragmentationFunction { // filling table distJetTable(axisDistance, - jet.pt(), jet.eta(), jet.phi(), jet.template tracks_as().size() + jet.template candidates_as().size(), + jet.pt(), jet.eta(), jet.phi(), jet.template tracks_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 (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { + if (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() + mcdjet.candidates_as().size(), // detector level jet + mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_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() + mcpjet.candidates_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(), // 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 (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { + if (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() + 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 + 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 } } 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() + +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 + 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 } } // end of mcpjets loop } // end of mccollisions loop diff --git a/PWGJE/Tasks/jetBackgroundAnalysis.cxx b/PWGJE/Tasks/jetBackgroundAnalysis.cxx index f7a0c56c7ac..84925d2dafe 100644 --- a/PWGJE/Tasks/jetBackgroundAnalysis.cxx +++ b/PWGJE/Tasks/jetBackgroundAnalysis.cxx @@ -22,7 +22,6 @@ #include "Common/Core/RecoDecay.h" -#include #include #include #include @@ -31,6 +30,7 @@ #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetChCorr.cxx b/PWGJE/Tasks/jetChCorr.cxx index be4fcf59b0b..070d4194223 100644 --- a/PWGJE/Tasks/jetChCorr.cxx +++ b/PWGJE/Tasks/jetChCorr.cxx @@ -19,32 +19,36 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include #include #include -#include +#include "fastjet/ClusterSequenceArea.hh" +#include "fastjet/PseudoJet.hh" #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 2dbdb7e5206..f33874ca55d 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -13,39 +13,44 @@ /// \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/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Qvectors.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#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 using namespace o2; diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 31b3bfcb944..22c08b9b272 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -13,8 +13,10 @@ /// \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/JetHFUtilities.h" +#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" @@ -27,11 +29,8 @@ #include "Framework/runDataProcessing.h" #include -#include #include -#include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -52,15 +51,12 @@ 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 { @@ -81,7 +77,7 @@ DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); DECLARE_SOA_COLUMN(D0Reflection, d0Reflection, int); } // namespace d0Info -DECLARE_SOA_TABLE(D0Tables, "AOD", "D0TABLE", +DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0DATATABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, d0Info::D0PromptBDT, @@ -105,75 +101,56 @@ DECLARE_SOA_TABLE(D0McPTables, "AOD", "D0MCPTABLE", namespace jetInfo { // D0 tables -DECLARE_SOA_INDEX_COLUMN(D0Table, d0Table); +DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0DataTable); DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); // Jet 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(JetTables, "JETTABLE", +DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, - jetInfo::D0TableId, + jetInfo::D0DataTableId, jetInfo::JetPt, jetInfo::JetEta, 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::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); + jetInfo::D0JetDeltaPhi); } // namespace o2::aod struct JetCorrelationD0 { // Define new table Produces tableCollision; - Produces tableMatchedCollision; Produces tableMcCollision; - Produces tableD0; - Produces tableD0McParticle; - Produces tableJet; - Produces tableJetMcParticle; - Produces tableJetMatched; + Produces tableD0; + Produces tableD0MCParticle; + Produces tableJet; + Produces tableJetMCParticle; // 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 @@ -195,14 +172,13 @@ 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_D0_Jet_dPhi"), dPhi); - registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dPhi); + registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dphi); } template @@ -216,6 +192,26 @@ 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)); @@ -243,7 +239,6 @@ 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 @@ -282,23 +277,23 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - 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)) { + 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 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) { @@ -325,110 +320,60 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - 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)) { + 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 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 detector level jet analysis", false); + PROCESS_SWITCH(JetCorrelationD0, processMCDetector, "charged particle level jet analysis", false); - void processMcParticle(aod::JetMcCollision const& collision, - aod::CandidatesD0MCP const& d0McPCandidates, - soa::Join const& jets) + void processMCParticle(aod::JetMcCollision const& collision, + aod::CandidatesD0MCP const& d0MCPCandidates, + soa::Filtered> const& jets) { - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // build without this return; } tableMcCollision(collision.posZ()); - for (const auto& d0McPCandidate : d0McPCandidates) { - if (d0McPCandidate.pt() < d0McPtCutMin) { + for (const auto& d0MCPCandidate : d0MCPCandidates) { + if (d0MCPCandidate.pt() < d0PtCutMin) { continue; } - tableD0McParticle(tableMcCollision.lastIndex(), - d0McPCandidate.originMcGen(), - d0McPCandidate.pt(), - d0McPCandidate.eta(), - d0McPCandidate.phi(), - d0McPCandidate.y()); + tableD0MCParticle(tableCollision.lastIndex(), + d0MCPCandidate.originMcGen(), + d0MCPCandidate.pt(), + d0MCPCandidate.eta(), + d0MCPCandidate.phi(), + d0MCPCandidate.y()); for (const auto& jet : jets) { - if (jet.pt() < jetMcPtCutMin) { + if (jet.pt() < jetPtCutMin) { continue; } - 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)) { + float dphi = RecoDecay::constrainAngle(jet.phi() - d0MCPCandidate.phi()); + if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dPhi); - tableJetMcParticle(tableMcCollision.lastIndex(), - tableD0McParticle.lastIndex(), + fillJetHistograms(jet, dphi); + tableJetMCParticle(tableCollision.lastIndex(), + tableD0MCParticle.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - 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); - } - } + dphi); } } } - PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMCParticle, "process MC Particle jets", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx index 240fb3e7a20..8f1c9858a5b 100644 --- a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx +++ b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx @@ -17,24 +17,17 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include -#include -#include +#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 using namespace o2; diff --git a/PWGJE/Tasks/jetD0AngSubstructure.cxx b/PWGJE/Tasks/jetD0AngSubstructure.cxx index 9650d7ea4bb..05c1923dd96 100644 --- a/PWGJE/Tasks/jetD0AngSubstructure.cxx +++ b/PWGJE/Tasks/jetD0AngSubstructure.cxx @@ -16,22 +16,29 @@ // \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 -#include -#include +#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 "TVector3.h" #include #include diff --git a/PWGJE/Tasks/jetDebug.cxx b/PWGJE/Tasks/jetDebug.cxx index 53b440e8ea8..be4a84f1a38 100644 --- a/PWGJE/Tasks/jetDebug.cxx +++ b/PWGJE/Tasks/jetDebug.cxx @@ -14,35 +14,27 @@ /// \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 -#include -#include -#include -#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" 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 629ba2f75f3..3e2e12d378a 100644 --- a/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx +++ b/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx @@ -17,23 +17,28 @@ /// \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 -#include -#include +#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 "TVector3.h" #include #include diff --git a/PWGJE/Tasks/jetFinderFullQA.cxx b/PWGJE/Tasks/jetFinderFullQA.cxx index 69b18b6e4af..6dc665fe07d 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 +#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/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 87315fc0819..40956d71038 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -91,7 +91,6 @@ 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; @@ -101,8 +100,6 @@ struct JetFinderQATask { std::vector eventSelectionBits; int trackSelection = -1; - float simPtRef = 10.; - std::vector jetPtBins; std::vector jetPtBinsRhoAreaSub; @@ -409,15 +406,13 @@ 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); @@ -435,20 +430,6 @@ 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, {{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); @@ -463,7 +444,6 @@ 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)); @@ -1491,14 +1471,17 @@ struct JetFinderQATask { } PROCESS_SWITCH(JetFinderQATask, processOccupancyQA, "occupancy QA on jet derived data", false); - void processQcMultCutCheck(soa::Filtered>::iterator const& collision, - soa::Join const&, - soa::Join const&, + void processQcMultCutCheck(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, - soa::Filtered> const& tracks, - soa::Filtered const& mcparticles) + soa::Filtered> const& tracks) { - float eventWeight = multCutCheck_applyWeightCorrection ? collision.weight() : 1; + 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) { @@ -1510,24 +1493,6 @@ struct JetFinderQATask { return; } - bool fillHistograms = 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 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); - } - 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); @@ -1536,9 +1501,6 @@ 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); @@ -1547,21 +1509,6 @@ 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(), 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) { registry.fill(HIST("h_jet_pt"), mcdjet.pt(), eventWeight); registry.fill(HIST("h_jet_eta"), mcdjet.eta(), eventWeight); diff --git a/PWGJE/Tasks/jetFinderV0QA.cxx b/PWGJE/Tasks/jetFinderV0QA.cxx index 55036241730..a80ee0eea25 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include #include -#include #include #include #include diff --git a/PWGJE/Tasks/jetFormationTimeReclustering.cxx b/PWGJE/Tasks/jetFormationTimeReclustering.cxx index b411fdddbe9..3040175b9bc 100644 --- a/PWGJE/Tasks/jetFormationTimeReclustering.cxx +++ b/PWGJE/Tasks/jetFormationTimeReclustering.cxx @@ -23,10 +23,12 @@ #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 @@ -75,22 +77,24 @@ 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 +#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 diff --git a/PWGJE/Tasks/jetFragmentation.cxx b/PWGJE/Tasks/jetFragmentation.cxx index f919d1f3ec3..0d3fe2965ed 100644 --- a/PWGJE/Tasks/jetFragmentation.cxx +++ b/PWGJE/Tasks/jetFragmentation.cxx @@ -23,6 +23,7 @@ #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 0cfbcd2ea8d..a16770e19f1 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -23,18 +23,19 @@ #include "Common/Core/RecoDecay.h" -#include -#include +#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 "TRandom3.h" #include #include @@ -70,7 +71,6 @@ 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"}; @@ -94,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 && aod::jcollision::trackOccupancyInTimeRange < trackOccupancyInTimeRangeMax); + Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax); 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, @@ -148,11 +148,8 @@ 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); @@ -172,7 +169,6 @@ 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) { @@ -258,7 +254,6 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; - int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -301,9 +296,7 @@ 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]; @@ -348,7 +341,6 @@ 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); @@ -397,7 +389,6 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; - int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -440,9 +431,7 @@ 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]; @@ -653,6 +642,7 @@ struct JetHadronRecoil { const auto jetsTagColl = jetsTag.sliceBy(perColJetMC, collisionID); for (const auto& jetTag : jetsTagColl) { + if (jetTag.pt() > pTHatMaxMCP * pTHat) { if (outlierRejectEvent) { return; @@ -870,8 +860,6 @@ 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); @@ -916,8 +904,6 @@ 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); @@ -962,8 +948,6 @@ 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); diff --git a/PWGJE/Tasks/jetLundPlane.cxx b/PWGJE/Tasks/jetLundPlane.cxx deleted file mode 100644 index eaa2af5b3a6..00000000000 --- a/PWGJE/Tasks/jetLundPlane.cxx +++ /dev/null @@ -1,804 +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. - -/// \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_CUSTOM(MiniCollision, miniCollision, "MINICOLLS"); - -// 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; -constexpr uint64_t collisionKeyShift = 1ULL; -constexpr uint64_t partCollisionKeyTag = 1ULL; -constexpr size_t MinConstituentsForJet = 2; - -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() < MinConstituentsForJet) { - 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()) << collisionKeyShift) | partCollisionKeyTag; - 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()) << collisionKeyShift); - 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)}; -} diff --git a/PWGJE/Tasks/jetLundReclustering.cxx b/PWGJE/Tasks/jetLundReclustering.cxx index 95b5b027931..b78c6f2b6ef 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include -#include +#include "fastjet/ClusterSequenceArea.hh" +#include "fastjet/PseudoJet.hh" #include -#include #include #include diff --git a/PWGJE/Tasks/jetMatchingQA.cxx b/PWGJE/Tasks/jetMatchingQA.cxx index eac3b3cf4bf..6770d42e47e 100644 --- a/PWGJE/Tasks/jetMatchingQA.cxx +++ b/PWGJE/Tasks/jetMatchingQA.cxx @@ -17,8 +17,8 @@ #include "PWGJE/DataModel/Jet.h" -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include #include #include diff --git a/PWGJE/Tasks/jetOutlierQA.cxx b/PWGJE/Tasks/jetOutlierQA.cxx index d0d802a95a8..89daf7111ce 100644 --- a/PWGJE/Tasks/jetOutlierQA.cxx +++ b/PWGJE/Tasks/jetOutlierQA.cxx @@ -17,9 +17,11 @@ #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 @@ -27,14 +29,17 @@ #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 480dcc69a53..2b93d9b1255 100644 --- a/PWGJE/Tasks/jetPlanarFlow.cxx +++ b/PWGJE/Tasks/jetPlanarFlow.cxx @@ -24,21 +24,18 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include +#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 diff --git a/PWGJE/Tasks/jetShape.cxx b/PWGJE/Tasks/jetShape.cxx index a5d8e9687a5..a02940bd9a2 100644 --- a/PWGJE/Tasks/jetShape.cxx +++ b/PWGJE/Tasks/jetShape.cxx @@ -32,7 +32,6 @@ #include "Framework/runDataProcessing.h" #include -#include #include #include @@ -76,39 +75,6 @@ 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", @@ -132,33 +98,27 @@ 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}}}}, - {"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}}}}, + {"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}}}}, {"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}}}}, - {"tpcDedxPerpJet", "tpcDedxPerpJet", {HistType::kTH2F, {{nBinsPForDedx, 0, pMax}, {nBinsTpcDedx, 0, 1000}}}}, + {"tpcDedxOutOfJet", "tpcDedxOutOfJet", {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}}}}, - {"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}}}}, + {"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}}}}, {"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}}}}, - {"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}}}}, + {"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}}}}, {"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::kTH2F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}, {100, 0, 2}}}}, + {"area", "area", {HistType::kTH1F, {{100, 0, 4}}}}, {"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}}}}, @@ -167,11 +127,10 @@ 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, {{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}}}}, + {"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, ""}}}}, {"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}}}}, @@ -190,6 +149,37 @@ 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; @@ -260,7 +250,7 @@ struct JetShapeTask { return; } - registry.fill(HIST("eventCounterJetShape"), collision.centFT0M()); + registry.fill(HIST("eventCounterJetShape"), 0.5); size_t nBins = distanceCategory->size() - 1; @@ -370,6 +360,7 @@ 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); @@ -406,7 +397,7 @@ struct JetShapeTask { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - registry.fill(HIST("eventCounterJet"), collision.centFT0M()); + registry.fill(HIST("eventCounterJet"), 0.5); registry.fill(HIST("event/vertexz"), collision.posZ()); float rho = collision.rho(); @@ -431,60 +422,11 @@ 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; @@ -550,65 +492,29 @@ struct JetShapeTask { // --- Background Fill --- if (distBg1 < distanceMax || distBg2 < distanceMax) { - registry.fill(HIST("tpcDedxPerpJet"), trkP, tpcSig); + registry.fill(HIST("tpcDedxOutOfJet"), trkP, tpcSig); // dcaXY if (track.hasTOF()) { if (nSigmaSqPr < nSigmaMaxForDcaxy) { - registry.fill(HIST("dcaPrPerpJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); + registry.fill(HIST("dcaPrOutOfJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); } if (nSigmaSqPi < nSigmaMaxForDcaxy) { - registry.fill(HIST("dcaPiPerpJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); + registry.fill(HIST("dcaPiOutOfJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); } } if (hasTofPi) { - registry.fill(HIST("tpcTofPiPerpJet"), trkP, tpcPi, jet.ptCorr, centrality); + registry.fill(HIST("tpcTofPiOutOfJet"), trkP, tpcPi, jet.ptCorr, centrality); if (isTpcPiRange) { - registry.fill(HIST("pVsPtForPiPerpJet"), trkP, trkPt, jet.ptCorr, centrality); + registry.fill(HIST("pVsPtForPiOutOfJet"), trkP, trkPt, jet.ptCorr, centrality); } } if (hasTofPr) { - registry.fill(HIST("tpcTofPrPerpJet"), trkP, tpcPr, jet.ptCorr, centrality); + registry.fill(HIST("tpcTofPrOutOfJet"), trkP, tpcPr, jet.ptCorr, centrality); if (isTpcPrRange) { - 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); - } + registry.fill(HIST("pVsPtForPrOutOfJet"), trkP, trkPt, jet.ptCorr, centrality); } } } @@ -652,7 +558,7 @@ struct JetShapeTask { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - registry.fill(HIST("eventCounterInc"), collision.centFT0M()); + registry.fill(HIST("eventCounterJet"), 0.5); // tracks conditions for (const auto& jetTrack : tracks) { diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index bd055c36f2a..09e02d67d4e 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -19,16 +19,15 @@ #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 @@ -63,7 +62,6 @@ 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"}; @@ -262,7 +260,6 @@ 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); @@ -678,7 +675,6 @@ 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)) { @@ -718,7 +714,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); - float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_coll_phat"), pTHat); registry.fill(HIST("h_coll_phat_weighted"), pTHat, eventWeight); } @@ -747,7 +743,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_mccollisions_zvertex"), mccollision.posZ(), eventWeight); - float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccoll_phat"), pTHat); registry.fill(HIST("h_mccoll_phat_weighted"), pTHat, eventWeight); } @@ -856,7 +852,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -883,7 +879,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -1126,7 +1122,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -1158,7 +1154,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccollisions_rho"), mccollision.rho(), eventWeight); for (auto const& jet : jets) { @@ -1249,7 +1245,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (const auto& mcdjet : mcdjets) { if (!isAcceptedJet(mcdjet)) { continue; @@ -1292,7 +1288,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); double mcrho = collision.has_mcCollision() ? collision.mcCollision_as().rho() : -1; diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index e9e445861e0..54dbc47901a 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -24,28 +24,22 @@ #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 -#include #include #include #include #include -#include #include #include -#include - #include #include #include @@ -54,13 +48,11 @@ #include #include #include - using namespace o2; 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"}; @@ -141,12 +133,6 @@ 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; @@ -154,12 +140,10 @@ struct JetSpectraEseTask { using ChargedMCDJets = soa::Filtered>; Preslice mcdjetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; - Preslice mcdTracksPerJCollision = o2::aod::jtrack::collisionId; SliceCache cache; using BinningType = ColumnBinningPolicy; BinningType corrBinning{{binsZVtx, binsCentrality}, true}; - Service pdg; enum class DetID { FT0C, FT0A, @@ -350,8 +334,6 @@ 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"); @@ -364,9 +346,8 @@ 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(1, "Event selection"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Occupancy cut"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Vtx z cut"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Collision size < 1"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Occupancy cut"); } if (doprocessMCChargedMatched) { LOGF(info, "JetSpectraEseTask::init() - MC Charged Matched"); @@ -408,48 +389,6 @@ 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("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("mcrec/hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); - registry.add("mcrec/hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); - registry.add("mcrec/hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); - } - } - - template - void loadEfficiency(TBC 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 @@ -524,25 +463,19 @@ 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], weff); - hSameSub[lRndInd]->Fill(centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); + 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]); } } for (const auto& track : tracks) { - double weff = getEfficiency(track); - if (weff < 0) - continue; - registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt(), weff); + registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt()); 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(), weff); + registry.fill(HIST("trackQA/after/hTrackPt"), centrality, track.pt()); 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]); @@ -556,10 +489,7 @@ 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()); @@ -618,29 +548,23 @@ 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("thn_jethad_corr_mixed"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); + 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]); } } for (const auto& track : tracks2) { - double weff = getEfficiency(track); - if (weff < 0) - continue; - registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt(), weff); + registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt()); 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(), weff); + registry.fill(HIST("trackQA/after/hTrackPtMixed"), centrality, track.pt()); registry.fill(HIST("trackQA/after/hTrackEtaMixed"), centrality, track.eta()); registry.fill(HIST("trackQA/after/hTrackPhiMixed"), centrality, track.phi()); } @@ -649,7 +573,7 @@ struct JetSpectraEseTask { void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered> const& jets, - aod::JetTracks const& tracks, aod::JBCs const&) + aod::JetTracks const& tracks) { registry.fill(HIST("eventQA/hEventCounter"), kFilteredInputEv); registry.fill(HIST("eventQA/before/hVtxZ"), collision.posZ()); @@ -661,15 +585,13 @@ 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::JBCs const&) + aod::JetTracks const& tracks) { jetMixed(collisions, jets, tracks); } @@ -756,13 +678,12 @@ 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); @@ -787,7 +708,6 @@ struct JetSpectraEseTask { if (!(std::abs(collision.posZ()) < vertexZCut)) { return; } - registry.fill(HIST("mcd/hEventCounter"), counter++); auto centrality = cfgisPbPb ? collision.centFT0M() : -1; @@ -848,134 +768,6 @@ 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; - } - - for (const auto& particle : particles) { - if (particle.mcCollisionId() != mcCollision.globalIndex()) { - continue; - } - 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("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); - 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("mcrec/hTrackPtReco"), track.pt()); - registry.fill(HIST("mcrec/hTrackEtaReco"), track.eta()); - registry.fill(HIST("mcrec/hTrackPhiReco"), track.phi()); - } - } - } - PROCESS_SWITCH(JetSpectraEseTask, processMCRecoTrack, "jet MC process: Reconstructed track", false); - static constexpr float InvalidValue = 999.; // template diff --git a/PWGJE/Tasks/jetSubstructure.cxx b/PWGJE/Tasks/jetSubstructure.cxx index fe568b6c2a6..65e2953a8c3 100644 --- a/PWGJE/Tasks/jetSubstructure.cxx +++ b/PWGJE/Tasks/jetSubstructure.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/jetSubstructureHF.h b/PWGJE/Tasks/jetSubstructureHF.h index 0dbe9aa6e3f..d0734e071ea 100644 --- a/PWGJE/Tasks/jetSubstructureHF.h +++ b/PWGJE/Tasks/jetSubstructureHF.h @@ -52,6 +52,8 @@ #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 2eb799a6708..afabd8b1d65 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.h +++ b/PWGJE/Tasks/jetSubstructureHFOutput.h @@ -36,6 +36,8 @@ #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 954214c7226..cb849700592 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include -#include #include #include #include @@ -38,6 +38,8 @@ 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 1dd147c0ff7..d64b664b98b 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 22ee5b8306d..d8b795aa1d6 100644 --- a/PWGJE/Tasks/jetTriggerChargedQa.cxx +++ b/PWGJE/Tasks/jetTriggerChargedQa.cxx @@ -18,12 +18,15 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include -#include -#include -#include +#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 diff --git a/PWGJE/Tasks/jetTutorial.cxx b/PWGJE/Tasks/jetTutorial.cxx index 828a23a86ce..48742399bf7 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 763f2dc4c0e..eeccd409d26 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/jetValidationQA.cxx b/PWGJE/Tasks/jetValidationQA.cxx index 999a1feeaef..4ccd260f47e 100644 --- a/PWGJE/Tasks/jetValidationQA.cxx +++ b/PWGJE/Tasks/jetValidationQA.cxx @@ -18,11 +18,11 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/mcGeneratorStudies.cxx b/PWGJE/Tasks/mcGeneratorStudies.cxx index 1fd61f64bfc..8310b03c25a 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 +#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 diff --git a/PWGJE/Tasks/nsubjettiness.cxx b/PWGJE/Tasks/nsubjettiness.cxx index e09bff37b17..133e1e6323b 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 +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #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 f6a419992b8..0953cb87500 100644 --- a/PWGJE/Tasks/nucleiInJets.cxx +++ b/PWGJE/Tasks/nucleiInJets.cxx @@ -14,39 +14,36 @@ #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 -#include -#include -#include -#include +#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 "TDatabasePDG.h" #include #include #include -#include -#include +#include #include #include diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 085da029904..8571b76b880 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 -#include +#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 "TRandom.h" #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx index 81cd439194e..0f4dbf82e41 100644 --- a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx +++ b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx @@ -20,43 +20,31 @@ #include "PWGJE/DataModel/PhotonChargedTriggerCorrelation.h" -#include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetReducedData.h" -// #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" +#include "PWGJE/DataModel/Jet.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 -#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 "Math/Vector4D.h" +#include "TMath.h" #include #include #include -#include -#include #include -#include -#include +#include #include #include #include @@ -728,7 +716,7 @@ struct PhotonChargedTriggerCorrelation { // init analysis variables // get variables from other tasks - o2::common::core::getTaskOptionValue(initContext, "photon-charged-trigger-producer", "etaMax", etaMax, false); + 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 4ffc372ad67..d600ca43c03 100644 --- a/PWGJE/Tasks/photonChargedTriggerProducer.cxx +++ b/PWGJE/Tasks/photonChargedTriggerProducer.cxx @@ -15,30 +15,35 @@ /// /// Table producer for photon-jet angular correlation analysis (see photonChargedTriggerCorrelation.cxx) -#include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/PCMUtilities.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/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/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include +#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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include +#include "Math/Vector4D.h" +#include "TMath.h" +#include +#include #include +#include +#include +#include #include #include diff --git a/PWGJE/Tasks/photonIsolationQA.cxx b/PWGJE/Tasks/photonIsolationQA.cxx index 4f31995b218..1738fef952f 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 -#include -#include -#include -#include +#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 diff --git a/PWGJE/Tasks/recoilJets.cxx b/PWGJE/Tasks/recoilJets.cxx index bb141c84a86..08271300538 100644 --- a/PWGJE/Tasks/recoilJets.cxx +++ b/PWGJE/Tasks/recoilJets.cxx @@ -18,37 +18,32 @@ #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 -#include -#include +#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 "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 b7d6fce2dff..4e13332dcfe 100644 --- a/PWGJE/Tasks/statPromptPhoton.cxx +++ b/PWGJE/Tasks/statPromptPhoton.cxx @@ -15,30 +15,40 @@ /// /// \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 -#include -#include -#include -#include -#include -#include -#include -#include +#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 diff --git a/PWGJE/Tasks/substructureDebug.cxx b/PWGJE/Tasks/substructureDebug.cxx index 0243cce3c1a..c6830c3a038 100644 --- a/PWGJE/Tasks/substructureDebug.cxx +++ b/PWGJE/Tasks/substructureDebug.cxx @@ -14,26 +14,28 @@ /// \author Nima Zardoshti // +#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetSubstructure.h" -#include -#include -#include -#include -#include -#include -#include -#include +#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 "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" 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 c1da7482405..1228de53867 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -19,18 +19,16 @@ #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include -#include +#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 @@ -86,7 +84,6 @@ 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"}; @@ -106,6 +103,7 @@ struct TrackEfficiency { std::vector eventSelectionBits; int trackSelection = -1; + float simPtRef = 10.; enum AcceptSplitCollisionsOptions { NonSplitOnly = 0, @@ -437,7 +435,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; } @@ -476,7 +474,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() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -623,7 +621,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; } @@ -685,7 +683,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 } } @@ -819,7 +817,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (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 +846,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -873,7 +871,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -881,7 +879,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; } @@ -936,7 +934,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -944,7 +942,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; } @@ -1030,7 +1028,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() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (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 +1065,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() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1082,14 +1080,14 @@ 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() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); + 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 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; } @@ -1154,15 +1152,15 @@ 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() : 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 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 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 3b7eafded61..60c099bf7a3 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 -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/triggerCorrelations.cxx b/PWGJE/Tasks/triggerCorrelations.cxx index 2a32add9252..c0c272d39c7 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" #include -#include #include #include #include diff --git a/PWGJE/Tasks/v0JetSpectra.cxx b/PWGJE/Tasks/v0JetSpectra.cxx index d17078958f9..95081bad725 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 -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisTask.h" #include #include #include diff --git a/PWGJE/Tasks/v0QA.cxx b/PWGJE/Tasks/v0QA.cxx index e32d56bc590..353869e4644 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,7 +35,6 @@ #include #include -#include #include #include diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 4d3d16f07f6..7d0a9c156a8 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,8 @@ 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,23 +450,19 @@ DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::DCAzMC, NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, - NPCascadeTable::MotherDecayDaughters); -DECLARE_SOA_TABLE(NPMCChargedTable, "AOD", "NPMCChargedTABLE", - NPCascadeTable::PtGen, - NPCascadeTable::PtRec, - NPCascadeTable::MultNTracksGlobal, - NPCascadeTable::MultGen); -DECLARE_SOA_TABLE(NPCollisionTable, "AOD", "NPCollisionTABLE", + NPCascadeTable::MotherDecayDaughters) +DECLARE_SOA_TABLE(NPPileUpTable, "AOD", "NPPileUpTABLE", NPCascadeTable::RunNumber, NPCascadeTable::GlobalBC, aod::collision::NumContrib, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::CentFT0M, - NPCascadeTable::MultFT0M); -DECLARE_SOA_INDEX_COLUMN_FULL(NPCollision, npCollision, int32_t, NPCollisionTable, ""); -DECLARE_SOA_TABLE(NPRecoChargedCand, "AOD", "NPRecoChargedCand", - NPCollisionId, - NPCascadeTable::PtRec); + 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/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index bb1c1586485..675b7265d4b 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -231,9 +231,6 @@ 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); @@ -646,8 +643,6 @@ DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0", v0data::DCAPosToPV, v0data::DCANegToPV, v0data::DCAV0ToPV, - resodaughter::NCrossedRowsPos, - resodaughter::NCrossedRowsNeg, resodaughter::MLambda, resodaughter::MAntiLambda, resodaughter::MK0Short, @@ -715,9 +710,6 @@ 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/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 6c8c9c3a232..9d728bab596 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -35,11 +35,16 @@ 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); @@ -158,9 +163,6 @@ 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, @@ -500,42 +502,6 @@ 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 { @@ -601,7 +567,6 @@ 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); @@ -611,9 +576,6 @@ 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); @@ -623,8 +585,6 @@ 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); @@ -731,17 +691,15 @@ 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::PhotonAmplitudeA, - sigma0MCCore::PhotonPDGCodePos, sigma0MCCore::PhotonPDGCodeNeg, sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, + sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, + sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz, - sigma0MCCore::LambdaPDGCodePos, sigma0MCCore::LambdaPDGCodeNeg, sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, + sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, // Dynamic columns sigma0MCCore::IsSigma0, @@ -770,6 +728,11 @@ 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 { @@ -960,6 +923,12 @@ 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/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 33d06f159d9..bc7fd7d3aaa 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -82,11 +82,6 @@ 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, @@ -279,16 +274,6 @@ 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 @@ -330,11 +315,11 @@ DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) stracollision::EventTime); using StraRawCents = StraRawCents_004; -using StraCents = StraCents_002; +using StraCents = StraCents_001; using StraEvSels = StraEvSels_005; using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; -using StraCent = StraCents::iterator; +using StraCent = StraCents_001::iterator; namespace stramccollision { diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx index 6ce044dac61..19fc5e65393 100644 --- a/PWGLF/TableProducer/Common/zdcvector.cxx +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -85,7 +85,6 @@ 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"}; @@ -120,7 +119,6 @@ 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}}); @@ -130,14 +128,6 @@ 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"); @@ -151,11 +141,6 @@ 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; @@ -195,14 +180,6 @@ 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(); @@ -210,7 +187,6 @@ 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; @@ -246,14 +222,6 @@ 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; @@ -276,8 +244,6 @@ 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); @@ -286,7 +252,6 @@ 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)); } @@ -299,7 +264,6 @@ struct zdcvector { return; } else { double ampl = gainequal * znaEnergy[iChA]; - znaEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -316,7 +280,6 @@ struct zdcvector { return; } else { double ampl = gainequal * zncEnergy[iChA - 4]; - zncEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -328,26 +291,13 @@ struct zdcvector { } } - auto cZNC = 1.0; - auto cZNA = 1.0; - if (sumA > 0) { - 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); + qxZDCA = qxZDCA / sumA; + qyZDCA = qyZDCA / sumA; } if (sumC > 0) { - 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); + qxZDCC = qxZDCC / sumC; + qyZDCC = qyZDCC / sumC; } if (sumA <= 1e-4 || sumC <= 1e-4) { @@ -372,8 +322,6 @@ 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/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 1928dbdbc45..25aa3e94e7e 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -89,22 +89,12 @@ 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; @@ -339,35 +329,21 @@ 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}); } } @@ -459,9 +435,9 @@ struct hyperRecoTask { hEvents->Fill(1.); if (std::abs(collision.posZ()) > 10) { + hEvents->Fill(2.); continue; } - hEvents->Fill(2.); if (zorroSelected) { hEventsZorro->Fill(1.); @@ -504,9 +480,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)) { @@ -690,7 +666,7 @@ struct hyperRecoTask { if (std::abs(posTrack.eta()) > etaMax || std::abs(negTrack.eta()) > etaMax) continue; - // temporary fix: tpcInnhRecoCentralityColvsFT0CmultiplicityerParam() returns the momentum in all the software tags before: https://github.com/AliceO2Group/AliceO2/pull/12521 + // temporary fix: tpcInnerParam() 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 @@ -1057,8 +1033,6 @@ 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) { @@ -1077,20 +1051,11 @@ 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; @@ -1131,7 +1096,6 @@ 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 @@ -1139,7 +1103,6 @@ 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()); } } diff --git a/PWGLF/TableProducer/QC/nucleiQC.cxx b/PWGLF/TableProducer/QC/nucleiQC.cxx index 7ed749b2c44..a6597d45137 100644 --- a/PWGLF/TableProducer/QC/nucleiQC.cxx +++ b/PWGLF/TableProducer/QC/nucleiQC.cxx @@ -110,7 +110,6 @@ 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"}; @@ -348,8 +347,10 @@ struct nucleiQC { } } - void fillSpeciesFlags(const int iSpecies, nuclei::SlimCandidate& candidate) + template + void fillNucleusFlagsPdgs(const int iSpecies, const Tcollision& collision, const Ttrack& track, nuclei::SlimCandidate& candidate) { + candidate.flags = static_cast((track.pidForTracking() & 0xF) << 12); switch (iSpecies) { case nuclei::Species::kPr: @@ -371,14 +372,6 @@ 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; @@ -515,117 +508,110 @@ struct nucleiQC { } } - void processMc(const Collisions& collisions, const TrackCandidatesMC& tracks, const aod::BCsWithTimestamps&, const aod::McParticles& mcParticles) + void processMc(const Collision& collision, const TrackCandidatesMC& tracks, const aod::BCsWithTimestamps&, const aod::McParticles& mcParticles) { + gRandom->SetSeed(67); mNucleiCandidates.clear(); - std::vector reconstructedMcParticles(mcParticles.size(), false); + mFilledMcParticleIds.clear(); - for (const auto& collision : collisions) { + auto bc = collision.template bc_as(); + initCCDB(bc); - auto bc = collision.template bc_as(); - initCCDB(bc); - - if (!nuclei::eventSelection(collision, mHistograms, cfgEventSelections, cfgCutVertex)) - continue; - - 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) { - - mTrackTuner.setRunNumber(mRunNumber); + if (!nuclei::eventSelection(collision, mHistograms, cfgEventSelections, cfgCutVertex)) + return; - /// setup the "auto-detected" path based on the run number - mTrackTuner.getPathInputFileAutomaticFromCCDB(); - mHistTrackTunedTracks->SetTitle(mTrackTuner.outputString.c_str()); - mTrackTuner.getDcaGraphs(); - } + 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) { - auto tracksThisCollision = tracks.sliceBy(mTracksPerCollision, collision.globalIndex()); - for (const auto& track : tracksThisCollision) { + mTrackTuner.setRunNumber(mRunNumber); - static_for<0, nuclei::kNspecies - 1>([&](auto iSpecies) { - constexpr int kSpeciesCt = decltype(iSpecies)::value; - const int kSpeciesRt = kSpeciesCt; + /// setup the "auto-detected" path based on the run number + mTrackTuner.getPathInputFileAutomaticFromCCDB(); + mHistTrackTunedTracks->SetTitle(mTrackTuner.outputString.c_str()); + mTrackTuner.getDcaGraphs(); + } - if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), kSpeciesRt) == mSpeciesToProcess.end()) - return; + auto tracksThisCollision = tracks.sliceBy(mTracksPerCollision, collision.globalIndex()); + tracksThisCollision.bindExternalIndices(&tracks); - if (!track.has_mcParticle()) - return; + for (const auto& track : tracks) { - if (track.mcParticleId() < -1 || track.mcParticleId() >= mcParticles.size()) - return; - const auto& particle = mcParticles.iteratorAt(track.mcParticleId()); + static_for<0, nuclei::kNspecies - 1>([&](auto iSpecies) { + constexpr int kSpeciesCt = decltype(iSpecies)::value; + const int kSpeciesRt = kSpeciesCt; - if (cfgDoCheckPdgCode) { - if (std::abs(particle.pdgCode()) != nuclei::pdgCodes[kSpeciesRt]) - return; - } + if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), kSpeciesRt) == mSpeciesToProcess.end()) + return; - if (cfgDownscalingFactor->get(kSpeciesRt) < 1.) { - if ((gRandom->Uniform()) > cfgDownscalingFactor->get(kSpeciesRt)) - return; - } + if (!track.has_mcParticle()) + return; - if (cfgRapidityToggle && ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax)) + const auto& particle = track.mcParticle(); + if (cfgDoCheckPdgCode) { + if (std::abs(particle.pdgCode()) != nuclei::pdgCodes[kSpeciesRt]) return; + } - if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) + if (cfgDownscalingFactor->get(kSpeciesRt) < 1.) { + if ((gRandom->Uniform()) > cfgDownscalingFactor->get(kSpeciesRt)) return; + } - LOG(info) << "track passed physical primary cut"; + if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) + 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); + if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) + return; - if (!pidSelection(track, collision)) - return; - mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kPidCuts); + 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); - nuclei::SlimCandidate candidate; - candidate = fillCandidate(kSpeciesCt, collision, track); + if (!pidSelection(track, collision)) + return; + mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kPidCuts); - mNucleiCandidates.emplace_back(candidate); - reconstructedMcParticles[particle.globalIndex()] = true; + nuclei::SlimCandidate candidate; + candidate = fillCandidate(kSpeciesCt, collision, track); - dispatchFillHistograms(kSpeciesRt, candidate); - dispatchFillHistograms(kSpeciesRt, candidate); - }); - } + mNucleiCandidates.emplace_back(candidate); + mFilledMcParticleIds.emplace_back(particle.globalIndex()); + dispatchFillHistograms(kSpeciesRt, candidate); + dispatchFillHistograms(kSpeciesRt, candidate); + }); } - int mcIndex = -1; - for (const auto& particle : mcParticles) { + const int mcCollisionId = collision.mcCollisionId(); + auto mcParticlesThisCollision = mcParticles.sliceBy(mMcParticlesPerCollision, mcCollisionId); + mcParticlesThisCollision.bindExternalIndices(&mcParticles); - mcIndex++; + for (const auto& particle : mcParticlesThisCollision) { - int iSpecies = nuclei::getSpeciesFromPdg(particle.pdgCode()); - if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), iSpecies) == mSpeciesToProcess.end()) + if (std::find(mFilledMcParticleIds.begin(), mFilledMcParticleIds.end(), particle.globalIndex()) != mFilledMcParticleIds.end()) continue; - if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) + if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) continue; - if (reconstructedMcParticles[mcIndex]) + if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) continue; - if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) + int iSpecies = nuclei::getSpeciesFromPdg(particle.pdgCode()); + if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), iSpecies) == mSpeciesToProcess.end()) continue; if (cfgDownscalingFactor->get(iSpecies) < 1.) { if ((gRandom->Uniform()) > cfgDownscalingFactor->get(iSpecies)) - continue; + return; } nuclei::SlimCandidate candidate; - // 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); + candidate.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator, mHistFailCentrality); fillNucleusFlagsPdgsMc(particle, candidate); fillNucleusGeneratedVariables(particle, candidate); diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 760360a497c..03c28a9b701 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -796,8 +796,6 @@ 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(), @@ -860,9 +858,6 @@ 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()); @@ -1741,9 +1736,6 @@ 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)) { @@ -1754,6 +1746,10 @@ 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); @@ -1829,9 +1825,6 @@ 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)) { @@ -1846,11 +1839,16 @@ 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 0049c9ce6ad..358703eaf13 100644 --- a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx @@ -1034,8 +1034,6 @@ struct ResonanceDaughterInitializer { v0.dcapostopv(), v0.dcanegtopv(), v0.dcav0topv(), - 0, - 0, v0.mLambda(), v0.mAntiLambda(), v0.mK0Short(), @@ -1208,9 +1206,6 @@ 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/TableProducer/Strangeness/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/CMakeLists.txt index 08ec72c6913..3f1d8565951 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 O2::Framework O2::EMCALBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(lambdajetpolarizationbuilder diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 8239715863d..83dfdaa3a36 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -124,11 +124,6 @@ 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 deleted file mode 100644 index febbb451be9..00000000000 --- a/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx +++ /dev/null @@ -1,44 +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/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/cascqaanalysis.cxx b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx index 81293bcebf2..e32ebd8a9db 100644 --- a/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx +++ b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx @@ -34,9 +34,7 @@ #include #include -#include #include -#include #include using namespace o2; @@ -124,7 +122,7 @@ struct Cascqaanalysis { SliceCache cache; // Random number generator for event scaling - TRandom2 fRand; + TRandom2* fRand = new TRandom2(); // Struct to select on event type typedef struct CollisionIndexAndType { @@ -132,41 +130,6 @@ 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)"}; @@ -247,13 +210,17 @@ struct Cascqaanalysis { auto bachelor = cascCand.template bachelor_as(); // Basic set of selections - 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; + 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; + } } template @@ -452,16 +419,39 @@ 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(); - 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); + // 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); mycascades(collision.posZ(), collision.centFT0M(), collision.centFV0A(), @@ -573,17 +563,41 @@ 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(); - 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); + // 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); mycascades(collision.posZ(), mcCollision.centFT0M(), 0, // mcCollision.centFV0A() to be added diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index 8e10eeefa21..f944b37749a 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -79,8 +79,6 @@ 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; @@ -368,11 +366,11 @@ struct HStrangeCorrelationFilter { template bool isCollisionSelectedPbPb(TCollision collision) { - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && eventSelections.requireGoodTriggerTVX) /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */ + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */ return false; - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll) && eventSelections.requireAllGoodITSLayers) // cut time intervals with dead ITS staves + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) // cut time intervals with dead ITS staves return false; - 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 + 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 return false; auto occupancy = collision.trackOccupancyInTimeRange(); if (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh) /* Below min occupancy and Above max occupancy*/ diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 0450200a07b..cc6dcf403cf 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -20,8 +20,6 @@ // 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" @@ -45,8 +43,10 @@ #include "Math/Vector3D.h" #include +#include #include #include +#include #include #include @@ -54,7 +54,6 @@ #include #include #include -#include #include using namespace o2; @@ -67,10 +66,8 @@ 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; @@ -78,6 +75,7 @@ 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 @@ -88,14 +86,15 @@ struct sigma0builder { //__________________________________________________ // Sigma0 specific - 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 + 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 //__________________________________________________ // Pi0 specific @@ -162,13 +161,8 @@ 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"}; @@ -184,7 +178,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)"}; @@ -213,7 +207,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)"}; @@ -238,27 +232,11 @@ 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)"}; @@ -337,22 +315,16 @@ struct sigma0builder { ConfigurableAxis axisIRBinning{"axisIRBinning", {151, -10, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisLifetime{"axisLifetime", {200, 0, 50}, "Lifetime"}; - // 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"}; + // For manual sliceBy (necessary to calculate the correction factors) + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); if (doprocessRealData + doprocessRealDataWithTOF + - doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithTOF + - doprocessMonteCarloWithEMCal + doprocessV0QA + doprocessV0MCQA > 1) { @@ -401,11 +373,9 @@ struct sigma0builder { } } - bool fUsePCMPhoton = !doprocessRealDataWithEMCal && !doprocessMonteCarloWithEMCal && !doprocessPCMVsEMCalQA; - for (const auto& histodir : DirList) { if ((histodir == "V0BeforeSel" && !fFillNoSelV0Histos) || - (histodir == "PhotonSel" && !fFillSelPhotonHistos && !fUsePCMPhoton) || + (histodir == "PhotonSel" && !fFillSelPhotonHistos) || (histodir == "LambdaSel" && !fFillSelLambdaHistos) || (histodir == "KShortSel" && !fFillSelKShortHistos)) { continue; @@ -454,55 +424,20 @@ struct sigma0builder { histos.add(histodir + "/h3dV0XYZ", "h3dV0XYZ", kTH3D, {axisXY, axisXY, axisZ}); } - 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"); - - 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) { - 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("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("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("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("LambdaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); @@ -536,14 +471,13 @@ struct sigma0builder { histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "ITSNCls"); histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(14, "Lifetime"); - if (doprocessRealData || doprocessRealDataWithTOF || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { + if (doprocessRealData || doprocessRealDataWithTOF || doprocessMonteCarlo || doprocessMonteCarloWithTOF) { 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}); @@ -567,7 +501,7 @@ struct sigma0builder { } // MC - if (doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { + if (doprocessMonteCarlo || doprocessMonteCarloWithTOF) { 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}}); @@ -595,30 +529,6 @@ 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 @@ -795,10 +705,6 @@ 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; @@ -814,7 +720,6 @@ struct sigma0builder { float V02MCpy = -999.f; float V02MCpz = -999.f; float V0PairMCRadius = -999.f; - float EMCalClusterAmplitude = -999.f; }; // ______________________________________________________ @@ -874,8 +779,7 @@ struct sigma0builder { info.DCADau = (cross.Mag2() > 0) ? std::abs(posdiff.Dot(cross)) / cross.R() : 999.f; info.CosPA = v01momentumNorm.Dot(v02momentumNorm); - float Min_threshold = 1e-5f; // Threshold to consider lines as parallel, can be tuned - if (d < Min_threshold) { // Parallel or nearly parallel lines + if (d < 1e-5f) { // Parallel or nearly parallel lines info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? return info; } @@ -927,10 +831,6 @@ 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(); @@ -1033,166 +933,6 @@ 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.rawIteratorAt(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.rawIteratorAt(daughterId); - - // Require true photon, please - if (mcPhoton.pdgCode() != PDG_t::kGamma) - continue; - - // Get Sigma0 index from photon mother - auto const& photonMothers = mcPhoton.template mothers_as(); - if (photonMothers.empty()) // No mothers? Weird - continue; - - // 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 (photonMotherIndex == lambdaMotherIndex) { - matchedPhotonId = daughterId; - matchedMotherIndex = photonMotherIndex; - 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.rawIteratorAt(matchedPhotonId); - auto mcSigma = mcparticles.rawIteratorAt(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.rawIteratorAt(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! @@ -1339,21 +1079,12 @@ 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 (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + for (auto const& collision : groupedCollisions) { // 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; @@ -1377,14 +1108,6 @@ 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) { @@ -1402,15 +1125,14 @@ 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 (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { - auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); - + for (auto const& collision : groupedCollisions) { if (eventSelections.fUseEventSelection) { if (!IsEventAccepted(collision, false)) continue; @@ -1536,7 +1258,7 @@ struct sigma0builder { auto v0MC = v0.template v0MCCore_as>(); - float V0MCpT = RecoDecay::pt(std::array{v0MC.pxMC(), v0MC.pyMC()}); + float V0MCpT = RecoDecay::pt(array{v0MC.pxMC(), v0MC.pyMC()}); float V0PA = TMath::ACos(v0.v0cosPA()); bool fIsV0CorrectlyAssigned = (v0MC.straMCCollisionId() == v0MCCollision.globalIndex()); bool isPrimary = v0MC.isPhysicalPrimary(); @@ -1600,7 +1322,7 @@ struct sigma0builder { histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); // Checking decay modes and getting daughter pTs - for (auto const& daughter : daughters) { + for (auto& daughter : daughters) { histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); if (GenInfo.NDaughters == 2) { @@ -1615,13 +1337,13 @@ struct sigma0builder { if ((GenInfo.IsKStar) && genSelections.doQA) { histos.fill(HIST("GenQA/h2dKStarMCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto const& daughter : daughters) // checking decay modes + for (auto& 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 const& daughter : daughters) // checking decay modes + for (auto& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } } @@ -1731,7 +1453,7 @@ struct sigma0builder { template void genProcess(TMCParticles const& mcParticles) { - for (auto const& mcParticle : mcParticles) { + for (auto& mcParticle : mcParticles) { // Rapidity selection if ((mcParticle.y() < genSelections.mc_rapidityMin) || (mcParticle.y() > genSelections.mc_rapidityMax)) continue; @@ -1779,28 +1501,9 @@ 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 = 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()); - 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 fillV0Histos(TV0Object const& v0, TCollision const& collision) + void fillHistos(TV0Object const& v0, TCollision const& collision) { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"V0BeforeSel", "PhotonSel", "LambdaSel", "KShortSel"}; @@ -1864,56 +1567,7 @@ struct sigma0builder { } //_______________________________________________ - // 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 + // Process photon candidate template bool processPhotonCandidate(TV0Object const& gamma) { @@ -2264,20 +1918,14 @@ struct sigma0builder { } //_______________________________________________ - // Build sigma0 candidate with PCM photons + // Build sigma0 candidate template - bool buildPCMSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) + bool buildSigma0(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.posTrackExtraId() == lambda.negTrackExtraId() || - gamma.negTrackExtraId() == lambda.posTrackExtraId()) { + gamma.negTrackExtraId() == lambda.negTrackExtraId()) { return false; } @@ -2311,23 +1959,26 @@ struct sigma0builder { // Sigma0 topological info auto sigma0TopoInfo = propagateV0PairToDCA(gamma, lambda); - sigma0cores(gamma.globalIndex(), lambda.globalIndex(), sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, + sigma0cores(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.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, + 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, sigma0MCInfo.V02MCpx, sigma0MCInfo.V02MCpy, sigma0MCInfo.V02MCpz, - sigma0MCInfo.V02PDGCodePos, sigma0MCInfo.V02PDGCodeNeg, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); + sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); + + sigma0mclabel(sigma0MCInfo.V0PairMCParticleID); } // Sigma0s -> stracollisions link histos.fill(HIST("SigmaSel/hSigma0DauDeltaIndex"), gamma.globalIndex() - lambda.globalIndex()); sigma0CollRefs(collision.globalIndex()); + sigmaIndices(gamma.globalIndex(), lambda.globalIndex()); //_______________________________________________ // Photon extra properties @@ -2392,111 +2043,6 @@ 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 = std::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.eta()); - - //_______________________________________________ - // 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 @@ -2619,40 +2165,25 @@ struct sigma0builder { } // Process photon and lambda candidates to build sigma0 candidates - template - void dataProcess(TCollision const& collisions, TV0s const& fullV0s, TEMCal const& fullEMCalClusters, TEMCalTracks const& emcaltracks, TMCParticles const& mcparticles) + template + void dataProcess(TCollision const& collisions, TV0s const& fullV0s, 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) { @@ -2662,14 +2193,11 @@ 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(); @@ -2681,55 +2209,40 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms + fillHistos<0>(v0, coll); // Filling "all V0s" histograms - 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 (processPhotonCandidate(v0)) { // selecting photons + if (fFillSelPhotonHistos) + fillHistos<1>(v0, coll); // QA histos + bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates } if (processLambdaCandidate(v0, coll)) { // selecting lambdas if (fFillSelLambdaHistos) - fillV0Histos<2>(v0, coll); // QA histos + fillHistos<2>(v0, coll); // QA histos bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates } if (processKShortCandidate(v0, coll)) { // selecting kshorts if (fFillSelKShortHistos) - fillV0Histos<3>(v0, coll); // QA histos + fillHistos<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) { - if constexpr (!soa::is_table) - analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis + analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis analyzeV0CollAssoc(coll, fullV0s, bestLambdasArray, false); // Lambda-analysis } } //_______________________________________________ - // Photon-V0 nested loop + // V0 nested loop for (size_t i = 0; i < bestGammasArray.size(); ++i) { + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); //_______________________________________________ // Sigma0 loop @@ -2738,45 +2251,32 @@ struct sigma0builder { auto lambda = fullV0s.rawIteratorAt(bestLambdasArray[j]); // Building sigma0 candidate & filling tables - 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; - } + if (!buildSigma0(lambda, gamma1, coll, mcparticles)) + continue; } } //_______________________________________________ // KStar loop - 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; - } + 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; } } //_______________________________________________ // pi0 loop - 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; - } + 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; } } } @@ -2817,7 +2317,7 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms + fillHistos<0>(v0, coll); // Filling "all V0s" histograms // Selection process fPassPhotonSel = processPhotonCandidate(v0); @@ -2827,7 +2327,7 @@ struct sigma0builder { // Reco part: if (fPassPhotonSel) { if (fFillSelPhotonHistos) - fillV0Histos<1>(v0, coll); + fillHistos<1>(v0, coll); // Fill analysis Histos: float PhotonY = RecoDecay::y(std::array{v0.px(), v0.py(), v0.pz()}, o2::constants::physics::MassGamma); @@ -2837,7 +2337,7 @@ struct sigma0builder { } if (fPassLambdaSel) { if (fFillSelLambdaHistos) - fillV0Histos<2>(v0, coll); + fillHistos<2>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dLambdaMass"), centrality, v0.pt(), v0.mLambda()); @@ -2852,7 +2352,7 @@ struct sigma0builder { if (fPassKShortSel) { if (fFillSelKShortHistos) - fillV0Histos<3>(v0, coll); + fillHistos<3>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dKShortMass"), centrality, v0.pt(), v0.mK0Short()); @@ -2903,250 +2403,25 @@ 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, nullptr, nullptr); + dataProcess(collisions, fullV0s, nullptr); } void processRealDataWithTOF(soa::Join const& collisions, V0TOFStandardDerivedDatas const& fullV0s, dauTracks const&) { - 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); + dataProcess(collisions, fullV0s, 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, nullptr, nullptr, mcParticles); + dataProcess(collisions, fullV0s, 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, 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); + dataProcess(collisions, fullV0s, mcParticles); } void processGeneratedRun3(aod::McParticles const& mcParticles) @@ -3170,22 +2445,14 @@ 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, uses TOF PID info", false); - PROCESS_SWITCH(sigma0builder, processRealDataWithEMCal, "process as if real data, uses EMCal clusters", false); + PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data", 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/TableProducer/Strangeness/stracents.cxx b/PWGLF/TableProducer/Strangeness/stracents.cxx index 96ca0a745c8..ce5597563da 100644 --- a/PWGLF/TableProducer/Strangeness/stracents.cxx +++ b/PWGLF/TableProducer/Strangeness/stracents.cxx @@ -131,7 +131,6 @@ 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"); @@ -244,7 +243,6 @@ struct straCents { ft0aInfo.mCalibrationStored = false; ft0cInfo.mCalibrationStored = false; ft0cVariant1Info.mCalibrationStored = false; - ft0cVariant2Info.mCalibrationStored = false; fddmInfo.mCalibrationStored = false; ntpvInfo.mCalibrationStored = false; nGlobalInfo.mCalibrationStored = false; @@ -373,7 +371,6 @@ 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); @@ -536,14 +533,12 @@ 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, centFT0CVariant2, - centMFT, centNGlobal, centNTPV); + centFT0C, centFV0A, centFT0CVariant1, + centMFT, centNGlobal); 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 7be69eeca47..a68b06b4b79 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -78,21 +78,20 @@ 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 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 + 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 //__________________________________________________ // track extra references @@ -208,8 +207,6 @@ 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 @@ -407,8 +404,6 @@ 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); @@ -463,14 +458,6 @@ 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 @@ -487,14 +474,6 @@ 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()); @@ -503,14 +482,6 @@ 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()); - } } } } @@ -531,32 +502,9 @@ 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.centFT0CVariant2(), - collision.centMFT(), collision.centNGlobal(), collision.centNTPV()); + centrality, collision.centFV0A(), collision.centFT0CVariant1(), + collision.centMFT(), collision.centNGlobal()); products.strangeEvSels(collision.sel8(), collision.selection_raw(), collision.multFT0A() * static_cast(fillTruncationOptions.fillRawFT0A), collision.multFT0C() * static_cast(fillTruncationOptions.fillRawFT0C), @@ -586,10 +534,6 @@ 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()); @@ -707,23 +651,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, aod::BCsWithTimestamps const& bcs) { 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, aod::BCsWithTimestamps const& bcs, 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, aod::BCsWithTimestamps const& bcs, 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, aod::BCsWithTimestamps const& bcs, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); diff --git a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt index cde1964f9e2..b80c7711571 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(pseudorapidity-density-mft - SOURCES PseudorapidityDensityMFT.cxx +o2physics_add_dpl_workflow(dndeta-mft-pp + SOURCES dndeta-mft-pp.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) @@ -38,8 +38,3 @@ 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/PseudorapidityDensityMFT.cxx b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx deleted file mode 100644 index fc7bc57cf19..00000000000 --- a/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx +++ /dev/null @@ -1,3004 +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 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}; -// 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}}; - -// 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 MFTTracksLabeled3d = - 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 - }; - enum class NeitherReasonBin : int { - NotTrueByLabel = 1, - BestColInvalid, - BestColMissingInRecoToMc, - ClassifiedRight, - ClassifiedWrong - }; - - 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 (doprocessGenReco3d || doprocessGenReco2d || 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/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}}}}); - 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}}}}); - registry.add({"Purity/TrueColNotFound", - ";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; - std::unordered_set acceptedRecoCols; - std::unordered_set recoCollisionIds; - std::unordered_set trueMCCollisionIds; - - 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; - }; - - 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; - }; - - for (const auto& collision : collisions) { - int nSavedRows = 0; - std::unordered_set uniqueRecoColsSaved; - - registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); - - if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { - continue; - } - fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); - - if (!collision.has_mcCollision()) { - LOGP(warning, "Reco collision {} has no MC collision label, skipping", collision.globalIndex()); - continue; - } - fillGenRecoCut(GenRecoCutBin::HasMcCollision); - - 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); - - 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()); - } - - 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; - } - - if (!passGenRecoTrackMode(track)) { - continue; - } - - const int recoCol = track.collisionId(); - if (acceptedRecoCols.find(recoCol) == acceptedRecoCols.end()) { - 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(); - - int bin = static_cast(RightWrongBin::Neither); - bool recoOfTrueExists = false; - - /// const int bestColID = track.bestCollisionId(); - const int mcOfTrack = isTrueByLabel ? track.mcParticle().mcCollisionId() : InvalidCollisionId; - - if (isTrueByLabel) { - auto itRecoList = mcToReco.find(mcOfTrack); - if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { - recoOfTrueExists = true; - } - - 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("RightWrong"), bin); - - if (bin == static_cast(RightWrongBin::Wrong)) { - registry.fill(HIST("Purity/WrongVertexRecoExists"), - recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) - : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); - } - - 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 = 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); - }; - - 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); - } - } - } - 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 - - template - void processGenReco(McCollisionsWithExtra::iterator const& mcCollision, - o2::soa::SmallGroups> const& collisions, - FullBCs const& bcs, - 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); - - std::unordered_map recoToMc; - 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()); - - bool magInited = false; - for (auto const& bc : bcs) { - initMagField(bc); - magInited = true; - 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; - }; - - 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; - }; - - for (const auto& collision : collisions) { - int nSavedRows = 0; - std::unordered_set uniqueRecoColsSaved; - - registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); - - if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { - continue; - } - fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); - - if (!collision.has_mcCollision()) { - LOGP(warning, "Reco collision {} has no MC collision label, skipping", collision.globalIndex()); - continue; - } - fillGenRecoCut(GenRecoCutBin::HasMcCollision); - - 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); - - 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()); - registry.fill(HIST("Purity/VtxXYZTruth"), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); - registry.fill(HIST("Purity/VtxXYZReco"), collision.posX(), collision.posY(), collision.posZ()); - registry.fill(HIST("Purity/DeltaVtxXYZ"), - collision.posX() - mcCollision.posX(), - collision.posY() - mcCollision.posY(), - collision.posZ() - mcCollision.posZ()); - } - - int64_t woOrpCount = 0; - bool filledRight = false; - bool filledWrong = false; - int nMftSelectedAfterCuts = 0; - std::unordered_set uniqueBestRecoCols; - - 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); - } - - o2::math_utils::bringTo02Pi(phi); - const float etaReco = track.eta(); - const float dcaXYReco = dcaXyCut; - const float dcaZReco = hasBestDCAZ ? dcaZCut : 0.f; - 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) || - failDCAzCut || - (usePtCut && ptCut > cfgnPt); - - 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; - } - - registry.fill(HIST("Purity/TrackEtaCategorySparse"), - etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); - }; - - 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); - } - } - } - - 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; - } - } - } - - if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { - recoOfTrueExists = true; - } - - 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"), - 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/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.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); - } - - 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 = 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(); - - 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); - 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) { - registry.fill(HIST("Purity/reco/woOrp_fake/woOrpTracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_fake/woOrpTracksPtZvtx"), track.pt(), z); - registry.fill(HIST("Purity/reco/woOrp_fake/woOrpTracksPhiEta"), phi, track.eta()); - 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) { - registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpTracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpTracksPtZvtx"), track.pt(), z); - registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpTracksPhiEta"), phi, track.eta()); - 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()); - 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()); - 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; - - 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.}; - std::array dcaRight{999., 999.}; - std::array dcaChosenXYZ{999., 999., 999.}; - - const double bZ = o2::base::Propagator::Instance()->getNominalBz(); - - 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; - dcaInfOrig = {999., 999., 999.}; - 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}; - 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]); - if (bin == static_cast(RightWrongBin::Wrong)) { - registry.fill(HIST("Purity/THnDCAChosenVsRight_Wrong"), - etaReco, dcaXyCut, dcaChosen[0], dcaRight[0], dcaZCut, dcaChosen[1], dcaRight[1]); - } - if (bin == static_cast(RightWrongBin::Right)) { - registry.fill(HIST("Purity/THnDCAChosenVsRight_Right"), - etaReco, dcaXyCut, dcaChosen[0], dcaRight[0], dcaZCut, dcaChosen[1], dcaRight[1]); - ++nMftSelectedAfterCuts; - } - - if (bin == static_cast(RightWrongBin::Right)) { - 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)) { - 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); - } - } - - 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) { - const float deltaXvtx = xReco - xTrue; - const float deltaYvtx = yReco - yTrue; - const float deltaZvtx = zReco - zTrue; - - 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); - } - } - } - - 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)) { - 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 { - 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); - } - } - - 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()); - 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; - - 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)); - } - } - } - - 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); - } - - 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) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} diff --git a/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx b/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx new file mode 100644 index 00000000000..93b8625ba65 --- /dev/null +++ b/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx @@ -0,0 +1,1223 @@ +// 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)}; +} diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index f86828f6cea..e7ddece6c1f 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -50,12 +50,10 @@ #include "TEfficiency.h" #include "THashList.h" +#include "TPDGCode.h" #include #include #include -#include -#include -#include #include #include @@ -87,10 +85,6 @@ 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; @@ -100,6 +94,7 @@ 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/"}; @@ -111,30 +106,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 = "/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 = "/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 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"; +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 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"; +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"; enum PidType { kEl = 0, @@ -208,29 +203,27 @@ struct MultE { std::array rhoLatticeFV0{0}; std::array fv0AmplitudeWoCalib{0}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; + +std::array, NpartChrg> hPtEffRecPrim{}; +std::array, NpartChrg> hPtEffRecWeak{}; +std::array, NpartChrg> hPtEffRecMat{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -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{}; +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{}; struct FlattenictyPikp { - HistogramRegistry registryData{"registryData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry registryMC{"registryMC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry registryQC{"registryQC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - + HistogramRegistry flatchrg{"flatchrg", {}, OutputObjHandlingPolicy::AnalysisObject, true, false}; OutputObj listEfficiency{"Efficiency"}; Service pdg; @@ -246,7 +239,6 @@ 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"}; @@ -277,19 +269,22 @@ 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 { - 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"}; + 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 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 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"}; @@ -335,6 +330,8 @@ 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"}; @@ -414,12 +411,10 @@ struct FlattenictyPikp { TrackSelection selTrkGlobal; Configurable isCustomTracks{"isCustomTracks", true, "Use custom track cuts"}; - Configurable minPt{"minPt", 0.1f, "Set minimum pT of tracks"}; - Configurable maxPt{"maxPt", 1e10f, "Set maximum pT of tracks"}; + Configurable minPt{"minPt", 0.15f, "Set minimum pT of tracks"}; + Configurable maxPt{"maxPt", 20.0f, "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"}; @@ -515,9 +510,7 @@ struct FlattenictyPikp { selTrkGlobal.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); selTrkGlobal.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); selTrkGlobal.SetMinNClustersITS(minITSnClusters.value); - if (requireITSminCl.value) { - selTrkGlobal.SetRequireHitsInITSLayers(setITSminCl.value, {0, 1, 2, 3, 4, 5, 6}); - } + 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); }); @@ -530,7 +523,6 @@ 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"}; @@ -563,255 +555,232 @@ 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) { - // 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) { - 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}}); - } + 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) { - 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}); + 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 - 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}}); + 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.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}}); + flatchrg.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); // its - 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}}); + 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}}); // tof - 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}}); + 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}}); + } } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { - 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}}); + 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}}); } else { - 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/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/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/"); + 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/"); if (cfgFillChrgType) { - 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/"); + 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/"); } } if (cfgFillDCAxyHist) { for (int i = 0; i < Npart; i++) { - 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.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.addClone("Tracks/postSel/", "Tracks/preSel/"); + 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}}); // V0's QA - registryData.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); - registryData.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + flatchrg.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); + flatchrg.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); // daughters' QA - 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/"); + 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/"); // dEdx PID - registryData.add({"Tracks/all/hdEdx", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + flatchrg.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) { - 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}}}); + 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}}}); } else { - 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/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/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}}}); + 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}}}); if (cfgFillChrgType) { - 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/"); + 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/"); } } if (cfgFillChrgType) { - registryData.addClone("Tracks/all/", "Tracks/pos/"); - registryData.addClone("Tracks/all/", "Tracks/neg/"); + flatchrg.addClone("Tracks/all/", "Tracks/pos/"); + flatchrg.addClone("Tracks/all/", "Tracks/neg/"); } - LOG(info) << "Size of the Data histograms:"; - registryData.print(); } if (doprocessMC) { - 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}}); + auto h = flatchrg.add("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"); - 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) { - 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}}); - } - registryMC.addClone("Tracks/postSel/", "Tracks/preSel/"); + + 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}); + + 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] = 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}); + 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}); } for (int i = 0; i < Npart; i++) { - 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({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({"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) { @@ -822,10 +791,44 @@ struct FlattenictyPikp { initEfficiency(); initEfficiency(); }); + } - LOG(info) << "Size of the MC histograms:"; - registryMC.print(); + 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}}}); + } } + + 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("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}}}); + } + } + + LOG(info) << "Size of the histograms:"; + flatchrg.print(); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -936,9 +939,9 @@ struct FlattenictyPikp { const float trkLength = track.length(); const float tExpPiTOF = track.tofExpSignalPi(tTOF); if (track.p() >= trkSelOpt.cfgMomSelPiTOF && trkLength > Cnull && tTOF > Cnull) { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); if (std::abs((tExpPiTOF / tTOF) - Cone) < trkSelOpt.cfgTofBetaPiMax) { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hBetaVsP"), track.p(), track.beta()); + flatchrg.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; // } @@ -974,16 +977,14 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - 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()))) { + 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))) { - registryData.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); } } } @@ -1002,7 +1003,7 @@ struct FlattenictyPikp { const float mult = getMult(collision); const float flat = fillFlat(collision); - registryData.fill(HIST("Events/hFlatVsMultEst"), flat, mult); + flatchrg.fill(HIST("Events/hFlatVsMultEst"), flat, mult); for (const auto& track : tracks) { float dEdx = track.tpcSignal(); @@ -1062,12 +1063,12 @@ struct FlattenictyPikp { // PID TPC dEdx if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { - registryData.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } else { - registryData.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } } else { - registryData.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } // TOF pions @@ -1076,22 +1077,22 @@ struct FlattenictyPikp { if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { if (cfgStoreThnSparse) { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } else { if (cfgStoreThnSparse) { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } else { if (cfgStoreThnSparse) { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } @@ -1169,19 +1170,19 @@ struct FlattenictyPikp { } if (cfgStoreThnSparse) { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } else { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } } @@ -1190,19 +1191,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } else { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } } @@ -1211,19 +1212,19 @@ struct FlattenictyPikp { fillV0QA(v0, posTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } else { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } } @@ -1232,19 +1233,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } else { if (cfgFillChrgType) { - 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); + 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); } else { - 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); + 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); } } } @@ -1290,136 +1291,103 @@ struct FlattenictyPikp { return std::abs(charge) >= CminCharge; } - 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; - } - - 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) + template + bool phiCut(T const& track, float mag, TF1* fphiCutLow, TF1* fphiCutHigh) { + 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 (charge < Cnull) // for negative charge + if (track.sign() < 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); - } - template - inline void fillNclVsPhiCutQaHist(T const& track, const float phimodn) - { - if (cfgFillNclVsPhiCutQaHist) { - 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()); + 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()); + } + } } + return true; } template - bool isGoodTrack(T const& track, const int magfield) + bool isGoodTrack(T const& track, int const magfield) { - registryData.fill(HIST("Tracks/hTrkSel"), trkSelAll); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelEta); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelEta); if (track.pt() < trkSelOpt.cfgTrkPtMin) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelPt); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelPt); if (!isDCAxyCut(track)) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelDCA); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelDCA); if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { return false; } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); - - 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()))) { + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); + if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { return false; } - if (cfgFillNclVsPhiCutQaHist) { - fillNclVsPhiCutQaHist(track, phimodn); - } - registryData.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); + flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } template void fillV0QA(V const& v0, U const& track) { - 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()); + 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()); } template @@ -1517,52 +1485,47 @@ struct FlattenictyPikp { } template - bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, const int magfield) + bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, int const magfield) { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); if (posTrack.sign() * negTrack.sign() > Cnull) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); - - float posTrackPhiModn = posTrack.phi(); - float negTrackPhiModn = negTrack.phi(); - phiMod(posTrackPhiModn, magfield, posTrack.sign()); - phiMod(negTrackPhiModn, magfield, negTrack.sign()); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); if (v0SelOpt.cfgRejectV0sAtTPCSector) { - 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()))) { + if (!(phiCut(posTrack, magfield, fPhiCutLow, fPhiCutHigh) && phiCut(negTrack, magfield, fPhiCutLow, fPhiCutHigh))) { return false; } } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); // V0 topological selections if (v0.v0cosPA() < v0SelOpt.cfgv0cospa) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); if (v0.v0radius() < v0SelOpt.cfgv0Rmin || v0.v0radius() > v0SelOpt.cfgv0Rmax) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); if (std::abs(v0.dcapostopv()) < v0SelOpt.cfgDCAposToPV || std::abs(v0.dcanegtopv()) < v0SelOpt.cfgDCAnegToPV) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); // selection of V0 daughters if (!(isGoodV0DaughterTrack(posTrack) && isGoodV0DaughterTrack(negTrack))) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); if (v0.dcaV0daughters() > v0SelOpt.cfgDCAv0daughter) { return false; } - registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); + flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); if constexpr (fillHist) { - registryData.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); - registryData.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); + flatchrg.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); + flatchrg.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); } return true; } @@ -1573,6 +1536,9 @@ 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; } @@ -1611,38 +1577,38 @@ struct FlattenictyPikp { inline void fillTrackQA(T const& track) { if constexpr (fillHist) { - 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()); + 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()); if (track.hasTPC() && track.hasITS()) { - 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()); + 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()); if (track.beta() > trkSelOpt.cfgTOFBetaPion && track.beta() < trkSelOpt.cfgTOFBetaPion + 0.05) { // TOF pions - registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); } if (std::abs(track.eta()) < trkSelOpt.cfgTrkEtaMax) { if (isDCAxyWoCut(track)) { - registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); } } } - registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); } template @@ -1654,24 +1620,24 @@ struct FlattenictyPikp { if (track.p() >= trkSelOpt.cfgMomMIPMin && track.p() <= trkSelOpt.cfgMomMIPMax) { if (dEdx > trkSelOpt.cfgDeDxMIPMin && dEdx < trkSelOpt.cfgDeDxMIPMax) { // MIP pions if (cfgStoreThnSparse) { - registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); + flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); } else { - 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("hMIP"), track.eta(), 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); + 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); } if (dEdx > trkSelOpt.cfgDeDxMIPMax + 10. && dEdx < trkSelOpt.cfgDeDxMIPMax + 30.) { // Plateau electrons if (std::abs(track.beta() - 1) < trkSelOpt.cfgBetaPlateuMax) { if (cfgStoreThnSparse) { - registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); + flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); } else { - 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("hPlateau"), track.eta(), 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); + 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); } } } @@ -1682,7 +1648,7 @@ struct FlattenictyPikp { bool isGoodEvent(C const& collision) { if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelAll); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelAll); } if (evtSelOpt.cfgCustomTVX) { if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) { @@ -1694,62 +1660,62 @@ struct FlattenictyPikp { } } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelSel8); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelSel8); } if (evtSelOpt.cfgRemoveITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); } if (evtSelOpt.cfgRemoveNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); } if (evtSelOpt.cfgRemoveNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); } if (evtSelOpt.cfgRequireIsGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); } if (evtSelOpt.cfgRequireIsVertexITSTPC && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); } if (evtSelOpt.cfgRequirekIsVertexTOFmatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); } if (std::abs(collision.posZ()) > evtSelOpt.cfgCutVtxZ) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelVtxZ); - registryQC.fill(HIST("Events/hVtxZ"), collision.posZ()); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelVtxZ); + flatchrg.fill(HIST("Events/hVtxZ"), collision.posZ()); } - if (!collision.isInelGt0()) { + if (evtSelOpt.cfgINELCut && !collision.isInelGt0()) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelINELgt0); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelINELgt0); } if (rctCuts.requireRCTFlagChecker && !rctChecker(collision)) { return false; } if constexpr (fillHist) { - registryQC.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); + flatchrg.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); } return true; } @@ -1859,11 +1825,7 @@ struct FlattenictyPikp { return val; break; case MultE::CmultFT0M: - if constexpr (!isMC) { - return collision.centFT0M(); - } else { - return collision.multMCFT0C() + collision.multMCFT0A(); - } + return collision.centFT0M(); break; case MultE::CmultTPC: if constexpr (!isMC) { @@ -1935,10 +1897,10 @@ struct FlattenictyPikp { int chv0 = fv0.channel()[ich]; int chv0phi = getFV0IndexPhi(chv0); if constexpr (fillHist) { - registryQC.fill(HIST("FV0/hFV0amp"), chv0, amplCh); - registryQC.fill(HIST("FV0/pFV0amp"), chv0, amplCh); + flatchrg.fill(HIST("FV0/hFV0amp"), chv0, amplCh); + flatchrg.fill(HIST("FV0/pFV0amp"), chv0, amplCh); if (applyCalibGain) { - registryQC.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); + flatchrg.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); } } if (amplCh > Cnull) { @@ -1948,7 +1910,7 @@ struct FlattenictyPikp { if (chv0phi > Cnull) { fv0AmplitudeWoCalib[chv0phi] = amplCh; if constexpr (fillHist) { - registryQC.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); + flatchrg.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); } if (chv0 < CinnerFV0) { rhoLatticeFV0[chv0phi] += amplCh; @@ -1956,12 +1918,12 @@ struct FlattenictyPikp { rhoLatticeFV0[chv0phi] += amplCh / 2.; } if constexpr (fillHist) { - registryQC.fill(HIST("FV0/hFV0AmplvsVtxzWoCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + flatchrg.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) { - registryQC.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + flatchrg.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); } } } @@ -2058,8 +2020,8 @@ struct FlattenictyPikp { float maxPhi = 0; float dPhi = 0; - float etaMinFV0bins[CmaxRingsFV0] = {0.0}; - float etaMaxFV0bins[CmaxRingsFV0] = {0.0}; + double etaMinFV0bins[CmaxRingsFV0] = {0.0}; + double etaMaxFV0bins[CmaxRingsFV0] = {0.0}; for (int i = 0; i < CmaxRingsFV0; ++i) { etaMaxFV0bins[i] = CmaxEtaFV0 - i * CdEtaFV0; if (i < CmaxRingsFV0 - 1) { @@ -2071,18 +2033,11 @@ struct FlattenictyPikp { rhoLatticeFV0.fill(0); std::vector vNch; - float nChFV0{0}; + float nCharged{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(); @@ -2102,22 +2057,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(nChFV0); - auto flatFV0 = 1. - calcFlatenicity(rhoLatticeFV0); + vNch.push_back(nCharged); + auto flatFV0 = calcFlatenicity(rhoLatticeFV0); if constexpr (fillHist) { - registryMC.fill(HIST("Events/ResponseGen"), vNch[0], flatFV0); - registryMC.fill(HIST("Events/h1flatencityFV0MCGen"), flatFV0); + flatchrg.fill(HIST("ResponseGen"), vNch[0], 1. - flatFV0); + flatchrg.fill(HIST("h1flatencityFV0MCGen"), 1. - flatFV0); } vNch.clear(); - return flatFV0; + return 1. - flatFV0; } template @@ -2127,8 +2082,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] = 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}); + 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}); } template @@ -2183,49 +2138,56 @@ struct FlattenictyPikp { { static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; - // LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; + 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(); - if (!isChrgParticle(mcParticle.pdgCode())) { + if (!isPID(mcParticle)) { return; } - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + flatchrg.fill(HIST("hPtOutNoEtaCut"), track.pt()); + if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { return; } - if (!isPID(mcParticle)) { + if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { return; } if ((collision.has_mcCollision() && (mcParticle.mcCollisionId() != collision.mcCollisionId())) || !collision.has_mcCollision()) { if (!mcParticle.isPhysicalPrimary()) { if (mcParticle.getProcess() == CprocessIdWeak) { - hDCAxyRecBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); } else { - hDCAxyRecBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } else { - hDCAxyRecBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } if (collision.has_mcCollision() && (mcParticle.mcCollisionId() == collision.mcCollisionId())) { - 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()); + 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 { - hPtEffRecGoodCollPrim[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyRecGoodCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } - if (isDCAxyCut(track)) { - hPtEffRec[ChistIdx]->Fill(mcParticle.pt()); - } } template @@ -2239,9 +2201,9 @@ struct FlattenictyPikp { } if constexpr (recoEvt) { - hPtGenRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); + hPtGenRecEvt[ChistIdx]->Fill(mcParticle.pt()); if (mcParticle.isPhysicalPrimary()) { - hPtGenPrimRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); + hPtGenPrimRecEvt[ChistIdx]->Fill(mcParticle.pt()); } return; } @@ -2258,6 +2220,179 @@ struct FlattenictyPikp { } } + void processSgnLoss(MCColls::iterator const& mcCollision, + CollsGenSgn const& collisions, + aod::FV0As const& /*fv0s*/, + aod::McParticles const& particles) + { + float flat; + float mult; + 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 + 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("hFlatGenINELgt0"), flat); + } + + // Sgn loss den + 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(CpTgenPrimSgn), mult, flat, particle.pt()); + if (isINELgt0mc) { + flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgnINEL), mult, flat, particle.pt()); + } + } + }); + } + + int nRecCollINEL = 0; + int nRecCollINELgt0 = 0; + for (const auto& collision : collisions) { + // Evt split num + flatchrg.fill(HIST("hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + 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()) { + 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(CpTrecCollPrimSgn), mult, flat, particle.pt()); + if (nRecCollINELgt0) { + flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgnINEL), mult, flat, particle.pt()); + } + } + }); + } + } + + if (nRecCollINEL < 1) { + return; + } + // Evt loss num + flatchrg.fill(HIST("hEvtMcGenRecColl"), 0.5); + if (nRecCollINELgt0 > Cnull) { + flatchrg.fill(HIST("hEvtMcGenRecColl"), 1.5); + } + + // 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()); + } + } + }); + } + } + 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; @@ -2266,94 +2401,60 @@ struct FlattenictyPikp { CollsGen const& collisions, aod::BCsWithTimestamps const& /*bcs*/, MyLabeledPIDTracks const& tracks, - aod::FV0As const& /*fv0s*/, aod::McParticles const& mcparticles) { - registryMC.fill(HIST("Events/hEvtGenRec"), 1.f, mcCollisions.size()); - registryMC.fill(HIST("Events/hEvtGenRec"), 2.f, collisions.size()); + flatchrg.fill(HIST("hEvtGenRec"), 1.f, mcCollisions.size()); + flatchrg.fill(HIST("hEvtGenRec"), 2.f, collisions.size()); - // Generated collisions for (const auto& mcCollision : mcCollisions) { if (mcCollision.isInelGt0()) { - registryMC.fill(HIST("Events/hEvtGenRec"), 3.f); + flatchrg.fill(HIST("hEvtGenRec"), 3.f); } - registryMC.fill(HIST("Events/hEvtMcGenColls"), 1); + 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); - registryMC.fill(HIST("Events/hFlatMCGen"), flatMC); - - auto multMC = -1.; - if (evtSelOpt.useMultMCmidrap || multEst == 2) { // use generated Nch in ∣eta∣ < 0.8 - multMC = countPart(groupedParts); - } else { - multMC = getMultMC(mcCollision); // using McCentFT0Ms - } + const float multMC = getMultMC(mcCollision); - if (groupedColls.size() < ConeInt) { // if MC events have no rec collisions + if (groupedColls.size() < 1) { // 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 } - registryMC.fill(HIST("Events/hEvtMcGenColls"), 2); - // - // Rec collisions w/ largest number of PV contributors + + flatchrg.fill(HIST("hEvtMcGenColls"), 2); for (const auto& collision : groupedColls) { - if (trkSelOpt.cfgRejectTrkAtTPCSector || applyCalibGain || applyCalibVtx) { - auto bc = collision.bc_as(); - int currentRun = bc.runNumber(); - if (runNumber != currentRun) { - initCCDB(bc); - runNumber = currentRun; - } - } - const float multRecGt1 = getMult(collision); - const float flatRec = fillFlat(collision); - registryMC.fill(HIST("Events/hEvtMcGenColls"), 3); - if (bestCollIndex != collision.globalIndex()) { + flatchrg.fill(HIST("hEvtMcGenColls"), 3); + if (!isGoodEvent(collision)) { continue; } - registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0wRecEvt"), multRecGt1, flatRec); // Evt split num, w/ Nrec > 0 - if (!isGoodEvent(collision)) { + // Select collisions with the largest number of contributors + if (bestCollIndex != collision.globalIndex()) { 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 + flatchrg.fill(HIST("hEvtMcGenColls"), 4); const auto groupedTrks = tracks.sliceBy(perCollTrk, collision.globalIndex()); for (const auto& track : groupedTrks) { if (!track.has_collision()) { continue; } - if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { - continue; - } - if (track.pt() < trkSelOpt.cfgTrkPtMin) { - 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; @@ -2361,75 +2462,42 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - 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()))) { + if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { continue; } if (!isDCAxyWoCut(track)) { continue; } if (!track.has_mcParticle()) { - registryMC.fill(HIST("Tracks/hPtFakes"), multMC, flatMC, track.pt()); + flatchrg.fill(HIST("PtOutFakes"), track.pt()); + continue; + } + const auto& mcParticle = track.mcParticle(); + if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { 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; } - 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 (!isChrgParticle(particle.pdgCode())) { - continue; - } - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + 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; } - if (particle.pt() < trkSelOpt.cfgTrkPtMin) { + } + + for (const auto& particle : groupedParts) { + if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { continue; } static_for<0, 1>([&](auto pidSgn) { @@ -2437,41 +2505,17 @@ 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 - } - }); } - } - // 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 + } // reco collisions - for (const auto& mcParticle : groupedParts) { - if (!isChrgParticle(mcParticle.pdgCode())) { - continue; - } - if (std::abs(mcParticle.eta()) > trkSelOpt.cfgTrkEtaMax) { + if (evtSelOpt.cfgINELCut.value) { + if (!o2::pwglf::isINELgt0mc(groupedParts, pdg)) { continue; } - if (mcParticle.pt() < trkSelOpt.cfgTrkPtMin) { + } + + for (const auto& mcParticle : groupedParts) { + if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { continue; } static_for<0, 1>([&](auto pidSgn) { @@ -2479,23 +2523,15 @@ 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); diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index 6eadc606998..d6f8a6df09f 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -52,11 +52,13 @@ 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,7 +89,6 @@ enum { kBkg, kSpNotPrimary, kSpAll, - kFake, kSpeciesend }; @@ -127,7 +128,7 @@ static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = static constexpr TrackSelectionFlags::flagtype TrackSelectionDcaxyOnly = TrackSelectionFlags::kDCAxy; -AxisSpec axisEvent{15, 0.5, 15.5, "#Event", "EventAxis"}; +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 axisEtaExtended{100, -5, 5, "#eta", "EtaAxisExtended"}; @@ -189,15 +190,15 @@ 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 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"}; @@ -206,13 +207,9 @@ 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"}; - Configurable isApplyBestCollIndex{"isApplyBestCollIndex", true, ""}; - - 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&) { @@ -235,15 +232,14 @@ struct HeavyionMultiplicity { 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, "ApplyNoCollInTimeRangeStandard"); - x->SetBinLabel(8, "ApplyNoCollInRofStandard"); - x->SetBinLabel(9, "ApplyNoHighMultCollInPrevRof"); - x->SetBinLabel(10, "INEL > 0"); + 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"); if (doprocessData) { histos.add("hdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); @@ -255,7 +251,7 @@ struct HeavyionMultiplicity { histos.add("hdatadndetaMB", "hdatadndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi}, false); } - if (doprocessMonteCarlo || doprocessMCcheckFakeTracks) { + if (doprocessMonteCarlo || doprocessMCpTefficiency || doprocessMCcheckFakeTracks) { histos.add("CentPercentileMCRecHist", "CentPercentileMCRecHist", kTH1D, {axisCent}, false); histos.add("hmczvtxcent", "hmczvtxcent", kTH3D, {axisVtxZ, centAxis, axisOccupancy}, false); } @@ -270,6 +266,11 @@ 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")); @@ -299,6 +300,21 @@ 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); @@ -359,69 +375,60 @@ 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}); } - - 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 bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + + if (!col.sel8()) { return false; } histos.fill(HIST("EventHist"), 2); - if (isApplyTFcut && !col.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + + if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + return false; + } + + if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return false; } histos.fill(HIST("EventHist"), 3); - if (isApplyITSROcut && !col.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + + if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } histos.fill(HIST("EventHist"), 4); - if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + + if (isApplyExtraCorrCut && col.multNTracksPV() > npvTracksCut && col.multFT0C() < (10 * col.multNTracksPV() - ft0cCut)) { return false; } histos.fill(HIST("EventHist"), 5); - if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return false; - } - histos.fill(HIST("EventHist"), 6); + if (isApplyNoCollInTimeRangeStandard && !col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } - histos.fill(HIST("EventHist"), 7); + histos.fill(HIST("EventHist"), 6); + if (isApplyNoCollInRofStandard && !col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { return false; } - histos.fill(HIST("EventHist"), 8); + histos.fill(HIST("EventHist"), 7); + if (isApplyNoHighMultCollInPrevRof && !col.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { return false; } - histos.fill(HIST("EventHist"), 9); + histos.fill(HIST("EventHist"), 8); + if (isApplyInelgt0 && !col.isInelGt0()) { return false; } - histos.fill(HIST("EventHist"), 10); - if (isApplyVtxCut && std::abs(col.posZ()) >= vtxRange) { - return false; - } - histos.fill(HIST("EventHist"), 11); + histos.fill(HIST("EventHist"), 9); return true; } @@ -460,7 +467,7 @@ struct HeavyionMultiplicity { if (isApplyCentFT0C) { cent = col.multMCFT0C(); } else if (isApplyCentFT0M) { - cent = col.multMCFT0C() + col.multMCFT0A(); + cent = (col.multMCFT0C() + col.multMCFT0A()) / 2.; } else if (isApplyCentFV0A) { cent = col.multMCFV0A(); } @@ -573,15 +580,17 @@ struct HeavyionMultiplicity { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), nchTracks); } - void processMonteCarlo(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(CollisionMCTrueTable::iterator const&, 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)); @@ -591,15 +600,6 @@ 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,37 +611,43 @@ struct HeavyionMultiplicity { histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kITSonly); } - 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 (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; } - } 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 (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("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)); } - 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) { @@ -657,6 +663,7 @@ 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: @@ -678,6 +685,53 @@ 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) { @@ -744,6 +798,129 @@ 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) { @@ -882,7 +1059,7 @@ struct HeavyionMultiplicity { if (!isEventSelected(RecCol)) { continue; } - if (isApplyBestCollIndex && RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } atLeastOne = true; @@ -935,12 +1112,11 @@ struct HeavyionMultiplicity { if (!isEventSelected(RecCol)) { continue; } - if (isApplyBestCollIndex && RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + if (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()); @@ -949,77 +1125,59 @@ 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)); - - 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; + 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; } - } 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 (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)); + } else { + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); } - 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 } - 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); + 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); - PROCESS_SWITCH(HeavyionMultiplicity, processBcData, "process BC Centrality", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx b/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx deleted file mode 100644 index caba7146363..00000000000 --- a/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx +++ /dev/null @@ -1,602 +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. -/// -/// \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)}; -} diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 35ad555d467..cab9f30cb9a 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -76,7 +76,6 @@ 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 { @@ -98,7 +97,6 @@ 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"}; @@ -107,8 +105,6 @@ 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&) { @@ -119,7 +115,6 @@ 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); @@ -134,19 +129,8 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - 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); @@ -159,9 +143,6 @@ 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); @@ -182,7 +163,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); @@ -255,10 +236,6 @@ 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++; } @@ -273,12 +250,12 @@ struct StudyPnch { if (!isGenTrackSelected(track)) { continue; } - if (track.mcCollisionId() != McCol.mcCollisionId()) { + // Verify that the track belongs to the given MC collision + if (track.mcCollisionId() != McCol.globalIndex()) { continue; } - histos.fill(HIST("EtaGenHist"), track.eta()); - histos.fill(HIST("PhiGenHist"), track.phi()); - histos.fill(HIST("PhiVsEtaGenHist"), track.phi(), track.eta()); + + histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); nTrk++; } return nTrk; @@ -288,28 +265,31 @@ struct StudyPnch { int countNTracksMcCol(countTrk const& tracks, McColType const& McCol) { auto nTrk = 0; - std::vector mcRecIDs; + std::unordered_map recoFrequencies; // Map that stores globalIndex and the times it appears for (const auto& track : tracks) { if (!isTrackSelected(track)) { continue; } + // Verify that the track belongs to the given MC collision if (track.has_mcParticle()) { auto particle = track.mcParticle(); - if (isApplyCheckID && particle.mcCollisionId() != McCol.mcCollisionId()) { - continue; - } - if (isApplyDuplicatedTrack && find(mcRecIDs.begin(), mcRecIDs.end(), particle.globalIndex()) != mcRecIDs.end()) { + if (particle.mcCollisionId() != McCol.mcCollisionId()) { continue; } - mcRecIDs.push_back(particle.globalIndex()); - nTrk++; + auto globalIndex = particle.globalIndex(); + recoFrequencies[globalIndex]++; // Increment the count for this globalIndex } - 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()); } + // 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; } @@ -344,28 +324,18 @@ struct StudyPnch { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), mult); } - void processMonteCarlo(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(ColMCTrueTable::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("hMultiplicityMCrec"), multrec); } - auto multgen = countGenTracks(GenParticles, RecCol); + auto multgen = countGenTracks(GenParticles, mcCollision); if (multgen > 0 && multrec > 0) { histos.fill(HIST("hMultiplicityMCgen"), multgen); histos.fill(HIST("hResponseMatrix"), multrec, multgen); @@ -386,15 +356,9 @@ struct StudyPnch { } // All generated events histos.fill(HIST("MCEventHist"), 1); - 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); + auto multAll = countGenTracks(GenParticles, mcCollision); + if (multAll > 0) { + histos.fill(HIST("hMultiplicityMCgenAll"), multAll); } bool atLeastOne = false; @@ -413,15 +377,9 @@ struct StudyPnch { if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); - 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); + auto multSel = countGenTracks(GenParticles, mcCollision); + if (multSel > 0) { + histos.fill(HIST("hMultiplicityMCgenSel"), multSel); } } } diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 71a38eb1c9f..8cc49c394a4 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(hadron-nuclei-correlation +o2physics_add_dpl_workflow(hadronnucleicorrelation SOURCES hadronnucleicorrelation.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) @@ -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 O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES dedxPidAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework 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 O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES MultiplicityPt.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(deuteron-in-jets-trg-pt SOURCES DeuteronInJetsTrgPt.cxx diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index a8a4363432d..80b50320ea6 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -2392,7 +2392,7 @@ struct LFNucleiBATask { return; } - if (enableCentrality && (centFT0M <= cfgMultCutLow || centFT0M > cfgMultCutHigh)) { + if (centFT0M <= cfgMultCutLow || centFT0M > cfgMultCutHigh) { return; } if (enableCentrality) @@ -2699,10 +2699,8 @@ struct LFNucleiBATask { isDeuteron = enableDe && deRapCut; isHelium = enableHe && heRapCut; - - // ITS PID cut - bool passITSDeCut = !nsigmaITSvar.useITSDeCut || (nITSDe > nsigmaITSvar.nsigmaITSDe); - bool passITSHeCut = !nsigmaITSvar.useITSHeCut || (nITSHe > nsigmaITSvar.nsigmaITSHe); + isDe = isDeuteron && track.sign() > 0; + isAntiDe = isDeuteron && track.sign() < 0; if constexpr (IsMC && !IsFilteredData) { int pdgCheck = track.mcParticle().pdgCode(); @@ -2712,19 +2710,25 @@ 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) && passITSDeCut) + if (std::abs(pdgCheck) == PDGDeuteron) histos.fill(HIST("tracks/hItsDeHeChecker"), 2); - if ((std::abs(pdgCheck) == PDGHelium) && passITSHeCut) + if (std::abs(pdgCheck) == PDGHelium) histos.fill(HIST("tracks/hItsDeHeChecker"), 3); } - isDe = isDeuteron && passITSDeCut && track.sign() > 0; - isAntiDe = isDeuteron && passITSDeCut && track.sign() < 0; - - isHe = isHelium && passITSHeCut && track.sign() > 0; - isAntiHe = isHelium && passITSHeCut && track.sign() < 0; + isHe = isHelium && track.sign() > 0; + isAntiHe = isHelium && track.sign() < 0; isDeWoDCAxy = isDe && passDCAzCutDe; isAntiDeWoDCAxy = isAntiDe && passDCAzCutAntiDe; @@ -4633,6 +4637,7 @@ struct LFNucleiBATask { // TOF if (outFlagOptions.doTOFplots) { + if (isDeWTPCpid) { switch (useHasTRDConfig) { case 0: @@ -4908,8 +4913,7 @@ struct LFNucleiBATask { } if (isHeWTPCpid) { - if (enableCentrality) - histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraVsMult_Z2"), 2 * hePt, centFT0M); + 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); @@ -4918,8 +4922,7 @@ struct LFNucleiBATask { } if (isAntiHeWTPCpid) { - if (enableCentrality) - histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraVsMult_Z2"), 2 * antihePt, centFT0M); + 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); @@ -6384,7 +6387,7 @@ struct LFNucleiBATask { return; } - if (enableCentrality && (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh)) + if (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh) return; if (evselOptions.enableGenVzCut) { diff --git a/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx b/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx new file mode 100644 index 00000000000..6d30693af1b --- /dev/null +++ b/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx @@ -0,0 +1,1481 @@ +// 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/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 0bfa461068d..f18e85682fd 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -17,18 +17,11 @@ #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" @@ -36,10 +29,8 @@ #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 @@ -62,22 +53,11 @@ 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 { +struct hadronnucleicorrelation { - static constexpr int betahasTOFthr = -100; - - SliceCache cache; + // PDG codes and masses used in this analysis + static constexpr int pdgProton = 2212; + static constexpr int pdgDeuteron = 1000010020; 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"}; @@ -87,14 +67,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 cfgUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable url{"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,16 +83,13 @@ 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"}; 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"}; @@ -122,14 +99,13 @@ 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 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"}; + 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"}; // 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}; + 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"}; // pT/A bins Configurable> pTBins{"pTBins", {0.6f, 1.0f, 1.2f, 2.f}, "p_{T} bins"}; @@ -138,7 +114,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::Filtered>; + using SimCollisions = aod::McCollisions; using SimParticles = aod::McParticles; using FilteredTracks = soa::Filtered>; // new tables (v3) using FilteredTracksMC = soa::Filtered>; // new tables (v3) @@ -146,13 +122,37 @@ struct HadronNucleiCorrelation { HistogramRegistry registry{"registry"}; HistogramRegistry QA{"QA"}; - using trkType = const FilteredTracks::iterator*; - // using trkTypeMC = const FilteredTracksMC::iterator*; - // typedef std::shared_ptr colType; - // typedef std::shared_ptr MCcolType; + 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; 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; @@ -160,6 +160,22 @@ 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; @@ -173,13 +189,13 @@ struct HadronNucleiCorrelation { void init(o2::framework::InitContext&) { - ccdb->setURL(cfgUrl.value); + ccdb->setURL(url.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; @@ -199,33 +215,157 @@ 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, "Mixing"); + 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.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= 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; - - Filter simvertexFilter = nabs(o2::aod::mccollision::posZ) <= cutzVertex; + 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) { bool isProton = false; - bool isTPCPID = std::abs(track.tpcNSigmaPr()) < nsigmaTPC; - bool isTOFPID = std::abs(track.tofNSigmaPr()) < nsigmaTOF; - bool isTPCElRejection = rejectionEl && track.beta() < betahasTOFthr && track.pt() < pTthrpr_TPCEl && track.tpcNSigmaEl() >= nsigmaElPr; - bool isITSPID = track.itsNSigmaPr() > nsigmaITSPr; - if (isTPCPID) { + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC) { if (track.pt() < pTthrpr_TOF) { - 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; - } + 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 (isTPCElRejection) { + } else if (rejectionEl && track.beta() < -100 && track.pt() < pTthrpr_TPCEl && track.tpcNSigmaEl() >= nsigmaElPr) { if (sign > 0) { if (track.sign() > 0) { isProton = true; @@ -466,7 +594,7 @@ struct HadronNucleiCorrelation { isProton = true; } } - } else if (isTOFPID) { + } else if (std::abs(track.tofNSigmaPr()) < nsigmaTOF) { if (sign > 0) { if (track.sign() > 0) { isProton = true; @@ -489,29 +617,23 @@ 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 (isTPCPID) { + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC) { if (track.pt() < pTthrde_TOF) { - 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; - } + 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 (isTPCElRejection) { + } else if (rejectionEl && track.beta() < -100 && track.pt() < pTthrde_TPCEl && track.tpcNSigmaEl() >= nsigmaElDe) { if (sign > 0) { if (track.sign() > 0) { isDeuteron = true; @@ -525,7 +647,7 @@ struct HadronNucleiCorrelation { isDeuteron = true; } } - } else if (isTOFPID) { + } else if (std::abs(track.tofNSigmaDe()) < nsigmaTOF) { if (sign > 0) { if (track.sign() > 0) { isDeuteron = true; @@ -557,97 +679,183 @@ struct HadronNucleiCorrelation { return passcut; } - 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; - } + 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) { - 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; - } + Pair->SetPair(it1, it2); + Pair->SetIdentical(isIdentical); + + // if Identical (pp and antip-antip) + if (isIdentical && Pair->IsClosePair(deta, dphi, radiusTPC)) { + QA.fill(HIST("QA/hdetadphistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff()); + continue; } - if (ME) { - hEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt()); - hCorrEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt(), 1. / (corr0 * corr1)); + float mass1 = 0.f, mass2 = 0.f; + + if (mode < 4) { + // Deuteron-Proton combinations + mass1 = o2::constants::physics::MassDeuteron; + mass2 = o2::constants::physics::MassProton; } else { - hEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt()); - hCorrEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt(), 1. / (corr0 * corr1)); - } // SE - } // pT condition - } // nBinspT loop + // Proton-Proton combinations + mass1 = o2::constants::physics::MassProton; + mass2 = o2::constants::physics::MassProton; + } + + // 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(); - Pair->ResetPair(); + } // tracks 2 + } // tracks 1 } - template - void fillHistogramsGen(T1 const& part0, T1 const& part1, bool ME) + template + void mixMCParticles(Type const& particles1, Type const& particles2, int mode, 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; + } + + // 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()); + } + } + } + } + } + } - 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++) { + 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; + } - if (part0.pt() >= pTBins.value.at(k) && part0.pt() < pTBins.value.at(k + 1)) { + if (!ME && std::abs(deltaPhiGen) < 0.0001 && std::abs(deltaEtaGen) < 0.0001) { + continue; + } - 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 + // 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()); + } + } + } + } + } } void GetCorrection(o2::framework::Service const& ccdbObj, TString filepath, TString histname) @@ -683,13 +891,12 @@ struct HadronNucleiCorrelation { LOGP(info, "Opened histogram {}", Form("%s_antideuteron", histname.Data())); } - void processSameEvent(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks) + void processData(FilteredCollisions const& collisions, FilteredTracks const& tracks) { + for (auto track : tracks) { + if (std::abs(track.template singleCollSel_as().posZ()) > cutzvertex) + continue; - 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) @@ -716,247 +923,446 @@ 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"), collision.posZ()); + QA.fill(HIST("QA/hVtxZ_trk"), track.template singleCollSel_as().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()); - QA.fill(HIST("QA/hnSigmaITSVsPt_Pr"), track.pt() * track.sign(), track.itsNSigmaPr()); - QA.fill(HIST("QA/hnSigmaITSVsPt_De"), track.pt() * track.sign(), track.itsNSigmaDe()); + } - 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 (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()); + // 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; + } + + 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 (IsDeuteron(track, +1)) { + + if (doQA) { 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 (IsDeuteron(track, -1)) { + } + 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) { 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()); } } } - Pair->SetMagField1(collision.magField()); - Pair->SetMagField2(collision.magField()); + for (auto collision : collisions) { - if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations + if (std::abs(collision.posZ()) > cutzvertex) + continue; - for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks, tracks))) { + registry.fill(HIST("hNEvents"), 0.5); + registry.fill(HIST("hMult"), collision.mult()); - 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 (selectedtracks_antid.find(collision.globalIndex()) != selectedtracks_antid.end() && + selectedtracks_antip.find(collision.globalIndex()) != selectedtracks_antip.end()) { + registry.fill(HIST("hNEvents"), 1.5); + } - if (!applyDCAcut(part0)) - continue; - if (!applyDCAcut(part1)) - continue; + 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 - // mode 6 - if (mode == kPP) { - if (!IsProton(part0, +1)) - continue; - if (!IsProton(part1, +1)) - continue; + 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_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 + } + } } - // mode 5 - if (mode == kPbarPbar) { - if (!IsProton(part0, -1)) - continue; - if (!IsProton(part1, -1)) - continue; + } + } + + 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 (col1 == col2) { + continue; + } - fillHistograms(part0, part1, false, true); + if (selectedtracks_p.find(col2->index()) != selectedtracks_p.end()) { + mixTracks<1>(selectedtracks_antid[col1->index()], selectedtracks_p[col2->index()], 0, dorapidity); // mixing ME + } + } + } } + } - } else { + if (mode == 3 && !mixbins_d.empty()) { - for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { + for (auto i = mixbins_d.begin(); i != mixbins_d.end(); i++) { // iterating over all vertex&mult bins - if (part0.tpcFractionSharedCls() > max_tpcSharedCls) - continue; - if (part0.itsNCls() < min_itsNCls) - continue; - if (part1.tpcFractionSharedCls() > max_tpcSharedCls) - continue; - if (part1.itsNCls() < min_itsNCls) - continue; + std::vector value = i->second; + int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - if (!applyDCAcut(part0)) - continue; - if (!applyDCAcut(part1)) - continue; + 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 + } - // 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); + 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 + } + } + } } } - } - PROCESS_SWITCH(HadronNucleiCorrelation, processSameEvent, "processSameEvent", true); - void processMixedEvent(FilteredCollisions const& collisions, FilteredTracks const& tracks) - { + if (mode == 4 && !mixbins_antip.empty()) { - for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, collisions, collisions)) { + for (auto i = mixbins_antip.begin(); i != mixbins_antip.end(); i++) { // iterating over all vertex&mult bins - // 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()); + std::vector value = i->second; + int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - auto groupPartsOne = tracks.sliceByCached(o2::aod::singletrackselector::singleCollSelId, collision1.globalIndex(), cache); - auto groupPartsTwo = tracks.sliceByCached(o2::aod::singletrackselector::singleCollSelId, collision2.globalIndex(), cache); + for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - const auto& magFieldTesla1 = collision1.magField(); - const auto& magFieldTesla2 = collision2.magField(); + auto col1 = value[indx1]; - if (magFieldTesla1 != magFieldTesla2) { - continue; + 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 + } + } + } } + } - Pair->SetMagField1(magFieldTesla1); - Pair->SetMagField2(magFieldTesla2); + if (mode == 5 && !mixbins_antip.empty()) { - for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (auto i = mixbins_antip.begin(); i != mixbins_antip.end(); i++) { // iterating over all vertex&mult bins - if (part0.tpcFractionSharedCls() > max_tpcSharedCls) - continue; - if (part0.itsNCls() < min_itsNCls) - continue; - if (part1.tpcFractionSharedCls() > max_tpcSharedCls) - continue; - if (part1.itsNCls() < min_itsNCls) - continue; + std::vector value = i->second; + int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - if (!applyDCAcut(part0)) - continue; - if (!applyDCAcut(part1)) - continue; + 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 + } + + 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_antip[col1->index()], selectedtracks_antip[col2->index()], 1, dorapidity); // mixing ME + } + } + } + } + } + + 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 + + auto col1 = value[indx1]; + + if (selectedtracks_p.find(col1->index()) != selectedtracks_p.end()) { + mixTracks<0>(selectedtracks_p[col1->index()], selectedtracks_p[col1->index()], 1, 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_p[col1->index()], selectedtracks_p[col2->index()], 1, dorapidity); // mixing ME + } + } + } + } + } + + 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 + + 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 (col1 == col2) { + continue; + } - //{"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); + if (selectedtracks_antip.find(col2->index()) != selectedtracks_antip.end()) { + mixTracks<1>(selectedtracks_p[col1->index()], selectedtracks_antip[col2->index()], 0, dorapidity); // mixing ME + } + } + } } } + + // 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, processMixedEvent, "processMixedEvent", true); + PROCESS_SWITCH(hadronnucleicorrelation, processData, "processData", true); void processMC(FilteredCollisions const&, FilteredTracksMC const& tracks) { - for (const auto& track : tracks) { - if (std::abs(track.template singleCollSel_as().posZ()) > cutzVertex) + for (auto track : tracks) { + if (std::abs(track.template singleCollSel_as().posZ()) > cutzvertex) continue; if (track.tpcFractionSharedCls() > max_tpcSharedCls) @@ -964,7 +1370,7 @@ struct HadronNucleiCorrelation { if (track.itsNCls() < min_itsNCls) continue; - if (IsProton(track, +1) && track.pdgCode() == PDG_t::kProton) { + if (IsProton(track, +1) && track.pdgCode() == pdgProton) { registry.fill(HIST("hPrDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimPrDCAxy"), track.dcaXY(), track.pt()); @@ -973,7 +1379,7 @@ struct HadronNucleiCorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatPrDCAxy"), track.dcaXY(), track.pt()); } - if (IsProton(track, -1) && track.pdgCode() == -PDG_t::kProton) { + if (IsProton(track, -1) && track.pdgCode() == -pdgProton) { registry.fill(HIST("hAntiPrDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimAntiPrDCAxy"), track.dcaXY(), track.pt()); @@ -982,7 +1388,7 @@ struct HadronNucleiCorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatAntiPrDCAxy"), track.dcaXY(), track.pt()); } - if (IsDeuteron(track, +1) && track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + if (IsDeuteron(track, +1) && track.pdgCode() == pdgDeuteron) { registry.fill(HIST("hDeDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimDeDCAxy"), track.dcaXY(), track.pt()); @@ -991,7 +1397,7 @@ struct HadronNucleiCorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatDeDCAxy"), track.dcaXY(), track.pt()); } - if (IsDeuteron(track, -1) && track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { + if (IsDeuteron(track, -1) && track.pdgCode() == -pdgDeuteron) { registry.fill(HIST("hAntiDeDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimAntiDeDCAxy"), track.dcaXY(), track.pt()); @@ -1005,7 +1411,7 @@ struct HadronNucleiCorrelation { continue; // Keep only protons and deuterons - // if (std::abs(track.pdgCode()) != PDG_t::kProton && std::abs(track.pdgCode()) != o2::constants::physics::Pdg::kDeuteron) + // if (std::abs(track.pdgCode()) != pdgProton && std::abs(track.pdgCode()) != pdgDeuteron) // continue; if (doQA) { @@ -1024,10 +1430,10 @@ struct HadronNucleiCorrelation { QA.fill(HIST("QA/hnSigmaTOFVsPt_De"), track.pt() * track.sign(), track.tofNSigmaDe()); } - 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); + 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); if (isPr) { registry.fill(HIST("hPrimSec_EtaPhiPt_Proton"), track.eta(), track.phi(), track.pt() * +1); @@ -1045,7 +1451,7 @@ struct HadronNucleiCorrelation { if (track.origin() != 0) continue; - if (track.pdgCode() == PDG_t::kProton) { + if (track.pdgCode() == pdgProton) { 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()); @@ -1059,7 +1465,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() == -PDG_t::kProton) { + if (track.pdgCode() == -pdgProton) { 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()); @@ -1073,7 +1479,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() == o2::constants::physics::Pdg::kDeuteron) { + if (track.pdgCode() == pdgDeuteron) { 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()); @@ -1087,7 +1493,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() == -o2::constants::physics::Pdg::kDeuteron) { + if (track.pdgCode() == -pdgDeuteron) { 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()); @@ -1131,113 +1537,113 @@ struct HadronNucleiCorrelation { if (doMCQA) { // Proton - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == PDG_t::kProton) { + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == pdgProton) { 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() == PDG_t::kProton) { + track.pdgCode() == pdgProton) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == PDG_t::kProton) { + 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) { 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() == PDG_t::kProton) { + track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == pdgProton) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == PDG_t::kProton) { + 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) { 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() == -PDG_t::kProton) { + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == -pdgProton) { 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() == -PDG_t::kProton) { + track.pdgCode() == -pdgProton) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == -PDG_t::kProton) { + 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) { 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() == -PDG_t::kProton) { + track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == -pdgProton) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == -PDG_t::kProton) { + 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) { 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() == o2::constants::physics::Pdg::kDeuteron) { + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == pdgDeuteron) { 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() == o2::constants::physics::Pdg::kDeuteron) { + track.pdgCode() == pdgDeuteron) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + 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) { 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() == o2::constants::physics::Pdg::kDeuteron) { + track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == pdgDeuteron) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + 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) { 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() == -o2::constants::physics::Pdg::kDeuteron) { + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == -pdgDeuteron) { 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() == -o2::constants::physics::Pdg::kDeuteron) { + track.pdgCode() == -pdgDeuteron) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { + 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) { 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() == -o2::constants::physics::Pdg::kDeuteron) { + track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == -pdgDeuteron) { 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { + 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) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCEl_or_TOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPCEl_or_TOF"), track.pt() * -1); } @@ -1247,16 +1653,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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || + (track.beta() > -100 && 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + 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.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl_or_TOF"), track.pt()); } @@ -1265,16 +1671,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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || + (track.beta() > -100 && 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + 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.sign() < 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl_or_TOF"), track.pt() * -1); } @@ -1283,8 +1689,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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || + (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && track.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Deuteron_TPC_or_TOF"), track.pt()); } @@ -1292,8 +1698,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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + 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.sign() > 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl_or_TOF"), track.pt()); @@ -1302,259 +1708,398 @@ 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || + (track.beta() > -100 && 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() < betahasTOFthr) || - (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + 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.sign() < 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl_or_TOF"), track.pt() * -1); } } // track } - PROCESS_SWITCH(HadronNucleiCorrelation, processMC, "processMC", false); + PROCESS_SWITCH(hadronnucleicorrelation, processMC, "processMC", false); - void processSameEventGen(SimCollisions::iterator const&, SimParticles const& mcParticles) - { + Preslice perMCCol = aod::mcparticle::mcCollisionId; - registry.fill(HIST("Generated/hNEventsMC"), 0.5); + void processGen(SimCollisions const& mcCollisions, + SimParticles const& mcParticles) + { + for (auto particle : mcParticles) { - for (const auto& particle : mcParticles) { + if (std::abs(particle.template mcCollision_as().posZ()) > cutzvertex) + continue; - if (particle.pdgCode() == PDG_t::kProton) { + if (particle.pdgCode() == pdgProton) { registry.fill(HIST("Generated/hQAProtons"), 0.5); } - if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + if (particle.pdgCode() == pdgDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 0.5); } if (isPrim && !particle.isPhysicalPrimary()) { continue; } - if (particle.pdgCode() == PDG_t::kProton) { + if (particle.pdgCode() == pdgProton) { registry.fill(HIST("Generated/hQAProtons"), 1.5); } - if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + if (particle.pdgCode() == pdgDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 1.5); } - if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron && std::abs(particle.y()) < 0.5) { + if (particle.pdgCode() == pdgDeuteron && std::abs(particle.y()) < 0.5) { registry.fill(HIST("Generated/hDeuteronsVsPt"), particle.pt()); } - if (particle.pdgCode() == -o2::constants::physics::Pdg::kDeuteron && std::abs(particle.y()) < 0.5) { + if (particle.pdgCode() == -pdgDeuteron && std::abs(particle.y()) < 0.5) { 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) { + if (particle.pdgCode() == pdgProton) { registry.fill(HIST("Generated/hQAProtons"), 2.5); } - if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + if (particle.pdgCode() == pdgDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 2.5); } - if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { + if (particle.pdgCode() == pdgDeuteron) { 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() == -o2::constants::physics::Pdg::kDeuteron) { + if (particle.pdgCode() == -pdgDeuteron) { 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() == PDG_t::kProton) { + if (particle.pdgCode() == pdgProton) { 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() == -PDG_t::kProton) { + if (particle.pdgCode() == -pdgProton) { registry.fill(HIST("hGen_EtaPhiPt_Proton"), particle.eta(), particle.phi(), -1. * particle.pt()); + selectedparticlesMC_antip[particle.mcCollisionId()].push_back(std::make_shared(particle)); } } - if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations + for (auto collision1 : mcCollisions) { // loop on collisions - for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(mcParticles, mcParticles))) { + registry.fill(HIST("Generated/hNEventsMC"), 0.5); - if (isPrim && !part0.isPhysicalPrimary()) { - continue; - } - if (isPrim && !part1.isPhysicalPrimary()) { - continue; - } - if (std::abs(part0.eta()) > etaCut) { + if (std::abs(collision1.posZ()) > cutzvertex) { + continue; + } + + const auto particlesInCollision = mcParticles.sliceBy(perMCCol, collision1.globalIndex()); + + float Ncharged = 0.; + for (auto& mcParticle : particlesInCollision) { + + if (!mcParticle.isPhysicalPrimary()) { continue; } - if (std::abs(part1.eta()) > etaCut) { + + if (std::abs(mcParticle.eta()) > 0.5f) { continue; } - // mode 6 - if (mode == kPP) { - if (part0.pdgCode() != PDG_t::kProton) - continue; - if (part1.pdgCode() != PDG_t::kProton) - 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++; } + } + + registry.fill(HIST("hMult"), Ncharged); - fillHistogramsGen(part0, part1, false); + 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 (isPrim && !part0.isPhysicalPrimary()) { - continue; - } - if (isPrim && !part1.isPhysicalPrimary()) { - continue; - } - if (std::abs(part0.eta()) > etaCut) { - continue; - } - if (std::abs(part1.eta()) > etaCut) { - continue; - } + if (selectedparticlesMC_p.find(collision1.globalIndex()) != selectedparticlesMC_p.end()) { + mixbinsMC_p[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; + } // 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]; + + if (selectedparticlesMC_antip.find(col1->index()) != selectedparticlesMC_antip.end()) { + mixMCParticlesIdentical<0>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_antip[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()) { + mixMCParticlesIdentical<1>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_antip[col2->index()], 0, dorapidity); // mixing SE + } + } } + } + + // 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 - fillHistogramsGen(part0, part1, false); + 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 + } + } + } } - } - } - PROCESS_SWITCH(HadronNucleiCorrelation, processSameEventGen, "processSameEventGen", false); - Preslice perMcCollision = o2::aod::mcparticle::mcCollisionId; + } // mixbinsMC_antip - void processMixedEventGen(SimCollisions const& mcCollisions, SimParticles const& mcParticles) - { + if (!mixbinsMC_p.empty()) { - for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningGen, 5, -1, mcCollisions, mcCollisions)) { + // p-p + for (auto i = mixbinsMC_p.begin(); i != mixbinsMC_p.end(); i++) { // iterating over all vertex&mult bins - // 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()); + std::vector value = i->second; + int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - auto groupPartsOne = mcParticles.sliceBy(perMcCollision, collision1.globalIndex()); - auto groupPartsTwo = mcParticles.sliceBy(perMcCollision, collision2.globalIndex()); + for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - registry.fill(HIST("hMult"), collision1.multMCNParticlesEta10()); + auto col1 = value[indx1]; - for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (selectedparticlesMC_p.find(col1->index()) != selectedparticlesMC_p.end()) { + mixMCParticlesIdentical<0>(selectedparticlesMC_p[col1->index()], selectedparticlesMC_p[col1->index()], 1, dorapidity); // mixing SE + } - if (isPrim && !part0.isPhysicalPrimary()) { - continue; + 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 (isPrim && !part1.isPhysicalPrimary()) { - 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 (std::abs(part0.eta()) > etaCut) { - 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 (std::abs(part1.eta()) > etaCut) { - 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 + } + } } + } + + // 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 (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 == kPbarPbar) { - if (part0.pdgCode() != -PDG_t::kProton) - continue; - if (part1.pdgCode() != -PDG_t::kProton) - continue; - } - 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; - } - - fillHistogramsGen(part0, part1, true); + 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 + } + } + } } + + } // 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 } + mixbinsMC_d.clear(); // clear the map } - PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEventGen, "processMixedEventGen", false); + PROCESS_SWITCH(hadronnucleicorrelation, processGen, "processGen", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx deleted file mode 100644 index 6edc236a27f..00000000000 --- a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx +++ /dev/null @@ -1,837 +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. - -/// \author Dushmanta Sahu (dushmanta.sahu@cern.ch) -/// \file multiplicityPt.cxx -/// \brief Analysis to do PID with MC - Full correction factors for pions, kaons, protons - -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/mcCentrality.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 -#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; - -struct MultiplicityPt { - - Service pdg; - Service ccdb; - static constexpr int CentBinMax = 100; - static constexpr int MultBinMax = 200; - static constexpr int RecMultBinMax = 100; - - enum INELCutSelection : int { - INEL = 0, - INELgt0 = 1, - INELgt1 = 2 - }; - - 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 cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; - Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; - Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; - - 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"}; - - 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"}; - - Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; - - 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"}; - - TrackSelection customTrackCuts; - TF1* fphiCutLow = nullptr; - TF1* fphiCutHigh = nullptr; - - HistogramRegistry ue; - - using CollisionTableData = soa::Join; - using TrackTableData = soa::Join; - using TrackTableMC = soa::Join; - using ParticlesMC = aod::McParticles; - using McCollisions = aod::McCollisions; - using RecoCollisions = aod::Collisions; - - Preslice perMCCol = aod::mcparticle::mcCollisionId; - - enum ParticleSpecies : int { - PartPion = 0, - PartKaon = 1, - PartProton = 2, - }; - - 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(); - } - - 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; - } - - template - bool passedPhiCut(const TrackType& track, float magField) const - { - if (!applyPhiCut.value) - return true; - if (track.pt() < pTthresholdPhiCut.value) - return true; - - 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(track.pt()) && phi > fphiCutLow->Eval(track.pt())) - return false; - return true; - } - - 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 - { - return !nClTPCFoundCut.value || trk.tpcNClsFound() >= minTPCNClsFound.value; - } - - template - bool passedNClTPCPIDCut(const T& trk) const - { - return !nClTPCPIDCut.value || 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, 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 (!passesDCAxyCut(track)) - return false; - if (!passedNClTPCFoundCut(track)) - return false; - if (!passedNClTPCPIDCut(track)) - return false; - if (!passedPhiCut(track, magField)) - return false; - return true; - } - - template - bool passesPIDSelection(const TrackType& track, int species) const - { - float nsigmaTPC = 0.f; - float cutValue = 0.f; - - if (species == PartPion) { - nsigmaTPC = track.tpcNSigmaPi(); - cutValue = cfgCutNsigmaPi.value; - } else if (species == PartKaon) { - nsigmaTPC = track.tpcNSigmaKa(); - cutValue = cfgCutNsigmaKa.value; - } else if (species == PartProton) { - nsigmaTPC = track.tpcNSigmaPr(); - cutValue = cfgCutNsigmaPr.value; - } - - return std::abs(nsigmaTPC) < cutValue; - } - - 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; - } - - 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); - - void init(InitContext const&); - void endOfStream(EndOfStreamContext& /*eos*/) {} -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} - -void MultiplicityPt::init(InitContext const&) -{ - LOG(info) << "=================================================="; - LOG(info) << "Initializing MultiplicityPt task - FULL CORRECTION FACTORS"; - LOG(info) << "=================================================="; - - 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); - } - - if (useCustomTrackCuts.value) { - 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.}; - AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; - - std::vector centBinningFine; - for (int i = 0; i <= CentBinMax; i++) - centBinningFine.push_back(static_cast(i)); - AxisSpec centFineAxis = {centBinningFine, "FT0M Centrality (%)"}; - - 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)"}; - - std::vector recoMultBins; - for (int i = 0; i <= RecMultBinMax; i++) - recoMultBins.push_back(static_cast(i)); - AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; - - 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/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/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", HistType::kTH2D, {centFineAxis, recoMultAxis}); - - 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 collisions"); - hCut->GetXaxis()->SetBinLabel(2, "Has MC match"); - hCut->GetXaxis()->SetBinLabel(3, "Has centrality"); - hCut->GetXaxis()->SetBinLabel(4, "Pass vertex"); - hCut->GetXaxis()->SetBinLabel(5, "Selected"); - - 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"); - - 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("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("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}); - - 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}); - - 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/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/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("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}}); - - LOG(info) << "=== Initialization complete ==="; -} - -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*/) -{ - - std::map mcCollisionToNch; - 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()); - - for (const auto& mcCollision : mcCollisions) { - 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; - - bool inel0 = o2::pwglf::isINELgt0mc(particlesInCollision, pdg); - bool inel1 = o2::pwglf::isINELgt1mc(particlesInCollision, pdg); - int inelClass = inel1 ? 2 : (inel0 ? 1 : 0); - mcCollisionToINELClass[mcCollId] = inelClass; - - bool physicsSelected = (std::abs(mcCollision.posZ()) <= cfgCutVertex.value); - if (cfgINELCut.value == INELgt0 && !inel0) - physicsSelected = false; - if (cfgINELCut.value == INELgt1 && !inel1) - physicsSelected = false; - - if (physicsSelected) { - physicsSelectedMCCollisions.insert(mcCollId); - if (inel0) - ue.fill(HIST("MC/GenRecoCollisions"), 2.f); - if (inel1) - ue.fill(HIST("MC/GenRecoCollisions"), 3.f); - } - - // 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; - - int pdgCode = std::abs(particle.pdgCode()); - float pt = particle.pt(); - - // 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) { - ue.fill(HIST("Kaon/hPtPrimGenAll"), pt); - } 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; - - if (pdgCode == PDG_t::kPiPlus) { - ue.fill(HIST("Pion/hPtGenINEL"), pt); - ue.fill(HIST("Pion/hPtGenINEL_Mult"), pt, nGenCharged); - } else if (pdgCode == PDG_t::kKPlus) { - ue.fill(HIST("Kaon/hPtGenINEL"), pt); - ue.fill(HIST("Kaon/hPtGenINEL_Mult"), pt, nGenCharged); - } else if (pdgCode == PDG_t::kProton) { - ue.fill(HIST("Proton/hPtGenINEL"), pt); - ue.fill(HIST("Proton/hPtGenINEL_Mult"), pt, nGenCharged); - } - } - - // 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); - } - } - } - } - - std::map recoToMcMap; - std::map recoToCentMap; - - 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 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); - } - - std::set reconstructedMCCollisions; - std::set selectedMCCollisions; - - for (const auto& collision : collisions) { - ue.fill(HIST("CutFlow/hCutStats"), 1); - - int64_t collId = collision.globalIndex(); - - // MC matching - auto mcIt = recoToMcMap.find(collId); - if (mcIt == recoToMcMap.end()) - continue; - ue.fill(HIST("CutFlow/hCutStats"), 2); - - int64_t mcCollId = mcIt->second; - auto nchIt = mcCollisionToNch.find(mcCollId); - if (nchIt == mcCollisionToNch.end()) - continue; - int nGenCharged = nchIt->second; - - auto inelIt = mcCollisionToINELClass.find(mcCollId); - int inelClass = (inelIt != mcCollisionToINELClass.end()) ? inelIt->second : 0; - - // Centrality - auto centIt = recoToCentMap.find(collId); - if (centIt == recoToCentMap.end()) - continue; - ue.fill(HIST("CutFlow/hCutStats"), 3); - - float cent = centIt->second; - if (cent < 0 || cent > CentBinMax) - continue; - - // Store centrality for this MC collision (used later for MC truth plots) - mcCollToCentFromReco[mcCollId] = cent; - - // Vertex cut - bool passVertex = std::abs(collision.posZ()) <= cfgCutVertex.value; - 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) - continue; - - // Event passed all cuts - ue.fill(HIST("CutFlow/hCutStats"), 5); - ue.fill(HIST("Centrality/hCentAfterAll"), 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); - reconstructedMCCollisions.insert(mcCollId); - - // Get magnetic field for phi cut - float magField = 0; - if (applyPhiCut.value) { - const auto& bc = collision.bc_as(); - magField = getMagneticField(bc.timestamp()); - } - - int nTracksInEvent = 0; - - for (const auto& track : tracks) { - if (!track.has_collision()) - continue; - if (track.collisionId() != collId) - continue; - - if (!passesTrackSelection(track, magField)) - continue; - - nTracksInEvent++; - - ue.fill(HIST("hNclFoundTPC"), track.tpcNClsFound()); - ue.fill(HIST("hNclPIDTPC"), track.tpcNClsPID()); - ue.fill(HIST("hEta"), track.eta()); - ue.fill(HIST("hPhi"), track.phi()); - ue.fill(HIST("Inclusive/hPtReco"), track.pt()); - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - int pdgCode = std::abs(particle.pdgCode()); - - 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("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("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("Inclusive/hPtPrimReco"), track.pt()); - } else { - ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); - } - } - } - - if (passesPIDSelection(track, PartPion)) { - ue.fill(HIST("Pion/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - } - - if (passesPIDSelection(track, PartKaon)) { - ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - } - - if (passesPIDSelection(track, PartProton)) { - ue.fill(HIST("Proton/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } - } - } - - ue.fill(HIST("Centrality/hRecoMultVsCent"), cent, nTracksInEvent); - } - - 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()); - - 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*/, - TrackTableData const& /*tracks*/, - BCsRun3 const& /*bcs*/) -{ -} diff --git a/PWGLF/Tasks/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index e1618a43d06..319d21d9d96 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 O2Physics::AnalysisCCDB + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(track-checks diff --git a/PWGLF/Tasks/QC/v0cascadesqa.cxx b/PWGLF/Tasks/QC/v0cascadesqa.cxx index 962687d2869..dc3d615cc57 100644 --- a/PWGLF/Tasks/QC/v0cascadesqa.cxx +++ b/PWGLF/Tasks/QC/v0cascadesqa.cxx @@ -9,22 +9,15 @@ // 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" @@ -41,1073 +34,382 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" -#include - -using namespace o2::aod::rctsel; +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -enum ParticleType : uint8_t { kPhoton = 0, - kK0s, - kLambda, - kAntiLambda, - kXiM, - kXiP, - kOmegaM, - kOmegaP }; - -// using DaughterTracks = soa::Join; -using DaughterTracks = soa::Join; +using MyTracks = soa::Join; +using MyTracksMC = soa::Join; +using DaughterTracks = soa::Join; struct v0cascadesQA { - HistogramRegistry histos_event{"histos_event", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry histos_V0{"histos_V0", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry histos_Casc{"histos_Casc", {}, OutputObjHandlingPolicy::AnalysisObject}; + static constexpr float defaultLifetimeCuts[1][2] = {{25., 20.}}; // configurable event properties - 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; + 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}; void init(InitContext const&) { - 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}); + 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 (doextraanalysis) { - 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}}}); - } - - // Initialise the RCTFlagsChecker - rctFlagsChecker.init(rctConfigurations.cfgRCTLabel.value, rctConfigurations.cfgCheckZDC, rctConfigurations.cfgTreatLimitedAcceptanceAsBad); + 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"); } - template - bool isEventAccepted(TCollision collision, bool fillHists) - // check whether the collision passes our collision selections - { - if (fillHists) { - histos_event.fill(HIST("hEventSelection"), 0. /* all collisions */); - } - - 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 */); - } - - 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 */); - } + /////////////////////////////////////////////////// + ////////// Collisions QA - reconstructed ////////// + /////////////////////////////////////////////////// - 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 + void processReconstructedEvent(soa::Join::iterator const& Collision) { - // 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; - } - - // 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; + histos_eve.fill(HIST("hEventCounter"), 0.5); + if (sel8 && !Collision.sel8()) { + return; } + histos_eve.fill(HIST("hEventCounter"), 1.5); + } + PROCESS_SWITCH(v0cascadesQA, processReconstructedEvent, "Process reconstructed level Event", true); - // TOF Requirement checks - if (v0Selections.requirePosHasTOF && !v0.positiveHasTOF()) { - return false; - } - if (v0Selections.requireNegHasTOF && !v0.negativeHasTOF()) { - return false; - } + /////////////////////////////////////// + ////////// Collision QA - MC ////////// + /////////////////////////////////////// - if (v0Selections.requireAtLeastOneHasTOF && !v0.positiveHasTOF() && !v0.negativeHasTOF()) { - return false; - } + void processMcEvent(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups>& collisions) + { + histos_eve.fill(HIST("hEventCounterMC"), 0.5); - // TOF Nsigma - if (v0Type == kK0s) { - if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaK0PiPlus()) > v0Selections.tofPidNsigmaCutK0Pi) { - return false; - } - 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; + std::vector SelectedEvents(collisions.size()); + int nevts = 0; + for (const auto& collision : collisions) { + if (sel8 && !collision.sel8()) { + continue; } + SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } + SelectedEvents.resize(nevts); - // TRD Requirement checks - if (v0Selections.requirePosHasTRD && !posTrackExtra.hasTRD()) { - return false; - } - if (v0Selections.requireNegHasTRD && !negTrackExtra.hasTRD()) { - return false; - } - - 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++; - } - } + const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); - if (posTrackExtra.hasTRD() && posTRDhits < v0Selections.minTRDclusters) { - return false; - } - if (negTrackExtra.hasTRD() && negTRDhits < v0Selections.minTRDclusters) { - return false; + if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + return; } - 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; - } + histos_eve.fill(HIST("hEventCounterMC"), 1.5); - // TOF Requirement checks - if (cascSelections.requireBachHasTOF && !casc.bachelorHasTOF()) { - return false; - } - if (cascSelections.requirePosHasTOF && !casc.positiveHasTOF()) { - return false; - } - if (cascSelections.requireNegHasTOF && !casc.negativeHasTOF()) { - return false; - } + double posx = mcCollision.posX(); + double posy = mcCollision.posY(); - if (cascSelections.requireAtLeastOneHasTOF && !casc.bachelorHasTOF() && !casc.positiveHasTOF() && !casc.negativeHasTOF()) { - return false; - } + for (auto& mcparticle : mcParticles) { - // - // 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; + if (!mcparticle.has_daughters()) { + continue; } - } - // 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 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; } - if (posTrackExtra.trdPattern() & (1 << i)) { - posTRDhits++; + 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 (negTrackExtra.trdPattern() & (1 << i)) { - negTRDhits++; + 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 (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); //////////////////////////////////////////// - /////////// QA - Reconstructed ///////////// + ////////// V0 QA - Reconstructed /////////// //////////////////////////////////////////// - void processReconstructed(soa::Join::iterator const& collision, soa::Join const& fullV0s, soa::Join const& fullCascades, DaughterTracks const&, aod::BCsWithTimestamps const&) + void processReconstructedV0(soa::Join::iterator const& collision, aod::V0Datas const& fullV0s, DaughterTracks&) { - histos_event.fill(HIST("hEventCounter"), 0.5); - if (!isEventAccepted(collision, true)) { + if (sel8 && !collision.sel8()) { 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 (v0.negativeeta() < 0. && v0.positiveeta() < 0.) { + if (posdau.eta() < 0. && negdau.eta() < 0.) { dauEtaFlag = -1; - } else if (v0.negativeeta() >= 0. && v0.positiveeta() >= 0.) { + } else if (posdau.eta() >= 0. && negdau.eta() >= 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("Radius"), v0.v0radius()); - histos_V0.fill(HIST("DCANegToPV"), v0.dcanegtopv()); - histos_V0.fill(HIST("DCAPosToPV"), v0.dcapostopv()); - histos_V0.fill(HIST("DCAV0Daughters"), v0.dcaV0daughters()); + 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()); float decayLength = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(v0.px(), v0.py(), v0.pz()); histos_V0.fill(HIST("DecayLength"), decayLength); @@ -1115,98 +417,166 @@ 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; - // 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()); + 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()); + } } - } - // 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()); + // 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()); + } } } + } + } + 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; + } - // 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()); + 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(); + } + + 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()); + } } } } + } + PROCESS_SWITCH(v0cascadesQA, processMcV0, "Process MC level V0s", false); - 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 + ////////////////////////////////////// + ///// 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; + } 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(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()}); + 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()}); histos_Casc.fill(HIST("V0CosPAToXi"), v0cospatoxi, casc.sign()); histos_Casc.fill(HIST("CascRadius"), casc.cascradius(), 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()); + 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()); 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 @@ -1216,9 +586,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("CascLifetimeXi"), CtauXi, casc.sign()); - histos_Casc.fill(HIST("CascLifetimeOmega"), CtauOmega, casc.sign()); - histos_Casc.fill(HIST("V0Lifetime"), CtauV0, casc.sign()); + 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("CascPt"), casc.pt(), casc.sign()); histos_Casc.fill(HIST("DcaV0Daughters"), casc.dcaV0daughters(), casc.sign()); histos_Casc.fill(HIST("DcaCascDaughters"), casc.dcacascdaughters(), casc.sign()); @@ -1226,196 +596,176 @@ 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("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()); + 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()); + } + } + } } } } + PROCESS_SWITCH(v0cascadesQA, processReconstructedCascade, "Process reconstructed level Cascades", true); - //////////////////////////////// - ////////// QA - MC ///////////// - //////////////////////////////// + ////////////////////////////////////// + ////////// Cascade QA - MC /////////// + ////////////////////////////////////// - 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&) + void processMcCascade(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, MyTracksMC const&, aod::McParticles const&) { - if (!isEventAccepted(collision, false)) { + if (sel8 && !collision.sel8()) { 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 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 - if (!v0.has_v0MCCore()) - continue; - - auto v0MC = v0.template v0MCCore_as>(); + for (auto& casc : Cascades) { - // 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; + histos_Casc.fill(HIST("QA_XiMinusCandidates"), 0.5); - auto cascMC = casc.template cascMCCore_as>(); + 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) { - histos_Casc.fill(HIST("QA_CascadeCandidates"), 0.5); + histos_Casc.fill(HIST("QA_XiMinusCandidates"), 1.5); - 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()); + 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; } - } - 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()); + histos_Casc.fill(HIST("QA_XiMinusCandidates"), 2.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(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()); + 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); + } + } + } + } } } } } - - /////////////////////////////////////// - ////////// 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); + PROCESS_SWITCH(v0cascadesQA, processMcCascade, "Process MC level Cascades", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index ba09b4f72d5..770ea3a38a7 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -17,7 +17,6 @@ /// \author Navneet Kumar , Protay #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" @@ -70,8 +69,6 @@ #include #include #include -#include -#include #include using namespace o2; @@ -87,9 +84,6 @@ struct Chargedkstaranalysis { FT0C = 1, FT0M = 2 }; - 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"}; @@ -112,7 +106,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", 5, "Number of random rotations in the rotational background"}; + Configurable cRotations{"cRotations", 3, "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)"}; @@ -131,17 +125,10 @@ 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 histosMc{"histosMc", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry hChaKstar{"hChaKstar", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -171,7 +158,7 @@ struct Chargedkstaranalysis { Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; struct RCTCut : ConfigurableGroup { - Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "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"}; @@ -184,7 +171,6 @@ 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"}; @@ -199,7 +185,6 @@ 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"}; @@ -216,11 +201,6 @@ 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 { @@ -292,7 +272,14 @@ struct Chargedkstaranalysis { Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; } kstarCutCfgs; - Configurable isQaRequired{"isQaRequired", false, "Fill QA plots"}; + 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; + float centrality; // PDG code @@ -308,7 +295,9 @@ struct Chargedkstaranalysis { { centrality = -999; - colCuts.setCuts(eventCutCfgs.confEvtZvtx, eventCutCfgs.confEvtTriggerCheck, eventCutCfgs.confEvtOfflineCheck, /*checkRun3*/ true, eventCutCfgs.confEvtTriggerTVXSel, eventCutCfgs.confEvtOccupancyInTimeRangeMax, eventCutCfgs.confEvtOccupancyInTimeRangeMin); + 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.init(&histos); colCuts.setTriggerTVX(eventCutCfgs.confEvtTriggerTVXSel); colCuts.setApplyTFBorderCut(eventCutCfgs.confEvtTFBorderCut); @@ -329,8 +318,6 @@ 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})"}; @@ -342,7 +329,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 = {800 / cNbinsDiv, 0.46, 0.54, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "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}; @@ -353,237 +340,224 @@ struct Chargedkstaranalysis { // THnSparse AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - 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", kTH1D, {{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", 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"); - 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/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/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}); - 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/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 - 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); - } + 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 (rotBkgEstCfgs.cFillRotBkg) { + histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); } // 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/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}); - } - 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}); - - 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}); + 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()); } - 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) @@ -600,86 +574,107 @@ struct Chargedkstaranalysis { } } + // Track selection template bool trackCut(TrackType const& track) { int ibin = 1; + 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; - }; - - // First bin (before any cuts) - if (!doprocessMC && isQaRequired) - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - // Cuts - if (!applyCut(std::abs(track.pt()) >= trackCutCfgs.cMinPtcut)) + // basic track cuts + if (std::abs(track.pt()) < trackCutCfgs.cMinPtcut) return false; - if (!applyCut(std::abs(track.eta()) <= trackCutCfgs.cMaxEtacut)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (std::abs(track.eta()) > trackCutCfgs.cMaxEtacut) return false; - if (!applyCut(track.itsNCls() >= trackCutCfgs.cfgITScluster)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (track.itsNCls() < trackCutCfgs.cfgITScluster) return false; - if (!applyCut(track.tpcNClsFound() >= trackCutCfgs.cfgTPCcluster)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (track.tpcNClsFound() < trackCutCfgs.cfgTPCcluster) return false; - if (!applyCut(track.tpcCrossedRowsOverFindableCls() >= trackCutCfgs.cfgRatioTPCRowsOverFindableCls)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (track.tpcCrossedRowsOverFindableCls() < trackCutCfgs.cfgRatioTPCRowsOverFindableCls) return false; - if (!applyCut(track.itsChi2NCl() < trackCutCfgs.cfgITSChi2NCl)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (track.itsChi2NCl() >= trackCutCfgs.cfgITSChi2NCl) return false; - if (!applyCut(track.tpcChi2NCl() < trackCutCfgs.cfgTPCChi2NCl)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (track.tpcChi2NCl() >= trackCutCfgs.cfgTPCChi2NCl) return false; + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (!applyCut(!trackCutCfgs.cfgHasITS || track.hasITS())) + if (trackCutCfgs.cfgHasITS && !track.hasITS()) return false; - if (!applyCut(!trackCutCfgs.cfgHasTPC || track.hasTPC())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgHasTPC && !track.hasTPC()) return false; - if (!applyCut(!trackCutCfgs.cfgHasTOF || track.hasTOF())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgHasTOF && !track.hasTOF()) return false; + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (!applyCut(!trackCutCfgs.cfgUseITSRefit || track.passedITSRefit())) + if (trackCutCfgs.cfgUseITSRefit && !track.passedITSRefit()) return false; - if (!applyCut(!trackCutCfgs.cfgUseTPCRefit || track.passedTPCRefit())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgUseTPCRefit && !track.passedTPCRefit()) return false; + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (!applyCut(!trackCutCfgs.cfgPVContributor || track.isPVContributor())) + if (trackCutCfgs.cfgPVContributor && !track.isPVContributor()) return false; - if (!applyCut(!trackCutCfgs.cfgGlobalWoDCATrack || track.isGlobalTrackWoDCA())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) return false; - if (!applyCut(!trackCutCfgs.cfgGlobalTrack || track.isGlobalTrack())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgGlobalTrack && !track.isGlobalTrack()) return false; - if (!applyCut(!trackCutCfgs.cfgPrimaryTrack || track.isPrimaryTrack())) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (trackCutCfgs.cfgPrimaryTrack && !track.isPrimaryTrack()) return false; + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cMaxbDCArToPVcut)) + if (std::abs(track.dcaXY()) > trackCutCfgs.cMaxbDCArToPVcut) return false; - if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cMaxbDCAzToPVcut)) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + + if (std::abs(track.dcaZ()) > trackCutCfgs.cMaxbDCAzToPVcut) return false; + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - // pT dependent DCA XY if (trackCutCfgs.cfgpTdepDCAxyCut) { - if (!applyCut(std::abs(track.dcaXY()) <= (0.004 + (0.013 / track.pt())))) + if (std::abs(track.dcaXY()) > (0.004 + (0.013 / track.pt()))) return false; } else { - if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cfgMaxbDCArToPVcut)) + if (std::abs(track.dcaXY()) > trackCutCfgs.cfgMaxbDCArToPVcut) return false; } + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - // pT dependent DCA Z if (trackCutCfgs.cfgpTdepDCAzCut) { - if (!applyCut(std::abs(track.dcaZ()) <= (0.004 + (0.013 / track.pt())))) + // 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()))) return false; } else { - if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cfgMaxbDCAzToPVcut)) + if (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) @@ -707,51 +702,108 @@ 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()); + auto dauDCA = candidate.dcaV0daughters(); + auto dauPosDCAtoPV = candidate.dcapostopv(); + auto dauNegDCAtoPV = candidate.dcanegtopv(); auto pT = candidate.pt(); auto rapidity = candidate.yK0Short(); auto v0Radius = candidate.v0radius(); - auto dcaToPV = std::fabs(candidate.dcav0topv()); + auto dcaToPV = candidate.dcav0topv(); auto cosPA = candidate.v0cosPA(); - auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0s; auto mK0s = candidate.mK0Short(); auto mLambda = candidate.mLambda(); auto mALambda = candidate.mAntiLambda(); - if (!doprocessMC && isQaRequired) + bool returnFlag = true; + histos.fill(HIST("QA/K0sCutCheck"), ibin); + if (dauDCA > secondaryCutsCfgs.cSecondaryDauDCAMax) { + returnFlag = false; + } + ibin++; + if (returnFlag == true) + histos.fill(HIST("QA/K0sCutCheck"), ibin); + if (dauPosDCAtoPV < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { + returnFlag = false; + } + ibin++; + if (returnFlag == true) + histos.fill(HIST("QA/K0sCutCheck"), ibin); + + if (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) 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 (candidate.qtarm() < secondaryCutsCfgs.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) { + 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 (std::fabs(mK0s - MassK0Short) > secondaryCutsCfgs.cSecondaryMassWindow) { + returnFlag = false; + } + ibin++; + if (returnFlag == true) + histos.fill(HIST("QA/K0sCutCheck"), ibin); + 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) { @@ -787,79 +839,8 @@ struct Chargedkstaranalysis { } int count = 0; - 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 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); - } - } - } - } + double massPi = o2::constants::physics::MassPionCharged; + double massK0s = o2::constants::physics::MassK0Short; template void fillInvMass(const T& mother, float multiplicity, const T& daughter1, const T& daughter2, bool isMix) @@ -907,7 +888,6 @@ 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 @@ -915,52 +895,56 @@ 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) { - fillKstarHist(false, multiplicity, mother, cosThetaStarHelicity); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity, 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()); + 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 = daughterRot + daughter2; + 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()); - ROOT::Math::Boost boost2{motherRot.BoostToCM()}; - daughterRotCM = boost2(daughterRot); + motherRot = daughterRot + daughter2; - 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); - } - } + 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 (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); } } } else if (helicityCfgs.activateCollinsSoperFrame) { if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - fillKstarHist(false, multiplicity, mother, cosThetaStarCS); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS, phiCS); } - 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()); + 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 = daughterRot + daughter2; + 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()); - ROOT::Math::Boost boost2{motherRot.BoostToCM()}; - daughterRotCM = boost2(daughterRot); + motherRot = daughterRot + daughter2; - 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); + ROOT::Math::Boost boost2{motherRot.BoostToCM()}; + daughterRotCM = boost2(daughterRot); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - fillKstarHist(true, multiplicity, mother, cosThetaStarCSrot); - } - } + 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 (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); } } } else if (helicityCfgs.activateProductionFrame) { @@ -968,38 +952,38 @@ 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) { - fillKstarHist(false, multiplicity, mother, cosThetaProduction); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.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); - } + 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); } } + } 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) { - fillKstarHist(false, multiplicity, mother, cosThetaStarBeam); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.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); - } + 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); } } + } 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); @@ -1009,102 +993,90 @@ struct Chargedkstaranalysis { auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - fillKstarHist(false, multiplicity, mother, cosThetaStarRandom); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.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); - } + 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); } } + } else { + if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { + hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom, phiRandom); + } } } + // } } template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { - 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; + 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 = {}; - 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) { - 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()); + // 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); } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); } else { - if (!doprocessMC && isQaRequired) { - histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); - } + + histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); } - if (!trackCut(bTrack) || !selectionPIDPion(bTrack)) + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) continue; if constexpr (!IsMix) { - 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()); + // 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); } + 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 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 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 trkkDauDCA = K0scand.dcaV0daughters(); auto trkkDauDCAPostoPV = K0scand.dcapostopv(); auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); @@ -1114,120 +1086,141 @@ 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) { - // 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/hArmSecondary"), K0scand.alpha(), K0scand.qtarm()); - histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); + // 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); + } + 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(pos) || !selectionPIDPion(neg))) || - !selectionK0s(collision, K0scand)) + 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)) continue; 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); - } + // Seconddary QA plots after applying cuts - 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/hArmSecondary"), K0scand.alpha(), K0scand.qtarm()); - histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); + 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); + } + 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()); } - // ========================= - // Pairing - // ========================= - 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(), MassPionCharged}; - lResoSecondary = {k0s.px(), k0s.py(), k0s.pz(), MassK0Short}; + 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); lResoKstar = lResoSecondary + lDecayDaughter_bach; + // QA plots if constexpr (!IsMix) { - if (!doprocessMC && isQaRequired) { - histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); - } + 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, @@ -1256,6 +1249,7 @@ 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}; @@ -1289,8 +1283,8 @@ struct Chargedkstaranalysis { continue; ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar; - lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), MassPionCharged); - lResoSecondary = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), MassK0Short); + lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massPi); + lResoSecondary = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massK0s); lResoKstar = lResoSecondary + lDecayDaughter_bach; if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) @@ -1301,192 +1295,15 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true); - void processMC(soa::Join const&, aod::McParticles const& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) + // process MC reconstructed level + void processMC(MCEventCandidates::iterator const& collision, + MCTrackCandidates const& tracks, + MCV0Candidates const& v0s) { - 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) { - - 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; - colCuts.fillQA(coll); - - 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; - - 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) { - 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()) { - 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) { - lResoSecondary = LorentzVectorSetXYZM(d2.px(), d2.py(), d2.pz(), MassK0Short); - 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("QAMC/hEvent"), 1.0); - 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()) - 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); - 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()); - } - } + fillHistograms(collision, tracks, v0s); } PROCESS_SWITCH(Chargedkstaranalysis, processMC, "Process Event for MC", false); }; diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index e581299b318..26a9c5aed59 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", - "|Vz| < 10", + Form("|Vz| < %.1f", selectionConfig.cutzvertex), "sel8", std::string("kNoTimeFrameBorder") + check(selectionConfig.isNoTimeFrameBorder.value), std::string("kNoITSROFrameBorder") + check(selectionConfig.isNoITSROFrameBorder.value), diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index bd0964bbea5..6af3bde09f8 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -17,6 +17,9 @@ #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" @@ -38,25 +41,18 @@ 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"}; @@ -145,7 +141,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.4, 2.0, {"M_{inv} (GeV/c^{2})"}); + const AxisSpec axisInvM(nBinsInvM, 1.2, 1.8, {"M_{inv} (GeV/c^{2})"}); AxisSpec axisOccupancy = {occupancy_bins, "Occupancy [-40,100]"}; AxisSpec axisDCAz = {cDCAzBins, "DCA_{z} (cm)"}; @@ -154,11 +150,7 @@ struct lambdaAnalysis_pb { if (doprocessMix || doprocessMixDF || doprocessMixepDF) { histos.add("Event/mixing_vzVsmultpercentile", "FT0(%)", kTH3F, {axisCent, axisVz, axisEP}); } - // 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}}); + // QA Before 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}); @@ -180,8 +172,6 @@ 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}); @@ -195,8 +185,7 @@ 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) { @@ -204,8 +193,7 @@ 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_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_rot", "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}); @@ -213,7 +201,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}); @@ -223,14 +211,13 @@ 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; @@ -246,15 +233,9 @@ 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) { @@ -361,7 +342,6 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { - return true; } return false; @@ -428,7 +408,6 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { - return true; } return false; @@ -441,13 +420,14 @@ 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(); @@ -462,6 +442,7 @@ 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(); @@ -504,9 +485,6 @@ 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); @@ -527,9 +505,6 @@ 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); @@ -550,12 +525,9 @@ struct lambdaAnalysis_pb { float _M = RecoDecay::m(arrMomrec, std::array{MassProton, MassKaonCharged}); float _pt = RecoDecay::pt(std::array{_pxPr + _pxKa, _pyPr + _pyKa}); - float _y = std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, _M)); - - float _yshift = _y - cfgRapidityShift; - - if (std::abs(_yshift) > cfgRapidityCut) + if (std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, MassLambda1520)) > 0.5) continue; + // Apply kinematic cuts. // Fill Invariant Mass Histograms. @@ -571,14 +543,7 @@ struct lambdaAnalysis_pb { for (int i = 0; i < cNofRotations; i++) { float delta = o2::constants::math::PI / rotationalcut; - 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 theta2 = (o2::constants::math::PI - delta) + i * (2.f * delta / (cNofRotations - 1)); float phiRot = trkKa.phi() + theta2; if (phiRot > o2::constants::math::TwoPI) @@ -596,19 +561,12 @@ struct lambdaAnalysis_pb { float _Mrot = RecoDecay::m(arrMomRot, std::array{MassProton, MassKaonCharged}); float _ptRot = RecoDecay::pt(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot}); - float _yrot = std::abs(RecoDecay::y(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, MassLambda1520)); - - float _yshiftrot = _yrot - cfgRapidityShift; - - if (std::abs(_yshiftrot) > cfgRapidityCut) + if (std::abs(RecoDecay::y( + std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, + MassLambda1520)) > 0.5f) continue; - 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); - } + histos.fill(HIST("Analysis/h4d_lstar_invm_rot"), _Mrot, _ptRot, mult, occup); } } } else { @@ -633,6 +591,7 @@ 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) @@ -640,34 +599,15 @@ 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; - 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; + // MC histograms 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); } } } @@ -681,6 +621,7 @@ 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()); @@ -693,74 +634,54 @@ struct lambdaAnalysis_pb { void processMC(resoMCCols::iterator const& collision, soa::Join const& tracks, aod::ResoMCParents const& resoParents) { - 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()) + if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) 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; - histos.fill(HIST("Event/hMCEventCutflow"), 4); // After Sel8 - - if (cEvtMCRecINELgt0 && !collision.isRecINELgt0()) + if (cEvtMCVtxIn10 && !collision.isVtxIn10()) return; - histos.fill(HIST("Event/hMCEventCutflow"), 5); // After RecINELgt0 - - if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) + if (cEvtMCTriggerTVX && !collision.isTriggerTVX()) + return; + if (cEvtMCRecINELgt0 && !collision.isRecINELgt0()) 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)) { - if (std::abs(track.pdgCode()) == 321) { - histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); - } + if (selectionPIDKaon(track, p) && std::abs(track.pdgCode()) == 321) { + histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); } - if (selectionPIDProton(track, p)) { - if (std::abs(track.pdgCode()) == 2212) { - histos.fill(HIST("QAChecks/h1d_pr_rec_pt"), track.pt()); - } + if (selectionPIDProton(track, p) && 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; @@ -775,7 +696,9 @@ 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 @@ -788,6 +711,7 @@ struct lambdaAnalysis_pb { void processMix(resoCols& collisions, resoTracks const& tracks) { + LOGF(debug, "Event Mixing Started"); BinningType2 binningPositions2{{cMixVtxBins, cMixMultBins}, true}; diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 2418f442bf4..fada8bbc6e4 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/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" #include "Common/DataModel/Centrality.h" @@ -36,7 +37,6 @@ 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,19 +85,23 @@ struct Lambda1520analysisinpp { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service pdg; - RCTFlagsChecker rctChecker; + + /// Event cuts + o2::analysis::CollisonCuts colCuts; 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 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"}; + Configurable cfgEvtNoCollInTimeRangeStandard{"cfgEvtNoCollInTimeRangeStandard", false, "Evt sel: apply NoNoCollInTimeRangeStandard"}; + Configurable cfgEvtIsVertexTOFmatched{"cfgEvtIsVertexTOFmatched", true, "kIsVertexTOFmatched: apply vertex TOF matched"}; } configEvents; struct : ConfigurableGroup { @@ -174,7 +178,6 @@ 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"}; @@ -234,7 +237,18 @@ struct Lambda1520analysisinpp { void init(framework::InitContext&) { - rctChecker.init(configEvents.cfgEvtRCTFlagCheckerLabel, configEvents.cfgEvtRCTFlagCheckerZDCCheck, configEvents.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + 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(); // axes AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -255,23 +269,10 @@ 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}}); } @@ -288,6 +289,9 @@ 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) { @@ -424,15 +428,6 @@ 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 (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 LOG(info) << "Size of the histograms in Lambda1520analysisinpp:"; @@ -464,52 +459,6 @@ 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) { @@ -1073,13 +1022,21 @@ struct Lambda1520analysisinpp { void processData(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { - if (!isSelected(collision)) // Default event selection + if (!colCuts.isSelected(collision)) // Default event selection return; - auto centrality = centEst(collision); + if (cFilladditionalQAeventPlots) { + histos.fill(HIST("QAevent/hEvents"), 1); + } + + if (!collision.isInelGt0()) // <-- + return; + + if (cFilladditionalQAeventPlots) { + histos.fill(HIST("QAevent/hEvents"), 2); + } - histos.fill(HIST("Event/posZ"), collision.posZ()); - histos.fill(HIST("Event/centFT0M"), centrality); + colCuts.fillQA(collision); fillHistograms(collision, tracks, tracks); } @@ -1087,7 +1044,7 @@ struct Lambda1520analysisinpp { void processRotational(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { - if (!isSelected(collision, false)) // Default event selection + if (!colCuts.isSelected(collision, false)) // Default event selection return; if (!collision.isInelGt0()) // <-- @@ -1101,13 +1058,21 @@ struct Lambda1520analysisinpp { aod::McCollisions const&, MCTrackCandidates const& tracks, aod::McParticles const&) { - if (!isSelected(collision)) + if (!colCuts.isSelected(collision)) return; - auto centrality = centEst(collision); + if (cFilladditionalQAeventPlots) { + histos.fill(HIST("QAevent/hEventsMC"), 1); + } + + if (!collision.isInelGt0()) // <-- + return; + + if (cFilladditionalQAeventPlots) { + histos.fill(HIST("QAevent/hEventsMC"), 2); + } - histos.fill(HIST("Event/posZ"), collision.posZ()); - histos.fill(HIST("Event/centFT0M"), centrality); + colCuts.fillQA(collision); fillHistograms(collision, tracks, tracks); } @@ -1117,7 +1082,7 @@ struct Lambda1520analysisinpp { void processMCGen(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { - bool isInAfterAllCuts = isSelected(collision, false); + 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(); @@ -1289,10 +1254,10 @@ struct Lambda1520analysisinpp { // 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 + if (!colCuts.isSelected(collision1, false)) // Default event selection continue; - if (!isSelected(collision2, false)) // Default event selection + if (!colCuts.isSelected(collision2, false)) // Default event selection continue; if (!collision1.isInelGt0()) // <-- @@ -1319,199 +1284,6 @@ struct Lambda1520analysisinpp { } } 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; - }; - - 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/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 (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 5, pt, centrality); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 6, 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 (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 3, ptL, centrality, weight); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 4, ptL, centrality, weight); - - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 5, ptL, centrality, weight); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 6, ptL, centrality, weight); - } - - if (std::abs(part.pdgCode()) == kLambda0) { - - // true lambda - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 0, pt, centrality); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 1, pt, centrality); - - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 2, pt, centrality); - - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 3, pt, centrality); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 4, pt, centrality); - - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 5, pt, centrality); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 6, pt, centrality); - - float ptL = computePtL(pt, MassLambda0); - if (ptL < 0) - 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 (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 2, ptL, centrality, weight); - - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 3, ptL, centrality, weight); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 4, ptL, centrality, weight); - - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 5, ptL, centrality, weight); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 6, ptL, centrality, weight); - } - - if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { - - // true Xi - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 0, pt, centrality); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 1, pt, centrality); - - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 2, pt, centrality); - - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 3, pt, centrality); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 4, pt, centrality); - - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 5, pt, centrality); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 6, pt, centrality); - - float ptL = computePtL(pt, MassXiMinus); - if (ptL < 0) - continue; - - if (useWeight) - weight = ptL / pt; - else - weight = 1.f; - - histos.fill(HIST("Result/SignalLoss/Genxipt"), 0, ptL, centrality, weight); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 1, ptL, centrality, weight); - - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 2, ptL, centrality, weight); - - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genxipt"), 3, ptL, centrality, weight); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 4, ptL, centrality, weight); - - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genxipt"), 5, ptL, centrality, weight); - - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 6, ptL, centrality, weight); - } - } - } - PROCESS_SWITCH(Lambda1520analysisinpp, processSignalLoss, "Process SignalLoss", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx index d2802812064..64dd2ed25f9 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx @@ -181,9 +181,6 @@ 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; @@ -338,16 +335,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) { @@ -405,7 +402,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 (doprocessMEMicro) { + if (doprocessMEDF || 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}); } @@ -467,9 +464,6 @@ 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}); @@ -484,9 +478,6 @@ 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}); @@ -501,9 +492,6 @@ 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"}}); } } @@ -564,12 +552,6 @@ 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; @@ -873,9 +855,6 @@ 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(); @@ -927,8 +906,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); @@ -941,9 +920,6 @@ 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); } } @@ -1006,8 +982,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); @@ -1020,9 +996,6 @@ 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) { @@ -1176,9 +1149,6 @@ 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(); @@ -1200,8 +1170,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); @@ -1215,9 +1185,6 @@ 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)) { @@ -1349,10 +1316,13 @@ struct Xi1530Analysisqa { if (!pass1 || !pass2) continue; - if (part.pdgCode() > 0) - histos.fill(HIST("h3Xi1530Gen"), part.pt(), inCent, multiplicity); - else - histos.fill(HIST("h3Xi1530GenAnti"), part.pt(), inCent, multiplicity); + 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); + } } } @@ -1406,33 +1376,31 @@ struct Xi1530Analysisqa { fillHistograms(collision1, inCent, tracks1, tracks2); } } - // void processMEDF(aod::ResoCollisionDFs const& resoCollisions, aod::ResoTrackDFs const& resotracks, aod::ResoCascadeDFs const& cascTracks) - // { - - /* Will be implemented once the DataFrame for cascade is ready. */ + void processMEDF(aod::ResoCollisionDFs const& resoCollisions, aod::ResoTrackDFs const& resotracks, aod::ResoCascadeDFs const& cascTracks) + { - // auto tracksTuple = std::make_tuple(resotracks, cascTracks); + auto tracksTuple = std::make_tuple(resotracks, cascTracks); - // BinningTypeVtxZT0M colBinning{{mixingConfig.cfgVtxBins, mixingConfig.cfgMultBins}, true}; - // Pair pairs{colBinning, mixingConfig.nEvtMixing, -1, resoCollisions, tracksTuple, &cache}; + BinningTypeVtxZT0M colBinning{{mixingConfig.cfgVtxBins, mixingConfig.cfgMultBins}, true}; + Pair pairs{colBinning, mixingConfig.nEvtMixing, -1, resoCollisions, tracksTuple, &cache}; - // for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { + 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); - // } - // } + 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) diff --git a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx index 0cf6ba274e5..098251faf28 100644 --- a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx +++ b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx @@ -243,8 +243,6 @@ struct cascpostprocessing { bool isCorrectlyRec = 0; for (auto& candidate : mycascades) { - isCandidate = false; - isCorrectlyRec = false; switch (evSelFlag) { case 1: { diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 1f3ea1b9cb5..28a6759f51e 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -125,7 +125,6 @@ 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 @@ -1003,18 +1002,10 @@ 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) @@ -1135,29 +1126,6 @@ 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}); @@ -2106,34 +2074,18 @@ 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 (doSecondaryV0s) { - histos.fill(HIST("h3dMassSecLambdaFromXi"), centrality, pt, v0.mLambda()); - } - } - if (v0mother.pdgCode() == PDG_t::kXiMinus || v0mother.pdgCode() == o2::constants::physics::Pdg::kXi0) { + 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 (doSecondaryV0s) { - histos.fill(HIST("h3dMassSecAntiLambdaFromXi"), centrality, pt, v0.mAntiLambda()); - } - } - if (v0mother.pdgCode() == PDG_t::kXiPlusBar || v0mother.pdgCode() == -o2::constants::physics::Pdg::kXi0) { + 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()); - } - } } } } @@ -2950,28 +2902,6 @@ 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) { @@ -2990,34 +2920,6 @@ 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); - } - } } } diff --git a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx index 9f340ebbf6c..6b43f823c12 100644 --- a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx @@ -65,17 +65,18 @@ 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"}; @@ -167,13 +168,6 @@ 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; @@ -219,8 +213,6 @@ 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 @@ -276,7 +268,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", {7, -1.5, 5.5}, "Gap side"}; + ConfigurableAxis axisSelGap{"axisSelGap", {4, -1.5, 2.5}, "Gap side"}; // AP plot axes ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; @@ -305,8 +297,6 @@ 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) { @@ -941,22 +931,6 @@ 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}); @@ -981,7 +955,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, {axisSelGap}); + histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {{5, -0.5, 4.5}}); } if (doprocessV0sMC) { @@ -1075,163 +1049,11 @@ struct Derivedupcanalysis { } } - template - int applyZDCTiming(int selGapSide, TCollision const& collision) - { - 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())); + int selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + return selGapSide; } template @@ -1269,26 +1091,14 @@ 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 @@ -2058,13 +1868,13 @@ struct Derivedupcanalysis { } } - const bool passStd = !evSels.studyUPConly || (selGapSide == static_cast(upcCuts.genGapSide)); - if (passStd) { - ++nCollisions; - atLeastOne = true; - } + if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) + continue; - if (passStd && biggestNContribs < collision.multPVTotalContributors()) { + ++nCollisions; + atLeastOne = true; + + if (biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); if (static_cast(upcCuts.genGapSide) == 0) { ft0ampl = collision.totalFT0AmplitudeC(); @@ -2136,9 +1946,6 @@ 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; @@ -2195,9 +2002,6 @@ 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; @@ -2283,9 +2087,6 @@ 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; @@ -2338,9 +2139,6 @@ 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; diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index c0a43472ed2..0c0c04f1448 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -86,8 +86,6 @@ 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"}; @@ -1914,7 +1912,7 @@ struct HStrangeCorrelation { if (fillHists) histos.fill(HIST("hEventSelection"), 1.5 /* collisions after sel8*/); - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && masterConfigurations.requireGoodTriggerTVX) { + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) { return false; } if (fillHists) @@ -1926,14 +1924,14 @@ struct HStrangeCorrelation { if (fillHists) histos.fill(HIST("hEventSelection"), 3.5 /* collisions after sel pvz sel*/); - if (!collision.selection_bit(aod::evsel::kIsGoodITSLayersAll) && masterConfigurations.requireAllGoodITSLayers) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { // 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) && masterConfigurations.requireGoodZvtxFT0vsPV) { + 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 false; diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index c181e4293c0..50c891f43f2 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -90,7 +90,6 @@ struct lambdapolsp { TH1D* hwgtAL; TH1D* heffL; TH1D* heffAL; - TH1D* hwgtRESO; // fill output struct : ConfigurableGroup { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; @@ -155,16 +154,13 @@ 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"}; @@ -217,13 +213,12 @@ 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"}; @@ -235,8 +230,6 @@ 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; @@ -443,7 +436,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); @@ -466,13 +459,6 @@ 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); @@ -513,12 +499,8 @@ 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); - 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); + heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); + heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.value, cfgCcdbParam.nolaterthan.value); } template @@ -751,7 +733,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 resowgt) + double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor) { TRandom3 randPhi(0); @@ -779,11 +761,6 @@ 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; @@ -1008,10 +985,7 @@ 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); @@ -1025,7 +999,6 @@ struct lambdapolsp { } auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane*/ - /*if (useonlypsis) { psiZDC = psiZDCC - psiZDCA; }*/ @@ -1070,15 +1043,6 @@ 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) { @@ -1298,7 +1262,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()); @@ -1308,16 +1272,9 @@ 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());*/ - 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()); + histos.fill(HIST("hptneglambda"), AntiPion.Pt()); } - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); } tagb = aLambdaTag; @@ -1332,7 +1289,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()); @@ -1342,16 +1299,9 @@ 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());*/ - 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()); + histos.fill(HIST("hptnegantilambda"), AntiProton.Pt()); } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue, resowgt); + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); } } } @@ -1424,10 +1374,7 @@ 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); @@ -1504,14 +1451,6 @@ 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) { @@ -1570,7 +1509,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, resowgt); + fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0); } int binxwgt; @@ -1605,18 +1544,8 @@ struct lambdapolsp { } else { acvalue = 1.0; } - - 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); + // double acvalue = 1.0; + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL)); } tagb = aLambdaTag; @@ -1631,18 +1560,7 @@ struct lambdapolsp { } else { acvalue = 1.0; } - - 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); + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL)); } } // lastRunNumber = currentRunNumber; diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index bb7e91da1f0..e5f7a59e3d4 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -195,22 +195,25 @@ struct lambdaspincorrderived { TH3D* hweight22; TH3D* hweight32; TH3D* hweight42; + TH2D* hweightCentPair = nullptr; - // ---------- NUA single-particle weights in (phi, eta) ---------- - TH2D* hNUALambda = nullptr; - TH2D* hNUAAntiLambda = nullptr; - + Configurable ConfWeightPathCentPair{"ConfWeightPathCentPair", "", "Centrality x pair-type weight path"}; 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"}; - 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)"}; + + // 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> 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"}; @@ -237,6 +240,8 @@ 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"}; @@ -281,21 +286,14 @@ 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("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}}); + 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); @@ -318,6 +316,27 @@ 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); @@ -387,16 +406,8 @@ struct lambdaspincorrderived { hweight32 = ccdb->getForTimeStamp(ConfWeightPathALL2.value, cfgCcdbParam.nolaterthan.value); hweight42 = ccdb->getForTimeStamp(ConfWeightPathALAL2.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()); - } + if (!ConfWeightPathCentPair.value.empty()) { + hweightCentPair = ccdb->getForTimeStamp(ConfWeightPathCentPair.value, cfgCcdbParam.nolaterthan.value); } } @@ -474,26 +485,6 @@ 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, @@ -568,10 +559,6 @@ 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); @@ -596,10 +583,18 @@ struct lambdaspincorrderived { } if (datatype == 0) { - const double weight = pairNUAWeight; + const double weight = 1.0; + if (tag1 == 0 && tag2 == 0) { - histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), nuaWeight1); - histos.fill(HIST("hPhiEtaSame"), dphi1, particle1.Eta(), nuaWeight1); + 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("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) { @@ -608,6 +603,13 @@ 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) { @@ -616,6 +618,13 @@ 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) { @@ -624,6 +633,13 @@ 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) { @@ -643,15 +659,26 @@ struct lambdaspincorrderived { } weight = mixpairweight / epsWeightReplaced; } - weight *= pairNUAWeight; + if (!std::isfinite(weight) || weight <= 0.0) { return; } if (tag1 == 0 && tag2 == 0) { if (replacedLeg == 1) { - histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), nuaWeight1 * mixpairweight); - histos.fill(HIST("hPhiEtaMix"), dphi1, particle1.Eta(), nuaWeight1 * mixpairweight); + 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("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); @@ -662,6 +689,19 @@ 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) { @@ -669,7 +709,21 @@ 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) { @@ -677,7 +731,21 @@ 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) { @@ -740,14 +808,7 @@ 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; @@ -760,7 +821,8 @@ 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()); + const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); + histos.fill(HIST("hCentPairTypeSE"), collision.cent(), ptype, 1.0); if (v0.v0Status() == 0 && v02.v0Status() == 0) { fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0); } @@ -1277,11 +1339,6 @@ 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()) { @@ -1301,7 +1358,8 @@ struct lambdaspincorrderived { RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02), -TMath::Pi(), harmonicDphi)); - // const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); + const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); + histos.fill(HIST("hCentPairTypeSE"), mcacc::cent(collision), ptype, 1.0); // datatype=0 (same event) fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02), lambda, lambda2, proton, proton2, @@ -1311,6 +1369,175 @@ 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) @@ -1328,16 +1555,19 @@ struct lambdaspincorrderived { { return std::abs(deltaPhiMinusPiToPi(phiA, phiB)); } - // symmetric neighbors for phi: no wrap at edge + + // symmetric neighbors for phi: periodic wrap 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) { - const int bb = b + d; - if (bb >= 0 && bb < nPhi) { - out.push_back(bb); + int bb = b + d; + bb %= nPhi; + if (bb < 0) { + bb += nPhi; } + out.push_back(bb); } std::sort(out.begin(), out.end()); out.erase(std::unique(out.begin(), out.end()), out.end()); @@ -1748,11 +1978,21 @@ 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()); + 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 float meWeight = wSE; + const float meWeight = wSE * centPairWeight; 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); } } @@ -1781,10 +2021,21 @@ 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()); - const float meWeight = wSE; + 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 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); } } @@ -2120,10 +2371,21 @@ 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)); - const float meWeight = wSE; + 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 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); @@ -2158,10 +2420,21 @@ 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)); - const float meWeight = wSE; + 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 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); diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 4b828a18bd3..6639404d334 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -182,21 +182,17 @@ struct NonPromptCascadeTask { Produces NPCTableNT; Produces NPCTableMCNT; Produces NPCTableGen; - // - Produces NPCollsTable; - Produces NPMCNTable; - Produces NPRecoCandTable; + Produces NPPUTable; + Produces NPMCNTable; 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; - Preslice perCollisionSel = aod::track::collisionId; HistogramRegistry mRegistry; @@ -223,7 +219,6 @@ 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"}; @@ -333,9 +328,8 @@ struct NonPromptCascadeTask { // dN/deta // bool runMCdNdeta = context.options().get("processdNdetaMC"); - bool rundNdeta = context.options().get("processdNdeta"); // std::cout << "runMCdNdeta: " << runMCdNdeta << std::endl; - if (runMCdNdeta || rundNdeta) { + if (runMCdNdeta) { std::vector ptBins; std::vector tokens = o2::utils::Str::tokenize(cfgPtEdgesdNdeta, ','); for (auto const& pts : tokens) { @@ -347,14 +341,13 @@ struct NonPromptCascadeTask { } ptBins.push_back(pt); } - AxisSpec ptAxisReco{ptBins, "pT Reco"}; AxisSpec ptAxisMC{ptBins, "pT MC"}; + AxisSpec ptAxisReco{ptBins, "pT Reco"}; // 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}); } } @@ -424,10 +417,12 @@ 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 runNumber = mRunNumber; + float run = mRunNumber; float numContrib = coll.numContrib(); - mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, runNumber); + mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, run); } }; @@ -814,10 +809,6 @@ 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 //-------------------------------------------------------------- @@ -830,7 +821,7 @@ struct NonPromptCascadeTask { // apply your primary/eta/charge definition here if (!mcp.isPhysicalPrimary()) continue; - if (std::abs(mcp.eta()) > cfgEtaCutdNdeta) + if (std::abs(mcp.eta()) > 0.5f) continue; int q = 0; if (auto pdg = pdgDB->GetParticle(mcp.pdgCode())) { @@ -867,7 +858,7 @@ struct NonPromptCascadeTask { // ------------------------------------------------------------ std::vector recoMultDense(colls.size(), 0); for (auto const& trk : tracks) { - if (std::abs(trk.eta()) > cfgEtaCutdNdeta) { + if (std::abs(trk.eta()) > 0.5f) { continue; } const int collRowId = trk.collisionId(); @@ -895,7 +886,7 @@ struct NonPromptCascadeTask { // ------------------------------------------------------------ for (auto const& trk : tracks) { // Accept reco track - if (std::abs(trk.eta()) > cfgEtaCutdNdeta) { + if (std::abs(trk.eta()) > 0.5f) { continue; } @@ -939,7 +930,7 @@ struct NonPromptCascadeTask { if (!mcPar.isPhysicalPrimary()) { continue; } - if (std::abs(mcPar.eta()) > cfgEtaCutdNdeta) { + if (std::abs(mcPar.eta()) > 0.5f) { continue; } @@ -960,10 +951,7 @@ struct NonPromptCascadeTask { const float ptMC = mcPar.pt(); mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRM"), mult, multReco, ptMC, ptReco); - if (ds % cfgDownscaleMB == 0) { - NPMCNTable(ptMC, ptReco, mult, multReco); - } - ds++; + NPMCNTable(ptMC, ptReco, mult, multReco); } // ------------------------------------------------------------ @@ -993,54 +981,6 @@ struct NonPromptCascadeTask { } PROCESS_SWITCH(NonPromptCascadeTask, processdNdetaMC, "process mc dN/deta", false); - // - void processdNdeta(CollisionCandidatesRun3 const& collisions, TracksWithSel const& tracks, aod::BCsWithTimestamps const&) - { - 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, - globalBC, - coll.numContrib(), - coll.multNTracksGlobal(), - coll.centFT0M(), - coll.multFT0M()); - - auto collIdx = NPCollsTable.lastIndex(); - auto tracksThisColl = tracks.sliceBy(perCollisionSel, coll.globalIndex()); - float multreco = 0.; - // std::cout << "tracks:" << tracksThisColl.size() << std::endl; - for (auto const& track : tracksThisColl) { - // std::cout << track.pt() << " tracks " << track.isGlobalTrack() << std::endl; - if (std::fabs(track.eta()) < cfgEtaCutdNdeta && track.tpcNClsFound() >= 80 && track.tpcNClsCrossedRows() >= 100) { - if (track.isGlobalTrack()) { - multreco++; - NPRecoCandTable(collIdx, track.pt()); - } - } - } - mRegistrydNdeta.fill(HIST("hdNdetaData"), multreco); - } - } - } - PROCESS_SWITCH(NonPromptCascadeTask, processdNdeta, "process dN/deta", false); void processPileUp(CollisionCandidatesRun3 const& collisions, aod::BCsWithTimestamps const&) { @@ -1067,7 +1007,7 @@ struct NonPromptCascadeTask { } float centFT0M = coll.centFT0M(); float multFT0M = coll.multFT0M(); - NPCollsTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); + NPPUTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); } } }; diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 05074ea22df..30cacfa6002 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -158,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", kDeltaYvsDeltaPhi, "Analysis mode: 0 - old method with online normalization, 1 - new method with offline normlization, 2 - deltay vs deltaphi"}; + 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 @@ -174,13 +173,13 @@ struct PhiStrangenessCorrelation { // Configurables for K0s selection struct : ConfigurableGroup { - Configurable selectK0sInSigRegion{"selectK0sInSigRegion", true, "Select K0s candidates in signal region"}; + Configurable selectK0sInSigRegion{"selectK0sInSigRegion", false, "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", true, "Select Pion candidates in signal region"}; + 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"}; @@ -261,24 +260,6 @@ 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&) { @@ -335,12 +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("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); @@ -352,8 +327,6 @@ struct PhiStrangenessCorrelation { loadEfficiencyMapFromCCDB(static_cast(i)); } } - - eventBuffer.resize(binsMult->size() - 1); } void loadEfficiencyMapFromCCDB(ParticleOfInterest poi) @@ -381,15 +354,6 @@ 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) { @@ -834,218 +798,6 @@ 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; - }; - - // 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; - - 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; - - // 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; - - 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)); - } - }); - } - - // Mixed Event Correlations - 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) diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 8e0b65f125a..9c37b4a8b1b 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -41,8 +41,10 @@ #include "ReconstructionDataFormats/Track.h" #include +#include #include #include +#include #include #include @@ -58,10 +60,8 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using Sigma0s = soa::Join; using MCSigma0s = soa::Join; -using Sigma0sWithEMCal = soa::Join; -using MCSigma0sWithEMCal = soa::Join; +using Sigma0s = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", "DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT", @@ -88,6 +88,10 @@ struct sigmaanalysis { ctpRateFetcher rateFetcher; //__________________________________________________ + // For manual sliceBy + // SliceCache cache; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Event level @@ -216,23 +220,6 @@ 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"}; @@ -256,7 +243,6 @@ 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}"}; @@ -291,13 +277,6 @@ 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 @@ -307,7 +286,7 @@ struct sigmaanalysis { void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithEMCal + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -354,52 +333,33 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { + if (doprocessRealData || doprocessMonteCarlo) { for (const auto& histodir : DirList) { if (fillSelhistos) { - - 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 + "/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}); histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); @@ -440,6 +400,8 @@ 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}); @@ -449,21 +411,22 @@ 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 || doprocessMonteCarloWithEMCal) { + if (doprocessMonteCarlo) { 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}); - - 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/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}); histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); @@ -478,6 +441,8 @@ 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}); @@ -500,17 +465,19 @@ 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}); - // pT Resolution: - if (fillResoQAhistos) { - histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); - histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + // 1/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/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/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); - histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); + 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/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}); } @@ -784,21 +751,12 @@ 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 (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + for (auto const& collision : groupedCollisions) { // 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; @@ -823,14 +781,6 @@ 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) { @@ -848,14 +798,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 (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { - auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + for (auto const& collision : groupedCollisions) { if (!IsEventAccepted(collision, false)) { continue; @@ -976,16 +926,14 @@ struct sigmaanalysis { int TrkCode = 10; // 1: TPC-only, 2: TPC+Something, 3: ITS-Only, 4: ITS+TPC + Something, 10: anything else if (isGamma) { - 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; - } + 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; @@ -1000,55 +948,51 @@ 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() == PDG_t::kGamma) { + if (sigma.photonPDGCode() == 22) { if (sigma.photonmcpt() > 0) { - 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 + 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 } } //_______________________________________ // Lambda MC association - if (sigma.lambdaPDGCode() == PDG_t::kLambda0) { + if (sigma.lambdaPDGCode() == 3122) { if (sigma.lambdamcpt() > 0) { - 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 + 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 } } //_______________________________________ // AntiLambda MC association - if (sigma.lambdaPDGCode() == PDG_t::kLambda0Bar) { + if (sigma.lambdaPDGCode() == -3122) { if (sigma.lambdamcpt() > 0) { - 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 + 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 } } //_______________________________________ // Sigma and AntiSigma MC association if (sigma.isSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) { - 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 - } + 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.isAntiSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -1072,24 +1016,24 @@ struct sigmaanalysis { //_______________________________________ // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! - if ((PhotonPDGCode == PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar)) && (!fIsSigma && !fIsAntiSigma)) { + if ((PhotonPDGCode == 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122)) && (!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 == PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) + if ((PhotonPDGCode == 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Real Lambda - if ((PhotonPDGCode != PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar))) + if ((PhotonPDGCode != 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122))) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Fake Lambda - if ((PhotonPDGCode != PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) + if ((PhotonPDGCode != 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeDaughters"), sigmapT, sigmaMass); } @@ -1100,61 +1044,39 @@ 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) { - - // 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()); - } + //_______________________________________ + // 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()); //_______________________________________ // Lambdas @@ -1172,12 +1094,13 @@ 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()); @@ -1196,6 +1119,8 @@ 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) { @@ -1215,30 +1140,31 @@ 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()); } //_______________________________________ // MC specific - if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { + if (doprocessMonteCarlo) { if constexpr (requires { sigma.lambdaPDGCode(); sigma.photonPDGCode(); }) { if (fillSelhistos) { //_______________________________________ // 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()); - if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + 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()); } } @@ -1265,6 +1191,9 @@ 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()); @@ -1282,6 +1211,9 @@ 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()); @@ -1302,8 +1234,8 @@ struct sigmaanalysis { //_______________________________________ // pT resolution histos - if (fillResoQAhistos) - getResolution(sigma); + if ((mode == 0) && fillResoQAhistos) + getResolution(sigma); } } } @@ -1450,48 +1382,6 @@ 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) @@ -1602,15 +1492,8 @@ struct sigmaanalysis { bool processSigma0Candidate(TSigma0Object const& cand) { // Photon specific selections - 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; - } + if (!selectPhoton(cand)) + return false; // Lambda specific selections if (!selectLambda(cand)) @@ -1656,7 +1539,7 @@ struct sigmaanalysis { for (const auto& coll : collisions) { // Event selection - if (!IsEventAccepted(coll, true)) // TODO: Should I Add event selection for events without EMCal? + if (!IsEventAccepted(coll, true)) continue; // Sigma0s loop @@ -1838,21 +1721,11 @@ 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) { @@ -1878,9 +1751,7 @@ 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); diff --git a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx index 4f2c3dea4d0..44eb59d507e 100644 --- a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx +++ b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx @@ -65,7 +65,6 @@ struct StrangeCascTrack { PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; PresliceUnsorted cascsPerMcCollision = aod::cascdata::straMCCollisionId; - Preslice cascsPerCollision = aod::cascdata::straCollisionId; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -88,33 +87,24 @@ 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.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 10}, "p_{T} (GeV/c)"}; + 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 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 selections + // event and dau track selection struct : ConfigurableGroup { - std::string prefix = "eventSelections"; + // event cuts 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"}; - 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"; + // cascade cuts 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"}; @@ -123,9 +113,10 @@ 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.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 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"}; @@ -145,7 +136,7 @@ struct StrangeCascTrack { // TOF PID selection Configurable cutNSigmaTOFXi{"cutNSigmaTOFXi", 3, "cutNSigmaTOFXi"}; Configurable cutNSigmaTOFOmega{"cutNSigmaTOFOmega", 3, "cutNSigmaTOFOmega"}; - } cascCuts; + } selCuts; // cascade reconstruction Types static constexpr std::string_view TypeNames[] = {"Standard", "Tracked"}; @@ -169,65 +160,44 @@ struct StrangeCascTrack { { bool passedAllSels = true; //* inel>0 cut - if (!eventCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { + if (!selCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 0.5); } else { passedAllSels = false; } //* pvz cut - if (std::abs(collision.posZ()) < eventCuts.cutZVertex) { + if (std::abs(collision.posZ()) < selCuts.cutZVertex) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 1.5); } else { passedAllSels = false; } //* sel8 cut - if (!eventCuts.cutDoSel8 || collision.sel8()) { + if (!selCuts.cutDoSel8 || collision.sel8()) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 2.5); } else { passedAllSels = false; } //* pileup cut - if (!eventCuts.cutDoNoPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (!selCuts.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 (!eventCuts.cutDoGoodFT0 || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (!selCuts.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"), 8.5); + histos.fill(HIST("Rec-Events/EvFilter"), 5.5); } return passedAllSels; } @@ -239,20 +209,20 @@ struct StrangeCascTrack { double ptMin = 0.0; double ptMax = 0.0; if (Type == 1 && particle == "Xi") { - ptMin = cascCuts.cutMinPtXiTra; - ptMax = cascCuts.cutMaxPtXiTra; + ptMin = selCuts.cutMinPtXiTra; + ptMax = selCuts.cutMaxPtXiTra; } if (Type == 1 && particle == "Omega") { - ptMin = cascCuts.cutMinPtOmegaTra; - ptMax = cascCuts.cutMaxPtOmegaTra; + ptMin = selCuts.cutMinPtOmegaTra; + ptMax = selCuts.cutMaxPtOmegaTra; } if (Type == 0 && particle == "Xi") { - ptMin = cascCuts.cutMinPtXiStd; - ptMax = cascCuts.cutMaxPtXiStd; + ptMin = selCuts.cutMinPtXiStd; + ptMax = selCuts.cutMaxPtXiStd; } if (Type == 0 && particle == "Omega") { - ptMin = cascCuts.cutMinPtOmegaStd; - ptMax = cascCuts.cutMaxPtOmegaStd; + ptMin = selCuts.cutMinPtOmegaStd; + ptMax = selCuts.cutMaxPtOmegaStd; } if (cascade.pt() < ptMin || cascade.pt() > ptMax) passedSel = false; @@ -270,7 +240,7 @@ struct StrangeCascTrack { y = std::abs(cascade.yXi()); else y = std::abs(cascade.yOmega()); - if (y > cascCuts.cutRapidity) { + if (y > selCuts.cutRapidity) { passedRapidity = false; passedAllSels = false; } @@ -279,7 +249,7 @@ struct StrangeCascTrack { double bachEta = std::abs(cascade.bacheloreta()); double negEta = std::abs(cascade.negativeeta()); double posEta = std::abs(cascade.positiveeta()); - if (bachEta > cascCuts.cutDauEta || negEta > cascCuts.cutDauEta || posEta > cascCuts.cutDauEta) { + if (bachEta > selCuts.cutDauEta || negEta > selCuts.cutDauEta || posEta > selCuts.cutDauEta) { passedDauEta = false; passedAllSels = false; } @@ -291,21 +261,21 @@ struct StrangeCascTrack { double posCls = posTrack.tpcClusters(); double negCls = negTrack.tpcClusters(); double bachCls = bachTrack.tpcClusters(); - if (posCls < cascCuts.cutNClsTPC || negCls < cascCuts.cutNClsTPC || bachCls < cascCuts.cutNClsTPC) { + if (posCls < selCuts.cutNClsTPC || negCls < selCuts.cutNClsTPC || bachCls < selCuts.cutNClsTPC) { passedTPCCls = false; passedAllSels = false; } // V0 cosPA bool passedV0CosPA = true; double v0cospa = cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - if (v0cospa < cascCuts.cutMinV0CosPA || v0cospa > cascCuts.cutMaxV0CosPA) { + if (v0cospa < selCuts.cutMinV0CosPA || v0cospa > selCuts.cutMaxV0CosPA) { passedV0CosPA = false; passedAllSels = false; } // Bachelor cosPA bool passedBachCosPA = true; double bachcospa = stdcasc.bachBaryonCosPA(); - if (bachcospa < cascCuts.cutMinBachCosPA || bachcospa > cascCuts.cutMaxBachCosPA) { + if (bachcospa < selCuts.cutMinBachCosPA || bachcospa > selCuts.cutMaxBachCosPA) { passedBachCosPA = false; passedAllSels = false; } @@ -314,22 +284,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(cascCuts.cutMinCascCosPaVsPt->size())) { + if (ptBin < 0 || ptBin >= static_cast(selCuts.cutMinCascCosPaVsPt->size())) { ptBin = 1; } // safety check - if pt bin not determined, default to loosest cut - if (casccospa < cascCuts.cutMinCascCosPaVsPt->at(ptBin)) { + if (casccospa < selCuts.cutMinCascCosPaVsPt->at(ptBin)) { passedCascCosPA = false; passedAllSels = false; } // Propagated cacade DCAxy to PV bool passedPropDCAxy = true; - if (cascCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > cascCuts.cutPropDCAtoPVxy) { + if (selCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > selCuts.cutPropDCAtoPVxy) { passedPropDCAxy = false; passedAllSels = false; } // Propagated cacade DCAz to PV bool passedPropDCAz = true; - if (cascCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > cascCuts.cutPropDCAtoPVz) { + if (selCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > selCuts.cutPropDCAtoPVz) { passedPropDCAz = false; passedAllSels = false; } @@ -344,25 +314,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()) > cascCuts.cutNSigmaTPCProton) { + if (std::abs(posTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(negTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { + if (std::abs(negTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { passedSel = false; } } else { - if (std::abs(negTrack.tpcNSigmaPr()) > cascCuts.cutNSigmaTPCProton) { + if (std::abs(negTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(posTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { + if (std::abs(posTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { passedSel = false; } } @@ -374,9 +344,9 @@ struct StrangeCascTrack { { bool passedSel = true; if (particle == "Xi") - passedSel = cascade.tofXiCompatibility(cascCuts.cutNSigmaTOFXi); + passedSel = cascade.tofXiCompatibility(selCuts.cutNSigmaTOFXi); if (particle == "Omega") - passedSel = cascade.tofOmegaCompatibility(cascCuts.cutNSigmaTOFOmega); + passedSel = cascade.tofOmegaCompatibility(selCuts.cutNSigmaTOFOmega); return passedSel; } // checks whether gen cascade corresponds to PDG code @@ -405,373 +375,357 @@ 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 - void analyseCascade(TEvent collision, TCasc cascade) + template + void analyseCascs(TEvent collision, TCascs cascades) { - if constexpr (requires { cascade.topologyChi2(); }) { - if (!cascade.has_standardCascade()) - return; // safety check: dismisses tracked cascades without proper reference - } + int64_t casccollid = 0; + for (auto const& cascade : cascades) { - // 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(); + 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.template standardCascade_as(); + return cascade; } - } else { - return cascade; - } - }(); + }(); - // Type 1 for tracked cascades, Type 0 for standard - static constexpr int Type = [&]() { - if constexpr (requires { cascade.topologyChi2(); }) { - return 1; - } else { - return 0; - } - }(); + // Type 1 for tracked cascades, Type 0 for standard + static constexpr int Type = [&]() { + if constexpr (requires { cascade.topologyChi2(); }) { + return 1; + } else { + return 0; + } + }(); - double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); // ion collisions use FT0C for multiplicity, pp uses both + 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 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); + // 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); + } } - 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); + casccollid = collision.index(); + } + + 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")) { + 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(); }) { - if (isMCTruth(stdCasc, "Xi")) { - fillTruthXi = true; + // 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 constexpr (requires { collision.straMCCollisionId(); }) { - if (isMCTruth(stdCasc, "Omega")) { - fillTruthOmega = true; + if constexpr (requires { collision.straMCCollisionId(); }) { + if (isMCTruth(stdCasc, "Omega")) { + fillTruthOmega = true; + } } - } - // 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; + // 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 (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 (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 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)); + // 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/GenFiltersXi"), (i + 0.5)); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 1.5); + } else { + passedAllSelsXi = false; } } - 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 (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/GenFiltersOmega"), (i + 0.5)); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 1.5); + } else { + passedAllSelsOmega = 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; - } - } - // 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 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; + } } - } - 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; + 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; + } } - } - // 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; + // 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; + 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; + // apply competing mass rej + if (doCompetingMassRej) { + if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > selCuts.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); + // 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()); + } + } + double binFillXi[3] = {massXi, pt, mult}; 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()); + 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); + // 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); + } + 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); + } + // 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); + } } + double binFillOmega[3] = {massOmega, pt, mult}; 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/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()); + 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); + // 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); + } + 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); + } + // 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); + } } - } - // 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); + // 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()); if (fillTruthXi || fillTruthOmega) - 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 (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); - } + 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); } - } - 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 (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 (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); - } + 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()); } } } } } - 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 - if (cascCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { + if (selCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { LOGF(fatal, "cutMinCascCosPaVsPt size does not match axisPt binning"); } // for all events processing @@ -784,16 +738,13 @@ 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, {{9, 0, 9}}); + histos.add("Rec-Events/EvFilter", "Event Filter", kTH1D, {{6, 0, 6}}); 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, "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"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(6, "all"); // for cascade processing static_for<0, 1>([&](auto Type) { // no selections applied @@ -807,6 +758,7 @@ 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}}); @@ -821,24 +773,12 @@ 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}); @@ -850,6 +790,7 @@ 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}}); @@ -859,18 +800,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()), "", 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}); + 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}); // 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()), "", 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}); + 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}); // 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}); @@ -881,6 +822,7 @@ 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}}); @@ -892,25 +834,6 @@ 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}}); - /// - 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: @@ -943,8 +866,6 @@ 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"); @@ -1082,8 +1003,6 @@ 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); @@ -1105,7 +1024,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)) < cascCuts.cutRapidity) { + if (isValidPDG(casc, "Xi") && std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryXiRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kXiMinus) histos.fill(HIST("MC/Gen/PrimaryXiMinusRapidity"), genMult, cascPt); @@ -1113,7 +1032,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)) < cascCuts.cutRapidity) { + if (isValidPDG(casc, "Omega") && std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryOmegaRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kOmegaMinus) histos.fill(HIST("MC/Gen/PrimaryOmegaMinusRapidity"), genMult, cascPt); @@ -1159,9 +1078,8 @@ struct StrangeCascTrack { if (casc.isPhysicalPrimary()) { if (isValidPDG(casc, "Xi")) { histos.fill(HIST("MC/EvRec/PrimaryXi"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(0)) < cascCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(0)) < selCuts.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) @@ -1170,9 +1088,8 @@ struct StrangeCascTrack { } if (isValidPDG(casc, "Omega")) { histos.fill(HIST("MC/EvRec/PrimaryOmega"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(2)) < cascCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(2)) < selCuts.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) @@ -1190,30 +1107,17 @@ struct StrangeCascTrack { } } - std::vector> traCascsGrouped; - void processDerivedMCRec(DerMCRecCollisions const& collisions, DerMCRecCascDatas const& allCascs, DerMCRecTraCascDatas const& traCascs, DauTracks const&, DerMCGenCascades const&) + void processDerivedMCRec(DerMCRecCollisions::iterator const& collision, DerMCRecCascDatas const& allCascs, DerMCRecTraCascDatas const& traCascs, DauTracks const&, DerMCGenCascades const&) { - // 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); - } - } + 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 } } diff --git a/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx b/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx index 9694d86cc4f..cefeec99ce6 100644 --- a/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx +++ b/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx @@ -458,10 +458,6 @@ 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}); @@ -1221,6 +1217,8 @@ 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; @@ -1229,31 +1227,14 @@ struct StrangenessInJetsIons { TVector3 vtxPos(collision.posX(), collision.posY(), collision.posZ()); // K0s - if (passedK0ShortSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kK0Short) { - 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_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) + // Lambda if (passedLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0) { registryMC.fill(HIST("Lambda_reconstructed_MB"), multiplicity, v0.pt()); } - // AntiLambda (primary) + // AntiLambda if (passedAntiLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0Bar) { registryMC.fill(HIST("AntiLambda_reconstructed_MB"), multiplicity, v0.pt()); } diff --git a/PWGMM/Lumi/Tasks/CMakeLists.txt b/PWGMM/Lumi/Tasks/CMakeLists.txt index 000f831a5c8..5bd93ae27d8 100644 --- a/PWGMM/Lumi/Tasks/CMakeLists.txt +++ b/PWGMM/Lumi/Tasks/CMakeLists.txt @@ -50,8 +50,3 @@ 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/LumiFDDFT0.cxx b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx index 629c2a7078d..c5609cbbd9a 100644 --- a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx +++ b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx @@ -10,33 +10,36 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include +#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 using namespace o2; diff --git a/PWGMM/Lumi/Tasks/fitLumi.cxx b/PWGMM/Lumi/Tasks/fitLumi.cxx index 4bcc73496c9..a62771cda66 100644 --- a/PWGMM/Lumi/Tasks/fitLumi.cxx +++ b/PWGMM/Lumi/Tasks/fitLumi.cxx @@ -11,25 +11,21 @@ // author: arvind.khuntia@cern.ch -#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 "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" using namespace o2; using namespace o2::framework; @@ -115,7 +111,7 @@ struct VdMAO2D { registry.get(HIST("FT0/bcVertexCollBC"))->Fill(localBC); } } // vertex - } // ft0 + } // ft0 nTF++; } // process @@ -178,7 +174,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 b1fcd5910d5..cc0149dbde7 100644 --- a/PWGMM/Lumi/Tasks/lumi.cxx +++ b/PWGMM/Lumi/Tasks/lumi.cxx @@ -15,30 +15,43 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#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" namespace o2::aod { diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index ab1dca52f6e..976fd6d351a 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -16,32 +16,22 @@ #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 9aba4bd6837..8ad19ef30a6 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx @@ -15,38 +15,25 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#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 using namespace o2; @@ -55,9 +42,30 @@ 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"}; @@ -77,12 +85,20 @@ 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; @@ -126,7 +142,7 @@ struct LumiStabilityLightIons { kBCNSLFT0 = 11 }; - static constexpr std::string_view NBCsVsTimeHistNames[5][12] = { + static constexpr std::string_view NBCsVsTimeHistNames[6][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"}, @@ -190,7 +206,10 @@ 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}); } } } @@ -213,6 +232,19 @@ 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) @@ -385,6 +417,64 @@ 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); @@ -395,15 +485,17 @@ 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); @@ -435,8 +527,9 @@ 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); @@ -471,10 +564,12 @@ struct LumiStabilityLightIons { } } - if (anyFDDTrigger) + if (anyFDDTrigger) { globalBCIdOfLastBCWithActivityFDD = globalBCFDD; - if (anyFT0Trigger) + } + if (anyFT0Trigger) { globalBCIdOfLastBCWithActivityFT0 = globalBC; + } globalBCLastInspectedBC = globalBC; diff --git a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx index bf0cae99e81..2962148c4dc 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx @@ -17,33 +17,25 @@ #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/MetadataHelper.h" - -#include -#include -#include -#include -#include -#include -#include -#include +#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 o2::common::core::MetadataHelper metadataInfo; // Metadata helper @@ -221,7 +213,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/Tasks/lumiZdcQa.cxx b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx deleted file mode 100644 index 5ebd6d64b59..00000000000 --- a/PWGMM/Lumi/Tasks/lumiZdcQa.cxx +++ /dev/null @@ -1,158 +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. -// -/// \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/Core/MetadataHelper.h" -#include "Common/DataModel/EventSelection.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; - -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)}; -} diff --git a/PWGMM/Lumi/macros/merger.C b/PWGMM/Lumi/macros/merger.C index 1ad2cd5f920..f3759a277ef 100644 --- a/PWGMM/Lumi/macros/merger.C +++ b/PWGMM/Lumi/macros/merger.C @@ -13,15 +13,6 @@ // 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 ea858e409f0..34022f82f8b 100644 --- a/PWGMM/Lumi/macros/non_fac.C +++ b/PWGMM/Lumi/macros/non_fac.C @@ -12,21 +12,6 @@ /// \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; @@ -208,7 +193,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]); - std::cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << std::endl; + cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << 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 9528e5a84ac..c215a8ba357 100644 --- a/PWGMM/Mult/Core/include/Axes.h +++ b/PWGMM/Mult/Core/include/Axes.h @@ -11,39 +11,35 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_AXES_H_ #define PWGMM_MULT_CORE_INCLUDE_AXES_H_ - -#include -#include - -#include -#include -#include +#include "Framework/HistogramSpec.h" +#include "CommonConstants/MathConstants.h" namespace pwgmm::mult { +using namespace o2::framework; static constexpr std::string_view ptAxisName = "p_{T} (GeV/c)"; // common axis definitions -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 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 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 +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 // Large wide-binned Pt (for efficiency) -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 +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 // event selection/efficiency binning enum struct EvSelBins : int { @@ -82,5 +78,4 @@ 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 17828d1edcb..2b41c9ecefe 100644 --- a/PWGMM/Mult/Core/include/Histograms.h +++ b/PWGMM/Mult/Core/include/Histograms.h @@ -11,8 +11,7 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ #define PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ -#include - +#include "TPDGCode.h" #include #include diff --git a/PWGMM/Mult/Core/include/Selections.h b/PWGMM/Mult/Core/include/Selections.h index 8240410c462..2532da6ccce 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 o2::aod::track::TrackSelectionFlags::flagtype trackSelectionITS = - o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF | - o2::aod::track::TrackSelectionFlags::kITSHits; +static constexpr TrackSelectionFlags::flagtype trackSelectionITS = + TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | + TrackSelectionFlags::kITSHits; // default quality criteria for tracks with TPC contribution -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionTPC = - o2::aod::track::TrackSelectionFlags::kTPCNCls | - o2::aod::track::TrackSelectionFlags::kTPCCrossedRowsOverNCls | - o2::aod::track::TrackSelectionFlags::kTPCChi2NDF; +static constexpr TrackSelectionFlags::flagtype trackSelectionTPC = + TrackSelectionFlags::kTPCNCls | + TrackSelectionFlags::kTPCCrossedRowsOverNCls | + TrackSelectionFlags::kTPCChi2NDF; // default standard DCA cuts -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCA = - o2::aod::track::TrackSelectionFlags::kDCAz | o2::aod::track::TrackSelectionFlags::kDCAxy; +static constexpr TrackSelectionFlags::flagtype trackSelectionDCA = + TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; // default standard transversal-only DCA cuts -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCAXYonly = - o2::aod::track::TrackSelectionFlags::kDCAxy; +static constexpr TrackSelectionFlags::flagtype trackSelectionDCAXYonly = + 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 fb7de9da0e8..112072fa2c8 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 +#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace gencents diff --git a/PWGMM/Mult/DataModel/Index.h b/PWGMM/Mult/DataModel/Index.h index ba4c29ef606..b3c71f534a2 100644 --- a/PWGMM/Mult/DataModel/Index.h +++ b/PWGMM/Mult/DataModel/Index.h @@ -9,11 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef PWGMM_MULT_DATAMODEL_INDEX_H_ -#define PWGMM_MULT_DATAMODEL_INDEX_H_ - -#include +#ifndef O2_ANALYSIS_INDEX_H_ +#define O2_ANALYSIS_INDEX_H_ +#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace idx @@ -24,5 +23,4 @@ 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 // PWGMM_MULT_DATAMODEL_INDEX_H_ +#endif // O2_ANALYSIS_INDEX_H_ diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 60eb29ac659..fbdd68b89db 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -11,14 +11,13 @@ #ifndef PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ #define PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ -#include "Common/DataModel/Centrality.h" +#include + +#include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.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 27b524b5b89..0b4ee5440bc 100644 --- a/PWGMM/Mult/DataModel/bestCollisionTable.h +++ b/PWGMM/Mult/DataModel/bestCollisionTable.h @@ -19,9 +19,7 @@ #ifndef PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ #define PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ -#include - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx index af3a895eec3..dc958a3cd02 100644 --- a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx +++ b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx @@ -25,32 +25,20 @@ #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 "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 diff --git a/PWGMM/Mult/TableProducer/particles2tracks.cxx b/PWGMM/Mult/TableProducer/particles2tracks.cxx index 662bd34dd69..6b7e7db6a17 100644 --- a/PWGMM/Mult/TableProducer/particles2tracks.cxx +++ b/PWGMM/Mult/TableProducer/particles2tracks.cxx @@ -16,16 +16,11 @@ /// \brief A task to create a reverse index from McParticles to Tracks /// -#include "Index.h" - -#include -#include -#include -#include -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" -#include +#include "Index.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/percentiles.cxx b/PWGMM/Mult/TableProducer/percentiles.cxx index d34802ab2ae..c11fca858f8 100644 --- a/PWGMM/Mult/TableProducer/percentiles.cxx +++ b/PWGMM/Mult/TableProducer/percentiles.cxx @@ -8,30 +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. -#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 -#include -#include +#include +#include "Common/DataModel/Centrality.h" +#include #include +#include #include -#include - -#include -#include +#include "Gencentralities.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducer.cxx b/PWGMM/Mult/TableProducer/reducer.cxx index 6d290692e55..de9d516703b 100644 --- a/PWGMM/Mult/TableProducer/reducer.cxx +++ b/PWGMM/Mult/TableProducer/reducer.cxx @@ -9,34 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "ReducedTables.h" -#include "Selections.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 "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" -#include +#include "Selections.h" +#include "ReducedTables.h" -#include -#include -#include -#include -#include -#include +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx index 29bfecf43e4..d05f5534eb0 100644 --- a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx +++ b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx @@ -9,14 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "ReducedTables.h" +#include "Framework/AnalysisTask.h" -#include -#include -#include -#include +#include "ReducedTables.h" -#include +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/assessment-mft.cxx b/PWGMM/Mult/Tasks/assessment-mft.cxx index 735e95e9a6c..70304229e1e 100644 --- a/PWGMM/Mult/Tasks/assessment-mft.cxx +++ b/PWGMM/Mult/Tasks/assessment-mft.cxx @@ -15,15 +15,11 @@ // \brief This code loops over MFT tracks and fills basic histograms // close to the QC ones -#include -#include -#include -#include -#include -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" -#include +#include "MathUtils/Utils.h" +#include "CommonConstants/LHCConstants.h" using namespace o2; using namespace o2::framework; @@ -39,7 +35,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 630922994cb..d479a3138e3 100644 --- a/PWGMM/Mult/Tasks/dndeta-hi.cxx +++ b/PWGMM/Mult/Tasks/dndeta-hi.cxx @@ -10,41 +10,47 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include +#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 using namespace o2; using namespace o2::framework; @@ -52,6 +58,7 @@ 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 e7ff487021d..f70cc1d638a 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft.cxx @@ -15,34 +15,27 @@ // \brief This code loops over MFT tracks and collisions and fills histograms // useful to compute dNdeta -#include "bestCollisionTable.h" +#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 "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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include +#include "bestCollisionTable.h" using namespace o2; using namespace o2::framework; @@ -115,7 +108,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 df1ebc63cd8..220bdbdebb8 100644 --- a/PWGMM/Mult/Tasks/dndeta.cxx +++ b/PWGMM/Mult/Tasks/dndeta.cxx @@ -9,40 +9,26 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Axes.h" -#include "Functions.h" -#include "Gencentralities.h" -#include "Histograms.h" -#include "Index.h" -#include "Selections.h" -#include "bestCollisionTable.h" - #include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/Centrality.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 "Gencentralities.h" +#include "Index.h" +#include "bestCollisionTable.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include +#include "Axes.h" +#include "Functions.h" +#include "Selections.h" +#include "Histograms.h" using namespace o2; using namespace o2::aod::track; diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index dfe53b32df8..3b060924ad7 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -24,7 +24,6 @@ #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" @@ -82,37 +81,8 @@ auto static constexpr CmaxAccFT0A = 4.9f; auto static constexpr CminAccFT0C = -3.3f; auto static constexpr CmaxAccFT0C = -2.1f; -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, +enum TrkSel { + trkSelAll, trkSelNCls, trkSelChi2Ncl, trkSelEta, @@ -122,169 +92,35 @@ enum class TrkSel { nTrkSel }; -enum class TrkTrkBestSel { - trkTrkBestSelAll = 0, - trkTrkBestSelCollID, - trkTrkBestSelOrphan, - trkTrkBestSelDCAxyCut, - trkTrkBestSelDCAzCut, - trkTrkBestSelNumReassoc, - nTrkTrkBestSel +enum TrkBestSel { + trkBestSelAll, + trkBestSelCollID, + trkBestSelDCAxyCut, + trkBestSelDCAzCut, + trkBestSelNumReassoc, + nTrkBestSel }; -enum class AmbTrkType { - kAll = 0, - kNonAmb, - kOrphan, - kOrphanNull, - kNonAmbSame, - kAmb, - kAmbGt1, +enum AmbTrkType { + kNonAmb = 0, + kOrphan = 1, + kNonAmbSame = 2, + kAmb = 3, + kAmbGt1 = 4, nAmbTrkType }; -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; +std::unordered_map mapVtxXrec; +std::unordered_map mapVtxYrec; +std::unordered_map mapVtxZrec; +std::unordered_map mapMcCollIdPerRecColl; struct DndetaMFTPbPb { SliceCache cache; std::array, 4> hCollAssoc; - std::array, 23> hReAssocVtxRes; - std::array, 23> hReAssocDCA; - // std::array, 23> hReAssocDCAPrim; - std::array, 21> hTimeAssocWithReassocMC; + std::array, 4> hReAssoc; + std::array, 8> hDCAMc; enum OccupancyEst { TrkITS = 1, Ft0C }; @@ -311,12 +147,8 @@ 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"}; @@ -349,7 +181,6 @@ 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"}; @@ -408,7 +239,6 @@ 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 @@ -507,60 +337,38 @@ struct DndetaMFTPbPb { "be enabled!"); } - // 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 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)"); auto hBcSel = registry.add("hBcSel", "hBcSel", HistType::kTH1F, {{3, -0.5f, +2.5f}}); @@ -1095,155 +903,77 @@ struct DndetaMFTPbPb { qaregistry.add({"Tracks/hMftTracksAmbDegreeWithTrivial", " ; N_{coll}^{comp}", {HistType::kTH1F, {{41, -0.5, 40.5}}}}); - - 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.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 < static_cast(AmbTrkType::nAmbTrkType); iBin++) { + + for (int iBin = 0; iBin < AmbTrkType::nAmbTrkType; iBin++) { qaregistry.get(HIST("Tracks/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); } } - 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()); - } + if (doprocessCollAssocMC) { + + registry.add("Events/hNAssocColls", "Number of times generated collisions are reconstructed; N; Counts", HistType::kTH1F, {{10, -0.5, 9.5}}); // tracks not associated to any collision - 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}); + 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}); // tracks associasted to a collision - 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}); + 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}); // tracks associated to the correct collision considering only first reco collision (based on the MC collision index) - 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}); + 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}); // tracks associated to the correct collision considering all ambiguous reco collisions (based on the MC collision index) - 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}); + 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}); } if (doprocessEfficiencyInclusive) { @@ -1280,40 +1010,13 @@ 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) { - 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({"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"); 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}}}); @@ -1328,38 +1031,12 @@ struct DndetaMFTPbPb { registry.add({"Tracks/THnGenSecMatAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}}); } if (doprocessSecondariesMCCentFT0C) { - 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({"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"); 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}}}); @@ -1454,156 +1131,6 @@ 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 @@ -1618,10 +1145,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; @@ -1637,16 +1164,13 @@ struct DndetaMFTPbPb { using CollisionsWithMCLabels = soa::Join; using CollGenCent = CollsGenCentFT0C::iterator; using CollsCorr = soa::Join; - using CollsMCExtra = soa::Join; - using CollsMCExtraMult = soa::Join; + using CollsMCExtra = 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; @@ -1708,31 +1232,25 @@ struct DndetaMFTPbPb { bool isBestTrackSelected(const B& besttrack) { if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelAll)); + registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelAll); } if (besttrack.bestCollisionId() < CintZero) { return false; } if constexpr (fillHis) { - 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)); + registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelCollID); } if (std::abs(besttrack.bestDCAXY()) >= trackCuts.maxDCAxy) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelDCAxyCut)); + registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelDCAxyCut); } - if (std::abs(besttrack.bestDCAZ()) >= trackCuts.maxDCAz) { + if (std::abs(besttrack.bestDCAZ()) >= trackCuts.maxDCAxy) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelDCAzCut)); + registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelDCAzCut); } return true; } @@ -1741,13 +1259,13 @@ struct DndetaMFTPbPb { bool isTrackSelected(const T& track) { if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelAll)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelAll); } if (track.nClusters() < trackCuts.minNclusterMft) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelNCls)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelNCls); } if (trackCuts.useChi2Cut) { float nclMft = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); @@ -1756,13 +1274,13 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelChi2Ncl)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelChi2Ncl); } if (track.eta() < trackCuts.minEta || track.eta() > trackCuts.maxEta) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelEta)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelEta); } if (trackCuts.usephiCut) { float phi = track.phi(); @@ -1778,19 +1296,19 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPhiCut)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelPhiCut); } if (trackCuts.usePtCut && track.pt() < trackCuts.minPt) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPt)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelPt); } if (trackCuts.requireCA && !track.isCA()) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelCA)); + registry.fill(HIST("Tracks/hTrkSel"), trkSelCA); } return true; } @@ -1918,7 +1436,7 @@ struct DndetaMFTPbPb { if (itrack.has_collision() && itrack.collisionId() != atrack.bestCollisionId()) { reassignedTrkIds.emplace_back(atrack.mfttrackId()); if (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelNumReassoc)); + registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelNumReassoc); float phi = itrack.phi(); o2::math_utils::bringTo02Pi(phi); if (phi < Czero || TwoPI < phi) { @@ -2052,9 +1570,6 @@ 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; } @@ -2111,69 +1626,69 @@ struct DndetaMFTPbPb { bool isGoodEvent(C const& collision) { if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtAll)); + registry.fill(HIST("Events/hEvtSel"), 0); } if (!collision.sel8()) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtSel)); + registry.fill(HIST("Events/hEvtSel"), 1); } if (eventCuts.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtIsGoodZvtx)); + registry.fill(HIST("Events/hEvtSel"), 2); } if (eventCuts.requireRejectSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoSameBunchPileup)); + registry.fill(HIST("Events/hEvtSel"), 3); } if (collision.posZ() <= eventCuts.minZvtx || collision.posZ() >= eventCuts.maxZvtx) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtZvtxCut)); + registry.fill(HIST("Events/hEvtSel"), 4); } if (eventCuts.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeStd)); + registry.fill(HIST("Events/hEvtSel"), 5); } if (eventCuts.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeNarrow)); + registry.fill(HIST("Events/hEvtSel"), 6); } if (eventCuts.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeStrict)); + registry.fill(HIST("Events/hEvtSel"), 7); } if (eventCuts.requireNoCollInRofStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInRofStrict)); + registry.fill(HIST("Events/hEvtSel"), 8); } if (eventCuts.requireNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInRofStandard)); + registry.fill(HIST("Events/hEvtSel"), 9); } if (eventCuts.requireNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoHighMultCollInPrevRof)); + registry.fill(HIST("Events/hEvtSel"), 10); } if (eventCuts.minOccupancy >= 0 && getOccupancy(collision, eventCuts.occupancyEstimator) < @@ -2181,7 +1696,7 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtBelowMinOccup)); + registry.fill(HIST("Events/hEvtSel"), 11); } if (eventCuts.maxOccupancy >= 0 && getOccupancy(collision, eventCuts.occupancyEstimator) > @@ -2189,19 +1704,14 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtAboveMaxOccup)); + registry.fill(HIST("Events/hEvtSel"), 12); } + if (rctCuts.requireRCTFlagChecker && !rctChecker(collision)) { return false; } if constexpr (fillHis) { - 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)); + registry.fill(HIST("Events/hEvtSel"), 13); } return true; } @@ -2310,12 +1820,6 @@ 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; } @@ -3425,196 +2929,352 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processEfficiencyCentFT0C, "Process efficiencies in FT0C centrality bins", false); - template - void processCorrelationwBestTracks(typename C::iterator const& collision, FiltMftTracks const& /*tracks*/, soa::SmallGroups const& besttracks) + /// @brief process function to check ambiguous tracks + void processCheckAmbiguousMftTracks(aod::Collisions const&, MftTracksWColls const& tracks) { - if (!isGoodEvent(collision)) { - return; - } - - auto nBestTrks = 0; - for (auto const& atrack : besttracks) { - if (gConf.cfgUseTrackSel && !isBestTrackSelected(atrack)) { - continue; - } - auto itrack = atrack.template mfttrack_as(); - if (itrack.eta() < trackCuts.minEta || itrack.eta() > trackCuts.maxEta) { + 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); + } continue; } - if (gConf.cfgUseTrackSel && !isTrackSelected(itrack)) { - 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); + } } - 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); - } - - void processCorrelationwBestTracksInclusive(CollsCorr::iterator const& collision, FiltMftTracks const& tracks, soa::SmallGroups const& besttracks) - { - processCorrelationwBestTracks(collision, tracks, besttracks); } - 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; - } + PROCESS_SWITCH(DndetaMFTPbPb, processCheckAmbiguousMftTracks, "Process checks for Ambiguous MFT tracks (inclusive)", false); - template - int getQuadrantTrack(T const& track) - { - float phi = static_cast(track.phi()) * ConeHeighty / PI; - return getQuadrantPhi(phi); - } + Partition tracksInAcc = (aod::fwdtrack::eta < trackCuts.maxEta) && (aod::fwdtrack::eta > trackCuts.minEta); - /// @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*/ + void processCheckAssocMC(C const& collisions, + MftTracksWCollsMC const& tracks, + aod::McParticles const& /*particles*/, + aod::McCollisions const& /*mccollisions*/ ) { - auto bc = collision.template foundBC_as(); - if (!isGoodEvent(collision)) { - return; - } + 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(); + } + } - 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; + 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(); + + 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); } - gCurrentHadronicRate->Fill(seconds, ir); } - auto z = collision.posZ(); - for (auto const& atrack : besttracks) { - if (!isBestTrackSelected(atrack)) { - continue; - } - auto itrack = atrack.template mfttrack_as(); - if (!isTrackSelected(itrack)) { - continue; - } + 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(); - int quadrant = getQuadrantTrack(itrack); - if (quadrant < 0) { - continue; + 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)); + } + } + + 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); } - std::get>(hAlignment[0][quadrant][0]["DCA_x_vs_z"])->Fill(z, atrack.bestDCAXY()); } } - void processAlignmentInclusive(Colls::iterator const& collision, - FiltMftTracks const& tracks, - soa::SmallGroups const& besttracks, - CollBCs const& bcs) + void processCollAssocMC(CollisionsWithMCLabels const& collisions, + MftTracksWCollsMC const& tracks, + aod::McParticles const& particles, + aod::McCollisions const& mccollisions) { - processAlignment(collision, tracks, besttracks, bcs); + processCheckAssocMC(collisions, tracks, particles, mccollisions); } + PROCESS_SWITCH(DndetaMFTPbPb, processCollAssocMC, "Process collision-association information, requires extra table from TrackToCollisionAssociation task (fillTableOfCollIdsPerTrack=true)", false); - PROCESS_SWITCH(DndetaMFTPbPb, processAlignmentInclusive, "Check MFT alignment using tracks based on BestCollisionsFwd3d table (inclusive)", false); - - /// @brief process function to calculate signal loss based on MC - void processEventAndSignalLossCentFT0C(CollsMCExtraMult::iterator const& mcCollision, - soa::SmallGroups> const& collisions, - FiltParticles const& particles) + template + void processCheckReAssocMC(C const& collisions, + soa::SmallGroups const& besttracks, + FiltMcMftTracks const& /*tracks*/, + FiltParticles const& /*particles*/, + aod::McCollisions const& /*mccollisions*/ + ) { - registry.fill(HIST("Events/Centrality/hNRecCollsSigEvtLoss"), 1.f, collisions.size()); - - if (gConf.cfgUseInelgt0 && !mcCollision.isInelGt0()) { - return; - } - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { - return; - } + const auto& nRecoColls = collisions.size(); + registry.fill(HIST("Events/hNReAssocColls"), 1.f, nRecoColls); + // Generated evets with >= 1 reco collisions + if (nRecoColls > CintZero) { - 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); + 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 (!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()); + } } - gtZeroColl = true; - } - auto perCollMCsample = mcSample->sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto multMCNParticlesEtaMFT = countPart(perCollMCsample); + 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; + } - 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 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(); - if (collisions.size() == 0) { - registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 3., centrality); - } + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + continue; + } - 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); - } + registry.fill(HIST("Events/ReAssocMCStatus"), 6); - for (auto const& particle : particles) { - if (!isChrgParticle(particle.pdgCode())) { - continue; - } - if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { - continue; - } + float deltaX = -999.f; + float deltaY = -999.f; + float deltaZ = -999.f; - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (phi < Czero || TwoPI < phi) { - 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(); - registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen_t"), particle.eta(), centrality, mcCollision.multMCFT0C()); - registry.fill(HIST("Tracks/Centrality/EtaGen_t"), particle.eta(), centrality); + 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 (gtZeroColl) { - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (phi < Czero || TwoPI < phi) { - continue; + 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); + } + } + } + } } - 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(); } } - PROCESS_SWITCH(DndetaMFTPbPb, processEventAndSignalLossCentFT0C, "Signal/event loss based on MC (in FT0C centrality bins)", false); + 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); Preslice filtTrkperCol = o2::aod::fwdtrack::collisionId; @@ -3693,1094 +3353,331 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processMcQACentFT0C, "Process MC QA checks (in FT0 centrality bins)", false); - /// @brief process function to check ambiguous tracks - void processCheckAmbiguousMftTracks(aod::Collisions const&, MftTracksWColls const& tracks) + 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*/ + ) { - 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()); + registry.fill(HIST("Events/hNGenRecColls"), 1.f, collisions.size()); + registry.fill(HIST("Events/hNGenRecColls"), 2.f, mcCollisions.size()); - 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)); + 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; } - } else { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); } } + if (cGen < 0) + cGen = crecMin; } - } - - PROCESS_SWITCH(DndetaMFTPbPb, processCheckAmbiguousMftTracks, "Process checks for Ambiguous MFT tracks (inclusive)", false); - - // 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; - } - - 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(); - - 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()); + if constexpr (has_reco_cent) { + registry.fill(HIST("Events/Centrality/EvtGenRec"), 1., cGen); + } else { + registry.fill(HIST("Events/EvtGenRec"), 1.); } - 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; - } - registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsSelected)); - if (!collision.has_mcCollision()) { - continue; + float crec = getRecoCent(collision); + + if constexpr (has_reco_cent) { + registry.fill(HIST("Events/Centrality/EvtGenRec"), 2., crec); + } else { + registry.fill(HIST("Events/EvtGenRec"), 2.); } - registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsHasMcColl)); - int64_t recCollId = collision.globalIndex(); - auto itMC = mapRecToMc.find(recCollId); - if (itMC == mapRecToMc.end()) { - nNoMC++; - LOGP(debug, "collison {} has no MC coll", recCollId); + if (!isGoodEvent(collision)) { continue; } - auto mcCollision = collision.mcCollision_as(); - if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { - 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::kEvtReAsSplitVtxRemoved)); - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + + if (!collision.has_mcCollision()) { continue; } - registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsZVtxCutMC)); - // 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) { + 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(); - 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; + 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()); } - } - 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 { + 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("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame)); + 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()); } - } else { - registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); } - } else { - registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kOrphanNull)); } - if (gConf.cfgUseTrackSel && !isTrackSelected(track)) { + + uint index = uint(track.collisionId() >= 0); + + if (!track.has_mcParticle()) { + LOGP(debug, "No MC particle for track, skip..."); 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; + auto particle = track.template mcParticle_as(); + if (!isChrgParticle(particle.pdgCode())) { + 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 (particle.eta() <= trackCuts.minEta || particle.eta() >= trackCuts.maxEta) { + 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 (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { + 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 (index) { + auto mcCollision = particle.template mcCollision_as(); + if (eventCuts.useZDiffCut) { + if (std::abs(collision.posZ() - mcCollision.posZ()) > eventCuts.maxZvtxDiff) { + continue; + } } - } - 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 (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 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)); - } - } - 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)); - } + 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()); } - } 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 (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/hVTXkSelNonAmbSameGoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); - registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameGoodVtxBad)); + } 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 { // 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)); + } 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/hVTXkSelAmbGt1GoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); - registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1GoodVtxBad)); + } 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 { - registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelOrphanNull)); } } } - LOG(info) << "No MC: " << nNoMC; } - 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) + + void processSecondariesMCInlcusive(soa::Join const& collisions, + MftTracksWCollsMC const& tracks, + aod::McCollisions const& mccollisions, + aod::McParticles const& particles) { - if (bcs.size() == 0) { - return; - } - auto bc = bcs.begin(); - initCCDB(bc); + processSecondariesMC(collisions, tracks, mccollisions, particles); + } - 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; - } + PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCInlcusive, "Process secondaries checks (Inclusive)", false); - 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(); + void processSecondariesMCCentFT0C(soa::Join const& collisions, + MftTracksWCollsMC const& tracks, + aod::McCollisions const& mccollisions, + aod::McParticles const& particles) + { + processSecondariesMC(collisions, tracks, mccollisions, particles); + } - std::unordered_map mapVtxXgen; - mapVtxXgen.reserve(nMcColls); - std::unordered_map mapVtxYgen; - mapVtxYgen.reserve(nMcColls); - std::unordered_map mapVtxZgen; - mapVtxZgen.reserve(nMcColls); + PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCCentFT0C, "Process secondaries checks (in FT0C centrality bins)", false); - for (const auto& mcCollision : mcCollisions) { - mapVtxXgen.emplace(mcCollision.globalIndex(), mcCollision.posX()); - mapVtxYgen.emplace(mcCollision.globalIndex(), mcCollision.posY()); - mapVtxZgen.emplace(mcCollision.globalIndex(), mcCollision.posZ()); + template + void processCorrelationwBestTracks(typename C::iterator const& collision, FiltMftTracks const& /*tracks*/, soa::SmallGroups const& besttracks) + { + if (!isGoodEvent(collision)) { + return; } - LOG(info) << "mapVtxXgen size: " << mapVtxXgen.size(); - 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; - } - if (!collision.has_mcCollision()) { - continue; - } - auto mcCollision = collision.mcCollision_as(); - // if (collision.globalIndex() != mcCollision.bestCollisionIndex()) { - // continue; - // } - if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + auto nBestTrks = 0; + for (auto const& atrack : besttracks) { + if (gConf.cfgUseTrackSel && !isBestTrackSelected(atrack)) { continue; } - - if (!isGoodEvent(collision)) { + auto itrack = atrack.template mfttrack_as(); + if (itrack.eta() < trackCuts.minEta || itrack.eta() > trackCuts.maxEta) { continue; } - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + if (gConf.cfgUseTrackSel && !isTrackSelected(itrack)) { 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)); - } - } - } + nBestTrks++; } - LOG(info) << "No MC: " << nNoMC; + 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, processTimeAssocWithReassocMC, "process MC: check MFT tracks in reassociation with compatible collisions", false); - - 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*/ - ) + void processCorrelationwBestTracksInclusive(CollsCorr::iterator const& collision, FiltMftTracks const& tracks, soa::SmallGroups const& 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(); - - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { - continue; - } - - 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)); - } - } + processCorrelationwBestTracks(collision, tracks, besttracks); + } - 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)); - } - } + PROCESS_SWITCH(DndetaMFTPbPb, processCorrelationwBestTracksInclusive, "Do correlation study based on BestCollisionsFwd3d table", false); - 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); - } + 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; } - PROCESS_SWITCH(DndetaMFTPbPb, processAssocMC, "Process collision-association information, requires extra table from TrackToCollisionAssociation task (fillTableOfCollIdsPerTrack=true)", false); + template + int getQuadrantTrack(T const& track) + { + float phi = static_cast(track.phi()) * ConeHeighty / PI; + return getQuadrantPhi(phi); + } - template - void processReAssocMC(CollisionsWithMCLabels const& collisions, - B const& besttracks, - FiltMcMftTracks const& /*tracks*/, - aod::McCollisions const& /*mcCollisions*/, - aod::McParticles const& /*particles*/ + /// @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*/ ) { - const auto& nRecoColls = collisions.size(); - registry.fill(HIST("ReAssocMC/hNReAssocRecoColls"), 1.f, nRecoColls); - - if (nRecoColls > CintZero) { - - 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 bc = collision.template foundBC_as(); + if (!isGoodEvent(collision)) { + return; + } - 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()); - } + 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); + } - 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; - } - } - } - } - } + auto z = collision.posZ(); + for (auto const& atrack : besttracks) { + if (!isBestTrackSelected(atrack)) { + continue; + } + auto itrack = atrack.template mfttrack_as(); + if (!isTrackSelected(itrack)) { + continue; + } - 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); - } - } - } - } - } - } - } + int quadrant = getQuadrantTrack(itrack); + if (quadrant < 0) { + continue; } - mapVtxXrec.clear(); - mapVtxYrec.clear(); - mapVtxZrec.clear(); - mapMcCollIdPerRecColl.clear(); - LOG(info) << "No MC: " << nNoMC; + std::get>(hAlignment[0][quadrant][0]["DCA_x_vs_z"])->Fill(z, atrack.bestDCAXY()); } } - void processReAssoc3dMC(CollisionsWithMCLabels const& collisions, - BestTracks3dWCollsMC const& besttracks, - FiltMcMftTracks const& tracks, - aod::McCollisions const& mcCollisions, - aod::McParticles const& particles) + void processAlignmentInclusive(Colls::iterator const& collision, + FiltMftTracks const& tracks, + soa::SmallGroups const& besttracks, + CollBCs const& bcs) { - processReAssocMC(collisions, besttracks, tracks, mcCollisions, particles); + processAlignment(collision, tracks, besttracks, bcs); } - PROCESS_SWITCH(DndetaMFTPbPb, processReAssoc3dMC, "Process re-association information based on BestCollisionsFwd3d table", false); + + PROCESS_SWITCH(DndetaMFTPbPb, processAlignmentInclusive, "Check MFT alignment using tracks based on BestCollisionsFwd3d table (inclusive)", false); Preslice compCollPerCol = o2::aod::fwdtrack::collisionId; /// @brief process function to check reassociation efficiency - void processReassocEfficiency(CollsMCExtraMult::iterator const& mcCollision, + void processReassocEfficiency(CollsMCExtra::iterator const& mcCollision, soa::SmallGroups const& collisions, MftTracksWCollsMC const& tracks, aod::McParticles const& particles, @@ -4827,10 +3724,12 @@ struct DndetaMFTPbPb { continue; } // Select collisions with the largest number of contributors - if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + if (bestCollIndex != collision.globalIndex()) { continue; } + registry.fill(HIST("Events/Centrality/ReEffStatus"), 1, crec); + if (!collision.has_mcCollision()) { continue; } @@ -4855,17 +3754,8 @@ struct DndetaMFTPbPb { auto bestCol = track.has_collision() ? track.collisionId() : -1; uint index = uint(track.collisionId() >= 0); - auto ids = track.compatibleCollIds(); - bool isAmbiguous = (ids.size() > 1); + bool isAmbiguous = (track.compatibleCollIds().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; } @@ -4879,11 +3769,18 @@ 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; @@ -4997,302 +3894,86 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processReassocEfficiency, "Process collision-reassociation efficiency based on track propagation DCA 3D (in FT0C 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, - ExtBCs const& bcs) + /// @brief process function to calculate signal loss based on MC + void processEventAndSignalLossCentFT0C(CollsMCExtra::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + FiltParticles const& particles) { - registry.fill(HIST("Events/hNGenRecColls"), 1.f, collisions.size()); - registry.fill(HIST("Events/hNGenRecColls"), 2.f, mcCollisions.size()); + registry.fill(HIST("Events/Centrality/hNRecCollsSigEvtLoss"), 1.f, collisions.size()); - if (bcs.size() == 0) { + if (gConf.cfgUseInelgt0 && !mcCollision.isInelGt0()) { + return; + } + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { return; } - auto bc = bcs.begin(); - initCCDB(bc); - // 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); - } - } + 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 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)); - } + auto perCollMCsample = mcSample->sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto multMCNParticlesEtaMFT = countPart(perCollMCsample); - 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); + 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 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 (collisions.size() == 0) { + registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 3., centrality); + } - if (gConf.cfgRemoveTrivialAssoc) { - if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { - qaregistry.fill(HIST("TrkCompColls/Centrality/histNonAmbTrackNumColls"), ids.size()); - continue; - } - } + 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 (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()); - } - } - } + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { + 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; - } + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + if (phi < Czero || TwoPI < phi) { + continue; + } - 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; - } - } + registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen_t"), particle.eta(), centrality, mcCollision.multMCFT0C()); + registry.fill(HIST("Tracks/Centrality/EtaGen_t"), particle.eta(), centrality); - 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; - } - } - } - } - } + 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); } } } - 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); + PROCESS_SWITCH(DndetaMFTPbPb, processEventAndSignalLossCentFT0C, "Signal/event loss based on MC (in FT0C centrality bins)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGMM/Mult/Tasks/effpt-mft.cxx b/PWGMM/Mult/Tasks/effpt-mft.cxx index c34dea1def2..2d3a9919922 100644 --- a/PWGMM/Mult/Tasks/effpt-mft.cxx +++ b/PWGMM/Mult/Tasks/effpt-mft.cxx @@ -9,25 +9,24 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Index.h" - -#include "Common/DataModel/EventSelection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include -#include - -#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" using namespace o2; using namespace o2::framework; @@ -220,9 +219,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 0c7c3565676..3a403d9ea1b 100644 --- a/PWGMM/Mult/Tasks/flatenicityFV0.cxx +++ b/PWGMM/Mult/Tasks/flatenicityFV0.cxx @@ -8,32 +8,24 @@ // 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 2f84c6603bb..fbfa4ab578d 100644 --- a/PWGMM/Mult/Tasks/flattenicty-chrg.cxx +++ b/PWGMM/Mult/Tasks/flattenicty-chrg.cxx @@ -17,37 +17,28 @@ // // \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 +#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" 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 d281fb37ac7..9d8fdf30a2a 100644 --- a/PWGMM/Mult/Tasks/heavy-ion-mult.cxx +++ b/PWGMM/Mult/Tasks/heavy-ion-mult.cxx @@ -18,42 +18,38 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 - 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 32f85d3e946..5d5194be4be 100644 --- a/PWGMM/Mult/Tasks/mcdata_split_test.cxx +++ b/PWGMM/Mult/Tasks/mcdata_split_test.cxx @@ -13,23 +13,19 @@ /// /// \author hhesouno -#include "Common/DataModel/EventSelection.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ReconstructionDataFormats/GlobalTrackID.h" -#include +#include "Common/DataModel/EventSelection.h" -#include +#include "Framework/O2DatabasePDGPlugin.h" + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx index 5d5e2f2b1bb..2afc211b4b3 100644 --- a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx +++ b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx @@ -17,41 +17,45 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/fwdtrackUtilities.h" +#include "Common/Core/RecoDecay.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 #include #include #include -#include -#include +#include #include #include #include +#include +#include #include +#include +#include #include #include #include #include #include #include -#include +#include -#include #include +#include #include -#include +#include + +#include #include #include #include #include #include -#include #include #include #include @@ -93,7 +97,6 @@ enum DataType { enum SpecificEventSelectionStep { AllEventsPrecise = 0, HasMcCollision, - IsNotSplitVertex, IsSel8, IsNoSameBunchPileup, IsGoodItsLayersAll, @@ -104,31 +107,9 @@ 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, @@ -207,8 +188,6 @@ enum MftTrackSelectionStep { Eta, Cluster, Pt, - IsCA, - IsLTF, NMftTrackSelectionSteps }; @@ -225,7 +204,6 @@ std::unordered_map recoVtxX; std::unordered_map recoVtxY; std::unordered_map recoVtxZ; std::unordered_map recoMcCollisionId; -std::unordered_map recoMcCollBestCollisionIndex; struct MftReassociationValidation { @@ -240,12 +218,6 @@ 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 @@ -262,11 +234,9 @@ 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"}; @@ -276,12 +246,6 @@ 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"}; @@ -292,34 +256,22 @@ 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; - 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 + TF1* fPtDepDCAxy = nullptr; + SliceCache cache; Service pdg; Service ccdb; o2::ccdb::CcdbApi ccdbApi; - o2::parameters::GRPMagField* grpmag = nullptr; RCTFlagsChecker rctChecker; - RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}; + RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, 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 @@ -346,19 +298,19 @@ struct MftReassociationValidation { // ========================= // Collision filters - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < configCollision.zVertexMaxInFilter; + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < configCollision.zVertexMax; 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 mcParticleEtaFilter = (aod::mcparticle::eta < configMft.etaMftTrackMaxFilter) && (aod::mcparticle::eta > configMft.etaMftTrackMinFilter); + 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); Partition mcParticlesSample = (aod::mcparticle::eta < configMft.etaMftTrackMaxFilter) && (aod::mcparticle::eta > configMft.etaMftTrackMinFilter); @@ -404,8 +356,6 @@ 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++) { @@ -464,38 +414,6 @@ 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"; @@ -518,51 +436,52 @@ struct MftReassociationValidation { registry.get(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNonAmbiguousAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/hIs2dReassociatedAndMatchedToTrueCollision", "Is2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/Is2dReassociatedAndMatchedToTrueCollision", "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/hIs2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/hIsNot2dReassociatedAndMatchedToTrueCollision", "IsNot2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/IsNot2dReassociatedAndMatchedToTrueCollision", "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/hIsNot2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/hIs3dReassociatedAndMatchedToTrueCollision", "Is3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/Is3dReassociatedAndMatchedToTrueCollision", "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/hIs3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/hIsNot3dReassociatedAndMatchedToTrueCollision", "IsNot3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/IsNot3dReassociatedAndMatchedToTrueCollision", "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/hIsNot3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"))->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]; @@ -570,11 +489,13 @@ 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()); } @@ -590,8 +511,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, true); - correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad, true); + rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad); + correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad); // ========================= // Event histograms @@ -605,7 +526,6 @@ 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"; @@ -616,42 +536,12 @@ 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"; @@ -777,35 +667,6 @@ 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 // ========================= @@ -878,12 +739,6 @@ 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()); @@ -894,7 +749,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 isData, float dcaXY, float dcaZ) + bool isAcceptedMftTrack(TTrack const& mftTrack, bool fillHistograms) { // cut on the eta of MFT tracks if (mftTrack.eta() > configMft.etaMftTrackMax || mftTrack.eta() < configMft.etaMftTrackMin) { @@ -902,11 +757,7 @@ struct MftReassociationValidation { } if (fillHistograms) { - if (isData) { - registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Eta); - } else { - registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterEtaCut); - } + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Eta); } // cut on the number of clusters of the reconstructed MFT track @@ -915,11 +766,7 @@ struct MftReassociationValidation { } if (fillHistograms) { - if (isData) { - registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Cluster); - } else { - registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterClusterCut); - } + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Cluster); } // cut on the pT of MFT tracks (for test purposes) @@ -928,48 +775,7 @@ struct MftReassociationValidation { } if (fillHistograms) { - 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; - } + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Pt); } return true; @@ -1014,8 +820,6 @@ struct MftReassociationValidation { soa::SmallGroups const& reassociated2dMftTracks, aod::BCsWithTimestamps const&) { - auto bc = collision.template bc_as(); - loadZVertexShiftCorrection(bc); if (!(isAcceptedCollision(collision, true))) { return; @@ -1028,13 +832,7 @@ struct MftReassociationValidation { registry.fill(HIST("Data/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AllMftTracks); auto templatedMftTrack = reassociated2dMftTrack.template mfttrack_as(); - 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])) { + if (!isAcceptedMftTrack(templatedMftTrack, false)) { continue; } @@ -1050,19 +848,17 @@ struct MftReassociationValidation { } PROCESS_SWITCH(MftReassociationValidation, processData, "Process MFT reassociation validation for DATA", false); - void processCreateLookupTable(FilteredCollisionsWSelMultMcLabels const& collisions, soa::Join const& mcCollisions) + void processCreateLookupTable(FilteredCollisionsWSelMultMcLabels const& collisions) { 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()); @@ -1070,10 +866,6 @@ 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); @@ -1081,12 +873,8 @@ struct MftReassociationValidation { FilteredMftTracksWCollsMcLabels const& /*mftTracks*/, soa::SmallGroups> const& reassociated2dMftTracks, aod::McCollisions const& /*mcCollisions*/, - aod::McParticles const& /*particles*/, - aod::BCsWithTimestamps const& /*bcs*/) + aod::McParticles const& /*particles*/) { - auto bc = collision.template bc_as(); - loadZVertexShiftCorrection(bc); - registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::AllMonteCarloEvents); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::AllEventsPrecise); @@ -1098,19 +886,6 @@ 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; } @@ -1119,51 +894,20 @@ 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(); - 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])) { + if (!isAcceptedMftTrack(templatedTrack, false)) { 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; @@ -1227,92 +971,66 @@ 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/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociated); + registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), 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/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndMatchedToTrueCollision); + registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), 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/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndNotMatchedToTrueCollision); + registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), 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/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); + registry.fill(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociated); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); // is collision.mcCollisionId() the reassociated collision vertex ? or the initial collision if (mcCollisionIdReco == particle.mcCollisionId()) { - 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); + registry.fill(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndMatchedToTrueCollision); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); } else { - 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/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndNotMatchedToTrueCollision); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); 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); } } } @@ -1322,16 +1040,23 @@ 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); - hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); + + 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); + } } } // end of if non ambi @@ -1346,12 +1071,8 @@ struct MftReassociationValidation { FilteredMftTracksWCollsMcLabels const& /*mftTracks*/, soa::SmallGroups> const& reassociated3dMftTracks, aod::McCollisions const& /*mcCollisions*/, - aod::McParticles const& /*particles*/, - aod::BCsWithTimestamps const& /*bcs*/) + aod::McParticles const& /*particles*/) { - auto bc = collision.template bc_as(); - loadZVertexShiftCorrection(bc); - registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::AllMonteCarloEvents); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::AllEventsPrecise); @@ -1363,19 +1084,6 @@ 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; } @@ -1384,51 +1092,20 @@ 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(); - 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) { + if (!isAcceptedMftTrack(templatedTrack, false)) { 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; @@ -1438,12 +1115,18 @@ 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); @@ -1492,91 +1175,66 @@ 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/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociated); + registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), 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/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndMatchedToTrueCollision); + registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), 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/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndNotMatchedToTrueCollision); + registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), 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/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); + registry.fill(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociated); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + // is collision.mcCollisionId() the reassociated collision vertex ? or the initial collision if (mcCollisionIdReco == particle.mcCollisionId()) { - 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); + registry.fill(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndMatchedToTrueCollision); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); } else { - 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/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndNotMatchedToTrueCollision); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); 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); } } } @@ -1586,16 +1244,23 @@ 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); - hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); + + 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); + } } } // end of if non ambi diff --git a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx index 70f62629b54..367b7e991a6 100644 --- a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx +++ b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx @@ -13,21 +13,17 @@ /// /// \author hhesouno -#include "Common/DataModel/EventSelection.h" +#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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "Framework/O2DatabasePDGPlugin.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx index 7a47c760094..d8dc1990329 100644 --- a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx +++ b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx @@ -16,47 +16,40 @@ /// \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 -#include +#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 "TPDGCode.h" #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 f634755a3dd..86e52b38850 100644 --- a/PWGMM/Mult/Tasks/puremc-dndeta.cxx +++ b/PWGMM/Mult/Tasks/puremc-dndeta.cxx @@ -9,29 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Axes.h" -#include "Histograms.h" - +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.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 "Axes.h" +#include "Histograms.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/run2dndeta.cxx b/PWGMM/Mult/Tasks/run2dndeta.cxx index 84e7fca4123..9db9fd291d9 100644 --- a/PWGMM/Mult/Tasks/run2dndeta.cxx +++ b/PWGMM/Mult/Tasks/run2dndeta.cxx @@ -8,29 +8,24 @@ // 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/DataModel/Centrality.h" +#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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "CommonConstants/MathConstants.h" +#include "TDatabasePDG.h" #include -#include - -#include -#include -#include - -#include using namespace o2; using namespace o2::framework; @@ -61,7 +56,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 f5dd786acc7..aecb9e7cd9c 100644 --- a/PWGMM/Mult/Tasks/vertexing-fwd.cxx +++ b/PWGMM/Mult/Tasks/vertexing-fwd.cxx @@ -16,27 +16,18 @@ // \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 -#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" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/dedxAnalysis.cxx b/PWGMM/UE/Tasks/dedxAnalysis.cxx index cb8e1cbbc0d..a4ea4bb22ac 100644 --- a/PWGMM/UE/Tasks/dedxAnalysis.cxx +++ b/PWGMM/UE/Tasks/dedxAnalysis.cxx @@ -16,33 +16,29 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include +#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" 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 bf632017ee4..ec5294f7248 100644 --- a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx +++ b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx @@ -12,21 +12,22 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include +#include "TH1F.h" +#include "TH2F.h" +#include "TObjArray.h" using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 8fef7ee4a8b..9af0eb3cc2a 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -13,37 +13,33 @@ /// \file uecharged.cxx /// \brief Underlying event analysis task /// \since November 2021 -/// \last update: April 2026 +/// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 using namespace o2; @@ -61,7 +57,6 @@ 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 @@ -419,7 +414,7 @@ struct ueCharged { ue.fill(HIST("hCounter"), 4); ue.fill(HIST("hStat"), collision.size()); - if ((std::abs(collision.posZ()) > CollPosZ)) { + if ((std::abs(collision.posZ()) > 10.f)) { return false; } @@ -465,7 +460,7 @@ struct ueCharged { ue.fill(HIST("hCounter"), 4); ue.fill(HIST("hStat"), collision.size()); - if ((std::abs(collision.posZ()) > CollPosZ)) { + if ((std::abs(collision.posZ()) > 10.f)) { return false; } @@ -666,7 +661,7 @@ struct ueCharged { if (cfgINELCut == 2 && !o2::pwglf::isINELgt1mc(GenParticles, pdg)) { return; } - if (std::abs(mcCollision.posZ()) > CollPosZ) { + if (std::abs(mcCollision.posZ()) > 10.f) { return; } ue.fill(HIST("hStat"), mcCollision.size()); @@ -1011,7 +1006,7 @@ struct ueCharged { if (cfgINELCut == 2 && !o2::pwglf::isINELgt1mc(GenParticles, pdg)) { return; } - if (std::abs(mcCollision.posZ()) > CollPosZ) { + if (std::abs(mcCollision.posZ()) > 10.f) { return; } @@ -1148,7 +1143,7 @@ struct ueCharged { ue.fill(HIST("hVtxFT0VsVtxCol_afterGoodZvtx"), foundBC.ft0().posZ(), collision.posZ()); } - if (std::abs(collision.posZ()) > CollPosZ) { + if (std::abs(collision.posZ()) > 10.f) { return; } diff --git a/PWGUD/AQC/FITtest.cxx b/PWGUD/AQC/FITtest.cxx index e1f2ac5a19a..8cada664d74 100644 --- a/PWGUD/AQC/FITtest.cxx +++ b/PWGUD/AQC/FITtest.cxx @@ -14,24 +14,20 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include +#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 "TLorentzVector.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQC.cxx b/PWGUD/AQC/udQC.cxx index 0edcdc28117..3da67d1f683 100644 --- a/PWGUD/AQC/udQC.cxx +++ b/PWGUD/AQC/udQC.cxx @@ -14,38 +14,17 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 04.05.2023 -#include "PWGUD/Core/DGCutparHolder.h" -#include "PWGUD/Core/UDHelpers.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 +#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/UDHelpers.h" +#include "Framework/StaticFor.h" +#include "TLorentzVector.h" +#include "TMath.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx index 6a2ea533d4c..acb35f21f57 100644 --- a/PWGUD/AQC/udQCmidRap.cxx +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -14,31 +14,16 @@ /// \author Paul Buehler /// \since 17.01.2023 -#include "PWGUD/Core/DGCutparHolder.h" +#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/UDHelpers.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 "Framework/StaticFor.h" +#include "TLorentzVector.h" +#include "TMath.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQcMuon.cxx b/PWGUD/AQC/udQcMuon.cxx index 9f09ee2d2c9..eaa5f59bc8b 100644 --- a/PWGUD/AQC/udQcMuon.cxx +++ b/PWGUD/AQC/udQcMuon.cxx @@ -16,37 +16,18 @@ /// \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 "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 "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/BCRange.h" + #include using namespace o2; diff --git a/PWGUD/Core/DGCutparHolder.cxx b/PWGUD/Core/DGCutparHolder.cxx index ee003684f5a..5775a7dd47e 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 "PWGUD/Core/DGCutparHolder.h" +#include "DGCutparHolder.h" #include diff --git a/PWGUD/Core/DGCutparHolder.h b/PWGUD/Core/DGCutparHolder.h index a67aefc4080..8312d72ac32 100644 --- a/PWGUD/Core/DGCutparHolder.h +++ b/PWGUD/Core/DGCutparHolder.h @@ -13,7 +13,6 @@ #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 7e0de287e48..04dab87ef7a 100644 --- a/PWGUD/Core/DGPIDSelector.cxx +++ b/PWGUD/Core/DGPIDSelector.cxx @@ -8,21 +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. -#include "DGPIDSelector.h" - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include #include +#include +#include "CommonConstants/PhysicsConstants.h" +#include "DGPIDSelector.h" // ----------------------------------------------------------------------------- float particleMass(TDatabasePDG* pdg, int pid) diff --git a/PWGUD/Core/DGPIDSelector.h b/PWGUD/Core/DGPIDSelector.h index de825ab3568..74ad6b54a58 100644 --- a/PWGUD/Core/DGPIDSelector.h +++ b/PWGUD/Core/DGPIDSelector.h @@ -12,16 +12,12 @@ #ifndef PWGUD_CORE_DGPIDSELECTOR_H_ #define PWGUD_CORE_DGPIDSELECTOR_H_ -#include - -#include -#include -#include - -#include -#include -#include +#include #include +#include +#include "TDatabasePDG.h" +#include "TLorentzVector.h" +#include "Framework/Logger.h" const int numDGPIDCutParameters = 9; float particleMass(TDatabasePDG* pdg, int pid); diff --git a/PWGUD/Core/DGSelector.h b/PWGUD/Core/DGSelector.h index 5c9afa99d00..c9349da9247 100644 --- a/PWGUD/Core/DGSelector.h +++ b/PWGUD/Core/DGSelector.h @@ -12,20 +12,15 @@ #ifndef PWGUD_CORE_DGSELECTOR_H_ #define PWGUD_CORE_DGSELECTOR_H_ -#include "PWGUD/Core/DGCutparHolder.h" -#include "PWGUD/Core/UDHelpers.h" - -#include - -#include -#include -#include - -#include - -#include #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" + // ----------------------------------------------------------------------------- // add here Selectors for different types of diffractive events // Selector for Double Gap events diff --git a/PWGUD/Core/SGCutParHolder.cxx b/PWGUD/Core/SGCutParHolder.cxx index ba180a97280..d171bd45a61 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 "PWGUD/Core/SGCutParHolder.h" +#include "SGCutParHolder.h" #include diff --git a/PWGUD/Core/SGCutParHolder.h b/PWGUD/Core/SGCutParHolder.h index fcee2d79703..753e9f0c96f 100644 --- a/PWGUD/Core/SGCutParHolder.h +++ b/PWGUD/Core/SGCutParHolder.h @@ -13,7 +13,6 @@ #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 4e2cef35a85..881cfb603bb 100644 --- a/PWGUD/Core/SGSelector.h +++ b/PWGUD/Core/SGSelector.h @@ -24,17 +24,16 @@ #include "Common/CCDB/RCTSelectionFlags.h" -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/Logger.h" #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 b571faf07f7..455eaf24ac1 100644 --- a/PWGUD/Core/SGTrackSelector.h +++ b/PWGUD/Core/SGTrackSelector.h @@ -16,10 +16,18 @@ #ifndef PWGUD_CORE_SGTRACKSELECTOR_H_ #define PWGUD_CORE_SGTRACKSELECTOR_H_ -#include +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/DataModel/UDTables.h" -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + +#include "TVector3.h" +#include + +#include #include template diff --git a/PWGUD/Core/UDFSParser.cxx b/PWGUD/Core/UDFSParser.cxx index 961412106c8..08c6b947ab2 100644 --- a/PWGUD/Core/UDFSParser.cxx +++ b/PWGUD/Core/UDFSParser.cxx @@ -11,18 +11,13 @@ #include "UDFSParser.h" -#include -#include -#include +#include "CommonConstants/LHCConstants.h" +#include "CommonDataFormat/BunchFilling.h" +#include "Framework/Logger.h" -#include -#include -#include #include #include -#include - // ----------------------------------------------------------------------------- UDFSParser::UDFSParser(const char* filename) { diff --git a/PWGUD/Core/UDFSParser.h b/PWGUD/Core/UDFSParser.h index a48fb9f8a4f..6ceddafa5df 100644 --- a/PWGUD/Core/UDFSParser.h +++ b/PWGUD/Core/UDFSParser.h @@ -12,6 +12,7 @@ #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 c8203a7a569..c9c7d317ec7 100644 --- a/PWGUD/Core/UDGoodRunSelector.cxx +++ b/PWGUD/Core/UDGoodRunSelector.cxx @@ -11,10 +11,10 @@ #include "PWGUD/Core/UDGoodRunSelector.h" -#include +#include "Framework/Logger.h" -#include -#include +#include "rapidjson/document.h" +#include "rapidjson/filereadstream.h" #include #include diff --git a/PWGUD/Core/UDGoodRunSelector.h b/PWGUD/Core/UDGoodRunSelector.h index 1b73f2c3ac4..4cf49330698 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 94d356501a7..73a3efcd775 100644 --- a/PWGUD/Core/UDHelpers.h +++ b/PWGUD/Core/UDHelpers.h @@ -19,25 +19,19 @@ #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 -#include -#include -#include -#include +#include "CommonConstants/LHCConstants.h" +#include "DataFormatsFIT/Triggers.h" +#include "DataFormatsFT0/Digit.h" +#include "Framework/Logger.h" -#include - -#include +#include "TLorentzVector.h" #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 8495f9c5adc..9dfa5fe3776 100644 --- a/PWGUD/Core/UPCHelpers.h +++ b/PWGUD/Core/UPCHelpers.h @@ -14,14 +14,13 @@ #include "UPCCutparHolder.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGUD/DataModel/UDTables.h" -#include +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" -#include +#include "CommonConstants/LHCConstants.h" +#include "Framework/AnalysisDataModel.h" using BCsWithBcSels = o2::soa::Join; diff --git a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h index 83a3eed9053..2a53f2f41f8 100644 --- a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h +++ b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h @@ -16,17 +16,9 @@ #ifndef PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ #define PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ -#include - -#include - -#include +#include "CommonConstants/MathConstants.h" #include -#include -#include -#include -#include #include #include diff --git a/PWGUD/Core/UPCPairCuts.h b/PWGUD/Core/UPCPairCuts.h index 817e4a86cfd..f53b419ffda 100644 --- a/PWGUD/Core/UPCPairCuts.h +++ b/PWGUD/Core/UPCPairCuts.h @@ -18,13 +18,10 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include -#include -#include -#include -#include - -#include +#include "CommonConstants/MathConstants.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" #include diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index ea4652b9b77..41af7ec5d78 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -18,14 +18,11 @@ #ifndef PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ #define PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ -#include -#include - -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include -#include -#include #include enum MyParticle { diff --git a/PWGUD/Core/decayTree.cxx b/PWGUD/Core/decayTree.cxx index ded7c2fa329..ed05772364e 100644 --- a/PWGUD/Core/decayTree.cxx +++ b/PWGUD/Core/decayTree.cxx @@ -11,20 +11,10 @@ #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 162a1859181..59421098605 100644 --- a/PWGUD/Core/decayTree.h +++ b/PWGUD/Core/decayTree.h @@ -12,19 +12,15 @@ #ifndef PWGUD_CORE_DECAYTREE_H_ #define PWGUD_CORE_DECAYTREE_H_ -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" +#include "Framework/O2DatabasePDGPlugin.h" -#include -#include -#include -#include +#include "TDatabasePDG.h" +#include "TLorentzVector.h" -#include -#include #include -#include #include #include #include diff --git a/PWGUD/DataModel/McPIDTable.h b/PWGUD/DataModel/McPIDTable.h index 7f9cf4ea875..3e2bf256db9 100644 --- a/PWGUD/DataModel/McPIDTable.h +++ b/PWGUD/DataModel/McPIDTable.h @@ -8,11 +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. +#ifndef O2_ANALYSIS_UDDIFFMCSCAN_H +#define O2_ANALYSIS_UDDIFFMCSCAN_H -#ifndef PWGUD_DATAMODEL_MCPIDTABLE_H_ -#define PWGUD_DATAMODEL_MCPIDTABLE_H_ - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -34,4 +33,4 @@ DECLARE_SOA_TABLE(UDnSigmas, "AOD", "UDNSIGMAS", //! MCTruth of particle PID and } // namespace o2::aod -#endif // PWGUD_DATAMODEL_MCPIDTABLE_H_ +#endif // O2_ANALYSIS_UDDIFFMCSCAN_H diff --git a/PWGUD/DataModel/SGTables.h b/PWGUD/DataModel/SGTables.h index 4e959cf886f..ddca7abf0fd 100644 --- a/PWGUD/DataModel/SGTables.h +++ b/PWGUD/DataModel/SGTables.h @@ -12,11 +12,15 @@ #ifndef PWGUD_DATAMODEL_SGTABLES_H_ #define PWGUD_DATAMODEL_SGTABLES_H_ -#include -#include +#include "Common/DataModel/TrackSelectionTables.h" + +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/DataTypes.h" +#include "MathUtils/Utils.h" #include -#include +#include namespace o2::aod { diff --git a/PWGUD/DataModel/TauEventTables.h b/PWGUD/DataModel/TauEventTables.h index ae0fd33496e..f508cbc2c4d 100644 --- a/PWGUD/DataModel/TauEventTables.h +++ b/PWGUD/DataModel/TauEventTables.h @@ -16,12 +16,10 @@ /// \brief A table to store information about events preselected to be candidates for UPC gammagamma->tautau /// -#ifndef PWGUD_DATAMODEL_TAUEVENTTABLES_H_ -#define PWGUD_DATAMODEL_TAUEVENTTABLES_H_ +#ifndef ALISW_TAUEVENTTABLES_H +#define ALISW_TAUEVENTTABLES_H -#include - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { @@ -223,4 +221,4 @@ DECLARE_SOA_TABLE(TrueTauTwoTracks, "AOD", "TRUETAUTWOTRACK", } // namespace o2::aod -#endif // PWGUD_DATAMODEL_TAUEVENTTABLES_H_ +#endif // ALISW_TAUEVENTTABLES_H diff --git a/PWGUD/DataModel/TauThreeProngEventTables.h b/PWGUD/DataModel/TauThreeProngEventTables.h index bd7da95f14c..61cc184cbdb 100644 --- a/PWGUD/DataModel/TauThreeProngEventTables.h +++ b/PWGUD/DataModel/TauThreeProngEventTables.h @@ -19,9 +19,7 @@ #ifndef PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ #define PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ -#include - -#include +#include "Framework/AnalysisDataModel.h" // derived tables for tautau->4 (=1+3) tracks namespace o2::aod { diff --git a/PWGUD/DataModel/TwoTracksEventTables.h b/PWGUD/DataModel/TwoTracksEventTables.h index 0f50fe2f493..5eb2640f431 100644 --- a/PWGUD/DataModel/TwoTracksEventTables.h +++ b/PWGUD/DataModel/TwoTracksEventTables.h @@ -21,9 +21,7 @@ #ifndef PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ #define PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ -#include - -#include +#include "Framework/AnalysisDataModel.h" namespace o2::aod { diff --git a/PWGUD/DataModel/UDIndex.h b/PWGUD/DataModel/UDIndex.h index 16a7ed3a5ed..8a4a236c5af 100644 --- a/PWGUD/DataModel/UDIndex.h +++ b/PWGUD/DataModel/UDIndex.h @@ -19,10 +19,9 @@ #ifndef PWGUD_DATAMODEL_UDINDEX_H_ #define PWGUD_DATAMODEL_UDINDEX_H_ -#include "PWGUD/DataModel/UDTables.h" // IWYU pragma: keep - -#include +#include "UDTables.h" +#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace udidx @@ -33,5 +32,4 @@ 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 afb7728a5ab..774bb31751a 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -25,13 +25,12 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include - -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/DataTypes.h" +#include "MathUtils/Utils.h" #include -#include #include namespace o2::aod diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx index 38ecb5abeb3..1fa1882e7d5 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx @@ -20,13 +20,11 @@ /// \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 d2b4d6408b4..b10b467ec4d 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx @@ -13,15 +13,11 @@ /// \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 e52b6fce784..a41b2c4efa6 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx @@ -15,12 +15,9 @@ #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx index 99de6088fb4..8be7bce717b 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx @@ -20,13 +20,11 @@ /// \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 4806232f490..f9b1f2d0d22 100644 --- a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx @@ -21,13 +21,11 @@ /// \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 eb272397af3..97b60c42c9e 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.cxx +++ b/PWGUD/TableProducer/DGBCCandProducer.cxx @@ -14,45 +14,15 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 30.09.2022 -#include "DGBCCandProducer.h" - -#include "PWGUD/Core/DGCutparHolder.h" -#include "PWGUD/Core/DGSelector.h" +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "ReconstructionDataFormats/Vertex.h" +#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.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 +#include "PWGUD/Core/DGSelector.h" +#include "DGBCCandProducer.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/DGBCCandProducer.h b/PWGUD/TableProducer/DGBCCandProducer.h index 64d30453dbf..5bdc09498c6 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.h +++ b/PWGUD/TableProducer/DGBCCandProducer.h @@ -16,10 +16,13 @@ #ifndef PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ #define PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/DataTypes.h" +#include "MathUtils/Utils.h" -#include +#include +#include namespace o2::aod { diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index a45493d792e..b2702b54546 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -19,42 +19,32 @@ // #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 "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 "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 #include -#include #include -#include #include #include diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index d58c98ac587..2208060bd59 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -11,8 +11,6 @@ /// \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" @@ -20,36 +18,17 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include + +#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 -#include -#include -#include #include #include -#include #include #include #include @@ -624,25 +603,17 @@ 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& 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; + const auto& bcSlice = ambTrk.template bc_as(); + uint64_t trackBC = -1; + if (bcSlice.size() != 0) { + auto first = bcSlice.begin(); + trackBC = first.globalBC(); } - - ambTrIds[trkId] = bcs.iteratorAt(firstBcId).globalBC(); + ambTrIds[trkId] = trackBC; } } @@ -678,22 +649,16 @@ 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()) @@ -718,22 +683,15 @@ 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()) @@ -758,12 +716,9 @@ 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(); @@ -774,13 +729,9 @@ 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()) @@ -849,7 +800,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; if (upcCuts.getAmbigSwitch() != 1) - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); collectBarrelTracks(bcsMatchedTrIdsTOF, 0, @@ -1150,10 +1101,10 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1350,7 +1301,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1605,7 +1556,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, diff --git a/PWGUD/TableProducer/dgCandProducer.cxx b/PWGUD/TableProducer/dgCandProducer.cxx index 6c075229fb1..d47093843fb 100644 --- a/PWGUD/TableProducer/dgCandProducer.cxx +++ b/PWGUD/TableProducer/dgCandProducer.cxx @@ -12,46 +12,21 @@ // \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 "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 "CCDB/BasicCCDBManager.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Vertex.h" + #include -#include #include #include diff --git a/PWGUD/TableProducer/fwdTrackPropagation.cxx b/PWGUD/TableProducer/fwdTrackPropagation.cxx index 655e78535a1..64099fac4ed 100644 --- a/PWGUD/TableProducer/fwdTrackPropagation.cxx +++ b/PWGUD/TableProducer/fwdTrackPropagation.cxx @@ -17,30 +17,21 @@ #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 "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 diff --git a/PWGUD/TableProducer/tauEventTableProducer.cxx b/PWGUD/TableProducer/tauEventTableProducer.cxx index d91c5dffe8d..ec08a426f35 100644 --- a/PWGUD/TableProducer/tauEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauEventTableProducer.cxx @@ -16,29 +16,32 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include +#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" using namespace o2; using namespace o2::framework; @@ -49,7 +52,7 @@ struct TauEventTableProducer { Produces tauTwoTracks; Produces trueTauTwoTracks; - // Global variables + // Global varialbes Service pdg; SGSelector sgSelector; diff --git a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx index 87878b7b364..1900e1a1232 100644 --- a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx @@ -23,38 +23,40 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx index 36c5c44112f..3af6a964021 100644 --- a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx +++ b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx @@ -16,33 +16,35 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#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 +// ROOT +#include "Math/Vector4D.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx index f97fe33a3f3..cea35fb70ea 100644 --- a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx +++ b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx @@ -16,18 +16,14 @@ /// \brief A task to create a reverse index from UDMcCollisions to UDCollisions /// -#include "PWGUD/DataModel/UDIndex.h" -#include "PWGUD/DataModel/UDTables.h" - -#include -#include -#include -#include -#include -#include - #include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/DataModel/UDIndex.h" + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcParticles2udTracks.cxx b/PWGUD/TableProducer/udMcParticles2udTracks.cxx index e4f18bc20d9..4a876a72fb3 100644 --- a/PWGUD/TableProducer/udMcParticles2udTracks.cxx +++ b/PWGUD/TableProducer/udMcParticles2udTracks.cxx @@ -16,18 +16,14 @@ /// \brief A task to create a reverse index from UDMcParticles to UDTracks /// -#include "PWGUD/DataModel/UDIndex.h" -#include "PWGUD/DataModel/UDTables.h" - -#include -#include -#include -#include -#include -#include - #include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/DataModel/UDIndex.h" + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index 42aa8108dd1..c97704fe2ce 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -16,45 +16,27 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" -#include "PWGUD/DataModel/UDTables.h" #include "Common/Core/fwdtrackUtilities.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 "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 @@ -88,6 +70,8 @@ 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 @@ -96,8 +80,6 @@ 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; @@ -113,12 +95,6 @@ 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; @@ -138,28 +114,24 @@ struct UpcCandProducerGlobalMuon { histRegistry.get(HIST("MuonsSelCounter"))->GetXaxis()->SetBinLabel(upchelpers::kFwdSelChi2 + 1, "Chi2"); // NEW: Add histograms for global track monitoring - 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}); + 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("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}}); + } } bool cut(const o2::dataformats::GlobalFwdTrack& pft, const ForwardTracks::iterator& fwdTrack) @@ -397,11 +369,13 @@ struct UpcCandProducerGlobalMuon { float px, py, pz; int sign; - // 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()); + // 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()); + } } if (fUpcCuts.getUseFwdCuts()) { @@ -478,11 +452,11 @@ struct UpcCandProducerGlobalMuon { } int newId = 0; - for (const auto& trackId : trackIds) { + for (auto trackId : trackIds) { auto it = clustersPerTrack.find(trackId); if (it != clustersPerTrack.end()) { const auto& clusters = it->second; - for (const auto& clsId : clusters) { + for (auto clsId : clusters) { const auto& clsInfo = fwdTrkCls.iteratorAt(clsId); udFwdTrkClusters(newId, clsInfo.x(), clsInfo.y(), clsInfo.z(), clsInfo.clInfo()); } @@ -491,6 +465,12 @@ 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} @@ -504,23 +484,6 @@ 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, @@ -614,8 +577,7 @@ struct UpcCandProducerGlobalMuon { std::map> mapGlobalBcsWithMCHMIDTrackIds; std::map> mapGlobalBcsWithMCHTrackIds; - std::map> mapGlobalBcsWithGlobalMuonTrackIds; // MCH-MID-MFT (good timing from MID) - std::map> mapGlobalBcsWithMCHMFTTrackIds; // MCH-MFT only (poor timing) + std::map> mapGlobalBcsWithGlobalTrackIds; // NEW: For global tracks for (const auto& fwdTrack : fwdTracks) { auto trackType = fwdTrack.trackType(); @@ -629,43 +591,35 @@ 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 + kBcTimeRoundingOffset); + auto globalBC = vGlobalBCs[indexBC] + TMath::FloorNint(fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + 1.); if (trackType == MuonStandaloneTrack) { // MCH-MID mapGlobalBcsWithMCHMIDTrackIds[globalBC].push_back(trackId); } else if (trackType == MCHStandaloneTrack) { // MCH-only mapGlobalBcsWithMCHTrackIds[globalBC].push_back(trackId); - } 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 (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); - } + } else if (fEnableMFT && (trackType == GlobalMuonTrack || trackType == GlobalForwardTrack)) { // NEW: Global tracks + mapGlobalBcsWithGlobalTrackIds[globalBC].push_back(trackId); } } // Map global BC to collisions for DCA-based vertex assignment std::map> mapGlobalBCtoCollisions; - for (const auto& col : collisions) { - uint64_t gbc = vGlobalBCs[col.bcId()]; - mapGlobalBCtoCollisions[gbc].push_back(col.globalIndex()); + 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; - // 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 (!mapGlobalBcsWithGlobalMuonTrackIds.empty()) { - for (const auto& gbc_anchorids : mapGlobalBcsWithGlobalMuonTrackIds) { - uint64_t globalBcAnchor = gbc_anchorids.first; - auto itFv0Id = mapGlobalBcWithV0A.find(globalBcAnchor); + // 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); if (itFv0Id != mapGlobalBcWithV0A.end()) { auto fv0Id = itFv0Id->second; const auto& fv0 = fv0s.iteratorAt(fv0Id); @@ -676,43 +630,32 @@ struct UpcCandProducerGlobalMuon { continue; } - 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); + auto& vGlobalIds = gbc_globalids.second; // Step 1: Find best collision vertex using DCA-based propagation + // (adapted from ambiguousTrackPropagation processMFTReassoc3D) float bestVtxX = 0., bestVtxY = 0., bestVtxZ = 0.; - double bestAvgDCA = kInvalidDCA; + double bestAvgDCA = 999.; bool hasVertex = false; int nCompatColls = 0; for (int dbc = -static_cast(fBcWindowCollision); dbc <= static_cast(fBcWindowCollision); dbc++) { - uint64_t searchBC = globalBcAnchor + dbc; + uint64_t searchBC = globalBcGlobal + dbc; auto itCol = mapGlobalBCtoCollisions.find(searchBC); if (itCol == mapGlobalBCtoCollisions.end()) continue; - for (const auto& colIdx : itCol->second) { + for (auto colIdx : itCol->second) { nCompatColls++; const auto& col = collisions.iteratorAt(colIdx); double sumDCAxy = 0.; int nTracks = 0; - for (const auto& iglobal : allTrackIds) { + for (const auto& iglobal : vGlobalIds) { const auto& trk = fwdTracks.iteratorAt(iglobal); - auto dca = propagateFwdToDCA(trk, col.posX(), col.posY(), col.posZ()); + auto dca = propagateGlobalToDCA(trk, col.posX(), col.posY(), col.posZ()); sumDCAxy += dca[0]; nTracks++; } - double avgDCA = nTracks > 0 ? sumDCAxy / nTracks : kInvalidDCA; + double avgDCA = nTracks > 0 ? sumDCAxy / nTracks : 999.; if (!hasVertex || avgDCA < bestAvgDCA) { bestAvgDCA = avgDCA; bestVtxX = col.posX(); @@ -725,80 +668,60 @@ struct UpcCandProducerGlobalMuon { histRegistry.fill(HIST("hNCompatColls"), nCompatColls); - // 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) { + // 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) { - const auto& trk = fwdTracks.iteratorAt(ianchor); - auto dca = propagateFwdToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + 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); - } - // Fill invariant mass from MCH-MID-MFT anchors only - uint16_t numContribAnch = numContrib; - if (numContribAnch >= kMinTracksForPair) { - double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; - histRegistry.fill(HIST("hMassGlobalMuon"), mass2 > 0. ? std::sqrt(mass2) : 0.); + // 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()); + } + } + } } - // 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 = propagateFwdToDCA(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)) + // 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; - 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(imchMft); - } - - // Fill invariant mass including MCH-MFT tracks (only if MCH-MFT tracks were added) - 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.); + selTrackIds.push_back(trkId); } - if (numContrib < kMinTracksForCandidate) + if (numContrib < 1) continue; - eventCandidates(globalBcAnchor, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); + eventCandidates(globalBcGlobal, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); std::vector amplitudesV0A{}; std::vector relBCsV0A{}; std::vector amplitudesT0A{}; std::vector relBCsT0A{}; if (nFV0s > 0) { - getFV0Amplitudes(globalBcAnchor, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); + getFV0Amplitudes(globalBcGlobal, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); } eventCandidatesSelsFwd(0., 0., amplitudesT0A, relBCsT0A, amplitudesV0A, relBCsV0A); if (nZdcs > 0) { - auto itZDC = mapGlobalBcWithZdc.find(globalBcAnchor); + auto itZDC = mapGlobalBcWithZdc.find(globalBcGlobal); if (itZDC != mapGlobalBcWithZdc.end()) { const auto& zdc = zdcs.iteratorAt(itZDC->second); float timeZNA = zdc.timeZNA(); @@ -834,7 +757,7 @@ struct UpcCandProducerGlobalMuon { numContrib++; selTrackIds.push_back(imuon); } - if (numContrib < kMinTracksForCandidate) // didn't save any MCH-MID tracks + if (numContrib < 1) // didn't save any MCH-MID tracks continue; std::map mapMchIdBc{}; getMchTrackIds(globalBcMid, mapGlobalBcsWithMCHTrackIds, fBcWindowMCH, mapMchIdBc); @@ -881,8 +804,7 @@ struct UpcCandProducerGlobalMuon { vAmbFwdTrackIndexBCs.clear(); mapGlobalBcsWithMCHMIDTrackIds.clear(); mapGlobalBcsWithMCHTrackIds.clear(); - mapGlobalBcsWithGlobalMuonTrackIds.clear(); - mapGlobalBcsWithMCHMFTTrackIds.clear(); + mapGlobalBcsWithGlobalTrackIds.clear(); mapGlobalBCtoCollisions.clear(); selTrackIds.clear(); } diff --git a/PWGUD/TableProducer/upcCandProducerMuon.cxx b/PWGUD/TableProducer/upcCandProducerMuon.cxx index 0ac8458d60f..329a83b432c 100644 --- a/PWGUD/TableProducer/upcCandProducerMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerMuon.cxx @@ -16,37 +16,24 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" -#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 "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 -#include #include #include diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index ab54549251c..d8aa575b906 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -254,11 +254,6 @@ 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 @@ -277,4 +272,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) + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/Tasks/FwdMuonsUPC.cxx b/PWGUD/Tasks/FwdMuonsUPC.cxx index b3351965727..0c4b3d81e3b 100644 --- a/PWGUD/Tasks/FwdMuonsUPC.cxx +++ b/PWGUD/Tasks/FwdMuonsUPC.cxx @@ -16,28 +16,22 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include +#include "TLorentzVector.h" +#include "TSystem.h" +#include "TMath.h" +#include "TRandom3.h" // table for saving tree with info on data namespace dimu diff --git a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx index 26d8c91c0e0..4347871377a 100644 --- a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx +++ b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx @@ -13,28 +13,18 @@ /// /// \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 "Common/DataModel/EventSelection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include +// #include "TLorentzVector.h" +// #include "TVector3.h" +#include "Math/LorentzVector.h" // ROOT::Math::LorentzVector +#include "Math/PxPyPzM4D.h" // ROOT::Math::PxPyPzM4D +#include "TMath.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/decayTreeAnalyzer.cxx b/PWGUD/Tasks/decayTreeAnalyzer.cxx index 5a46ed7c8cb..c725a2ca72a 100644 --- a/PWGUD/Tasks/decayTreeAnalyzer.cxx +++ b/PWGUD/Tasks/decayTreeAnalyzer.cxx @@ -13,27 +13,18 @@ // \author Paul Buehler, paul.buehler@oeaw.ac.at // \since 01.03.2024 -#include "PWGUD/Core/UDGoodRunSelector.h" +#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/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 79b5b6c5f02..d7283115434 100644 --- a/PWGUD/Tasks/dgCandAnalyzer.cxx +++ b/PWGUD/Tasks/dgCandAnalyzer.cxx @@ -18,31 +18,12 @@ #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 -#include - -#include - -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/LHCConstants.h" +#include "DataFormatsParameters/GRPLHCIFData.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + #include #include diff --git a/PWGUD/Tasks/diffMCDataScanner.cxx b/PWGUD/Tasks/diffMCDataScanner.cxx index 06fa70f5220..8ad8d7ae853 100644 --- a/PWGUD/Tasks/diffMCDataScanner.cxx +++ b/PWGUD/Tasks/diffMCDataScanner.cxx @@ -13,32 +13,9 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "PWGUD/Core/UDHelpers.h" +#include "Framework/AnalysisTask.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 +#include "PWGUD/Core/UDHelpers.h" using namespace o2; using namespace o2::framework; @@ -48,7 +25,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 +#include "Framework/runDataProcessing.h" using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/diffMCQA.cxx b/PWGUD/Tasks/diffMCQA.cxx index c6b1f650db2..19bf3016a97 100644 --- a/PWGUD/Tasks/diffMCQA.cxx +++ b/PWGUD/Tasks/diffMCQA.cxx @@ -13,35 +13,13 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "PWGUD/Core/DGCutparHolder.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "TLorentzVector.h" +#include "ReconstructionDataFormats/BCRange.h" +#include "CommonConstants/PhysicsConstants.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 59bdd9a67eb..a1e9ec34185 100644 --- a/PWGUD/Tasks/diffQA.cxx +++ b/PWGUD/Tasks/diffQA.cxx @@ -13,38 +13,14 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 20.05.2022 -#include "PWGUD/Core/DGCutparHolder.h" +#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/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 913319bd785..072ae2d961c 100644 --- a/PWGUD/Tasks/eventByevent.cxx +++ b/PWGUD/Tasks/eventByevent.cxx @@ -10,27 +10,16 @@ // or submit itself to any jurisdiction. // -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" +#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 #include - -#include -#include +#include "TLorentzVector.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/SGTrackSelector.h" using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/exclusivePentaquark.cxx b/PWGUD/Tasks/exclusivePentaquark.cxx index 8f21b5f333f..eb5170bb400 100644 --- a/PWGUD/Tasks/exclusivePentaquark.cxx +++ b/PWGUD/Tasks/exclusivePentaquark.cxx @@ -11,25 +11,15 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include -#include +#include "TLorentzVector.h" +#include +#include +using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhi.cxx b/PWGUD/Tasks/exclusivePhi.cxx index 499f8e1046f..c0850b4b84d 100644 --- a/PWGUD/Tasks/exclusivePhi.cxx +++ b/PWGUD/Tasks/exclusivePhi.cxx @@ -11,27 +11,17 @@ // #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include +#include "TLorentzVector.h" +#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 ae4e80c31ed..cb2d8834862 100644 --- a/PWGUD/Tasks/exclusivePhiLeptons.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptons.cxx @@ -11,27 +11,16 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "TLorentzVector.h" #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 577f25e63c6..ecc65174f26 100644 --- a/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx @@ -8,30 +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. - +#include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include -#include +#include "TLorentzVector.h" #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 c295a40df6e..8cefae2262c 100644 --- a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -14,33 +14,26 @@ /// \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 -#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 "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 diff --git a/PWGUD/Tasks/exclusiveTwoProtons.cxx b/PWGUD/Tasks/exclusiveTwoProtons.cxx index bc3c4783aba..d22c92cccbc 100644 --- a/PWGUD/Tasks/exclusiveTwoProtons.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtons.cxx @@ -11,28 +11,15 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include -#include +#include "TLorentzVector.h" +#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 7d8e3ed9326..521096634e9 100644 --- a/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx @@ -11,28 +11,15 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include -#include +#include "TLorentzVector.h" +#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 6bd5736ee48..b1b70fb5db9 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,7 +56,6 @@ 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}; @@ -377,21 +376,12 @@ 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) { - 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) + 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 7d831eb2bf8..98006bbde6a 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -14,51 +14,41 @@ /// \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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include + +#include "TList.h" +#include "TVector3.h" #include -#include -#include -#include #include #include #include -#include - -#include - -#include #include -#include #include -#include #include #include #include @@ -125,18 +115,9 @@ 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"}; @@ -226,15 +207,13 @@ struct FlowCumulantsUpc { // Add some output objects to the histogram registry // Event QA - registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{6, 0, 6}}}); + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{5, 0, 5}}}); 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(6, "after consistency check"); - - registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{7, 0, 7}}}); + registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{5, 0, 5}}}); 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"); @@ -404,34 +383,33 @@ 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); + 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("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); - - // eta region for MC, can be different from data to study the effect of acceptance + 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); + 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 @@ -967,7 +945,7 @@ struct FlowCumulantsUpc { registry.fill(HIST("hMult"), tracks.size()); registry.fill(HIST("hCent"), cent); fGFW->Clear(); - if (cfgIfVertex && std::abs(vtxz) > cfgCutVertex) { + if (cfgIfVertex && abs(vtxz) > cfgCutVertex) { return; } registry.fill(HIST("hEventCount"), 3.5); @@ -983,8 +961,6 @@ 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()); @@ -1010,16 +986,6 @@ 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); @@ -1041,23 +1007,6 @@ 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++) { diff --git a/PWGUD/Tasks/flowMcUpc.cxx b/PWGUD/Tasks/flowMcUpc.cxx deleted file mode 100644 index a927c075658..00000000000 --- a/PWGUD/Tasks/flowMcUpc.cxx +++ /dev/null @@ -1,196 +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. - -/// \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)}; -} diff --git a/PWGUD/Tasks/polarisationRho.cxx b/PWGUD/Tasks/polarisationRho.cxx index 386bd5de510..c10e86baad6 100644 --- a/PWGUD/Tasks/polarisationRho.cxx +++ b/PWGUD/Tasks/polarisationRho.cxx @@ -8,26 +8,13 @@ // 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 - -#include - -#include -#include +#include "TLorentzVector.h" using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgD0Analyzer.cxx b/PWGUD/Tasks/sgD0Analyzer.cxx index 149683c1c40..7e4c2019434 100644 --- a/PWGUD/Tasks/sgD0Analyzer.cxx +++ b/PWGUD/Tasks/sgD0Analyzer.cxx @@ -17,21 +17,15 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" -#include +#include "TLorentzVector.h" +#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 a02a30b621d..6178d4cb0b0 100644 --- a/PWGUD/Tasks/sgExcUniverse.cxx +++ b/PWGUD/Tasks/sgExcUniverse.cxx @@ -15,21 +15,15 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include - -#include +#include "TFile.h" +#include "TTree.h" +#include "TVector3.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgExclOmega.cxx b/PWGUD/Tasks/sgExclOmega.cxx index cb8c298ce0f..858b0499caa 100644 --- a/PWGUD/Tasks/sgExclOmega.cxx +++ b/PWGUD/Tasks/sgExclOmega.cxx @@ -17,28 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" -#include - -#include -#include +#include "TLorentzVector.h" +#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 73d2d5884a5..b0b2058a27d 100644 --- a/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx +++ b/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx @@ -17,21 +17,12 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.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 "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector4D.h" +#include "TMath.h" #include #include diff --git a/PWGUD/Tasks/sgExclusivePhi.cxx b/PWGUD/Tasks/sgExclusivePhi.cxx index a68d9ba8cdb..c4bed3d1456 100644 --- a/PWGUD/Tasks/sgExclusivePhi.cxx +++ b/PWGUD/Tasks/sgExclusivePhi.cxx @@ -12,29 +12,17 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include +#include "TLorentzVector.h" +#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 d3d8a580b4b..1e3fe149e59 100644 --- a/PWGUD/Tasks/sgExclusivePhiITSselections.cxx +++ b/PWGUD/Tasks/sgExclusivePhiITSselections.cxx @@ -12,26 +12,17 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "TLorentzVector.h" #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 f3369b3a7cb..60464ed6cf4 100644 --- a/PWGUD/Tasks/sgFITAnalyzer.cxx +++ b/PWGUD/Tasks/sgFITAnalyzer.cxx @@ -15,29 +15,18 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Common/DataModel/PIDResponseTOF.h" -#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" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgFourPiAnalyzer.cxx b/PWGUD/Tasks/sgFourPiAnalyzer.cxx index ef6f1b17a0b..13979d87c38 100644 --- a/PWGUD/Tasks/sgFourPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgFourPiAnalyzer.cxx @@ -17,27 +17,25 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Common/DataModel/TrackSelectionTables.h" -#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 "TLorentzVector.h" +#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 4ead557224a..eba36e3845c 100644 --- a/PWGUD/Tasks/sgInclJpsi.cxx +++ b/PWGUD/Tasks/sgInclJpsi.cxx @@ -17,27 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" -#include - -#include +#include "TLorentzVector.h" +#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 f68d3b0ddf9..c3038cee058 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -13,16 +13,19 @@ // \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 -#include -#include -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include +#include "TFile.h" +#include "TTree.h" +#include "TVector3.h" +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectra.cxx b/PWGUD/Tasks/sgPIDSpectra.cxx index 706c34a1150..2792dee4be2 100644 --- a/PWGUD/Tasks/sgPIDSpectra.cxx +++ b/PWGUD/Tasks/sgPIDSpectra.cxx @@ -15,21 +15,15 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include -#include - -#include -#include +#include "TFile.h" +#include "TTree.h" +#include "TVector3.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectraTable.cxx b/PWGUD/Tasks/sgPIDSpectraTable.cxx index 75b81336c3d..bd781969afc 100644 --- a/PWGUD/Tasks/sgPIDSpectraTable.cxx +++ b/PWGUD/Tasks/sgPIDSpectraTable.cxx @@ -12,21 +12,18 @@ // \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 -#include -#include -#include -#include -#include -#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" -#include +#include "TFile.h" +#include "TTree.h" +#include "TVector3.h" #include diff --git a/PWGUD/Tasks/sgSixPiAnalyzer.cxx b/PWGUD/Tasks/sgSixPiAnalyzer.cxx index ff288249dc2..1a3ed6604e2 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 -#include -#include -#include -#include -#include -#include -#include -#include +#include "Common/DataModel/TrackSelectionTables.h" -#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 "TLorentzVector.h" +#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 b17c699970f..1d73df42642 100644 --- a/PWGUD/Tasks/sgSpectraAnalyzer.cxx +++ b/PWGUD/Tasks/sgSpectraAnalyzer.cxx @@ -17,31 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include +#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 "PWGUD/Core/RLhelper.h" +#include "TLorentzVector.h" +#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 77c6e4f2d94..7a2c8aefc3c 100644 --- a/PWGUD/Tasks/sgTwoPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgTwoPiAnalyzer.cxx @@ -17,21 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Common/DataModel/TrackSelectionTables.h" -#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 using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index a67bd2bd325..ea7c42308a2 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -16,35 +16,24 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.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 "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 diff --git a/PWGUD/Tasks/testMcStdTabsRl.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx index 7651b5e5c2a..9748b28784f 100644 --- a/PWGUD/Tasks/testMcStdTabsRl.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -16,25 +16,24 @@ /// \since 12.02.2025 // -#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" +// C++ headers +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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" -#include +// O2Physics headers +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" + +// ROOT headers +#include "Math/Vector4D.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcAnalysis.cxx b/PWGUD/Tasks/upcAnalysis.cxx index f6dc8ba1323..74a007314e0 100644 --- a/PWGUD/Tasks/upcAnalysis.cxx +++ b/PWGUD/Tasks/upcAnalysis.cxx @@ -9,22 +9,16 @@ // 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/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include -#include -#include -#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" -#include -#include -#include +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" -#include -#include +#include +#include +#include "TLorentzVector.h" using namespace o2; using namespace o2::aod::evsel; diff --git a/PWGUD/Tasks/upcCandidateAnalyzer.cxx b/PWGUD/Tasks/upcCandidateAnalyzer.cxx index dcf23797803..568ecacb872 100644 --- a/PWGUD/Tasks/upcCandidateAnalyzer.cxx +++ b/PWGUD/Tasks/upcCandidateAnalyzer.cxx @@ -9,23 +9,12 @@ // 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 -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include +#include "TLorentzVector.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index c33c17ecfe4..51241be5d69 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -15,32 +15,23 @@ /// \author Roman Lavicka , Austrian Academy of Sciences & SMI /// \since 09.08.2024 -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/UDTables.h" +#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 "Common/CCDB/EventSelectionParams.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 "PWGUD/DataModel/UDTables.h" +#include "PWGUD/Core/SGSelector.h" + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcForward.cxx b/PWGUD/Tasks/upcForward.cxx index 49325f3e0db..bebcf0b2be2 100644 --- a/PWGUD/Tasks/upcForward.cxx +++ b/PWGUD/Tasks/upcForward.cxx @@ -14,26 +14,16 @@ 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 "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" #include "Common/DataModel/EventSelection.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - #include +#include +#include +#include +#include "TLorentzVector.h" +#include "Common/CCDB/TriggerAliases.h" using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/upcJpsiCorr.cxx b/PWGUD/Tasks/upcJpsiCorr.cxx index 1732869e0d6..ad0145dae34 100644 --- a/PWGUD/Tasks/upcJpsiCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCorr.cxx @@ -15,33 +15,25 @@ /// \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" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include +// ROOT headers +#include "TLorentzVector.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcMft.cxx b/PWGUD/Tasks/upcMft.cxx index 6349589e6b4..a3ae2b03287 100644 --- a/PWGUD/Tasks/upcMft.cxx +++ b/PWGUD/Tasks/upcMft.cxx @@ -9,35 +9,31 @@ // 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 +// 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" // define namespaces using namespace o2; diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index 0ae2035f93a..68f9c1698e1 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 using namespace o2; diff --git a/PWGUD/Tasks/upcPionAnalysis.cxx b/PWGUD/Tasks/upcPionAnalysis.cxx index 470281f0a77..fc215ea1822 100644 --- a/PWGUD/Tasks/upcPionAnalysis.cxx +++ b/PWGUD/Tasks/upcPionAnalysis.cxx @@ -9,35 +9,18 @@ // 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/Core/SGTrackSelector.h" +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#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 "TLorentzVector.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/SGTrackSelector.h" +#include "Common/Core/RecoDecay.h" using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx index d026d6ce962..88d8f36d18d 100644 --- a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx +++ b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx @@ -19,25 +19,19 @@ #include "Common/Core/RecoDecay.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include +#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 diff --git a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx index b87d5f3eb29..8baf7f42206 100644 --- a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx +++ b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx @@ -31,31 +31,36 @@ // #include "PWGUD/Core/SGSelector.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 "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 #include -#include #include +#include #include #include diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index 18c3eb5f08a..2b5d7405fca 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -19,31 +19,13 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.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 "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector4D.h" +#include "TPDGCode.h" + #include #include #include @@ -817,7 +799,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 703f0989283..f8f03970ff0 100644 --- a/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx @@ -15,25 +15,16 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.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 -#include +#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 diff --git a/PWGUD/Tasks/upcTauRl.cxx b/PWGUD/Tasks/upcTauRl.cxx index 264dae05eb8..78e9f7b48ae 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#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 +// ROOT headers +#include "Math/Vector4D.h" +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTauTau13topo.cxx b/PWGUD/Tasks/upcTauTau13topo.cxx index a14ebd9cb35..d2dd61ade0c 100644 --- a/PWGUD/Tasks/upcTauTau13topo.cxx +++ b/PWGUD/Tasks/upcTauTau13topo.cxx @@ -17,35 +17,27 @@ // 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include +#include "Common/DataModel/PIDResponseTPC.h" +// #include +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTestFITBitMapping.cxx b/PWGUD/Tasks/upcTestFITBitMapping.cxx index eefd4f0aa83..8456c46dc85 100644 --- a/PWGUD/Tasks/upcTestFITBitMapping.cxx +++ b/PWGUD/Tasks/upcTestFITBitMapping.cxx @@ -16,19 +16,13 @@ #include "PWGUD/Core/UDHelpers.h" // udhelpers::Bits256, makeBits256, testBit, getPhiEtaFromFitBit #include "PWGUD/DataModel/UDTables.h" // aod::UDCollisionFITBits -#include // o2::ft0::Geometry -#include -#include -#include -#include -#include -#include +#include "FT0Base/Geometry.h" // o2::ft0::Geometry +#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/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx index 2e70f5c2a1a..5f6d1bd8db1 100644 --- a/PWGUD/Tasks/upcTestRctTables.cxx +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -16,21 +16,18 @@ /// \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 fab4246a0f7..45b3844ed51 100644 --- a/PWGUD/Tasks/upcVetoAnalysis.cxx +++ b/PWGUD/Tasks/upcVetoAnalysis.cxx @@ -8,40 +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. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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; diff --git a/Tools/KFparticle/qaKFEventTrack.cxx b/Tools/KFparticle/qaKFEventTrack.cxx index 2242de51154..f3f026a8da7 100644 --- a/Tools/KFparticle/qaKFEventTrack.cxx +++ b/Tools/KFparticle/qaKFEventTrack.cxx @@ -15,42 +15,47 @@ /// \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/Multiplicity.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 "Tools/KFparticle/KFUtilities.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include +/// includes KFParticle +#include "KFParticle.h" +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFParticleBase.h" +#include "KFVertex.h" + +#ifndef HomogeneousField + +#define HomogeneousField + +#endif -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 51f505a435e..399a3139a91 100644 --- a/Tools/KFparticle/qaKFEventTrack.h +++ b/Tools/KFparticle/qaKFEventTrack.h @@ -15,11 +15,9 @@ #ifndef TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ #define TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ -#include - -#include - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/Core/trackUtilities.h" enum FlagsTracks { kITS = BIT(0), diff --git a/Tools/KFparticle/qaKFParticle.h b/Tools/KFparticle/qaKFParticle.h index e9c8f298325..afb23851cb5 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 - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/Core/trackUtilities.h" enum Source { kPrompt = BIT(0), diff --git a/Tools/KFparticle/qaKFParticleLc.cxx b/Tools/KFparticle/qaKFParticleLc.cxx index 86902d349cd..792acdff439 100644 --- a/Tools/KFparticle/qaKFParticleLc.cxx +++ b/Tools/KFparticle/qaKFParticleLc.cxx @@ -15,40 +15,52 @@ /// \brief Task to test the performance of the KFParticle package on the Lc to pKpi decay /// -#ifndef HomogeneousField -#define HomogeneousField -#endif - #include "Tools/KFparticle/qaKFParticleLc.h" +#include "TableHelper.h" + +#include + +#include +#include + +#include + +/// 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" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/// includes KFParticle +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFParticle.h" +#include "KFParticleBase.h" +#include "KFVertex.h" -#include +#ifndef HomogeneousField -#include -#include -#include +#define HomogeneousField -#include -#include -#include +#endif using namespace o2; using namespace o2::framework; diff --git a/Tools/KFparticle/qaKFParticleLc.h b/Tools/KFparticle/qaKFParticleLc.h index 29fc5707be4..8c57232f99a 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 - -#include +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/Core/trackUtilities.h" enum Source { kPrompt = BIT(0), diff --git a/Tools/ML/model.cxx b/Tools/ML/model.cxx index 6d2098068aa..a60abc65af5 100644 --- a/Tools/ML/model.cxx +++ b/Tools/ML/model.cxx @@ -23,7 +23,6 @@ #include -#include #include #include diff --git a/Tools/ML/model.h b/Tools/ML/model.h index 3be08e72fa9..468c3dfd733 100644 --- a/Tools/ML/model.h +++ b/Tools/ML/model.h @@ -22,7 +22,6 @@ #include -#include #include #include