From d5930d2ae78e19d2895d22a8da0b12a9731e481c Mon Sep 17 00:00:00 2001 From: Bianca-Maria Popa Date: Tue, 12 Aug 2025 15:30:10 +0200 Subject: [PATCH 1/9] PWGCF: V0-V0 pair task --- .../FemtoDream/Core/femtoDreamDetaDphiStar.h | 110 ++- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 5 + .../Tasks/femtoDreamPairTaskV0V0.cxx | 721 ++++++++++++++++++ 3 files changed, 835 insertions(+), 1 deletion(-) create mode 100644 PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx diff --git a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h index 58dc6c9ded4..3e60a81f16c 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h +++ b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h @@ -98,6 +98,24 @@ class FemtoDreamDetaDphiStar } } } + if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kV0) { + for (int i = 0; i < 4; i++) { + std::string dirName = static_cast(dirNames[1]); + histdetadpi[i][0] = mHistogramRegistry->add((dirName + static_cast(histNames[0][i]) + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpi[i][1] = mHistogramRegistry->add((dirName + static_cast(histNames[1][i]) + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpi[i][2] = mHistogramRegistry->add((dirName + "at_PV_" + std::to_string(i) + "_before" + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpi[i][3] = mHistogramRegistry->add((dirName + "at_PV_" + std::to_string(i) + "_after" + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + if (plotForEveryRadii) { + for (int j = 0; j < 9; j++) { + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[i][j]) + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + } + } + if (fillQA) { + histdetadpi_eta[i] = mHistogramRegistry->add((dirName + "dEtadPhi_Eta_" + std::to_string(i) + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}; #eta_{1}; #eta_{2}", kTHnSparseF, {{100, -0.15, 0.15}, {100, -0.15, 0.15}, {100, -0.8, 0.8}, {100, -0.8, 0.8}}); + histdetadpi_phi[i] = mHistogramRegistry->add((dirName + "dEtadPhi_Phi_" + std::to_string(i) + static_cast(histNameSEorME[meORse])).c_str(), "; #Delta #eta; #Delta #phi^{*}; #phi_{1}; #phi_{2}", kTHnSparseF, {{100, -0.15, 0.15}, {100, -0.15, 0.15}, {100, 0, 6.28}, {100, 0, 6.28}}); + } + } + } if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCharmHadron) { for (int i = 0; i < Nprongs; i++) { std::string dirName = static_cast(dirNames[2]); @@ -293,6 +311,95 @@ class FemtoDreamDetaDphiStar } } } + return pass; + } else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kV0) { + /// V0-V0 combination + // check if provided particles are in agreement with the class instantiation + if (part1.partType() != o2::aod::femtodreamparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtodreamparticle::ParticleType::kV0) { + LOG(fatal) << "FemtoDreamDetaDphiStar: passed arguments don't agree with FemtoDreamDetaDphiStar instantiation! Please provide kV0,kV0 candidates."; + return false; + } + + bool pass = false; + int nhist = 0; + for (int i = 0; i < 2; i++) { + int indexOfDaughterPart1, indexOfDaughterPart2; + for (int j = 0; j < 2; j++) { + if (isMixedEventLambda) { + indexOfDaughterPart1 = part1.globalIndex() - 2 + i; + indexOfDaughterPart2 = part2.globalIndex() - 2 + j; + } else { + indexOfDaughterPart1 = part1.index() - 2 + i; + indexOfDaughterPart2 = part2.index() - 2 + j; + } + + + auto daughterPart1 = particles.begin() + indexOfDaughterPart1; + auto daughterPart2 = particles.begin() + indexOfDaughterPart2; + auto deta = daughterPart1.eta() - daughterPart2.eta(); + auto dphi_AT_PV = daughterPart1.phi() - daughterPart2.phi(); + auto dphi_AT_SpecificRadii = PhiAtSpecificRadiiTPC(daughterPart1, radiiTPC) - PhiAtSpecificRadiiTPC(daughterPart2, radiiTPC); + bool sameCharge = false; + auto dphiAvg = AveragePhiStar(*daughterPart1, *daughterPart2, nhist, &sameCharge); + if (Q3 == 999) { + histdetadpi[nhist][0]->Fill(deta, dphiAvg); + histdetadpi[nhist][2]->Fill(deta, dphi_AT_PV); + if (fillQA) { + histdetadpi_eta[nhist]->Fill(deta, dphiAvg, daughterPart1.eta(), daughterPart2.eta()); + histdetadpi_phi[nhist]->Fill(deta, dphiAvg, daughterPart1.phi(), daughterPart2.phi()); + } + } /* else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[i][0]->Fill(deta, dphiAvg); + histdetadpi[i][2]->Fill(deta, dphi_AT_PV); + if (fillQA) { + histdetadpi_eta[i]->Fill(deta, dphiAvg, part1.eta(), daughter.eta()); + histdetadpi_phi[i]->Fill(deta, dphiAvg, part1.phi(), daughter.phi()); + } + } */ + if (sameCharge) { + if (atWhichRadiiToSelect == 1) { + if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } + } + } else if (atWhichRadiiToSelect == 0) { + if (pow(dphi_AT_PV, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } + } + } else if (atWhichRadiiToSelect == 2) { + if (pow(dphi_AT_SpecificRadii, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } + } + } + } + nhist += 1; + } + } + + return pass; } else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCharmHadron) { // check if provided particles are in agreement with the class instantiation @@ -378,7 +485,8 @@ class FemtoDreamDetaDphiStar histdetadpi[i][3]->Fill(deta, dphi_AT_PV); } } - } else if (atWhichRadiiToSelect == 2) { + } + else if (atWhichRadiiToSelect == 2) { if (pow(dphi_AT_SpecificRadii, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { pass = true; } else { diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 3341346bb24..166ff4994e7 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -68,3 +68,8 @@ o2physics_add_dpl_workflow(femtodream-hash SOURCES femtoDreamHashTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(femtodream-pair-v0-v0 + SOURCES femtoDreamPairTaskV0V0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx new file mode 100644 index 00000000000..72c17c2fe6a --- /dev/null +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -0,0 +1,721 @@ +// Copyright 2019-2025 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoDreamPairTaskTrackTrack.cxx +/// \brief Tasks that reads the track tables used for the pairing and builds pairs of two tracks +/// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de +/// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de +/// \author Anton Riedel, TU München, anton.riedel@tum.de + +#include +#include +#include +#include +#include "TRandom3.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/Configurable.h" +#include "Framework/Expressions.h" + +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +using namespace o2::aod; +using namespace o2::soa; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::analysis::femtoDream; + +struct femtoDreamPairTaskV0V0 { + SliceCache cache; + Preslice perCol = aod::femtodreamparticle::fdCollisionId; + + /// General options + struct : ConfigurableGroup { + std::string prefix = std::string("Option"); + Configurable IsMC{"IsMC", false, "Enable additional Histogramms in the case of runninger over Monte Carlo"}; + Configurable Use4D{"Use4D", false, "Enable four dimensional histogramms (to be used only for analysis with high statistics): k* vs multiplicity vs multiplicity percentil vs mT"}; + Configurable ExtendedPlots{"ExtendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"}; + Configurable HighkstarCut{"HighkstarCut", -1., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"}; + Configurable SameSpecies{"SameSpecies", true, "Set to true if particle 1 and particle 2 are the same species"}; + Configurable MixEventWithPairs{"MixEventWithPairs", false, "Only use events that contain particle 1 and partile 2 for the event mixing"}; + Configurable RandomizePair{"RandomizePair", false, "Randomly mix particle 1 and particle 2 in case both are identical"}; + Configurable CPROn{"CPROn", true, "Close Pair Rejection"}; + Configurable CPROld{"CPROld", false, "Set to FALSE to use fixed version of CPR (for testing now, will be default soon)"}; + Configurable CPRSepMeSe{"CPRSepMESE", true, "Use seperated plots for same and mixed event for CPR plots"}; + Configurable CPRPlotPerRadii{"CPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable CPRdeltaPhiMax{"CPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; + Configurable CPRdeltaEtaMax{"CPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; + Configurable DCACutPtDep{"DCACutPtDep", false, "Use pt dependent dca cut"}; + Configurable SmearingByOrigin{"SmearingByOrigin", false, "Obtain the smearing matrix differential in the MC origin of particle 1 and particle 2. High memory consumption"}; + ConfigurableAxis Dummy{"Dummy", {1, 0, 1}, "Dummy axis"}; + } Option; + + /// Event selection + struct : ConfigurableGroup { + std::string prefix = std::string("EventSel"); + Configurable MultMin{"MultMin", 0, "Minimum Multiplicity (MultNtr)"}; + Configurable MultMax{"MultMax", 99999, "Maximum Multiplicity (MultNtr)"}; + Configurable MultPercentileMin{"MultPercentileMin", 0, "Maximum Multiplicity Percentile"}; + Configurable MultPercentileMax{"MultPercentileMax", 100, "Minimum Multiplicity Percentile"}; + } EventSel; + + Filter EventMultiplicity = aod::femtodreamcollision::multNtr >= EventSel.MultMin && aod::femtodreamcollision::multNtr <= EventSel.MultMax; + Filter EventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= EventSel.MultPercentileMin && aod::femtodreamcollision::multV0M <= EventSel.MultPercentileMax; + + using FilteredCollisions = soa::Filtered; + using FilteredCollision = FilteredCollisions::iterator; + using FilteredMCCollisions = soa::Filtered>; + using FilteredMCCollision = FilteredMCCollisions::iterator; + + using FilteredMaskedCollisions = soa::Filtered>; + using FilteredMaskedCollision = FilteredMaskedCollisions::iterator; + using FilteredMaskedMCCollisions = soa::Filtered>; + using FilteredMaskedMCCollision = FilteredMaskedMCCollisions::iterator; + + femtodreamcollision::BitMaskType BitMask = 0; + + /// Particle 1 (V0) + struct : ConfigurableGroup { + std::string prefix = std::string("V01"); + Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 1 (V0)"}; + Configurable CutBit{"CutBit", 7518, "Selection bit for particle 1 (V0)"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; + + Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 1 (particle) (V0)"}; + Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 1 (particle) (V0)"}; + Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 1 (antiparticle) (V0)"}; + Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 1 (antiparticle) (V0)"}; + + Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 1 (V0)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 1 (V0)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 1 (V0)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 1 (V0)"}; + } V01; + + /// Partition for particle 1 + Partition PartitionV01 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V01.CutBit) == V01.CutBit) && + (aod::femtodreamparticle::pt > V01.PtMin) && + (aod::femtodreamparticle::pt < V01.PtMax) && + (aod::femtodreamparticle::eta > V01.EtaMin) && + (aod::femtodreamparticle::eta < V01.EtaMax) && + (aod::femtodreamparticle::mLambda > V01.InvMassMin) && + (aod::femtodreamparticle::mLambda < V01.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); + + /* + Partition PartitionMCV01 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V01.CutBit) == V01.CutBit) && + (aod::femtodreamparticle::pt > V01.PtMin) && + (aod::femtodreamparticle::pt < V01.PtMax) && + (aod::femtodreamparticle::eta > V01.EtaMax) && + (aod::femtodreamparticle::eta < V01.EtaMin) && + (aod::femtodreamparticle::mLambda > V01.InvMassMin) && + (aod::femtodreamparticle::mLambda < V01.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); + */ + + /// Histogramming for particle 1 + FemtoDreamParticleHisto trackHistoPartOne; + FemtoDreamParticleHisto posChildHistos; + FemtoDreamParticleHisto negChildHistos; + + + /// Particle 2 (V0) + struct : ConfigurableGroup { + std::string prefix = std::string("V02"); + Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 2 (V0)"}; + Configurable CutBit{"CutBit", 7518, "Selection bit for particle 2 (V0)"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; + + Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 2 (particle) (V0)"}; + Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 2 (particle) (V0)"}; + Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 2 (antiparticle) (V0)"}; + Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 2 (antiparticle) (V0)"}; + + Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 2 (V0)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 2 (V0)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 2 (V0)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 2 (V0)"}; + } V02; + + /// Partition for particle 2 + Partition PartitionV02 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V02.CutBit) == V02.CutBit) && + (aod::femtodreamparticle::pt > V02.PtMin) && + (aod::femtodreamparticle::pt < V02.PtMax) && + (aod::femtodreamparticle::eta > V02.EtaMin) && + (aod::femtodreamparticle::eta < V02.EtaMax) && + (aod::femtodreamparticle::mLambda > V02.InvMassMin) && + (aod::femtodreamparticle::mLambda < V02.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); + + /* + Partition PartitionMCV02 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V02.CutBit) == V02.CutBit) && + (aod::femtodreamparticle::pt > V02.PtMin) && + (aod::femtodreamparticle::pt < V02.PtMax) && + (aod::femtodreamparticle::eta > V02.EtaMax) && + (aod::femtodreamparticle::eta < V02.EtaMin) && + (aod::femtodreamparticle::mLambda > V02.InvMassMin) && + (aod::femtodreamparticle::mLambda < V02.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); + */ + + /// Histogramming for particle 2 + /* + FemtoDreamParticleHisto trackHistoPartTwo; + FemtoDreamParticleHisto posChildHistos; + FemtoDreamParticleHisto negChildHistos; + */ + + + /// Histogramming for Event + FemtoDreamEventHisto eventHisto; + + /// Binning configurables + struct : ConfigurableGroup { + std::string prefix = std::string("Binning"); + ConfigurableAxis TempFitVarTrack{"TempFitVarTrack", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Track)"}; + ConfigurableAxis TempFitVarV0{"TempFitVarV0", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis TempFitVarV0Child{"TempFitVarV0Child", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0 child)"}; + ConfigurableAxis InvMass{"InvMass", {200, 1, 1.2}, "InvMass binning"}; + ConfigurableAxis pTTrack{"pTTrack", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Track)"}; + ConfigurableAxis pTV0{"pTV0", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis pTV0Child{"pTV0Child", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis pT{"pT", {20, 0.5, 4.05}, "pT binning"}; + ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis kT{"kT", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis mT{"mT", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis multTempFit{"multTempFit", {1, 0, 1}, "multiplicity for the TempFitVar plot"}; + } Binning; + + struct : ConfigurableGroup { + std::string prefix = "Binning4D"; + ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true)"}; + ConfigurableAxis mT{"mT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true)"}; + ConfigurableAxis mult{"mult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true)"}; + ConfigurableAxis multPercentile{"multPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true)"}; + } Binning4D; + + // Mixing configurables + struct : ConfigurableGroup { + std::string prefix = "Mixing"; + ConfigurableAxis MultMixBins{"MultMixBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis MultPercentileMixBins{"MultPercentileMixBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f}, "Mixing bins - multiplicity percentile"}; + ConfigurableAxis VztxMixBins{"VztxMixBins", {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"}; + Configurable Depth{"Depth", 5, "Number of events for mixing"}; + Configurable Policy{"Policy", 0, "Binning policy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both"}; + } Mixing; + + ColumnBinningPolicy colBinningMult{{Mixing.VztxMixBins, Mixing.MultMixBins}, true}; + ColumnBinningPolicy colBinningMultPercentile{{Mixing.VztxMixBins, Mixing.MultPercentileMixBins}, true}; + ColumnBinningPolicy colBinningMultMultPercentile{{Mixing.VztxMixBins, Mixing.MultMixBins, Mixing.MultPercentileMixBins}, true}; + + FemtoDreamContainer sameEventCont; + FemtoDreamContainer mixedEventCont; + //LOGF(info, " Bianca"); + //FemtoDreamPairCleaner pairCleaner; + FemtoDreamDetaDphiStar pairCloseRejectionSE; + FemtoDreamDetaDphiStar pairCloseRejectionME; + /// Histogram output + HistogramRegistry Registry{"Output", {}, OutputObjHandlingPolicy::AnalysisObject}; + + TRandom3* random; + + void init(InitContext& context) + { + + // setup columnpolicy for binning + colBinningMult = {{Mixing.VztxMixBins, Mixing.MultMixBins}, true}; + colBinningMultPercentile = {{Mixing.VztxMixBins, Mixing.MultPercentileMixBins}, true}; + colBinningMultMultPercentile = {{Mixing.VztxMixBins, Mixing.MultMixBins, Mixing.MultPercentileMixBins}, true}; + + if (Option.RandomizePair.value) { + random = new TRandom3(0); + } + eventHisto.init(&Registry, Option.IsMC); + trackHistoPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pT, Option.Dummy, Option.Dummy, Binning.TempFitVarV0, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Binning.InvMass, Option.Dummy, Option.IsMC, V01.PDGCode); + posChildHistos.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTV0Child, Option.Dummy, Option.Dummy, Binning.TempFitVarV0Child, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + negChildHistos.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTV0Child, Option.Dummy, Option.Dummy, Binning.TempFitVarV0Child, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + /* + if (!Option.SameSpecies) { + trackHistoPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pT, Option.Dummy, Option.Dummy, Binning.TempFitVar, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.IsMC, V02.PDGCode); + } + */ + + sameEventCont.init(&Registry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.MultMixBins, Mixing.MultPercentileMixBins, + Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, + Option.IsMC, Option.Use4D, Option.ExtendedPlots, + Option.HighkstarCut, + Option.SmearingByOrigin); + mixedEventCont.init(&Registry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.MultMixBins, Mixing.MultPercentileMixBins, + Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, + Option.IsMC, Option.Use4D, Option.ExtendedPlots, + Option.HighkstarCut, + Option.SmearingByOrigin); + sameEventCont.setPDGCodes(V01.PDGCode, V02.PDGCode); + mixedEventCont.setPDGCodes(V01.PDGCode, V02.PDGCode); + //pairCleaner.init(&Registry); + + if (Option.CPROn.value) { + pairCloseRejectionSE.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 1, Option.CPROld.value); + pairCloseRejectionME.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 2, Option.CPROld.value); + } + + + /* + // get bit for the collision mask + std::bitset<8 * sizeof(femtodreamcollision::BitMaskType)> mask; + int index = 0; + auto& workflows = context.services().get(); + for (DeviceSpec const& device : workflows.devices) { + if (device.name.find("femto-dream-pair-task-v0-v0") != std::string::npos) { + if (containsNameValuePair(device.options, "Option.DCACutPtDep", Option.DCACutPtDep.value) && + containsNameValuePair(device.options, "Option.SameSpecies", Option.SameSpecies.value) && + containsNameValuePair(device.options, "V01.CutBit", V02.CutBit.value) && + containsNameValuePair(device.options, "V01.ChildPos_CutBit", V02.ChildPos_CutBit.value) && + containsNameValuePair(device.options, "V01.ChildPos_TPCBit", V02.ChildPos_TPCBit.value) && + containsNameValuePair(device.options, "V02.ChildNeg_CutBit", V02.ChildNeg_CutBit.value) && + containsNameValuePair(device.options, "V02.ChildNeg_TPCBit", V02.ChildNeg_TPCBit.value) && + containsNameValuePair(device.options, "V02.InvMassMin", V02.InvMassMin.value) && + containsNameValuePair(device.options, "V02.InvMassMax", V02.InvMassMax.value) && + containsNameValuePair(device.options, "V02.InvMassAntiMin", V02.InvMassAntiMin.value) && + containsNameValuePair(device.options, "V02.InvMassAntiMax", V02.InvMassAntiMax.value) && + containsNameValuePair(device.options, "V02.PtMin", V02.PtMin.value) && + containsNameValuePair(device.options, "V02.PtMax", V02.PtMax.value) && + containsNameValuePair(device.options, "V02.EtaMin", V02.EtaMin.value) && + containsNameValuePair(device.options, "V02.EtaMax", V02.EtaMax.value) && + containsNameValuePair(device.options, "Track2.CutBit", Track2.CutBit.value) && + containsNameValuePair(device.options, "Track2.TPCBit", Track2.TPCBit.value) && + containsNameValuePair(device.options, "Track2.TPCTOFBit", Track2.TPCTOFBit.value) && + containsNameValuePair(device.options, "Track2.PIDThres", Track2.PIDThres.value) && + containsNameValuePair(device.options, "Track2.PtMin", Track2.PtMin.value) && + containsNameValuePair(device.options, "Track2.PtMax", Track2.PtMax.value) && + containsNameValuePair(device.options, "Track2.EtaMin", Track2.EtaMin.value) && + containsNameValuePair(device.options, "Track2.EtaMax", Track2.EtaMax.value) && + containsNameValuePair(device.options, "Track2.TempFitVarMin", Track2.TempFitVarMin.value) && + containsNameValuePair(device.options, "Track2.TempFitVarMax", Track2.TempFitVarMax.value)) { + mask.set(index); + BitMask = static_cast(mask.to_ulong()); + LOG(info) << "Configuration matched for device: " << device.name; + LOG(info) << "Bitmask for collisions: " << mask.to_string(); + break; + } else { + index++; + } + } + } + */ + + /* + if ((doprocessSameEvent && doprocessSameEventMasked) || + (doprocessMixedEvent && doprocessMixedEventMasked) || + (doprocessSameEventMC && doprocessSameEventMCMasked) || + (doprocessMixedEventMC && doprocessMixedEventMCMasked)) { + LOG(fatal) << "Normal and masked processing cannot be activated simultaneously!"; + } + */ + }; + + template + void fillCollision(CollisionType col) + { + eventHisto.fillQA(col); + } + + /// This function processes the same event and takes care of all the histogramming + /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... + /// @tparam PartitionType + /// @tparam PartType + /// @tparam isMC: enables Monte Carlo truth specific histograms + /// @param groupPartsOne partition for the first particle passed by the process function + /// @param groupPartsTwo partition for the second particle passed by the process function + /// @param parts femtoDreamParticles table (in case of Monte Carlo joined with FemtoDreamMCLabels) + /// @param magFieldTesla magnetic field of the collision + /// @param multCol multiplicity of the collision + template + void doSameEvent(PartitionType SliceV01, PartitionType SliceV02, PartType parts, Collision col) + { + for (auto& v0 : SliceV01) { + const auto& posChild = parts.iteratorAt(v0.index() - 2); + const auto& negChild = parts.iteratorAt(v0.index() - 1); + // This is how it is supposed to work but there seems to be an issue + // with partitions and accessing elements in tables that have been declared + // with an SELF_INDEX column. Under investigation. Maybe need to change + // femtdream dataformat to take special care of v0 candidates + // auto posChild = v0.template children_as().front(); + // auto negChild = v0.template children_as().back(); + // check cuts on V0 children + if (((posChild.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && + ((posChild.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && + ((negChild.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && + ((negChild.pidcut() & V01.ChildNeg_TPCBit) == V01.ChildNeg_TPCBit)) { + trackHistoPartOne.fillQA(v0, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + } + } + + /* + if (!Option.SameSpecies.value) { + for (auto& v0 : SliceV02) { + const auto& posChild = parts.iteratorAt(v0.index() - 2); + const auto& negChild = parts.iteratorAt(v0.index() - 1); + // This is how it is supposed to work but there seems to be an issue + // with partitions and accessing elements in tables that have been declared + // with an SELF_INDEX column. Under investigation. Maybe need to change + // femtdream dataformat to take special care of v0 candidates + // auto posChild = v0.template children_as().front(); + // auto negChild = v0.template children_as().back(); + // check cuts on V0 children + if (((posChild.cut() & V02.ChildPos_CutBit) == V02.ChildPos_CutBit) && + ((posChild.pidcut() & V02.ChildPos_TPCBit) == V02.ChildPos_TPCBit) && + ((negChild.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && + ((negChild.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { + trackHistoPartTwo.fillQA(v0, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + } + } + } + */ + + /// Now build the combinations + float rand = 0.; + if (Option.SameSpecies.value) { + for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(SliceV01, SliceV02))) { + if (Option.CPROn.value) { + if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { + continue; + } + } + /* + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + */ + + if (Option.RandomizePair.value) { + rand = random->Rndm(); + } + if (rand <= 0.5) { + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } else { + sameEventCont.setPair(p2, p1, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } + } + } + + else { + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { + if (Option.CPROn.value) { + if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { + continue; + } + } + /* + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + */ + + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } + } + } + + /// process function for to call doSameEvent with Data + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoDreamParticleTable + void processSameEvent(FilteredCollision& col, o2::aod::FDParticles& parts) + { + fillCollision(col); + auto SliceV01 = PartitionV01->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto SliceV02 = PartitionV02->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (SliceV01.size() == 0 && SliceV02.size() == 0) { + return; + } + doSameEvent(SliceV01, SliceV02, parts, col); + } + PROCESS_SWITCH(femtoDreamPairTaskV0V0, processSameEvent, "Enable processing same event", true); + + /* + void processSameEventMasked(FilteredMaskedCollision& col, o2::aod::FDParticles& parts) + { + if (Option.SameSpecies.value) { + if ((col.bitmaskTrackOne() & BitMask) != BitMask) { + return; + } + } else { + if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { + return; + } + } + fillCollision(col); + auto SliceTrk1 = PartitionTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto SliceTrk2 = PartitionTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + doSameEvent(SliceTrk1, SliceTrk2, parts, col); + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMasked, "Enable processing same event with masks", false); + */ + + /// process function for to call doSameEvent with Monte Carlo + /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// \param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + /* + void processSameEventMC(FilteredMCCollision& col, + o2::aod::FDMCCollisions&, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + fillCollision(col); + auto SliceMCTrk1 = PartitionMCTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto SliceMCTrk2 = PartitionMCTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (SliceMCTrk1.size() == 0 && SliceMCTrk2.size() == 0) { + return; + } + doSameEvent(SliceMCTrk1, SliceMCTrk2, parts, col); + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMC, "Enable processing same event for Monte Carlo", false); + */ + + /* + void processSameEventMCMasked(FilteredMaskedMCCollision& col, o2::aod::FDMCCollisions&, soa::Join& parts, + o2::aod::FDMCParticles&) + { + if (Option.SameSpecies.value) { + if ((col.bitmaskTrackOne() & BitMask) != BitMask) { + return; + } + } else { + if ((col.bitmaskTrackOne() & BitMask) != BitMask && (col.bitmaskTrackTwo() & BitMask) != BitMask) { + return; + } + } + fillCollision(col); + auto SliceMCTrk1 = PartitionMCTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto SliceMCTrk2 = PartitionMCTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + doSameEvent(SliceMCTrk1, SliceMCTrk2, parts, col); + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMCMasked, "Enable processing same event for Monte Carlo with masked collisions", false); + */ + + template + void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + { + for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { + auto SliceV01 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto SliceV02 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + if (SliceV01.size() == 0 || SliceV02.size() == 0) { + continue; + } + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { + if (Option.CPROn.value) { + if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { + continue; + } + } + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } + } + } + + + template + void doMixedEvent_Masked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + { + if (!Option.SameSpecies.value && !Option.MixEventWithPairs.value) { + // If the two particles are not the same species and the events which are mixed should contain at least one particle of interest, create two paritition of collisions that contain at least one of the two particle of interest and mix them + // Make sure there is a check that we do not mix a event with itself in case it contains both partilces + Partition PartitionMaskedCol1 = (aod::femtodreamcollision::bitmaskTrackOne & BitMask) == BitMask && aod::femtodreamcollision::downsample == true; + PartitionMaskedCol1.bindTable(cols); + Partition PartitionMaskedCol2 = (aod::femtodreamcollision::bitmaskTrackTwo & BitMask) == BitMask && aod::femtodreamcollision::downsample == true; + PartitionMaskedCol2.bindTable(cols); + // use *Partition.mFiltered when passing the partition to mixing object + // there is an issue when the partition is passed directly + // workaround for now, change back once it is fixed + for (auto const& [collision1, collision2] : combinations(soa::CombinationsBlockUpperIndexPolicy(policy, Mixing.Depth.value, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol2.mFiltered))) { + // make sure that tracks in the same events are not mixed + if (collision1.globalIndex() == collision2.globalIndex()) { + continue; + } + auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto SliceTrk2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceTrk1, SliceTrk2))) { + if (Option.CPROn.value) { + if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { + continue; + } + } + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } + } + } else { + // In the other case where the two particles are not the same species and we do not mix event with pairs, we only need to define one partition of collisions and make self combinations + + // define a lambda function for the mixing with selfCombinations policy + auto MixEvents = [policy, &part1, &part2, parts, this](auto& partition) { + for (auto const& [collision1, collision2] : selfCombinations(policy, Mixing.Depth.value, -1, *partition.mFiltered, *partition.mFiltered)) { + auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto SliceTrk2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceTrk1, SliceTrk2))) { + if (Option.CPROn.value) { + if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { + continue; + } + } + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D.value, Option.ExtendedPlots.value, Option.SmearingByOrigin.value); + } + } + }; + if (Option.SameSpecies.value && Option.MixEventWithPairs.value) + // in case of mixing the same species and events that contain pairs, check for bitmask of particle two + // when same species is set to true the bit of particle two is only set if the event contains at least two selected particles + Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask) && aod::femtodreamcollision::downsample == true; + PartitionMaskedCol1.bindTable(cols); + MixEvents(PartitionMaskedCol1); + } else if (Option.SameSpecies.value && !Option.MixEventWithPairs.value) { + // in case of mixing the same species and events that contain at least one selected paritcle, check for bitmask of particle one + Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && aod::femtodreamcollision::downsample == true; + PartitionMaskedCol1.bindTable(cols); + MixEvents(PartitionMaskedCol1); + } else if (!Option.SameSpecies.value && Option.MixEventWithPairs.value) { + // in case of mixing different species and events that contain a pair of selected paritcles, check for both bitmasks of paritcle one and particle two + Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask) && aod::femtodreamcollision::downsample == true; + PartitionMaskedCol1.bindTable(cols); + MixEvents(PartitionMaskedCol1); + } + } + } + + + /// process function for to call doMixedEvent with Data + /// @param cols subscribe to the collisions table (Data) + /// @param parts subscribe to the femtoDreamParticleTable + void processMixedEvent(FilteredCollisions& cols, o2::aod::FDParticles& parts) + { + switch (Mixing.Policy.value) { + case femtodreamcollision::kMult: + doMixedEvent_NotMasked(cols, parts, PartitionV01, PartitionV02, colBinningMult); + break; + case femtodreamcollision::kMultPercentile: + doMixedEvent_NotMasked(cols, parts, PartitionV01, PartitionV02, colBinningMultPercentile); + break; + case femtodreamcollision::kMultMultPercentile: + doMixedEvent_NotMasked(cols, parts, PartitionV01, PartitionV02, colBinningMultMultPercentile); + break; + default: + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; + } + } + PROCESS_SWITCH(femtoDreamPairTaskV0V0, processMixedEvent, "Enable processing mixed events", true); + + /* + void processMixedEventMasked(FilteredMaskedCollisions& cols, o2::aod::FDParticles& parts) + { + switch (Mixing.Policy.value) { + case static_cast(femtodreamcollision::kMult): + doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMult); + break; + case femtodreamcollision::kMultPercentile: + doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMultPercentile); + break; + case femtodreamcollision::kMultMultPercentile: + doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMultMultPercentile); + break; + default: + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; + } + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMasked, "Enable processing mixed events", false); + */ + + /// brief process function for to call doMixedEvent with Monte Carlo + /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) + /// @param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth + /// @param FemtoDreamMCParticles subscribe to the Monte Carlo truth table + /* + void processMixedEventMC(FilteredMCCollisions& cols, o2::aod::FDMCCollisions&, soa::Join& parts, o2::aod::FDMCParticles&) + { + switch (Mixing.Policy.value) { + case femtodreamcollision::kMult: + doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMult); + break; + case femtodreamcollision::kMultPercentile: + doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultPercentile); + break; + case femtodreamcollision::kMultMultPercentile: + doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultMultPercentile); + break; + default: + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; + } + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMC, "Enable processing mixed events MC", false); + */ + + /* + void processMixedEventMCMasked(FilteredMaskedMCCollisions& cols, o2::aod::FDMCCollisions&, soa::Join& parts, o2::aod::FDMCParticles&) + { + switch (Mixing.Policy.value) { + case femtodreamcollision::kMult: + doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMult); + break; + case femtodreamcollision::kMultPercentile: + doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultPercentile); + break; + case femtodreamcollision::kMultMultPercentile: + doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultMultPercentile); + break; + default: + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; + } + } + PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMCMasked, "Enable processing mixed events MC with masked collisions", false); + */ +}; + + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + return workflow; +} From 4d34bd3dcf403bc6d430f4fa042f032316d95a44 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Sat, 16 Aug 2025 00:55:32 +0200 Subject: [PATCH 2/9] Delete commented code and fix bracket bug --- .../Tasks/femtoDreamPairTaskV0V0.cxx | 280 ------------------ 1 file changed, 280 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index 72c17c2fe6a..5dc0e967c00 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -243,7 +243,6 @@ struct femtoDreamPairTaskV0V0 { FemtoDreamContainer sameEventCont; FemtoDreamContainer mixedEventCont; - //LOGF(info, " Bianca"); //FemtoDreamPairCleaner pairCleaner; FemtoDreamDetaDphiStar pairCloseRejectionSE; FemtoDreamDetaDphiStar pairCloseRejectionME; @@ -254,7 +253,6 @@ struct femtoDreamPairTaskV0V0 { void init(InitContext& context) { - // setup columnpolicy for binning colBinningMult = {{Mixing.VztxMixBins, Mixing.MultMixBins}, true}; colBinningMultPercentile = {{Mixing.VztxMixBins, Mixing.MultPercentileMixBins}, true}; @@ -267,11 +265,6 @@ struct femtoDreamPairTaskV0V0 { trackHistoPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pT, Option.Dummy, Option.Dummy, Binning.TempFitVarV0, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Binning.InvMass, Option.Dummy, Option.IsMC, V01.PDGCode); posChildHistos.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTV0Child, Option.Dummy, Option.Dummy, Binning.TempFitVarV0Child, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); negChildHistos.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTV0Child, Option.Dummy, Option.Dummy, Binning.TempFitVarV0Child, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - /* - if (!Option.SameSpecies) { - trackHistoPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pT, Option.Dummy, Option.Dummy, Binning.TempFitVar, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.IsMC, V02.PDGCode); - } - */ sameEventCont.init(&Registry, Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.MultMixBins, Mixing.MultPercentileMixBins, @@ -293,60 +286,6 @@ struct femtoDreamPairTaskV0V0 { pairCloseRejectionSE.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 1, Option.CPROld.value); pairCloseRejectionME.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 2, Option.CPROld.value); } - - - /* - // get bit for the collision mask - std::bitset<8 * sizeof(femtodreamcollision::BitMaskType)> mask; - int index = 0; - auto& workflows = context.services().get(); - for (DeviceSpec const& device : workflows.devices) { - if (device.name.find("femto-dream-pair-task-v0-v0") != std::string::npos) { - if (containsNameValuePair(device.options, "Option.DCACutPtDep", Option.DCACutPtDep.value) && - containsNameValuePair(device.options, "Option.SameSpecies", Option.SameSpecies.value) && - containsNameValuePair(device.options, "V01.CutBit", V02.CutBit.value) && - containsNameValuePair(device.options, "V01.ChildPos_CutBit", V02.ChildPos_CutBit.value) && - containsNameValuePair(device.options, "V01.ChildPos_TPCBit", V02.ChildPos_TPCBit.value) && - containsNameValuePair(device.options, "V02.ChildNeg_CutBit", V02.ChildNeg_CutBit.value) && - containsNameValuePair(device.options, "V02.ChildNeg_TPCBit", V02.ChildNeg_TPCBit.value) && - containsNameValuePair(device.options, "V02.InvMassMin", V02.InvMassMin.value) && - containsNameValuePair(device.options, "V02.InvMassMax", V02.InvMassMax.value) && - containsNameValuePair(device.options, "V02.InvMassAntiMin", V02.InvMassAntiMin.value) && - containsNameValuePair(device.options, "V02.InvMassAntiMax", V02.InvMassAntiMax.value) && - containsNameValuePair(device.options, "V02.PtMin", V02.PtMin.value) && - containsNameValuePair(device.options, "V02.PtMax", V02.PtMax.value) && - containsNameValuePair(device.options, "V02.EtaMin", V02.EtaMin.value) && - containsNameValuePair(device.options, "V02.EtaMax", V02.EtaMax.value) && - containsNameValuePair(device.options, "Track2.CutBit", Track2.CutBit.value) && - containsNameValuePair(device.options, "Track2.TPCBit", Track2.TPCBit.value) && - containsNameValuePair(device.options, "Track2.TPCTOFBit", Track2.TPCTOFBit.value) && - containsNameValuePair(device.options, "Track2.PIDThres", Track2.PIDThres.value) && - containsNameValuePair(device.options, "Track2.PtMin", Track2.PtMin.value) && - containsNameValuePair(device.options, "Track2.PtMax", Track2.PtMax.value) && - containsNameValuePair(device.options, "Track2.EtaMin", Track2.EtaMin.value) && - containsNameValuePair(device.options, "Track2.EtaMax", Track2.EtaMax.value) && - containsNameValuePair(device.options, "Track2.TempFitVarMin", Track2.TempFitVarMin.value) && - containsNameValuePair(device.options, "Track2.TempFitVarMax", Track2.TempFitVarMax.value)) { - mask.set(index); - BitMask = static_cast(mask.to_ulong()); - LOG(info) << "Configuration matched for device: " << device.name; - LOG(info) << "Bitmask for collisions: " << mask.to_string(); - break; - } else { - index++; - } - } - } - */ - - /* - if ((doprocessSameEvent && doprocessSameEventMasked) || - (doprocessMixedEvent && doprocessMixedEventMasked) || - (doprocessSameEventMC && doprocessSameEventMCMasked) || - (doprocessMixedEventMC && doprocessMixedEventMCMasked)) { - LOG(fatal) << "Normal and masked processing cannot be activated simultaneously!"; - } - */ }; template @@ -388,30 +327,6 @@ struct femtoDreamPairTaskV0V0 { } } - /* - if (!Option.SameSpecies.value) { - for (auto& v0 : SliceV02) { - const auto& posChild = parts.iteratorAt(v0.index() - 2); - const auto& negChild = parts.iteratorAt(v0.index() - 1); - // This is how it is supposed to work but there seems to be an issue - // with partitions and accessing elements in tables that have been declared - // with an SELF_INDEX column. Under investigation. Maybe need to change - // femtdream dataformat to take special care of v0 candidates - // auto posChild = v0.template children_as().front(); - // auto negChild = v0.template children_as().back(); - // check cuts on V0 children - if (((posChild.cut() & V02.ChildPos_CutBit) == V02.ChildPos_CutBit) && - ((posChild.pidcut() & V02.ChildPos_TPCBit) == V02.ChildPos_TPCBit) && - ((negChild.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && - ((negChild.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { - trackHistoPartTwo.fillQA(v0, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - } - } - } - */ - /// Now build the combinations float rand = 0.; if (Option.SameSpecies.value) { @@ -473,68 +388,6 @@ struct femtoDreamPairTaskV0V0 { } PROCESS_SWITCH(femtoDreamPairTaskV0V0, processSameEvent, "Enable processing same event", true); - /* - void processSameEventMasked(FilteredMaskedCollision& col, o2::aod::FDParticles& parts) - { - if (Option.SameSpecies.value) { - if ((col.bitmaskTrackOne() & BitMask) != BitMask) { - return; - } - } else { - if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { - return; - } - } - fillCollision(col); - auto SliceTrk1 = PartitionTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - auto SliceTrk2 = PartitionTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - doSameEvent(SliceTrk1, SliceTrk2, parts, col); - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMasked, "Enable processing same event with masks", false); - */ - - /// process function for to call doSameEvent with Monte Carlo - /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) - /// \param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth - /// \param FemtoDreamMCParticles subscribe to the Monte Carlo truth table - /* - void processSameEventMC(FilteredMCCollision& col, - o2::aod::FDMCCollisions&, - soa::Join& parts, - o2::aod::FDMCParticles&) - { - fillCollision(col); - auto SliceMCTrk1 = PartitionMCTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - auto SliceMCTrk2 = PartitionMCTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - if (SliceMCTrk1.size() == 0 && SliceMCTrk2.size() == 0) { - return; - } - doSameEvent(SliceMCTrk1, SliceMCTrk2, parts, col); - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMC, "Enable processing same event for Monte Carlo", false); - */ - - /* - void processSameEventMCMasked(FilteredMaskedMCCollision& col, o2::aod::FDMCCollisions&, soa::Join& parts, - o2::aod::FDMCParticles&) - { - if (Option.SameSpecies.value) { - if ((col.bitmaskTrackOne() & BitMask) != BitMask) { - return; - } - } else { - if ((col.bitmaskTrackOne() & BitMask) != BitMask && (col.bitmaskTrackTwo() & BitMask) != BitMask) { - return; - } - } - fillCollision(col); - auto SliceMCTrk1 = PartitionMCTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - auto SliceMCTrk2 = PartitionMCTrk2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - doSameEvent(SliceMCTrk1, SliceMCTrk2, parts, col); - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMCMasked, "Enable processing same event for Monte Carlo with masked collisions", false); - */ - template void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) { @@ -555,76 +408,6 @@ struct femtoDreamPairTaskV0V0 { } } - - template - void doMixedEvent_Masked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) - { - if (!Option.SameSpecies.value && !Option.MixEventWithPairs.value) { - // If the two particles are not the same species and the events which are mixed should contain at least one particle of interest, create two paritition of collisions that contain at least one of the two particle of interest and mix them - // Make sure there is a check that we do not mix a event with itself in case it contains both partilces - Partition PartitionMaskedCol1 = (aod::femtodreamcollision::bitmaskTrackOne & BitMask) == BitMask && aod::femtodreamcollision::downsample == true; - PartitionMaskedCol1.bindTable(cols); - Partition PartitionMaskedCol2 = (aod::femtodreamcollision::bitmaskTrackTwo & BitMask) == BitMask && aod::femtodreamcollision::downsample == true; - PartitionMaskedCol2.bindTable(cols); - // use *Partition.mFiltered when passing the partition to mixing object - // there is an issue when the partition is passed directly - // workaround for now, change back once it is fixed - for (auto const& [collision1, collision2] : combinations(soa::CombinationsBlockUpperIndexPolicy(policy, Mixing.Depth.value, -1, *PartitionMaskedCol1.mFiltered, *PartitionMaskedCol2.mFiltered))) { - // make sure that tracks in the same events are not mixed - if (collision1.globalIndex() == collision2.globalIndex()) { - continue; - } - auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); - auto SliceTrk2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); - - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceTrk1, SliceTrk2))) { - if (Option.CPROn.value) { - if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { - continue; - } - } - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); - } - } - } else { - // In the other case where the two particles are not the same species and we do not mix event with pairs, we only need to define one partition of collisions and make self combinations - - // define a lambda function for the mixing with selfCombinations policy - auto MixEvents = [policy, &part1, &part2, parts, this](auto& partition) { - for (auto const& [collision1, collision2] : selfCombinations(policy, Mixing.Depth.value, -1, *partition.mFiltered, *partition.mFiltered)) { - auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); - auto SliceTrk2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceTrk1, SliceTrk2))) { - if (Option.CPROn.value) { - if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { - continue; - } - } - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D.value, Option.ExtendedPlots.value, Option.SmearingByOrigin.value); - } - } - }; - if (Option.SameSpecies.value && Option.MixEventWithPairs.value) - // in case of mixing the same species and events that contain pairs, check for bitmask of particle two - // when same species is set to true the bit of particle two is only set if the event contains at least two selected particles - Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask) && aod::femtodreamcollision::downsample == true; - PartitionMaskedCol1.bindTable(cols); - MixEvents(PartitionMaskedCol1); - } else if (Option.SameSpecies.value && !Option.MixEventWithPairs.value) { - // in case of mixing the same species and events that contain at least one selected paritcle, check for bitmask of particle one - Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && aod::femtodreamcollision::downsample == true; - PartitionMaskedCol1.bindTable(cols); - MixEvents(PartitionMaskedCol1); - } else if (!Option.SameSpecies.value && Option.MixEventWithPairs.value) { - // in case of mixing different species and events that contain a pair of selected paritcles, check for both bitmasks of paritcle one and particle two - Partition PartitionMaskedCol1 = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask) && aod::femtodreamcollision::downsample == true; - PartitionMaskedCol1.bindTable(cols); - MixEvents(PartitionMaskedCol1); - } - } - } - - /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoDreamParticleTable @@ -646,69 +429,6 @@ struct femtoDreamPairTaskV0V0 { } PROCESS_SWITCH(femtoDreamPairTaskV0V0, processMixedEvent, "Enable processing mixed events", true); - /* - void processMixedEventMasked(FilteredMaskedCollisions& cols, o2::aod::FDParticles& parts) - { - switch (Mixing.Policy.value) { - case static_cast(femtodreamcollision::kMult): - doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMult); - break; - case femtodreamcollision::kMultPercentile: - doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMultPercentile); - break; - case femtodreamcollision::kMultMultPercentile: - doMixedEvent_Masked(cols, parts, PartitionTrk1, PartitionTrk2, colBinningMultMultPercentile); - break; - default: - LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; - } - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMasked, "Enable processing mixed events", false); - */ - - /// brief process function for to call doMixedEvent with Monte Carlo - /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) - /// @param parts subscribe to joined table FemtoDreamParticles and FemtoDreamMCLables to access Monte Carlo truth - /// @param FemtoDreamMCParticles subscribe to the Monte Carlo truth table - /* - void processMixedEventMC(FilteredMCCollisions& cols, o2::aod::FDMCCollisions&, soa::Join& parts, o2::aod::FDMCParticles&) - { - switch (Mixing.Policy.value) { - case femtodreamcollision::kMult: - doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMult); - break; - case femtodreamcollision::kMultPercentile: - doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultPercentile); - break; - case femtodreamcollision::kMultMultPercentile: - doMixedEvent_NotMasked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultMultPercentile); - break; - default: - LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; - } - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMC, "Enable processing mixed events MC", false); - */ - - /* - void processMixedEventMCMasked(FilteredMaskedMCCollisions& cols, o2::aod::FDMCCollisions&, soa::Join& parts, o2::aod::FDMCParticles&) - { - switch (Mixing.Policy.value) { - case femtodreamcollision::kMult: - doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMult); - break; - case femtodreamcollision::kMultPercentile: - doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultPercentile); - break; - case femtodreamcollision::kMultMultPercentile: - doMixedEvent_Masked(cols, parts, PartitionMCTrk1, PartitionMCTrk2, colBinningMultMultPercentile); - break; - default: - LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; - } - } - PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processMixedEventMCMasked, "Enable processing mixed events MC with masked collisions", false); - */ }; From ba1fed450fd771d4e28ac3a33c35034aa4e65f71 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 12:54:07 +0200 Subject: [PATCH 3/9] Ad selections for the V0 daughters in the paring --- .../Tasks/femtoDreamPairTaskV0V0.cxx | 108 ++++++++---------- 1 file changed, 48 insertions(+), 60 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index 5dc0e967c00..d8318808345 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -126,19 +126,6 @@ struct femtoDreamPairTaskV0V0 { (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); - /* - Partition PartitionMCV01 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && - ((aod::femtodreamparticle::cut & V01.CutBit) == V01.CutBit) && - (aod::femtodreamparticle::pt > V01.PtMin) && - (aod::femtodreamparticle::pt < V01.PtMax) && - (aod::femtodreamparticle::eta > V01.EtaMax) && - (aod::femtodreamparticle::eta < V01.EtaMin) && - (aod::femtodreamparticle::mLambda > V01.InvMassMin) && - (aod::femtodreamparticle::mLambda < V01.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && - (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); - */ - /// Histogramming for particle 1 FemtoDreamParticleHisto trackHistoPartOne; FemtoDreamParticleHisto posChildHistos; @@ -178,27 +165,6 @@ struct femtoDreamPairTaskV0V0 { (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); - /* - Partition PartitionMCV02 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && - ((aod::femtodreamparticle::cut & V02.CutBit) == V02.CutBit) && - (aod::femtodreamparticle::pt > V02.PtMin) && - (aod::femtodreamparticle::pt < V02.PtMax) && - (aod::femtodreamparticle::eta > V02.EtaMax) && - (aod::femtodreamparticle::eta < V02.EtaMin) && - (aod::femtodreamparticle::mLambda > V02.InvMassMin) && - (aod::femtodreamparticle::mLambda < V02.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && - (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); - */ - - /// Histogramming for particle 2 - /* - FemtoDreamParticleHisto trackHistoPartTwo; - FemtoDreamParticleHisto posChildHistos; - FemtoDreamParticleHisto negChildHistos; - */ - - /// Histogramming for Event FemtoDreamEventHisto eventHisto; @@ -272,6 +238,7 @@ struct femtoDreamPairTaskV0V0 { Option.IsMC, Option.Use4D, Option.ExtendedPlots, Option.HighkstarCut, Option.SmearingByOrigin); + mixedEventCont.init(&Registry, Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.MultMixBins, Mixing.MultPercentileMixBins, Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, @@ -310,13 +277,6 @@ struct femtoDreamPairTaskV0V0 { for (auto& v0 : SliceV01) { const auto& posChild = parts.iteratorAt(v0.index() - 2); const auto& negChild = parts.iteratorAt(v0.index() - 1); - // This is how it is supposed to work but there seems to be an issue - // with partitions and accessing elements in tables that have been declared - // with an SELF_INDEX column. Under investigation. Maybe need to change - // femtdream dataformat to take special care of v0 candidates - // auto posChild = v0.template children_as().front(); - // auto negChild = v0.template children_as().back(); - // check cuts on V0 children if (((posChild.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && ((posChild.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && ((negChild.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && @@ -331,26 +291,40 @@ struct femtoDreamPairTaskV0V0 { float rand = 0.; if (Option.SameSpecies.value) { for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(SliceV01, SliceV02))) { - if (Option.CPROn.value) { - if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { - continue; + const auto& posChild_1 = parts.iteratorAt(p1.index() - 2); + const auto& negChild_1 = parts.iteratorAt(p1.index() - 1); + const auto& posChild_2 = parts.iteratorAt(p2.index() - 2); + const auto& negChild_2 = parts.iteratorAt(p2.index() - 1); + if (((posChild_1.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && + ((posChild_1.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && + ((negChild_1.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && + ((negChild_1.pidcut() & V01.ChildNeg_TPCBit) == V01.ChildNeg_TPCBit) && + ((posChild_2.cut() & V02.ChildPos_CutBit) == V02.ChildPos_CutBit) && + ((posChild_2.pidcut() & V02.ChildPos_TPCBit) == V02.ChildPos_TPCBit) && + ((negChild_2.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && + ((negChild_2.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { + + if (Option.CPROn.value) { + if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { + continue; + } + } + /* + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + */ + + if (Option.RandomizePair.value) { + rand = random->Rndm(); + } + if (rand <= 0.5) { + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } else { + sameEventCont.setPair(p2, p1, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } } - } - /* - // track cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { - continue; - } - */ - - if (Option.RandomizePair.value) { - rand = random->Rndm(); - } - if (rand <= 0.5) { - sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); - } else { - sameEventCont.setPair(p2, p1, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); - } } } @@ -398,6 +372,19 @@ struct femtoDreamPairTaskV0V0 { continue; } for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { + const auto& posChild_1 = parts.iteratorAt(p1.index() - 2); + const auto& negChild_1 = parts.iteratorAt(p1.index() - 1); + const auto& posChild_2 = parts.iteratorAt(p2.index() - 2); + const auto& negChild_2 = parts.iteratorAt(p2.index() - 1); + if (((posChild_1.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && + ((posChild_1.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && + ((negChild_1.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && + ((negChild_1.pidcut() & V01.ChildNeg_TPCBit) == V01.ChildNeg_TPCBit) && + ((posChild_2.cut() & V02.ChildPos_CutBit) == V02.ChildPos_CutBit) && + ((posChild_2.pidcut() & V02.ChildPos_TPCBit) == V02.ChildPos_TPCBit) && + ((negChild_2.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && + ((negChild_2.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { + if (Option.CPROn.value) { if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { continue; @@ -407,6 +394,7 @@ struct femtoDreamPairTaskV0V0 { } } } +} /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) From cd974ead9ba56ee71dcec5a619789475035e2629 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 15:18:26 +0200 Subject: [PATCH 4/9] Fixing clang-fromat issues --- .../FemtoDream/Core/femtoDreamDetaDphiStar.h | 129 ++++---- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 82 ++--- .../Tasks/femtoDreamPairTaskV0V0.cxx | 307 +++++++++--------- 3 files changed, 240 insertions(+), 278 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h index 3e60a81f16c..702dd3ebf5d 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h +++ b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h @@ -16,11 +16,13 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMDETADPHISTAR_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMDETADPHISTAR_H_ +#include "PWGCF/DataModel/FemtoDerived.h" + +#include "Framework/HistogramRegistry.h" + #include #include #include -#include "PWGCF/DataModel/FemtoDerived.h" -#include "Framework/HistogramRegistry.h" using namespace o2; using namespace o2::framework; @@ -332,74 +334,72 @@ class FemtoDreamDetaDphiStar indexOfDaughterPart1 = part1.index() - 2 + i; indexOfDaughterPart2 = part2.index() - 2 + j; } - - - auto daughterPart1 = particles.begin() + indexOfDaughterPart1; - auto daughterPart2 = particles.begin() + indexOfDaughterPart2; - auto deta = daughterPart1.eta() - daughterPart2.eta(); - auto dphi_AT_PV = daughterPart1.phi() - daughterPart2.phi(); - auto dphi_AT_SpecificRadii = PhiAtSpecificRadiiTPC(daughterPart1, radiiTPC) - PhiAtSpecificRadiiTPC(daughterPart2, radiiTPC); - bool sameCharge = false; - auto dphiAvg = AveragePhiStar(*daughterPart1, *daughterPart2, nhist, &sameCharge); - if (Q3 == 999) { - histdetadpi[nhist][0]->Fill(deta, dphiAvg); - histdetadpi[nhist][2]->Fill(deta, dphi_AT_PV); - if (fillQA) { - histdetadpi_eta[nhist]->Fill(deta, dphiAvg, daughterPart1.eta(), daughterPart2.eta()); - histdetadpi_phi[nhist]->Fill(deta, dphiAvg, daughterPart1.phi(), daughterPart2.phi()); - } - } /* else if (Q3 < upperQ3LimitForPlotting) { - histdetadpi[i][0]->Fill(deta, dphiAvg); - histdetadpi[i][2]->Fill(deta, dphi_AT_PV); - if (fillQA) { - histdetadpi_eta[i]->Fill(deta, dphiAvg, part1.eta(), daughter.eta()); - histdetadpi_phi[i]->Fill(deta, dphiAvg, part1.phi(), daughter.phi()); - } - } */ - if (sameCharge) { - if (atWhichRadiiToSelect == 1) { - if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { - pass = true; - } else { - if (Q3 == 999) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); - } else if (Q3 < upperQ3LimitForPlotting) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + + auto daughterPart1 = particles.begin() + indexOfDaughterPart1; + auto daughterPart2 = particles.begin() + indexOfDaughterPart2; + auto deta = daughterPart1.eta() - daughterPart2.eta(); + auto dphi_AT_PV = daughterPart1.phi() - daughterPart2.phi(); + auto dphi_AT_SpecificRadii = PhiAtSpecificRadiiTPC(daughterPart1, radiiTPC) - PhiAtSpecificRadiiTPC(daughterPart2, radiiTPC); + bool sameCharge = false; + auto dphiAvg = AveragePhiStar(*daughterPart1, *daughterPart2, nhist, &sameCharge); + if (Q3 == 999) { + histdetadpi[nhist][0]->Fill(deta, dphiAvg); + histdetadpi[nhist][2]->Fill(deta, dphi_AT_PV); + if (fillQA) { + histdetadpi_eta[nhist]->Fill(deta, dphiAvg, daughterPart1.eta(), daughterPart2.eta()); + histdetadpi_phi[nhist]->Fill(deta, dphiAvg, daughterPart1.phi(), daughterPart2.phi()); + } + } /* else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[i][0]->Fill(deta, dphiAvg); + histdetadpi[i][2]->Fill(deta, dphi_AT_PV); + if (fillQA) { + histdetadpi_eta[i]->Fill(deta, dphiAvg, part1.eta(), daughter.eta()); + histdetadpi_phi[i]->Fill(deta, dphiAvg, part1.phi(), daughter.phi()); + } + } */ + if (sameCharge) { + if (atWhichRadiiToSelect == 1) { + if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } } - } - } else if (atWhichRadiiToSelect == 0) { - if (pow(dphi_AT_PV, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { - pass = true; - } else { - if (Q3 == 999) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); - } else if (Q3 < upperQ3LimitForPlotting) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (atWhichRadiiToSelect == 0) { + if (pow(dphi_AT_PV, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } } - } - } else if (atWhichRadiiToSelect == 2) { - if (pow(dphi_AT_SpecificRadii, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { - pass = true; - } else { - if (Q3 == 999) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); - } else if (Q3 < upperQ3LimitForPlotting) { - histdetadpi[nhist][1]->Fill(deta, dphiAvg); - histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (atWhichRadiiToSelect == 2) { + if (pow(dphi_AT_SpecificRadii, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { + pass = true; + } else { + if (Q3 == 999) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } else if (Q3 < upperQ3LimitForPlotting) { + histdetadpi[nhist][1]->Fill(deta, dphiAvg); + histdetadpi[nhist][3]->Fill(deta, dphi_AT_PV); + } } } } + nhist += 1; } - nhist += 1; } - } - - + return pass; } else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kCharmHadron) { // check if provided particles are in agreement with the class instantiation @@ -485,8 +485,7 @@ class FemtoDreamDetaDphiStar histdetadpi[i][3]->Fill(deta, dphi_AT_PV); } } - } - else if (atWhichRadiiToSelect == 2) { + } else if (atWhichRadiiToSelect == 2) { if (pow(dphi_AT_SpecificRadii, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { pass = true; } else { diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 166ff4994e7..d2b86934a69 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -1,75 +1,39 @@ -# Copyright 2019-2025 CERN and copyright holders of ALICE O2. -# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -# All rights not expressly granted are reserved. +#Copyright 2019 - 2025 CERN and copyright holders of ALICE O2. +#See https: // alice-o2.web.cern.ch/copyright for details of the copyright holders. +#All rights not expressly granted are reserved. # -# This software is distributed under the terms of the GNU General Public -# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +#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 +#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. -o2physics_add_dpl_workflow(femtodream-pair-track-track - SOURCES femtoDreamPairTaskTrackTrack.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream - pair - track - track SOURCES femtoDreamPairTaskTrackTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-triplet-track-track-track - SOURCES femtoDreamTripletTaskTrackTrackTrack.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - triplet - track - track - track SOURCES femtoDreamTripletTaskTrackTrackTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-triplet-track-track-track-pb-pb - SOURCES femtoDreamTripletTaskTrackTrackTrackPbPb.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - triplet - track - track - track - pb - pb SOURCES femtoDreamTripletTaskTrackTrackTrackPbPb.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-pair-track-v0 - SOURCES femtoDreamPairTaskTrackV0.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - pair - track - v0 SOURCES femtoDreamPairTaskTrackV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-pair-track-cascade - SOURCES femtoDreamPairTaskTrackCascade.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - pair - track - cascade SOURCES femtoDreamPairTaskTrackCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-triplet-track-track-v0 - SOURCES femtoDreamTripletTaskTrackTrackV0.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - triplet - track - track - v0 SOURCES femtoDreamTripletTaskTrackTrackV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-debug-track - SOURCES femtoDreamDebugTrack.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - debug - track SOURCES femtoDreamDebugTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-debug-v0 - SOURCES femtoDreamDebugV0.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - debug - v0 SOURCES femtoDreamDebugV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-debug-cascade - SOURCES femtoDreamDebugCascade.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - debug - cascade SOURCES femtoDreamDebugCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-collision-masker - SOURCES femtoDreamCollisionMasker.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - collision - masker SOURCES femtoDreamCollisionMasker.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-pair-efficiency - SOURCES femtoDreamPairEfficiency.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - pair - efficiency SOURCES femtoDreamPairEfficiency.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-hash - SOURCES femtoDreamHashTask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - hash + SOURCES femtoDreamHashTask.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(femtodream-pair-v0-v0 - SOURCES femtoDreamPairTaskV0V0.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream - pair - v0 - v0 SOURCES femtoDreamPairTaskV0V0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index d8318808345..34bb9c43acd 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -15,28 +15,30 @@ /// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de /// \author Anton Riedel, TU München, anton.riedel@tum.de -#include -#include -#include -#include -#include "TRandom3.h" +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Framework/Configurable.h" +#include "Framework/Expressions.h" #include "Framework/HistogramRegistry.h" -#include "Framework/ASoAHelpers.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" +#include "Framework/runDataProcessing.h" -#include "PWGCF/DataModel/FemtoDerived.h" -#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" -#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" -#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" -#include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" -#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" +#include "TRandom3.h" + +#include +#include +#include +#include using namespace o2::aod; using namespace o2::soa; @@ -93,97 +95,96 @@ struct femtoDreamPairTaskV0V0 { femtodreamcollision::BitMaskType BitMask = 0; - /// Particle 1 (V0) - struct : ConfigurableGroup { - std::string prefix = std::string("V01"); - Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 1 (V0)"}; - Configurable CutBit{"CutBit", 7518, "Selection bit for particle 1 (V0)"}; - Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; - Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; - Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; - Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; - - Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 1 (particle) (V0)"}; - Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 1 (particle) (V0)"}; - Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 1 (antiparticle) (V0)"}; - Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 1 (antiparticle) (V0)"}; - - Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 1 (V0)"}; - Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 1 (V0)"}; - Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 1 (V0)"}; - Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 1 (V0)"}; - } V01; - - /// Partition for particle 1 - Partition PartitionV01 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && - ((aod::femtodreamparticle::cut & V01.CutBit) == V01.CutBit) && - (aod::femtodreamparticle::pt > V01.PtMin) && - (aod::femtodreamparticle::pt < V01.PtMax) && - (aod::femtodreamparticle::eta > V01.EtaMin) && - (aod::femtodreamparticle::eta < V01.EtaMax) && - (aod::femtodreamparticle::mLambda > V01.InvMassMin) && - (aod::femtodreamparticle::mLambda < V01.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && - (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); - - /// Histogramming for particle 1 - FemtoDreamParticleHisto trackHistoPartOne; - FemtoDreamParticleHisto posChildHistos; - FemtoDreamParticleHisto negChildHistos; - - - /// Particle 2 (V0) - struct : ConfigurableGroup { - std::string prefix = std::string("V02"); - Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 2 (V0)"}; - Configurable CutBit{"CutBit", 7518, "Selection bit for particle 2 (V0)"}; - Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; - Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; - Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; - Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; - - Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 2 (particle) (V0)"}; - Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 2 (particle) (V0)"}; - Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 2 (antiparticle) (V0)"}; - Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 2 (antiparticle) (V0)"}; - - Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 2 (V0)"}; - Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 2 (V0)"}; - Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 2 (V0)"}; - Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 2 (V0)"}; - } V02; - - /// Partition for particle 2 - Partition PartitionV02 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && - ((aod::femtodreamparticle::cut & V02.CutBit) == V02.CutBit) && - (aod::femtodreamparticle::pt > V02.PtMin) && - (aod::femtodreamparticle::pt < V02.PtMax) && - (aod::femtodreamparticle::eta > V02.EtaMin) && - (aod::femtodreamparticle::eta < V02.EtaMax) && - (aod::femtodreamparticle::mLambda > V02.InvMassMin) && - (aod::femtodreamparticle::mLambda < V02.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && - (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); + /// Particle 1 (V0) + struct : ConfigurableGroup { + std::string prefix = std::string("V01"); + Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 1 (V0)"}; + Configurable CutBit{"CutBit", 7518, "Selection bit for particle 1 (V0)"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; + + Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 1 (particle) (V0)"}; + Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 1 (particle) (V0)"}; + Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 1 (antiparticle) (V0)"}; + Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 1 (antiparticle) (V0)"}; + + Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 1 (V0)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 1 (V0)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 1 (V0)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 1 (V0)"}; + } V01; + + /// Partition for particle 1 + Partition PartitionV01 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V01.CutBit) == V01.CutBit) && + (aod::femtodreamparticle::pt > V01.PtMin) && + (aod::femtodreamparticle::pt < V01.PtMax) && + (aod::femtodreamparticle::eta > V01.EtaMin) && + (aod::femtodreamparticle::eta < V01.EtaMax) && + (aod::femtodreamparticle::mLambda > V01.InvMassMin) && + (aod::femtodreamparticle::mLambda < V01.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V01.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V01.InvMassAntiMax); + + /// Histogramming for particle 1 + FemtoDreamParticleHisto trackHistoPartOne; + FemtoDreamParticleHisto posChildHistos; + FemtoDreamParticleHisto negChildHistos; + + /// Particle 2 (V0) + struct : ConfigurableGroup { + std::string prefix = std::string("V02"); + Configurable PDGCode{"PDGCode", 3122, "PDG code of particle 2 (V0)"}; + Configurable CutBit{"CutBit", 7518, "Selection bit for particle 2 (V0)"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 210, "Selection bit for positive child of V0"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 64, "PID TPC bit for positive child of V0"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 209, "Selection bit for negative child of V0"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 256, "PID TPC bit for negative child of V0"}; + + Configurable InvMassMin{"InvMassMin", 1.08, "Minimum invariant mass of Partricle 2 (particle) (V0)"}; + Configurable InvMassMax{"InvMassMax", 1.15, "Maximum invariant mass of Partricle 2 (particle) (V0)"}; + Configurable InvMassAntiMin{"InvMassAntiMin", 0., "Minimum invariant mass of Partricle 2 (antiparticle) (V0)"}; + Configurable InvMassAntiMax{"InvMassAntiMax", 999., "Maximum invariant mass of Partricle 2 (antiparticle) (V0)"}; + + Configurable PtMin{"PtMin", 0., "Minimum pT of Partricle 2 (V0)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Partricle 2 (V0)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Partricle 2 (V0)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Partricle 2 (V0)"}; + } V02; + + /// Partition for particle 2 + Partition PartitionV02 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & V02.CutBit) == V02.CutBit) && + (aod::femtodreamparticle::pt > V02.PtMin) && + (aod::femtodreamparticle::pt < V02.PtMax) && + (aod::femtodreamparticle::eta > V02.EtaMin) && + (aod::femtodreamparticle::eta < V02.EtaMax) && + (aod::femtodreamparticle::mLambda > V02.InvMassMin) && + (aod::femtodreamparticle::mLambda < V02.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > V02.InvMassAntiMin) && + (aod::femtodreamparticle::mAntiLambda < V02.InvMassAntiMax); /// Histogramming for Event FemtoDreamEventHisto eventHisto; - /// Binning configurables - struct : ConfigurableGroup { - std::string prefix = std::string("Binning"); - ConfigurableAxis TempFitVarTrack{"TempFitVarTrack", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Track)"}; - ConfigurableAxis TempFitVarV0{"TempFitVarV0", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0)"}; - ConfigurableAxis TempFitVarV0Child{"TempFitVarV0Child", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0 child)"}; - ConfigurableAxis InvMass{"InvMass", {200, 1, 1.2}, "InvMass binning"}; - ConfigurableAxis pTTrack{"pTTrack", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Track)"}; - ConfigurableAxis pTV0{"pTV0", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; - ConfigurableAxis pTV0Child{"pTV0Child", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; - ConfigurableAxis pT{"pT", {20, 0.5, 4.05}, "pT binning"}; - ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis kT{"kT", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis mT{"mT", {225, 0., 7.5}, "binning mT"}; - ConfigurableAxis multTempFit{"multTempFit", {1, 0, 1}, "multiplicity for the TempFitVar plot"}; - } Binning; + /// Binning configurables + struct : ConfigurableGroup { + std::string prefix = std::string("Binning"); + ConfigurableAxis TempFitVarTrack{"TempFitVarTrack", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Track)"}; + ConfigurableAxis TempFitVarV0{"TempFitVarV0", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis TempFitVarV0Child{"TempFitVarV0Child", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (V0 child)"}; + ConfigurableAxis InvMass{"InvMass", {200, 1, 1.2}, "InvMass binning"}; + ConfigurableAxis pTTrack{"pTTrack", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Track)"}; + ConfigurableAxis pTV0{"pTV0", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis pTV0Child{"pTV0Child", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (V0)"}; + ConfigurableAxis pT{"pT", {20, 0.5, 4.05}, "pT binning"}; + ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis kT{"kT", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis mT{"mT", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis multTempFit{"multTempFit", {1, 0, 1}, "multiplicity for the TempFitVar plot"}; + } Binning; struct : ConfigurableGroup { std::string prefix = "Binning4D"; @@ -209,7 +210,7 @@ struct femtoDreamPairTaskV0V0 { FemtoDreamContainer sameEventCont; FemtoDreamContainer mixedEventCont; - //FemtoDreamPairCleaner pairCleaner; + // FemtoDreamPairCleaner pairCleaner; FemtoDreamDetaDphiStar pairCloseRejectionSE; FemtoDreamDetaDphiStar pairCloseRejectionME; /// Histogram output @@ -238,7 +239,7 @@ struct femtoDreamPairTaskV0V0 { Option.IsMC, Option.Use4D, Option.ExtendedPlots, Option.HighkstarCut, Option.SmearingByOrigin); - + mixedEventCont.init(&Registry, Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.MultMixBins, Mixing.MultPercentileMixBins, Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, @@ -247,9 +248,9 @@ struct femtoDreamPairTaskV0V0 { Option.SmearingByOrigin); sameEventCont.setPDGCodes(V01.PDGCode, V02.PDGCode); mixedEventCont.setPDGCodes(V01.PDGCode, V02.PDGCode); - //pairCleaner.init(&Registry); - - if (Option.CPROn.value) { + // pairCleaner.init(&Registry); + + if (Option.CPROn.value) { pairCloseRejectionSE.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 1, Option.CPROld.value); pairCloseRejectionME.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 2, Option.CPROld.value); } @@ -274,18 +275,18 @@ struct femtoDreamPairTaskV0V0 { template void doSameEvent(PartitionType SliceV01, PartitionType SliceV02, PartType parts, Collision col) { - for (auto& v0 : SliceV01) { - const auto& posChild = parts.iteratorAt(v0.index() - 2); - const auto& negChild = parts.iteratorAt(v0.index() - 1); - if (((posChild.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && - ((posChild.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && - ((negChild.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && - ((negChild.pidcut() & V01.ChildNeg_TPCBit) == V01.ChildNeg_TPCBit)) { - trackHistoPartOne.fillQA(v0, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - } + for (auto& v0 : SliceV01) { + const auto& posChild = parts.iteratorAt(v0.index() - 2); + const auto& negChild = parts.iteratorAt(v0.index() - 1); + if (((posChild.cut() & V01.ChildPos_CutBit) == V01.ChildPos_CutBit) && + ((posChild.pidcut() & V01.ChildPos_TPCBit) == V01.ChildPos_TPCBit) && + ((negChild.cut() & V01.ChildNeg_CutBit) == V01.ChildNeg_CutBit) && + ((negChild.pidcut() & V01.ChildNeg_TPCBit) == V01.ChildNeg_TPCBit)) { + trackHistoPartOne.fillQA(v0, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); } + } /// Now build the combinations float rand = 0.; @@ -303,45 +304,45 @@ struct femtoDreamPairTaskV0V0 { ((posChild_2.pidcut() & V02.ChildPos_TPCBit) == V02.ChildPos_TPCBit) && ((negChild_2.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && ((negChild_2.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { - - if (Option.CPROn.value) { - if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { - continue; - } - } - /* - // track cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { + + if (Option.CPROn.value) { + if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { continue; } - */ + } + /* + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + */ - if (Option.RandomizePair.value) { - rand = random->Rndm(); - } - if (rand <= 0.5) { - sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); - } else { - sameEventCont.setPair(p2, p1, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); - } + if (Option.RandomizePair.value) { + rand = random->Rndm(); } + if (rand <= 0.5) { + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } else { + sameEventCont.setPair(p2, p1, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); + } + } } } - - else { + + else { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { if (Option.CPROn.value) { if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { continue; } } - /* - // track cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { - continue; - } - */ - + /* + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + */ + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); } } @@ -385,16 +386,16 @@ struct femtoDreamPairTaskV0V0 { ((negChild_2.cut() & V02.ChildNeg_CutBit) == V02.ChildNeg_CutBit) && ((negChild_2.pidcut() & V02.ChildNeg_TPCBit) == V02.ChildNeg_TPCBit)) { - if (Option.CPROn.value) { - if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { - continue; + if (Option.CPROn.value) { + if (pairCloseRejectionME.isClosePair(p1, p2, parts, collision1.magField())) { + continue; + } } + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); } - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); } } } -} /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) @@ -416,9 +417,7 @@ struct femtoDreamPairTaskV0V0 { } } PROCESS_SWITCH(femtoDreamPairTaskV0V0, processMixedEvent, "Enable processing mixed events", true); - }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From e8483494259832de916983245bfd62a939347f83 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 15:27:38 +0200 Subject: [PATCH 5/9] Fix copyright header and Mega Linter errors --- PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h | 9 +-------- PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h index 702dd3ebf5d..7dadb08df78 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h +++ b/PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h @@ -349,14 +349,7 @@ class FemtoDreamDetaDphiStar histdetadpi_eta[nhist]->Fill(deta, dphiAvg, daughterPart1.eta(), daughterPart2.eta()); histdetadpi_phi[nhist]->Fill(deta, dphiAvg, daughterPart1.phi(), daughterPart2.phi()); } - } /* else if (Q3 < upperQ3LimitForPlotting) { - histdetadpi[i][0]->Fill(deta, dphiAvg); - histdetadpi[i][2]->Fill(deta, dphi_AT_PV); - if (fillQA) { - histdetadpi_eta[i]->Fill(deta, dphiAvg, part1.eta(), daughter.eta()); - histdetadpi_phi[i]->Fill(deta, dphiAvg, part1.phi(), daughter.phi()); - } - } */ + } if (sameCharge) { if (atWhichRadiiToSelect == 1) { if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index 34bb9c43acd..0ced5691eaf 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -9,11 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file femtoDreamPairTaskTrackTrack.cxx +/// \file femtoDreamPairTaskV0V0.cxx /// \brief Tasks that reads the track tables used for the pairing and builds pairs of two tracks /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de /// \author Anton Riedel, TU München, anton.riedel@tum.de +/// \author Bianca Popa, TU München, bianca.popa@tum.de #include "PWGCF/DataModel/FemtoDerived.h" #include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" From 711f04951dfed630218d87e60be07992da2ceb74 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 16:09:31 +0200 Subject: [PATCH 6/9] More MegaLinter and Copyright errors --- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 64 +++++++++++++------ .../Tasks/femtoDreamPairTaskV0V0.cxx | 5 +- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index d2b86934a69..51a04baa005 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -1,5 +1,5 @@ #Copyright 2019 - 2025 CERN and copyright holders of ALICE O2. -#See https: // alice-o2.web.cern.ch/copyright for details of the copyright holders. +#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 @@ -9,31 +9,57 @@ #granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(femtodream - pair - track - track SOURCES femtoDreamPairTaskTrackTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-pair-track-track + SOURCES femtoDreamPairTaskTrackTrack.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - triplet - track - track - track SOURCES femtoDreamTripletTaskTrackTrackTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-triplet-track-track-track + SOURCES femtoDreamTripletTaskTrackTrackTrack.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - triplet - track - track - track - pb - pb SOURCES femtoDreamTripletTaskTrackTrackTrackPbPb.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-pair-track-v0 + SOURCES femtoDreamPairTaskTrackV0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - pair - track - v0 SOURCES femtoDreamPairTaskTrackV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-pair-track-cascade + SOURCES femtoDreamPairTaskTrackCascade.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - pair - track - cascade SOURCES femtoDreamPairTaskTrackCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-triplet-track-track-v0 + SOURCES femtoDreamTripletTaskTrackTrackV0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - triplet - track - track - v0 SOURCES femtoDreamTripletTaskTrackTrackV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-debug-track + SOURCES femtoDreamDebugTrack.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - debug - track SOURCES femtoDreamDebugTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-debug-v0 + SOURCES femtoDreamDebugV0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - debug - v0 SOURCES femtoDreamDebugV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-debug-cascade + SOURCES femtoDreamDebugCascade.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - debug - cascade SOURCES femtoDreamDebugCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-collision-masker + SOURCES femtoDreamCollisionMasker.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - collision - masker SOURCES femtoDreamCollisionMasker.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-hash + SOURCES femtoDreamHashTask.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(femtodream - pair - efficiency SOURCES femtoDreamPairEfficiency.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) - - o2physics_add_dpl_workflow(femtodream - hash - SOURCES femtoDreamHashTask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - - o2physics_add_dpl_workflow(femtodream - pair - v0 - v0 SOURCES femtoDreamPairTaskV0V0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-pair-v0-v0 + SOURCES femtoDreamPairTaskV0V0.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index 0ced5691eaf..e9fed303853 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -328,9 +328,7 @@ struct femtoDreamPairTaskV0V0 { } } } - } - - else { + }else { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { if (Option.CPROn.value) { if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { @@ -343,7 +341,6 @@ struct femtoDreamPairTaskV0V0 { continue; } */ - sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.SmearingByOrigin); } } From bce208d7344d3f76343d179f7759b1999ae787d9 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 16:27:57 +0200 Subject: [PATCH 7/9] This time the correct header error... --- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 16 ++++++++-------- .../FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 51a04baa005..21ed38d6b0a 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -1,12 +1,12 @@ -#Copyright 2019 - 2025 CERN and copyright holders of ALICE O2. -#See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -#All rights not expressly granted are reserved. +# Copyright 2019 - 2025 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. # -#This software is distributed under the terms of the GNU General Public -#License v3(GPL Version 3), copied verbatim in the file "COPYING". +# 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 +# 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. o2physics_add_dpl_workflow(femtodream-pair-track-track @@ -62,4 +62,4 @@ o2physics_add_dpl_workflow(femtodream-hash o2physics_add_dpl_workflow(femtodream-pair-v0-v0 SOURCES femtoDreamPairTaskV0V0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index e9fed303853..fff7dc36010 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -328,7 +328,7 @@ struct femtoDreamPairTaskV0V0 { } } } - }else { + } else { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceV01, SliceV02))) { if (Option.CPROn.value) { if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { From 84777560558f922445f61ab339d04d4f21f16271 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 16:34:12 +0200 Subject: [PATCH 8/9] Header errors in the CMakeLists.txt --- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 21ed38d6b0a..933d50035a9 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -1,9 +1,9 @@ -# Copyright 2019 - 2025 CERN and copyright holders of ALICE O2. +# Copyright 2019-2025 CERN and copyright holders of ALICE O2. # See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. # All rights not expressly granted are reserved. # # This software is distributed under the terms of the GNU General Public -# License v3(GPL Version 3), copied verbatim in the file "COPYING". +# 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 From 7d97618c7d72ecc2b6b2caa743ee415832da3fe7 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 18 Aug 2025 17:18:39 +0200 Subject: [PATCH 9/9] Remove compilation warning --- PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index fff7dc36010..21be57205e3 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -219,7 +219,7 @@ struct femtoDreamPairTaskV0V0 { TRandom3* random; - void init(InitContext& context) + void init(InitContext&) { // setup columnpolicy for binning colBinningMult = {{Mixing.VztxMixBins, Mixing.MultMixBins}, true};