From 8a356600212900b1ff902eae99fda4fe14008c22 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:59:58 +0100 Subject: [PATCH 01/28] [PWGLF] Task for high mas reconstruction in 2 phi decay mode (#9090) --- PWGLF/Tasks/Resonances/CMakeLists.txt | 5 + PWGLF/Tasks/Resonances/doublephimeson.cxx | 319 ++++++++++++++++++++++ 2 files changed, 324 insertions(+) create mode 100644 PWGLF/Tasks/Resonances/doublephimeson.cxx diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index e7d08dc500c..d684a7cd5a4 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -173,3 +173,8 @@ o2physics_add_dpl_workflow(chk892pp SOURCES chk892pp.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(doublephimeson + SOURCES doublephimeson.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/doublephimeson.cxx b/PWGLF/Tasks/Resonances/doublephimeson.cxx new file mode 100644 index 00000000000..1c0270b2825 --- /dev/null +++ b/PWGLF/Tasks/Resonances/doublephimeson.cxx @@ -0,0 +1,319 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief this is a starting point for the Resonances tutorial +/// \author sourav kundu +/// \since 02/11/2023 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/StepTHn.h" +#include "Common/Core/trackUtilities.h" +#include "PWGLF/DataModel/ReducedDoublePhiTables.h" +#include "CommonConstants/PhysicsConstants.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct doublephimeson { + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable fillRotation{"fillRotation", 1, "Fill rotation"}; + Configurable strategyPID{"strategyPID", 0, "PID strategy"}; + Configurable minPhiMass{"minPhiMass", 1.01, "Minimum phi mass"}; + Configurable maxPhiMass{"maxPhiMass", 1.03, "Maximum phi mass"}; + Configurable additionalEvsel{"additionalEvsel", false, "Additional event selection"}; + Configurable cutNsigmaTPC{"cutNsigmaTPC", 2.5, "nsigma cut TPC"}; + Configurable cutNsigmaTOF{"cutNsigmaTOF", 3.0, "nsigma cut TOF"}; + // Event Mixing + Configurable nEvtMixing{"nEvtMixing", 10, "Number of events to mix"}; + ConfigurableAxis CfgVtxBins{"CfgVtxBins", {10, -10, 10}, "Mixing bins - z-vertex"}; + ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0, 20.0, 40.0, 60.0, 80.0, 500.0}, "Mixing bins - number of contributor"}; + + // THnsparse bining + ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {1500, 2.0, 3.5}, "#it{M} (GeV/#it{c}^{2})"}; + ConfigurableAxis configThnAxisDaugherPt{"configThnAxisDaugherPt", {25, 0.0, 50.}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configThnAxisPt{"configThnAxisPt", {40, 0.0, 20.}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configThnAxisKstar{"configThnAxisKstar", {50, 0.0, 0.5}, "#it{k}^{*} (GeV/#it{c})"}; + + // Initialize the ananlysis task + void init(o2::framework::InitContext&) + { + // register histograms + histos.add("hnsigmaTPCKaonPlus", "hnsigmaTPCKaonPlus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}}); + histos.add("hnsigmaTPCKaonMinus", "hnsigmaTPCKaonMinus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}}); + histos.add("hPhid1Mass", "hPhid1Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}}); + histos.add("hPhid2Mass", "hPhid2Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}}); + + const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisDaughterPt{configThnAxisDaugherPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisKstar{configThnAxisKstar, "#it{k}^{*} (GeV/#it{c})"}; + + histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDaughterPt, thnAxisDaughterPt, thnAxisKstar}); + histos.add("SEMassRot", "SEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDaughterPt, thnAxisDaughterPt, thnAxisKstar}); + + histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDaughterPt, thnAxisDaughterPt, thnAxisKstar}); + histos.add("MEMassRot", "MEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDaughterPt, thnAxisDaughterPt, thnAxisKstar}); + } + + // get kstar + TLorentzVector trackSum, PartOneCMS, PartTwoCMS, trackRelK; + float getkstar(const TLorentzVector part1, + const TLorentzVector part2) + { + // const TLorentzVector trackSum = part1 + part2; + trackSum = part1 + part2; + const float beta = trackSum.Beta(); + const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta()); + const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); + const float betaz = beta * std::cos(trackSum.Theta()); + // TLorentzVector PartOneCMS(part1); + // TLorentzVector PartTwoCMS(part2); + PartOneCMS.SetXYZM(part1.Px(), part1.Py(), part1.Pz(), part1.M()); + PartTwoCMS.SetXYZM(part2.Px(), part2.Py(), part2.Pz(), part2.M()); + const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); + PartOneCMS = boostPRF(PartOneCMS); + PartTwoCMS = boostPRF(PartTwoCMS); + // const TLorentzVector trackRelK = PartOneCMS - PartTwoCMS; + trackRelK = PartOneCMS - PartTwoCMS; + return 0.5 * trackRelK.P(); + } + bool selectionPID(float nsigmaTPC, float nsigmaTOF, int TOFHit, int PIDStrategy, float ptcand) + { + if (PIDStrategy == 0) { + if (TOFHit != 1) { + if (TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + } + if (TOFHit == 1) { + if (TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + } + if (PIDStrategy == 1) { + if (ptcand < 0.6) { + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + if (ptcand >= 0.6) { + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + } + if (PIDStrategy == 2) { + if (ptcand < 0.6) { + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + if (ptcand >= 0.6 && ptcand < 1.2) { + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + if (TOFHit != 1 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) { + return true; + } + } + if (ptcand >= 1.2) { + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + } + } + if (PIDStrategy == 3) { + if (ptcand < 0.6) { + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + if (ptcand >= 0.6 && ptcand < 1.2) { + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + } + if (ptcand >= 1.2) { + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { + return true; + } + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { + return true; + } + } + } + return false; + } + + TLorentzVector exotic, Phid1, Phid2; + TLorentzVector exoticRot, Phid1Rot; + void process(aod::RedPhiEvents::iterator const& collision, aod::PhiTracks const& phitracks) + { + if (additionalEvsel && (collision.numPos() < 2 || collision.numNeg() < 2)) { + return; + } + for (auto phitrackd1 : phitracks) { + if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) { + continue; + } + + auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py()); + auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py()); + + if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID, kaonplusd1pt)) { + continue; + } + if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID, kaonminusd1pt)) { + continue; + } + + histos.fill(HIST("hnsigmaTPCKaonPlus"), phitrackd1.phid1TPC(), kaonplusd1pt); + histos.fill(HIST("hnsigmaTPCKaonMinus"), phitrackd1.phid2TPC(), kaonminusd1pt); + Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass()); + histos.fill(HIST("hPhid1Mass"), Phid1.M(), Phid1.Pt()); + auto phid1id = phitrackd1.index(); + for (auto phitrackd2 : phitracks) { + auto phid2id = phitrackd2.index(); + if (phid2id <= phid1id) { + continue; + } + if (phitrackd2.phiMass() < minPhiMass || phitrackd2.phiMass() > maxPhiMass) { + continue; + } + auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py()); + auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py()); + + if (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID, kaonplusd2pt)) { + continue; + } + if (!selectionPID(phitrackd2.phid2TPC(), phitrackd2.phid2TOF(), phitrackd2.phid2TOFHit(), strategyPID, kaonminusd2pt)) { + continue; + } + if (phitrackd1.phid1Index() == phitrackd2.phid1Index()) { + continue; + } + if (phitrackd1.phid2Index() == phitrackd2.phid2Index()) { + continue; + } + Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass()); + exotic = Phid1 + Phid2; + auto kstar = getkstar(Phid1, Phid2); + histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), Phid1.Pt(), Phid2.Pt(), kstar); + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { + auto anglestart = 5.0 * TMath::Pi() / 6.0; + auto angleend = 7.0 * TMath::Pi() / 6.0; + auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); + auto rotangle = anglestart + nrotbkg * anglestep; + auto rotd1px = Phid1.Px() * std::cos(rotangle) - Phid1.Py() * std::sin(rotangle); + auto rotd1py = Phid1.Px() * std::sin(rotangle) + Phid1.Py() * std::cos(rotangle); + Phid1Rot.SetXYZM(rotd1px, rotd1py, Phid1.Pz(), Phid1.M()); + exoticRot = Phid1Rot + Phid2; + auto kstar_rot = getkstar(Phid1Rot, Phid2); + histos.fill(HIST("SEMassRot"), exoticRot.M(), exoticRot.Pt(), Phid1Rot.Pt(), Phid2.Pt(), kstar_rot); + } + } + } + } + } + + SliceCache cache; + using BinningTypeVertexContributor = ColumnBinningPolicy; + void processMixedEvent(aod::RedPhiEvents& collisions, aod::PhiTracks& phitracks) + { + auto tracksTuple = std::make_tuple(phitracks); + BinningTypeVertexContributor binningOnPositions{{CfgVtxBins, CfgMultBins}, true}; + SameKindPair pair{binningOnPositions, nEvtMixing, -1, collisions, tracksTuple, &cache}; + + for (auto& [collision1, tracks1, collision2, tracks2] : pair) { + if (collision1.index() == collision2.index()) { + continue; + } + for (auto& [phitrackd1, phitrackd2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) { + continue; + } + + auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py()); + auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py()); + auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py()); + auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py()); + + if (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID, kaonplusd1pt)) { + continue; + } + if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID, kaonminusd1pt)) { + continue; + } + Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass()); + if (phitrackd2.phiMass() < minPhiMass || phitrackd2.phiMass() > maxPhiMass) { + continue; + } + if (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID, kaonplusd2pt)) { + continue; + } + if (!selectionPID(phitrackd2.phid2TPC(), phitrackd2.phid2TOF(), phitrackd2.phid2TOFHit(), strategyPID, kaonminusd2pt)) { + continue; + } + Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass()); + exotic = Phid1 + Phid2; + auto kstar = getkstar(Phid1, Phid2); + histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), Phid1.Pt(), Phid2.Pt(), kstar); + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { + auto anglestart = 5.0 * TMath::Pi() / 6.0; + auto angleend = 7.0 * TMath::Pi() / 6.0; + auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); + auto rotangle = anglestart + nrotbkg * anglestep; + auto rotd1px = Phid1.Px() * std::cos(rotangle) - Phid1.Py() * std::sin(rotangle); + auto rotd1py = Phid1.Px() * std::sin(rotangle) + Phid1.Py() * std::cos(rotangle); + Phid1Rot.SetXYZM(rotd1px, rotd1py, Phid1.Pz(), Phid1.M()); + exoticRot = Phid1Rot + Phid2; + auto kstar_rot = getkstar(Phid1Rot, Phid2); + histos.fill(HIST("MEMassRot"), exoticRot.M(), exoticRot.Pt(), Phid1Rot.Pt(), Phid2.Pt(), kstar_rot); + } + } + } + } + } + PROCESS_SWITCH(doublephimeson, processMixedEvent, "Process EventMixing for combinatorial background", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From ef31dcd3aac415f7d5f45720f5c7fe300ebc2d35 Mon Sep 17 00:00:00 2001 From: rebeccacerri <116571396+rebeccacerri@users.noreply.github.com> Date: Sat, 21 Dec 2024 01:16:50 +0100 Subject: [PATCH 02/28] [PWGDQ] Adding extra cut Upsilon analysis (#9088) --- PWGDQ/Core/CutsLibrary.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index e8e1321b2e6..cd5c7cda09f 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -2655,6 +2655,13 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("muonLowPt610SigmaPDCA")) { + cut->AddCut(GetAnalysisCut("muonLowPt6")); + cut->AddCut(GetAnalysisCut("muonQualityCuts10SigmaPDCA")); + cut->AddCut(GetAnalysisCut("MCHMID")); + return cut; + } + if (!nameStr.compare("muonLowPt")) { cut->AddCut(GetAnalysisCut("muonLowPt")); cut->AddCut(GetAnalysisCut("muonQualityCuts")); From d54e46168ddd39fe42178d4aefda630968cb5fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sat, 21 Dec 2024 09:54:40 +0100 Subject: [PATCH 03/28] [Common] Move TOF ev. time cols to PIDResponse.h (#9093) - minor adjustements for linter --- Common/DataModel/PIDResponse.h | 46 ++++++++++++++++----------- Common/TableProducer/PID/pidTOFBase.h | 6 ---- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Common/DataModel/PIDResponse.h b/Common/DataModel/PIDResponse.h index 3ef77fef8d4..90eb0e55112 100644 --- a/Common/DataModel/PIDResponse.h +++ b/Common/DataModel/PIDResponse.h @@ -94,7 +94,7 @@ template using hasTPCAl = decltype(std::declval().tpcNSigmaAl()); // PID index as template argument -#define perSpeciesWrapper(functionName) \ +#define PER_SPECIES_WRAPPER(functionName) \ template \ auto functionName(const TrackType& track) \ { \ @@ -119,8 +119,8 @@ using hasTPCAl = decltype(std::declval().tpcNSigmaAl()); } \ } -perSpeciesWrapper(tofNSigma); -perSpeciesWrapper(tofExpSigma); +PER_SPECIES_WRAPPER(tofNSigma); +PER_SPECIES_WRAPPER(tofExpSigma); template auto tofExpSignal(const TrackType& track) { @@ -144,10 +144,10 @@ auto tofExpSignal(const TrackType& track) return track.tofExpSignalAl(track.tofSignal()); } } -perSpeciesWrapper(tofExpSignalDiff); +PER_SPECIES_WRAPPER(tofExpSignalDiff); -perSpeciesWrapper(tpcNSigma); -perSpeciesWrapper(tpcExpSigma); +PER_SPECIES_WRAPPER(tpcNSigma); +PER_SPECIES_WRAPPER(tpcExpSigma); template auto tpcExpSignal(const TrackType& track) { @@ -171,12 +171,12 @@ auto tpcExpSignal(const TrackType& track) return track.tpcExpSignalAl(track.tpcSignal()); } } -perSpeciesWrapper(tpcExpSignalDiff); +PER_SPECIES_WRAPPER(tpcExpSignalDiff); -#undef perSpeciesWrapper +#undef PER_SPECIES_WRAPPER // PID index as function argument for TOF -#define perSpeciesWrapper(functionName) \ +#define PER_SPECIES_WRAPPER(functionName) \ template \ auto functionName(const o2::track::PID::ID index, const TrackType& track) \ { \ @@ -223,8 +223,8 @@ perSpeciesWrapper(tpcExpSignalDiff); } \ } -perSpeciesWrapper(tofNSigma); -perSpeciesWrapper(tofExpSigma); +PER_SPECIES_WRAPPER(tofNSigma); +PER_SPECIES_WRAPPER(tofExpSigma); template auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) { @@ -270,12 +270,12 @@ auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) return 0.f; } } -perSpeciesWrapper(tofExpSignalDiff); +PER_SPECIES_WRAPPER(tofExpSignalDiff); -#undef perSpeciesWrapper +#undef PER_SPECIES_WRAPPER // PID index as function argument for TPC -#define perSpeciesWrapper(functionName) \ +#define PER_SPECIES_WRAPPER(functionName) \ template \ auto functionName(const o2::track::PID::ID index, const TrackType& track) \ { \ @@ -322,8 +322,8 @@ perSpeciesWrapper(tofExpSignalDiff); } \ } -perSpeciesWrapper(tpcNSigma); -perSpeciesWrapper(tpcExpSigma); +PER_SPECIES_WRAPPER(tpcNSigma); +PER_SPECIES_WRAPPER(tpcExpSigma); template auto tpcExpSignal(const o2::track::PID::ID index, const TrackType& track) { @@ -369,9 +369,9 @@ auto tpcExpSignal(const o2::track::PID::ID index, const TrackType& track) return 0.f; } } -perSpeciesWrapper(tpcExpSignalDiff); +PER_SPECIES_WRAPPER(tpcExpSignalDiff); -#undef perSpeciesWrapper +#undef PER_SPECIES_WRAPPER } // namespace pidutils @@ -409,6 +409,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(EventCollisionTime, eventCollisionTime, //! Event col } // namespace pidtofsignal +namespace pidtofevtime +{ +DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C +DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C +} // namespace pidtofevtime + namespace pidtofbeta { DECLARE_SOA_COLUMN(Beta, beta, float); //! TOF beta @@ -534,6 +540,10 @@ DECLARE_SOA_TABLE(TOFSignal, "AOD", "TOFSignal", //! Table of the TOF signal pidtofsignal::TOFSignal, pidtofsignal::EventCollisionTime); +DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track. + pidtofevtime::TOFEvTime, + pidtofevtime::TOFEvTimeErr); + DECLARE_SOA_TABLE(pidTOFFlags, "AOD", "pidTOFFlags", //! Table of the flags for TOF signal quality on the track level pidflags::GoodTOFMatch); diff --git a/Common/TableProducer/PID/pidTOFBase.h b/Common/TableProducer/PID/pidTOFBase.h index d8556f95432..2861cf883ce 100644 --- a/Common/TableProducer/PID/pidTOFBase.h +++ b/Common/TableProducer/PID/pidTOFBase.h @@ -37,8 +37,6 @@ namespace o2::aod namespace pidtofevtime { -DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C -DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C // TOF only columns DECLARE_SOA_COLUMN(UsedForTOFEvTime, usedForTOFEvTime, uint8_t); //! Flag to check if track was used in the TOF event time making DECLARE_SOA_COLUMN(EvTimeTOF, evTimeTOF, float); //! Event time computed with the TOF detector @@ -46,10 +44,6 @@ DECLARE_SOA_COLUMN(EvTimeTOFErr, evTimeTOFErr, float); //! Error of th DECLARE_SOA_COLUMN(EvTimeTOFMult, evTimeTOFMult, int); //! Event time multiplicity for TOF } // namespace pidtofevtime -DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track. - pidtofevtime::TOFEvTime, - pidtofevtime::TOFEvTimeErr); - DECLARE_SOA_TABLE(EvTimeTOFOnly, "AOD", "EvTimeTOFOnly", //! Table for the TOF event time only with TOF. One entry per track. pidtofevtime::UsedForTOFEvTime, pidtofevtime::EvTimeTOF, From 8f18e638f831ce502d20057ee08aa96dc5e01ba4 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sat, 21 Dec 2024 10:13:17 +0100 Subject: [PATCH 04/28] [PWGLF] add path for findable cascades with KF (#8500) --- .../Strangeness/cascadebuilder.cxx | 63 +++++++++++-------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx index 6a7c74dc273..71a5d0143ae 100644 --- a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" @@ -1237,8 +1239,8 @@ struct cascadeBuilder { return true; } - template - bool buildCascadeCandidateWithKF(TCascObject const& cascade) + template + bool buildCascadeCandidateWithKF(TCascObject const& cascade, TV0Object const& v0) { registry.fill(HIST("hKFParticleStatistics"), 0.0f); //*>~<*>~<*>~<*>~<*>~<*>~<*>~<*>~<*>~<* @@ -1246,11 +1248,10 @@ struct cascadeBuilder { // dispenses prior V0 generation, uses constrained (re-)fit based on bachelor charge //*>~<*>~<*>~<*>~<*>~<*>~<*>~<*>~<*>~<* - // Track casting - auto bachTrack = cascade.template bachelor_as(); - auto v0 = cascade.v0(); + // Track casting for those not provided auto posTrack = v0.template posTrack_as(); auto negTrack = v0.template negTrack_as(); + auto bachTrack = cascade.template bachelor_as(); auto const& collision = cascade.collision(); if (calculateBachBaryonVars) { @@ -1624,24 +1625,14 @@ struct cascadeBuilder { // de-reference from V0 pool, either specific for cascades or general // use templatizing to avoid code duplication - auto v0index = cascade.template v0_as(); - processCascadeCandidate(v0index, cascade); - } - // En masse filling at end of process call - fillHistos(); - resetHistos(); - } - - template - void buildFindableStrangenessTables(TCascTable const& cascades) - { - statisticsRegistry.eventCounter++; - for (auto& cascade : cascades) { - // de-reference from V0 pool, either specific for cascades or general - // use templatizing to avoid code duplication - - auto v0index = cascade.template findableV0_as(); - processCascadeCandidate(v0index, cascade); + if constexpr (requires { cascade.template v0(); }) { + auto v0index = cascade.template v0_as(); + processCascadeCandidate(v0index, cascade); + } + if constexpr (requires { cascade.template findableV0(); }) { + auto v0index = cascade.template findableV0_as(); + processCascadeCandidate(v0index, cascade); + } } // En masse filling at end of process call fillHistos(); @@ -1653,7 +1644,15 @@ struct cascadeBuilder { { statisticsRegistry.eventCounter++; for (auto& cascade : cascades) { - bool validCascadeCandidateKF = buildCascadeCandidateWithKF(cascade); + bool validCascadeCandidateKF = false; + if constexpr (requires { cascade.template v0(); }) { + auto v0 = cascade.template v0_as(); + validCascadeCandidateKF = buildCascadeCandidateWithKF(cascade, v0); + } + if constexpr (requires { cascade.template findableV0(); }) { + auto v0 = cascade.template findableV0_as(); + validCascadeCandidateKF = buildCascadeCandidateWithKF(cascade, v0); + } if (!validCascadeCandidateKF) continue; // doesn't pass cascade selections @@ -1974,7 +1973,7 @@ struct cascadeBuilder { // Do analysis with collision-grouped V0s, retain full collision information const uint64_t collIdx = collision.globalIndex(); auto CascadeTable_thisCollision = cascades.sliceBy(perCollisionFindable, collIdx); - buildFindableStrangenessTables(CascadeTable_thisCollision); + buildStrangenessTables(CascadeTable_thisCollision); } } PROCESS_SWITCH(cascadeBuilder, processFindableRun3, "Produce Run 3 findable cascade tables", false); @@ -1993,6 +1992,20 @@ struct cascadeBuilder { } PROCESS_SWITCH(cascadeBuilder, processRun3withKFParticle, "Produce Run 3 KF cascade tables", false); + void processFindableRun3withKFParticle(aod::Collisions const& collisions, aod::FindableV0sLinked const&, V0full const&, soa::Filtered const& cascades, FullTracksExtIU const&, aod::BCsWithTimestamps const&) + { + for (const auto& collision : collisions) { + // Fire up CCDB + auto bc = collision.bc_as(); + initCCDB(bc); + // Do analysis with collision-grouped V0s, retain full collision information + const uint64_t collIdx = collision.globalIndex(); + auto CascadeTable_thisCollision = cascades.sliceBy(perCollisionFindable, collIdx); + buildKFStrangenessTables(CascadeTable_thisCollision); + } + } + PROCESS_SWITCH(cascadeBuilder, processFindableRun3withKFParticle, "Produce Run 3 findable cascade tables with KF processing path", false); + void processRun3withStrangenessTracking(aod::Collisions const& collisions, aod::V0sLinked const&, V0full const&, V0fCfull const&, soa::Filtered const& cascades, FullTracksExtIU const&, aod::BCsWithTimestamps const&, aod::TrackedCascades const& trackedCascades) { for (const auto& collision : collisions) { From 7d7ca059086f8258ca872ada12408ce7fb9b0977 Mon Sep 17 00:00:00 2001 From: Zhen Zhang <74494053+zz951@users.noreply.github.com> Date: Sat, 21 Dec 2024 10:36:14 +0100 Subject: [PATCH 05/28] [PWGHF] Add Lc and Hadron table (#9085) --- PWGHF/HFC/DataModel/CorrelationTables.h | 41 ++++++++++++++----- .../HFC/TableProducer/correlatorLcHadrons.cxx | 8 ++++ 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 178e3b30a0c..c4aa16f8aeb 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -51,21 +51,21 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO", // definition of columns and tables for D0-Hadron correlation pairs namespace hf_correlation_d0_hadron { -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons -DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0 -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron -DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0 -DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar -DECLARE_SOA_COLUMN(MlScoreBkgD0, mlScoreBkgD0, float); //! ML background score for D0 selection +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons +DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0 +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron +DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0 +DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar +DECLARE_SOA_COLUMN(MlScoreBkgD0, mlScoreBkgD0, float); //! ML background score for D0 selection DECLARE_SOA_COLUMN(MlScoreNonPromptD0, mlScoreNonPromptD0, float); //! ML prompt score for D0 selection DECLARE_SOA_COLUMN(MlScorePromptD0, mlScorePromptD0, float); //! ML prompt score for D0 selection DECLARE_SOA_COLUMN(MlScoreBkgD0bar, mlScoreBkgD0bar, float); //! ML background score for D0 selection DECLARE_SOA_COLUMN(MlScoreNonPromptD0bar, mlScoreNonPromptD0bar, float); //! ML prompt score for D0 selection DECLARE_SOA_COLUMN(MlScorePromptD0bar, mlScorePromptD0bar, float); //! ML prompt score for D0 selection -DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent -DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status +DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status enum ParticleTypeData { D0Only = 1, // Identified as D0 @@ -243,6 +243,27 @@ DECLARE_SOA_TABLE(TrackRecoInfo, "AOD", "TRACKRECOINFO", //! Tracks Reconstructe aod::hf_correlation_ds_hadron::TrackDcaZ, aod::hf_correlation_ds_hadron::TrackTPCNClsCrossedRows); +// definition of columns and tables for LambdaC properties +namespace hf_lc_baryon +{ +DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi of Lc +DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta of Lc +DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc +DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity +DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision +DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision +} // namespace hf_lc_baryon + +DECLARE_SOA_TABLE(Lc, "AOD", "LC", //! Lc properties + aod::hf_lc_baryon::Phi, + aod::hf_lc_baryon::Eta, + aod::hf_lc_baryon::PtLc, + aod::hf_lc_baryon::MLc, + aod::hf_lc_baryon::PoolBin, + aod::hf_lc_baryon::GIndexCol, + aod::hf_lc_baryon::TimeStamp); + // definition of columns and tables for Dplus properties namespace hf_dplus_meson { diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 97538f65ebc..5c77f9da21e 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -166,6 +166,8 @@ struct HfCorrelatorLcHadrons { Produces entryLcHadronGenInfo; Produces entryLcCandGenInfo; Produces entryTrackRecoInfo; + Produces entryLc; + Produces entryHadron; Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; @@ -321,6 +323,9 @@ struct HfCorrelatorLcHadrons { if (correlateLcWithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); } + auto bc = collision.bc_as(); + int gCollisionId = collision.globalIndex(); + int64_t timeStamp = bc.timestamp(); int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; @@ -368,6 +373,7 @@ struct HfCorrelatorLcHadrons { outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; } entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLc(candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassLcToPKPi(candidate), poolBin, gCollisionId, timeStamp); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); @@ -377,6 +383,7 @@ struct HfCorrelatorLcHadrons { outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; } entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLc(candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassLcToPiKP(candidate), poolBin, gCollisionId, timeStamp); } // Lc-Hadron correlation dedicated section @@ -432,6 +439,7 @@ struct HfCorrelatorLcHadrons { } } if (cntLc == 0) { + entryHadron(track.phi(), track.eta(), track.pt(), poolBin, gCollisionId, timeStamp); registry.fill(HIST("hTracksBin"), poolBin); } } // Hadron Tracks loop From 52fcea8a7f8ec7fd2fd45bd494642503f970bc17 Mon Sep 17 00:00:00 2001 From: Samuele Cattaruzzi <124249902+scattaru@users.noreply.github.com> Date: Sat, 21 Dec 2024 10:37:44 +0100 Subject: [PATCH 06/28] [PWGHF] Ds-h correlation, fix bug in ME derived data (#9086) Co-authored-by: ALICE Action Bot --- .../HFC/TableProducer/correlatorDsHadrons.cxx | 20 ++++----- .../correlatorDsHadronsReduced.cxx | 4 +- PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 45 ++++++++++--------- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 090b3f45d23..740d7832491 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -417,7 +417,7 @@ struct HfCorrelatorDsHadrons { track.pt(), poolBin); entryDsHadronRecoInfo(hfHelper.invMassDsToKKPi(candidate), false, false); - entryDsHadronGenInfo(false, false, 0); + // entryDsHadronGenInfo(false, false, 0); entryDsHadronMlInfo(outputMl[0], outputMl[2]); entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); } else if (candidate.isSelDsToPiKK() >= selectionFlagDs) { @@ -427,7 +427,7 @@ struct HfCorrelatorDsHadrons { track.pt(), poolBin); entryDsHadronRecoInfo(hfHelper.invMassDsToPiKK(candidate), false, false); - entryDsHadronGenInfo(false, false, 0); + // entryDsHadronGenInfo(false, false, 0); entryDsHadronMlInfo(outputMl[0], outputMl[2]); entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); } @@ -688,8 +688,8 @@ struct HfCorrelatorDsHadrons { entryDsHadronRecoInfo(MassDS, true, isDecayChan); entryDsHadronGenInfo(isDsPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); } - } - } + } // end loop generated particles + } // end loop generated Ds } // end loop reconstructed collision } // end loop generated collision } @@ -706,7 +706,7 @@ struct HfCorrelatorDsHadrons { auto tracksThisColl = tracks.sliceBy(trackIndicesPerCollision, thisCollId); // Ds fill histograms and Ds candidates information stored - for (const auto& candidate : candidates) { + for (const auto& candidate : candsDsThisColl) { // candidate selected if (candidate.isSelDsToKKPi() >= selectionFlagDs) { candReduced(hfcReducedCollisionIndex, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToKKPi(candidate)); @@ -716,7 +716,7 @@ struct HfCorrelatorDsHadrons { } // tracks information - for (const auto& track : tracks) { + for (const auto& track : tracksThisColl) { if (!track.isGlobalTrackWoDCA()) { continue; } @@ -742,7 +742,7 @@ struct HfCorrelatorDsHadrons { int indexHfcReducedCollision = collReduced.lastIndex() + 1; // Ds fill histograms and Ds candidates information stored - for (const auto& candidate : candidates) { + for (const auto& candidate : candsDsThisColl) { // candidate selected if (candidate.isSelDsToKKPi() >= selectionFlagDs) { candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToKKPi(candidate)); @@ -752,7 +752,7 @@ struct HfCorrelatorDsHadrons { } // tracks information - for (const auto& track : tracks) { + for (const auto& track : tracksThisColl) { if (!track.isGlobalTrackWoDCA()) { continue; } @@ -808,7 +808,7 @@ struct HfCorrelatorDsHadrons { pAssoc.pt(), poolBin); entryDsHadronRecoInfo(hfHelper.invMassDsToKKPi(cand), false, false); - entryDsHadronGenInfo(false, false, 0); + // entryDsHadronGenInfo(false, false, 0); for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = cand.mlProbDsToKKPi()[classMl->at(iclass)]; } @@ -822,7 +822,7 @@ struct HfCorrelatorDsHadrons { pAssoc.pt(), poolBin); entryDsHadronRecoInfo(hfHelper.invMassDsToPiKK(cand), false, false); - entryDsHadronGenInfo(false, false, 0); + // entryDsHadronGenInfo(false, false, 0); for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = cand.mlProbDsToPiKK()[classMl->at(iclass)]; } diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx index 37cf40766f2..78e05a61ec1 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx @@ -43,7 +43,7 @@ using BinningTypeDerived = ColumnBinningPolicy entryDsHadronPair; Produces entryDsHadronRecoInfo; - Produces entryDsHadronGenInfo; + // Produces entryDsHadronGenInfo; Configurable fillHistoData{"fillHistoData", true, "Flag for filling histograms in data processes"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; @@ -109,7 +109,7 @@ struct HfCorrelatorDsHadronsReduced { pAssoc.ptAssocTrack(), poolBin); entryDsHadronRecoInfo(cand.invMassDs(), false, false); - entryDsHadronGenInfo(false, false, 0); + // entryDsHadronGenInfo(false, false, 0); } } } diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index 89d8631652e..1611f3560a0 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -14,6 +14,8 @@ /// \author Grazia Luparello /// \author Samuele Cattaruzzi +#include + #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -59,8 +61,8 @@ struct HfTaskCorrelationDsHadrons { Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; Configurable> binsPtD{"binsPtD", std::vector{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle efficiency"}; - Configurable> mlOutputPrompt{"mlScorePrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; - Configurable> mlOutputBkg{"mlScoreBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; + Configurable> mlOutputPrompt{"mlOutputPrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkg{"mlOutputBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; Configurable> binsPtEfficiencyD{"binsPtEfficiencyD", std::vector{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for D-meson efficiency"}; Configurable> binsPtEfficiencyHad{"binsPtEfficiencyHad", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for associated particle efficiency"}; Configurable> efficiencyD{"efficiencyD", {1., 1., 1., 1., 1., 1.}, "efficiency values for Ds meson"}; @@ -71,15 +73,6 @@ struct HfTaskCorrelationDsHadrons { Configurable> sidebandLeftOuter{"sidebandLeftOuter", {1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040}, "Outer values of left sideband vs pT"}; Configurable> sidebandRightInner{"sidebandRightInner", {2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000}, "Inner values of right sideband vs pT"}; Configurable> sidebandRightOuter{"sidebandRightOuter", {2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320}, "Outer values of right sideband vs pT"}; - ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; - ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; - ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - - HfHelper hfHelper; enum CandidateStep { kCandidateStepMcGenDsToKKPi = 0, @@ -98,7 +91,11 @@ struct HfTaskCorrelationDsHadrons { kAssocTrackStepRecoSpecies, kAssocTrackNSteps }; + HfHelper hfHelper; + SliceCache cache; + using DsHadronPairFull = soa::Join; + using DsHadronPairWithMl = soa::Join; using DsHadronPairFullWithMl = soa::Join; using CandDsMcReco = soa::Filtered>; // flagDsFilter applied using CandDsMcGen = soa::Join; // flagDsFilter applied @@ -107,6 +104,20 @@ struct HfTaskCorrelationDsHadrons { Filter flagDsFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) != static_cast(0)) && (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + Preslice perCollisionCand = o2::aod::hf_cand::collisionId; + Preslice perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; + Preslice perCollision = o2::aod::track::collisionId; + Preslice perCollisionMc = o2::aod::mcparticle::mcCollisionId; + PresliceUnsorted> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; + + ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -218,7 +229,7 @@ struct HfTaskCorrelationDsHadrons { } } - void processData(DsHadronPairFullWithMl const& pairEntries, + void processData(DsHadronPairWithMl const& pairEntries, aod::DsCandRecoInfo const& candidates) { for (const auto& candidate : candidates) { @@ -410,7 +421,7 @@ struct HfTaskCorrelationDsHadrons { } PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcGen, "Process MC Gen mode", false); - void processDataME(DsHadronPairFullWithMl const& pairEntries) + void processDataME(DsHadronPairWithMl const& pairEntries) { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities @@ -524,11 +535,6 @@ struct HfTaskCorrelationDsHadrons { } PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcRecME, "Process MC Reco ME", false); - SliceCache cache; - Preslice perCollisionCand = o2::aod::hf_cand::collisionId; - Preslice perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; - PresliceUnsorted> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; - /// Ds-Hadron correlation - for calculating candidate reconstruction efficiency using MC reco-level analysis void processMcCandEfficiency(soa::Join const& collisions, soa::Join const& mcCollisions, @@ -727,9 +733,6 @@ struct HfTaskCorrelationDsHadrons { } PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcCandEfficiencyWoColl, "Process MC for calculating candidate reconstruction efficiency", false); - Preslice perCollision = o2::aod::track::collisionId; - Preslice perCollisionMc = o2::aod::mcparticle::mcCollisionId; - /// Ds-Hadron correlation - for calculating associated particle tracking efficiency using MC reco-level analysis void processMcTrackEfficiency(soa::Join const& collisions, soa::Join const& mcCollisions, From 327de636d695faef713cfb56f421614125254338 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sat, 21 Dec 2024 19:46:47 +0100 Subject: [PATCH 07/28] [Common] add fatal if tracksExtra converter has no process enabled (#9098) --- .../TableProducer/Converters/tracksExtraV002Converter.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Common/TableProducer/Converters/tracksExtraV002Converter.cxx b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx index 7765daa9e5e..d081f525cc9 100644 --- a/Common/TableProducer/Converters/tracksExtraV002Converter.cxx +++ b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx @@ -19,6 +19,13 @@ using namespace o2::framework; struct TracksExtraV002Converter { Produces tracksExtra_002; + void init(InitContext const&) + { + if (doprocessV000ToV002 == false && doprocessV001ToV002 == false) { + LOGF(fatal, "Neither processV000ToV002 nor processV001ToV002 is enabled. Please choose one!"); + } + } + void processV000ToV002(aod::TracksExtra_000 const& tracksExtra_000) { From c23922074610b17f27c80136ae2416ccc71dd626 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Sat, 21 Dec 2024 19:58:15 +0100 Subject: [PATCH 08/28] [PWGHF,Trigger] Add vertex reconstruction for all B hadrons in software triggers (#9099) Co-authored-by: ALICE Action Bot --- EventFiltering/PWGHF/HFFilter.cxx | 185 ++++++++++++++----- EventFiltering/PWGHF/HFFilterHelpers.h | 236 ++++++++++++++++--------- 2 files changed, 288 insertions(+), 133 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 1b7ec0ee02d..4b414ed814b 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -67,8 +67,7 @@ struct HfFilter { // Main struct for HF triggers Configurable activateQA{"activateQA", 0, "flag to enable QA histos (0 no QA, 1 basic QA, 2 extended QA, 3 very extended QA)"}; Configurable applyEventSelection{"applyEventSelection", true, "flag to enable event selection (sel8 + Zvt and possibly time-frame border cut)"}; - Configurable applyTimeFrameBorderCut{"applyTimeFrameBorderCut", true, "flag to enable time-frame border cut"}; - Configurable activateSecVtx{"activateSecVtx", false, "flag to enable 2nd vertex fitting - only beauty hadrons"}; + Configurable activateSecVtxForB{"activateSecVtxForB", false, "flag to enable 2nd vertex fitting - only beauty hadrons"}; // parameters for all triggers // nsigma PID (except for V0 and cascades) @@ -80,7 +79,6 @@ struct HfFilter { // Main struct for HF triggers Configurable> ptThresholds{"ptThresholds", {cutsHighPtThresholds[0], 1, 2, labelsEmpty, labelsColumnsHighPtThresholds}, "pT treshold for high pT charm hadron candidates for kHighPt triggers in GeV/c"}; // parameters for beauty triggers - Configurable> deltaMassBeauty{"deltaMassBeauty", {cutsDeltaMassB[0], 1, kNBeautyParticles, labelsEmpty, labelsColumnsDeltaMassB}, "invariant-mass delta with respect to the b-hadron masses in GeV/c2"}; Configurable> pTBinsTrack{"pTBinsTrack", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for DCAXY pT-dependent cut"}; Configurable> cutsTrackBeauty3Prong{"cutsTrackBeauty3Prong", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for 3-prong beauty candidates"}; Configurable> cutsTrackBeauty4Prong{"cutsTrackBeauty4Prong", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for 4-prong beauty candidates"}; @@ -88,6 +86,11 @@ struct HfFilter { // Main struct for HF triggers Configurable numSigmaDeltaMassCharmHad{"numSigmaDeltaMassCharmHad", 2.5, "Number of sigma for charm-hadron delta mass cut in B and D resonance triggers"}; Configurable> pTBinsBHadron{"pTBinsBHadron", std::vector{hf_trigger_cuts_presel_beauty::vecBinsPt}, "pT bin limits for beauty hadrons preselections"}; Configurable> cutsBplus{"cutsBplus", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "B+ candidate selection per pT bin"}; + Configurable> cutsBzeroToDstar{"cutsBzeroToDstar", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "B0 -> D*+ candidate selection per pT bin"}; + Configurable> cutsBzero{"cutsBzero", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "B0 candidate selection per pT bin"}; + Configurable> cutsBs{"cutsBs", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "Bs candidate selection per pT bin"}; + Configurable> cutsLb{"cutsLb", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "Lb candidate selection per pT bin"}; + Configurable> cutsXib{"cutsXib", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "Xib candidate selection per pT bin"}; // parameters for femto triggers Configurable femtoMaxRelativeMomentum{"femtoMaxRelativeMomentum", 2., "Maximal allowed value for relative momentum between charm-proton pairs in GeV/c"}; @@ -149,7 +152,9 @@ struct HfFilter { // Main struct for HF triggers std::array, kNCharmParticles> thresholdBDTScores; o2::vertexing::DCAFitterN<2> df2; // fitter for Charm Hadron vertex (2-prong vertex fitter) + o2::vertexing::DCAFitterN<3> df3; // fitter for Charm Hadron vertex (3-prong vertex fitter) o2::vertexing::DCAFitterN<2> dfB; // fitter for Beauty Hadron vertex (2-prong vertex fitter) + o2::vertexing::DCAFitterN<3> dfBtoDstar; // fitter for Beauty Hadron to D* vertex (3-prong vertex fitter) HistogramRegistry registry{"registry"}; std::shared_ptr hProcessedEvents; @@ -194,7 +199,7 @@ struct HfFilter { // Main struct for HF triggers helper.setPtLimitsCharmBaryonBachelor(ptCuts->get(0u, 3u), ptCuts->get(1u, 3u)); helper.setCutsSingleTrackBeauty(cutsTrackBeauty3Prong, cutsTrackBeauty4Prong); helper.setCutsSingleTrackCharmBaryonBachelor(cutsTrackCharmBaryonBachelor); - helper.setCutsBplus(cutsBplus); + helper.setCutsBhadrons(cutsBplus, cutsBzeroToDstar, cutsBzero, cutsBs, cutsLb, cutsXib); helper.setNsigmaProtonCutsForFemto(std::array{nSigmaPidCuts->get(0u, 3u), nSigmaPidCuts->get(1u, 3u), nSigmaPidCuts->get(2u, 3u)}); helper.setNsigmaDeuteronCutsForFemto(std::array{nSigmaPidCuts->get(0u, 6u), nSigmaPidCuts->get(1u, 6u), nSigmaPidCuts->get(2u, 6u)}); helper.setNsigmaProtonCutsForCharmBaryons(nSigmaPidCuts->get(0u, 0u), nSigmaPidCuts->get(1u, 0u)); @@ -210,9 +215,11 @@ struct HfFilter { // Main struct for HF triggers helper.setPtRangeSoftPiSigmaC(ptCuts->get(0u, 4u), ptCuts->get(1u, 4u)); helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(0u, 8u), cutsPtDeltaMassCharmReso->get(1u, 8u), cutsPtDeltaMassCharmReso->get(0u, 9u), cutsPtDeltaMassCharmReso->get(1u, 9u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u), cutsPtDeltaMassCharmReso->get(2u, 8u), cutsPtDeltaMassCharmReso->get(2u, 9u)); helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u)); - if (activateSecVtx) { + if (activateSecVtxForB) { helper.setVtxConfiguration(df2, false); // (DCAFitterN, useAbsDCA) + helper.setVtxConfiguration(df3, false); helper.setVtxConfiguration(dfB, true); + helper.setVtxConfiguration(dfBtoDstar, true); } hProcessedEvents = registry.add("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, +kNtriggersHF + 1.5}}); for (auto iBin = 0; iBin < kNtriggersHF + 2; ++iBin) { @@ -262,7 +269,9 @@ struct HfFilter { // Main struct for HF triggers hMassVsPtB[iBeautyPart] = registry.add(Form("fMassVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("#it{M} vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, massAxisB[iBeautyPart]}); hCpaVsPtB[iBeautyPart] = registry.add(Form("fCpaVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("CPA vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, -1, 1}}); hDecayLengthVsPtB[iBeautyPart] = registry.add(Form("fDecayLengthVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("DecayLength vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, 0, 20}}); - hImpactParamProductVsPtB[iBeautyPart] = registry.add(Form("fImpactParamProductVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("ImpactParamProduct vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, -2.5, +2.5}}); + if (iBeautyPart != kB0toDStar) { + hImpactParamProductVsPtB[iBeautyPart] = registry.add(Form("fImpactParamProductVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("ImpactParamProduct vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, -2.5, +2.5}}); + } } constexpr int kNBinsHfVtxStages = kNHfVtxStage; std::string labels[kNBinsHfVtxStages]; @@ -270,9 +279,12 @@ struct HfFilter { // Main struct for HF triggers labels[HfVtxStage::BeautyVertex] = "vertex CharmHad-Pi pairs"; labels[HfVtxStage::CharmHadPiSelected] = "selected CharmHad-Pi pairs"; static const AxisSpec axisHfVtxStages = {kNBinsHfVtxStages, 0.5, kNBinsHfVtxStages + 0.5, ""}; - registry.add("fHfVtxStages", "HfVtxStages;;entries", HistType::kTH1F, {axisHfVtxStages}); + registry.add("fHfVtxStages", "HfVtxStages;;entries", HistType::kTH2F, {axisHfVtxStages, {kNBeautyParticles, -0.5, +kNBeautyParticles - 0.5}}); for (int iBin = 0; iBin < kNBinsHfVtxStages; iBin++) { - registry.get(HIST("fHfVtxStages"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + registry.get(HIST("fHfVtxStages"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } + for (int iBin = 0; iBin < kNBeautyParticles; iBin++) { + registry.get(HIST("fHfVtxStages"))->GetYaxis()->SetBinLabel(iBin + 1, beautyParticleNames[iBin].data()); } for (int iV0{kPhoton}; iV0 < kNV0; ++iV0) { @@ -341,7 +353,7 @@ struct HfFilter { // Main struct for HF triggers for (const auto& collision : collisions) { bool keepEvent[kNtriggersHF]{false}; - if (applyEventSelection && (!collision.sel8() || std::fabs(collision.posZ()) > 11.f || (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && applyTimeFrameBorderCut))) { // safety margin for Zvtx + if (applyEventSelection && (!collision.sel8() || std::fabs(collision.posZ()) > 11.f)) { // safety margin for Zvtx tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P]); continue; } @@ -479,11 +491,11 @@ struct HfFilter { // Main struct for HF triggers auto massCand = RecoDecay::m(std::array{pVec2Prong, pVecThird}, std::array{massD0, massPi}); auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird); auto ptCand = RecoDecay::pt(pVecBeauty3Prong); - if (TESTBIT(isTrackSelected, kForBeauty) && helper.isSelectedBplusInMassRange(ptCand, massCand)) { + if (TESTBIT(isTrackSelected, kForBeauty) && helper.isSelectedBhadronInMassRange(ptCand, massCand, kBplus)) { if (activateQA) { - registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::Skimmed); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::Skimmed, kBplus); } - if (!activateSecVtx) { + if (!activateSecVtxForB) { keepEvent[kBeauty3P] = true; // fill optimisation tree for D0 if (applyOptimisation) { @@ -494,22 +506,24 @@ struct HfFilter { // Main struct for HF triggers } } else { df2.process(trackParPos, trackParNeg); - df2.getTrack(0).getPxPyPzGlo(pVecPos); - df2.getTrack(1).getPxPyPzGlo(pVecNeg); + std::array pVecPosVtx{}, pVecNegVtx{}; + df2.getTrack(0).getPxPyPzGlo(pVecPosVtx); + df2.getTrack(1).getPxPyPzGlo(pVecNegVtx); auto trackParD = df2.createParentTrackParCov(); trackParD.setAbsCharge(0); // to be sure - auto pVec2Prong = RecoDecay::pVec(pVecPos, pVecNeg); + auto pVec2ProngVtx = RecoDecay::pVec(pVecPosVtx, pVecNegVtx); if (dfB.process(trackParD, trackParThird) != 0) { if (activateQA) { - registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, kBplus); } const auto& secondaryVertexBplus = dfB.getPCACandidate(); dfB.propagateTracksToVertex(); - dfB.getTrack(0).getPxPyPzGlo(pVec2Prong); - dfB.getTrack(1).getPxPyPzGlo(pVecThird); + std::array pVecThirdVtx{}; + dfB.getTrack(0).getPxPyPzGlo(pVec2ProngVtx); + dfB.getTrack(1).getPxPyPzGlo(pVecThirdVtx); o2::gpu::gpustd::array dca2Prong; //{trackParD.dcaXY(), trackParD.dcaZ()}; o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParD, 2.f, noMatCorr, &dca2Prong); - bool isBplus = helper.isSelectedBplus(pVec2Prong, pVecThird, dca2Prong, dcaThird, std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}); + bool isBplus = helper.isSelectedBhadron(pVec2ProngVtx, pVecThirdVtx, dca2Prong, dcaThird, std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}, kBplus); if (isBplus) { keepEvent[kBeauty3P] = true; // fill optimisation tree for D0 @@ -517,10 +531,10 @@ struct HfFilter { // Main struct for HF triggers optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], dcaThird[0]); } if (activateQA) { - registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::CharmHadPiSelected); - hCpaVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), RecoDecay::cpa(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}, RecoDecay::pVec(pVec2Prong, pVecThird))); - hDecayLengthVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), RecoDecay::distance(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]})); - hImpactParamProductVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), dca2Prong[0] * dcaThird[0]); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::CharmHadPiSelected, kBplus); + hCpaVsPtB[kBplus]->Fill(ptCand, RecoDecay::cpa(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}, RecoDecay::pVec(pVec2ProngVtx, pVecThirdVtx))); + hDecayLengthVsPtB[kBplus]->Fill(ptCand, RecoDecay::distance(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]})); + hImpactParamProductVsPtB[kBplus]->Fill(ptCand, dca2Prong[0] * dcaThird[0]); hMassVsPtB[kBplus]->Fill(ptCand, massCand); } } @@ -549,7 +563,7 @@ struct HfFilter { // Main struct for HF triggers if (track.globalIndex() == trackB.globalIndex()) { continue; } - auto trackParFourth = getTrackPar(trackB); + auto trackParFourth = getTrackParCov(trackB); o2::gpu::gpustd::array dcaFourth{trackB.dcaXY(), trackB.dcaZ()}; std::array pVecFourth = trackB.pVector(); if (trackB.collisionId() != thisCollId) { @@ -560,16 +574,54 @@ struct HfFilter { // Main struct for HF triggers auto isTrackFourthSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackB, trackParFourth, dcaFourth, kBeauty3P); if (track.sign() * trackB.sign() < 0 && TESTBIT(isTrackFourthSelected, kForBeauty)) { auto massCandB0 = RecoDecay::m(std::array{pVecBeauty3Prong, pVecFourth}, std::array{massDStar, massPi}); - if (std::fabs(massCandB0 - massB0) <= deltaMassBeauty->get(0u, 2u)) { - keepEvent[kBeauty3P] = true; - // fill optimisation tree for D0 - if (applyOptimisation) { - optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413 - } + auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth); + auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong); + if (helper.isSelectedBhadronInMassRange(ptCandBeauty4Prong, massCandB0, kB0toDStar)) { if (activateQA) { - auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth); - auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong); - hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::Skimmed, kB0toDStar); + } + if (!activateSecVtxForB) { + keepEvent[kBeauty3P] = true; + // fill optimisation tree for D* + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413 + } + if (activateQA) { + hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0); + } + } else { + df2.process(trackParPos, trackParNeg); + std::array pVecPosVtx{}, pVecNegVtx{}; + df2.getTrack(0).getPxPyPzGlo(pVecPosVtx); + df2.getTrack(1).getPxPyPzGlo(pVecNegVtx); + auto trackParD = df2.createParentTrackParCov(); + trackParD.setAbsCharge(0); // to be sure + auto pVec2ProngVtx = RecoDecay::pVec(pVecPosVtx, pVecNegVtx); + if (dfBtoDstar.process(trackParD, trackParThird, trackParFourth) != 0) { + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, kB0toDStar); + } + const auto& secondaryVertexBzero = dfBtoDstar.getPCACandidate(); + dfBtoDstar.propagateTracksToVertex(); + std::array pVecThirdVtx{}, pVecFourthVtx{}; + dfBtoDstar.getTrack(0).getPxPyPzGlo(pVec2ProngVtx); + dfBtoDstar.getTrack(1).getPxPyPzGlo(pVecThirdVtx); + dfBtoDstar.getTrack(2).getPxPyPzGlo(pVecFourthVtx); + bool isBzero = helper.isSelectedBzeroToDstar(pVec2ProngVtx, pVecThirdVtx, pVecFourthVtx, std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBzero[0], secondaryVertexBzero[1], secondaryVertexBzero[2]}); + if (isBzero) { + keepEvent[kBeauty3P] = true; + // fill optimisation tree for D0 + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413 + } + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::CharmHadPiSelected, kB0toDStar); + hCpaVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, RecoDecay::cpa(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBzero[0], secondaryVertexBzero[1], secondaryVertexBzero[2]}, RecoDecay::pVec(pVec2ProngVtx, pVecThirdVtx, pVecFourthVtx))); + hDecayLengthVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, RecoDecay::distance(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBzero[0], secondaryVertexBzero[1], secondaryVertexBzero[2]})); + hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0); + } + } + } } } } @@ -790,9 +842,9 @@ struct HfFilter { // Main struct for HF triggers auto trackSecond = cand3Prong.prong1_as(); auto trackThird = cand3Prong.prong2_as(); - auto trackParFirst = getTrackPar(trackFirst); - auto trackParSecond = getTrackPar(trackSecond); - auto trackParThird = getTrackPar(trackThird); + auto trackParFirst = getTrackParCov(trackFirst); + auto trackParSecond = getTrackParCov(trackSecond); + auto trackParThird = getTrackParCov(trackThird); o2::gpu::gpustd::array dcaFirst{trackFirst.dcaXY(), trackFirst.dcaZ()}; o2::gpu::gpustd::array dcaSecond{trackSecond.dcaXY(), trackSecond.dcaZ()}; o2::gpu::gpustd::array dcaThird{trackThird.dcaXY(), trackThird.dcaZ()}; @@ -924,7 +976,7 @@ struct HfFilter { // Main struct for HF triggers continue; } - auto trackParFourth = getTrackPar(track); + auto trackParFourth = getTrackParCov(track); o2::gpu::gpustd::array dcaFourth{track.dcaXY(), track.dcaZ()}; std::array pVecFourth = track.pVector(); if (track.collisionId() != thisCollId) { @@ -935,22 +987,61 @@ struct HfFilter { // Main struct for HF triggers int charmParticleID[kNBeautyParticles - 2] = {o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kXiCPlus}; float massCharmHypos[kNBeautyParticles - 2] = {massDPlus, massDs, massLc, massXic}; - float massBeautyHypos[kNBeautyParticles - 2] = {massB0, massBs, massLb, massXib}; - float deltaMassHypos[kNBeautyParticles - 2] = {deltaMassBeauty->get(0u, 1u), deltaMassBeauty->get(0u, 3u), deltaMassBeauty->get(0u, 4u), deltaMassBeauty->get(0u, 5u)}; auto isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(track, trackParFourth, dcaFourth, kBeauty4P); if (track.sign() * sign3Prong < 0 && TESTBIT(isTrackSelected, kForBeauty)) { for (int iHypo{0}; iHypo < kNBeautyParticles - 2 && !keepEvent[kBeauty4P]; ++iHypo) { if (isBeautyTagged[iHypo] && (TESTBIT(is3ProngInMass[iHypo], 0) || TESTBIT(is3ProngInMass[iHypo], 1))) { auto massCandB = RecoDecay::m(std::array{pVec3Prong, pVecFourth}, std::array{massCharmHypos[iHypo], massPi}); - if (std::fabs(massCandB - massBeautyHypos[iHypo]) <= deltaMassHypos[iHypo]) { - keepEvent[kBeauty4P] = true; - if (applyOptimisation) { - optimisationTreeBeauty(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], dcaFourth[0]); - } + auto pVecBeauty4Prong = RecoDecay::pVec(pVec3Prong, pVecFourth); + auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong); + if (helper.isSelectedBhadronInMassRange(ptCandBeauty4Prong, massCandB, iHypo + 2)) { // + 2 to account for B+ and B0->D*+ if (activateQA) { - auto pVecBeauty4Prong = RecoDecay::pVec(pVec3Prong, pVecFourth); - auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong); - hMassVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, massCandB); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::Skimmed, iHypo + 2); + } + if (!activateSecVtxForB) { + keepEvent[kBeauty4P] = true; + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], dcaFourth[0]); + } + if (activateQA) { + hMassVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, massCandB); + } + } else { + df3.process(trackParFirst, trackParSecond, trackParThird); + std::array pVecFirstVtx{}, pVecSecondVtx{}, pVecThirdVtx{}; + df3.getTrack(0).getPxPyPzGlo(pVecFirstVtx); + df3.getTrack(1).getPxPyPzGlo(pVecSecondVtx); + df3.getTrack(1).getPxPyPzGlo(pVecThirdVtx); + auto trackParD = df3.createParentTrackParCov(); + trackParD.setAbsCharge(sign3Prong); // to be sure + auto pVec3ProngVtx = RecoDecay::pVec(pVecFirstVtx, pVecSecondVtx, pVecThirdVtx); + if (dfB.process(trackParD, trackParFourth) != 0) { + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, iHypo + 2); + } + const auto& secondaryVertexB = dfB.getPCACandidate(); + dfB.propagateTracksToVertex(); + std::array pVecFourtVtx{}; + dfB.getTrack(0).getPxPyPzGlo(pVec3ProngVtx); + dfB.getTrack(1).getPxPyPzGlo(pVecFourtVtx); + o2::gpu::gpustd::array dca3Prong; //{trackParD.dcaXY(), trackParD.dcaZ()}; + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParD, 2.f, noMatCorr, &dca3Prong); + bool isBhad = helper.isSelectedBhadron(pVec3ProngVtx, pVecFourtVtx, dca3Prong, dcaFourth, std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexB[0], secondaryVertexB[1], secondaryVertexB[2]}, iHypo + 2); + if (isBhad) { + keepEvent[kBeauty4P] = true; + // fill optimisation tree + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], dcaFourth[0]); + } + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::CharmHadPiSelected, iHypo + 2); + hCpaVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, RecoDecay::cpa(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexB[0], secondaryVertexB[1], secondaryVertexB[2]}, RecoDecay::pVec(pVec3ProngVtx, pVecFourtVtx))); + hDecayLengthVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, RecoDecay::distance(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexB[0], secondaryVertexB[1], secondaryVertexB[2]})); + hImpactParamProductVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, dca3Prong[0] * dcaFourth[0]); + hMassVsPtB[iHypo + 2]->Fill(ptCandBeauty4Prong, massCandB); + } + } + } } } } diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 73df6b6fa8d..fe38a740903 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -220,10 +220,6 @@ static const std::vector labelsRowsNsigma = {"TPC", "TOF", "Comb"}; constexpr float cutsHighPtThresholds[1][2] = {{8., 8.}}; // 2-prongs, 3-prongs static const std::vector labelsColumnsHighPtThresholds = {"2Prongs", "3Prongs"}; -// beauty -constexpr float cutsDeltaMassB[1][kNBeautyParticles] = {{0.4, 0.4, 0.4, 0.4, 0.4, 0.4}}; // B+, B0, B0toDstar, Bs, Lb, Xib -static const std::vector labelsColumnsDeltaMassB = {"Bplus", "BZero", "BZeroToDstar", "Bs", "Lb", "Xib"}; - namespace hf_trigger_cuts_presel_beauty { static constexpr int nBinsPt = 2; @@ -306,9 +302,14 @@ class HfFilterHelper mCutsSingleTrackBeauty3Prong = cutsSingleTrack3P; mCutsSingleTrackBeauty4Prong = cutsSingleTrack4P; } - void setCutsBplus(o2::framework::LabeledArray cutsBeautyHadrons) + void setCutsBhadrons(o2::framework::LabeledArray cutsBplus, o2::framework::LabeledArray cutsB0toDstar, o2::framework::LabeledArray cutsB0, o2::framework::LabeledArray cutsBs, o2::framework::LabeledArray cutsLb, o2::framework::LabeledArray cutsXib) { - mCutsBplus = cutsBeautyHadrons; + mCutsBhad[kBplus] = cutsBplus; + mCutsBhad[kB0toDStar] = cutsB0toDstar; + mCutsBhad[kB0] = cutsB0; + mCutsBhad[kBs] = cutsBs; + mCutsBhad[kLb] = cutsLb; + mCutsBhad[kXib] = cutsXib; } void setPtLimitsProtonForFemto(float minPt, float maxPt) { @@ -472,9 +473,11 @@ class HfFilterHelper template bool isSelectedKaonFromXicResoToSigmaC(const T& track); template - inline bool isSelectedBplus(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx); + inline bool isSelectedBhadron(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx, const int whichB); template - inline bool isSelectedBplusInMassRange(T1 const& ptCand, T2 const& massCand); + inline bool isSelectedBhadronInMassRange(T1 const& ptCand, T2 const& massCand, const int whichB); + template + inline bool isSelectedBzeroToDstar(T1 const& pVecTrack0, T1 const& pVecTrack1, T1 const& pVecTrack2, const T2& primVtx, const T3& secVtx); template inline bool isCharmHadronMassInSbRegions(T1 const& massHypo1, T1 const& massHypo2, const float& lowLimitSB, const float& upLimitSB); @@ -508,75 +511,75 @@ class HfFilterHelper int findBin(T1 const& binsPt, T2 value); // selections - std::vector mPtBinsTracks{}; // vector of pT bins for single track cuts - std::vector mPtBinsBeautyHadrons{}; // vector of pT bins for beauty hadron candidates - o2::framework::LabeledArray mCutsSingleTrackBeauty3Prong{}; // dca selections for the 3-prong b-hadron pion daughter - o2::framework::LabeledArray mCutsSingleTrackBeauty4Prong{}; // dca selections for the 4-prong b-hadron pion daughter - float mPtMinSoftPionForDstar{0.1}; // minimum pt for the D*+ soft pion - float mPtMinSoftPionForSigmaC{0.1}; // minimum pt for the Σ0,++ soft pion - float mPtMaxSoftPionForSigmaC{10000.f}; // maximum pt for the Σ0,++ soft pion - float mPtMinSoftKaonForXicResoToSigmaC{0.1}; // minimum pt for the soft kaon of Xic* to SigmaC-Kaon - float mPtMaxSoftKaonForXicResoToSigmaC{10000.f}; // maximum pt for the soft kaon of Xic* to SigmaC-Kaon - float mPtMinBeautyBachelor{0.5}; // minimum pt for the b-hadron pion daughter - float mPtMinProtonForFemto{0.8}; // minimum pt for the proton for femto - float mPtMinDeuteronForFemto{0.8}; // minimum pt for the deuteron for femto - float mPtMinCharmBaryonBachelor{0.5}; // minimum pt for the bachelor pion from Xic/Omegac decays - float mPtMaxSoftPionForDstar{2.}; // maximum pt for the D*+ soft pion - float mPtMaxBeautyBachelor{100000.}; // maximum pt for the b-hadron pion daughter - float mPtMaxProtonForFemto{5.0}; // maximum pt for the proton for femto - float mPtMaxDeuteronForFemto{5.0}; // maximum pt for the deuteron for femto - float mPtMaxCharmBaryonBachelor{100000.}; // maximum pt for the bachelor pion from Xic/Omegac decays - float mPtThresholdProtonForFemto{8.}; // pt threshold to change strategy for proton PID for femto - float mPtThresholdDeuteronForFemto{1.4}; // pt threshold to change strategy for deuteron PID for femto - float mPtMinSigmaCZero{0.f}; // pt min SigmaC0 candidate - float mPtMinSigmaC2520Zero{0.f}; // pt min SigmaC(2520)0 candidate - float mPtMinSigmaCPlusPlus{0.f}; // pt min SigmaC++ candidate - float mPtMinSigmaC2520PlusPlus{0.f}; // pt min SigmaC(2520)++ candidate - std::array mNSigmaPrCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto protons - std::array mNSigmaDeCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto deuterons - float mNSigmaTpcPrCutForCharmBaryons{3.}; // maximum Nsigma TPC for protons in Lc and Xic decays - float mNSigmaTofPrCutForCharmBaryons{3.}; // maximum Nsigma TOF for protons in Lc and Xic decays - float mNSigmaTpcKaCutFor3Prongs{3.}; // maximum Nsigma TPC for kaons in 3-prong decays - float mNSigmaTofKaCutFor3Prongs{3.}; // maximum Nsigma TOF for kaons in 3-prong decays - float mNSigmaTpcPiKaCutForDzero{3.}; // maximum Nsigma TPC for pions/kaons in D0 decays - float mNSigmaTofPiKaCutForDzero{3.}; // maximum Nsigma TOF for pions/kaons in D0 decays - float mDeltaMassMinSigmaCZero{0.155}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC0 candidates - float mDeltaMassMaxSigmaCZero{0.18}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC0 candidates - float mDeltaMassMinSigmaC2520Zero{0.2}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)0 candidates - float mDeltaMassMaxSigmaC2520Zero{0.26}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)0 candidates - float mDeltaMassMinSigmaCPlusPlus{0.155}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC++ candidates - float mDeltaMassMaxSigmaCPlusPlus{0.18}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC++ candidates - float mDeltaMassMinSigmaC2520PlusPlus{0.2}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)++ candidates - float mDeltaMassMaxSigmaC2520PlusPlus{0.26}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)++ candidates - float mMinGammaCosinePa{0.85}; // minimum cosp for gammas - float mMinK0sLambdaCosinePa{0.97}; // minimum cosp for K0S and Lambda in charm excited decays - float mMinK0sLambdaRadius{0.5}; // minimum radius for K0S and Lambda in charm excited decays - float mMaxNsigmaPrForLambda{4.}; // maximum Nsigma TPC and TOF for protons in Lambda decays - float mDeltaMassK0s{0.02}; // delta mass cut for K0S in charm excited decays - float mDeltaMassLambda{0.01}; // delta mass cut for Lambda in charm excited decays - float mMinPtXiBachelor{0.1}; // minimum pt for Xi bachelor in Xic/Omegac decays - float mMinPtXi{1.}; // minimum pt for Xi in Xic/Omegac decays - float mDeltaMassXi{0.01}; // delta mass cut for Xi in Xic/Omegac decays - float mDeltaMassLambdaFromXi{0.01}; // delta mass cut for Lambda <- Xi in Xic/Omegac decays - float mCosPaXi{0.99}; // minimum cosp for Xi in Xic/Omegac decays - float mCosPaLambdaFromXi{0.99}; // minimum cosp for Xi in Xic/Omegac decays - float mMaxDcaXyXi{0.3}; // maximum dca for Xi in Xic/Omegac decays - float mMaxNsigmaXiDau{3.}; // maximum Nsigma TPC and TOF for Xi daughter tracks - o2::framework::LabeledArray mCutsSingleTrackCharmBaryonBachelor{}; // dca selections for the bachelor pion from Xic/Omegac decays - float mNSigmaTpcPiCharmBaryonBachelor{3.}; // maximum Nsigma TPC for pions in Xic/Omegac decays - float mNSigmaTofPiCharmBaryonBachelor{3.}; // maximum Nsigma TOF for pions in Xic/Omegac decays - float mNumSigmaDeltaMassCharmHad{2.5}; // number of sigmas for delta mass cut for charm hadrons in B and charm excited decays - std::array mSigmaPars2Prongs{}; // parameters (intercept, slope) for parametrisation of mass sigma vs pT for 2-prongs - std::array mDeltaMassPars2Prongs{}; // parameters (intercept, slope) for parametrisation of mass delta wrt PDG vs pT for 2-prongs - std::array mSigmaPars3Prongs{}; // parameters (intercept, slope) for parametrisation of mass sigma vs pT for 3-prongs - std::array mDeltaMassPars3Prongs{}; // parameters (intercept, slope) for parametrisation of mass delta wrt PDG vs pT for 3-prongs - float mPtThresholdHighPt2Prongs{8.}; // threshold for high pT triggers for 2-prongs - float mPtThresholdHighPt3Prongs{8.}; // threshold for high pT triggers for 3-prongs - float mNSigmaTpcKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TPC for kaons in Xic*->SigmaC-Kaon - float mNSigmaTofKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TOF for kaons in Xic*->SigmaC-Kaon - bool mForceTofProtonForFemto = true; // flag to force TOF PID for protons - bool mForceTofDeuteronForFemto = false; // flag to force TOF PID for deuterons - o2::framework::LabeledArray mCutsBplus{}; // selections for B+ candidates (DeltaMass, CPA, DecayLength, ImpactParameterProduct) + std::vector mPtBinsTracks{}; // vector of pT bins for single track cuts + std::vector mPtBinsBeautyHadrons{}; // vector of pT bins for beauty hadron candidates + o2::framework::LabeledArray mCutsSingleTrackBeauty3Prong{}; // dca selections for the 3-prong b-hadron pion daughter + o2::framework::LabeledArray mCutsSingleTrackBeauty4Prong{}; // dca selections for the 4-prong b-hadron pion daughter + float mPtMinSoftPionForDstar{0.1}; // minimum pt for the D*+ soft pion + float mPtMinSoftPionForSigmaC{0.1}; // minimum pt for the Σ0,++ soft pion + float mPtMaxSoftPionForSigmaC{10000.f}; // maximum pt for the Σ0,++ soft pion + float mPtMinSoftKaonForXicResoToSigmaC{0.1}; // minimum pt for the soft kaon of Xic* to SigmaC-Kaon + float mPtMaxSoftKaonForXicResoToSigmaC{10000.f}; // maximum pt for the soft kaon of Xic* to SigmaC-Kaon + float mPtMinBeautyBachelor{0.5}; // minimum pt for the b-hadron pion daughter + float mPtMinProtonForFemto{0.8}; // minimum pt for the proton for femto + float mPtMinDeuteronForFemto{0.8}; // minimum pt for the deuteron for femto + float mPtMinCharmBaryonBachelor{0.5}; // minimum pt for the bachelor pion from Xic/Omegac decays + float mPtMaxSoftPionForDstar{2.}; // maximum pt for the D*+ soft pion + float mPtMaxBeautyBachelor{100000.}; // maximum pt for the b-hadron pion daughter + float mPtMaxProtonForFemto{5.0}; // maximum pt for the proton for femto + float mPtMaxDeuteronForFemto{5.0}; // maximum pt for the deuteron for femto + float mPtMaxCharmBaryonBachelor{100000.}; // maximum pt for the bachelor pion from Xic/Omegac decays + float mPtThresholdProtonForFemto{8.}; // pt threshold to change strategy for proton PID for femto + float mPtThresholdDeuteronForFemto{1.4}; // pt threshold to change strategy for deuteron PID for femto + float mPtMinSigmaCZero{0.f}; // pt min SigmaC0 candidate + float mPtMinSigmaC2520Zero{0.f}; // pt min SigmaC(2520)0 candidate + float mPtMinSigmaCPlusPlus{0.f}; // pt min SigmaC++ candidate + float mPtMinSigmaC2520PlusPlus{0.f}; // pt min SigmaC(2520)++ candidate + std::array mNSigmaPrCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto protons + std::array mNSigmaDeCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto deuterons + float mNSigmaTpcPrCutForCharmBaryons{3.}; // maximum Nsigma TPC for protons in Lc and Xic decays + float mNSigmaTofPrCutForCharmBaryons{3.}; // maximum Nsigma TOF for protons in Lc and Xic decays + float mNSigmaTpcKaCutFor3Prongs{3.}; // maximum Nsigma TPC for kaons in 3-prong decays + float mNSigmaTofKaCutFor3Prongs{3.}; // maximum Nsigma TOF for kaons in 3-prong decays + float mNSigmaTpcPiKaCutForDzero{3.}; // maximum Nsigma TPC for pions/kaons in D0 decays + float mNSigmaTofPiKaCutForDzero{3.}; // maximum Nsigma TOF for pions/kaons in D0 decays + float mDeltaMassMinSigmaCZero{0.155}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC0 candidates + float mDeltaMassMaxSigmaCZero{0.18}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC0 candidates + float mDeltaMassMinSigmaC2520Zero{0.2}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)0 candidates + float mDeltaMassMaxSigmaC2520Zero{0.26}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)0 candidates + float mDeltaMassMinSigmaCPlusPlus{0.155}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC++ candidates + float mDeltaMassMaxSigmaCPlusPlus{0.18}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC++ candidates + float mDeltaMassMinSigmaC2520PlusPlus{0.2}; // minimum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)++ candidates + float mDeltaMassMaxSigmaC2520PlusPlus{0.26}; // maximum delta mass M(pKpipi)-M(pKpi) of SigmaC(2520)++ candidates + float mMinGammaCosinePa{0.85}; // minimum cosp for gammas + float mMinK0sLambdaCosinePa{0.97}; // minimum cosp for K0S and Lambda in charm excited decays + float mMinK0sLambdaRadius{0.5}; // minimum radius for K0S and Lambda in charm excited decays + float mMaxNsigmaPrForLambda{4.}; // maximum Nsigma TPC and TOF for protons in Lambda decays + float mDeltaMassK0s{0.02}; // delta mass cut for K0S in charm excited decays + float mDeltaMassLambda{0.01}; // delta mass cut for Lambda in charm excited decays + float mMinPtXiBachelor{0.1}; // minimum pt for Xi bachelor in Xic/Omegac decays + float mMinPtXi{1.}; // minimum pt for Xi in Xic/Omegac decays + float mDeltaMassXi{0.01}; // delta mass cut for Xi in Xic/Omegac decays + float mDeltaMassLambdaFromXi{0.01}; // delta mass cut for Lambda <- Xi in Xic/Omegac decays + float mCosPaXi{0.99}; // minimum cosp for Xi in Xic/Omegac decays + float mCosPaLambdaFromXi{0.99}; // minimum cosp for Xi in Xic/Omegac decays + float mMaxDcaXyXi{0.3}; // maximum dca for Xi in Xic/Omegac decays + float mMaxNsigmaXiDau{3.}; // maximum Nsigma TPC and TOF for Xi daughter tracks + o2::framework::LabeledArray mCutsSingleTrackCharmBaryonBachelor{}; // dca selections for the bachelor pion from Xic/Omegac decays + float mNSigmaTpcPiCharmBaryonBachelor{3.}; // maximum Nsigma TPC for pions in Xic/Omegac decays + float mNSigmaTofPiCharmBaryonBachelor{3.}; // maximum Nsigma TOF for pions in Xic/Omegac decays + float mNumSigmaDeltaMassCharmHad{2.5}; // number of sigmas for delta mass cut for charm hadrons in B and charm excited decays + std::array mSigmaPars2Prongs{}; // parameters (intercept, slope) for parametrisation of mass sigma vs pT for 2-prongs + std::array mDeltaMassPars2Prongs{}; // parameters (intercept, slope) for parametrisation of mass delta wrt PDG vs pT for 2-prongs + std::array mSigmaPars3Prongs{}; // parameters (intercept, slope) for parametrisation of mass sigma vs pT for 3-prongs + std::array mDeltaMassPars3Prongs{}; // parameters (intercept, slope) for parametrisation of mass delta wrt PDG vs pT for 3-prongs + float mPtThresholdHighPt2Prongs{8.}; // threshold for high pT triggers for 2-prongs + float mPtThresholdHighPt3Prongs{8.}; // threshold for high pT triggers for 3-prongs + float mNSigmaTpcKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TPC for kaons in Xic*->SigmaC-Kaon + float mNSigmaTofKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TOF for kaons in Xic*->SigmaC-Kaon + bool mForceTofProtonForFemto = true; // flag to force TOF PID for protons + bool mForceTofDeuteronForFemto = false; // flag to force TOF PID for deuterons + std::array, kNBeautyParticles> mCutsBhad{}; // selections for B-hadron candidates (DeltaMass, CPA, DecayLength, ImpactParameterProduct) // PID recalibrations int mTpcPidCalibrationOption{0}; // Option for TPC PID calibration (0 -> AO2D, 1 -> postcalibrations, 2 -> alternative bethe bloch parametrisation) @@ -1743,11 +1746,15 @@ inline bool HfFilterHelper::isSelectedKaon4Charm3Prong(const T& track) /// \param dcaTrack1 is the dca of the pion daughter track /// \param primVtx is the primary vertex /// \param secVtx is the secondary vertex -/// \param cuts B+ candidate pre-selection per pT bin +/// \param whichB is the B-hadron species /// \return true if the beauty candidate passes all cuts template -inline bool HfFilterHelper::isSelectedBplus(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx) +inline bool HfFilterHelper::isSelectedBhadron(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx, const int whichB) { + if (whichB == kB0toDStar) { + LOGP(fatal, "Wrong function used for selection of B0 -> D*pi, please use isSelectedBzeroToDstar"); + } + auto pVecB = RecoDecay::pVec(pVecTrack0, pVecTrack1); auto pTB = RecoDecay::pt(pVecB); auto binPtB = findBin(mPtBinsBeautyHadrons, pTB); @@ -1758,13 +1765,42 @@ inline bool HfFilterHelper::isSelectedBplus(T1 const& pVecTrack0, T1 const& pVec auto decayLength = RecoDecay::distance(primVtx, secVtx); auto impactParameterProduct = dcaTrack0[0] * dcaTrack1[0]; - if (cpa < mCutsBplus.get(binPtB, 1u)) { + if (cpa < mCutsBhad[whichB].get(binPtB, 1u)) { + return false; + } + if (decayLength < mCutsBhad[whichB].get(binPtB, 2u)) { + return false; + } + if (impactParameterProduct > mCutsBhad[whichB].get(binPtB, 3u)) { + return false; + } + + return true; +} + +/// Method to perform selections for B+ candidates after vertex reconstruction +/// \param pVecTrack0 is the array for the candidate D daughter momentum after reconstruction of secondary vertex +/// \param pVecTrack1 is the array for the soft pion momentum after reconstruction of secondary vertex +/// \param pVecTrack2 is the array for the candidate bachelor pion momentum after reconstruction of secondary vertex +/// \param primVtx is the primary vertex +/// \param secVtx is the secondary vertex +/// \return true if the beauty candidate passes all cuts +template +inline bool HfFilterHelper::isSelectedBzeroToDstar(T1 const& pVecTrack0, T1 const& pVecTrack1, T1 const& pVecTrack2, const T2& primVtx, const T3& secVtx) +{ + auto pVecB = RecoDecay::pVec(pVecTrack0, pVecTrack1, pVecTrack2); + auto pTB = RecoDecay::pt(pVecB); + auto binPtB = findBin(mPtBinsBeautyHadrons, pTB); + if (binPtB == -1) { return false; } - if (decayLength < mCutsBplus.get(binPtB, 2u)) { + auto cpa = RecoDecay::cpa(primVtx, secVtx, pVecB); + auto decayLength = RecoDecay::distance(primVtx, secVtx); + + if (cpa < mCutsBhad[kB0toDStar].get(binPtB, 1u)) { return false; } - if (impactParameterProduct > mCutsBplus.get(binPtB, 3u)) { + if (decayLength < mCutsBhad[kB0toDStar].get(binPtB, 2u)) { return false; } @@ -1774,17 +1810,45 @@ inline bool HfFilterHelper::isSelectedBplus(T1 const& pVecTrack0, T1 const& pVec /// Method to perform selections for B+ candidates after vertex reconstruction /// \param ptCand is the pT of the beauty candidate /// \param massCand is the mass of the beauty candidate -/// \param ptBins is the array of pT bin limits -/// \param cuts B+ candidate pre-selection per pT bin +/// \param whichB is the B-hadron species /// \return true if the beauty candidate passes all cuts template -inline bool HfFilterHelper::isSelectedBplusInMassRange(T1 const& ptCand, T2 const& massCand) +inline bool HfFilterHelper::isSelectedBhadronInMassRange(T1 const& ptCand, T2 const& massCand, const int whichB) { auto binPtB = findBin(mPtBinsBeautyHadrons, ptCand); if (binPtB == -1) { return false; } - if (std::fabs(massCand - massBPlus) > mCutsBplus.get(binPtB, 0u)) { + + float massBhad{-1}; + switch (whichB) { + case kBplus: { + massBhad = massBPlus; + break; + } + case kB0toDStar: { + massBhad = massB0; + break; + } + case kB0: { + massBhad = massB0; + break; + } + case kBs: { + massBhad = massBs; + break; + } + case kLb: { + massBhad = massLb; + break; + } + case kXib: { + massBhad = massXib; + break; + } + } + + if (std::fabs(massCand - massBhad) > mCutsBhad[whichB].get(binPtB, 0u)) { return false; } From e0ad248f77f08a91b42f2c26ba138f183abe74d8 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sat, 21 Dec 2024 20:22:01 +0100 Subject: [PATCH 09/28] [Common] QA developments, cent work for more estimators (#8999) Co-authored-by: ALICE Builder --- Common/CMakeLists.txt | 1 + Common/DataModel/Centrality.h | 66 +++++++++++++-------- Common/LegacyDataQA/CMakeLists.txt | 20 +++++++ Common/LegacyDataQA/centqa.cxx | 92 ++++++++++++++++++++++++++++++ Common/LegacyDataQA/otfv0qa.cxx | 63 ++++++++++++++++++++ 5 files changed, 218 insertions(+), 24 deletions(-) create mode 100644 Common/LegacyDataQA/CMakeLists.txt create mode 100644 Common/LegacyDataQA/centqa.cxx create mode 100644 Common/LegacyDataQA/otfv0qa.cxx diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt index b81500cb1c9..f9458f6f409 100644 --- a/Common/CMakeLists.txt +++ b/Common/CMakeLists.txt @@ -15,3 +15,4 @@ add_subdirectory(CCDB) add_subdirectory(Tasks) add_subdirectory(TableProducer) add_subdirectory(Tools) +add_subdirectory(LegacyDataQA) diff --git a/Common/DataModel/Centrality.h b/Common/DataModel/Centrality.h index a4701ef56a3..e2aa77d0238 100644 --- a/Common/DataModel/Centrality.h +++ b/Common/DataModel/Centrality.h @@ -17,43 +17,61 @@ namespace o2::aod { namespace cent { -DECLARE_SOA_COLUMN(CentRun2V0M, centRun2V0M, float); //! Run2 Centrality percentile estimated from V0C+V0A multiplicities -DECLARE_SOA_COLUMN(CentRun2V0A, centRun2V0A, float); //! Run2 Centrality percentile estimated from V0A multiplicities -DECLARE_SOA_COLUMN(CentRun2SPDTracklets, centRun2SPDTracklets, float); //! Run2 centrality percentile estimated from SPD tracklets multiplicity -DECLARE_SOA_COLUMN(CentRun2SPDClusters, centRun2SPDClusters, float); //! Run2 centrality percentile estimated from SPD clusters multiplicity -DECLARE_SOA_COLUMN(CentRun2CL0, centRun2CL0, float); //! Run2 centrality percentile estimated from CL0 multiplicity -DECLARE_SOA_COLUMN(CentRun2CL1, centRun2CL1, float); //! Run2 centrality percentile estimated from CL1 multiplicity -DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! Run3 Centrality percentile estimated from FV0A multiplicities -DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! Run3 centrality percentile estimated from FT0A+FT0C multiplicities -DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! Run3 centrality percentile estimated from FT0A multiplicity -DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! Run3 centrality percentile estimated from FT0C multiplicity -DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! Run3 centrality percentile estimated from FDDA+FDDC multiplicity -DECLARE_SOA_COLUMN(CentNTPV, centNTPV, float); //! Run3 centrality percentile estimated from the number of tracks contributing to the PV +DECLARE_SOA_COLUMN(CentRun2V0M, centRun2V0M, float); //! Run 2 cent. from V0C+V0A multiplicities +DECLARE_SOA_COLUMN(CentRun2V0A, centRun2V0A, float); //! Run 2 cent. from V0A multiplicities +DECLARE_SOA_COLUMN(CentRun2SPDTracklets, centRun2SPDTracklets, float); //! Run 2 cent. from SPD tracklets multiplicity +DECLARE_SOA_COLUMN(CentRun2SPDClusters, centRun2SPDClusters, float); //! Run 2 cent. from SPD clusters multiplicity +DECLARE_SOA_COLUMN(CentRun2CL0, centRun2CL0, float); //! Run 2 cent. from CL0 multiplicity +DECLARE_SOA_COLUMN(CentRun2CL1, centRun2CL1, float); //! Run 2 cent. from CL1 multiplicity +DECLARE_SOA_COLUMN(CentRun2RefMult5, centRun2RefMult5, float); //! Run 2 cent. from ref. mult. estimator, eta 0.5 +DECLARE_SOA_COLUMN(CentRun2RefMult8, centRun2RefMult8, float); //! Run 2 cent. from ref. mult. estimator, eta 0.8 + +DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! Run 3 cent. from FV0A multiplicities +DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! Run 3 cent. from FT0A+FT0C multiplicities +DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! Run 3 cent. from FT0A multiplicity +DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! Run 3 cent. from FT0C multiplicity +DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! Run 3 cent. from FDDA+FDDC multiplicity +DECLARE_SOA_COLUMN(CentNTPV, centNTPV, float); //! Run 3 cent. from the number of tracks contributing to the +DECLARE_SOA_COLUMN(CentNGlobal, centNGlobal, float); //! Run 3 cent. from the number of tracks contributing to the PV +DECLARE_SOA_COLUMN(CentMFT, centMFT, float); //! Run 3 cent. from the number of tracks in the MFT } // namespace cent -DECLARE_SOA_TABLE(CentRun2V0Ms, "AOD", "CENTRUN2V0M", cent::CentRun2V0M); //! Run2 V0M estimated centrality table -DECLARE_SOA_TABLE(CentRun2V0As, "AOD", "CENTRUN2V0A", cent::CentRun2V0A); //! Run2 V0A estimated centrality table -DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table -DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentRun2SPDClusters); //! Run2 SPD clusters estimated centrality table -DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentRun2CL0); //! Run2 CL0 estimated centrality table -DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentRun2CL1); //! Run2 CL1 estimated centrality table -DECLARE_SOA_TABLE(CentFV0As, "AOD", "CENTFV0A", cent::CentFV0A); //! Run3 FV0A estimated centrality table -DECLARE_SOA_TABLE(CentFT0Ms, "AOD", "CENTFT0M", cent::CentFT0M); //! Run3 FT0M estimated centrality table -DECLARE_SOA_TABLE(CentFT0As, "AOD", "CENTFT0A", cent::CentFT0A); //! Run3 FT0A estimated centrality table -DECLARE_SOA_TABLE(CentFT0Cs, "AOD", "CENTFT0C", cent::CentFT0C); //! Run3 FT0C estimated centrality table -DECLARE_SOA_TABLE(CentFDDMs, "AOD", "CENTFDDM", cent::CentFDDM); //! Run3 FDDM estimated centrality table -DECLARE_SOA_TABLE(CentNTPVs, "AOD", "CENTNTPV", cent::CentNTPV); //! Run3 NTPV estimated centrality table + +// Run 2 tables +DECLARE_SOA_TABLE(CentRun2V0Ms, "AOD", "CENTRUN2V0M", cent::CentRun2V0M); //! Run 2 V0M centrality table +DECLARE_SOA_TABLE(CentRun2V0As, "AOD", "CENTRUN2V0A", cent::CentRun2V0A); //! Run 2 V0A centrality table +DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentRun2SPDTracklets); //! Run 2 SPD tracklets centrality table +DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentRun2SPDClusters); //! Run 2 SPD clusters centrality table +DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentRun2CL0); //! Run 2 CL0 centrality table +DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentRun2CL1); //! Run 2 CL1 centrality table +DECLARE_SOA_TABLE(CentRun2RefMult5s, "AOD", "CENTRUN2REFMULT5", cent::CentRun2RefMult5); //! Run 2, ref mult |eta| < 0.5 +DECLARE_SOA_TABLE(CentRun2RefMult8s, "AOD", "CENTRUN2REFMULT8", cent::CentRun2RefMult8); //! Run 2, ref mult |eta| < 0.8 + +// Run 3 tables +DECLARE_SOA_TABLE(CentFV0As, "AOD", "CENTFV0A", cent::CentFV0A); //! Run 3 FV0A centrality table +DECLARE_SOA_TABLE(CentFT0Ms, "AOD", "CENTFT0M", cent::CentFT0M); //! Run 3 FT0M centrality table +DECLARE_SOA_TABLE(CentFT0As, "AOD", "CENTFT0A", cent::CentFT0A); //! Run 3 FT0A centrality table +DECLARE_SOA_TABLE(CentFT0Cs, "AOD", "CENTFT0C", cent::CentFT0C); //! Run 3 FT0C centrality table +DECLARE_SOA_TABLE(CentFDDMs, "AOD", "CENTFDDM", cent::CentFDDM); //! Run 3 FDDM centrality table +DECLARE_SOA_TABLE(CentNTPVs, "AOD", "CENTNTPV", cent::CentNTPV); //! Run 3 NTPV centrality table +DECLARE_SOA_TABLE(CentNGlobals, "AOD", "CENTNGLOBAL", cent::CentNGlobal); //! Run 3 NGlobal centrality table +DECLARE_SOA_TABLE(CentMFTs, "AOD", "CENTMFT", cent::CentMFT); //! Run 3 MFT tracks centrality table + using CentRun2V0M = CentRun2V0Ms::iterator; using CentRun2V0A = CentRun2V0As::iterator; using CentRun2SPDTrk = CentRun2SPDTrks::iterator; using CentRun2SPDCls = CentRun2SPDClss::iterator; using CentRun2CL0 = CentRun2CL0s::iterator; using CentRun2CL1 = CentRun2CL1s::iterator; +using CentRun2RefMult5 = CentRun2RefMult5s::iterator; +using CentRun2RefMult8 = CentRun2RefMult8s::iterator; using CentFV0A = CentFV0As::iterator; using CentFT0M = CentFT0Ms::iterator; using CentFT0A = CentFT0As::iterator; using CentFT0C = CentFT0Cs::iterator; using CentFDDM = CentFDDMs::iterator; using CentNTPV = CentNTPVs::iterator; +using CentNGlobal = CentNGlobals::iterator; +using CentMFT = CentMFTs::iterator; template concept HasRun2Centrality = requires(T&& t) { diff --git a/Common/LegacyDataQA/CMakeLists.txt b/Common/LegacyDataQA/CMakeLists.txt new file mode 100644 index 00000000000..7da951c247e --- /dev/null +++ b/Common/LegacyDataQA/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +o2physics_add_dpl_workflow(otfv0qa + SOURCES otfv0qa.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(centqa + SOURCES centqa.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/Common/LegacyDataQA/centqa.cxx b/Common/LegacyDataQA/centqa.cxx new file mode 100644 index 00000000000..0d69be10754 --- /dev/null +++ b/Common/LegacyDataQA/centqa.cxx @@ -0,0 +1,92 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +// This code calculates output histograms for centrality calibration +// as well as vertex-Z dependencies of raw variables (either for calibration +// of vtx-Z dependencies or for the calibration of those). +// +// This task is not strictly necessary in a typical analysis workflow, +// except for centrality calibration! The necessary task is the multiplicity +// tables. +// +// Comments, suggestions, questions? Please write to: +// - victor.gonzalez@cern.ch +// - david.dobrigkeit.chinellato@cern.ch +// + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TH1F.h" +#include "TH2F.h" + +using namespace o2; +using namespace o2::framework; + +struct CentQA { + // Raw multiplicities + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext&) + { + const AxisSpec axisCentrality{205, 0, 205, "centrality"}; + + // Base histograms + histos.add("hV0M", "V0M centrality", kTH1F, {axisCentrality}); + histos.add("hV0A", "V0A centrality", kTH1F, {axisCentrality}); + histos.add("hCL0", "CL0 centrality", kTH1F, {axisCentrality}); + histos.add("hCL1", "CL1 centrality", kTH1F, {axisCentrality}); + histos.add("hRefMult5", "RefMult .5 centrality", kTH1F, {axisCentrality}); + histos.add("hRefMult8", "RefMult .8 centrality", kTH1F, {axisCentrality}); + } + + void processV0M(soa::Join::iterator const& col) + { + histos.fill(HIST("hV0M"), col.centRun2V0M()); + } + void processV0A(soa::Join::iterator const& col) + { + histos.fill(HIST("hV0A"), col.centRun2V0A()); + } + void processCL0(soa::Join::iterator const& col) + { + histos.fill(HIST("hCL0"), col.centRun2CL0()); + } + void processCL1(soa::Join::iterator const& col) + { + histos.fill(HIST("hCL1"), col.centRun2CL1()); + } + void processRefMult5(soa::Join::iterator const& col) + { + histos.fill(HIST("hRefMult5"), col.centRun2RefMult5()); + } + void processRefMult8(soa::Join::iterator const& col) + { + histos.fill(HIST("hRefMult8"), col.centRun2RefMult8()); + } + + PROCESS_SWITCH(CentQA, processV0M, "QA V0M centrality", true); + PROCESS_SWITCH(CentQA, processV0A, "QA V0A centrality", false); + PROCESS_SWITCH(CentQA, processCL0, "QA CL0 centrality", false); + PROCESS_SWITCH(CentQA, processCL1, "QA CL1 centrality", false); + PROCESS_SWITCH(CentQA, processRefMult5, "QA RefMult5 centrality", false); + PROCESS_SWITCH(CentQA, processRefMult8, "QA RefMult8 centrality", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Common/LegacyDataQA/otfv0qa.cxx b/Common/LegacyDataQA/otfv0qa.cxx new file mode 100644 index 00000000000..a97af78f83a --- /dev/null +++ b/Common/LegacyDataQA/otfv0qa.cxx @@ -0,0 +1,63 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +// This code calculates output histograms for centrality calibration +// as well as vertex-Z dependencies of raw variables (either for calibration +// of vtx-Z dependencies or for the calibration of those). +// +// This task is not strictly necessary in a typical analysis workflow, +// except for centrality calibration! The necessary task is the multiplicity +// tables. +// +// Comments, suggestions, questions? Please write to: +// - victor.gonzalez@cern.ch +// - david.dobrigkeit.chinellato@cern.ch +// + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TH1F.h" +#include "TH2F.h" + +using namespace o2; +using namespace o2::framework; + +struct OTFV0Qa { + // Raw multiplicities + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext&) + { + const AxisSpec axisEvent{10, 0, 10, "Event counter"}; + const AxisSpec axisNCandidates{500, 0, 500, "Number of OTF v0s"}; + + // Base histograms + histos.add("hEventCounter", "Event counter", kTH1F, {axisEvent}); + histos.add("hCandidates", "Number of OTF V0s", kTH1F, {axisNCandidates}); + } + + void process(aod::Collision const&, aod::Run2OTFV0s const& v0s) + { + histos.fill(HIST("hEventCounter"), 0.5); + histos.fill(HIST("hCandidates"), v0s.size()); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 647a9538cb5d4aec820e5d90b6e77f573ed25e87 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Sat, 21 Dec 2024 22:18:00 +0100 Subject: [PATCH 10/28] [PWGEM/PhotonMeson] Change precision float->double for event histogram in emcQC (#9097) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index 8ed00c1f50e..e7a414b452a 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -145,7 +145,7 @@ struct EmcalQC { defineEMEventCut(); o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); - auto hEMCCollisionCounter = fRegistry.add("Event/hEMCCollisionCounter", "Number of collisions after event cuts", HistType::kTH1F, {{7, 0.5, 7.5}}, false); + auto hEMCCollisionCounter = fRegistry.add("Event/hEMCCollisionCounter", "Number of collisions after event cuts", HistType::kTH1D, {{7, 0.5, 7.5}}, false); hEMCCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hEMCCollisionCounter->GetXaxis()->SetBinLabel(2, "+TVX"); // TVX hEMCCollisionCounter->GetXaxis()->SetBinLabel(3, "+|z|<10cm"); // TVX with z < 10cm From bd6c1b4cc6aa4477f00b37c9078503a6f40a6de3 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets <66421517+lubynets@users.noreply.github.com> Date: Sat, 21 Dec 2024 23:07:01 +0100 Subject: [PATCH 11/28] [PWGHF] Add bitmap of primary-vertex-contributor prongs (#9051) --- .../DataModel/CandidateReconstructionTables.h | 45 ++++++++++--------- .../TableProducer/candidateCreator2Prong.cxx | 18 ++++---- .../TableProducer/candidateCreator3Prong.cxx | 11 ++--- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 6 +++ PWGHF/Utils/utilsTrkCandHf.h | 13 ++++++ 5 files changed, 58 insertions(+), 35 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 009735144a7..5cdfbca4a00 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -484,26 +484,27 @@ DECLARE_SOA_COLUMN(ErrorImpactParameterZ2, errorImpactParameterZ2, float); DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterZNormalised2, impactParameterZNormalised2, //! [](float dca, float err) -> float { return dca / err; }); /// prong PID nsigma -DECLARE_SOA_COLUMN(NProngsContributorsPV, nProngsContributorsPV, uint8_t); //! number of prongs contributing to the primary-vertex reconstruction -DECLARE_SOA_COLUMN(NSigTpcPi0, nSigTpcPi0, float); //! TPC nSigma for pion hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC nSigma for pion hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTpcPi2, nSigTpcPi2, float); //! TPC nSigma for pion hypothesis - prong 2 -DECLARE_SOA_COLUMN(NSigTpcKa0, nSigTpcKa0, float); //! TPC nSigma for kaon hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTpcKa1, nSigTpcKa1, float); //! TPC nSigma for kaon hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTpcKa2, nSigTpcKa2, float); //! TPC nSigma for kaon hypothesis - prong 2 -DECLARE_SOA_COLUMN(NSigTpcPr0, nSigTpcPr0, float); //! TPC nSigma for proton hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTpcPr1, nSigTpcPr1, float); //! TPC nSigma for proton hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTpcPr2, nSigTpcPr2, float); //! TPC nSigma for proton hypothesis - prong 2 -DECLARE_SOA_COLUMN(NSigTofPi0, nSigTofPi0, float); //! TOF nSigma for pion hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF nSigma for pion hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTofPi2, nSigTofPi2, float); //! TOF nSigma for pion hypothesis - prong 2 -DECLARE_SOA_COLUMN(NSigTofKa0, nSigTofKa0, float); //! TOF nSigma for kaon hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTofKa1, nSigTofKa1, float); //! TOF nSigma for kaon hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTofKa2, nSigTofKa2, float); //! TOF nSigma for kaon hypothesis - prong 2 -DECLARE_SOA_COLUMN(NSigTofPr0, nSigTofPr0, float); //! TOF nSigma for proton hypothesis - prong 0 -DECLARE_SOA_COLUMN(NSigTofPr1, nSigTofPr1, float); //! TOF nSigma for proton hypothesis - prong 1 -DECLARE_SOA_COLUMN(NSigTofPr2, nSigTofPr2, float); //! TOF nSigma for proton hypothesis - prong 2 -DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPi0, tpcTofNSigmaPi0, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 0 +DECLARE_SOA_COLUMN(NProngsContributorsPV, nProngsContributorsPV, uint8_t); //! number of prongs contributing to the primary-vertex reconstruction +DECLARE_SOA_COLUMN(BitmapProngsContributorsPV, bitmapProngsContributorsPV, uint8_t); //! bitmap with booleans indicating prongs contributing to the primary-vertex reconstruction +DECLARE_SOA_COLUMN(NSigTpcPi0, nSigTpcPi0, float); //! TPC nSigma for pion hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC nSigma for pion hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTpcPi2, nSigTpcPi2, float); //! TPC nSigma for pion hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTpcKa0, nSigTpcKa0, float); //! TPC nSigma for kaon hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTpcKa1, nSigTpcKa1, float); //! TPC nSigma for kaon hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTpcKa2, nSigTpcKa2, float); //! TPC nSigma for kaon hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTpcPr0, nSigTpcPr0, float); //! TPC nSigma for proton hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTpcPr1, nSigTpcPr1, float); //! TPC nSigma for proton hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTpcPr2, nSigTpcPr2, float); //! TPC nSigma for proton hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTofPi0, nSigTofPi0, float); //! TOF nSigma for pion hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF nSigma for pion hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTofPi2, nSigTofPi2, float); //! TOF nSigma for pion hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTofKa0, nSigTofKa0, float); //! TOF nSigma for kaon hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTofKa1, nSigTofKa1, float); //! TOF nSigma for kaon hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTofKa2, nSigTofKa2, float); //! TOF nSigma for kaon hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTofPr0, nSigTofPr0, float); //! TOF nSigma for proton hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTofPr1, nSigTofPr1, float); //! TOF nSigma for proton hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTofPr2, nSigTofPr2, float); //! TOF nSigma for proton hypothesis - prong 2 +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPi0, tpcTofNSigmaPi0, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 0 [](float tpcNSigmaPi0, float tofNSigmaPi0) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPi0, tofNSigmaPi0); }); DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPi1, tpcTofNSigmaPi1, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 1 [](float tpcNSigmaPi1, float tofNSigmaPi1) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPi1, tofNSigmaPi1); }); @@ -664,7 +665,7 @@ DECLARE_SOA_TABLE(HfCand2ProngBase, "AOD", "HFCAND2PBASE", //! hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ImpactParameterZ0, hf_cand::ImpactParameterZ1, hf_cand::ErrorImpactParameterZ0, hf_cand::ErrorImpactParameterZ1, - hf_track_index::Prong0Id, hf_track_index::Prong1Id, hf_cand::NProngsContributorsPV, + hf_track_index::Prong0Id, hf_track_index::Prong1Id, hf_cand::NProngsContributorsPV, hf_cand::BitmapProngsContributorsPV, hf_track_index::HFflag, /* dynamic columns */ hf_cand_2prong::M, @@ -970,7 +971,7 @@ DECLARE_SOA_TABLE(HfCand3ProngBase, "AOD", "HFCAND3PBASE", //! hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, hf_cand::ImpactParameterZ0, hf_cand::ImpactParameterZ1, hf_cand::ImpactParameterZ2, hf_cand::ErrorImpactParameterZ0, hf_cand::ErrorImpactParameterZ1, hf_cand::ErrorImpactParameterZ2, - hf_track_index::Prong0Id, hf_track_index::Prong1Id, hf_track_index::Prong2Id, hf_cand::NProngsContributorsPV, + hf_track_index::Prong0Id, hf_track_index::Prong1Id, hf_track_index::Prong2Id, hf_cand::NProngsContributorsPV, hf_cand::BitmapProngsContributorsPV, hf_track_index::HFflag, /* dynamic columns */ hf_cand_3prong::M, diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 8b464257ce6..1b05c6d463d 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -281,13 +281,14 @@ struct HfCandidateCreator2Prong { auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); auto indexCollision = collision.globalIndex(); - uint8_t nProngsContributorsPV = 0; + uint8_t bitmapProngsContributorsPV = 0; if (indexCollision == track0.collisionId() && track0.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 0); } if (indexCollision == track1.collisionId() && track1.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 1); } + uint8_t nProngsContributorsPV = hf_trkcandsel::countOnesInBinary(bitmapProngsContributorsPV); // fill candidate table rows rowCandidateBase(indexCollision, @@ -301,7 +302,7 @@ struct HfCandidateCreator2Prong { std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), impactParameter0.getZ(), impactParameter1.getZ(), std::sqrt(impactParameter0.getSigmaZ2()), std::sqrt(impactParameter1.getSigmaZ2()), - rowTrackIndexProng2.prong0Id(), rowTrackIndexProng2.prong1Id(), nProngsContributorsPV, + rowTrackIndexProng2.prong0Id(), rowTrackIndexProng2.prong1Id(), nProngsContributorsPV, bitmapProngsContributorsPV, rowTrackIndexProng2.hfflag()); // fill candidate prong PID rows @@ -432,13 +433,14 @@ struct HfCandidateCreator2Prong { } auto indexCollision = collision.globalIndex(); - uint8_t nProngsContributorsPV = 0; + uint8_t bitmapProngsContributorsPV = 0; if (indexCollision == track0.collisionId() && track0.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 0); } if (indexCollision == track1.collisionId() && track1.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 1); } + uint8_t nProngsContributorsPV = hf_trkcandsel::countOnesInBinary(bitmapProngsContributorsPV); // fill candidate table rows rowCandidateBase(indexCollision, @@ -452,7 +454,7 @@ struct HfCandidateCreator2Prong { errImpactParameter0XY, errImpactParameter1XY, 0.f, 0.f, 0.f, 0.f, - rowTrackIndexProng2.prong0Id(), rowTrackIndexProng2.prong1Id(), nProngsContributorsPV, + rowTrackIndexProng2.prong0Id(), rowTrackIndexProng2.prong1Id(), nProngsContributorsPV, bitmapProngsContributorsPV, rowTrackIndexProng2.hfflag()); // fill candidate prong PID rows diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index e7c464efa72..1361eed0b13 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -275,16 +275,17 @@ struct HfCandidateCreator3Prong { auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); auto indexCollision = collision.globalIndex(); - uint8_t nProngsContributorsPV = 0; + uint8_t bitmapProngsContributorsPV = 0; if (indexCollision == track0.collisionId() && track0.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 0); } if (indexCollision == track1.collisionId() && track1.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 1); } if (indexCollision == track2.collisionId() && track2.isPVContributor()) { - nProngsContributorsPV += 1; + SETBIT(bitmapProngsContributorsPV, 2); } + uint8_t nProngsContributorsPV = hf_trkcandsel::countOnesInBinary(bitmapProngsContributorsPV); // fill candidate table rows rowCandidateBase(indexCollision, @@ -299,7 +300,7 @@ struct HfCandidateCreator3Prong { std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), std::sqrt(impactParameter2.getSigmaY2()), impactParameter0.getZ(), impactParameter1.getZ(), impactParameter2.getZ(), std::sqrt(impactParameter0.getSigmaZ2()), std::sqrt(impactParameter1.getSigmaZ2()), std::sqrt(impactParameter2.getSigmaZ2()), - rowTrackIndexProng3.prong0Id(), rowTrackIndexProng3.prong1Id(), rowTrackIndexProng3.prong2Id(), nProngsContributorsPV, + rowTrackIndexProng3.prong0Id(), rowTrackIndexProng3.prong1Id(), rowTrackIndexProng3.prong2Id(), nProngsContributorsPV, bitmapProngsContributorsPV, rowTrackIndexProng3.hfflag()); // fill histograms diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index f0c1c1503c2..07f869382a1 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -101,6 +101,7 @@ DECLARE_SOA_TABLE(HfCandLcLites, "AOD", "HFCANDLCLITE", collision::PosY, collision::PosZ, hf_cand::NProngsContributorsPV, + hf_cand::BitmapProngsContributorsPV, // hf_cand::ErrorDecayLength, // hf_cand::ErrorDecayLengthXY, hf_cand::Chi2PCA, @@ -159,6 +160,7 @@ DECLARE_SOA_TABLE(HfCandLcFulls, "AOD", "HFCANDLCFULL", collision::PosY, collision::PosZ, hf_cand::NProngsContributorsPV, + hf_cand::BitmapProngsContributorsPV, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, @@ -357,6 +359,7 @@ struct HfTreeCreatorLcToPKPi { candidate.posY(), candidate.posZ(), candidate.nProngsContributorsPV(), + candidate.bitmapProngsContributorsPV(), // candidate.errorDecayLength(), // candidate.errorDecayLengthXY(), candidate.chi2PCA(), @@ -419,6 +422,7 @@ struct HfTreeCreatorLcToPKPi { candidate.posY(), candidate.posZ(), candidate.nProngsContributorsPV(), + candidate.bitmapProngsContributorsPV(), candidate.xSecondaryVertex(), candidate.ySecondaryVertex(), candidate.zSecondaryVertex(), @@ -614,6 +618,7 @@ struct HfTreeCreatorLcToPKPi { candidate.posY(), candidate.posZ(), candidate.nProngsContributorsPV(), + candidate.bitmapProngsContributorsPV(), // candidate.errorDecayLength(), // candidate.errorDecayLengthXY(), candidate.chi2PCA(), @@ -676,6 +681,7 @@ struct HfTreeCreatorLcToPKPi { candidate.posY(), candidate.posZ(), candidate.nProngsContributorsPV(), + candidate.bitmapProngsContributorsPV(), candidate.xSecondaryVertex(), candidate.ySecondaryVertex(), candidate.zSecondaryVertex(), diff --git a/PWGHF/Utils/utilsTrkCandHf.h b/PWGHF/Utils/utilsTrkCandHf.h index 073e416236d..a1d1b41c10f 100644 --- a/PWGHF/Utils/utilsTrkCandHf.h +++ b/PWGHF/Utils/utilsTrkCandHf.h @@ -41,6 +41,19 @@ void setLabelHistoCands(Histo& hCandidates) hCandidates->GetXaxis()->SetBinLabel(SVFitting::Fail + 1, "Run-time error in secondary vertexing"); } +/// @brief Function to evaluate number of ones in a binary representation of the argument +/// \param num is the input argument +int countOnesInBinary(uint8_t num) +{ + int count = 0; + + for (int iBit = 0; iBit < 8; iBit++) { + count += TESTBIT(num, iBit); + } + + return count; +} + } // namespace o2::hf_trkcandsel #endif // PWGHF_UTILS_UTILSTRKCANDHF_H_ From 0b92bd9fd73fbd7f02945e6212fbb165318009b0 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 22 Dec 2024 19:20:39 +0900 Subject: [PATCH 12/28] [PWGEM/PhotonMeson] add a column for v0leg moved by vdrifter (#9103) --- PWGEM/Dilepton/Tasks/createResolutionMap.cxx | 9 +++-- PWGEM/Dilepton/Tasks/eventQC.cxx | 4 +-- PWGEM/PhotonMeson/DataModel/gammaTables.h | 3 +- .../TableProducer/photonconversionbuilder.cxx | 36 +++++++++++++------ .../TableProducer/skimmerGammaConversion.cxx | 7 +++- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index 6df7af5c768..8239a89a704 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -65,7 +65,6 @@ struct CreateResolutionMap { using SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; - Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; @@ -75,12 +74,12 @@ struct CreateResolutionMap { ConfigurableAxis ConfPtGenBins{"ConfPtGenBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "gen. pT bins for output histograms"}; ConfigurableAxis ConfEtaCBGenBins{"ConfEtaCBGenBins", {30, -1.5, +1.5}, "gen. eta bins at midrapidity for output histograms"}; - ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {30, -5, -2.0}, "gen. eta bins at forward rapidity for output histograms"}; - ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {90, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"}; + ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {40, -5.5, -1.5}, "gen. eta bins at forward rapidity for output histograms"}; + ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {72, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"}; ConfigurableAxis ConfRelDeltaPtBins{"ConfRelDeltaPtBins", {200, -1.f, +1.f}, "rel. dpt for output histograms"}; - ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {200, -0.1f, +0.1f}, "deta bins for output histograms"}; - ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {200, -0.1f, +0.1f}, "dphi bins for output histograms"}; + ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {100, -0.1f, +0.1f}, "deta bins for output histograms"}; + ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {100, -0.1f, +0.1f}, "dphi bins for output histograms"}; struct : ConfigurableGroup { std::string prefix = "electroncut_group"; diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index 640038992dc..22d889a81b2 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -251,7 +251,7 @@ struct eventQC { fRegistry.add("Track/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("Track/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); if (cfgFillPID) { fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{pv} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); @@ -290,7 +290,7 @@ struct eventQC { fRegistry.fill(HIST("Track/hDeltaPin"), track.p(), (track.tpcInnerParam() - track.p()) / track.p()); fRegistry.fill(HIST("Track/hChi2ITS"), track.itsChi2NCl()); fRegistry.fill(HIST("Track/hITSClusterMap"), track.itsClusterMap()); - fRegistry.fill(HIST("Track/hChi2TOF"), track.tofChi2()); + fRegistry.fill(HIST("Track/hChi2TOF"), track.p(), track.tofChi2()); if (cfgFillPID) { int nsize = 0; diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 5c366715b44..6baa101b3cf 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -113,6 +113,7 @@ namespace v0leg DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! DECLARE_SOA_COLUMN(TrackId, trackId, int); //! DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! +DECLARE_SOA_COLUMN(IsMoved, isMoved, bool); //! moved by drift manager. relevant to TPConly tracks DECLARE_SOA_COLUMN(Px, px, float); //! Px at SV DECLARE_SOA_COLUMN(Py, py, float); //! Py at SV DECLARE_SOA_COLUMN(Pz, pz, float); //! Pz at SV @@ -167,7 +168,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32 }); } // namespace v0leg DECLARE_SOA_TABLE(V0Legs, "AOD", "V0LEG", //! - o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign, + o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign, v0leg::IsMoved, v0leg::Px, v0leg::Py, v0leg::Pz, track::DcaXY, track::DcaZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 9786329b601..66d149c6061 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -21,6 +21,11 @@ #include #include #include +#include +#include +#include +#include +#include #include "Math/Vector4D.h" @@ -367,9 +372,9 @@ struct PhotonConversionBuilder { } template - void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ) + void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ, bool isMoved) { - v0legs(track.collisionId(), track.globalIndex(), track.sign(), + v0legs(track.collisionId(), track.globalIndex(), track.sign(), isMoved, kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(), @@ -415,10 +420,17 @@ struct PhotonConversionBuilder { // Calculate DCA with respect to the collision associated to the v0, not individual tracks gpu::gpustd::array dcaInfo; + bool is_pos_moved = false; + bool is_ele_moved = false; + auto pTrack = getTrackParCov(pos); - if (moveTPCTracks && isTPConlyTrack(pos) && !mVDriftMgr.moveTPCTrack(collision, pos, pTrack)) { - LOGP(error, "failed correction for positive tpc track"); - return; + if (moveTPCTracks && isTPConlyTrack(pos)) { + if (mVDriftMgr.moveTPCTrack(collision, pos, pTrack)) { + is_pos_moved = true; + } else { + LOGP(error, "failed correction for positive tpc track"); + return; + } } auto pTrackC = pTrack; pTrackC.setPID(o2::track::PID::Electron); @@ -427,9 +439,13 @@ struct PhotonConversionBuilder { auto posdcaZ = dcaInfo[1]; auto nTrack = getTrackParCov(ele); - if (moveTPCTracks && isTPConlyTrack(ele) && !mVDriftMgr.moveTPCTrack(collision, ele, nTrack)) { - LOGP(error, "failed correction for negative tpc track"); - return; + if (moveTPCTracks && isTPConlyTrack(ele)) { + if (mVDriftMgr.moveTPCTrack(collision, ele, nTrack)) { + is_ele_moved = true; + } else { + LOGP(error, "failed correction for negative tpc track"); + return; + } } auto nTrackC = nTrack; nTrackC.setPID(o2::track::PID::Electron); @@ -669,8 +685,8 @@ struct PhotonConversionBuilder { v0photonskfcov(gammaKF_PV.GetCovariance(9), gammaKF_PV.GetCovariance(14), gammaKF_PV.GetCovariance(20), gammaKF_PV.GetCovariance(13), gammaKF_PV.GetCovariance(19), gammaKF_PV.GetCovariance(18)); - fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first - fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second + fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ, is_pos_moved); // positive leg first + fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ, is_ele_moved); // negative leg second } // end of fill table } diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index bed52425fb5..eb8f1786a39 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -23,6 +23,11 @@ // runme like: o2-analysis-trackselection -b --aod-file ${sourceFile} --aod-writer-json ${writerFile} | o2-analysis-timestamp -b | o2-analysis-trackextension -b | o2-analysis-lf-lambdakzerobuilder -b | o2-analysis-pid-tpc -b | o2-analysis-em-skimmermc -b +#include +#include +#include +#include + // todo: remove reduantant information in GammaConversionsInfoTrue #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" @@ -179,7 +184,7 @@ struct skimmerGammaConversion { void fillTrackTable(TTRACK const& theTrack, TKFP const& kfp) { v0legs(theTrack.collisionId(), - theTrack.globalIndex(), theTrack.sign(), + theTrack.globalIndex(), theTrack.sign(), false, kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), theTrack.dcaXY(), theTrack.dcaZ(), theTrack.tpcNClsFindable(), theTrack.tpcNClsFindableMinusFound(), theTrack.tpcNClsFindableMinusCrossedRows(), theTrack.tpcNClsShared(), theTrack.tpcChi2NCl(), theTrack.tpcInnerParam(), theTrack.tpcSignal(), From c4ae4309ef82966e192484252ec324b57bfa8f0c Mon Sep 17 00:00:00 2001 From: sawan <124118453+sawankumawat@users.noreply.github.com> Date: Sun, 22 Dec 2024 17:42:44 +0530 Subject: [PATCH 13/28] [PWGLF] Fixed memory warnings and added cut to remove fake tracks (#9096) --- PWGLF/Tasks/Resonances/kstarqa.cxx | 790 ++++++++++++++++------------- 1 file changed, 426 insertions(+), 364 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 06fcb14511c..804e8538824 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file Kstarqa.cxx -/// \brief this is a code for the Kstarqa resonance +/// \file kstarqa.cxx +/// \brief Code for Kstar resonance without resonance initializer /// \author prottay das, sawan /// \since 13/03/2024 @@ -60,18 +60,18 @@ struct Kstarqa { // Histograms are defined with HistogramRegistry HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hInvMass{"hInvMass", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hPID{"hPID", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hOthers{"hOthers", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Confugrable for QA histograms Configurable calcLikeSign{"calcLikeSign", true, "Calculate Like Sign"}; Configurable calcRotational{"calcRotational", true, "Calculate Rotational"}; - Configurable cQAbefore{"cQAbefore", true, "cQAbefore"}; - Configurable cQAafter{"cQAafter", true, "cQAafter"}; + Configurable cQAplots{"cQAplots", true, "cQAplots"}; Configurable cQAevents{"cQAevents", true, "Multiplicity dist, DCAxy, DCAz"}; Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; Configurable onlyTPC{"onlyTPC", true, "only TPC tracks"}; - Configurable cfgFT0M{"cfgFT0M", true, "1: pp, 0: PbPb"}; // Configurables for track selections Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; @@ -79,15 +79,10 @@ struct Kstarqa { Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; - Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; - Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3.0, "TOF Nsigma cut for pions"}; - Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3.0, "TOF Nsigma cut for kaons"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Combined Nsigma cut"}; Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; - Configurable cfgTPCcluster{"cfgTPCcluster", 120, "Number of TPC cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable cfgRCRFC{"cfgRCRFC", 0.8f, "Crossed Rows to Findable Clusters"}; Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 36.0, "ITS Chi2/NCl"}; Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 4.0, "TPC Chi2/NCl"}; @@ -95,27 +90,38 @@ struct Kstarqa { Configurable cfgPrimaryTrack{"cfgPrimaryTrack", false, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", false, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cBetaCutTOF{"cBetaCutTOF", 0.0, "cut TOF beta"}; + Configurable cFakeTrackCutKa{"cFakeTrackCutKa", 0.5, "Cut based on momentum difference in global and TPC tracks for Kaons"}; + Configurable cFakeTrackCutPi{"cFakeTrackCutPi", 0.5, "Cut based on momentum difference in global and TPC tracks for Pions"}; + Configurable cFakeTrack{"cFakeTrack", true, "Fake track selection"}; + + // PID selections + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; + Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; + Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3.0, "TOF Nsigma cut for pions"}; + Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3.0, "TOF Nsigma cut for kaons"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Combined Nsigma cut"}; // Event selection configurables Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; Configurable cTVXEvsel{"cTVXEvsel", false, "Triggger selection"}; Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; - Configurable cMID{"cMID", false, "Misidentification of tracks"}; + // Configurable cMID{"cMID", false, "Misidentification of tracks"}; // Configurable for histograms - Configurable nBins{"nBins", 100, "N bins in all histos"}; - Configurable nBinsinvMass{"nBinsinvMass", 180, "N bins in invMass histos"}; + Configurable nBins{"nBins", 100, "No. of bins in Vz distribution"}; + Configurable nBinsinvMass{"nBinsinvMass", 180, "N bins in invMass hInvMass"}; Configurable invMassbinlow{"invMassbinlow", 0.6, "invMass bin low"}; Configurable invMassbinhigh{"invMassbinhigh", 1.5, "invMass bin high"}; - Configurable nBinspT{"nBinspT", 200, "N bins in pT histos"}; + Configurable nBinspT{"nBinspT", 200, "N bins in pT hInvMass"}; Configurable pTbinlow{"pTbinlow", 0.0, "pT bin low"}; Configurable pTbinhigh{"pTbinhigh", 20.0, "pT bin high"}; Configurable avoidsplitrackMC{"avoidsplitrackMC", true, "avoid split track in MC"}; - Configurable cAllGenCollisions{"cAllGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable cAllGenCollisions{"cAllGenCollisions", false, "To fill all generated collisions for the signal loss calculations"}; ConfigurableAxis binsMultPlot{"binsMultPlot", {201, -0.5f, 200.5f}, "centrality axis bins"}; - ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; - ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; - ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; + ConfigurableAxis axisdEdx{"axisdEdx", {1, 0.0f, 200.0f}, "dE/dx (a.u.)"}; + ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {1, 0, 20}, "pT (GeV/c)"}; + ConfigurableAxis axisMultdist{"axisMultdist", {1, 0, 70000}, "Multiplicity distribution"}; // Event plane configurables Configurable boostDaugter1{"boostDaugter1", false, "Boost daughter Kaon in the COM frame"}; @@ -142,49 +148,65 @@ struct Kstarqa { rEventSelection.add("hmult", "Multiplicity percentile", kTH1F, {{binsMultPlot}}); // for primary tracks - if (cQAbefore && cQAafter) { - histos.add("hNsigmaTPC_before", "NsigmaKaon TPC distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); - histos.add("hNsigmaTOF_before", "NsigmaKaon TOF distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); - histos.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); - histos.add("hphi", "Phi distribution", kTH1F, {{65, 0, 6.5}}); - - histos.add("hEta_after", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); - histos.add("hCRFC_after", "CRFC after distribution", kTH1F, {{100, 0.0f, 10.0f}}); - histos.add("hCRFC_before", "CRFC before distribution", kTH1F, {{100, 0.0f, 10.0f}}); - // histos.add("hNsigmaPionTPC_after", "NsigmaPion TPC distribution", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); - // histos.add("hNsigmaPionTOF_after", "NsigmaPion TOF distribution", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); - // histos.add("hNsigmaKaonTPC_after", "NsigmaKaon TPC distribution", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); - // histos.add("hNsigmaKaonTOF_after", "NsigmaKaon TOF distribution", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + if (cQAplots) { + hOthers.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); + hOthers.add("hphi", "Phi distribution", kTH1F, {{65, 0, 6.5}}); + hOthers.add("hEta_after", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); + hOthers.add("hCRFC_after", "CRFC after distribution", kTH1F, {{100, 0.0f, 10.0f}}); + hOthers.add("hCRFC_before", "CRFC before distribution", kTH1F, {{100, 0.0f, 10.0f}}); + + hPID.add("Before/hNsigmaTPC_Ka_before", "N #sigma Kaon TPC before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("Before/hNsigmaTOF_Ka_before", "N #sigma Kaon TOF before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("Before/hNsigmaTPC_Pi_before", "N #sigma Pion TPC before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("Before/hNsigmaTOF_Pi_before", "N #sigma Pion TOF before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("Before/hNsigma_TPC_TOF_Ka_before", "N #sigma Kaon TOF before", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); + hPID.add("Before/hNsigma_TPC_TOF_Pi_before", "N #sigma Pion TOF before", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); + hPID.add("h1PID_TPC_kaon_data", "Kaon PID distribution in data", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TPC_pion_data", "Pion PID distribution in data", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TPC_kaon_MC", "Kaon PID distribution in MC", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TPC_pion_MC", "Pion PID distribution in MC", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TOF_kaon_data", "Kaon PID distribution in data", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TOF_pion_data", "Pion PID distribution in data", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TOF_kaon_MC", "Kaon PID distribution in MC", kTH1F, {{100, -10.0f, 10.0f}}); + hPID.add("h1PID_TOF_pion_MC", "Pion PID distribution in MC", kTH1F, {{100, -10.0f, 10.0f}}); + + hPID.add("After/hNsigmaPionTPC_after", "N #Pi TPC after", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("After/hNsigmaPionTOF_after", "N #Pi TOF after", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("After/hNsigmaKaonTPC_after", "N #sigma Kaon TPC after", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("After/hNsigmaKaonTOF_after", "N #sigma Kaon TOF after", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + hPID.add("After/hNsigma_TPC_TOF_Ka_after", "N #sigma Kaon TOF after", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); + hPID.add("After/hNsigma_TPC_TOF_Pi_after", "N #sigma Pion TOF after", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); } // KStar histograms - histos.add("h3KstarInvMassUnlikeSign", "kstar Unlike Sign", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); - histos.add("h3KstarInvMasslikeSign", "kstar like Sign", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); - histos.add("h3KstarInvMassRotated", "kstar rotated", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); - histos.add("h3KstarInvMassMixed", "kstar Mixed", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); + hInvMass.add("h3KstarInvMassUnlikeSign", "kstar Unlike Sign", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); + hInvMass.add("h3KstarInvMassMixed", "kstar Mixed", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); + if (calcLikeSign) + hInvMass.add("h3KstarInvMasslikeSign", "kstar like Sign", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); + if (calcRotational) + hInvMass.add("h3KstarInvMassRotated", "kstar rotated", kTHnSparseF, {binsMultPlot, ptAxis, invmassAxis, thnAxisPOL}); // MC generated histograms - histos.add("k892Gen", "pT distribution of True MC K(892)0", kTH1D, {ptAxis}); - // histos.add("k892GenAnti", "pT distribution of True MC Anti-K(892)0", kTH1D, {ptAxis}); + hInvMass.add("hk892GenpT", "pT distribution of True MC K(892)0", kTH2F, {ptAxis, binsMultPlot}); + // hInvMass.add("hk892GenpTAnti", "pT distribution of True MC Anti-K(892)0", kTH2F, {ptAxis}, {binsMultPlot}); // Reconstructed MC histogram - histos.add("h3KstarRec", "pT of reconstructed kstar", kTH1F, {ptAxis}); - histos.add("h1KstarRecMass", "Invariant mass of kstar meson", kTH1D, {invmassAxis}); - histos.add("h1KstarRecpt", "pT of kstar meson", kTH1F, {ptAxis}); - histos.add("h1genmass", "Invariant mass of generated kstar meson", kTH1D, {invmassAxis}); - histos.add("h1recpt", "pT of generated kstar meson", kTH1F, {ptAxis}); - histos.add("events_check_data", "No. of events in the data", kTH1I, {{20, 0, 20}}); - histos.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}}); - histos.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); - histos.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); + hInvMass.add("h1KstarRecMass", "Invariant mass of kstar meson", kTH1F, {invmassAxis}); + hInvMass.add("h2KstarRecpt1", "pT of kstar meson", kTH2F, {ptAxis, binsMultPlot}); + hInvMass.add("h2KstarRecpt2", "pT of generated kstar meson", kTH2F, {ptAxis, binsMultPlot}); + hInvMass.add("h1genmass", "Invariant mass of generated kstar meson", kTH1F, {invmassAxis}); + rEventSelection.add("events_check_data", "No. of events in the data", kTH1I, {{20, 0, 20}}); + rEventSelection.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}}); + rEventSelection.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); + hInvMass.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); // Multplicity distribution if (cQAevents) { - histos.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); - histos.add("multdist_FT0A", "FT0A Multiplicity distribution", kTH1F, {axisMultdist}); - histos.add("multdist_FT0C", "FT0C Multiplicity distribution", kTH1F, {axisMultdist}); - // histos.add("hNcontributor", "Number of primary vertex contributor", kTH1F, {{2000, 0.0f, 10000.0f}}); - histos.add("hDcaxy", "Dcaxy distribution", kTH1F, {{200, -1.0f, 1.0f}}); - histos.add("hDcaz", "Dcaz distribution", kTH1F, {{200, -1.0f, 1.0f}}); + rEventSelection.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); + // hInvMass.add("multdist_FT0A", "FT0A Multiplicity distribution", kTH1F, {axisMultdist}); + // hInvMass.add("multdist_FT0C", "FT0C Multiplicity distribution", kTH1F, {axisMultdist}); + // hInvMass.add("hNcontributor", "Number of primary vertex contributor", kTH1F, {{2000, 0.0f, 10000.0f}}); + rEventSelection.add("hDcaxy", "Dcaxy distribution", kTH1F, {{200, -1.0f, 1.0f}}); + rEventSelection.add("hDcaz", "Dcaz distribution", kTH1F, {{200, -1.0f, 1.0f}}); } } @@ -195,7 +217,7 @@ struct Kstarqa { template bool selectionTrack(const T& candidate) { - if (ismanualDCAcut && !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) { + if (ismanualDCAcut && !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && candidate.itsNCls() > cfgITScluster)) { return false; } else if (!ismanualDCAcut) { if (std::abs(candidate.pt()) < cfgCutPT) @@ -216,8 +238,8 @@ struct Kstarqa { return false; if (cfgPVContributor && !candidate.isPVContributor()) return false; - // if (cfgPrimaryTrack && !candidate.isPrimaryTrack()) - // return false; + if (cfgPrimaryTrack && !candidate.isPrimaryTrack()) + return false; if (cfgGlobalWoDCATrack && !candidate.isGlobalTrackWoDCA()) return false; if (cfgGlobalTrack && !candidate.isGlobalTrack()) @@ -227,20 +249,33 @@ struct Kstarqa { return true; } + template + bool isFakeTrack(const T& track, int PID) + { + const auto pglobal = track.p(); + const auto ptpc = track.tpcInnerParam(); + if (PID == 0 && std::abs(pglobal - ptpc) > cFakeTrackCutPi) { + return true; + } + if (PID == 1 && std::abs(pglobal - ptpc) > cFakeTrackCutKa) { + return true; + } + return false; + } + template bool selectionPID(const T& candidate, int PID) { if (PID == 0) { if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi && candidate.beta() > cBetaCutTOF) { return true; } } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi && candidate.beta() > cBetaCutTOF) { return true; } - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { return true; } } else if (onlyTPC) { @@ -248,7 +283,7 @@ struct Kstarqa { return true; } } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (nsigmaCutCombined * nsigmaCutCombined)) { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (nsigmaCutCombined * nsigmaCutCombined) && candidate.beta() > cBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { @@ -257,11 +292,11 @@ struct Kstarqa { } } else if (PID == 1) { if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa && candidate.beta() > cBetaCutTOF) { return true; } } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa && candidate.beta() > cBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { @@ -272,7 +307,7 @@ struct Kstarqa { return true; } } else { - if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (nsigmaCutCombined * nsigmaCutCombined)) { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (nsigmaCutCombined * nsigmaCutCombined) && candidate.beta() > cBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { @@ -283,85 +318,85 @@ struct Kstarqa { return false; } - template - bool cMIDselectionPID(const T& candidate, int PID) - { - if (PID == 0) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < 3.0) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < 3.0) { - return true; - } - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < 3.0) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPi()) < 3.0) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (3.0 * 3.0)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < 3.0) { - return true; - } - } - } else if (PID == 1) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < 3.0) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < 3.0) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < 3.0) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaKa()) < 3.0) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (3.0 * 3.0)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < 3.0) { - return true; - } - } - } else if (PID == 2) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < 3.0) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < 3.0) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < 3.0) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPr()) < 3.0) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (3.0 * 3.0)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < 3.0) { - return true; - } - } - } - return false; - } + // template + // bool cMIDselectionPID(const T& candidate, int PID) + // { + // if (PID == 0) { + // if (onlyTOF) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < 3.0) { + // return true; + // } + // } else if (onlyTOFHIT) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < 3.0) { + // return true; + // } + // if (!candidate.hasTOF() && + // std::abs(candidate.tpcNSigmaPi()) < 3.0) { + // return true; + // } + // } else if (onlyTPC) { + // if (std::abs(candidate.tpcNSigmaPi()) < 3.0) { + // return true; + // } + // } else { + // if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (3.0 * 3.0)) { + // return true; + // } + // if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < 3.0) { + // return true; + // } + // } + // } else if (PID == 1) { + // if (onlyTOF) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < 3.0) { + // return true; + // } + // } else if (onlyTOFHIT) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < 3.0) { + // return true; + // } + // if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < 3.0) { + // return true; + // } + // } else if (onlyTPC) { + // if (std::abs(candidate.tpcNSigmaKa()) < 3.0) { + // return true; + // } + // } else { + // if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (3.0 * 3.0)) { + // return true; + // } + // if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < 3.0) { + // return true; + // } + // } + // } else if (PID == 2) { + // if (onlyTOF) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < 3.0) { + // return true; + // } + // } else if (onlyTOFHIT) { + // if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < 3.0) { + // return true; + // } + // if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < 3.0) { + // return true; + // } + // } else if (onlyTPC) { + // if (std::abs(candidate.tpcNSigmaPr()) < 3.0) { + // return true; + // } + // } else { + // if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (3.0 * 3.0)) { + // return true; + // } + // if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < 3.0) { + // return true; + // } + // } + // } + // return false; + // } std::array pvec0; std::array pvec1; @@ -376,173 +411,188 @@ struct Kstarqa { Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using EventCandidates = soa::Filtered>; - using TrackCandidates = soa::Filtered>; - using EventCandidatesMC = soa::Join; + using TrackCandidates = soa::Filtered>; + using EventCandidatesMC = soa::Join; - using TrackCandidatesMC = soa::Filtered>; + using TrackCandidatesMC = soa::Filtered>; + + //*********Varibles declaration*************** + TLorentzVector lv1, lv2, lv3, lv4, lv5; + float multiplicity = 0.0f; + float theta2; + ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterSelected, fourVecDau1, fourVecMother, fourVecDauCM; + ROOT::Math::XYZVector threeVecDauCM, helicityVec, randomVec, beamVec, normalVec; + bool isMix = false; template void fillInvMass(const T1& track1, const T2& track2, const T3& lv2, const T4& lv3, float multiplicity, bool isMix) { - ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterSelected; daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); // Kaon daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); // Pion daughterSelected = (boostDaugter1) ? daughter1 : daughter2; auto selectedDauMass = (boostDaugter1) ? massKa : massPi; - TLorentzVector lv4, lv5; // polarization calculations - ROOT::Math::PxPyPzMVector fourVecDau1 = ROOT::Math::PxPyPzMVector(daughterSelected.Px(), daughterSelected.Py(), daughterSelected.Pz(), selectedDauMass); // Kaon or Pion + fourVecDau1 = ROOT::Math::PxPyPzMVector(daughterSelected.Px(), daughterSelected.Py(), daughterSelected.Pz(), selectedDauMass); // Kaon or Pion - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau1); // boost the frame of daughter same as mother - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother + fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame + fourVecDauCM = boost(fourVecDau1); // boost the frame of daughter same as mother + threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame + helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); if (track1.sign() * track2.sign() < 0) { if (!isMix) { - histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); + hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); for (int i = 0; i < cRotations; i++) { - float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; if (calcRotational) - histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity); + hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity); } } else { - histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); + hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); } } else { if (!isMix) { if (calcLikeSign) - histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); + hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); } } } else if (activateTHnSparseCosThStarProduction) { - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); + normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); if (track1.sign() * track2.sign() < 0) { if (!isMix) { - histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); + hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); for (int i = 0; i < cRotations; i++) { - float theta2 = rn->Uniform(0, o2::constants::math::PI); + theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; if (calcRotational) - histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction); + hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction); } } else { - histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); + hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); } } else { if (!isMix) { if (calcLikeSign) - histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); + hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); } } } else if (activateTHnSparseCosThStarBeam) { - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); if (track1.sign() * track2.sign() < 0) { if (!isMix) { - histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); + hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); for (int i = 0; i < cRotations; i++) { - float theta2 = rn->Uniform(0, o2::constants::math::PI); + theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; if (calcRotational) - histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam); + hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam); } } else { - histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); + hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else { if (calcLikeSign) - histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); + hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); if (track1.sign() * track2.sign() < 0) { if (!isMix) { - histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); + hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); for (int i = 0; i < cRotations; i++) { - float theta2 = rn->Uniform(0, o2::constants::math::PI); + theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; if (calcRotational) - histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom); + hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom); } } else { - histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); + hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); } } else { if (!isMix) { if (calcLikeSign) - histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); + hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); } } } } } + // int counter = 0; + void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&) { - histos.fill(HIST("events_check_data"), 0.5); + rEventSelection.fill(HIST("events_check_data"), 0.5); if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } - histos.fill(HIST("events_check_data"), 1.5); + rEventSelection.fill(HIST("events_check_data"), 1.5); if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { return; } - histos.fill(HIST("events_check_data"), 2.5); + rEventSelection.fill(HIST("events_check_data"), 2.5); if (!collision.sel8()) { return; } - histos.fill(HIST("events_check_data"), 3.5); - - float multiplicity = 0.0f; + rEventSelection.fill(HIST("events_check_data"), 3.5); - multiplicity = (cfgFT0M) ? collision.centFT0M() : collision.centFT0C(); + multiplicity = collision.centFT0M(); // Fill the event counter if (cQAevents) { rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); rEventSelection.fill(HIST("hmult"), multiplicity); - histos.fill(HIST("multdist_FT0M"), collision.multFT0M()); - histos.fill(HIST("multdist_FT0A"), collision.multFT0A()); - histos.fill(HIST("multdist_FT0C"), collision.multFT0C()); - // histos.fill(HIST("hNcontributor"), collision.numContrib()); + rEventSelection.fill(HIST("multdist_FT0M"), collision.multFT0M()); + // rEventSelection.fill(HIST("multdist_FT0A"), collision.multFT0A()); + // rEventSelection.fill(HIST("multdist_FT0C"), collision.multFT0C()); + // rEventSelection.fill(HIST("hNcontributor"), collision.numContrib()); } for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - if (cQAbefore) { - histos.fill(HIST("hNsigmaTPC_before"), track1.pt(), track1.tpcNSigmaKa()); - histos.fill(HIST("hNsigmaTOF_before"), track1.pt(), track1.tofNSigmaKa()); - histos.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); - histos.fill(HIST("dE_by_dx_TPC"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hphi"), track1.phi()); + if (cQAplots) { + hPID.fill(HIST("Before/hNsigmaTPC_Ka_before"), track1.pt(), track1.tpcNSigmaKa()); + hPID.fill(HIST("Before/hNsigmaTOF_Ka_before"), track1.pt(), track1.tofNSigmaKa()); + hPID.fill(HIST("Before/hNsigmaTPC_Pi_before"), track2.pt(), track2.tpcNSigmaPi()); + hPID.fill(HIST("Before/hNsigmaTOF_Pi_before"), track2.pt(), track2.tofNSigmaPi()); + hPID.fill(HIST("Before/hNsigma_TPC_TOF_Ka_before"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); + hPID.fill(HIST("Before/hNsigma_TPC_TOF_Pi_before"), track2.tpcNSigmaPi(), track2.tofNSigmaPi()); + hPID.fill(HIST("h1PID_TPC_kaon_data"), track1.tpcNSigmaKa()); + hPID.fill(HIST("h1PID_TPC_pion_data"), track2.tpcNSigmaPi()); + hPID.fill(HIST("h1PID_TOF_kaon_data"), track1.tofNSigmaKa()); + hPID.fill(HIST("h1PID_TOF_pion_data"), track2.tofNSigmaPi()); + + hOthers.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); + hOthers.fill(HIST("dE_by_dx_TPC"), track1.p(), track1.tpcSignal()); + hOthers.fill(HIST("hphi"), track1.phi()); } - histos.fill(HIST("events_check_data"), 4.5); + rEventSelection.fill(HIST("events_check_data"), 4.5); if (!selectionTrack(track1)) { continue; @@ -550,10 +600,14 @@ struct Kstarqa { if (!selectionTrack(track2)) { continue; } - histos.fill(HIST("events_check_data"), 5.5); + rEventSelection.fill(HIST("events_check_data"), 5.5); + // if (counter < 1e4) + // std::cout << "TOF beta value is " << track1.beta() << std::endl; + // counter++; + if (cQAevents) { - histos.fill(HIST("hDcaxy"), track1.dcaXY()); - histos.fill(HIST("hDcaz"), track1.dcaZ()); + rEventSelection.fill(HIST("hDcaxy"), track1.dcaXY()); + rEventSelection.fill(HIST("hDcaz"), track1.dcaZ()); } // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion @@ -562,38 +616,45 @@ struct Kstarqa { if (!selectionPID(track2, 0)) // Track 2 is checked with Pion continue; - histos.fill(HIST("events_check_data"), 6.5); + rEventSelection.fill(HIST("events_check_data"), 6.5); - if (cMID) { - if (cMIDselectionPID(track1, 0)) // Kaon misidentified as pion - continue; - if (cMIDselectionPID(track1, 2)) // Kaon misidentified as proton - continue; - if (cMIDselectionPID(track2, 1)) // Pion misidentified as kaon - continue; - } - - histos.fill(HIST("events_check_data"), 7.5); + if (cFakeTrack && isFakeTrack(track1, 1)) // Kaon + continue; + if (cFakeTrack && isFakeTrack(track2, 0)) // Pion + continue; - if (cQAafter) { - histos.fill(HIST("hEta_after"), track1.eta()); - histos.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); - // histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); - // histos.fill(HIST("hNsigmaKaonTOF_after"), track1.pt(), track1.tofNSigmaKa()); - // histos.fill(HIST("hNsigmaPionTPC_after"), track2.pt(), track2.tpcNSigmaPi()); - // histos.fill(HIST("hNsigmaPionTOF_after"), track2.pt(), track2.tofNSigmaPi()); + // if (cMID) { + // if (cMIDselectionPID(track1, 0)) // Kaon misidentified as pion + // continue; + // if (cMIDselectionPID(track1, 2)) // Kaon misidentified as proton + // continue; + // if (cMIDselectionPID(track2, 1)) // Pion misidentified as kaon + // continue; + // } + + rEventSelection.fill(HIST("events_check_data"), 7.5); + + if (cQAplots) { + hOthers.fill(HIST("hEta_after"), track1.eta()); + hOthers.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); + hPID.fill(HIST("After/hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); + hPID.fill(HIST("After/hNsigmaKaonTOF_after"), track1.pt(), track1.tofNSigmaKa()); + hPID.fill(HIST("After/hNsigmaPionTPC_after"), track2.pt(), track2.tpcNSigmaPi()); + hPID.fill(HIST("After/hNsigmaPionTOF_after"), track2.pt(), track2.tofNSigmaPi()); + hPID.fill(HIST("After/hNsigma_TPC_TOF_Ka_after"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); + hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi()); } if (track1.globalIndex() == track2.globalIndex()) continue; - histos.fill(HIST("events_check_data"), 8.5); + rEventSelection.fill(HIST("events_check_data"), 8.5); - TLorentzVector lv1, lv2, lv3; + lv3.SetPtEtaPhiM(0.0, 0.0, 0.0, 0.0); lv1.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi(), massKa); lv2.SetPtEtaPhiM(track2.pt(), track2.eta(), track2.phi(), massPi); lv3 = lv1 + lv2; - bool isMix = false; + isMix = false; fillInvMass(track1, track2, lv2, lv3, multiplicity, isMix); } } @@ -601,123 +662,77 @@ struct Kstarqa { PROCESS_SWITCH(Kstarqa, processSE, "Process Same event", true); ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for ME mixing"}; - ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for ME mixing"}; - // ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2000, 0, 10000}, "TPC multiplicity for bin for ME mixing"}; + // ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for ME mixing"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2000, 0, 10000}, "TPC multiplicity axis for ME mixing"}; // using BinningTypeTPCMultiplicity = ColumnBinningPolicy; - using BinningTypeCentralityM = ColumnBinningPolicy; + // using BinningTypeCentralityM = ColumnBinningPolicy; using BinningTypeVertexContributor = ColumnBinningPolicy; - BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass}, true}; - BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicityClass}, true}; + BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicity}, true}; + // BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true}; SameKindPair pair1{binningOnPositions, cfgNoMixedEvents, -1, &cache}; - SameKindPair pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache}; + // SameKindPair pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache}; void processME(EventCandidates const&, TrackCandidates const&) { - if (cfgFT0M) { - for (const auto& [c1, tracks1, c2, tracks2] : pair1) { + for (const auto& [c1, tracks1, c2, tracks2] : pair1) { - if (!c1.sel8()) { - continue; - } - if (!c2.sel8()) { - continue; - } - - if (timFrameEvsel && (!c1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c1.selection_bit(aod::evsel::kNoITSROFrameBorder) || !c2.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - continue; - } - - if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { - return; - } - - auto multiplicity = c1.centFT0M(); - - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (!c1.sel8()) { + continue; + } + if (!c2.sel8()) { + continue; + } - if (!selectionTrack(t1)) // Kaon - continue; - if (!selectionTrack(t2)) // Pion - continue; - if (!selectionPID(t1, 1)) // Kaon - continue; - if (!selectionPID(t2, 0)) // Pion - continue; - if (cMID) { - if (cMIDselectionPID(t1, 0)) // misidentified as pion - continue; - if (cMIDselectionPID(t1, 2)) // misidentified as proton - continue; - if (cMIDselectionPID(t2, 1)) // misidentified as kaon - continue; - } + if (timFrameEvsel && (!c1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c1.selection_bit(aod::evsel::kNoITSROFrameBorder) || !c2.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + continue; + } - TLorentzVector vKAON; - vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector vPION; - vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { + return; + } - TLorentzVector kstar = vKAON + vPION; - bool isMix = true; + multiplicity = c1.centFT0M(); - if (std::abs(kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); - } - } - } - } else { - for (const auto& [c1, tracks1, c2, tracks2] : pair2) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (!c1.sel8()) { + if (!selectionTrack(t1)) // Kaon continue; - } - if (!c2.sel8()) { + if (!selectionTrack(t2)) // Pion continue; - } - - if (timFrameEvsel && (!c1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c1.selection_bit(aod::evsel::kNoITSROFrameBorder) || !c2.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + if (!selectionPID(t1, 1)) // Kaon + continue; + if (!selectionPID(t2, 0)) // Pion continue; - } - - if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { - return; - } - auto multiplicity = c1.centFT0C(); + // if (cMID) { + // if (cMIDselectionPID(t1, 0)) // misidentified as pion + // continue; + // if (cMIDselectionPID(t1, 2)) // misidentified as proton + // continue; + // if (cMIDselectionPID(t2, 1)) // misidentified as kaon + // continue; + // } - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + // TLorentzVector vKAON; + // vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + // TLorentzVector vPION; + // vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + lv3.SetPtEtaPhiM(0.0, 0.0, 0.0, 0.0); + lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); - if (!selectionTrack(t1)) // Kaon - continue; - if (!selectionTrack(t2)) // Pion - continue; - if (!selectionPID(t1, 1)) // Kaon - continue; - if (!selectionPID(t2, 0)) // Pion - continue; - if (cMID) { - if (cMIDselectionPID(t1, 0)) // misidentified as pion - continue; - if (cMIDselectionPID(t1, 2)) // misidentified as proton - continue; - if (cMIDselectionPID(t2, 1)) // misidentified as kaon - continue; - } + // TLorentzVector kstar = vKAON + vPION; + lv3 = lv1 + lv2; + isMix = true; - TLorentzVector vKAON; - vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector vPION; - vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + // if (std::abs(kstar.Rapidity()) < 0.5) { + // fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); - TLorentzVector kstar = vKAON + vPION; - bool isMix = true; - - if (std::abs(kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); - } + if (std::abs(lv3.Rapidity()) < 0.5) { + fillInvMass(t1, t2, lv2, lv3, multiplicity, isMix); } } } @@ -727,10 +742,11 @@ struct Kstarqa { void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { - histos.fill(HIST("events_check"), 0.5); + rEventSelection.fill(HIST("events_check"), 0.5); if (std::abs(mcCollision.posZ()) < cutzvertex) { - histos.fill(HIST("events_check"), 1.5); + rEventSelection.fill(HIST("events_check"), 1.5); } + int nChInel = 0; for (const auto& mcParticle : mcParticles) { auto pdgcode = std::abs(mcParticle.pdgCode()); @@ -741,9 +757,12 @@ struct Kstarqa { } } if (nChInel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) - histos.fill(HIST("events_check"), 2.5); + rEventSelection.fill(HIST("events_check"), 2.5); + std::vector selectedEvents(collisions.size()); int nevts = 0; + + multiplicity = 0; for (const auto& collision : collisions) { // if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cutzvertex) { if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { @@ -756,53 +775,60 @@ struct Kstarqa { if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { continue; } - + multiplicity = collision.centFT0M(); selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } selectedEvents.resize(nevts); - histos.fill(HIST("events_check"), 3.5); + rEventSelection.fill(HIST("events_check"), 3.5); + const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); if (!cAllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } - histos.fill(HIST("events_check"), 4.5); + rEventSelection.fill(HIST("events_check"), 4.5); + for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) >= 0.5) { continue; } - histos.fill(HIST("events_check"), 5.5); + rEventSelection.fill(HIST("events_check"), 5.5); + if (std::abs(mcParticle.pdgCode()) != 313) { continue; } - histos.fill(HIST("events_check"), 6.5); + rEventSelection.fill(HIST("events_check"), 6.5); + auto kDaughters = mcParticle.daughters_as(); if (kDaughters.size() != 2) { continue; } - histos.fill(HIST("events_check"), 7.5); + rEventSelection.fill(HIST("events_check"), 7.5); + auto passkaon = false; auto passpion = false; for (const auto& kCurrentDaughter : kDaughters) { if (!kCurrentDaughter.isPhysicalPrimary()) { continue; } - histos.fill(HIST("events_check"), 8.5); + rEventSelection.fill(HIST("events_check"), 8.5); + if (std::abs(kCurrentDaughter.pdgCode()) == 321) { // if (kCurrentDaughter.pdgCode() == +321) { passkaon = true; - histos.fill(HIST("events_check"), 9.5); + rEventSelection.fill(HIST("events_check"), 9.5); + } else if (std::abs(kCurrentDaughter.pdgCode()) == 211) { //} else if (kCurrentDaughter.pdgCode() == -321) { passpion = true; - // histos.fill(HIST("events_check"), 10.5); + // rEventSelection.fill(HIST("events_check"), 10.5); } } if (passkaon && passpion) { // if (mcParticle.pdgCode() > 0) - histos.fill(HIST("k892Gen"), mcParticle.pt()); + hInvMass.fill(HIST("hk892GenpT"), mcParticle.pt(), multiplicity); // else - // histos.fill(HIST("k892GenAnti"), mcParticle.pt()); + // hInvMass.fill(HIST("hk892GenpTAnti"), mcParticle.pt()); } } } @@ -811,105 +837,141 @@ struct Kstarqa { void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { - TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; + // TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; + multiplicity = collision.centFT0M(); + + rEventSelection.fill(HIST("events_checkrec"), 0.5); - histos.fill(HIST("events_checkrec"), 0.5); if (!collision.has_mcCollision()) { return; } - histos.fill(HIST("events_checkrec"), 1.5); + rEventSelection.fill(HIST("events_checkrec"), 1.5); + // if (std::abs(collision.mcCollision().posZ()) > cutzvertex || !collision.sel8()) { if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { return; } - histos.fill(HIST("events_checkrec"), 2.5); + rEventSelection.fill(HIST("events_checkrec"), 2.5); if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return; } - histos.fill(HIST("events_checkrec"), 3.5); + rEventSelection.fill(HIST("events_checkrec"), 3.5); + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } - histos.fill(HIST("events_checkrec"), 4.5); + rEventSelection.fill(HIST("events_checkrec"), 4.5); auto oldindex = -999; for (const auto& track1 : tracks) { if (!selectionTrack(track1)) { continue; } - histos.fill(HIST("events_checkrec"), 5.5); + rEventSelection.fill(HIST("events_checkrec"), 5.5); + if (!track1.has_mcParticle()) { continue; } - histos.fill(HIST("events_checkrec"), 6.5); + rEventSelection.fill(HIST("events_checkrec"), 6.5); + auto track1ID = track1.index(); for (const auto& track2 : tracks) { if (!track2.has_mcParticle()) { continue; } - histos.fill(HIST("events_checkrec"), 7.5); + rEventSelection.fill(HIST("events_checkrec"), 7.5); + if (!selectionTrack(track2)) { continue; } - histos.fill(HIST("events_checkrec"), 8.5); + rEventSelection.fill(HIST("events_checkrec"), 8.5); + auto track2ID = track2.index(); if (track2ID <= track1ID) { continue; } - // if (!selectionPair(track1, track2)) { - // continue; - // } - histos.fill(HIST("events_checkrec"), 9.5); + rEventSelection.fill(HIST("events_checkrec"), 9.5); + if (track1.sign() * track2.sign() >= 0) { continue; } - histos.fill(HIST("events_checkrec"), 10.5); + rEventSelection.fill(HIST("events_checkrec"), 10.5); + const auto mctrack1 = track1.mcParticle(); const auto mctrack2 = track2.mcParticle(); int track1PDG = std::abs(mctrack1.pdgCode()); int track2PDG = std::abs(mctrack2.pdgCode()); + + if (cQAplots && track1PDG == 211) { + hPID.fill(HIST("h1PID_TPC_kaon_MC"), track1.tpcNSigmaKa()); + hPID.fill(HIST("h1PID_TOF_kaon_MC"), track1.tofNSigmaKa()); + } + if (cQAplots && track1PDG == 321) { + hPID.fill(HIST("h1PID_TPC_pion_MC"), track1.tpcNSigmaPi()); + hPID.fill(HIST("h1PID_TOF_pion_MC"), track1.tofNSigmaPi()); + } + if (!mctrack1.isPhysicalPrimary()) { continue; } - histos.fill(HIST("events_checkrec"), 11.5); + rEventSelection.fill(HIST("events_checkrec"), 11.5); + if (!mctrack2.isPhysicalPrimary()) { continue; } - histos.fill(HIST("events_checkrec"), 12.5); - if (!(selectionPID(track1, 1) && selectionPID(track2, 0))) { // pion and kaon + rEventSelection.fill(HIST("events_checkrec"), 12.5); + + // if (!(track1PDG == 321 && track2PDG == 211)) { + // continue; + // } + if (!(track1PDG == 211) && !(track1PDG == 321)) { continue; } - histos.fill(HIST("events_checkrec"), 13.5); - if (!(track1PDG == 321 && track2PDG == 211)) { + if (!(track2PDG == 211) && !(track2PDG == 321)) { continue; } - // LOG(info) << "trackpdgs are:"<()) { for (const auto& mothertrack2 : mctrack2.mothers_as()) { if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) { continue; } - histos.fill(HIST("events_checkrec"), 15.5); + rEventSelection.fill(HIST("events_checkrec"), 15.5); + if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { continue; } - histos.fill(HIST("events_checkrec"), 16.5); + rEventSelection.fill(HIST("events_checkrec"), 16.5); + if (!mothertrack1.producedByGenerator()) { continue; } - histos.fill(HIST("events_checkrec"), 17.5); + rEventSelection.fill(HIST("events_checkrec"), 17.5); + if (std::abs(mothertrack1.y()) >= 0.5) { continue; } - histos.fill(HIST("events_checkrec"), 18.5); + rEventSelection.fill(HIST("events_checkrec"), 18.5); + if (std::abs(mothertrack1.pdgCode()) != 313) { continue; } if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { - histos.fill(HIST("h1KSRecsplit"), mothertrack1.pt()); + hInvMass.fill(HIST("h1KSRecsplit"), mothertrack1.pt()); continue; } oldindex = mothertrack1.globalIndex(); @@ -920,16 +982,16 @@ struct Kstarqa { auto motherE = mothertrack1.e(); auto genMass = std::sqrt(motherE * motherE - motherP * motherP); auto recMass = RecoDecay::m(arrMomrec, std::array{massKa, massPi}); - // auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); + auto recpt = std::sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); //// Resonance reconstruction - lDecayDaughter1.SetXYZM(track1.px(), track1.py(), track1.pz(), massKa); - lDecayDaughter2.SetXYZM(track2.px(), track2.py(), track2.pz(), massPi); - lResonance = lDecayDaughter1 + lDecayDaughter2; - histos.fill(HIST("h3KstarRec"), motherP); - histos.fill(HIST("h1KstarRecMass"), recMass); - histos.fill(HIST("h1KstarRecpt"), mothertrack1.pt()); - histos.fill(HIST("h1genmass"), genMass); - histos.fill(HIST("h1recpt"), lResonance.Pt()); + // lDecayDaughter1.SetXYZM(track1.px(), track1.py(), track1.pz(), massKa); + // lDecayDaughter2.SetXYZM(track2.px(), track2.py(), track2.pz(), massPi); + // lResonance = lDecayDaughter1 + lDecayDaughter2; + + hInvMass.fill(HIST("h1KstarRecMass"), recMass); + hInvMass.fill(HIST("h1genmass"), genMass); + hInvMass.fill(HIST("h2KstarRecpt1"), mothertrack1.pt(), multiplicity); + hInvMass.fill(HIST("h2KstarRecpt2"), recpt, multiplicity); } } } From c95149b5e6f175f710523eb67c835a549c3f9f22 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 22 Dec 2024 21:14:17 +0900 Subject: [PATCH 14/28] [PWGEM/Dilepton] add TOF chi2 in QC task (#9104) --- PWGEM/Dilepton/Core/PhotonHBT.h | 6 ++-- PWGEM/Dilepton/Tasks/eventQC.cxx | 34 +++++++++++++++---- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 2 ++ PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 2 ++ PWGEM/PhotonMeson/Core/V0PhotonCut.cxx | 10 +++++- PWGEM/PhotonMeson/Core/V0PhotonCut.h | 9 +++++ PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 14 +++++--- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 14 +++++--- 9 files changed, 73 insertions(+), 20 deletions(-) diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index 9b395559216..fa1b2865d2c 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -157,6 +157,7 @@ struct PhotonHBT { Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; Configurable cfg_require_v0_with_correct_xz{"cfg_require_v0_with_correct_xz", true, "flag to select V0s with correct xz"}; Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; @@ -495,6 +496,7 @@ struct PhotonHBT { fV0PhotonCut.SetV0EtaRange(-pcmcuts.cfg_max_eta_v0, +pcmcuts.cfg_max_eta_v0); fV0PhotonCut.SetMinCosPA(pcmcuts.cfg_min_cospa); fV0PhotonCut.SetMaxPCA(pcmcuts.cfg_max_pca); + fV0PhotonCut.SetMaxChi2KF(pcmcuts.cfg_max_chi2kf); fV0PhotonCut.SetRxyRange(pcmcuts.cfg_min_v0radius, pcmcuts.cfg_max_v0radius); fV0PhotonCut.SetAPRange(pcmcuts.cfg_max_alpha_ap, pcmcuts.cfg_max_qt_ap); fV0PhotonCut.RejectITSib(pcmcuts.cfg_reject_v0_on_itsib); @@ -521,21 +523,17 @@ struct PhotonHBT { if (pcmcuts.cfg_require_v0_with_itstpc) { fV0PhotonCut.SetRequireITSTPC(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 40); } if (pcmcuts.cfg_require_v0_with_itsonly) { fV0PhotonCut.SetRequireITSonly(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 24); } if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); - fV0PhotonCut.SetMaxPCA(3.0); fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { - fV0PhotonCut.SetMaxPCA(0.3); fV0PhotonCut.SetOnWwireIB(true); fV0PhotonCut.SetOnWwireOB(false); fV0PhotonCut.SetRxyRange(7, 14); diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index 22d889a81b2..2eba04f72a3 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -82,6 +82,7 @@ struct eventQC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequirekNoCollInRofStandard{"cfgRequirekNoCollInRofStandard", false, "require no other collisions in this Readout Frame with per-collision multiplicity above threshold"}; Configurable cfgRequirekNoCollInRofStrict{"cfgRequirekNoCollInRofStrict", false, "require no other collisions in this Readout Frame"}; + Configurable cfgRequirekNoHighMultCollInPrevRof{"cfgRequirekNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; struct : ConfigurableGroup { @@ -98,6 +99,7 @@ struct eventQC { Configurable cfg_min_ncluster_itsib{"cfg_min_ncluster_itsib", 1, "min ncluster its"}; Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2/NclsTOF"}; Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -1e+10, "min n sigma e in TPC"}; @@ -129,7 +131,7 @@ struct eventQC { { // event info - const int nbin_ev = 13; + const int nbin_ev = 17; auto hCollisionCounter = fRegistry.add("Event/before/hCollisionCounter", "collision counter;;Number of events", kTH1F, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "FT0AND"); @@ -143,7 +145,11 @@ struct eventQC { hCollisionCounter->GetXaxis()->SetBinLabel(10, "sel8"); hCollisionCounter->GetXaxis()->SetBinLabel(11, "|Z_{vtx}| < 10 cm"); hCollisionCounter->GetXaxis()->SetBinLabel(12, "NoCollInTimeRangeStandard"); - hCollisionCounter->GetXaxis()->SetBinLabel(13, "accepted"); + hCollisionCounter->GetXaxis()->SetBinLabel(13, "NoCollInTimeRangeStrict"); + hCollisionCounter->GetXaxis()->SetBinLabel(14, "NoCollInRofStandard"); + hCollisionCounter->GetXaxis()->SetBinLabel(15, "NoCollInRofStrict"); + hCollisionCounter->GetXaxis()->SetBinLabel(16, "NoHighMultCollInPrevRof"); + hCollisionCounter->GetXaxis()->SetBinLabel(17, "accepted"); fRegistry.add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); fRegistry.add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", kTH1F, {{6001, -0.5, 6000.5}}, false); @@ -350,6 +356,18 @@ struct eventQC { if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 12.0); } + if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { + fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 13.0); + } + if (collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 14.0); + } + if (collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { + fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 15.0); + } + if (collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 16.0); + } fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hZvtx"), collision.posZ()); fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV()); @@ -571,11 +589,11 @@ struct eventQC { return false; } - if (trackcuts.cfg_requireTOF && !track.hasTOF()) { + if (trackcuts.cfg_requireTOF && !(track.hasTOF() && track.tofChi2() < trackcuts.cfg_max_chi2tof)) { return false; } - if (track.hasTOF() && (track.tofNSigmaEl() < trackcuts.cfg_min_TOFNsigmaEl || trackcuts.cfg_max_TOFNsigmaEl < track.tofNSigmaEl())) { + if (track.hasTOF() && ((track.tofNSigmaEl() < trackcuts.cfg_min_TOFNsigmaEl || trackcuts.cfg_max_TOFNsigmaEl < track.tofNSigmaEl()) || trackcuts.cfg_max_chi2tof < track.tofChi2())) { return false; } @@ -629,6 +647,10 @@ struct eventQC { return false; } + if (eventcuts.cfgRequirekNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + return false; + } + if (!(eventcuts.cfgTrackOccupancyMin <= collision.trackOccupancyInTimeRange() && collision.trackOccupancyInTimeRange() < eventcuts.cfgTrackOccupancyMax)) { return false; } @@ -669,8 +691,8 @@ struct eventQC { continue; } fillEventInfo<1>(collision); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 13); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 13); // accepted + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 17); // accepted + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 17); // accepted int nGlobalTracks = 0, nGlobalTracksPV = 0; auto tracks_per_coll = tracks.sliceBy(perCol, collision.globalIndex()); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index b452030bc24..4520198ed2a 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -137,6 +137,7 @@ struct Pi0EtaToGammaGamma { Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; Configurable cfg_require_v0_with_correct_xz{"cfg_require_v0_with_correct_xz", true, "flag to select V0s with correct xz"}; Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; @@ -337,6 +338,7 @@ struct Pi0EtaToGammaGamma { fV0PhotonCut.SetV0EtaRange(-pcmcuts.cfg_max_eta_v0, +pcmcuts.cfg_max_eta_v0); fV0PhotonCut.SetMinCosPA(pcmcuts.cfg_min_cospa); fV0PhotonCut.SetMaxPCA(pcmcuts.cfg_max_pca); + fV0PhotonCut.SetMaxChi2KF(pcmcuts.cfg_max_chi2kf); fV0PhotonCut.SetRxyRange(pcmcuts.cfg_min_v0radius, pcmcuts.cfg_max_v0radius); fV0PhotonCut.SetAPRange(pcmcuts.cfg_max_alpha_ap, pcmcuts.cfg_max_qt_ap); fV0PhotonCut.RejectITSib(pcmcuts.cfg_reject_v0_on_itsib); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 4ce009632dc..ca3e2766bb0 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -125,6 +125,7 @@ struct Pi0EtaToGammaGammaMC { Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; Configurable cfg_require_v0_with_correct_xz{"cfg_require_v0_with_correct_xz", true, "flag to select V0s with correct xz"}; Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; @@ -301,6 +302,7 @@ struct Pi0EtaToGammaGammaMC { fV0PhotonCut.SetV0EtaRange(-pcmcuts.cfg_max_eta_v0, +pcmcuts.cfg_max_eta_v0); fV0PhotonCut.SetMinCosPA(pcmcuts.cfg_min_cospa); fV0PhotonCut.SetMaxPCA(pcmcuts.cfg_max_pca); + fV0PhotonCut.SetMaxChi2KF(pcmcuts.cfg_max_chi2kf); fV0PhotonCut.SetRxyRange(pcmcuts.cfg_min_v0radius, pcmcuts.cfg_max_v0radius); fV0PhotonCut.SetAPRange(pcmcuts.cfg_max_alpha_ap, pcmcuts.cfg_max_qt_ap); fV0PhotonCut.RejectITSib(pcmcuts.cfg_reject_v0_on_itsib); diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx index 9c369df9514..94343e0104d 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx @@ -10,9 +10,12 @@ // or submit itself to any jurisdiction. // -// Class for track selection +// Class for v0 photon selection // +#include +#include + #include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" @@ -79,6 +82,11 @@ void V0PhotonCut::SetMaxPCA(float max) mMaxPCA = max; LOG(info) << "V0 Photon Cut, set max distance between 2 legs: " << mMaxPCA; } +void V0PhotonCut::SetMaxChi2KF(float max) +{ + mMaxChi2KF = max; + LOG(info) << "V0 Photon Cut, set max chi2/ndf with KF: " << mMaxChi2KF; +} void V0PhotonCut::SetMaxMarginZ(float max) { mMaxMarginZ = max; diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 2acd533d14f..345b388c3df 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -45,6 +45,7 @@ class V0PhotonCut : public TNamed kRxy, kCosPA, kPCA, + kChi2KF, kRZLine, kOnWwireIB, kOnWwireOB, @@ -103,6 +104,9 @@ class V0PhotonCut : public TNamed if (!IsSelectedV0(v0, V0PhotonCuts::kPCA)) { return false; } + if (!IsSelectedV0(v0, V0PhotonCuts::kChi2KF)) { + return false; + } if (!IsSelectedV0(v0, V0PhotonCuts::kRZLine)) { return false; } @@ -280,6 +284,9 @@ class V0PhotonCut : public TNamed case V0PhotonCuts::kPCA: return v0.pca() <= mMaxPCA; + case V0PhotonCuts::kChi2KF: + return v0.chiSquareNDF() <= mMaxChi2KF; + case V0PhotonCuts::kRZLine: return v0.v0radius() > abs(v0.vz()) * std::tan(2 * std::atan(std::exp(-mMaxV0Eta))) - mMaxMarginZ; @@ -437,6 +444,7 @@ class V0PhotonCut : public TNamed void SetRxyRange(float min = 0.f, float max = 180.f); void SetMinCosPA(float min = 0.95); void SetMaxPCA(float max = 2.f); + void SetMaxChi2KF(float max = 1e+10); void SetMaxMarginZ(float max = 7.f); void SetMaxMeePsiPairDep(std::function psiDepCut); void SetOnWwireIB(bool flag = false); @@ -483,6 +491,7 @@ class V0PhotonCut : public TNamed float mMinRxy{0.f}, mMaxRxy{180.f}; float mMinCosPA{0.95}; float mMaxPCA{2.f}; + float mMaxChi2KF{1e+10}; float mMaxMarginZ{7.f}; std::function mMaxMeePsiPairDep{}; // max mee as a function of psipair bool mIsOnWwireIB{false}; diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 6baa101b3cf..89013efb401 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -230,7 +230,7 @@ DECLARE_SOA_COLUMN(CosPA, cospa, float); //! DECLARE_SOA_COLUMN(PCA, pca, float); //! DECLARE_SOA_COLUMN(Alpha, alpha, float); //! DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! -DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); // Chi2 / NDF of the reconstructed V0 +DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); //! Chi2 / NDF of the reconstructed V0 DECLARE_SOA_COLUMN(SigmaPx2, sigmaPx2, float); //! error^2 of px in covariant matrix DECLARE_SOA_COLUMN(SigmaPy2, sigmaPy2, float); //! error^2 of py in covariant matrix DECLARE_SOA_COLUMN(SigmaPz2, sigmaPz2, float); //! error^2 of pz in covariant matrix diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 2e8a39ed8de..023189b3f4d 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -61,6 +61,10 @@ struct PCMQC { Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; V0PhotonCut fV0PhotonCut; @@ -79,6 +83,7 @@ struct PCMQC { Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; Configurable cfg_require_v0_with_correct_xz{"cfg_require_v0_with_correct_xz", true, "flag to select V0s with correct xz"}; Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; @@ -187,6 +192,10 @@ struct PCMQC { fEMEventCut.SetRequireVertexITSTPC(eventcuts.cfgRequireVertexITSTPC); fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireNoCollInTimeRangeStandard(eventcuts.cfgRequireNoCollInTimeRangeStandard); + fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); + fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); + fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } void DefinePCMCut() @@ -198,6 +207,7 @@ struct PCMQC { fV0PhotonCut.SetV0EtaRange(pcmcuts.cfg_min_eta_v0, pcmcuts.cfg_max_eta_v0); fV0PhotonCut.SetMinCosPA(pcmcuts.cfg_min_cospa); fV0PhotonCut.SetMaxPCA(pcmcuts.cfg_max_pca); + fV0PhotonCut.SetMaxChi2KF(pcmcuts.cfg_max_chi2kf); fV0PhotonCut.SetRxyRange(pcmcuts.cfg_min_v0radius, pcmcuts.cfg_max_v0radius); fV0PhotonCut.SetAPRange(pcmcuts.cfg_max_alpha_ap, pcmcuts.cfg_max_qt_ap); fV0PhotonCut.RejectITSib(pcmcuts.cfg_reject_v0_on_itsib); @@ -224,21 +234,17 @@ struct PCMQC { if (pcmcuts.cfg_require_v0_with_itstpc) { fV0PhotonCut.SetRequireITSTPC(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 40); } if (pcmcuts.cfg_require_v0_with_itsonly) { fV0PhotonCut.SetRequireITSonly(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 24); } if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); - fV0PhotonCut.SetMaxPCA(3.0); fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { - fV0PhotonCut.SetMaxPCA(0.3); fV0PhotonCut.SetOnWwireIB(true); fV0PhotonCut.SetOnWwireOB(false); fV0PhotonCut.SetRxyRange(7, 14); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index b1f445e558d..27f2a4e6e14 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -75,6 +75,10 @@ struct PCMQCMC { Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; V0PhotonCut fV0PhotonCut; @@ -93,6 +97,7 @@ struct PCMQCMC { Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; Configurable cfg_require_v0_with_correct_xz{"cfg_require_v0_with_correct_xz", true, "flag to select V0s with correct xz"}; Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; @@ -244,6 +249,10 @@ struct PCMQCMC { fEMEventCut.SetRequireVertexITSTPC(eventcuts.cfgRequireVertexITSTPC); fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireNoCollInTimeRangeStandard(eventcuts.cfgRequireNoCollInTimeRangeStandard); + fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); + fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); + fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } void DefinePCMCut() @@ -255,6 +264,7 @@ struct PCMQCMC { fV0PhotonCut.SetV0EtaRange(pcmcuts.cfg_min_eta_v0, pcmcuts.cfg_max_eta_v0); fV0PhotonCut.SetMinCosPA(pcmcuts.cfg_min_cospa); fV0PhotonCut.SetMaxPCA(pcmcuts.cfg_max_pca); + fV0PhotonCut.SetMaxChi2KF(pcmcuts.cfg_max_chi2kf); fV0PhotonCut.SetRxyRange(pcmcuts.cfg_min_v0radius, pcmcuts.cfg_max_v0radius); fV0PhotonCut.SetAPRange(pcmcuts.cfg_max_alpha_ap, pcmcuts.cfg_max_qt_ap); fV0PhotonCut.RejectITSib(pcmcuts.cfg_reject_v0_on_itsib); @@ -281,21 +291,17 @@ struct PCMQCMC { if (pcmcuts.cfg_require_v0_with_itstpc) { fV0PhotonCut.SetRequireITSTPC(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 40); } if (pcmcuts.cfg_require_v0_with_itsonly) { fV0PhotonCut.SetRequireITSonly(true); - fV0PhotonCut.SetMaxPCA(1.0); fV0PhotonCut.SetRxyRange(4, 24); } if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); - fV0PhotonCut.SetMaxPCA(3.0); fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { - fV0PhotonCut.SetMaxPCA(0.3); fV0PhotonCut.SetOnWwireIB(true); fV0PhotonCut.SetOnWwireOB(false); fV0PhotonCut.SetRxyRange(7, 14); From f6e43a6bb5bc262ae1f5a543b0fec3c2547b0b0f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 22 Dec 2024 17:20:50 +0100 Subject: [PATCH 15/28] [Common] one more check for the tracksExtra converter (#9107) --- Common/TableProducer/Converters/tracksExtraV002Converter.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Common/TableProducer/Converters/tracksExtraV002Converter.cxx b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx index d081f525cc9..a70ac8ea8a8 100644 --- a/Common/TableProducer/Converters/tracksExtraV002Converter.cxx +++ b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx @@ -24,6 +24,9 @@ struct TracksExtraV002Converter { if (doprocessV000ToV002 == false && doprocessV001ToV002 == false) { LOGF(fatal, "Neither processV000ToV002 nor processV001ToV002 is enabled. Please choose one!"); } + if (doprocessV000ToV002 == true && doprocessV001ToV002 == true) { + LOGF(fatal, "Both processV000ToV002 and processV001ToV002 are enabled. Please choose only one!"); + } } void processV000ToV002(aod::TracksExtra_000 const& tracksExtra_000) From 71dcb8e5caec74c9a8cc67d0c22df809b9922ee8 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 22 Dec 2024 20:38:55 +0100 Subject: [PATCH 16/28] [PWGLF] addition of derived data path for lambda polarization (#9100) Co-authored-by: ALICE Builder --- PWGLF/DataModel/LFStrangenessTables.h | 53 +++++- .../Strangeness/Converters/CMakeLists.txt | 5 + .../stradautracksextraconverter2.cxx | 41 ++++ .../Strangeness/strangederivedbuilder.cxx | 17 +- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 177 ++++++++++++++++++ 5 files changed, 285 insertions(+), 8 deletions(-) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 66d9027779e..58913d404c4 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -229,8 +229,9 @@ DECLARE_SOA_TABLE(StraTPCQVs, "AOD", "STRATPCQVS", //! tpc Qvec qvec::QvecBPosRe, qvec::QvecBPosIm, epcalibrationtable::QTPCR); DECLARE_SOA_TABLE(StraFT0CQVsEv, "AOD", "STRAFT0CQVSEv", //! events used to compute t0c Qvec epcalibrationtable::TriggerEventEP); -DECLARE_SOA_TABLE(StraZDCSP, "AOD", "STRAZDCSP", //! events used to compute the ZDC spectator plane - spcalibrationtable::TriggerEventSP, spcalibrationtable::PsiZDCA, spcalibrationtable::PsiZDCC); +DECLARE_SOA_TABLE(StraZDCSP, "AOD", "STRAZDCSP", //! ZDC SP information + spcalibrationtable::TriggerEventSP, + spcalibrationtable::PsiZDCA, spcalibrationtable::PsiZDCC); DECLARE_SOA_TABLE(StraStamps_000, "AOD", "STRASTAMPS", //! information for ID-ing mag field if needed bc::RunNumber, timestamp::Timestamp); DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! information for ID-ing mag field if needed @@ -262,6 +263,8 @@ namespace dautrack { //______________________________________________________ // Daughter track declarations for derived data analysis +// These definitions are for the first version of the table +// The latest version will inherit most properties from TracksExtra DECLARE_SOA_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, float); //! ITS chi2 per N cluster DECLARE_SOA_COLUMN(DetectorMap, detectorMap, uint8_t); //! detector map for reference (see DetectorMapEnum) DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t); //! ITS cluster sizes per layer @@ -306,6 +309,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(HasITSTracker, hasITSTracker, //! Flag to check if tr [](uint8_t detectorMap, float itsChi2PerNcl) -> bool { return (detectorMap & o2::aod::track::ITS) ? (itsChi2PerNcl > -1e-3f) : false; }); DECLARE_SOA_DYNAMIC_COLUMN(HasITSAfterburner, hasITSAfterburner, //! Flag to check if track is from ITS AB [](uint8_t detectorMap, float itsChi2PerNcl) -> bool { return (detectorMap & o2::aod::track::ITS) ? (itsChi2PerNcl < -1e-3f) : false; }); + +// sub-namespace for compatibility purposes +namespace compatibility +{ // adds dynamics that ensure full backwards compatibility with previous getters +DECLARE_SOA_DYNAMIC_COLUMN(TPCClusters, tpcClusters, //! number of TPC clusters + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRows, tpcCrossedRows, //! Number of crossed TPC Rows + [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t)tpcNClsFindable - TPCNClsFindableMinusCrossedRows; }); +DECLARE_SOA_DYNAMIC_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, //! simple equivalent return + [](float itsChi2NCl) -> float { return (float)itsChi2NCl; }); +} // namespace compatibility + } // namespace dautrack DECLARE_SOA_TABLE(DauTrackExtras_000, "AOD", "DAUTRACKEXTRA", //! detector properties of decay daughters @@ -337,10 +352,42 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_001, "AOD", "DAUTRACKEXTRA", 1, //! d dautrack::HasITSTracker, dautrack::HasITSAfterburner); +DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_002, "AOD", "DAUTRACKEXTRA", 2, //! detector properties of decay daughters + track::ITSChi2NCl, + dautrack::DetectorMap, // here we don´t save everything so we simplify this + track::ITSClusterSizes, + track::TPCNClsFindable, + track::TPCNClsFindableMinusFound, + track::TPCNClsFindableMinusCrossedRows, + + // Dynamics for ITS matching TracksExtra + track::v001::ITSNClsInnerBarrel, + track::v001::ITSClsSizeInLayer, + track::v001::ITSClusterMap, + track::v001::ITSNCls, + track::v001::IsITSAfterburner, + /*compatibility*/ dautrack::HasITSTracker, + /*compatibility*/ dautrack::HasITSAfterburner, + + // dynamics for TPC tracking properties matching main data model + track::TPCCrossedRowsOverFindableCls, + track::TPCFoundOverFindableCls, + track::TPCNClsFound, + track::TPCNClsCrossedRows, + /*compatibility*/ dautrack::compatibility::TPCClusters, + /*compatibility*/ dautrack::compatibility::TPCCrossedRows, + /*compatibility*/ dautrack::compatibility::ITSChi2PerNcl, + + // dynamics to identify detectors + dautrack::HasITS, + dautrack::HasTPC, + dautrack::HasTRD, + dautrack::HasTOF); + DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds dautrack::ParticleMCId); -using DauTrackExtras = DauTrackExtras_001; +using DauTrackExtras = DauTrackExtras_002; using DauTrackExtra = DauTrackExtras::iterator; namespace motherParticle diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 50311dd41cd..010e2fc2813 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -14,6 +14,11 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stradautracksextraconverter2 + SOURCES stradautracksextraconverter2.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(strarawcentsconverter SOURCES strarawcentsconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx new file mode 100644 index 00000000000..34e005d956d --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx @@ -0,0 +1,41 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts daughter TracksExtra from 1 to 2 +struct stradautracksextraconverter2 { + Produces dauTrackExtras_002; + + void process(aod::DauTrackExtras_001 const& dauTrackExtras_001) + { + for (auto& values : dauTrackExtras_001) { + dauTrackExtras_002(values.itsChi2PerNcl(), + values.detectorMap(), + values.itsClusterSizes(), + static_cast(0), // findable (unknown in old format) + -values.tpcClusters(), // findable minus found: we know found + -values.tpcCrossedRows()); // findable minus crossed rows: we know crossed rows + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 9888f324bf4..2af0f0d9ef9 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -483,8 +483,11 @@ struct strangederivedbuilder { for (auto const& tr : tracksExtra) { if (trackMap[tr.globalIndex()] >= 0) { dauTrackExtras(tr.itsChi2NCl(), - tr.detectorMap(), tr.itsClusterSizes(), - tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); + tr.detectorMap(), + tr.itsClusterSizes(), + tr.tpcNClsFindable(), + tr.tpcNClsFindableMinusFound(), + tr.tpcNClsFindableMinusCrossedRows()); } } // done! @@ -574,8 +577,11 @@ struct strangederivedbuilder { for (auto const& tr : tracksExtra) { if (trackMap[tr.globalIndex()] >= 0) { dauTrackExtras(tr.itsChi2NCl(), - tr.detectorMap(), tr.itsClusterSizes(), - tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); + tr.detectorMap(), + tr.itsClusterSizes(), + tr.tpcNClsFindable(), + tr.tpcNClsFindableMinusFound(), + tr.tpcNClsFindableMinusCrossedRows()); // if the table has MC info if constexpr (requires { tr.mcParticle(); }) { @@ -807,7 +813,8 @@ struct strangederivedbuilder { } void processZDCSP(soa::Join::iterator const& collision) { - StraZDCSP(collision.triggereventsp(), collision.psiZDCA(), collision.psiZDCC()); + StraZDCSP(collision.triggereventsp(), + collision.psiZDCA(), collision.psiZDCC()); } void processFT0MQVectors(soa::Join::iterator const& collision) { diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 07c42cf641f..e8c0c2d4ce9 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -54,6 +54,7 @@ #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "Common/DataModel/FT0Corrected.h" using namespace o2; @@ -61,6 +62,9 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; +using dauTracks = soa::Join; +using v0Candidates = soa::Join; + struct lambdapolsp { int mRunNumber; @@ -427,6 +431,49 @@ struct lambdapolsp { return true; } + template + bool isCompatible(TV0 const& v0, int pid /*0: lambda, 1: antilambda*/) + { + // checks if this V0 is compatible with the requested hypothesis + + // de-ref track extras + auto posTrackExtra = v0.template posTrackExtra_as(); + auto negTrackExtra = v0.template negTrackExtra_as(); + + // check for desired kinematics + if (pid == 0 && (v0.positivept() < cfgDaughPrPt || v0.negativept() < cfgDaughPiPt)) { + return false; // doesn´t pass lambda pT sels + } + if (pid == 1 && (v0.positivept() < cfgDaughPiPt || v0.negativept() < cfgDaughPrPt)) { + return false; // doesn´t pass antilambda pT sels + } + if (std::abs(v0.positiveeta()) > ConfDaughEta || std::abs(v0.negativeeta()) > ConfDaughEta) { + return false; + } + + // check TPC tracking properties + if (posTrackExtra.tpcNClsCrossedRows() < 70 || negTrackExtra.tpcNClsCrossedRows() < 70) { + return false; + } + if (posTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin) { + return false; + } + if (posTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8 || negTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8) { + return false; + } + + // check TPC PID + if (pid == 0 && ((std::abs(posTrackExtra.tpcNSigmaPr()) > ConfDaughPIDCuts) || (std::abs(negTrackExtra.tpcNSigmaPi()) > ConfDaughPIDCuts))) { + return false; + } + if (pid == 1 && ((std::abs(posTrackExtra.tpcNSigmaPi()) > ConfDaughPIDCuts) || (std::abs(negTrackExtra.tpcNSigmaPr()) > ConfDaughPIDCuts))) { + return false; + } + + // if we made it this far, it's good + return true; + } + double GetPhiInRange(double phi) { double result = phi; @@ -743,6 +790,136 @@ struct lambdapolsp { } } PROCESS_SWITCH(lambdapolsp, processData, "Process data", true); + + // process function for derived data - mimics the functionality of the original data + void processDerivedData(soa::Join::iterator const& collision, v0Candidates const& V0s, dauTracks const&) + { + //___________________________________________________________________________________________________ + // event selection + if (!collision.sel8()) { + return; + } + auto centrality = collision.centFT0C(); + if (!collision.triggereventsp()) { // provided by StraZDCSP + return; + } + + if (additionalEvSel && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { + return; + } + // histos.fill(HIST("hCentrality2"), centrality); + // if (additionalEvSel2 && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) { + if (additionalEvSel2 && (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy)) { + return; + } + // histos.fill(HIST("hCentrality3"), centrality); + if (additionalEvSel3 && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + return; + } + + //___________________________________________________________________________________________________ + // retrieve further info provided by StraZDCSP + auto psiZDCC = collision.psiZDCC(); + auto psiZDCA = collision.psiZDCA(); + + // fill histograms + histos.fill(HIST("hCentrality"), centrality); + if (!checkwithpub) { + // histos.fill(HIST("hVtxZ"), collision.posZ()); + histos.fill(HIST("hpRes"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA - psiZDCC)))); + if (QA) { + histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); + histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); + histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC)))); + } + } + + //___________________________________________________________________________________________________ + // loop over V0s as necessary + for (auto v0 : V0s) { + bool LambdaTag = isCompatible(v0, 0); + bool aLambdaTag = isCompatible(v0, 1); + + if (LambdaTag == aLambdaTag) + continue; + + if (!SelectionV0(collision, v0)) { + continue; + } + + if (LambdaTag) { + Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); + Pion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); + } + if (aLambdaTag) { + Proton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); + Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); + } + Lambda = Proton + Pion; + + ROOT::Math::Boost boost{Lambda.BoostToCM()}; + fourVecDauCM = boost(Proton); + threeVecDauCM = fourVecDauCM.Vect(); + // beamvector = ROOT::Math::XYZVector(0, 0, 1); + // eventplaneVec = ROOT::Math::XYZVector(collision.qFT0C(), collision.qFT0A(), 0); //this needs to be changed + // eventplaneVecNorm = eventplaneVec.Cross(beamvector); //z' + phiangle = TMath::ATan2(fourVecDauCM.Py(), fourVecDauCM.Px()); + // double phiangledir = fourVecDauCM.Phi(); + + auto phiminuspsiC = GetPhiInRange(phiangle - psiZDCC); + auto phiminuspsiA = GetPhiInRange(phiangle - psiZDCA); + // histos.fill(HIST("hpsiApsiC"), psiZDCA, psiZDCC); + // histos.fill(HIST("hpsiApsiC"), GetPhiInRange(GetPhiInRange(phiangle) - GetPhiInRange(psiZDCA)), phiminuspsiA); + // histos.fill(HIST("hphiminuspsiA"), (phiminuspsiA)); + // histos.fill(HIST("hphiminuspsiC"), (phiminuspsiC)); + // auto cosThetaStar = eventplaneVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVecNorm.Mag2()); + auto cosThetaStar = fourVecDauCM.Pz() / fourVecDauCM.P(); // A0 correction + auto sinThetaStar = TMath::Sqrt(1 - (cosThetaStar * cosThetaStar)); + auto PolC = TMath::Sin(phiminuspsiC); + auto PolA = TMath::Sin(phiminuspsiA); + + // needed for corrections + auto sinPhiStar = TMath::Sin(GetPhiInRange(phiangle)); + auto cosPhiStar = TMath::Cos(GetPhiInRange(phiangle)); + auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction + auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); + + auto candmass = 0.0; + auto candpt = 0.0; + auto candeta = 0.0; + + if (LambdaTag) { + candmass = v0.mLambda(); + candpt = v0.pt(); + candeta = v0.eta(); + + histos.fill(HIST("hSparseLambdaPolA"), candmass, candpt, candeta, PolA, centrality); + histos.fill(HIST("hSparseLambdaPolC"), candmass, candpt, candeta, PolC, centrality); + histos.fill(HIST("hSparseLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); + histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); + } + + if (aLambdaTag) { + candmass = v0.mAntiLambda(); + candpt = v0.pt(); + candeta = v0.eta(); + + histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, candpt, candeta, PolA, centrality); + histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, candpt, candeta, PolC, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); + } + } // end loop over V0s + } + PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 3206c77cb7b6c15004bca8ed9ed5f5a82f30176b Mon Sep 17 00:00:00 2001 From: abilandz Date: Sun, 22 Dec 2024 21:32:54 +0100 Subject: [PATCH 17/28] [PWGCF] dead zones (#9091) --- .../Core/MuPa-Configurables.h | 5 +- .../Core/MuPa-Enums.h | 3 + .../Core/MuPa-MemberFunctions.h | 60 +++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 30c3e38eca5..78adc891cf3 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -62,7 +62,7 @@ struct : ConfigurableGroup { // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "0-NoCollInTimeRangeStrict", "0-NoCollInTimeRangeStandard", "0-NoCollInRofStrict", "0-NoCollInRofStandard", "0-NoHighMultCollInPrevRof", "1-OccupancyEstimator", "1-MinVertexDistanceFromIP"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "0-NoCollInTimeRangeStrict", "0-NoCollInTimeRangeStandard", "0-NoCollInRofStrict", "0-NoCollInRofStandard", "0-NoHighMultCollInPrevRof", "0-IsGoodITSLayer3", "0-IsGoodITSLayer0123", "0-IsGoodITSLayersAll", "1-OccupancyEstimator", "1-MinVertexDistanceFromIP"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; @@ -102,6 +102,9 @@ struct : ConfigurableGroup { Configurable cfUseNoCollInRofStrict{"cfUseNoCollInRofStrict", false, "TBI 20240521 explanation"}; Configurable cfUseNoCollInRofStandard{"cfUseNoCollInRofStandard", false, "TBI 20240521 explanation"}; Configurable cfUseNoHighMultCollInPrevRof{"cfUseNoHighMultCollInPrevRof", false, "TBI 20240521 explanation"}; + Configurable cfUseIsGoodITSLayer3{"cfUseIsGoodITSLayer3", false, "TBI 20241220 explanation (or see enum)"}; + Configurable cfUseIsGoodITSLayer0123{"cfUseIsGoodITSLayer0123", false, "TBI 20241220 explanation (or see enum)"}; + Configurable cfUseIsGoodITSLayersAll{"cfUseIsGoodITSLayersAll", false, "TBI 20241220 explanation (or see enum)"}; Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "FT0COccupancyInTimeRange", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; } cf_ec; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h index 7fdd8054b94..f48e0b3b873 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h @@ -138,6 +138,9 @@ enum eEventCuts { // see IA Slide 39 in https://indico.cern.ch/event/1462154/ eNoCollInRofStandard, // same as previous + additional cuts on multiplicity, see IA Slide 39 in https://indico.cern.ch/event/1462154/ eNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold (default is >5000 a.e. by FT0C), see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value + eIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values + eIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values eOccupancyEstimator, // the default Occupancy estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eOccupancyEstimators eMinVertexDistanceFromIP, // if sqrt(vx^2+vy^2+vz^2) < MinVertexDistanceFromIP, the event is rejected. This way, I remove suspicious events with |vertex| = 0. eEventCuts_N diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 58358985a5d..1715085e10f 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -283,6 +283,9 @@ void DefaultConfiguration() ec.fEventCutName[eNoCollInRofStrict] = "NoCollInRofStrict"; ec.fEventCutName[eNoCollInRofStandard] = "NoCollInRofStandard"; ec.fEventCutName[eNoHighMultCollInPrevRof] = "NoHighMultCollInPrevRof"; + ec.fEventCutName[eIsGoodITSLayer3] = "IsGoodITSLayer3"; + ec.fEventCutName[eIsGoodITSLayer0123] = "IsGoodITSLayer0123"; + ec.fEventCutName[eIsGoodITSLayersAll] = "IsGoodITSLayersAll"; ec.fEventCutName[eOccupancyEstimator] = "OccupancyEstimator"; ec.fEventCutName[eMinVertexDistanceFromIP] = "MinVertexDistanceFromIP"; for (Int_t t = 0; t < eEventCuts_N; t++) { @@ -1371,6 +1374,9 @@ void DefaultCuts() ec.fUseEventCuts[eNoCollInRofStrict] = Alright(lUseEventCuts[eNoCollInRofStrict]); ec.fUseEventCuts[eNoCollInRofStandard] = Alright(lUseEventCuts[eNoCollInRofStandard]); ec.fUseEventCuts[eNoHighMultCollInPrevRof] = Alright(lUseEventCuts[eNoHighMultCollInPrevRof]); + ec.fUseEventCuts[eIsGoodITSLayer3] = Alright(lUseEventCuts[eIsGoodITSLayer3]); + ec.fUseEventCuts[eIsGoodITSLayer0123] = Alright(lUseEventCuts[eIsGoodITSLayer0123]); + ec.fUseEventCuts[eIsGoodITSLayersAll] = Alright(lUseEventCuts[eIsGoodITSLayersAll]); ec.fUseEventCuts[eOccupancyEstimator] = Alright(lUseEventCuts[eOccupancyEstimator]); ec.fUseEventCuts[eMinVertexDistanceFromIP] = Alright(lUseEventCuts[eMinVertexDistanceFromIP]); @@ -1387,6 +1393,9 @@ void DefaultCuts() ec.fUseEventCuts[eNoCollInRofStrict] = ec.fUseEventCuts[eNoCollInRofStrict] && cf_ec.cfUseNoCollInRofStrict; ec.fUseEventCuts[eNoCollInRofStandard] = ec.fUseEventCuts[eNoCollInRofStandard] && cf_ec.cfUseNoCollInRofStandard; ec.fUseEventCuts[eNoHighMultCollInPrevRof] = ec.fUseEventCuts[eNoHighMultCollInPrevRof] && cf_ec.cfUseNoHighMultCollInPrevRof; + ec.fUseEventCuts[eIsGoodITSLayer3] = ec.fUseEventCuts[eIsGoodITSLayer3] && cf_ec.cfUseIsGoodITSLayer3; + ec.fUseEventCuts[eIsGoodITSLayer0123] = ec.fUseEventCuts[eIsGoodITSLayer0123] && cf_ec.cfUseIsGoodITSLayer0123; + ec.fUseEventCuts[eIsGoodITSLayersAll] = ec.fUseEventCuts[eIsGoodITSLayersAll] && cf_ec.cfUseIsGoodITSLayersAll; // **) event cuts defined via [min, max): // Remark: I use this one also for events cuts set only via min or via max. @@ -2001,6 +2010,24 @@ void InsanityChecksBeforeBooking() } } + if (ec.fUseEventCuts[eIsGoodITSLayer3]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eIsGoodITSLayer3 only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eIsGoodITSLayer0123]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eIsGoodITSLayer0123 only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eIsGoodITSLayersAll]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eIsGoodITSLayersAll only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + // **) Supported reference multiplicity estimators for Run 3 are enlisted here: if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim]) { if (!(ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultTPC", TString::kIgnoreCase) || @@ -5602,6 +5629,39 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) IsGoodITSLayer3: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsGoodITSLayer3]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eIsGoodITSLayer3, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer3)) { + if (!EventCut(eRec, eIsGoodITSLayer3, cutModus)) { + return kFALSE; + } + } + } + + // *) IsGoodITSLayer0123: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsGoodITSLayer0123]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eIsGoodITSLayer0123, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123)) { + if (!EventCut(eRec, eIsGoodITSLayer0123, cutModus)) { + return kFALSE; + } + } + } + + // *) IsGoodITSLayersAll: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsGoodITSLayersAll]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eIsGoodITSLayersAll, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { + if (!EventCut(eRec, eIsGoodITSLayersAll, cutModus)) { + return kFALSE; + } + } + } + // ... // ... and corresponding MC truth simulated (Run 3 specific): From b76fd7a4656fd69a216e6edc45304fccad252407 Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:05:23 +0530 Subject: [PATCH 18/28] [PWGCF] Update lambdaR2Correlation.cxx (#9095) --- .../Tasks/lambdaR2Correlation.cxx | 229 +++++++++++++----- 1 file changed, 168 insertions(+), 61 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 324f344f0ab..17b23e249b6 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -117,6 +117,41 @@ using LambdaMcGenTrack = LambdaMcGenTracks::iterator; } // namespace o2::aod +enum CollisionLabels { + kTotColBeforeHasMcCollision = 1, + kTotCol, + kPassSelCol +}; + +enum TrackLabels { + kTracksBeforeHasMcParticle = 1, + kAllV0Tracks, + kPassV0DauTrackSel, + kPassV0TopoSel, + kPassV0TopoKinCuts, + kNotLambdaNotAntiLambda, + kV0AsLambdaAntiLambda, + kPassV0MassWinCuts, + kNotPrimaryLambda, + kNotSecondaryLambda, + kLambdaDauNotMcParticle, + kLambdaNotPrPiMinus, + kAntiLambdaNotAntiPrPiPlus, + kPassTrueLambdaSel, + kEffCorrPt, + kEffCorrPtY, + kEffCorrPtYVz, + kNoEffCorr, + kGenTotLambda, + kGenLambdaNoDau, + kGenLambdaToPrPi +}; + +enum RunType { + kRun3 = 0, + kRun2 +}; + enum ParticleType { kLambda = 0, kAntiLambda @@ -148,7 +183,9 @@ struct LambdaCorrTableProducer { // Collisions Configurable cMinZVtx{"cMinZVtx", -10.0, "z vertex cut"}; Configurable cMaxZVtx{"cMaxZVtx", 10.0, "z vertex cut"}; - Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection"}; + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cInt7Trig{"cInt7Trig", false, "kINT7 MB Trigger"}; + Configurable cSel7Trig{"cSel7Trig", false, "Sel7 (V0A + V0C) Selection Run2"}; Configurable cTriggerTvxSel{"cTriggerTvxSel", false, "Trigger Time and Vertex Selection"}; Configurable cTFBorder{"cTFBorder", false, "Timeframe Border Selection"}; Configurable cNoItsROBorder{"cNoItsROBorder", false, "No ITSRO Border Cut"}; @@ -194,6 +231,8 @@ struct LambdaCorrTableProducer { Configurable cRecPrimaryLambda{"cRecPrimaryLambda", false, "Primary Reconstructed Lambda"}; Configurable cRecSecondaryLambda{"cRecSecondaryLambda", false, "Secondary Reconstructed Lambda"}; Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; + Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; + Configurable cLambdaToPiProtonBR{"cLambdaToPiProtonBR", 0.639, "#Lambda->p#pi B.R. (63.9%) (PDG)"}; // Efficiency Correction Configurable cCorrectionFlag{"cCorrectionFlag", true, "Efficiency Correction Flag"}; @@ -221,7 +260,8 @@ struct LambdaCorrTableProducer { ccdb->setCaching(true); // initialize axis specifications - const AxisSpec axisCol(25, 0, 25, ""); + const AxisSpec axisCols(5, 0.5, 5.5, ""); + const AxisSpec axisTrks(25, 0.5, 25.5, ""); const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); @@ -251,11 +291,11 @@ struct LambdaCorrTableProducer { // Create Histograms. // Event histograms + histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCol}); // QA - histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisCol}); + histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); histos.add("Tracks/h2f_armpod_before_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); histos.add("Tracks/h2f_armpod_after_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); histos.add("Tracks/h1f_lambda_pt_vs_invm", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); @@ -301,45 +341,83 @@ struct LambdaCorrTableProducer { histos.add("Tracks/h2f_lambda_from_omega", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos - histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCol}); + histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCols}); histos.add("McGen/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); histos.add("McGen/h1f_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); histos.add("McGen/h1f_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + + // set bin lables specific to MC + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotColBeforeHasMcCollision, "kTotColBeforeHasMcCollision"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kTracksBeforeHasMcParticle, "kTracksBeforeHasMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotPrimaryLambda, "kNotPrimaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotSecondaryLambda, "kNotSecondaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaDauNotMcParticle, "kLambdaDauNotMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaNotPrPiMinus, "kLambdaNotPrPiMinus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAntiLambdaNotAntiPrPiPlus, "kAntiLambdaNotAntiPrPiPlus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassTrueLambdaSel, "kPassTrueLambdaSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenTotLambda, "kGenTotLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaNoDau, "kGenLambdaNoDau"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaToPrPi, "kGenLambdaToPrPi"); } + + // set bin labels + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol"); + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAllV0Tracks, "kAllV0Tracks"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0DauTrackSel, "kPassV0DauTrackSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0TopoSel, "kPassV0TopoSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0TopoKinCuts, "kPassV0TopoKinCuts"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotLambdaNotAntiLambda, "kNotLambdaNotAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0AsLambdaAntiLambda, "kV0AsLambdaAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0MassWinCuts, "kPassV0MassWinCuts"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPt, "kEffCorrPt"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtY, "kEffCorrPtY"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtYVz, "kEffCorrPtYVz"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNoEffCorr, "kNoEffCorr"); } - template + template bool selCollision(C const& col) { if (col.posZ() <= cMinZVtx || col.posZ() >= cMaxZVtx) { return false; } - if (!col.sel8() && cSel8Trig) { - return false; + if constexpr (run == kRun3) { + if (cSel8Trig && !col.sel8()) { + return false; + } + } else { + if (cInt7Trig && !col.alias_bit(kINT7)) { + return false; + } + + if (cSel7Trig && !col.sel7()) { + return false; + } } - if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && cTriggerTvxSel) { + if (cTriggerTvxSel && !col.selection_bit(aod::evsel::kIsTriggerTVX)) { return false; } - if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && cTFBorder) { + if (cTFBorder && !col.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return false; } - if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && cNoItsROBorder) { + if (cNoItsROBorder && !col.selection_bit(aod::evsel::kNoITSROFrameBorder)) { return false; } - if (!col.selection_bit(aod::evsel::kIsVertexITSTPC) && cItsTpcVtx) { + if (cItsTpcVtx && !col.selection_bit(aod::evsel::kIsVertexITSTPC)) { return false; } - if (!col.selection_bit(aod::evsel::kNoSameBunchPileup) && cPileupReject) { + if (cPileupReject && !col.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } - if (!col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && cZVtxTimeDiff) { + if (cZVtxTimeDiff && !col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } @@ -382,7 +460,7 @@ struct LambdaCorrTableProducer { return false; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 2.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0DauTrackSel); if (v0.dcaV0daughters() <= cMinV0DcaDaughters || v0.dcaV0daughters() >= cMaxV0DcaDaughters) { return false; @@ -415,7 +493,7 @@ struct LambdaCorrTableProducer { return false; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 3.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0TopoSel); // pT cut if (v0.pt() <= cMinV0Pt || v0.pt() >= cMaxV0Pt) { @@ -427,8 +505,6 @@ struct LambdaCorrTableProducer { return false; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 4.5); - return true; } @@ -482,10 +558,10 @@ struct LambdaCorrTableProducer { } if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda - histos.fill(HIST("Tracks/h1f_tracks_info"), 17.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotLambdaNotAntiLambda); return false; } else if (lambdaFlag && antiLambdaFlag) { // check if the track is identified as lambda and anti-lambda both (DISCARD THIS TRACK) - histos.fill(HIST("Tracks/h1f_tracks_info"), 18.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0AsLambdaAntiLambda); return false; } @@ -503,7 +579,7 @@ struct LambdaCorrTableProducer { return true; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 19.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), 23.5); return false; } @@ -519,10 +595,10 @@ struct LambdaCorrTableProducer { // check for primary/secondary lambda if (cRecPrimaryLambda && !mcpart.isPhysicalPrimary()) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 12.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotPrimaryLambda); return false; } else if (cRecSecondaryLambda && mcpart.isPhysicalPrimary()) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 13.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotSecondaryLambda); return false; } @@ -531,7 +607,7 @@ struct LambdaCorrTableProducer { // check if the daughters have corresponding mcparticle if (!postrack.has_mcParticle() || !negtrack.has_mcParticle()) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 14.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kLambdaDauNotMcParticle); return false; } @@ -540,12 +616,12 @@ struct LambdaCorrTableProducer { if (mcpart.pdgCode() == kLambda0) { if (mcpostrack.pdgCode() != kProton || mcnegtrack.pdgCode() != kPiMinus) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 15.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kLambdaNotPrPiMinus); return false; } } else if (mcpart.pdgCode() == kLambda0Bar) { if (mcpostrack.pdgCode() != kPiPlus || mcnegtrack.pdgCode() != kProtonBar) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 16.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kAntiLambdaNotAntiPrPiPlus); return false; } } @@ -588,16 +664,16 @@ struct LambdaCorrTableProducer { float retVal = 0.; if (std::string(obj->ClassName()) == "TH1F") { - histos.fill(HIST("Tracks/h1f_tracks_info"), 21.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPt); retVal = hist->GetBinContent(hist->FindBin(v0.pt())); } else if (std::string(obj->ClassName()) == "TH2F") { - histos.fill(HIST("Tracks/h1f_tracks_info"), 22.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtY); retVal = hist->GetBinContent(hist->FindBin(v0.pt(), v0.yLambda())); } else if (std::string(obj->ClassName()) == "TH3F") { - histos.fill(HIST("Tracks/h1f_tracks_info"), 23.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtYVz); retVal = hist->GetBinContent(hist->FindBin(v0.pt(), v0.yLambda(), col.posZ())); } else { - histos.fill(HIST("Tracks/h1f_tracks_info"), 24.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kNoEffCorr); LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); retVal = 1.; } @@ -655,27 +731,35 @@ struct LambdaCorrTableProducer { histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); } - template + template void fillLambdaTables(C const& collision, V const& v0tracks, T const& tracks) { if constexpr (dmc == kMC) { - histos.fill(HIST("Events/h1f_collisions_info"), 0.5); + histos.fill(HIST("Events/h1f_collisions_info"), kTotColBeforeHasMcCollision); if (!collision.has_mcCollision()) { return; } } - histos.fill(HIST("Events/h1f_collisions_info"), 1.5); + histos.fill(HIST("Events/h1f_collisions_info"), kTotCol); // select collision - if (!selCollision(collision)) { + if (!selCollision(collision)) { return; } - histos.fill(HIST("Events/h1f_collisions_info"), 2.5); + histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); - lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); + float cent = 0.; + + if constexpr (run == kRun3) { + cent = collision.centFT0M(); + } else { + cent = collision.centRun2V0M(); + } + + lambdaCollisionTable(cent, collision.posX(), collision.posY(), collision.posZ()); // initialize v0track objects ParticleType v0type = kLambda; @@ -684,29 +768,29 @@ struct LambdaCorrTableProducer { for (auto const& v0 : v0tracks) { // check for corresponding MCGen Particle if constexpr (dmc == kMC) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 0.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); if (!v0.has_mcParticle() || !v0.template posTrack_as().has_mcParticle() || !v0.template negTrack_as().has_mcParticle()) { continue; } } - histos.fill(HIST("Tracks/h1f_tracks_info"), 1.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kAllV0Tracks); histos.fill(HIST("Tracks/h2f_armpod_before_sel"), v0.alpha(), v0.qtarm()); // topological and kinematic selection - // armeteros-podolanski selection | kshort mass rejection hypothesis if (!selLambdaWithTopoKinCuts(collision, v0, tracks)) { continue; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 5.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0TopoKinCuts); // select v0 as lambda / anti-lambda + // armeteros-podolanski selection | kshort mass rejection hypothesis if (!selLambdaMassWindow(v0, tracks, v0type)) { continue; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 6.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0MassWinCuts); // we have v0 as lambda // do MC analysis @@ -715,7 +799,7 @@ struct LambdaCorrTableProducer { if (cSelectTrueLambda && !selTrueMcRecLambda(v0, tracks)) { continue; } - histos.fill(HIST("Tracks/h1f_tracks_info"), 7.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); } @@ -742,26 +826,41 @@ struct LambdaCorrTableProducer { } } - using Collisions = soa::Join; + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; using Tracks = soa::Join; + using McV0Tracks = soa::Join; + using TracksMC = soa::Join; - void processData(Collisions::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) + void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { - fillLambdaTables(collision, V0s, tracks); + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(LambdaCorrTableProducer, processData, "Process for DATA", true); + PROCESS_SWITCH(LambdaCorrTableProducer, processDataRun3, "Process for Run3 DATA", true); - using McV0Tracks = soa::Join; - using TracksMC = soa::Join; + void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) + { + fillLambdaTables(collision, V0s, tracks); + } - void processMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, - McV0Tracks const& V0s, aod::McParticles const&, TracksMC const& tracks) + PROCESS_SWITCH(LambdaCorrTableProducer, processDataRun2, "Process for Run2 DATA", false); + + void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, aod::McParticles const&, TracksMC const& tracks) + { + fillLambdaTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaCorrTableProducer, processMCRecoRun3, "Process for Run3 MC Reconstructed", false); + + void processMCRecoRun2(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, aod::McParticles const&, TracksMC const& tracks) { - fillLambdaTables(collision, V0s, tracks); + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(LambdaCorrTableProducer, processMCReco, "Process for MC Reconstructed", false); + PROCESS_SWITCH(LambdaCorrTableProducer, processMCRecoRun2, "Process for Run2 MC Reconstructed", false); void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) { @@ -790,6 +889,8 @@ struct LambdaCorrTableProducer { continue; } + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenTotLambda); + // check for Primary Lambdas/AntiLambdas if (cGenPrimaryLambda && !mcpart.isPhysicalPrimary()) { continue; @@ -800,30 +901,36 @@ struct LambdaCorrTableProducer { continue; } - // check for correct decay channel + // get daughter track info and check for decay channel flag + if (!mcpart.has_daughters()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaNoDau); + continue; + } auto dautracks = mcpart.template daughters_as(); std::vector daughterPDGs, daughterIDs; for (auto const& dautrack : dautracks) { daughterPDGs.push_back(dautrack.pdgCode()); daughterIDs.push_back(dautrack.globalIndex()); } - if (std::abs(daughterPDGs[0]) != kProton || std::abs(daughterPDGs[1]) != kPiPlus) { + if (cGenDecayChannel && (std::abs(daughterPDGs[0]) != kProton || std::abs(daughterPDGs[1]) != kPiPlus)) { continue; } + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); + if (v0type == kLambda) { - histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0], mcpart.pt()); - histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1], mcpart.pt()); - histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode(), mcpart.pt()); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); } else { - histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0], mcpart.pt()); - histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1], mcpart.pt()); - histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode(), mcpart.pt()); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); } lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), - daughterIDs[0], daughterIDs[1], (int8_t)v0type, -999., -999., 1.); + daughterIDs[0], daughterIDs[1], (int8_t)v0type, -999., -999., 1. / cLambdaToPiProtonBR); } } From 9f20e89c025bc78862bf63373eb1bb64a831ea0b Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 22 Dec 2024 21:36:38 +0100 Subject: [PATCH 19/28] [PWGCF] DptDpt - Tracking the fraction of shared TPC clusters (#9102) Co-authored-by: Victor --- PWGCF/Core/AnalysisConfigurableCuts.h | 33 ++++++++++++++------------- PWGCF/TableProducer/dptdptfilter.cxx | 4 ++-- PWGCF/TableProducer/dptdptfilter.h | 15 +++++++++++- PWGCF/Tasks/matchRecoGen.cxx | 2 +- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/PWGCF/Core/AnalysisConfigurableCuts.h b/PWGCF/Core/AnalysisConfigurableCuts.h index c35d24430c6..886d78c95fe 100644 --- a/PWGCF/Core/AnalysisConfigurableCuts.h +++ b/PWGCF/Core/AnalysisConfigurableCuts.h @@ -86,27 +86,28 @@ class TrackSelectionCfg ClassDefNV(TrackSelectionCfg, 1); }; -/// \brief Simple class for fine tuning a track selection object -/// The tune is done after the actual track selection has ben performed -/// Take into consideration that only more restrictive tunes are supported -/// For more relaxed tunes the whole track selection object must be modified +/// \brief Simple class for configuring the fine tuning a track selection object +/// The tune should change the track selection objects and probably do further checks +/// after the actual track selection has ben performed class TrackSelectionTuneCfg { public: - bool mUseIt = false; ///< use this track selection tuning configuration - int mTPCclusters = 0; ///< minimum number of TPC clusters - bool mUseTPCclusters = false; ///< use or not the number of TPC clusters - int mTPCxRows = 70; ///< minimum number of TPC crossed rows - bool mUseTPCxRows = false; ///< use or not the number of TPC crossed rows - float mTPCXRoFClusters = 0.8; ///< minimum value of the TPC ratio no of crossed rows over findable clusters - bool mUseTPCXRoFClusters = false; ///< use or not the TPC ration of no of crossed rows over findable clusters - float mDCAxy = 2.4; ///< maximum DCA on xy plane - bool mUseDCAxy = false; ///< use or not the maximum DCA on the xy plane - float mDCAz = 3.2; ///< maximum DCA on z axis - bool mUseDCAz = false; ///< use or not the maximum DCA on z asis + bool mUseIt = false; ///< use this track selection tuning configuration + int mTPCclusters = 0; ///< minimum number of TPC clusters + bool mUseTPCclusters = false; ///< use or not the number of TPC clusters + int mTPCxRows = 70; ///< minimum number of TPC crossed rows + bool mUseTPCxRows = false; ///< use or not the number of TPC crossed rows + float mTPCXRoFClusters = 0.8; ///< minimum value of the TPC ratio no of crossed rows over findable clusters + bool mUseTPCXRoFClusters = false; ///< use or not the TPC ratio of no of crossed rows over findable clusters + float mFractionTpcSharedClusters = 0.4; ///< the maximum fraction of TPC shared clusters + bool mUseFractionTpcSharedClusters = false; ///< use or not the fraction of TPC share clusters + float mDCAxy = 2.4; ///< maximum DCA on xy plane + bool mUseDCAxy = false; ///< use or not the maximum DCA on the xy plane + float mDCAz = 3.2; ///< maximum DCA on z axis + bool mUseDCAz = false; ///< use or not the maximum DCA on z asis private: - ClassDefNV(TrackSelectionTuneCfg, 1); + ClassDefNV(TrackSelectionTuneCfg, 2); }; /// \brief Simple class to configure a selection based on PID diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 6c2482fffda..ee89a85bfeb 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -770,7 +770,7 @@ struct DptDptFilterTracks { Configurable cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; Configurable cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; Configurable cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle, 3 mcparticle only primaries, 4 mcparticle only sec, 5 mcparicle only sec from decays, 6 mcparticle only sec from material. Default 0"}; - Configurable cfgTuneTrackSelection{"tunetracksel", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,2.4,false,3.2,false}"}; + Configurable cfgTuneTrackSelection{"tunetracksel", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, tpcshcls-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,0.4,false,2.4,false,3.2,false}"}; Configurable cfgPionPIDSelection{"pipidsel", {}, "PID criteria for pions"}; @@ -835,7 +835,7 @@ struct DptDptFilterTracks { /* the track types and combinations */ tracktype = cfgTrackType.value; - initializeTrackSelection(cfgTuneTrackSelection); + initializeTrackSelection(cfgTuneTrackSelection.value); traceDCAOutliers = cfgTraceDCAOutliers; traceOutOfSpeciesParticles = cfgTraceOutOfSpeciesParticles; recoIdMethod = cfgRecoIdMethod; diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 16904455a9e..b1a4f1a737f 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -210,6 +210,7 @@ std::function maxDcaZPtDep{}; // max dca in z axis as function of std::vector trackFilters = {}; bool dca2Dcut = false; +float sharedTpcClusters = 1.0; ///< max fraction of shared TPC clusters float maxDCAz = 1e6f; float maxDCAxy = 1e6f; @@ -236,7 +237,7 @@ inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdat return lst; } -inline void initializeTrackSelection(const TrackSelectionTuneCfg& tune) +inline void initializeTrackSelection(TrackSelectionTuneCfg& tune) { switch (tracktype) { case 1: { /* Run2 global track */ @@ -341,12 +342,20 @@ inline void initializeTrackSelection(const TrackSelectionTuneCfg& tune) filter->SetMinNCrossedRowsOverFindableClustersTPC(tune.mTPCXRoFClusters); } if (tune.mUseDCAxy) { + /* DCAxy is tricky due to how the pT dependence is implemented */ + filter->SetMaxDcaXYPtDep([&tune](float) { return tune.mDCAxy; }); filter->SetMaxDcaXY(tune.mDCAxy); } if (tune.mUseDCAz) { filter->SetMaxDcaZ(tune.mDCAz); } } + if (tune.mUseDCAz) { + maxDcaZPtDep = [&tune](float) { return tune.mDCAz; }; + } + if (tune.mUseFractionTpcSharedClusters) { + sharedTpcClusters = tune.mFractionTpcSharedClusters; + } } } @@ -1128,6 +1137,10 @@ inline bool matchTrackType(TrackObject const& track) if (!checkDca2Dcut(track)) { return false; } + /* shared fraction of TPC clusters */ + if (!(track.tpcFractionSharedCls() < sharedTpcClusters)) { + return false; + } return true; } } diff --git a/PWGCF/Tasks/matchRecoGen.cxx b/PWGCF/Tasks/matchRecoGen.cxx index 4e1022acd2f..254d5ba0c1e 100644 --- a/PWGCF/Tasks/matchRecoGen.cxx +++ b/PWGCF/Tasks/matchRecoGen.cxx @@ -120,7 +120,7 @@ struct MatchRecoGen { /* the track types and combinations */ tracktype = cfgTrackType.value; - initializeTrackSelection(cfgTuneTrackSelection); + initializeTrackSelection(cfgTuneTrackSelection.value); /* the centrality/multiplicity estimation */ fCentMultEstimator = getCentMultEstimator(cfgCentMultEstimator); /* the trigger selection */ From 97b7701f0f2553ce34d17de6da80a1085b337e26 Mon Sep 17 00:00:00 2001 From: hernasab Date: Sun, 22 Dec 2024 14:38:42 -0600 Subject: [PATCH 20/28] [PWGCF] Adjusting multiplicity axis to be configurable (#9092) Co-authored-by: Sabrina Hernandez --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 7efdeff3d05..d4255c156f3 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -79,7 +79,7 @@ struct FlowZDCtask { ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; - ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2500, 0, 2500}, "centrality axis for histograms"}; ConfigurableAxis axisEnergy{"axisEnergy", {100, 0, 700}, "energy axis for zdc histos"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -133,7 +133,7 @@ struct FlowZDCtask { AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; AxisSpec axisCent{8, 0.f, 105.f, "centrality"}; - AxisSpec axisMult{1000, -0.5f, 1500.5f, "multiplicity"}; + AxisSpec axisMult{2500, 0, 2500.0f, "multiplicity"}; AxisSpec axisMultTPC{1000, -0.5f, 1999.5f, "TPCmultiplicity"}; AxisSpec axisCentBins{{0, 5., 10., 20., 30., 40., 50., 60., 70., 80.}, "centrality percentile"}; AxisSpec axisPtBins{{0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.25, 2.5, 2.75, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 8.0, 10., 13., 16., 20.}, "p_{T} (GeV/c)"}; @@ -144,7 +144,7 @@ struct FlowZDCtask { histos.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); histos.add("centHistogram", "centHistogram", kTH1F, {axisCent}); - histos.add("multHistogram", "multHistogram", kTH1F, {axisMult}); + histos.add("multHistogram", "multHistogram", kTH1F, {axisMultiplicity}); histos.add("multvsCent", "centrality vs multiplicity", kTH2F, {axisCent, axisMult}); histos.add("phiHistogram", "phiHistogram", kTH1F, {axisPhi}); histos.add("TPCmultiplicity", "TPCmultiplicity", kTH1F, {axisMultTPC}); @@ -187,7 +187,6 @@ struct FlowZDCtask { histos.add("ImagQHistogramZNC", "ImagQHistogramZNC", kTH1F, {axisQZNA}); histos.add("Acorrelations", "Acorrelations", kTH2F, {{axisQZNA}, {axisQZNA}}); - histos.add("SPAngleZNA", "Spectator Plane Angle ZNA;Angle (radians);Entries", {HistType::kTH1F, {{100, -TMath::Pi(), TMath::Pi()}}}); histos.add("SPAngleZNC", "Spectator Plane Angle ZNC;Angle (radians);Entries", {HistType::kTH1F, {{100, -TMath::Pi(), TMath::Pi()}}}); From 0bf9bea2f6920a7d2ed94b968583776191fc9242 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Sun, 22 Dec 2024 22:35:09 +0100 Subject: [PATCH 21/28] [PWGCF] adding event mixing with 2prong pair (#9105) Co-authored-by: ALICE Action Bot --- PWGCF/Tasks/correlations.cxx | 44 ++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 850cdd4d455..077638905ed 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -12,7 +12,6 @@ /// \file correlations.cxx /// \brief task for the correlation calculations with CF-filtered tracks for O2 analysis /// \author Jan Fiete Grosse-Oetringhaus , Jasper Parkkila -// o2-linter: disable=name/workflow-file #include #include @@ -481,7 +480,7 @@ struct CorrelationTask { float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -o2::constants::math::PIHalf); // last param is the weight - if (cfgMassAxis && doprocessSame2Prong2Prong) { + if (cfgMassAxis && (doprocessSame2Prong2Prong) && !(doprocessSame2ProngDerived || doprocessMixed2ProngDerived)) { if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) target->getPairHist()->Fill(step, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, posZ, track2.invMass(), track1.invMass(), associatedWeight); else @@ -764,6 +763,47 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processMixed2ProngDerived, "Process mixed events on derived data", false); + void processMixed2Prong2Prong(DerivedCollisions const& collisions, soa::Filtered const& p2tracks) + { + BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + // Strictly upper categorised collisions, for cfgNoMixedEvents combinations per bin, skipping those in entry -1 + auto tracksTuple = std::make_tuple(p2tracks); + SameKindPair, BinningTypeDerived> pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + + for (auto it = pairs.begin(); it != pairs.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + int bin = configurableBinningDerived.getBin({collision1.posZ(), collision1.multiplicity()}); + float eventWeight = 1.0f / it.currentWindowNeighbours(); + int field = 0; + if (cfgTwoTrackCut > 0) { + field = getMagneticField(collision1.timestamp()); + } + + if (cfgVerbosity > 0) { + LOGF(info, "processMixedDerived: Mixed collisions bin: %d pair: [%d, %d] %d (%.3f, %.3f), %d (%.3f, %.3f)", bin, it.isNewWindow(), it.currentWindowNeighbours(), collision1.globalIndex(), collision1.posZ(), collision1.multiplicity(), collision2.globalIndex(), collision2.posZ(), collision2.multiplicity()); + } + + if (it.isNewWindow()) { + loadEfficiency(collision1.timestamp()); + + mixed->fillEvent(collision1.multiplicity(), CorrelationContainer::kCFStepReconstructed); + } + + // LOGF(info, "Tracks: %d and %d entries", tracks1.size(), tracks2.size()); + + registry.fill(HIST("eventcount_mixed"), bin); + fillCorrelations(mixed, tracks1, tracks2, collision1.multiplicity(), collision1.posZ(), field, eventWeight); + + if (cfg.mEfficiencyAssociated || cfg.mEfficiencyTrigger) { + if (it.isNewWindow()) { + mixed->fillEvent(collision1.multiplicity(), CorrelationContainer::kCFStepCorrected); + } + fillCorrelations(mixed, tracks1, tracks2, collision1.multiplicity(), collision1.posZ(), field, eventWeight); + } + } + } + PROCESS_SWITCH(CorrelationTask, processMixed2Prong2Prong, "Process mixed events on derived data", false); + // Version with combinations /*void processWithCombinations(soa::Join::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { From 07e18fdd56dbfd1990a1c236853456607a9308ef Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 23 Dec 2024 13:25:58 +0900 Subject: [PATCH 22/28] [PWGEM/PhotonMeson] remove unnecessary flag (#9110) --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- .../TableProducer/photonconversionbuilder.cxx | 31 ++++++------------- .../TableProducer/skimmerGammaConversion.cxx | 2 +- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 89013efb401..d81902b234f 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -168,7 +168,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32 }); } // namespace v0leg DECLARE_SOA_TABLE(V0Legs, "AOD", "V0LEG", //! - o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign, v0leg::IsMoved, + o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign, v0leg::Px, v0leg::Py, v0leg::Pz, track::DcaXY, track::DcaZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 66d149c6061..571c92c906a 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -372,9 +372,9 @@ struct PhotonConversionBuilder { } template - void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ, bool isMoved) + void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ) { - v0legs(track.collisionId(), track.globalIndex(), track.sign(), isMoved, + v0legs(track.collisionId(), track.globalIndex(), track.sign(), kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(), @@ -420,17 +420,10 @@ struct PhotonConversionBuilder { // Calculate DCA with respect to the collision associated to the v0, not individual tracks gpu::gpustd::array dcaInfo; - bool is_pos_moved = false; - bool is_ele_moved = false; - auto pTrack = getTrackParCov(pos); - if (moveTPCTracks && isTPConlyTrack(pos)) { - if (mVDriftMgr.moveTPCTrack(collision, pos, pTrack)) { - is_pos_moved = true; - } else { - LOGP(error, "failed correction for positive tpc track"); - return; - } + if (moveTPCTracks && isTPConlyTrack(pos) && !mVDriftMgr.moveTPCTrack(collision, pos, pTrack)) { + LOGP(error, "failed correction for positive tpc track"); + return; } auto pTrackC = pTrack; pTrackC.setPID(o2::track::PID::Electron); @@ -439,13 +432,9 @@ struct PhotonConversionBuilder { auto posdcaZ = dcaInfo[1]; auto nTrack = getTrackParCov(ele); - if (moveTPCTracks && isTPConlyTrack(ele)) { - if (mVDriftMgr.moveTPCTrack(collision, ele, nTrack)) { - is_ele_moved = true; - } else { - LOGP(error, "failed correction for negative tpc track"); - return; - } + if (moveTPCTracks && isTPConlyTrack(ele) && !mVDriftMgr.moveTPCTrack(collision, ele, nTrack)) { + LOGP(error, "failed correction for negative tpc track"); + return; } auto nTrackC = nTrack; nTrackC.setPID(o2::track::PID::Electron); @@ -685,8 +674,8 @@ struct PhotonConversionBuilder { v0photonskfcov(gammaKF_PV.GetCovariance(9), gammaKF_PV.GetCovariance(14), gammaKF_PV.GetCovariance(20), gammaKF_PV.GetCovariance(13), gammaKF_PV.GetCovariance(19), gammaKF_PV.GetCovariance(18)); - fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ, is_pos_moved); // positive leg first - fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ, is_ele_moved); // negative leg second + fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first + fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second } // end of fill table } diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index eb8f1786a39..8c8e2c8a109 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -184,7 +184,7 @@ struct skimmerGammaConversion { void fillTrackTable(TTRACK const& theTrack, TKFP const& kfp) { v0legs(theTrack.collisionId(), - theTrack.globalIndex(), theTrack.sign(), false, + theTrack.globalIndex(), theTrack.sign(), kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), theTrack.dcaXY(), theTrack.dcaZ(), theTrack.tpcNClsFindable(), theTrack.tpcNClsFindableMinusFound(), theTrack.tpcNClsFindableMinusCrossedRows(), theTrack.tpcNClsShared(), theTrack.tpcChi2NCl(), theTrack.tpcInnerParam(), theTrack.tpcSignal(), From 56c64b32f25b651a92291384dcf0a1153bd89405 Mon Sep 17 00:00:00 2001 From: Dukhishyam Mallick <160018357+dmallick2@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:36:34 +0100 Subject: [PATCH 23/28] [PWGLF] PWGLF:Added task for higher mass resonances in non identical Vzero pairs (#9101) --- PWGLF/Tasks/Resonances/CMakeLists.txt | 5 + PWGLF/Tasks/Resonances/kshortlambda.cxx | 943 ++++++++++++++++++++++++ 2 files changed, 948 insertions(+) create mode 100644 PWGLF/Tasks/Resonances/kshortlambda.cxx diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index d684a7cd5a4..51d07dd381d 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -178,3 +178,8 @@ o2physics_add_dpl_workflow(doublephimeson SOURCES doublephimeson.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(kshortlambda + SOURCES kshortlambda.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/kshortlambda.cxx b/PWGLF/Tasks/Resonances/kshortlambda.cxx new file mode 100644 index 00000000000..71361129905 --- /dev/null +++ b/PWGLF/Tasks/Resonances/kshortlambda.cxx @@ -0,0 +1,943 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file kshortlambda.cxx +/// \brief higher mass resonance search in non-identical V0 pairs (K0s-L) +/// \author dukhishyam Mallick (dukhishyam.mallick@cern.ch) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "TF1.h" +#include "TRandom3.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/StepTHn.h" +#include "ReconstructionDataFormats/Track.h" +#include "Framework/O2DatabasePDGPlugin.h" + +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" // +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" // +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" // +#include "Framework/runDataProcessing.h" // +#include "PWGLF/DataModel/LFStrangenessTables.h" // + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +// using namespace o2::constants::physics; +using std::array; + +struct Kshortlambda { + SliceCache cache; + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hvzero{"hvzeroball", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + Configurable qAv0{"qAv0", false, "qAv0"}; + Configurable qAPID{"qAPID", true, "qAPID"}; + Configurable qAv0daughters{"qAv0daughters", false, "qA of v0 daughters"}; + Configurable qAevents{"qAevents", false, "QA of events"}; + Configurable invMass1D{"invMass1D", false, "1D invariant mass histograms"}; + Configurable correlation2Dhist{"correlation2Dhist", true, "Lamda K0 mass correlation"}; + Configurable cDCAv0topv{"cDCAv0topv", false, "DCA V0 to PV"}; + Configurable armcut{"armcut", true, "arm cut"}; + Configurable globalTracks{"globalTracks", false, "Global tracks"}; + Configurable hasTPC{"hasTPC", false, "TPC"}; + + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable cfgETAcut{"cfgETAcut", 0.8f, "Track ETA cut"}; + Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + Configurable goodzvertex{"goodzvertex", false, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference."}; + Configurable itstpctracks{"itstpctracks", false, "selects collisions with at least one ITS-TPC track,"}; + Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; + Configurable applyOccupancyCut{"applyOccupancyCut", false, "Apply occupancy cut"}; + Configurable occupancyCut{"occupancyCut", 1000, "Mimimum Occupancy cut"}; + + // Configurable parameters for V0 selection + Configurable confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; + Configurable v0settingdcapostopv{"v0settingdcapostopv", 0.06, "DCA Pos To PV"}; + Configurable v0settingdcanegtopv{"v0settingdcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable cMaxV0DCA{"cMaxV0DCA", 1, "DCA V0 to PV"}; + // Configurable isStandarv0{"isStandarv0", false, "Standard V0"}; + // Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; // same as DCA pos to pv and neg to pv + + Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; + Configurable confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"}; + Configurable confV0TranRadV0Min{"confV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; + Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; + Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on Ks0 mass (Mass (Ks) - cSigmaMassKs0*cWidthKs0)"}; + Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; + Configurable confDaughEta{"confDaughEta", 0.8f, "V0 Daugh sel: max eta"}; + Configurable confDaughTPCnclsMin{"confDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; + Configurable confDaughPIDCuts{"confDaughPIDCuts", 5, "PID selections for KS0 daughters"}; + Configurable confarmcut{"confarmcut", 0.2f, "Armenteros cut"}; + Configurable confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"}; + + // Configurable lowmasscutks0{"lowmasscutks0", 0.497 - 4 * 0.005, "Low mass cut on K0s"}; + // Configurable highmasscutks0{"highmasscutks0", 0.497 + 4 * 0.005, "High mass cut on K0s"}; + + // Configurable for track selection and multiplicity + Configurable cfgPTcut{"cfgPTcut", 0.2f, "Track PT cut"}; + Configurable cfgNmixedEvents{"cfgNmixedEvents", 5, "Number of mixed events"}; + Configurable cfgMultFOTM{"cfgMultFOTM", true, "Use FOTM multiplicity if pp else use 0 here for PbPb (FT0C)"}; + ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; + + // output THnSparses + Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; + Configurable activateTHnSparseCosThStarProduction{"activateTHnSparseCosThStarProduction", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; + Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", true, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; + Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; + Configurable cnofrotations{"cnofrotations", 3, "Number of random rotations in the rotational background"}; + + // Other cuts on Ks and glueball + Configurable rapidityks{"rapidityks", true, "rapidity cut on K0s"}; + Configurable applyCompetingcut{"applyCompetingcut", false, "Competing cascade rejection cut"}; + Configurable competingCascrejlambda{"competingCascrejlambda", 0.005, "rejecting competing cascade lambda"}; + Configurable competingCascrejlambdaanti{"competingCascrejlambdaanti", 0.005, "rejecting competing cascade anti-lambda"}; // If one of the pions is misidentified as a proton, then instead of Ks we reconstruct lambda, therefore the competing cascade rejection cut is applied in which if the reconstrcted mass of a pion and proton (which we are assuming to be misidentified as proton) is close to lambda or anti-lambda, then the track is rejected. + Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; + Configurable tpcCrossedrowsOverfcls{"tpcCrossedrowsOverfcls", 0.8, "TPC crossed rows over findable clusters"}; + + // Mass and pT axis as configurables + Configurable cPtMin{"cPtMin", 0.0f, "Minimum pT"}; + Configurable cPtMax{"cPtMax", 50.0f, "Maximum pT"}; + Configurable cPtBins{"cPtBins", 500, "Number of pT bins"}; + Configurable cMassMin{"cMassMin", 0.9f, "Minimum mass bin"}; + Configurable cMassMax{"cMassMax", 3.0f, "Maximum mass bin"}; + Configurable cMassBins{"cMassBins", 210, "Number of mass binsl"}; + Configurable ksMassMin{"ksMassMin", 0.45f, "Minimum mass of K0s"}; + Configurable ksMassMax{"ksMassMax", 0.55f, "Maximum mass of K0s"}; + Configurable ksMassBins{"ksMassBins", 200, "Number of mass bins for K0s"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; + ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; + ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; + ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; + ConfigurableAxis occupancyBins{"occupancyBins", {VARIABLE_WIDTH, 0.0, 100, 500, 600, 1000, 1100, 1500, 1600, 2000, 2100, 2500, 2600, 3000, 3100, 3500, 3600, 4000, 4100, 4500, 4600, 5000, 5100, 9999}, "Binning of the occupancy axis"}; + + // Event selection cuts - Alex (Temporary, need to fix!) + TF1* fMultPVCutLow = nullptr; + TF1* fMultPVCutHigh = nullptr; + TF1* fMultCutLow = nullptr; + TF1* fMultCutHigh = nullptr; + TF1* fMultMultPVCut = nullptr; + + TRandom* rn = new TRandom(); + + void init(InitContext const&) + { + // Axes + AxisSpec k0ShortMassAxis = {ksMassBins, ksMassMin, ksMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vzeroMassAxis = {cMassBins, cMassMin, cMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {60, -15.f, 15.f, "vrtx_{Z} [cm]"}; // for histogram + AxisSpec ptAxis = {cPtBins, cPtMin, cPtMax, "#it{p}_{T} (GeV/#it{c})"}; + // AxisSpec multiplicityAxis = {110, 0.0f, 150.0f, "Multiplicity Axis"}; + AxisSpec multiplicityAxis = {binsCent, "Multiplicity Axis"}; + AxisSpec thnAxisPOL{configThnAxisPOL, "Configurabel theta axis"}; + AxisSpec occupancyAxis = {occupancyBins, "Occupancy [-40,100]"}; + + // THnSparses + std::array sparses = {activateTHnSparseCosThStarHelicity, activateTHnSparseCosThStarProduction, activateTHnSparseCosThStarBeam, activateTHnSparseCosThStarRandom}; + // std::array sparses = {activateTHnSparseCosThStarHelicity}; + if (std::accumulate(sparses.begin(), sparses.end(), 0) == 0) { + LOGP(fatal, "No output THnSparses enabled"); + } else { + if (activateTHnSparseCosThStarHelicity) { + LOGP(info, "THnSparse with cosThStar w.r.t. helicity axis active."); + } + if (activateTHnSparseCosThStarProduction) { + LOGP(info, "THnSparse with cosThStar w.r.t. production axis active."); + } + if (activateTHnSparseCosThStarBeam) { + LOGP(info, "THnSparse with cosThStar w.r.t. beam axis active. (Gottified jackson frame)"); + } + if (activateTHnSparseCosThStarRandom) { + LOGP(info, "THnSparse with cosThStar w.r.t. random axis active."); + } + } + + // Event selection + if (qAevents) { + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + rEventSelection.add("hmultiplicity", "multiplicity percentile distribution", {HistType::kTH1F, {{150, 0.0f, 150.0f}}}); + rEventSelection.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); + rEventSelection.add("multdist_FT0A", "FT0A Multiplicity distribution", kTH1F, {axisMultdist}); + rEventSelection.add("multdist_FT0C", "FT0C Multiplicity distribution", kTH1F, {axisMultdist}); + rEventSelection.add("hNcontributor", "Number of primary vertex contributor", kTH1F, {{2000, 0.0f, 10000.0f}}); + } + + if (invMass1D) { + hvzero.add("h3vzeropairInvMassDS", "h1vzeropairInvMassDS", kTH1F, {vzeroMassAxis}); + hvzero.add("h3vzeropairInvMassME", "h1vzeropairInvMassME", kTH1F, {vzeroMassAxis}); + hvzero.add("h3vzeropairInvMassRot", "h1vzeropairInvMassRot", kTH1F, {vzeroMassAxis}); + } + hvzero.add("h3vzeropairInvMassDS", "h3vzeropairInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, vzeroMassAxis, thnAxisPOL, occupancyAxis}, true); + hvzero.add("h3vzeropairInvMassME", "h3vzeropairInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, vzeroMassAxis, thnAxisPOL, occupancyAxis}, true); + hvzero.add("h3vzeropairInvMassRot", "h3vzeropairInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, vzeroMassAxis, thnAxisPOL, occupancyAxis}, true); + hvzero.add("heventscheck", "heventscheck", kTH1I, {{10, 0, 10}}); + hvzero.add("htrackscheckv0", "htrackscheckv0", kTH1I, {{15, 0, 15}}); + hvzero.add("htrackscheckv0daughters", "htrackscheckv0daughters", kTH1I, {{15, 0, 15}}); + + // K0s topological/PID cuts + if (correlation2Dhist) { + rKzeroShort.add("mass_lambda_kshort_before", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after1", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after2", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after3", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after4", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after5", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after6", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after7", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after8", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after9", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + rKzeroShort.add("mass_lambda_kshort_after10", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); + } + if (qAv0) { + // Invariant Mass + rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis}); + rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis}); + + // Topological histograms (after the selection) + rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.96f, 1.1f}}}); + rKzeroShort.add("hLT", "hLT", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); + rKzeroShort.add("Mass_lambda", "Mass under lambda hypothesis", kTH1F, {vzeroMassAxis}); + rKzeroShort.add("mass_AntiLambda", "Mass under anti-lambda hypothesis", kTH1F, {vzeroMassAxis}); + rKzeroShort.add("mass_Gamma", "Mass under Gamma hypothesis", kTH1F, {vzeroMassAxis}); + + rKzeroShort.add("rapidity", "Rapidity distribution", kTH1F, {{100, -1.0f, 1.0f}}); + rKzeroShort.add("hv0radius", "hv0radius", kTH1F, {{100, 0.0f, 200.0f}}); + rKzeroShort.add("hDCApostopv", "DCA positive daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); + rKzeroShort.add("hDCAnegtopv", "DCA negative daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); + rKzeroShort.add("hDCAv0topv", "DCA V0 to PV", kTH1F, {{60, -3.0f, 3.0f}}); + rKzeroShort.add("halpha", "Armenteros alpha", kTH1F, {{100, -5.0f, 5.0f}}); + rKzeroShort.add("hqtarmbyalpha", "qtarm/alpha", kTH1F, {{100, 0.0f, 1.0f}}); + rKzeroShort.add("hpsipair", "psi pair angle", kTH1F, {{100, -5.0f, 5.0f}}); + rKzeroShort.add("NksProduced", "Number of K0s produced", kTH1I, {{15, 0, 15}}); + } + if (qAPID) { + rKzeroShort.add("hNSigmaPosPionK0s_before", "hNSigmaPosPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); + rKzeroShort.add("hNSigmaNegPionK0s_before", "hNSigmaNegPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); + rKzeroShort.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); + } + if (qAv0daughters) { + rKzeroShort.add("negative_pt", "Negative daughter pT", kTH1F, {ptAxis}); + rKzeroShort.add("positive_pt", "Positive daughter pT", kTH1F, {ptAxis}); + rKzeroShort.add("negative_eta", "Negative daughter eta", kTH1F, {{100, -1.0f, 1.0f}}); + rKzeroShort.add("positive_eta", "Positive daughter eta", kTH1F, {{100, -1.0f, 1.0f}}); + rKzeroShort.add("negative_phi", "Negative daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); + rKzeroShort.add("positive_phi", "Positive daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); + } + if (additionalEvsel) { + fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); + fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultPVCutHigh->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); + // fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x)", 0, 100); + // fMultCutLow->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); + // fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x)", 0, 100); + // fMultCutHigh->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); + // fMultMultPVCut = new TF1("fMultMultPVCut", "[0]+[1]*x+[2]*x*x", 0, 5000); + // fMultMultPVCut->SetParameters(-0.1, 0.785, -4.7e-05); + } + } + + template + bool eventselection(Collision const& collision, float& multiplicity) + { + hvzero.fill(HIST("heventscheck"), 1.5); + + if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + return false; + } + hvzero.fill(HIST("heventscheck"), 2.5); + + if (!collision.sel8()) { + return false; + } + hvzero.fill(HIST("heventscheck"), 3.5); + + if (piluprejection && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + hvzero.fill(HIST("heventscheck"), 4.5); + + if (goodzvertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + hvzero.fill(HIST("heventscheck"), 5.5); + + if (itstpctracks && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return false; + } + hvzero.fill(HIST("heventscheck"), 6.5); + + auto multNTracksPV = collision.multNTracksPV(); + if (additionalEvsel && multNTracksPV < fMultPVCutLow->Eval(multiplicity)) { + return false; + } + hvzero.fill(HIST("heventscheck"), 7.5); + if (additionalEvsel && multNTracksPV > fMultPVCutHigh->Eval(multiplicity)) { + return false; + } + hvzero.fill(HIST("heventscheck"), 8.5); + + return true; + } + + template + bool selectionV0(Collision const& collision, V0 const& candidate, float /*multiplicity*/) + { + const float qtarm = candidate.qtarm(); + const float alph = candidate.alpha(); + float arm = qtarm / alph; + const float pT = candidate.pt(); + const float tranRad = candidate.v0radius(); + const float dcaDaughv0 = candidate.dcaV0daughters(); + const float cpav0 = candidate.v0cosPA(); + + float ctauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; + float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; + float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; + // float decayLength = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), candidate.pz()); + + if (qAv0) { + rKzeroShort.fill(HIST("hMassK0Shortbefore"), candidate.mK0Short(), candidate.pt()); + rKzeroShort.fill(HIST("hMasscorrelationbefore"), candidate.mK0Short(), candidate.mK0Short()); + rKzeroShort.fill(HIST("hLT"), ctauK0s); + rKzeroShort.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), candidate.v0cosPA()); + rKzeroShort.fill(HIST("Mass_lambda"), candidate.mLambda()); + rKzeroShort.fill(HIST("mass_AntiLambda"), candidate.mAntiLambda()); + rKzeroShort.fill(HIST("mass_Gamma"), candidate.mGamma()); + rKzeroShort.fill(HIST("rapidity"), candidate.yK0Short()); + rKzeroShort.fill(HIST("hv0radius"), candidate.v0radius()); + rKzeroShort.fill(HIST("hDCApostopv"), candidate.dcapostopv()); + rKzeroShort.fill(HIST("hDCAnegtopv"), candidate.dcanegtopv()); + rKzeroShort.fill(HIST("hDCAv0topv"), candidate.dcav0topv()); + rKzeroShort.fill(HIST("halpha"), candidate.alpha()); + rKzeroShort.fill(HIST("hqtarmbyalpha"), arm); + rKzeroShort.fill(HIST("hpsipair"), candidate.psipair()); + } + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_before"), candidate.mK0Short(), candidate.mLambda()); + + hvzero.fill(HIST("htrackscheckv0"), 0.5); + + if (cDCAv0topv && std::fabs(candidate.dcav0topv()) > cMaxV0DCA) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 1.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after1"), candidate.mK0Short(), candidate.mLambda()); + + if (rapidityks && std::abs(candidate.yK0Short()) >= confKsrapidity) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 2.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after2"), candidate.mK0Short(), candidate.mLambda()); + + if (pT < confV0PtMin) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 3.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after3"), candidate.mK0Short(), candidate.mLambda()); + + if (dcaDaughv0 > confV0DCADaughMax) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 4.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after4"), candidate.mK0Short(), candidate.mLambda()); + + if (cpav0 < confV0CPAMin) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 5.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after5"), candidate.mK0Short(), candidate.mLambda()); + + if (tranRad < confV0TranRadV0Min) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 6.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after6"), candidate.mK0Short(), candidate.mLambda()); + + if (tranRad > confV0TranRadV0Max) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 7.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after7"), candidate.mK0Short(), candidate.mLambda()); + + if (std::fabs(ctauK0s) > cMaxV0LifeTime) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 8.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after8"), candidate.mK0Short(), candidate.mLambda()); + + if (armcut && arm < confarmcut) { + return false; + } + hvzero.fill(HIST("htrackscheckv0"), 9.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after9"), candidate.mK0Short(), candidate.mLambda()); + + if (applyCompetingcut && (std::abs(candidate.mLambda() - o2::constants::physics::MassLambda0) <= competingCascrejlambda || std::abs(candidate.mAntiLambda() - o2::constants::physics::MassLambda0) <= competingCascrejlambdaanti)) { + return false; + } + + hvzero.fill(HIST("htrackscheckv0"), 10.5); + if (correlation2Dhist) + rKzeroShort.fill(HIST("mass_lambda_kshort_after10"), candidate.mK0Short(), candidate.mLambda()); + + if (qAv0) { + rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt()); + // rKzeroShort.fill(HIST("mass_lambda_kshort_after"), candidate.mK0Short(), candidate.mLambda()); + } + + if (candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) { + return false; + } + return true; + } + + template + bool isSelectedV0Daughter(T const& track, float charge, double nsigmaV0Daughter, V0s const& /*candidate*/) + { + if (qAPID) { + // Filling the PID of the V0 daughters in the region of the K0 peak. + (charge == 1) ? rKzeroShort.fill(HIST("hNSigmaPosPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()) : rKzeroShort.fill(HIST("hNSigmaNegPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()); + rKzeroShort.fill(HIST("dE_by_dx_TPC"), track.p(), track.tpcSignal()); + } + const auto eta = track.eta(); + const auto tpcNClsF = track.tpcNClsFound(); + const auto sign = track.sign(); + + hvzero.fill(HIST("htrackscheckv0daughters"), 0.5); + + if (hasTPC && !track.hasTPC()) + return false; + hvzero.fill(HIST("htrackscheckv0daughters"), 1.5); + + if (!globalTracks) { + if (track.tpcNClsCrossedRows() < tpcCrossedrows) + return false; + hvzero.fill(HIST("htrackscheckv0daughters"), 2.5); + + if (track.tpcCrossedRowsOverFindableCls() < tpcCrossedrowsOverfcls) + return false; + hvzero.fill(HIST("htrackscheckv0daughters"), 3.5); + + if (tpcNClsF < confDaughTPCnclsMin) { + return false; + } + hvzero.fill(HIST("htrackscheckv0daughters"), 4.5); + } else { + if (!track.isGlobalTrack()) + return false; + hvzero.fill(HIST("htrackscheckv0daughters"), 4.5); + } + + if (charge < 0 && sign > 0) { + return false; + } + hvzero.fill(HIST("htrackscheckv0daughters"), 5.5); + + if (charge > 0 && sign < 0) { + return false; + } + hvzero.fill(HIST("htrackscheckv0daughters"), 6.5); + + if (std::abs(eta) > confDaughEta) { + return false; + } + hvzero.fill(HIST("htrackscheckv0daughters"), 7.5); + + if (std::abs(nsigmaV0Daughter) > confDaughPIDCuts) { + return false; + } + hvzero.fill(HIST("htrackscheckv0daughters"), 8.5); + + return true; + } + + // Defining filters for events (event selection) + // Filter eventFilter = (o2::aod::evsel::sel8 == true); + + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + Filter acceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); + + // Filters on V0s + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0settingdcapostopv && + nabs(aod::v0data::dcanegtopv) > v0settingdcanegtopv); + + // Defining the type of the daughter tracks + using DaughterTracks = soa::Join; + using EventCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; + using V0TrackCandidate = aod::V0Datas; + + ROOT::Math::PxPyPzMVector daughter1, daughter2; + ROOT::Math::PxPyPzMVector protonVec, pionVec, lambdaVec; + + void processSE(EventCandidates::iterator const& collision, TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s) + { + hvzero.fill(HIST("heventscheck"), 0.5); + const double massK0s = o2::constants::physics::MassK0Short; + const double massLambda = o2::constants::physics::MassLambda; + const double massPr = o2::constants::physics::MassProton; + const double massPi = o2::constants::physics::MassPionCharged; + + float multiplicity = 0.0f; + if (cfgMultFOTM) { + multiplicity = collision.centFT0M(); + } else { + multiplicity = collision.centFT0C(); + } + if (!eventselection(collision, multiplicity)) { + return; + } + + auto occupancyno = collision.trackOccupancyInTimeRange(); + if (applyOccupancyCut && occupancyno < occupancyCut) { + return; + } + + if (qAevents) { + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + rEventSelection.fill(HIST("hmultiplicity"), multiplicity); + rEventSelection.fill(HIST("multdist_FT0M"), collision.multFT0M()); + rEventSelection.fill(HIST("multdist_FT0A"), collision.multFT0A()); + rEventSelection.fill(HIST("multdist_FT0C"), collision.multFT0C()); + rEventSelection.fill(HIST("hNcontributor"), collision.numContrib()); + } + + std::vector v0indexes; + + for (const auto& [v1, v2] : combinations(CombinationsStrictlyUpperIndexPolicy(V0s, V0s))) { + hvzero.fill(HIST("heventscheck"), 2.5); + if (v1.size() == 0 || v2.size() == 0) { + continue; + } + + if (!selectionV0(collision, v1, multiplicity)) { + continue; + } + if (!selectionV0(collision, v2, multiplicity)) { + continue; + } + + auto postrack1 = v1.template posTrack_as(); + auto negtrack1 = v1.template negTrack_as(); + + // selection for kshort + + double nTPCSigmaPosPi = postrack1.tpcNSigmaPi(); + double nTPCSigmaNegPi = negtrack1.tpcNSigmaPi(); + + if (!(isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNegPi, v1) && isSelectedV0Daughter(postrack1, 1, nTPCSigmaPosPi, v1))) { + continue; + } + + // for lamba baryon selection + + auto postrack2 = v2.template posTrack_as(); + auto negtrack2 = v2.template negTrack_as(); + + double nTPCSigmaPosPr = postrack2.tpcNSigmaPr(); + double nTPCSigmaNegPiTrk2 = negtrack2.tpcNSigmaPi(); + + double nTPCSigmaNegPr = negtrack2.tpcNSigmaPr(); + double nTPCSigmaPosPiTrk2 = postrack2.tpcNSigmaPi(); + + int lambdaTag = 0; + int alambdaTag = 0; + + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPr, v2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPiTrk2, v2)) { + lambdaTag = 1; + } + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPiTrk2, v2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPr, v2)) { + alambdaTag = 1; + } + + if (!lambdaTag && !alambdaTag) + continue; + + if (lambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPi); + } + if (alambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPi); + } + lambdaVec = protonVec + pionVec; + + TLorentzVector lv1, lv2, lv3, lvLambda, lv4, lv5; + lv1.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi(), massK0s); + lvLambda.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi(), massLambda); + lv3 = lv1 + lvLambda; + + if (qAv0daughters) { + rKzeroShort.fill(HIST("negative_pt"), negtrack1.pt()); + rKzeroShort.fill(HIST("positive_pt"), postrack1.pt()); + rKzeroShort.fill(HIST("negative_eta"), negtrack1.eta()); + rKzeroShort.fill(HIST("positive_eta"), postrack1.eta()); + rKzeroShort.fill(HIST("negative_phi"), negtrack1.phi()); + rKzeroShort.fill(HIST("positive_phi"), postrack1.phi()); + } + + daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), massK0s); // V01 + daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), massLambda); // V02 + + // polarization calculations + ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame + ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother + ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother + if (std::abs(lv3.Rapidity()) < 0.5) { + if (invMass1D) { + hvzero.fill(HIST("h1vzeropairInvMassRot"), lv3.M()); + } + + if (activateTHnSparseCosThStarHelicity) { + ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame + auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyno); + + for (int i = 0; i < cnofrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); + lv4.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi() + theta2, massLambda); // for rotated background + + lv5 = lv1 + lv4; + + hvzero.fill(HIST("h3vzeropairInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity, occupancyno); + } + + } else if (activateTHnSparseCosThStarProduction) { + ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); + auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyno); + for (int i = 0; i < cnofrotations; i++) { + + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); + + lv4.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi() + theta2, massLambda); // for rotated background + lv5 = lv1 + lv4; + hvzero.fill(HIST("h3vzeropairInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction, occupancyno); + } + } else if (activateTHnSparseCosThStarBeam) { + ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyno); + for (int i = 0; i < cnofrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); + lv4.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi() + theta2, massLambda); // for rotated background + lv5 = lv1 + lv4; + hvzero.fill(HIST("h3vzeropairInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam, occupancyno); + } + } else if (activateTHnSparseCosThStarRandom) { + auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyno); + + for (int i = 0; i < cnofrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); + lv4.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi() + theta2, massLambda); // for rotated background + lv5 = lv1 + lv4; + hvzero.fill(HIST("h3vzeropairInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom, occupancyno); + } + } + } + } + if (qAv0) { + int sizeofv0indexes = v0indexes.size(); + rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); + // std::cout << "Size of v0indexes: " << sizeofv0indexes << std::endl; + } + } + PROCESS_SWITCH(Kshortlambda, processSE, "same event process", true); + + // use any one of 3 alias depending on the dataset. If pp then FT0M and if pbpb then FTOC + using BinningTypeTPCMultiplicity = ColumnBinningPolicy; + using BinningTypeCentralityM = ColumnBinningPolicy; + using BinningTypeVertexContributor = ColumnBinningPolicy; + ConfigurableAxis mevz = {"mevz", {10, -10., 10.}, "mixed event vertex z binning"}; + ConfigurableAxis memult = {"memult", {2000, 0, 10000}, "mixed event multiplicity binning"}; + + void processME(EventCandidates const& collisions, TrackCandidates const& /*tracks*/, V0TrackCandidate const& v0s) + { + const double massK0s = o2::constants::physics::MassK0Short; + const double massLambda = o2::constants::physics::MassLambda; + const double massPr = o2::constants::physics::MassProton; + const double massPi = o2::constants::physics::MassPionCharged; + + auto tracksTuple = std::make_tuple(v0s); + BinningTypeVertexContributor binningOnPositions1{{mevz, memult}, true}; + BinningTypeCentralityM binningOnPositions2{{mevz, memult}, true}; + + SameKindPair pair1{binningOnPositions1, cfgNmixedEvents, -1, collisions, tracksTuple, &cache}; // for PbPb + SameKindPair pair2{binningOnPositions2, cfgNmixedEvents, -1, collisions, tracksTuple, &cache}; // for pp + + if (cfgMultFOTM) { + for (const auto& [c1, tracks1, c2, tracks2] : pair2) // two different centrality c1 and c2 and tracks corresponding to them + { + + float multiplicity = 0.0f; + + multiplicity = c1.centFT0M(); + + if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { + continue; + } + auto occupancyno = c1.trackOccupancyInTimeRange(); + auto occupancyno2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyno < occupancyCut || occupancyno2 < occupancyCut)) { + return; + } + + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (t1.size() == 0 || t2.size() == 0) { + continue; + } + + if (!selectionV0(c1, t1, multiplicity)) + continue; + if (!selectionV0(c2, t2, multiplicity)) + continue; + + auto postrack1 = t1.template posTrack_as(); + auto negtrack1 = t1.template negTrack_as(); + + // selection for kshort + + double nTPCSigmaPosPi = postrack1.tpcNSigmaPi(); + double nTPCSigmaNegPi = negtrack1.tpcNSigmaPi(); + + if (!(isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNegPi, t1) && isSelectedV0Daughter(postrack1, 1, nTPCSigmaPosPi, t1))) { + continue; + } + + // for lamba baryon selection + + auto postrack2 = t2.template posTrack_as(); + auto negtrack2 = t2.template negTrack_as(); + + double nTPCSigmaPosPr = postrack2.tpcNSigmaPr(); + double nTPCSigmaNegPiTrk2 = negtrack2.tpcNSigmaPi(); + + double nTPCSigmaNegPr = negtrack2.tpcNSigmaPr(); + double nTPCSigmaPosPiTrk2 = postrack2.tpcNSigmaPi(); + + int lambdaTag = 0; + int alambdaTag = 0; + + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPr, t2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPiTrk2, t2)) { + lambdaTag = 1; + } + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPiTrk2, t2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPr, t2)) { + alambdaTag = 1; + } + + if (!lambdaTag && !alambdaTag) + continue; + + if (lambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPi); + } + if (alambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPi); + } + lambdaVec = protonVec + pionVec; + + TLorentzVector lv1, lv2, lv3, lvLambda, lv4, lv5; + lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massK0s); + lvLambda.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi(), massLambda); + lv3 = lv1 + lvLambda; + ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame + ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother + ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother + if (std::abs(lv3.Rapidity()) < 0.5) { + if (activateTHnSparseCosThStarHelicity) { + ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame + auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyno); + } else if (activateTHnSparseCosThStarProduction) { + ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); + auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyno); + } else if (activateTHnSparseCosThStarBeam) { + ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyno); + } else if (activateTHnSparseCosThStarRandom) { + auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyno); + } + } + } + } + } else { + for (const auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them + { + float multiplicity = 0.0f; + multiplicity = c1.centFT0C(); + + if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { + continue; + } + auto occupancyno = c1.trackOccupancyInTimeRange(); + auto occupancyno2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyno < occupancyCut || occupancyno2 < occupancyCut)) { + return; + } + + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (t1.size() == 0 || t2.size() == 0) { + continue; + } + + if (!selectionV0(c1, t1, multiplicity)) + continue; + if (!selectionV0(c2, t2, multiplicity)) + continue; + + auto postrack1 = t1.template posTrack_as(); + auto negtrack1 = t1.template negTrack_as(); + + // selection for kshort + + double nTPCSigmaPosPi = postrack1.tpcNSigmaPi(); + double nTPCSigmaNegPi = negtrack1.tpcNSigmaPi(); + + if (!(isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNegPi, t1) && isSelectedV0Daughter(postrack1, 1, nTPCSigmaPosPi, t1))) { + continue; + } + + // for lamba baryon selection + + auto postrack2 = t2.template posTrack_as(); + auto negtrack2 = t2.template negTrack_as(); + + double nTPCSigmaPosPr = postrack2.tpcNSigmaPr(); + double nTPCSigmaNegPiTrk2 = negtrack2.tpcNSigmaPi(); + + double nTPCSigmaNegPr = negtrack2.tpcNSigmaPr(); + double nTPCSigmaPosPiTrk2 = postrack2.tpcNSigmaPi(); + + int lambdaTag = 0; + int alambdaTag = 0; + + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPr, t2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPiTrk2, t2)) { + lambdaTag = 1; + } + if (isSelectedV0Daughter(postrack2, 1, nTPCSigmaPosPiTrk2, t2) && isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNegPr, t2)) { + alambdaTag = 1; + } + + if (!lambdaTag && !alambdaTag) + continue; + + if (lambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPi); + } + if (alambdaTag) { + protonVec = ROOT::Math::PxPyPzMVector(negtrack2.px(), negtrack2.py(), negtrack2.pz(), massPr); + pionVec = ROOT::Math::PxPyPzMVector(postrack2.px(), postrack2.py(), postrack2.pz(), massPi); + } + lambdaVec = protonVec + pionVec; + + TLorentzVector lv1, lv2, lv3, lvLambda, lv4, lv5; + lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massK0s); + lvLambda.SetPtEtaPhiM(lambdaVec.pt(), lambdaVec.eta(), lambdaVec.phi(), massLambda); + lv3 = lv1 + lvLambda; + ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort + + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame + ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother + ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother + if (std::abs(lv3.Rapidity()) < 0.5) { + + if (activateTHnSparseCosThStarHelicity) { + ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame + auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyno); + } else if (activateTHnSparseCosThStarProduction) { + ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); + auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyno); + } else if (activateTHnSparseCosThStarBeam) { + ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyno); + } else if (activateTHnSparseCosThStarRandom) { + auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + hvzero.fill(HIST("h3vzeropairInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyno); + } + } + } + } + } + } + PROCESS_SWITCH(Kshortlambda, processME, "mixed event process", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From ca18cd80a7b471fb41c17f2e374f8007e3b6bcad Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Mon, 23 Dec 2024 11:52:32 +0100 Subject: [PATCH 24/28] [PWGLF] Fixed bug on mcParticles loop in phik0sanalysis.cxx (#9106) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index a68206f85e3..02c5a6970e1 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -1066,7 +1066,7 @@ struct phik0shortanalysis { std::array isCountedMCPhi{false, false, false}; - for (const auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticlesThisColl) { if (mcParticle.pdgCode() != 333) continue; auto kDaughters = mcParticle.daughters_as(); @@ -1150,7 +1150,7 @@ struct phik0shortanalysis { std::array isCountedMCPhi{false, false, false}; - for (const auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticlesThisColl) { if (mcParticle.pdgCode() != 333) continue; auto kDaughters = mcParticle.daughters_as(); From f661f3e5562bf90c2762004ce832f3bcd62c61e9 Mon Sep 17 00:00:00 2001 From: altsybee Date: Mon, 23 Dec 2024 12:04:05 +0100 Subject: [PATCH 25/28] [DPG] adding checks after ROF occupancy sel.bits (#9109) --- DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx | 136 ++++++++++++--------- 1 file changed, 75 insertions(+), 61 deletions(-) diff --git a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx index 81bf34ae73c..bdfbde3f74e 100644 --- a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx @@ -9,6 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file detectorOccupancyQa.cxx +/// \brief Occupancy QA task +/// +/// \author Igor Altsybeev + #include #include "map" @@ -33,8 +38,8 @@ #include "TH2F.h" #include "TH3.h" -using namespace o2::framework; using namespace o2; +using namespace o2::framework; using namespace o2::aod::evsel; using BCsRun2 = soa::Join; @@ -46,42 +51,44 @@ using FullTracksIU = soa::Join confAddBasicQAhistos{"AddBasicQAhistos", true, "0 - add basic histograms, 1 - skip"}; - Configurable confTimeIntervalForOccupancyCalculation{"TimeIntervalForOccupancyCalculation", 100, "Time interval for TPC occupancy calculation, us"}; - Configurable confOccupancyHistCoeffNtracksForOccupancy{"HistCoeffNtracksForOccupancy", 1., "Coefficient for max nTracks in occupancy histos"}; - Configurable confOccupancyHistCoeffNbins2D{"HistCoeffNbins2D", 1., "Coefficient for nBins in occupancy 2D histos"}; - Configurable confOccupancyHistCoeffNbins3D{"HistCoeffNbins3D", 1., "Coefficient for nBins in occupancy 3D histos"}; - Configurable confCoeffMaxNtracksThisEvent{"CoeffMaxNtracksThisEvent", 1., "Coefficient for max nTracks or FT0 ampl in histos in a given event"}; - Configurable confFlagApplyROFborderCut{"ApplyROFborderCut", true, "Use ROF border cut for a current event"}; - Configurable confFlagApplyTFborderCut{"ApplyTFborderCut", true, "Use TF border cut for a current event"}; - Configurable confFlagWhichTimeRange{"FlagWhichTimeRange", 0, "Whicn time range for occupancy calculation: 0 - symmetric, 1 - only past, 2 - only future"}; - Configurable confFlagUseGlobalTracks{"FlagUseGlobalTracks", 0, "For small time bins, use global tracks counter instead of ITSTPC tracks"}; + Configurable confAddBasicQAhistos{"AddBasicQAhistos", true, "0 - add basic histograms, 1 - skip"}; // o2-linter: disable=name/configurable + Configurable confTimeIntervalForOccupancyCalculation{"TimeIntervalForOccupancyCalculation", 100, "Time interval for TPC occupancy calculation, us"}; // o2-linter: disable=name/configurable + Configurable confOccupancyHistCoeffNtracksForOccupancy{"HistCoeffNtracksForOccupancy", 1., "Coefficient for max nTracks in occupancy histos"}; // o2-linter: disable=name/configurable + Configurable confOccupancyHistCoeffNbins2D{"HistCoeffNbins2D", 1., "Coefficient for nBins in occupancy 2D histos"}; // o2-linter: disable=name/configurable + Configurable confOccupancyHistCoeffNbins3D{"HistCoeffNbins3D", 1., "Coefficient for nBins in occupancy 3D histos"}; // o2-linter: disable=name/configurable + Configurable confCoeffMaxNtracksThisEvent{"CoeffMaxNtracksThisEvent", 1., "Coefficient for max nTracks or FT0 ampl in histos in a given event"}; // o2-linter: disable=name/configurable + Configurable confFlagApplyROFborderCut{"ApplyROFborderCut", true, "Use ROF border cut for a current event"}; // o2-linter: disable=name/configurable + Configurable confFlagApplyTFborderCut{"ApplyTFborderCut", true, "Use TF border cut for a current event"}; // o2-linter: disable=name/configurable + Configurable confFlagWhichTimeRange{"FlagWhichTimeRange", 0, "Whicn time range for occupancy calculation: 0 - symmetric, 1 - only past, 2 - only future"}; // o2-linter: disable=name/configurable + Configurable confFlagUseGlobalTracks{"FlagUseGlobalTracks", false, "For small time bins, use global tracks counter instead of ITSTPC tracks"}; // o2-linter: disable=name/configurable + Configurable confFlagUseNoCollInRofStrict{"FlagUseNoCollInRofStrict", false, "Suppress same-ROF events for occupancy historams"}; // o2-linter: disable=name/configurable + Configurable confFlagUseNoHighMultCollInPrevRof{"FlagUseNoHighMultCollInPrevRof", false, "Suppress high-multiplicity prev-ROF events for occupancy historams"}; // o2-linter: disable=name/configurable // configuration for small time binning - Configurable confTimeIntervalForSmallBins{"TimeIntervalForSmallBins", 100, "Time interval for TPC occupancy calculation in small bins, +/-, us"}; - Configurable confNumberOfSmallTimeBins{"nSmallTimeBins", 40, "Number of small time bins"}; + Configurable confTimeIntervalForSmallBins{"TimeIntervalForSmallBins", 100, "Time interval for TPC occupancy calculation in small bins, +/-, us"}; // o2-linter: disable=name/configurable + Configurable confNumberOfSmallTimeBins{"nSmallTimeBins", 40, "Number of small time bins"}; // o2-linter: disable=name/configurable // event and track cuts for given event - Configurable confCutVertZMinThisEvent{"VzMinThisEvent", -10, "vZ cut for a current event"}; - Configurable confCutVertZMaxThisEvent{"VzMaxThisEvent", 10, "vZ cut for a current event"}; - Configurable confCutPtMinThisEvent{"PtMinThisEvent", 0.2, "pt cut for particles in a current event"}; - Configurable confCutPtMaxThisEvent{"PtMaxThisEvent", 100., "pt cut for particles in a current event"}; - Configurable confCutEtaMinTracksThisEvent{"EtaMinTracksThisEvent", -0.8, "eta cut for particles in a current event"}; - Configurable confCutEtaMaxTracksThisEvent{"EtaMaxTracksThisEvent", 0.8, "eta cut for particles in a current event"}; - Configurable confCutMinTPCcls{"MinNumTPCcls", 70, "min number of TPC clusters for a current event"}; + Configurable confCutVertZMinThisEvent{"VzMinThisEvent", -10, "vZ cut for a current event"}; // o2-linter: disable=name/configurable + Configurable confCutVertZMaxThisEvent{"VzMaxThisEvent", 10, "vZ cut for a current event"}; // o2-linter: disable=name/configurable + Configurable confCutPtMinThisEvent{"PtMinThisEvent", 0.2, "pt cut for particles in a current event"}; // o2-linter: disable=name/configurable + Configurable confCutPtMaxThisEvent{"PtMaxThisEvent", 100., "pt cut for particles in a current event"}; // o2-linter: disable=name/configurable + Configurable confCutEtaMinTracksThisEvent{"EtaMinTracksThisEvent", -0.8, "eta cut for particles in a current event"}; // o2-linter: disable=name/configurable + Configurable confCutEtaMaxTracksThisEvent{"EtaMaxTracksThisEvent", 0.8, "eta cut for particles in a current event"}; // o2-linter: disable=name/configurable + Configurable confCutMinTPCcls{"MinNumTPCcls", 70, "min number of TPC clusters for a current event"}; // o2-linter: disable=name/configurable // config for QA histograms - Configurable confAddTracksVsFwdHistos{"AddTracksVsFwdHistos", true, "0 - add histograms, 1 - skip"}; - Configurable nBinsTracks{"nBinsTracks", 400, "N bins in n tracks histo"}; - Configurable nMaxTracks{"nMaxTracks", 8000, "N max in n tracks histo"}; - Configurable nMaxGlobalTracks{"nMaxGlobalTracks", 3000, "N max in n tracks histo"}; - Configurable nBinsMultFwd{"nBinsMultFwd", 400, "N bins in mult fwd histo"}; - Configurable nMaxMultFwd{"nMaxMultFwd", 200000, "N max in mult fwd histo"}; + Configurable confAddTracksVsFwdHistos{"AddTracksVsFwdHistos", true, "0 - add histograms, 1 - skip"}; // o2-linter: disable=name/configurable + Configurable nBinsTracks{"nBinsTracks", 400, "N bins in n tracks histo"}; // o2-linter: disable=name/configurable + Configurable nMaxTracks{"nMaxTracks", 8000, "N max in n tracks histo"}; // o2-linter: disable=name/configurable + Configurable nMaxGlobalTracks{"nMaxGlobalTracks", 3000, "N max in n tracks histo"}; // o2-linter: disable=name/configurable + Configurable nBinsMultFwd{"nBinsMultFwd", 400, "N bins in mult fwd histo"}; // o2-linter: disable=name/configurable + Configurable nMaxMultFwd{"nMaxMultFwd", 200000, "N max in mult fwd histo"}; // o2-linter: disable=name/configurable - Configurable nBinsOccupancy{"nBinsOccupancy", 150, "N bins for occupancy axis"}; - Configurable nMaxOccupancy{"nMaxOccupancy", 15000, "N for max of the occupancy axis"}; + Configurable nBinsOccupancy{"nBinsOccupancy", 150, "N bins for occupancy axis"}; // o2-linter: disable=name/configurable + Configurable nMaxOccupancy{"nMaxOccupancy", 15000, "N for max of the occupancy axis"}; // o2-linter: disable=name/configurable - Configurable nMaxBcInTFforAnalysis{"nMaxBcInTFforAnalysis", -1, "When to stop taking collisions in TF, if -1: take all collisions"}; + Configurable nMaxBcInTFforAnalysis{"nMaxBcInTFforAnalysis", -1, "When to stop taking collisions in TF, if -1: take all collisions"}; // o2-linter: disable=name/configurable uint64_t minGlobalBC = 0; Service ccdb; @@ -140,10 +147,10 @@ struct DetectorOccupancyQaTask { histos.add("dEdx_vs_Momentum_occupBelow200", "dE/dx", kTH2F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}}); histos.add("dEdx_vs_Momentum_occupBelow200_kNoCollStd", "dE/dx", kTH2F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}}); histos.add("dEdx_vs_Momentum_occupAbove4000", "dE/dx", kTH2F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}}); - AxisSpec axisBinsOccupStudy_dEdx{{0., 500, 1000, 2000, 4000, 6000, 8000, 15000}, "p_{T}"}; - histos.add("dEdx_vs_Momentum_vs_occup", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudy_dEdx}); - histos.add("dEdx_vs_Momentum_vs_occup_eta_02_04", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudy_dEdx}); - histos.add("dEdx_vs_Momentum_vs_occup_eta_04_02", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudy_dEdx}); + AxisSpec axisBinsOccupStudydEdx{{0., 500, 1000, 2000, 4000, 6000, 8000, 15000}, "p_{T}"}; + histos.add("dEdx_vs_Momentum_vs_occup", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudydEdx}); + histos.add("dEdx_vs_Momentum_vs_occup_eta_02_04", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudydEdx}); + histos.add("dEdx_vs_Momentum_vs_occup_eta_04_02", "dE/dx", kTH3F, {{1000, -5.0, 5.0, "#it{p}/Z (GeV/c)"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}, axisBinsOccupStudydEdx}); histos.add("dEdx_vs_centr_vs_occup_narrow_p_win", "dE/dx", kTH3F, {{20, 0, 4000, "nITStrk cls567"}, {60, 0, 15000, "occupancy"}, {800, 0.0, 800.0, "dE/dx (a. u.)"}}); @@ -165,17 +172,18 @@ struct DetectorOccupancyQaTask { histos.add("track_distr_nITStrThisEv_above_2000/hEta_highOccupInNeighbourEvents", ";#eta;n tracks", kTH1D, {{nEtaBins, -1.0, 1.0}}); const int nPhiBins = 800; - histos.add("track_distr_nITStrThisEv_10_200/hPhi_lowOccupInTPC", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInRecentPast", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInCloseFuture", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInDistantFuture", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInNeighbourEvents", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - - histos.add("track_distr_nITStrThisEv_above_2000/hPhi_lowOccupInTPC", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInRecentPast", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInCloseFuture", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInDistantFuture", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); - histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInNeighbourEvents", ";#varphi;n tracks", kTH1D, {{nPhiBins, 0, TMath::TwoPi()}}); + AxisSpec axisPhi{nPhiBins, 0, TMath::TwoPi(), "#varphi"}; // o2-linter: disable=external-pi + histos.add("track_distr_nITStrThisEv_10_200/hPhi_lowOccupInTPC", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInRecentPast", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInCloseFuture", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInDistantFuture", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInNeighbourEvents", ";#varphi;n tracks", kTH1D, {axisPhi}); + + histos.add("track_distr_nITStrThisEv_above_2000/hPhi_lowOccupInTPC", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInRecentPast", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInCloseFuture", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInDistantFuture", ";#varphi;n tracks", kTH1D, {axisPhi}); + histos.add("track_distr_nITStrThisEv_above_2000/hPhi_highOccupInNeighbourEvents", ";#varphi;n tracks", kTH1D, {axisPhi}); // const int nPtBins = 800; AxisSpec axisLogPt{200, 0.05, 40, "p_{T}"}; @@ -393,7 +401,7 @@ struct DetectorOccupancyQaTask { const double timeWinOccupancyCalcNS = confTimeIntervalForOccupancyCalculation * 1e3; // ns, to be compared with TPC drift time const double bcNS = o2::constants::lhc::LHCBunchSpacingNS; - for (auto& col : cols) { + for (const auto& col : cols) { const auto& bc = col.foundBC_as(); // count tracks of different types @@ -405,7 +413,7 @@ struct DetectorOccupancyQaTask { int nTOFtracks = 0; // int nTRDtracks = 0; auto tracksGrouped = tracks.sliceBy(perCollision, col.globalIndex()); - for (auto& track : tracksGrouped) { + for (const auto& track : tracksGrouped) { if (!track.isPVContributor()) { continue; } @@ -450,8 +458,8 @@ struct DetectorOccupancyQaTask { vTracksITSTPCperCollPtEtaCuts[colIndex] += nITSTPCtracksPtEtaCuts; // TF ids within a given cols table - int TFid = (bc.globalBC() - bcSOR) / nBCsPerTF; - vTFids[colIndex] = TFid; + int tfId = (bc.globalBC() - bcSOR) / nBCsPerTF; + vTFids[colIndex] = tfId; // check that this collision has full information inside the time window (taking into account TF borders) int64_t bcInTF = (bc.globalBC() - bcSOR) % nBCsPerTF; @@ -465,7 +473,7 @@ struct DetectorOccupancyQaTask { // find for each collision all collisions within the defined time window std::vector> vCollsInTimeWin; std::vector> vTimeDeltaForColls; // delta time wrt a given collision - for (auto& col : cols) { + for (const auto& col : cols) { int32_t colIndex = col.globalIndex(); std::vector vCollsAssocToGivenColl; std::vector vCollsTimeDeltaWrtGivenColl; @@ -478,7 +486,7 @@ struct DetectorOccupancyQaTask { } int64_t foundGlobalBC = vFoundGlobalBC[colIndex]; - int64_t TFid = (foundGlobalBC - bcSOR) / nBCsPerTF; + int64_t tfId = (foundGlobalBC - bcSOR) / nBCsPerTF; // find all collisions in time window before the current one (start with the current collision) int32_t minColIndex = colIndex; @@ -486,8 +494,8 @@ struct DetectorOccupancyQaTask { int64_t thisBC = vFoundGlobalBC[minColIndex]; // check if this is still the same TF - int64_t thisTFid = (thisBC - bcSOR) / nBCsPerTF; - if (thisTFid != TFid) + int64_t thisTfId = (thisBC - bcSOR) / nBCsPerTF; + if (thisTfId != tfId) break; float dt = (thisBC - foundGlobalBC) * bcNS; // ns @@ -507,8 +515,8 @@ struct DetectorOccupancyQaTask { int32_t maxColIndex = colIndex + 1; while (maxColIndex < cols.size() && confFlagWhichTimeRange != 1) { int64_t thisBC = vFoundGlobalBC[maxColIndex]; - int64_t thisTFid = (thisBC - bcSOR) / nBCsPerTF; - if (thisTFid != TFid) + int64_t thisTfId = (thisBC - bcSOR) / nBCsPerTF; + if (thisTfId != tfId) break; float dt = (thisBC - foundGlobalBC) * bcNS; // ns @@ -526,7 +534,7 @@ struct DetectorOccupancyQaTask { // perform the occupancy calculation in the pre-defined time window uint32_t orbitAtCollIndexZero = 0; - for (auto& col : cols) { + for (const auto& col : cols) { int32_t colIndex = col.globalIndex(); // protection against the TF borders @@ -581,7 +589,7 @@ struct DetectorOccupancyQaTask { float thisColTimeDiff = vCollsTimeDeltaWrtGivenColl[iCol] / 1e3; // ns -> us // fill this-event time bins - if (thisColIndex != colIndex && fabs(thisColTimeDiff) < confTimeIntervalForSmallBins) { + if (thisColIndex != colIndex && std::fabs(thisColTimeDiff) < confTimeIntervalForSmallBins) { LOGP(debug, " iCol={}/{}, thisColIndex={}, colIndex={}, thisColTimeDiff={} nITS={}", iCol, vCollsAssocToGivenColl.size(), thisColIndex, colIndex, thisColTimeDiff, vTracksITS567perColl[thisColIndex]); histos.fill(HIST("thisEventITStracksInTimeBins"), thisColTimeDiff, vTracksITS567perColl[thisColIndex]); histos.fill(HIST("thisEventFT0CInTimeBins"), thisColTimeDiff, vAmpFT0CperColl[thisColIndex]); @@ -643,7 +651,7 @@ struct DetectorOccupancyQaTask { histos.fill(HIST("hNumITSTPC_vs_ITS567tracksThisCol_vs_ITS567tracksInTimeWindow_BEFORE_sel"), vTracksITS567perCollPtEtaCuts[colIndex], vTracksITSTPCperCollPtEtaCuts[colIndex], nITS567tracksInTimeWindow - vTracksITS567perColl[colIndex]); histos.fill(HIST("hNumITSTPC_vs_ITS567tracksThisCol_vs_FT0CamplInTimeWindow_BEFORE_sel"), vTracksITS567perCollPtEtaCuts[colIndex], vTracksITSTPCperCollPtEtaCuts[colIndex], multFT0CInTimeWindow - multFT0CmainCollision); - if (sel && fabs(col.posZ()) < 10) { + if (sel && std::fabs(col.posZ()) < 10) { histos.fill(HIST("hNumITS567tracksInTimeWindowSel"), nITS567tracksInTimeWindowSel); histos.fill(HIST("hNumITSTPCtracksInTimeWindowSel"), nITSTPCtracksInTimeWindowSel); @@ -720,7 +728,13 @@ struct DetectorOccupancyQaTask { histos.fill(HIST("occupancyInTimeBins_BEFORE_sel"), dt, vTracksITS567perCollPtEtaCuts[colIndex], confFlagUseGlobalTracks ? vTracksGlobalPerCollPtEtaCuts[colIndex] : vTracksITSTPCperCollPtEtaCuts[colIndex], nITStrInTimeBin); histos.fill(HIST("occupancyInTimeBins_occupByFT0_BEFORE_sel"), dt, vTracksITS567perCollPtEtaCuts[colIndex], confFlagUseGlobalTracks ? vTracksGlobalPerCollPtEtaCuts[colIndex] : vTracksITSTPCperCollPtEtaCuts[colIndex], nFT0CInTimeBin); - if (sel && fabs(col.posZ()) < 10) { + bool flagFillOccupVsDt = true; + if (confFlagUseNoCollInRofStrict && !col.selection_bit(kNoCollInRofStrict)) + flagFillOccupVsDt = false; + if (confFlagUseNoHighMultCollInPrevRof && !col.selection_bit(kNoHighMultCollInPrevRof)) + flagFillOccupVsDt = false; + + if (sel && std::fabs(col.posZ()) < 10 && flagFillOccupVsDt) { histos.fill(HIST("occupancyInTimeBins"), dt, vTracksITS567perCollPtEtaCuts[colIndex], confFlagUseGlobalTracks ? vTracksGlobalPerCollPtEtaCuts[colIndex] : vTracksITSTPCperCollPtEtaCuts[colIndex], nITStrInTimeBin); histos.fill(HIST("occupancyInTimeBins_occupByFT0"), dt, vTracksITS567perCollPtEtaCuts[colIndex], confFlagUseGlobalTracks ? vTracksGlobalPerCollPtEtaCuts[colIndex] : vTracksITSTPCperCollPtEtaCuts[colIndex], nFT0CInTimeBin); @@ -760,7 +774,7 @@ struct DetectorOccupancyQaTask { } // end of occupancy calculation // ### occupancy event selection QA - for (auto& col : cols) { + for (const auto& col : cols) { // if (!col.sel8()) { // continue; // } @@ -789,7 +803,7 @@ struct DetectorOccupancyQaTask { int occupancy = col.trackOccupancyInTimeRange(); auto tracksGrouped = tracks.sliceBy(perCollision, col.globalIndex()); - for (auto& track : tracksGrouped) { + for (const auto& track : tracksGrouped) { if (!track.isPVContributor()) continue; if (track.pt() < confCutPtMinThisEvent || track.pt() > confCutPtMaxThisEvent) @@ -870,7 +884,7 @@ struct DetectorOccupancyQaTask { } } - for (auto& track : tracksGrouped) { + for (const auto& track : tracksGrouped) { if (!track.isPVContributor()) continue; if (track.itsNCls() < 5) From 91a81f0df1b0512b2da22ce238ca44e4ccc22851 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 23 Dec 2024 20:59:42 +0900 Subject: [PATCH 26/28] [PWGEM/Dilepton] update event QC task (#9111) --- PWGEM/Dilepton/Tasks/createResolutionMap.cxx | 28 +-- PWGEM/Dilepton/Tasks/eventQC.cxx | 195 ++++++++++++++++-- .../TableProducer/photonconversionbuilder.cxx | 14 +- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 6 +- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 6 +- 5 files changed, 208 insertions(+), 41 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index 8239a89a704..fcffa3a2ba6 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -92,8 +92,9 @@ struct CreateResolutionMap { Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; Configurable cfg_min_tpc_cr_findable_ratio{"cfg_min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.3, "max dca XY for single track in cm"}; + Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.3, "max dca Z for single track in cm"}; Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", false, "flag to require ITS ib 1st hit"}; } electroncuts; @@ -135,6 +136,7 @@ struct CreateResolutionMap { const AxisSpec axis_dpt{ConfRelDeltaPtBins, "(p_{T,l}^{gen} - p_{T,l}^{rec})/p_{T,l}^{gen}"}; const AxisSpec axis_deta{ConfDeltaEtaBins, "#eta_{l}^{gen} - #eta_{l}^{rec}"}; const AxisSpec axis_dphi{ConfDeltaPhiBins, "#varphi_{l}^{gen} - #varphi_{l}^{rec} (rad.)"}; + const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true sign"}; registry.add("Electron/Ptgen_RelDeltaPt", "resolution", kTH2F, {{axis_pt_gen}, {axis_dpt}}, true); registry.add("Electron/Ptgen_DeltaEta", "resolution", kTH2F, {{axis_pt_gen}, {axis_deta}}, true); @@ -143,12 +145,9 @@ struct CreateResolutionMap { registry.addClone("Electron/", "StandaloneMuon/"); registry.addClone("Electron/", "GlobalMuon/"); - registry.add("Electron/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); - registry.add("StandaloneMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); - registry.add("GlobalMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); - registry.add("Electron/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); - registry.add("StandaloneMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); - registry.add("GlobalMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("Electron/hs_reso", "7D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_charge_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("StandaloneMuon/hs_reso", "7D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_charge_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("GlobalMuon/hs_reso", "7D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_charge_gen, axis_dpt, axis_deta, axis_dphi}, true); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -210,6 +209,10 @@ struct CreateResolutionMap { return false; } + if (track.tpcFractionSharedCls() > electroncuts.cfg_max_frac_shared_clusters_tpc) { + return false; + } + return true; } @@ -313,24 +316,22 @@ struct CreateResolutionMap { auto mctrack = muon.template mcParticle_as(); if (muon.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) { + registry.fill(HIST("StandaloneMuon/hs_reso"), mctrack.pt(), mctrack.eta(), mctrack.phi(), -mctrack.pdgCode() / 13, (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); registry.fill(HIST("StandaloneMuon/Ptgen_RelDeltaPt"), mctrack.pt(), (mctrack.pt() - pt) / mctrack.pt()); registry.fill(HIST("StandaloneMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); - registry.fill(HIST("StandaloneMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); - registry.fill(HIST("StandaloneMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } else if (muon.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { + registry.fill(HIST("GlobalMuon/hs_reso"), mctrack.pt(), mctrack.eta(), mctrack.phi(), -mctrack.pdgCode() / 13, (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); registry.fill(HIST("GlobalMuon/Ptgen_RelDeltaPt"), mctrack.pt(), (mctrack.pt() - pt) / mctrack.pt()); registry.fill(HIST("GlobalMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); - registry.fill(HIST("GlobalMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); - registry.fill(HIST("GlobalMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } return true; @@ -380,14 +381,13 @@ struct CreateResolutionMap { continue; } + registry.fill(HIST("Electron/hs_reso"), mctrack.pt(), mctrack.eta(), mctrack.phi(), -mctrack.pdgCode() / 11, (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); registry.fill(HIST("Electron/Ptgen_RelDeltaPt"), mctrack.pt(), (mctrack.pt() - track.pt()) / mctrack.pt()); registry.fill(HIST("Electron/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - track.eta()); if (mctrack.pdgCode() == -11) { // positron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - track.phi()); - registry.fill(HIST("Electron/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } else if (mctrack.pdgCode() == 11) { // electron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - track.phi()); - registry.fill(HIST("Electron/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } } // end of track loop diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index 2eba04f72a3..d12876de86c 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include "TString.h" #include "Framework/runDataProcessing.h" @@ -33,6 +34,8 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" #include "CCDB/BasicCCDBManager.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" using namespace o2; using namespace o2::aod; @@ -111,6 +114,24 @@ struct eventQC { Configurable cfg_requireTOF{"cfg_requireTOF", false, "require TOF hit"}; } trackcuts; + struct : ConfigurableGroup { + std::string prefix = "v0cut_group"; + Configurable cfg_min_mass_k0s{"cfg_min_mass_k0s", 0.49, "min mass for K0S"}; + Configurable cfg_max_mass_k0s{"cfg_max_mass_k0s", 0.50, "max mass for K0S"}; + Configurable cfg_min_cospa_k0s{"cfg_min_cospa_k0s", 0.999, "min mass for K0S"}; + Configurable cfg_max_v0dau_k0s{"cfg_max_v0dau_k0s", 1.0, "max mass for K0S"}; + Configurable cfg_min_cr2findable_ratio_tpc{"cfg_min_cr2findable_ratio_tpc", 0.8, "min. TPC Ncr/Nf ratio"}; + Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + Configurable cfg_min_ncrossedrows_tpc{"cfg_min_ncrossedrows_tpc", 40, "min ncrossed rows"}; + Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -1e+10, "min n sigma e in TPC"}; + Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +1e+10, "max n sigma e in TPC"}; + Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min n sigma pi in TPC"}; + Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +1e+10, "max n sigma pi in TPC"}; + } v0cuts; + Service ccdb; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -123,6 +144,9 @@ struct eventQC { ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); addhistograms(); + if (doprocessEventQC_V0_PID) { + addV0histograms(); + } } ~eventQC() {} @@ -260,14 +284,14 @@ struct eventQC { fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); if (cfgFillPID) { - fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{pv} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); fRegistry.add("Track/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/hTPCNsigmaEl", "TPC n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTPCNsigmaMu", "TPC n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTPCNsigmaPi", "TPC n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTPCNsigmaKa", "TPC n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTPCNsigmaPr", "TPC n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); @@ -276,6 +300,28 @@ struct eventQC { } } + void addV0histograms() + { + fRegistry.add("V0/hAP", "AP plot", kTH2F, {{200, -1, +1}, {250, 0, 0.25}}, false); + fRegistry.add("V0/hPCA", "distance between 2 legs", kTH1F, {{200, 0, 2}}, false); + fRegistry.add("V0/hCosPA", "cos pointing angle", kTH1F, {{100, 0.99, 1}}, false); + + fRegistry.add("V0/K0S/hMass", "mass vs. p_{T}", kTH2F, {{200, 0.4, 0.6}, {100, 0, 10}}, false); + fRegistry.add("V0/K0S/Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("V0/K0S/Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {200, -10, +10}}, false); + fRegistry.add("V0/K0S/Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {200, -10, +10}}, false); + + fRegistry.add("V0/Photon/hMass", "mass vs. p_{T}", kTH2F, {{100, 0, 0.1}, {100, 0, 10}}, false); + fRegistry.add("V0/Photon/hXY", "photon conversion point;X (cm);Y(cm)", kTH2F, {{400, -100, +100}, {400, -100, 100}}, false); + fRegistry.add("V0/Photon/Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("V0/Photon/Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {200, -10, +10}}, false); + fRegistry.add("V0/Photon/Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {200, -10, +10}}, false); + + // // extra info. Not important + // fRegistry.add("V0/Lambda/hMass", "mass vs. p_{T}", kTH2F, {{100, 1.08, 1.18}, {100, 0, 10}}, false); + // fRegistry.add("V0/AntiLambda/hMass", "mass vs. p_{T}", kTH2F, {{100, 1.08, 1.18}, {100, 0, 10}}, false); + } + template void fillTrackInfo(TTrack const& track) { @@ -303,14 +349,14 @@ struct eventQC { for (int il = 0; il < 7; il++) { nsize += track.itsClsSizeInLayer(il); } - fRegistry.fill(HIST("Track/hTPCdEdx"), track.p(), track.tpcSignal()); + fRegistry.fill(HIST("Track/hTPCdEdx"), track.tpcInnerParam(), track.tpcSignal()); fRegistry.fill(HIST("Track/hTOFbeta"), track.p(), track.beta()); fRegistry.fill(HIST("Track/hMeanClusterSizeITS"), track.p(), static_cast(nsize) / static_cast(track.itsNCls()) * std::cos(std::atan(track.tgl()))); - fRegistry.fill(HIST("Track/hTPCNsigmaEl"), track.p(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/hTPCNsigmaMu"), track.p(), track.tpcNSigmaMu()); - fRegistry.fill(HIST("Track/hTPCNsigmaPi"), track.p(), track.tpcNSigmaPi()); - fRegistry.fill(HIST("Track/hTPCNsigmaKa"), track.p(), track.tpcNSigmaKa()); - fRegistry.fill(HIST("Track/hTPCNsigmaPr"), track.p(), track.tpcNSigmaPr()); + fRegistry.fill(HIST("Track/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); + fRegistry.fill(HIST("Track/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + fRegistry.fill(HIST("Track/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); + fRegistry.fill(HIST("Track/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); + fRegistry.fill(HIST("Track/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); fRegistry.fill(HIST("Track/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); @@ -600,6 +646,40 @@ struct eventQC { return true; } + template + bool isSelectedV0Leg(TTrack const& track) + { + if (!track.hasTPC()) { + return false; + } + + if (track.hasITS() && track.itsChi2NCl() > v0cuts.cfg_max_chi2its) { + return false; + } + + if (track.tpcChi2NCl() > v0cuts.cfg_max_chi2tpc) { + return false; + } + + if (track.tpcNClsFound() < v0cuts.cfg_min_ncluster_tpc) { + return false; + } + + if (track.tpcNClsCrossedRows() < v0cuts.cfg_min_ncrossedrows_tpc) { + return false; + } + + if (track.tpcCrossedRowsOverFindableCls() < v0cuts.cfg_min_cr2findable_ratio_tpc) { + return false; + } + + if (track.tpcFractionSharedCls() > v0cuts.cfg_max_frac_shared_clusters_tpc) { + return false; + } + + return true; + } + template bool isSelectedEvent(TCollision const& collision) { @@ -677,9 +757,11 @@ struct eventQC { SliceCache cache; Preslice perCol = o2::aod::track::collisionId; + Preslice perCol_pcm = o2::aod::v0photonkf::collisionId; + Preslice perCol_v0 = o2::aod::v0data::collisionId; - template - void processQC(TCollisions const& collisions, FilteredMyTracks const& tracks) + template + void runQC(TCollisions const& collisions, TTracks const& tracks, TV0Photons const& v0photons, TV0Legs const&, TV0StrHadrons const& v0strhadrons) { for (auto& collision : collisions) { const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; @@ -732,11 +814,92 @@ struct eventQC { fRegistry.fill(HIST("Event/after/hCentFT0CvsMultNGlobalTracks"), collision.centFT0C(), nGlobalTracks); fRegistry.fill(HIST("Event/after/hCentFT0CvsMultNGlobalTracksPV"), collision.centFT0C(), nGlobalTracksPV); } + + // for V0 PID + if constexpr (doV0s) { + auto v0photons_per_coll = v0photons.sliceBy(perCol_pcm, collision.globalIndex()); + auto v0hadrons_per_coll = v0strhadrons.sliceBy(perCol_v0, collision.globalIndex()); + // LOGF(info, "v0photons_per_coll.size() = %d, v0hadrons_per_coll.size() = %d", v0photons_per_coll.size(), v0hadrons_per_coll.size()); + + for (auto& v0hadron : v0hadrons_per_coll) { + fRegistry.fill(HIST("V0/hAP"), v0hadron.alpha(), v0hadron.qtarm()); + fRegistry.fill(HIST("V0/hPCA"), v0hadron.dcaV0daughters()); + fRegistry.fill(HIST("V0/hCosPA"), v0hadron.v0cosPA()); + + fRegistry.fill(HIST("V0/K0S/hMass"), v0hadron.mK0Short(), v0hadron.pt()); + if (v0cuts.cfg_min_mass_k0s < v0hadron.mK0Short() && v0hadron.mK0Short() < v0cuts.cfg_max_mass_k0s) { + if (v0hadron.dcaV0daughters() > v0cuts.cfg_max_v0dau_k0s || v0hadron.v0cosPA() < v0cuts.cfg_min_cospa_k0s) { + continue; + } + + auto pos = v0hadron.template posTrack_as(); + auto neg = v0hadron.template negTrack_as(); + if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg)) { + continue; + } + if (pos.tpcNSigmaPi() < v0cuts.cfg_min_TPCNsigmaPi || v0cuts.cfg_max_TPCNsigmaPi < pos.tpcNSigmaPi()) { + continue; + } + if (neg.tpcNSigmaPi() < v0cuts.cfg_min_TPCNsigmaPi || v0cuts.cfg_max_TPCNsigmaPi < neg.tpcNSigmaPi()) { + continue; + } + + fRegistry.fill(HIST("V0/K0S/Track/hTPCdEdx"), pos.tpcInnerParam(), pos.tpcSignal()); + fRegistry.fill(HIST("V0/K0S/Track/hTPCdEdx"), neg.tpcInnerParam(), neg.tpcSignal()); + fRegistry.fill(HIST("V0/K0S/Track/hTPCNsigmaEl"), pos.tpcInnerParam(), pos.tpcNSigmaEl()); + fRegistry.fill(HIST("V0/K0S/Track/hTPCNsigmaPi"), pos.tpcInnerParam(), pos.tpcNSigmaPi()); + fRegistry.fill(HIST("V0/K0S/Track/hTPCNsigmaEl"), neg.tpcInnerParam(), neg.tpcNSigmaEl()); + fRegistry.fill(HIST("V0/K0S/Track/hTPCNsigmaPi"), neg.tpcInnerParam(), neg.tpcNSigmaPi()); + } + } // end of v0hadron loop + + for (auto& v0photon : v0photons_per_coll) { + fRegistry.fill(HIST("V0/Photon/hMass"), v0photon.mGamma(), v0photon.pt()); + fRegistry.fill(HIST("V0/Photon/hXY"), v0photon.vx(), v0photon.vy()); + auto pos = v0photon.template posTrack_as(); + auto neg = v0photon.template negTrack_as(); + if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg)) { + continue; + } + if (pos.tpcNSigmaEl() < v0cuts.cfg_min_TPCNsigmaEl || v0cuts.cfg_max_TPCNsigmaEl < pos.tpcNSigmaEl()) { + continue; + } + if (neg.tpcNSigmaEl() < v0cuts.cfg_min_TPCNsigmaEl || v0cuts.cfg_max_TPCNsigmaEl < neg.tpcNSigmaEl()) { + continue; + } + fRegistry.fill(HIST("V0/Photon/Track/hTPCdEdx"), pos.tpcInnerParam(), pos.tpcSignal()); + fRegistry.fill(HIST("V0/Photon/Track/hTPCdEdx"), neg.tpcInnerParam(), neg.tpcSignal()); + fRegistry.fill(HIST("V0/Photon/Track/hTPCNsigmaEl"), pos.tpcInnerParam(), pos.tpcNSigmaEl()); + fRegistry.fill(HIST("V0/Photon/Track/hTPCNsigmaPi"), pos.tpcInnerParam(), pos.tpcNSigmaPi()); + fRegistry.fill(HIST("V0/Photon/Track/hTPCNsigmaEl"), neg.tpcInnerParam(), neg.tpcNSigmaEl()); + fRegistry.fill(HIST("V0/Photon/Track/hTPCNsigmaPi"), neg.tpcInnerParam(), neg.tpcNSigmaPi()); + } // end of v0photon loop + + } // end of V0 PID } // end of collision loop } // end of process - PROCESS_SWITCH_FULL(eventQC, processQC, processEventQC, "event QC", true); - PROCESS_SWITCH_FULL(eventQC, processQC, processEventQC_Cent_Qvec, "event QC + q vector", false); + void processEventQC(FilteredMyCollisions const& collisions, FilteredMyTracks const& tracks) + { + runQC(collisions, tracks, nullptr, nullptr, nullptr); + } + PROCESS_SWITCH(eventQC, processEventQC, "event QC", true); + + void processEventQC_Cent_Qvec(FilteredMyCollisions_Qvec const& collisions, FilteredMyTracks const& tracks) + { + runQC(collisions, tracks, nullptr, nullptr, nullptr); + } + PROCESS_SWITCH(eventQC, processEventQC_Cent_Qvec, "event QC + q vector", false); + + //! type of V0. 0: built solely for cascades (does not pass standard V0 cuts), 1: standard 2, 3: photon-like with TPC-only use. Regular analysis should always use type 1. + Filter v0Filter = o2::aod::v0data::v0Type == uint8_t(1); + using filteredV0s = soa::Filtered; + + void processEventQC_V0_PID(FilteredMyCollisions const& collisions, FilteredMyTracks const& tracks, aod::V0PhotonsKF const& v0photons, aod::V0Legs const& v0legs, filteredV0s const& v0strhadrons) + { + runQC(collisions, tracks, v0photons, v0legs, v0strhadrons); + } + PROCESS_SWITCH(eventQC, processEventQC_V0_PID, "event QC + V0 PID", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 571c92c906a..b667eadb549 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -99,6 +99,7 @@ struct PhotonConversionBuilder { Configurable maxpt_itsonly{"maxpt_itsonly", 0.15, "max pT for ITSonly tracks at SV"}; Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 4.0, "max. TPC n sigma for electron"}; Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -4.0, "min. TPC n sigma for electron"}; + Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; Configurable dcanegtopv{"dcanegtopv", 0.1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", 0.1, "DCA Pos To PV"}; Configurable min_pt_leg_at_sv{"min_pt_leg_at_sv", 0.0, "min pT for v0 legs at SV"}; // this is obsolete. @@ -125,7 +126,7 @@ struct PhotonConversionBuilder { Configurable max_eta_v0{"max_eta_v0", 0.9, "max eta for v0 photons at PV"}; Configurable kfMassConstrain{"kfMassConstrain", -1.f, "mass constrain for the KFParticle mother particle"}; Configurable max_r_req_its{"max_r_req_its", 16.0, "max Rxy for V0 with ITS hits"}; - Configurable min_r_tpconly{"min_r_tpconly", 36.0, "min Rxy for V0 with TPConly tracks"}; + Configurable min_r_tpconly{"min_r_tpconly", 32.0, "min Rxy for V0 with TPConly tracks"}; Configurable max_r_itsmft_ss{"max_r_itsmft_ss", 66.0, "max Rxy for ITS/MFT SS"}; Configurable max_dcatopv_xy_v0{"max_dcatopv_xy_v0", +1e+10, "max. DCAxy to PV for V0"}; Configurable max_dcatopv_z_v0{"max_dcatopv_z_v0", +1e+10, "max. DCAz to PV for V0"}; @@ -149,10 +150,10 @@ struct PhotonConversionBuilder { {"V0/hConversionPointRZ", "conversion point in RZ;Z (cm);R_{xy} (cm)", {HistType::kTH2F, {{200, -100.0f, 100.0f}, {200, 0.f, 100.f}}}}, {"V0/hPt", "pT of V0 at PV;p_{T,#gamma} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}}, {"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, 2 * M_PI}, {200, -1, +1}}}}, - {"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.9f, 1.f}}}}, - {"V0/hCosPA_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.9f, 1.f}}}}, - {"V0/hCosPAXY_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.9f, 1.f}}}}, - {"V0/hCosPARZ_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.9f, 1.f}}}}, + {"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.99f, 1.f}}}}, + {"V0/hCosPA_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}}, + {"V0/hCosPAXY_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}}, + {"V0/hCosPARZ_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}}, {"V0/hPCA", "distance between 2 legs at SV;PCA (cm)", {HistType::kTH1F, {{500, 0.0f, 5.f}}}}, {"V0/hPCA_Rxy", "distance between 2 legs at SV;R_{xy} (cm);PCA (cm)", {HistType::kTH2F, {{200, 0, 100}, {500, 0.0f, 5.f}}}}, {"V0/hPCA_CosPA", "distance between 2 legs at SV vs. cosPA;cosine of pointing angle;PCA (cm)", {HistType::kTH2F, {{100, 0.9, 1}, {500, 0.0f, 5.f}}}}, @@ -299,6 +300,9 @@ struct PhotonConversionBuilder { if (track.tpcNClsCrossedRows() < mincrossedrows || track.tpcChi2NCl() > maxchi2tpc) { return false; } + if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) { + return false; + } if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { return false; } diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 023189b3f4d..e593e69e52f 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -136,11 +136,11 @@ struct PCMQC { fRegistry.add("V0/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); fRegistry.add("V0/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); - fRegistry.add("V0/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.9f, 1.0f}}, false); - fRegistry.add("V0/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.9f, 1.0f}}, false); + fRegistry.add("V0/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false); + fRegistry.add("V0/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false); fRegistry.add("V0/hPCA", "distance between 2 legs;PCA (cm)", kTH1F, {{500, 0.0f, 5.0f}}, false); fRegistry.add("V0/hPCA_Rxy", "distance between 2 legs vs. R_{xy};R_{xy} (cm);PCA (cm)", kTH2F, {{200, 0.f, 100.f}, {500, 0.0f, 5.0f}}, false); - fRegistry.add("V0/hPCA_CosPA", "distance between 2 legs vs. cosPA;cosine of pointing angle;PCA (cm)", kTH2F, {{100, 0.9f, 1.f}, {500, 0.0f, 5.0f}}, false); + fRegistry.add("V0/hPCA_CosPA", "distance between 2 legs vs. cosPA;cosine of pointing angle;PCA (cm)", kTH2F, {{100, 0.99f, 1.f}, {500, 0.0f, 5.0f}}, false); fRegistry.add("V0/hDCAxyz", "DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -5.f, +5.f}, {200, -5.f, +5.f}}, false); fRegistry.add("V0/hAPplot", "AP plot;#alpha;q_{T} (GeV/c)", kTH2F, {{200, -1.0f, +1.0f}, {250, 0.0f, 0.25f}}, false); fRegistry.add("V0/hMassGamma", "hMassGamma;R_{xy} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{200, 0.0f, 100.0f}, {100, 0.0f, 0.1f}}, false); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index 27f2a4e6e14..6005a6afbdc 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -178,11 +178,11 @@ struct PCMQCMC { fRegistry.add("V0/primary/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); fRegistry.add("V0/primary/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); - fRegistry.add("V0/primary/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.9f, 1.0f}}, false); - fRegistry.add("V0/primary/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.9f, 1.0f}}, false); + fRegistry.add("V0/primary/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false); + fRegistry.add("V0/primary/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false); fRegistry.add("V0/primary/hPCA", "distance between 2 legs;PCA (cm)", kTH1F, {{500, 0.0f, 5.0f}}, false); fRegistry.add("V0/primary/hPCA_Rxy", "distance between 2 legs vs. R_{xy};R_{xy} (cm);PCA (cm)", kTH2F, {{200, 0.f, 100.f}, {500, 0.0f, 5.0f}}, false); - fRegistry.add("V0/primary/hPCA_CosPA", "distance between 2 legs vs. cosPA;cosine of pointing angle;PCA (cm)", kTH2F, {{100, 0.9f, 1.f}, {500, 0.0f, 5.0f}}, false); + fRegistry.add("V0/primary/hPCA_CosPA", "distance between 2 legs vs. cosPA;cosine of pointing angle;PCA (cm)", kTH2F, {{100, 0.99f, 1.f}, {500, 0.0f, 5.0f}}, false); fRegistry.add("V0/primary/hDCAxyz", "DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -5.f, +5.f}, {200, -5.f, +5.f}}, false); fRegistry.add("V0/primary/hAPplot", "AP plot;#alpha;q_{T} (GeV/c)", kTH2F, {{200, -1.0f, +1.0f}, {250, 0.0f, 0.25f}}, false); fRegistry.add("V0/primary/hMassGamma", "hMassGamma;R_{xy} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{200, 0.0f, 100.0f}, {100, 0.0f, 0.1f}}, false); From 1f81fecd34e9aa3cc883d45852eed5424084c3cc Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 23 Dec 2024 22:06:44 +0900 Subject: [PATCH 27/28] [PWGEM/Dilepton] update norm in dilepton task (#9112) --- PWGEM/Dilepton/Core/Dilepton.h | 9 ++- PWGEM/Dilepton/Tasks/eventQC.cxx | 103 ++++++++++++++++--------------- 2 files changed, 61 insertions(+), 51 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 949f6efcb5d..db7016e79a3 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -1492,9 +1492,16 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false); - void processNorm(aod::EMEventNormInfos const& collisions) + Filter collisionFilter_centrality_norm = cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax; + using FilteredNormInfos = soa::Filtered; + + void processNorm(FilteredNormInfos const& collisions) { for (auto& collision : collisions) { + if (collision.centFT0C() < cfgCentMin || cfgCentMax < collision.centFT0C()) { + continue; + } + fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 2.0); diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index d12876de86c..f7b7784d2e3 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -198,51 +198,6 @@ struct eventQC { fRegistry.add("Event/after/hCentFT0CvsMultNGlobalTracksPV", "hCentFT0CvsMultNGlobalTracksPV;centrality FT0C (%);N_{track}^{global} to PV", kTH2F, {{100, 0, 100}, {600, 0, 6000}}, false); fRegistry.add("Event/after/hMultFT0CvsMultNGlobalTracksPV", "hMultFT0CvsMultNGlobalTracksPV;mult. FT0C;N_{track}^{global} to PV", kTH2F, {{60, 0, 60000}, {600, 0, 6000}}, false); - for (int i = 0; i < static_cast(cfgnMods->size()); i++) { - int nmod = cfgnMods->at(i); - fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0M_CentFT0C", nmod), Form("hQ%dxFT0M_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0M}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0M_CentFT0C", nmod), Form("hQ%dyFT0M_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0M}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0A_CentFT0C", nmod), Form("hQ%dxFT0A_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0A}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0A_CentFT0C", nmod), Form("hQ%dyFT0A_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0A}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0C_CentFT0C", nmod), Form("hQ%dxFT0C_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0C}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0C_CentFT0C", nmod), Form("hQ%dyFT0C_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0C}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dxBPos_CentFT0C", nmod), Form("hQ%dxBPos_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BPos}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyBPos_CentFT0C", nmod), Form("hQ%dyBPos_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BPos}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dxBNeg_CentFT0C", nmod), Form("hQ%dxBNeg_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BNeg}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyBNeg_CentFT0C", nmod), Form("hQ%dyBNeg_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BNeg}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dxBTot_CentFT0C", nmod), Form("hQ%dxBTot_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BTot}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry.add(Form("Event/after/Qvector/hQ%dyBTot_CentFT0C", nmod), Form("hQ%dyBTot_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BTot}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0MQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0M} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0M} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0MQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0M} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0M} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dBPosQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{BPos} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{BPos} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBTot_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BTot};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BTot}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBTot_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BTot};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BTot}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dFT0C_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - - fRegistry.add(Form("Event/after/Qvector/hEP%dFT0M_CentFT0C", nmod), Form("event plane FT0M;centrality FT0C (%%);#Psi_{%d}^{FT0M} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry.add(Form("Event/after/Qvector/hEP%dFT0A_CentFT0C", nmod), Form("event plane FT0A;centrality FT0C (%%);#Psi_{%d}^{FT0A} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry.add(Form("Event/after/Qvector/hEP%dFT0C_CentFT0C", nmod), Form("event plane FT0C;centrality FT0C (%%);#Psi_{%d}^{FT0C} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry.add(Form("Event/after/Qvector/hEP%dBPos_CentFT0C", nmod), Form("event plane BPos;centrality FT0C (%%);#Psi_{%d}^{BPos} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry.add(Form("Event/after/Qvector/hEP%dBNeg_CentFT0C", nmod), Form("event plane BNeg;centrality FT0C (%%);#Psi_{%d}^{BNeg} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry.add(Form("Event/after/Qvector/hEP%dBTot_CentFT0C", nmod), Form("event plane BTot;centrality FT0C (%%);#Psi_{%d}^{BTot} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0MEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0MEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dBPosEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{BPos} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{BPos} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBTot_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BTot}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BTot}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBTot_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BTot}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BTot}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dFT0C_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{FT0C}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{FT0C}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); - } - std::vector tmp_ptbins; for (int i = 0; i < 100; i++) { tmp_ptbins.emplace_back(0.01 * i); // every 0.01 GeV/c from 0 to 1 GeV/c @@ -258,12 +213,60 @@ struct eventQC { const AxisSpec axis_sign{3, -1.5, +1.5, "sign"}; const AxisSpec axis_cent{20, 0, 100, "centrality FT0C (%)"}; - for (int i = 0; i < static_cast(cfgnMods->size()); i++) { - int nmod = cfgnMods->at(i); - const AxisSpec axis_sp{100, -5, +5, Form("#vec{u_{%d}} #upoint #vec{Q_{%d}}", nmod, nmod)}; - const AxisSpec axis_cos{200, -1, +1, Form("cos(%d(#varphi - #Psi_{%d}))", nmod, nmod)}; - fRegistry.add(Form("Track/hV%d", nmod), Form("charged particle v_{%d}", nmod), kTHnSparseD, {axis_cent, axis_pt, axis_sp, axis_cos}, false); + if (doprocessEventQC_Cent_Qvec) { + for (int i = 0; i < static_cast(cfgnMods->size()); i++) { + int nmod = cfgnMods->at(i); + fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0M_CentFT0C", nmod), Form("hQ%dxFT0M_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0M}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0M_CentFT0C", nmod), Form("hQ%dyFT0M_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0M}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0A_CentFT0C", nmod), Form("hQ%dxFT0A_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0A}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0A_CentFT0C", nmod), Form("hQ%dyFT0A_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0A}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dxFT0C_CentFT0C", nmod), Form("hQ%dxFT0C_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{FT0C}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyFT0C_CentFT0C", nmod), Form("hQ%dyFT0C_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{FT0C}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dxBPos_CentFT0C", nmod), Form("hQ%dxBPos_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BPos}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyBPos_CentFT0C", nmod), Form("hQ%dyBPos_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BPos}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dxBNeg_CentFT0C", nmod), Form("hQ%dxBNeg_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BNeg}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyBNeg_CentFT0C", nmod), Form("hQ%dyBNeg_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BNeg}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dxBTot_CentFT0C", nmod), Form("hQ%dxBTot_CentFT0C;centrality FT0C (%%);Q_{%d,x}^{BTot}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry.add(Form("Event/after/Qvector/hQ%dyBTot_CentFT0C", nmod), Form("hQ%dyBTot_CentFT0C;centrality FT0C (%%);Q_{%d,y}^{BTot}", nmod, nmod), kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0MQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0M} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0M} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0MQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0M} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0M} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dBPosQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{BPos} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{BPos} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0CQ%dBTot_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0C} #upoint Q_{%d}^{BTot};centrality FT0C (%%);Q_{%d}^{FT0C} #upoint Q_{%d}^{BTot}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBPos_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BPos};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BPos}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBNeg_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BNeg};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BNeg}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dBTot_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{BTot};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{BTot}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dFT0C_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + + fRegistry.add(Form("Event/after/Qvector/hEP%dFT0M_CentFT0C", nmod), Form("event plane FT0M;centrality FT0C (%%);#Psi_{%d}^{FT0M} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry.add(Form("Event/after/Qvector/hEP%dFT0A_CentFT0C", nmod), Form("event plane FT0A;centrality FT0C (%%);#Psi_{%d}^{FT0A} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry.add(Form("Event/after/Qvector/hEP%dFT0C_CentFT0C", nmod), Form("event plane FT0C;centrality FT0C (%%);#Psi_{%d}^{FT0C} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry.add(Form("Event/after/Qvector/hEP%dBPos_CentFT0C", nmod), Form("event plane BPos;centrality FT0C (%%);#Psi_{%d}^{BPos} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry.add(Form("Event/after/Qvector/hEP%dBNeg_CentFT0C", nmod), Form("event plane BNeg;centrality FT0C (%%);#Psi_{%d}^{BNeg} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry.add(Form("Event/after/Qvector/hEP%dBTot_CentFT0C", nmod), Form("event plane BTot;centrality FT0C (%%);#Psi_{%d}^{BTot} (rad.)", nmod), kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0MEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0MEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0M} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dBPosEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{BPos} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{BPos} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0CEP%dBTot_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BTot}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0C} - #Psi_{%d}^{BTot}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBPos_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BPos}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BPos}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBNeg_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BNeg}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BNeg}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dBTot_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BTot}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{BTot}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + fRegistry.add(Form("Event/after/Qvector/hPrfCosDiffEP%dFT0AEP%dFT0C_CentFT0C", nmod, nmod), Form("cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{FT0C}));centrality FT0C (%%);cos(%d(#Psi_{%d}^{FT0A} - #Psi_{%d}^{FT0C}))", nmod, nmod, nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); + } + + for (int i = 0; i < static_cast(cfgnMods->size()); i++) { + int nmod = cfgnMods->at(i); + const AxisSpec axis_sp{100, -5, +5, Form("#vec{u_{%d}} #upoint #vec{Q_{%d}}", nmod, nmod)}; + const AxisSpec axis_cos{200, -1, +1, Form("cos(%d(#varphi - #Psi_{%d}))", nmod, nmod)}; + fRegistry.add(Form("Track/hV%d", nmod), Form("charged particle v_{%d}", nmod), kTHnSparseD, {axis_cent, axis_pt, axis_sp, axis_cos}, false); + } } + fRegistry.add("Track/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_sign}, false); fRegistry.add("Track/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{400, -20, 20}}, false); fRegistry.add("Track/hRelSigma1Pt", "relative p_{T} resolution;p_{T} (GeV/c);#sigma_{1/p_{T}} #times p_{T}", kTH2F, {axis_pt_tmp, {100, 0, 0.1}}, false); From 916dd1d876d8ad5c8909fe99a9e3b3137a8c968f Mon Sep 17 00:00:00 2001 From: Anantha Padmanabhan M Nair <82643666+ananthapadmanabhan18@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:58:13 +0530 Subject: [PATCH 28/28] [PWGUD] Added few more TPC N Sigmas (#9108) --- PWGUD/Tasks/exclusiveRhoTo4Pi.cxx | 43 ++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx index 42025b7ae0c..647b999b5a2 100644 --- a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -37,7 +37,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -struct UPCAnalysis { +struct exclusiveRhoTo4Pi { SGSelector sgSelector; HistogramRegistry histos{"HistoReg", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -78,14 +78,26 @@ struct UPCAnalysis { histos.add("EventCounts", "Total Events; Events", kTH1F, {{10, 0, 10}}); // 2=#Events, 3= #Selected Events, 5=#Selected Events with Zero Net charge, 6=Selected Events with Non-Zero Net charge // TPC nSigma - histos.add("tpcNSigmaPi_WOTS", "TPC nSigma Pion without track selection; Events", kTH1F, {{100, -15, 15}}); - histos.add("tpcNSigmaPi_WTS", "TPC nSigma Pion with track selection; Events", kTH1F, {{100, -15, 15}}); - histos.add("tpcNSigmaPi_WTS_PID_Pi", "TPC nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{100, -15, 15}}); + histos.add("tpcNSigmaPi_WOTS", "TPC nSigma Pion without track selection; Events", kTH1F, {{1000, -15, 15}}); + histos.add("tpcNSigmaPi_WTS", "TPC nSigma Pion with track selection; Events", kTH1F, {{1000, -15, 15}}); + histos.add("tpcNSigmaPi_WTS_PID_Pi", "TPC nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{1000, -15, 15}}); + + // TPC nSigma of other particles with selected pion tracks + histos.add("tpcNSigmaPi_WTS_PID_Pi_Ka", "TPC nSigma Kaon with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tpcNSigmaPi_WTS_PID_Pi_Pr", "TPC nSigma Proton with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tpcNSigmaPi_WTS_PID_Pi_El", "TPC nSigma Electron with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tpcNSigmaPi_WTS_PID_Pi_Mu", "TPC nSigma Muon with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); // TOF nSigma - histos.add("tofNSigmaPi_WTS", "TOF nSigma Pion with track selection; Events", kTH1F, {{100, -15, 15}}); - histos.add("tofNSigmaPi_WOTS", "TOF nSigma Pion without track selection; Events", kTH1F, {{100, -15, 15}}); - histos.add("tofNSigmaPi_WTS_PID_Pi", "TOF nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{100, -15, 15}}); + histos.add("tofNSigmaPi_WTS", "TOF nSigma Pion with track selection; Events", kTH1F, {{1000, -15, 15}}); + histos.add("tofNSigmaPi_WOTS", "TOF nSigma Pion without track selection; Events", kTH1F, {{1000, -15, 15}}); + histos.add("tofNSigmaPi_WTS_PID_Pi", "TOF nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{1000, -15, 15}}); + + // TOF nSigma of other particles with selected pion tracks + histos.add("tofNSigmaPi_WTS_PID_Pi_Ka", "TOF nSigma Kaon with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tofNSigmaPi_WTS_PID_Pi_Pr", "TOF nSigma Proton with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tofNSigmaPi_WTS_PID_Pi_El", "TOF nSigma Electron with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); + histos.add("tofNSigmaPi_WTS_PID_Pi_Mu", "TOF nSigma Muon with track selection and PID Selection of Pion; Entries", kTH1F, {{1000, -15, 15}}); // Track Transverse Momentum histos.add("pT_track_WOTS", "pT without track selection; pT [GeV/c]; Events", kTH1F, {{nBins_pT, 0, 2}}); @@ -291,8 +303,19 @@ struct UPCAnalysis { histos.fill(HIST("tpcSignal_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py() + WTS_PID_Pi_tracks[i].pz() * WTS_PID_Pi_tracks[i].pz()), WTS_PID_Pi_tracks[i].tpcSignal()); histos.fill(HIST("tofBeta_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py() + WTS_PID_Pi_tracks[i].pz() * WTS_PID_Pi_tracks[i].pz()), WTS_PID_Pi_tracks[i].beta()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi"), WTS_PID_Pi_tracks[i].tpcNSigmaPi()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi_Ka"), WTS_PID_Pi_tracks[i].tpcNSigmaKa()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi_Pr"), WTS_PID_Pi_tracks[i].tpcNSigmaPr()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi_El"), WTS_PID_Pi_tracks[i].tpcNSigmaEl()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi_Mu"), WTS_PID_Pi_tracks[i].tpcNSigmaMu()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi"), WTS_PID_Pi_tracks[i].tofNSigmaPi()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi_Ka"), WTS_PID_Pi_tracks[i].tofNSigmaKa()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi_Pr"), WTS_PID_Pi_tracks[i].tofNSigmaPr()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi_El"), WTS_PID_Pi_tracks[i].tofNSigmaEl()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi_Mu"), WTS_PID_Pi_tracks[i].tofNSigmaMu()); + histos.fill(HIST("pT_track_WTS_PID_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py())); } // End of loop over tracks with selection and PID selection of Pions @@ -324,7 +347,7 @@ struct UPCAnalysis { k23 = k2 + k3; k24 = k2 + k4; - if (fabs(p1234.Rapidity()) < 0.5) { + if (std::fabs(p1234.Rapidity()) < 0.5) { histos.fill(HIST("pT_event_0charge_WTS_PID_Pi"), p1234.Pt()); if (p1234.Pt() < 0.15) { histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi_domainA"), p1234.Rapidity()); @@ -363,7 +386,7 @@ struct UPCAnalysis { p1234 = p1 + p2 + p3 + p4; - if (fabs(p1234.Rapidity()) < 0.5) { + if (std::fabs(p1234.Rapidity()) < 0.5) { histos.fill(HIST("pT_event_non0charge_WTS_PID_Pi"), p1234.Pt()); if (p1234.Pt() < 0.15) { @@ -391,5 +414,5 @@ struct UPCAnalysis { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; }