diff --git a/EventFiltering/PWGCF/CFFilterAll.cxx b/EventFiltering/PWGCF/CFFilterAll.cxx index c94413f4cca..6e0147621f1 100644 --- a/EventFiltering/PWGCF/CFFilterAll.cxx +++ b/EventFiltering/PWGCF/CFFilterAll.cxx @@ -96,6 +96,7 @@ static const std::vector TPCTOFAvgName{"TPC Avg", "TOF Avg"}; static const std::vector PidCutsName{"TPC min", "TPC max", "TOF min", "TOF max", "TPCTOF max"}; static const std::vector PtCutsName{"Pt min (particle)", "Pt max (particle)", "Pt min (antiparticle)", "Pt max (antiparticle)", "P thres"}; static const std::vector MomCorCutsName{"Momemtum Correlation min", "Momemtum Correlation max"}; +static const std::vector PIDForTrackingName{"Switch", "Momemtum Threshold"}; static const std::vector ThreeBodyFilterNames{"PPP", "PPL", "PLL", "LLL"}; static const std::vector TwoBodyFilterNames{"PD", "LD"}; static const std::vector ParticleNames{"PPP", "aPaPaP", "PPL", "aPaPaL", "PLL", "aPaLaL", "LLL", "aLaLaL", "PD", "aPaD", "LD", "aLaD"}; @@ -135,6 +136,9 @@ static const float NClustersMin[1][nTracks]{ static const float MomCorLimits[2][nMomCorCuts] = {{-99, 99}, {-99, 99}}; +static const float PIDForTrackingTable[2][nTracks]{ + {-1, 0.75}, + {-1, 1.2}}; static const float triggerSwitches[1][nAllTriggers]{ {1, 1, 1, 1, 1, 1}}; @@ -383,6 +387,11 @@ struct CFFilter { "Cut on momentum correlation ratio (antipartilce)"}; Configurable ConfMomCorRatioCutFlag{"ConfMomCorRatioFlag", false, "Flag for cut on momentum correlation ratio"}; + Configurable> ConfPIDForTracking{ + "ConfPIDForTracking", + {CFTrigger::PIDForTrackingTable[0], CFTrigger::nTracks, 2, CFTrigger::SpeciesName, CFTrigger::PIDForTrackingName}, + "Use PID used in tracking up to momentum threshold"}; + Configurable> ConfPtCuts{ "ConfPtCuts", {CFTrigger::ptcutsTable[0], CFTrigger::kNParticleSpecies, CFTrigger::nPtCuts, CFTrigger::SpeciesNameAll, CFTrigger::PtCutsName}, @@ -971,6 +980,22 @@ struct CFFilter { bool pThres = true; float nSigma = -999.; + // check tracking PID + uint8_t SpeciesForTracking = 0; + if (partSpecies == CFTrigger::kProton) { + SpeciesForTracking = o2::track::PID::Proton; + } else if (partSpecies == CFTrigger::kDeuteron) { + SpeciesForTracking = o2::track::PID::Deuteron; + } else { + LOG(warn) << "Unknown PID for tracking encountered"; + } + + if (ConfPIDForTracking->get(partSpecies, "Switch") > 0 && track.tpcInnerParam() < ConfPIDForTracking->get(partSpecies, "Momemtum Threshold")) { + if (track.pidForTracking() != SpeciesForTracking) { + return false; + } + } + // check momentum threshold if (track.tpcInnerParam() <= ConfPtCuts->get(partSpecies, "P thres")) { pThres = true; diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 9fb62031dc6..d2a7e8aeeac 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -21,6 +21,7 @@ #include // needed for HFFilterHelpers, to be fixed +#include "CommonConstants/PhysicsConstants.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" @@ -422,7 +423,7 @@ struct HfFilter { // Main struct for HF triggers auto pt2Prong = RecoDecay::pt(pVec2Prong); if (applyOptimisation) { - optimisationTreeCharm(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]); + optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]); } auto selD0 = helper.isSelectedD0InMassRange(pVecPos, pVecNeg, pt2Prong, preselD0, activateQA, hMassVsPtC[kD0]); @@ -468,7 +469,7 @@ struct HfFilter { // Main struct for HF triggers keepEvent[kBeauty3P] = true; // fill optimisation tree for D0 if (applyOptimisation) { - optimisationTreeBeauty(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]); + optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]); } if (activateQA) { hMassVsPtB[kBplus]->Fill(ptCand, massCand); @@ -529,7 +530,7 @@ struct HfFilter { // Main struct for HF triggers if (isProton) { float relativeMomentum = helper.computeRelativeMomentum(pVecThird, pVec2Prong, massD0); if (applyOptimisation) { - optimisationTreeFemto(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr()); + optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr()); } if (relativeMomentum < femtoMaxRelativeMomentum) { keepEvent[kFemto2P] = true; @@ -757,25 +758,25 @@ struct HfFilter { // Main struct for HF triggers if (is3Prong[0]) { is3ProngInMass[0] = helper.isSelectedDplusInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, activateQA, hMassVsPtC[kDplus]); if (applyOptimisation) { - optimisationTreeCharm(thisCollId, pdg::Code::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]); + optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]); } } if (is3Prong[1]) { is3ProngInMass[1] = helper.isSelectedDsInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[1], activateQA, hMassVsPtC[kDs]); if (applyOptimisation) { - optimisationTreeCharm(thisCollId, pdg::Code::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]); + optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]); } } if (is3Prong[2]) { is3ProngInMass[2] = helper.isSelectedLcInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[2], activateQA, hMassVsPtC[kLc]); if (applyOptimisation) { - optimisationTreeCharm(thisCollId, pdg::Code::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]); + optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]); } } if (is3Prong[3]) { is3ProngInMass[3] = helper.isSelectedXicInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[3], activateQA, hMassVsPtC[kXic]); if (applyOptimisation) { - optimisationTreeCharm(thisCollId, pdg::Code::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]); + optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]); } } @@ -806,7 +807,7 @@ struct HfFilter { // Main struct for HF triggers getPxPyPz(trackParFourth, pVecFourth); } - int charmParticleID[kNBeautyParticles - 2] = {pdg::Code::kDPlus, pdg::Code::kDS, pdg::Code::kLambdaCPlus, pdg::Code::kXiCPlus}; + 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}; diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 1123d8c0196..1056a278bfc 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -134,25 +134,25 @@ static const std::tuple pdgCharmDaughters{ std::array{2212, -321, 211}, // Lc std::array{2212, -321, 211}}; // Xic -constexpr float massPi = o2::analysis::pdg::MassPiPlus; -constexpr float massKa = o2::analysis::pdg::MassKPlus; -constexpr float massProton = o2::analysis::pdg::MassProton; -constexpr float massGamma = o2::analysis::pdg::MassGamma; -constexpr float massK0S = o2::analysis::pdg::MassK0Short; -constexpr float massLambda = o2::analysis::pdg::MassLambda0; -constexpr float massXi = o2::analysis::pdg::MassXiMinus; -constexpr float massPhi = o2::analysis::pdg::MassPhi; -constexpr float massD0 = o2::analysis::pdg::MassD0; -constexpr float massDPlus = o2::analysis::pdg::MassDPlus; -constexpr float massDs = o2::analysis::pdg::MassDS; -constexpr float massLc = o2::analysis::pdg::MassLambdaCPlus; -constexpr float massXic = o2::analysis::pdg::MassXiCPlus; -constexpr float massDStar = o2::analysis::pdg::MassDStar; -constexpr float massBPlus = o2::analysis::pdg::MassBPlus; -constexpr float massB0 = o2::analysis::pdg::MassB0; -constexpr float massBs = o2::analysis::pdg::MassBS; -constexpr float massLb = o2::analysis::pdg::MassLambdaB0; -constexpr float massXib = o2::analysis::pdg::MassXiB0; +constexpr float massPi = o2::constants::physics::MassPiPlus; +constexpr float massKa = o2::constants::physics::MassKPlus; +constexpr float massProton = o2::constants::physics::MassProton; +constexpr float massGamma = o2::constants::physics::MassGamma; +constexpr float massK0S = o2::constants::physics::MassK0Short; +constexpr float massLambda = o2::constants::physics::MassLambda0; +constexpr float massXi = o2::constants::physics::MassXiMinus; +constexpr float massPhi = o2::constants::physics::MassPhi; +constexpr float massD0 = o2::constants::physics::MassD0; +constexpr float massDPlus = o2::constants::physics::MassDPlus; +constexpr float massDs = o2::constants::physics::MassDS; +constexpr float massLc = o2::constants::physics::MassLambdaCPlus; +constexpr float massXic = o2::constants::physics::MassXiCPlus; +constexpr float massDStar = o2::constants::physics::MassDStar; +constexpr float massBPlus = o2::constants::physics::MassBPlus; +constexpr float massB0 = o2::constants::physics::MassB0; +constexpr float massBs = o2::constants::physics::MassBS; +constexpr float massLb = o2::constants::physics::MassLambdaB0; +constexpr float massXib = o2::constants::physics::MassXiB0; static const o2::framework::AxisSpec ptAxis{50, 0.f, 50.f}; static const o2::framework::AxisSpec pAxis{50, 0.f, 10.f}; diff --git a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx index 72a530c015c..b7a6fb2a5bb 100644 --- a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx +++ b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx @@ -20,6 +20,7 @@ #include // needed for HFFilterHelpers, to be fixed +#include "CommonConstants/PhysicsConstants.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" @@ -121,7 +122,7 @@ struct HfFilterPrepareMlSamples { // Main struct // D0(bar) → π± K∓ bool isInCorrectColl{false}; - auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { auto particle = mcParticles.rawIteratorAt(indexRec); flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle); @@ -202,27 +203,27 @@ struct HfFilterPrepareMlSamples { // Main struct int8_t channel = -1; // D± → π± K∓ π± - auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kDplus; } if (indexRec < 0) { // Ds± → K± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kDs; } } if (indexRec < 0) { // Λc± → p± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kLc; } } if (indexRec < 0) { // Ξc± → p± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kXic; } diff --git a/EventFiltering/PWGLF/filterf1proton.cxx b/EventFiltering/PWGLF/filterf1proton.cxx index a81973b84ee..1e1e8dc502b 100644 --- a/EventFiltering/PWGLF/filterf1proton.cxx +++ b/EventFiltering/PWGLF/filterf1proton.cxx @@ -36,7 +36,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsTPC/BetheBlochAleph.h" #include "CCDB/BasicCCDBManager.h" #include "CCDB/CcdbApi.h" @@ -316,7 +316,7 @@ struct filterf1proton { const float dcaDaughv0 = candidate.dcaV0daughters(); const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0; float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0; @@ -390,10 +390,10 @@ struct filterf1proton { std::vector BBProton, BBAntiproton, BBPion, BBAntipion, BBKaon, BBAntikaon; ROOT::Math::PtEtaPhiMVector F1Vector, KKs0Vector; - double massPi = o2::analysis::pdg::MassPiPlus; - double massKa = o2::analysis::pdg::MassKPlus; + double massPi = o2::constants::physics::MassPiPlus; + double massKa = o2::constants::physics::MassKPlus; double massPr = o2::constants::physics::MassProton; - double massK0s = o2::analysis::pdg::MassK0Short; + double massK0s = o2::constants::physics::MassK0Short; double massF1{0.}; double masskKs0{0.}; double pT{0.}; diff --git a/EventFiltering/PWGLF/strangenessFilter.cxx b/EventFiltering/PWGLF/strangenessFilter.cxx index 2176ad1bddf..bc23672e9bd 100644 --- a/EventFiltering/PWGLF/strangenessFilter.cxx +++ b/EventFiltering/PWGLF/strangenessFilter.cxx @@ -35,7 +35,7 @@ #include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Multiplicity.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "../filterTables.h" using namespace o2; @@ -435,8 +435,8 @@ struct strangenessFilter { // Total momentum xiptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); // Proper lifetime - xiproperlifetime = o2::analysis::pdg::MassXiMinus * xipos / (xiptotmom + 1e-13); - omegaproperlifetime = o2::analysis::pdg::MassOmegaMinus * xipos / (xiptotmom + 1e-13); + xiproperlifetime = o2::constants::physics::MassXiMinus * xipos / (xiptotmom + 1e-13); + omegaproperlifetime = o2::constants::physics::MassOmegaMinus * xipos / (xiptotmom + 1e-13); if (casc.sign() == 1) { if (TMath::Abs(casc.dcapostopv()) < dcamesontopv) { @@ -503,30 +503,30 @@ struct strangenessFilter { isXi = (TMath::Abs(bachelor.tpcNSigmaPi()) < nsigmatpcpi) && (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaxi) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < ximasswindow) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) > omegarej) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < ximasswindow) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > omegarej) && (xiproperlifetime < properlifetimefactor * ctauxi) && (TMath::Abs(casc.yXi()) < rapidity); // add PID on bachelor isXiYN = (TMath::Abs(bachelor.tpcNSigmaPi()) < nsigmatpcpi) && (casc.cascradius() > lowerradiusXiYN) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < ximasswindow) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) > omegarej) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < ximasswindow) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > omegarej) && (xiproperlifetime < properlifetimefactor * ctauxi) && (TMath::Abs(casc.yXi()) < rapidity); // add PID on bachelor isOmega = (TMath::Abs(bachelor.tpcNSigmaKa()) < nsigmatpcka) && (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaomega) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && (casc.cascradius() < upperradiusOmega) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) < omegamasswindow) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) > xirej) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < omegamasswindow) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) > xirej) && (omegaproperlifetime < properlifetimefactor * ctauomega) && (TMath::Abs(casc.yOmega()) < rapidity); // add PID on bachelor isOmegalargeR = (TMath::Abs(bachelor.tpcNSigmaKa()) < nsigmatpcka) && (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaomega) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && (casc.cascradius() > lowerradiusOmega) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) < omegamasswindow) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) > xirej) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < omegamasswindow) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) > xirej) && (omegaproperlifetime < properlifetimefactor * ctauomega) && (TMath::Abs(casc.yOmega()) < rapidity); // add PID on bachelor @@ -537,7 +537,7 @@ struct strangenessFilter { // Plot for estimates if (tracks.size() > 0) triggcounterForEstimates = 1; - if (triggcounterForEstimates && (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < 0.01)) + if (triggcounterForEstimates && (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < 0.01)) hhXiPairsvsPt->Fill(casc.pt()); // Fill the histogram with all the Xis produced in events with a trigger particle // End plot for estimates } @@ -700,8 +700,8 @@ struct strangenessFilter { // Total momentum xiptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); // Proper lifetime - xiproperlifetime = o2::analysis::pdg::MassXiMinus * xipos / (xiptotmom + 1e-13); - omegaproperlifetime = o2::analysis::pdg::MassOmegaMinus * xipos / (xiptotmom + 1e-13); + xiproperlifetime = o2::constants::physics::MassXiMinus * xipos / (xiptotmom + 1e-13); + omegaproperlifetime = o2::constants::physics::MassOmegaMinus * xipos / (xiptotmom + 1e-13); if (casc.sign() > 0) { if (TMath::Abs(casc.dcapostopv()) < dcamesontopv) { @@ -805,21 +805,21 @@ struct strangenessFilter { isXi = (TMath::Abs(bachelor.tpcNSigmaPi()) < nsigmatpcpi) && (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaxi) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < ximasswindow) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) > omegarej) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < ximasswindow) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > omegarej) && (xiproperlifetime < properlifetimefactor * ctauxi) && (TMath::Abs(casc.yXi()) < rapidity); isXiYN = (TMath::Abs(bachelor.tpcNSigmaPi()) < nsigmatpcpi) && (casc.cascradius() > lowerradiusXiYN) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < ximasswindow) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) > omegarej) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < ximasswindow) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > omegarej) && (xiproperlifetime < properlifetimefactor * ctauxi) && (TMath::Abs(casc.yXi()) < rapidity); isOmega = (TMath::Abs(bachelor.tpcNSigmaKa()) < nsigmatpcka) && (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaomega) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) < omegamasswindow) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) > xirej) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < omegamasswindow) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) > xirej) && (casc.cascradius() < upperradiusOmega) && (omegaproperlifetime < properlifetimefactor * ctauomega) && (TMath::Abs(casc.yOmega()) < rapidity); @@ -827,8 +827,8 @@ struct strangenessFilter { (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospaomega) && (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) && (casc.cascradius() > lowerradiusOmega) && - (TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) < omegamasswindow) && - (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) > xirej) && + (TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < omegamasswindow) && + (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) > xirej) && (omegaproperlifetime < properlifetimefactor * ctauomega) && (TMath::Abs(casc.yOmega()) < rapidity); @@ -881,7 +881,7 @@ struct strangenessFilter { if (triggcounterForEstimates > 0) break; } - if (triggcounterForEstimates && (TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) < 0.01)) + if (triggcounterForEstimates && (TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) < 0.01)) hhXiPairsvsPt->Fill(casc.pt()); // Fill the histogram with all the Xis produced in events with a trigger particle // End plot for estimates } @@ -1096,7 +1096,7 @@ struct strangenessFilter { continue; } - std::array masses{o2::analysis::pdg::MassProton, o2::analysis::pdg::MassPiMinus}; + std::array masses{o2::constants::physics::MassProton, o2::constants::physics::MassPiMinus}; std::array, 2> momenta; std::array nsigma; if (trackCasc.sign() < 0) { @@ -1145,7 +1145,7 @@ struct strangenessFilter { } // Omega hypothesis - masses = {o2::analysis::pdg::MassLambda0, o2::analysis::pdg::MassKPlus}; + masses = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; const auto massOmega = recalculateMasses ? RecoDecay::m(momenta, masses) : trackedCascade.omegaMass(); QAHistosStrangenessTracking.fill(HIST("hMassOmegaTrkCasc"), massOmega); QAHistosStrangenessTracking.fill(HIST("hMassOmegaVsMatchChi2TrkCasc"), massOmega, trackedCascade.matchingChi2()); @@ -1153,7 +1153,7 @@ struct strangenessFilter { QAHistosStrangenessTracking.fill(HIST("hPtVsMassTrkOmega"), trackCasc.pt(), massOmega); // Xi hypothesis - masses = {o2::analysis::pdg::MassLambda0, o2::analysis::pdg::MassPiPlus}; + masses = {o2::constants::physics::MassLambda0, o2::constants::physics::MassPiPlus}; const auto massXi = recalculateMasses ? RecoDecay::m(momenta, masses) : trackedCascade.xiMass(); QAHistosStrangenessTracking.fill(HIST("hMassXiTrkCasc"), massXi); QAHistosStrangenessTracking.fill(HIST("hPtVsMassTrkXi"), trackCasc.pt(), massXi); @@ -1165,12 +1165,12 @@ struct strangenessFilter { if ((trackCasc.pt() > minPtTrackedCascade) && // (trackedCascade.matchingChi2() < maxMatchingChi2TrackedCascade) && - (std::abs(v0mass - o2::analysis::pdg::MassLambda0) < massWindowLambda) && + (std::abs(v0mass - o2::constants::physics::MassLambda0) < massWindowLambda) && (std::abs(nsigma[0]) < maxNSigmaV0PrTrackedCascade) && (std::abs(nsigma[1]) < maxNSigmaV0PiTrackedCascade)) { // Xi - if ((std::abs(massXi - o2::analysis::pdg::MassXiMinus) < massWindowTrackedXi) && - (RecoDecay::sqrtSumOfSquares(trackCasc.x(), trackCasc.y()) >= minDcaTrackedXi) && + if ((std::abs(massXi - o2::constants::physics::MassXiMinus) < massWindowTrackedXi) && + (impactParameterTrk.getY() >= minDcaTrackedXi) && (cpa <= maxCpaTrackedOmega) && (std::abs(bachelor.tpcNSigmaPi()) < maxNSigmaBachelorTrackedXi)) { keepEvent[7] = true; @@ -1188,9 +1188,9 @@ struct strangenessFilter { QAHistosStrangenessTracking.fill(HIST("hDcaZVsPtSelectedXi"), trackParCovTrk.getPt(), impactParameterTrk.getZ()); } // Omega - if ((std::abs(massOmega - o2::analysis::pdg::MassOmegaMinus) < massWindowTrackedOmega) && - (std::abs(massXi - o2::analysis::pdg::MassXiMinus) >= massWindowXiExclTrackedOmega) && - (RecoDecay::sqrtSumOfSquares(trackCasc.x(), trackCasc.y()) >= minDcaTrackedXi) && + if ((std::abs(massOmega - o2::constants::physics::MassOmegaMinus) < massWindowTrackedOmega) && + (std::abs(massXi - o2::constants::physics::MassXiMinus) >= massWindowXiExclTrackedOmega) && + (impactParameterTrk.getY() >= minDcaTrackedOmega) && (cpa <= maxCpaTrackedOmega) && (std::abs(bachelor.tpcNSigmaKa()) < maxNSigmaBachelorTrackedOmega)) { keepEvent[8] = true; diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 4ec775b2609..44191404d17 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -214,6 +214,102 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) cut->AddCut(GetAnalysisCut("electronPIDnsigmaVeryLoose")); // with 3 sigma El TOF return cut; } + // + // New cuts to test for jpsi2ee electron selection (potentially not useful) + // + // With pT > 1.0 GeV/c as primary cut + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_1")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_1")); // Loose pion rejection at high p with no correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_1_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_1_Corr")); // Loose pion rejection at high p with correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_2")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_2")); // No pion rejection at high p and asymmetrical e selection with no correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_2_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_2_Corr")); // No pion rejection at high p and asymmetrical e selection with correction maps + + return cut; + } + + // With p > 1.5 GeV/c as primary cut + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_3")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_1")); // Loose pion rejection at high p with no correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_3_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_1_Corr")); // Loose pion rejection at high p with correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_4")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_2")); // No pion rejection at high p and asymmetrical e selection with no correction maps + + return cut; + } + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_4_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_TEST_2_Corr")); // No pion rejection at high p and asymmetrical e selection with correction maps + + return cut; + } + + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_6_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("pidCut_lowP")); + + AnalysisCompositeCut* pidCut_highP = new AnalysisCompositeCut("pidCut_highP", "pidCut_highP", kFALSE); + pidCut_highP->AddCut(GetAnalysisCut("MySpecial_EleInclusion")); + pidCut_highP->AddCut(GetAnalysisCut("MySpecial_PionExclusion")); + cut->AddCut(pidCut_highP); + return cut; + } + + if (!nameStr.compare("jpsiO2MCdebugCuts_TEST_5_Corr")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("pidCut_lowP")); + + AnalysisCompositeCut* pidCut_highP = new AnalysisCompositeCut("pidCut_highP", "pidCut_highP", kFALSE); + pidCut_highP->AddCut(GetAnalysisCut("MySpecial_EleInclusion")); + pidCut_highP->AddCut(GetAnalysisCut("MySpecial_PionExclusion")); + cut->AddCut(pidCut_highP); + return cut; + } + // + // end new test cuts + // + + if (!nameStr.compare("JpsiPWGSkimmedCuts1")) { // please do not remove or modify, this is used for the common Skimmed tree production, (Xiaozhi Bai) + cut->AddCut(GetAnalysisCut("jpsiKineSkimmed")); + cut->AddCut(GetAnalysisCut("electronTrackQualitySkimmed")); + cut->AddCut(GetAnalysisCut("electronPIDLooseSkimmed")); + return cut; + } if (!nameStr.compare("JpsiPWGSkimmedCuts1")) { // please do not remove or modify, this is used for the common Skimmed tree production, (Xiaozhi Bai) cut->AddCut(GetAnalysisCut("jpsiKineSkimmed")); @@ -230,6 +326,21 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsiO2MCdebugCuts14")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaSkewed")); + return cut; + } + + if (!nameStr.compare("jpsiO2MCdebugCuts14andDCA")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaSkewed")); + cut->AddCut(GetAnalysisCut("PrimaryTrack_DCAz")); + return cut; + } + if (!nameStr.compare("jpsiKineAndQuality")) { cut->AddCut(GetAnalysisCut("jpsiStandardKine")); cut->AddCut(GetAnalysisCut("electronStandardQuality")); @@ -358,6 +469,13 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) cut->AddCut(GetAnalysisCut("kaonPIDnsigma2")); return cut; } + + if (!nameStr.compare("kaonPID3")) { + cut->AddCut(GetAnalysisCut("AssocKine")); // standard kine cuts usually are applied via Filter in the task + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); + cut->AddCut(GetAnalysisCut("kaonPID_TPCnTOF")); + return cut; + } // NOTE Below there are several TPC pid cuts used for studies of the Run3 TPC post PID calib. if (!nameStr.compare("Jpsi_TPCPost_calib_debug1")) { cut->AddCut(GetAnalysisCut("jpsi_trackCut_debug")); @@ -2245,6 +2363,26 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("eventDoubleGap")) { + cut->AddCut(VarManager::kIsDoubleGap, 0.5, 1.5); + return cut; + } + + if (!nameStr.compare("eventSingleGap")) { + cut->AddCut(VarManager::kIsSingleGap, 0.5, 1.5); + return cut; + } + + if (!nameStr.compare("eventSingleGapA")) { + cut->AddCut(VarManager::kIsSingleGapA, 0.5, 1.5); + return cut; + } + + if (!nameStr.compare("eventSingleGapC")) { + cut->AddCut(VarManager::kIsSingleGapC, 0.5, 1.5); + return cut; + } + // Event cuts based on centrality if (!nameStr.compare("eventStandardNoINT7Cent090")) { cut->AddCut(VarManager::kVtxZ, -10.0, 10.0); @@ -2343,13 +2481,19 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) } if (!nameStr.compare("jpsiStandardKine3")) { - cut->AddCut(VarManager::kPin, 1.2, 1000.0); + cut->AddCut(VarManager::kP, 1.2, 1000.0); cut->AddCut(VarManager::kEta, -0.9, 0.9); return cut; } if (!nameStr.compare("jpsiStandardKine4")) { - cut->AddCut(VarManager::kPin, 1.5, 1000.0); + cut->AddCut(VarManager::kP, 1.5, 1000.0); + cut->AddCut(VarManager::kEta, -0.9, 0.9); + return cut; + } + + if (!nameStr.compare("jpsiKineSkimmed")) { + cut->AddCut(VarManager::kPt, 0.7, 1000.0); cut->AddCut(VarManager::kEta, -0.9, 0.9); return cut; } @@ -2642,6 +2786,11 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("PrimaryTrack_DCAz")) { + cut->AddCut(VarManager::kTrackDCAz, -0.3, 0.3); + return cut; + } + // ----------------------------------------------------- // V0 and Dalitz legs selections @@ -2742,6 +2891,60 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) cut->AddCut(VarManager::kTPCnSigmaPr, 3.5, 999); return cut; } + // + // New test for jpsi2ee PID selection + // + if (!nameStr.compare("jpsi_TPCPID_TEST_1_Corr")) { + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -3.0, 3.0); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 2.0, 999, false, VarManager::kP, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPr_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPr_Corr, 2.0, 999, false, VarManager::kP, 4.0, 999); + return cut; + } + if (!nameStr.compare("jpsi_TPCPID_TEST_1")) { + cut->AddCut(VarManager::kTPCnSigmaEl, -3.0, 3.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 2.0, 999, false, VarManager::kP, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPr, 2.0, 999, false, VarManager::kP, 4.0, 999); + return cut; + } + if (!nameStr.compare("jpsi_TPCPID_TEST_2_Corr")) { + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -3.0, 3.0, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -1.0, 4.0, false, VarManager::kP, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 2.0, 999, false, VarManager::kP, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPr_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPr_Corr, 2.0, 999, false, VarManager::kP, 4.0, 999); + return cut; + } + if (!nameStr.compare("jpsi_TPCPID_TEST_2")) { + cut->AddCut(VarManager::kTPCnSigmaEl, -3.0, 3.0, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaEl, -1.0, 4.0, false, VarManager::kP, 4.0, 999.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 0, 999, false, VarManager::kP, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPr, 0, 999, false, VarManager::kP, 4.0, 999); + return cut; + } + + if (!nameStr.compare("pidCut_lowP")) { + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -3.0, 3.0, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPr_Corr, 3.0, 999, false, VarManager::kP, 0.0, 4.0); + return cut; + } + + if (!nameStr.compare("MySpecial_EleInclusion")) { + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -1.0, 4.0, false, VarManager::kP, 4.0, 999.0); + return cut; + } + if (!nameStr.compare("MySpecial_PionExclusion")) { + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 2.0, 999, false, VarManager::kP, 4.0, 999.0); + return cut; + } + // end of new tests cuts if (!nameStr.compare("lmee_TPCPID_debug1")) { cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -5.0, 5.0); @@ -3104,6 +3307,13 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("electronPIDnsigmaSkewed")) { + cut->AddCut(VarManager::kTPCnSigmaEl, -2.0, 3.0); + cut->AddCut(VarManager::kTPCnSigmaPr, 3.5, 3000.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 3.5, 3000.0); + return cut; + } + if (!nameStr.compare("electronPIDPrKaPiRej")) { cut->AddCut(VarManager::kTPCnSigmaEl, -3.0, 3.0); cut->AddCut(VarManager::kTPCnSigmaPr, -3.0, 3.0, true); @@ -3148,6 +3358,18 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("kaonPID_TPCnTOF")) { + cut->AddCut(VarManager::kTPCnSigmaKa, -3.0, 3.0); + cut->AddCut(VarManager::kTOFnSigmaKa, -3.0, 3.0); + return cut; + } + + if (!nameStr.compare("AssocKine")) { + cut->AddCut(VarManager::kPt, 1.0, 1000.0); + cut->AddCut(VarManager::kEta, -0.9, 0.9); + return cut; + } + if (!nameStr.compare("electronPIDnsigmaRandomized")) { cut->AddCut(VarManager::kTPCnSigmaElRandomized, -3.0, 3.0); cut->AddCut(VarManager::kTPCnSigmaPrRandomized, 3.0, 3000.0); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 2abd3af77e3..a9cda0e7d05 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -528,9 +528,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h } if (subGroupStr.Contains("vertexing")) { hm->AddHistogram(histClass, "UsedKF", "", false, 2, -0.5, 1.5, VarManager::kUsedKF); - hm->AddHistogram(histClass, "Lxy", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxy); - hm->AddHistogram(histClass, "Lxyz", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyz); - hm->AddHistogram(histClass, "Tauxy", "", false, 200, -0.01, 0.01, VarManager::kVertexingTauxy); + hm->AddHistogram(histClass, "Lz", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLz); + hm->AddHistogram(histClass, "Lxy", "", false, 41000, -2.0, 2.0, VarManager::kVertexingLxy); + hm->AddHistogram(histClass, "Lxyz", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyz); + hm->AddHistogram(histClass, "Tauz", "", false, 4000, -0.01, 0.01, VarManager::kVertexingTauz); + hm->AddHistogram(histClass, "Tauxy", "", false, 4000, -0.01, 0.01, VarManager::kVertexingTauxy); + } + + if (subGroupStr.Contains("kalman-filter")) { hm->AddHistogram(histClass, "LxyErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyErr); hm->AddHistogram(histClass, "LxyzErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyzErr); hm->AddHistogram(histClass, "TauxyErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingTauxyErr); @@ -540,6 +545,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "LxyOverDLxy", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyOverErr); hm->AddHistogram(histClass, "LzOverDLz", "", false, 100, 0.0, 10.0, VarManager::kVertexingLzOverErr); hm->AddHistogram(histClass, "LxyzOverDLxyz", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyzOverErr); + hm->AddHistogram(histClass, "KFTauxy", "", false, 1000, -0.2, 0.2, VarManager::kVertexingTauxy); hm->AddHistogram(histClass, "KFTrack0DCAxyz", "", false, 400, -2.0, 2.0, VarManager::kKFTrack0DCAxyz); hm->AddHistogram(histClass, "KFTrack1DCAxyz", "", false, 400, -2.0, 2.0, VarManager::kKFTrack1DCAxyz); hm->AddHistogram(histClass, "KFTracksDCAxyzMax", "", false, 400, -2.0, 2.0, VarManager::kKFTracksDCAxyzMax); @@ -555,6 +561,42 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_DCAxyTwoProngs", "", false, 500, 0.0, 5.0, VarManager::kMass, 400, -2.0, 2.0, VarManager::kKFDCAxyBetweenProngs); hm->AddHistogram(histClass, "Mass_KFChi2OverNDFGeo", "", false, 500, 0.0, 5.0, VarManager::kMass, 150, -5, 10, VarManager::kKFChi2OverNDFGeo); } + if (subGroupStr.Contains("run2-vertexing-definitions")) { + hm->AddHistogram(histClass, "LzProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLzProjected); + hm->AddHistogram(histClass, "LxyProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyProjected); + hm->AddHistogram(histClass, "LxyzProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyzProjected); + hm->AddHistogram(histClass, "TauzProj", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauzProjected); + hm->AddHistogram(histClass, "TauxyProjNs", "", false, 4000, -0.1, 0.1, VarManager::kVertexingTauxyProjectedNs); + hm->AddHistogram(histClass, "TauxyProjCm", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauxyProjected); + } + if (subGroupStr.Contains("multidimentional-vertexing-histograms")) { + hm->AddHistogram(histClass, "pT_TauxyProj", "", false, 1000, -0.2, 0.2, VarManager::kVertexingTauxyProjected, 20, 0.0, 20., VarManager::kPt); + hm->AddHistogram(histClass, "InvMass_TauxyProj", "", false, 500, 0.0, 5.0, VarManager::kMass, 1000, -0.2, 0.2, VarManager::kVertexingTauxyProjected); + hm->AddHistogram(histClass, "Eta_TauxyProj", "", false, 40, -2.0, 2.0, VarManager::kEta, 1000, -0.2, 0.2, VarManager::kVertexingTauxyProjected); + hm->AddHistogram(histClass, "Rap_TauxyProj", "", false, 200, -1.0, 1.0, VarManager::kRap, 1000, -0.2, 0.2, VarManager::kVertexingTauxyProjected); + + const int kNvarsPair = 4; + const int kInvMassNbins = 3; + double InvMassBinLims[kInvMassNbins + 1] = {2.2, 2.6, 3.4, 3.6}; + + const int kPtNbins = 10; + double PtBinLims[kPtNbins + 1] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 12., 20.}; + + const int kTauNBins = 500; + double TauBinLims[kTauNBins + 1]; + for (int i = 0; i <= kTauNBins; ++i) + TauBinLims[i] = -0.3 + (0.0015 * i); + + TArrayD nCutsBinLimits[kNvarsPair]; + nCutsBinLimits[0] = TArrayD(kInvMassNbins + 1, InvMassBinLims); + nCutsBinLimits[1] = TArrayD(kPtNbins + 1, PtBinLims); + nCutsBinLimits[2] = TArrayD(kTauNBins + 1, TauBinLims); + nCutsBinLimits[3] = TArrayD(kTauNBins + 1, TauBinLims); + + int varsPair[kNvarsPair] = {VarManager::kMass, VarManager::kPt, VarManager::kVertexingTauzProjected, VarManager::kVertexingTauxyProjected}; + hm->AddHistogram(histClass, "tau_MultiD", "Invariant mass vs. pT vs. eta vs. rapidity vs. Run2 tau", kNvarsPair, varsPair, nCutsBinLimits); + } + if (subGroupStr.Contains("flow")) { hm->AddHistogram(histClass, "Mass_u2q2", "u_{2}Q_{2}^{A} vs m", true, 125, 0.0, 5.0, VarManager::kMass, 100, -1.0, 1.0, VarManager::kU2Q2); hm->AddHistogram(histClass, "Mass_u3q3", "u_{3}Q_{3}^{A} vs m", true, 125, 0.0, 5.0, VarManager::kMass, 100, -1.0, 1.0, VarManager::kU3Q3); @@ -698,14 +740,24 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt", "", false, 40, 0.0, 20.0, VarManager::kPairMass, 40, 0.0, 20.0, VarManager::kPairPt); hm->AddHistogram(histClass, "Pt_Dilepton__Pt", "", false, 40, 0.0, 20.0, VarManager::kPairPtDau, 40, 0.0, 20.0, VarManager::kPairPt); hm->AddHistogram(histClass, "Pt_Track__Pt", "", false, 40, 0.0, 20.0, VarManager::kPt, 40, 0.0, 20.0, VarManager::kPairPt); - hm->AddHistogram(histClass, "Lxyz", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyz); - hm->AddHistogram(histClass, "Lz", "", false, 100, 0.0, 10.0, VarManager::kVertexingLz); - hm->AddHistogram(histClass, "Tauz", "", false, 100, -0.01, 0.01, VarManager::kVertexingTauz); + hm->AddHistogram(histClass, "UsedKF", "", false, 2, -0.5, 1.5, VarManager::kUsedKF); + hm->AddHistogram(histClass, "KFMass", "", false, 750, 0.0, 30.0, VarManager::kKFMass); + hm->AddHistogram(histClass, "Lz", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLz); + hm->AddHistogram(histClass, "Lxy", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxy); + hm->AddHistogram(histClass, "Lxyz", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyz); + hm->AddHistogram(histClass, "Tauz", "", false, 4000, -0.01, 0.01, VarManager::kVertexingTauz); + hm->AddHistogram(histClass, "Tauxy", "", false, 4000, -0.01, 0.01, VarManager::kVertexingTauxy); hm->AddHistogram(histClass, "LxyzErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingLxyzErr); hm->AddHistogram(histClass, "LzErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingLzErr); hm->AddHistogram(histClass, "TauzErr", "", false, 100, 0.0, 10.0, VarManager::kVertexingTauzErr); hm->AddHistogram(histClass, "VtxingProcCode", "", false, 10, 0.0, 10.0, VarManager::kVertexingProcCode); hm->AddHistogram(histClass, "VtxingChi2PCA", "", false, 100, 0.0, 10.0, VarManager::kVertexingChi2PCA); + hm->AddHistogram(histClass, "LzProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLzProjected); + hm->AddHistogram(histClass, "LxyProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyProjected); + hm->AddHistogram(histClass, "LxyzProj", "", false, 1000, -2.0, 2.0, VarManager::kVertexingLxyzProjected); + hm->AddHistogram(histClass, "TauzProj", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauzProjected); + hm->AddHistogram(histClass, "TauxyProj", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauxyProjected); + hm->AddHistogram(histClass, "CosPointingAngle", "", false, 100, 0.0, 1.0, VarManager::kCosPointingAngle); } if (groupStr.Contains("dilepton-hadron-correlation")) { diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index cc4beeafea3..1f9005519f8 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -17,6 +17,7 @@ #ifndef PWGDQ_CORE_VARMANAGER_H_ #define PWGDQ_CORE_VARMANAGER_H_ +#include #ifndef HomogeneousField #define HomogeneousField #endif @@ -374,6 +375,12 @@ class VarManager : public TObject kVertexingLzErr, kVertexingTauxy, kVertexingTauxyErr, + kVertexingLzProjected, + kVertexingLxyProjected, + kVertexingLxyzProjected, + kVertexingTauzProjected, + kVertexingTauxyProjected, + kVertexingTauxyProjectedNs, kVertexingTauz, kVertexingTauzErr, kVertexingProcCode, @@ -462,7 +469,7 @@ class VarManager : public TObject }; enum EventFilters { - kDoubleGap = 1, + kDoubleGap = 0, kSingleGapA, kSingleGapC }; @@ -580,6 +587,18 @@ class VarManager : public TObject { fgFitterTwoProngFwd.setTGeoMat(false); } + // Setup the 3 prong KFParticle + static void SetupThreeProngKFParticle(float magField) + { + KFParticle::SetField(magField); + fgUsedKF = true; + } + + // Setup the 3 prong DCAFitterN + static void SetupThreeProngDCAFitter() + { + fgUsedKF = false; + } static auto getEventPlane(int harm, float qnxa, float qnya) { @@ -790,7 +809,7 @@ void VarManager::FillPropagateMuon(const T& muon, const C& collision, float* val muon.c1PtX(), muon.c1PtY(), muon.c1PtPhi(), muon.c1PtTgl(), muon.c1Pt21Pt2()}; SMatrix55 tcovs(v1.begin(), v1.end()); o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2}; - o2::dataformats::GlobalFwdTrack track{fwdtrack}; + o2::dataformats::GlobalFwdTrack track(fwdtrack); auto mchTrack = mMatching.FwdtoMCH(track); o2::mch::TrackExtrap::extrapToVertex(mchTrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); auto propmuon = mMatching.MCHtoFwd(mchTrack); @@ -915,10 +934,17 @@ void VarManager::FillEvent(T const& event, float* values) values[kVtxY] = event.posY(); values[kVtxZ] = event.posZ(); values[kVtxNcontrib] = event.numContrib(); - if (fgUsedVars[kIsSel8]) { values[kIsSel8] = (event.tag() & (uint64_t(1) << o2::aod::evsel::kIsTriggerTVX)) > 0; } + if (fgUsedVars[kIsDoubleGap]) { + values[kIsDoubleGap] = (event.tag() & (uint64_t(1) << (56 + kDoubleGap))) > 0; + } + if (fgUsedVars[kIsSingleGap] || fgUsedVars[kIsSingleGapA] || fgUsedVars[kIsSingleGapC]) { + values[kIsSingleGapA] = (event.tag() & (uint64_t(1) << (56 + kSingleGapA))) > 0; + values[kIsSingleGapC] = (event.tag() & (uint64_t(1) << (56 + kSingleGapC))) > 0; + values[kIsSingleGap] = values[kIsSingleGapA] || values[kIsSingleGapC]; + } } if constexpr ((fillMap & ReducedEventExtended) > 0) { @@ -1856,6 +1882,15 @@ void VarManager::FillPairVertexing(C const& collision, T const& t1, T const& t2, (collision.posY() - secondaryVertex[1]) * v12.Py() + (collision.posZ() - secondaryVertex[2]) * v12.Pz()) / (v12.P() * values[VarManager::kVertexingLxyz]); + // Decay length defined as in Run 2 + values[kVertexingLzProjected] = ((secondaryVertex[2] - collision.posZ()) * v12.Pz()) / TMath::Sqrt(v12.Pz() * v12.Pz()); + values[kVertexingLxyProjected] = ((secondaryVertex[0] - collision.posX()) * v12.Px()) + ((secondaryVertex[1] - collision.posY()) * v12.Py()); + values[kVertexingLxyProjected] = values[kVertexingLxyProjected] / TMath::Sqrt((v12.Px() * v12.Px()) + (v12.Py() * v12.Py())); + values[kVertexingLxyzProjected] = ((secondaryVertex[0] - collision.posX()) * v12.Px()) + ((secondaryVertex[1] - collision.posY()) * v12.Py()) + ((secondaryVertex[2] - collision.posZ()) * v12.Pz()); + values[kVertexingLxyzProjected] = values[kVertexingLxyzProjected] / TMath::Sqrt((v12.Px() * v12.Px()) + (v12.Py() * v12.Py()) + (v12.Pz() * v12.Pz())); + values[kVertexingTauxyProjected] = values[kVertexingLxyProjected] * v12.M() / (v12.P()); + values[kVertexingTauxyProjectedNs] = values[kVertexingTauxyProjected] / o2::constants::physics::LightSpeedCm2NS; + values[kVertexingTauzProjected] = values[kVertexingLzProjected] * v12.M() / (v12.P()); } } else { KFParticle trk0KF; @@ -1889,10 +1924,10 @@ void VarManager::FillPairVertexing(C const& collision, T const& t1, T const& t2, KFPVertex kfpVertex = createKFPVertexFromCollision(collision); values[kKFNContributorsPV] = kfpVertex.GetNContributors(); KFParticle KFPV(kfpVertex); - if (fgUsedVars[kVertexingLxy] || fgUsedVars[kVertexingLz] || fgUsedVars[kVertexingLxyz] || fgUsedVars[kVertexingLxyErr] || fgUsedVars[kVertexingLzErr] || fgUsedVars[kVertexingTauxy] || fgUsedVars[kVertexingLxyOverErr] || fgUsedVars[kVertexingLzOverErr] || fgUsedVars[kVertexingLxyzOverErr]) { - double dxPair2PV = KFGeoTwoProng.GetX() - KFPV.GetX(); - double dyPair2PV = KFGeoTwoProng.GetY() - KFPV.GetY(); - double dzPair2PV = KFGeoTwoProng.GetZ() - KFPV.GetZ(); + double dxPair2PV = KFGeoTwoProng.GetX() - KFPV.GetX(); + double dyPair2PV = KFGeoTwoProng.GetY() - KFPV.GetY(); + double dzPair2PV = KFGeoTwoProng.GetZ() - KFPV.GetZ(); + if (fgUsedVars[kVertexingLxy] || fgUsedVars[kVertexingLz] || fgUsedVars[kVertexingLxyz] || fgUsedVars[kVertexingLxyErr] || fgUsedVars[kVertexingLzErr] || fgUsedVars[kVertexingTauxy] || fgUsedVars[kVertexingLxyOverErr] || fgUsedVars[kVertexingLzOverErr] || fgUsedVars[kVertexingLxyzOverErr] || fgUsedVars[kCosPointingAngle]) { values[kVertexingLxy] = std::sqrt(dxPair2PV * dxPair2PV + dyPair2PV * dyPair2PV); values[kVertexingLz] = std::sqrt(dzPair2PV * dzPair2PV); values[kVertexingLxyz] = std::sqrt(dxPair2PV * dxPair2PV + dyPair2PV * dyPair2PV + dzPair2PV * dzPair2PV); @@ -1912,13 +1947,23 @@ void VarManager::FillPairVertexing(C const& collision, T const& t1, T const& t2, values[kVertexingTauz] = dzPair2PV * KFGeoTwoProng.GetMass() / (TMath::Abs(KFGeoTwoProng.GetPz()) * o2::constants::physics::LightSpeedCm2NS); values[kVertexingTauxyErr] = values[kVertexingLxyErr] * KFGeoTwoProng.GetMass() / (KFGeoTwoProng.GetPt() * o2::constants::physics::LightSpeedCm2NS); values[kVertexingTauzErr] = values[kVertexingLzErr] * KFGeoTwoProng.GetMass() / (TMath::Abs(KFGeoTwoProng.GetPz()) * o2::constants::physics::LightSpeedCm2NS); - if (fgUsedVars[kCosPointingAngle]) { - values[kCosPointingAngle] = (std::sqrt(dxPair2PV * dxPair2PV) * v12.Px() + - std::sqrt(dyPair2PV * dyPair2PV) * v12.Py() + - std::sqrt(dzPair2PV * dzPair2PV) * v12.Pz()) / - (v12.P() * values[VarManager::kVertexingLxyz]); - } + values[kCosPointingAngle] = (std::sqrt(dxPair2PV * dxPair2PV) * v12.Px() + + std::sqrt(dyPair2PV * dyPair2PV) * v12.Py() + + std::sqrt(dzPair2PV * dzPair2PV) * v12.Pz()) / + (v12.P() * values[VarManager::kVertexingLxyz]); } + // As defined in Run 2 (projected onto momentum) + if (fgUsedVars[kVertexingLxyProjected] || fgUsedVars[kVertexingLxyzProjected] || fgUsedVars[kVertexingLzProjected]) { + values[kVertexingLzProjected] = (dzPair2PV * KFGeoTwoProng.GetPz()) / TMath::Sqrt(KFGeoTwoProng.GetPz() * KFGeoTwoProng.GetPz()); + values[kVertexingLxyProjected] = (dxPair2PV * KFGeoTwoProng.GetPx()) + (dyPair2PV * KFGeoTwoProng.GetPy()); + values[kVertexingLxyProjected] = values[kVertexingLxyProjected] / TMath::Sqrt((KFGeoTwoProng.GetPx() * KFGeoTwoProng.GetPx()) + (KFGeoTwoProng.GetPy() * KFGeoTwoProng.GetPy())); + values[kVertexingLxyzProjected] = (dxPair2PV * KFGeoTwoProng.GetPx()) + (dyPair2PV * KFGeoTwoProng.GetPy()) + (dzPair2PV * KFGeoTwoProng.GetPz()); + values[kVertexingLxyzProjected] = values[kVertexingLxyzProjected] / TMath::Sqrt((KFGeoTwoProng.GetPx() * KFGeoTwoProng.GetPx()) + (KFGeoTwoProng.GetPy() * KFGeoTwoProng.GetPy()) + (KFGeoTwoProng.GetPz() * KFGeoTwoProng.GetPz())); + values[kVertexingTauxyProjected] = values[kVertexingLxyProjected] * KFGeoTwoProng.GetMass() / (KFGeoTwoProng.GetP()); + values[kVertexingTauxyProjectedNs] = values[kVertexingTauxyProjected] / o2::constants::physics::LightSpeedCm2NS; + values[kVertexingTauzProjected] = values[kVertexingLzProjected] * KFGeoTwoProng.GetMass() / (KFGeoTwoProng.GetP()); + } + if (fgUsedVars[kVertexingLxyOverErr] || fgUsedVars[kVertexingLzOverErr] || fgUsedVars[kVertexingLxyzOverErr]) { values[kVertexingLxyOverErr] = values[kVertexingLxy] / values[kVertexingLxyErr]; values[kVertexingLzOverErr] = values[kVertexingLz] / values[kVertexingLzErr]; @@ -2021,139 +2066,245 @@ void VarManager::FillDileptonTrackVertexing(C const& collision, T1 const& lepton int procCode = 0; int procCodeJpsi = 0; - if constexpr ((candidateType == kBcToThreeMuons) && muonHasCov) { - mlepton = o2::constants::physics::MassMuon; - mtrack = o2::constants::physics::MassMuon; - - double chi21 = lepton1.chi2(); - double chi22 = lepton2.chi2(); - double chi23 = track.chi2(); - SMatrix5 t1pars(lepton1.x(), lepton1.y(), lepton1.phi(), lepton1.tgl(), lepton1.signed1Pt()); - std::vector v1{lepton1.cXX(), lepton1.cXY(), lepton1.cYY(), lepton1.cPhiX(), lepton1.cPhiY(), - lepton1.cPhiPhi(), lepton1.cTglX(), lepton1.cTglY(), lepton1.cTglPhi(), lepton1.cTglTgl(), - lepton1.c1PtX(), lepton1.c1PtY(), lepton1.c1PtPhi(), lepton1.c1PtTgl(), lepton1.c1Pt21Pt2()}; - SMatrix55 t1covs(v1.begin(), v1.end()); - o2::track::TrackParCovFwd pars1{lepton1.z(), t1pars, t1covs, chi21}; - - SMatrix5 t2pars(lepton2.x(), lepton2.y(), lepton2.phi(), lepton2.tgl(), lepton2.signed1Pt()); - std::vector v2{lepton2.cXX(), lepton2.cXY(), lepton2.cYY(), lepton2.cPhiX(), lepton2.cPhiY(), - lepton2.cPhiPhi(), lepton2.cTglX(), lepton2.cTglY(), lepton2.cTglPhi(), lepton2.cTglTgl(), - lepton2.c1PtX(), lepton2.c1PtY(), lepton2.c1PtPhi(), lepton2.c1PtTgl(), lepton2.c1Pt21Pt2()}; - SMatrix55 t2covs(v2.begin(), v2.end()); - o2::track::TrackParCovFwd pars2{lepton2.z(), t2pars, t2covs, chi22}; - - SMatrix5 t3pars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); - std::vector v3{track.cXX(), track.cXY(), track.cYY(), track.cPhiX(), track.cPhiY(), - track.cPhiPhi(), track.cTglX(), track.cTglY(), track.cTglPhi(), track.cTglTgl(), - track.c1PtX(), track.c1PtY(), track.c1PtPhi(), track.c1PtTgl(), track.c1Pt21Pt2()}; - SMatrix55 t3covs(v3.begin(), v3.end()); - o2::track::TrackParCovFwd pars3{track.z(), t3pars, t3covs, chi23}; - procCode = VarManager::fgFitterThreeProngFwd.process(pars1, pars2, pars3); - procCodeJpsi = VarManager::fgFitterTwoProngFwd.process(pars1, pars2); - } else if constexpr ((candidateType == kBtoJpsiEEK) && trackHasCov) { - mlepton = o2::constants::physics::MassElectron; - mtrack = o2::constants::physics::MassKaonCharged; - std::array lepton1pars = {lepton1.y(), lepton1.z(), lepton1.snp(), lepton1.tgl(), lepton1.signed1Pt()}; - std::array lepton1covs = {lepton1.cYY(), lepton1.cZY(), lepton1.cZZ(), lepton1.cSnpY(), lepton1.cSnpZ(), - lepton1.cSnpSnp(), lepton1.cTglY(), lepton1.cTglZ(), lepton1.cTglSnp(), lepton1.cTglTgl(), - lepton1.c1PtY(), lepton1.c1PtZ(), lepton1.c1PtSnp(), lepton1.c1PtTgl(), lepton1.c1Pt21Pt2()}; - o2::track::TrackParCov pars1{lepton1.x(), lepton1.alpha(), lepton1pars, lepton1covs}; - std::array lepton2pars = {lepton2.y(), lepton2.z(), lepton2.snp(), lepton2.tgl(), lepton2.signed1Pt()}; - std::array lepton2covs = {lepton2.cYY(), lepton2.cZY(), lepton2.cZZ(), lepton2.cSnpY(), lepton2.cSnpZ(), - lepton2.cSnpSnp(), lepton2.cTglY(), lepton2.cTglZ(), lepton2.cTglSnp(), lepton2.cTglTgl(), - lepton2.c1PtY(), lepton2.c1PtZ(), lepton2.c1PtSnp(), lepton2.c1PtTgl(), lepton2.c1Pt21Pt2()}; - o2::track::TrackParCov pars2{lepton2.x(), lepton2.alpha(), lepton2pars, lepton2covs}; - std::array lepton3pars = {track.y(), track.z(), track.snp(), track.tgl(), track.signed1Pt()}; - std::array lepton3covs = {track.cYY(), track.cZY(), track.cZZ(), track.cSnpY(), track.cSnpZ(), - track.cSnpSnp(), track.cTglY(), track.cTglZ(), track.cTglSnp(), track.cTglTgl(), - track.c1PtY(), track.c1PtZ(), track.c1PtSnp(), track.c1PtTgl(), track.c1Pt21Pt2()}; - o2::track::TrackParCov pars3{track.x(), track.alpha(), lepton3pars, lepton3covs}; - procCode = VarManager::fgFitterThreeProngBarrel.process(pars1, pars2, pars3); - procCodeJpsi = VarManager::fgFitterTwoProngBarrel.process(pars1, pars2); + values[kUsedKF] = fgUsedKF; + if (!fgUsedKF) { + if constexpr ((candidateType == kBcToThreeMuons) && muonHasCov) { + mlepton = o2::constants::physics::MassMuon; + mtrack = o2::constants::physics::MassMuon; + + double chi21 = lepton1.chi2(); + double chi22 = lepton2.chi2(); + double chi23 = track.chi2(); + SMatrix5 t1pars(lepton1.x(), lepton1.y(), lepton1.phi(), lepton1.tgl(), lepton1.signed1Pt()); + std::vector v1{lepton1.cXX(), lepton1.cXY(), lepton1.cYY(), lepton1.cPhiX(), lepton1.cPhiY(), + lepton1.cPhiPhi(), lepton1.cTglX(), lepton1.cTglY(), lepton1.cTglPhi(), lepton1.cTglTgl(), + lepton1.c1PtX(), lepton1.c1PtY(), lepton1.c1PtPhi(), lepton1.c1PtTgl(), lepton1.c1Pt21Pt2()}; + SMatrix55 t1covs(v1.begin(), v1.end()); + o2::track::TrackParCovFwd pars1{lepton1.z(), t1pars, t1covs, chi21}; + + SMatrix5 t2pars(lepton2.x(), lepton2.y(), lepton2.phi(), lepton2.tgl(), lepton2.signed1Pt()); + std::vector v2{lepton2.cXX(), lepton2.cXY(), lepton2.cYY(), lepton2.cPhiX(), lepton2.cPhiY(), + lepton2.cPhiPhi(), lepton2.cTglX(), lepton2.cTglY(), lepton2.cTglPhi(), lepton2.cTglTgl(), + lepton2.c1PtX(), lepton2.c1PtY(), lepton2.c1PtPhi(), lepton2.c1PtTgl(), lepton2.c1Pt21Pt2()}; + SMatrix55 t2covs(v2.begin(), v2.end()); + o2::track::TrackParCovFwd pars2{lepton2.z(), t2pars, t2covs, chi22}; + + SMatrix5 t3pars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); + std::vector v3{track.cXX(), track.cXY(), track.cYY(), track.cPhiX(), track.cPhiY(), + track.cPhiPhi(), track.cTglX(), track.cTglY(), track.cTglPhi(), track.cTglTgl(), + track.c1PtX(), track.c1PtY(), track.c1PtPhi(), track.c1PtTgl(), track.c1Pt21Pt2()}; + SMatrix55 t3covs(v3.begin(), v3.end()); + o2::track::TrackParCovFwd pars3{track.z(), t3pars, t3covs, chi23}; + procCode = VarManager::fgFitterThreeProngFwd.process(pars1, pars2, pars3); + procCodeJpsi = VarManager::fgFitterTwoProngFwd.process(pars1, pars2); + } else if constexpr ((candidateType == kBtoJpsiEEK) && trackHasCov) { + mlepton = o2::constants::physics::MassElectron; + mtrack = o2::constants::physics::MassKaonCharged; + std::array lepton1pars = {lepton1.y(), lepton1.z(), lepton1.snp(), lepton1.tgl(), lepton1.signed1Pt()}; + std::array lepton1covs = {lepton1.cYY(), lepton1.cZY(), lepton1.cZZ(), lepton1.cSnpY(), lepton1.cSnpZ(), + lepton1.cSnpSnp(), lepton1.cTglY(), lepton1.cTglZ(), lepton1.cTglSnp(), lepton1.cTglTgl(), + lepton1.c1PtY(), lepton1.c1PtZ(), lepton1.c1PtSnp(), lepton1.c1PtTgl(), lepton1.c1Pt21Pt2()}; + o2::track::TrackParCov pars1{lepton1.x(), lepton1.alpha(), lepton1pars, lepton1covs}; + std::array lepton2pars = {lepton2.y(), lepton2.z(), lepton2.snp(), lepton2.tgl(), lepton2.signed1Pt()}; + std::array lepton2covs = {lepton2.cYY(), lepton2.cZY(), lepton2.cZZ(), lepton2.cSnpY(), lepton2.cSnpZ(), + lepton2.cSnpSnp(), lepton2.cTglY(), lepton2.cTglZ(), lepton2.cTglSnp(), lepton2.cTglTgl(), + lepton2.c1PtY(), lepton2.c1PtZ(), lepton2.c1PtSnp(), lepton2.c1PtTgl(), lepton2.c1Pt21Pt2()}; + o2::track::TrackParCov pars2{lepton2.x(), lepton2.alpha(), lepton2pars, lepton2covs}; + std::array lepton3pars = {track.y(), track.z(), track.snp(), track.tgl(), track.signed1Pt()}; + std::array lepton3covs = {track.cYY(), track.cZY(), track.cZZ(), track.cSnpY(), track.cSnpZ(), + track.cSnpSnp(), track.cTglY(), track.cTglZ(), track.cTglSnp(), track.cTglTgl(), + track.c1PtY(), track.c1PtZ(), track.c1PtSnp(), track.c1PtTgl(), track.c1Pt21Pt2()}; + o2::track::TrackParCov pars3{track.x(), track.alpha(), lepton3pars, lepton3covs}; + procCode = VarManager::fgFitterThreeProngBarrel.process(pars1, pars2, pars3); + procCodeJpsi = VarManager::fgFitterTwoProngBarrel.process(pars1, pars2); + } else { + return; + } + + ROOT::Math::PtEtaPhiMVector v1(lepton1.pt(), lepton1.eta(), lepton1.phi(), mlepton); + ROOT::Math::PtEtaPhiMVector v2(lepton2.pt(), lepton2.eta(), lepton2.phi(), mlepton); + ROOT::Math::PtEtaPhiMVector v3(track.pt(), track.eta(), track.phi(), mtrack); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + ROOT::Math::PtEtaPhiMVector vdilepton(v12.pt(), v12.eta(), v12.phi(), v12.M()); + ROOT::Math::PtEtaPhiMVector v123 = vdilepton + v3; + values[VarManager::kPairMass] = v123.M(); + values[VarManager::kPairPt] = v123.Pt(); + values[VarManager::kPairEta] = v123.Eta(); + if (fgUsedVars[kPairMassDau] || fgUsedVars[kPairPtDau]) { + values[VarManager::kPairMassDau] = v12.M(); + values[VarManager::kPairPtDau] = v12.Pt(); + } + values[VarManager::kPt] = track.pt(); + + values[VarManager::kVertexingProcCode] = procCode; + if (procCode == 0 || procCodeJpsi == 0) { + // TODO: set the other variables to appropriate values and return + values[VarManager::kVertexingChi2PCA] = -999.; + values[VarManager::kVertexingLxy] = -999.; + values[VarManager::kVertexingLxyz] = -999.; + values[VarManager::kVertexingLz] = -999.; + values[VarManager::kVertexingLxyErr] = -999.; + values[VarManager::kVertexingLxyzErr] = -999.; + values[VarManager::kVertexingLzErr] = -999.; + + values[VarManager::kVertexingTauxy] = -999.; + values[VarManager::kVertexingTauz] = -999.; + values[VarManager::kVertexingTauxyErr] = -999.; + values[VarManager::kVertexingTauzErr] = -999.; + return; + } + + Vec3D secondaryVertex; + + if constexpr (eventHasVtxCov) { + std::array covMatrixPCA; + o2::dataformats::DCA impactParameter0; + o2::dataformats::DCA impactParameter1; + + o2::math_utils::Point3D vtxXYZ(collision.posX(), collision.posY(), collision.posZ()); + std::array vtxCov{collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()}; + o2::dataformats::VertexBase primaryVertex = {std::move(vtxXYZ), std::move(vtxCov)}; + auto covMatrixPV = primaryVertex.getCov(); + + if constexpr (candidateType == kBtoJpsiEEK && trackHasCov) { + secondaryVertex = fgFitterThreeProngBarrel.getPCACandidate(); + covMatrixPCA = fgFitterThreeProngBarrel.calcPCACovMatrixFlat(); + } else if constexpr (candidateType == kBcToThreeMuons && muonHasCov) { + secondaryVertex = fgFitterThreeProngFwd.getPCACandidate(); + covMatrixPCA = fgFitterThreeProngFwd.calcPCACovMatrixFlat(); + } + + auto chi2PCA = fgFitterThreeProngBarrel.getChi2AtPCACandidate(); + if (fgUsedVars[kVertexingChi2PCA]) + values[VarManager::kVertexingChi2PCA] = chi2PCA; + + double phi = std::atan2(secondaryVertex[1] - collision.posY(), secondaryVertex[0] - collision.posX()); + double theta = std::atan2(secondaryVertex[2] - collision.posZ(), + std::sqrt((secondaryVertex[0] - collision.posX()) * (secondaryVertex[0] - collision.posX()) + + (secondaryVertex[1] - collision.posY()) * (secondaryVertex[1] - collision.posY()))); + if (fgUsedVars[kVertexingLxy] || fgUsedVars[kVertexingLz] || fgUsedVars[kVertexingLxyz]) { + + values[VarManager::kVertexingLxy] = (collision.posX() - secondaryVertex[0]) * (collision.posX() - secondaryVertex[0]) + + (collision.posY() - secondaryVertex[1]) * (collision.posY() - secondaryVertex[1]); + values[VarManager::kVertexingLxy] = std::sqrt(values[VarManager::kVertexingLxy]); + values[VarManager::kVertexingLz] = (collision.posZ() - secondaryVertex[2]) * (collision.posZ() - secondaryVertex[2]); + values[VarManager::kVertexingLz] = std::sqrt(values[VarManager::kVertexingLz]); + values[VarManager::kVertexingLxyz] = values[VarManager::kVertexingLxy] + values[VarManager::kVertexingLz]; + values[VarManager::kVertexingLxyz] = std::sqrt(values[VarManager::kVertexingLxyz]); + } + + if (fgUsedVars[kVertexingLxyzErr] || fgUsedVars[kVertexingLxyErr] || fgUsedVars[kVertexingLzErr]) { + values[kVertexingLxyzErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); + values[kVertexingLxyErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); + values[kVertexingLzErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, 0, theta) + getRotatedCovMatrixXX(covMatrixPCA, 0, theta)); + } + + values[kVertexingTauz] = (collision.posZ() - secondaryVertex[2]) * v123.M() / (TMath::Abs(v123.Pz()) * o2::constants::physics::LightSpeedCm2NS); + values[kVertexingTauxy] = values[kVertexingLxy] * v123.M() / (v123.P() * o2::constants::physics::LightSpeedCm2NS); + + values[kVertexingTauzErr] = values[kVertexingLzErr] * v123.M() / (TMath::Abs(v123.Pz()) * o2::constants::physics::LightSpeedCm2NS); + values[kVertexingTauxyErr] = values[kVertexingLxyErr] * v123.M() / (v123.P() * o2::constants::physics::LightSpeedCm2NS); + + if (fgUsedVars[kCosPointingAngle] && fgUsedVars[kVertexingLxyz]) { + values[VarManager::kCosPointingAngle] = ((collision.posX() - secondaryVertex[0]) * v123.Px() + + (collision.posY() - secondaryVertex[1]) * v123.Py() + + (collision.posZ() - secondaryVertex[2]) * v123.Pz()) / + (v123.P() * values[VarManager::kVertexingLxyz]); + } + // run 2 definitions: Lxy projected onto the momentum vector of the candidate + if (fgUsedVars[kVertexingLxyProjected] || fgUsedVars[kVertexingLxyzProjected] || values[kVertexingTauxyProjected]) { + values[kVertexingLzProjected] = (secondaryVertex[2] - collision.posZ()) * v123.Pz(); + values[kVertexingLzProjected] = values[kVertexingLzProjected] / TMath::Sqrt(v123.Pz() * v123.Pz()); + values[kVertexingLxyProjected] = ((secondaryVertex[0] - collision.posX()) * v123.Px()) + ((secondaryVertex[1] - collision.posY()) * v123.Py()); + values[kVertexingLxyProjected] = values[kVertexingLxyProjected] / TMath::Sqrt((v123.Px() * v123.Px()) + (v123.Py() * v123.Py())); + values[kVertexingLxyzProjected] = ((secondaryVertex[0] - collision.posX()) * v123.Px()) + ((secondaryVertex[1] - collision.posY()) * v123.Py()) + ((secondaryVertex[2] - collision.posZ()) * v123.Pz()); + values[kVertexingLxyzProjected] = values[kVertexingLxyzProjected] / TMath::Sqrt((v123.Px() * v123.Px()) + (v123.Py() * v123.Py()) + (v123.Pz() * v123.Pz())); + values[kVertexingTauzProjected] = values[kVertexingLzProjected] * v123.M() / (v123.P()); + values[kVertexingTauxyProjected] = values[kVertexingLxyProjected] * v123.M() / (v123.P()); + } + } } else { - return; - } + KFParticle lepton1KF; + KFParticle lepton2KF; + KFParticle hadronKF; + KFParticle KFGeoThreeProngBarrel; + + if constexpr ((candidateType == kBtoJpsiEEK) && trackHasCov) { + KFPTrack kfpTrack0 = createKFPTrackFromTrack(lepton1); + lepton1KF = KFParticle(kfpTrack0, 11 * lepton1.sign()); + KFPTrack kfpTrack1 = createKFPTrackFromTrack(lepton2); + lepton2KF = KFParticle(kfpTrack1, 11 * lepton2.sign()); + KFPTrack kfpTrack2 = createKFPTrackFromTrack(track); + hadronKF = KFParticle(kfpTrack2, 321 * track.sign()); // kaon mass + + KFGeoThreeProngBarrel.SetConstructMethod(2); + KFGeoThreeProngBarrel.AddDaughter(lepton1KF); + KFGeoThreeProngBarrel.AddDaughter(lepton2KF); + + if (fgUsedVars[kPairMassDau] || fgUsedVars[kPairPtDau]) { + values[VarManager::kPairMassDau] = KFGeoThreeProngBarrel.GetMass(); + values[VarManager::kPairPtDau] = KFGeoThreeProngBarrel.GetPt(); + } - ROOT::Math::PtEtaPhiMVector v1(lepton1.pt(), lepton1.eta(), lepton1.phi(), mlepton); - ROOT::Math::PtEtaPhiMVector v2(lepton2.pt(), lepton2.eta(), lepton2.phi(), mlepton); - ROOT::Math::PtEtaPhiMVector v3(track.pt(), track.eta(), track.phi(), mtrack); - ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - ROOT::Math::PtEtaPhiMVector vdilepton(v12.pt(), v12.eta(), v12.phi(), v12.M()); - ROOT::Math::PtEtaPhiMVector v123 = vdilepton + v3; - values[VarManager::kPairMass] = v123.M(); - values[VarManager::kPairPt] = v123.Pt(); - values[VarManager::kPairEta] = v123.Eta(); - - values[VarManager::kPairMassDau] = v12.M(); - values[VarManager::kPairPtDau] = v12.Pt(); - values[VarManager::kPt] = track.pt(); - - values[VarManager::kVertexingProcCode] = procCode; - if (procCode == 0 || procCodeJpsi == 0) { - // TODO: set the other variables to appropriate values and return - values[VarManager::kVertexingChi2PCA] = -999.; - values[VarManager::kVertexingLxy] = -999.; - values[VarManager::kVertexingLxyz] = -999.; - values[VarManager::kVertexingLz] = -999.; - values[VarManager::kVertexingLxyErr] = -999.; - values[VarManager::kVertexingLxyzErr] = -999.; - values[VarManager::kVertexingLzErr] = -999.; - - values[VarManager::kVertexingTauxy] = -999.; - values[VarManager::kVertexingTauz] = -999.; - values[VarManager::kVertexingTauxyErr] = -999.; - values[VarManager::kVertexingTauzErr] = -999.; - return; - } - - Vec3D secondaryVertex; - - if constexpr (eventHasVtxCov) { - std::array covMatrixPCA; - o2::dataformats::DCA impactParameter0; - o2::dataformats::DCA impactParameter1; - - o2::math_utils::Point3D vtxXYZ(collision.posX(), collision.posY(), collision.posZ()); - std::array vtxCov{collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()}; - o2::dataformats::VertexBase primaryVertex = {std::move(vtxXYZ), std::move(vtxCov)}; - auto covMatrixPV = primaryVertex.getCov(); - - if constexpr (candidateType == kBtoJpsiEEK && trackHasCov) { - secondaryVertex = fgFitterThreeProngBarrel.getPCACandidate(); - covMatrixPCA = fgFitterThreeProngBarrel.calcPCACovMatrixFlat(); - } else if constexpr (candidateType == kBcToThreeMuons && muonHasCov) { - secondaryVertex = fgFitterThreeProngFwd.getPCACandidate(); - covMatrixPCA = fgFitterThreeProngFwd.calcPCACovMatrixFlat(); - } - - double phi = std::atan2(secondaryVertex[1] - collision.posY(), secondaryVertex[0] - collision.posX()); - double theta = std::atan2(secondaryVertex[2] - collision.posZ(), - std::sqrt((secondaryVertex[0] - collision.posX()) * (secondaryVertex[0] - collision.posX()) + - (secondaryVertex[1] - collision.posY()) * (secondaryVertex[1] - collision.posY()))); - - values[kVertexingLxyzErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); - values[kVertexingLxyErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); - values[kVertexingLzErr] = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, 0, theta) + getRotatedCovMatrixXX(covMatrixPCA, 0, theta)); - - values[VarManager::kVertexingLxy] = (collision.posX() - secondaryVertex[0]) * (collision.posX() - secondaryVertex[0]) + - (collision.posY() - secondaryVertex[1]) * (collision.posY() - secondaryVertex[1]); - values[VarManager::kVertexingLz] = (collision.posZ() - secondaryVertex[2]) * (collision.posZ() - secondaryVertex[2]); - values[VarManager::kVertexingLxyz] = values[VarManager::kVertexingLxy] + values[VarManager::kVertexingLz]; - values[VarManager::kVertexingLxy] = std::sqrt(values[VarManager::kVertexingLxy]); - values[VarManager::kVertexingLz] = std::sqrt(values[VarManager::kVertexingLz]); - values[VarManager::kVertexingLxyz] = std::sqrt(values[VarManager::kVertexingLxyz]); - - values[kVertexingTauz] = (collision.posZ() - secondaryVertex[2]) * v123.M() / (TMath::Abs(v123.Pz()) * o2::constants::physics::LightSpeedCm2NS); - values[kVertexingTauxy] = values[kVertexingLxy] * v123.M() / (v123.P() * o2::constants::physics::LightSpeedCm2NS); - - values[kVertexingTauzErr] = values[kVertexingLzErr] * v123.M() / (TMath::Abs(v123.Pz()) * o2::constants::physics::LightSpeedCm2NS); - values[kVertexingTauxyErr] = values[kVertexingLxyErr] * v123.M() / (v123.P() * o2::constants::physics::LightSpeedCm2NS); - - values[VarManager::kCosPointingAngle] = ((collision.posX() - secondaryVertex[0]) * v123.Px() + - (collision.posY() - secondaryVertex[1]) * v123.Py() + - (collision.posZ() - secondaryVertex[2]) * v123.Pz()) / - (v123.P() * values[VarManager::kVertexingLxyz]); - } + // Quantities between 3rd prong and candidate + if (fgUsedVars[kKFDCAxyzBetweenProngs]) + values[kKFDCAxyzBetweenProngs] = KFGeoThreeProngBarrel.GetDistanceFromParticle(hadronKF); + + KFGeoThreeProngBarrel.AddDaughter(hadronKF); // third prong + + if (fgUsedVars[kKFMass]) + values[kKFMass] = KFGeoThreeProngBarrel.GetMass(); + + if constexpr (eventHasVtxCov) { + KFPVertex kfpVertex = createKFPVertexFromCollision(collision); + KFParticle KFPV(kfpVertex); + double dxTriplet3PV = KFGeoThreeProngBarrel.GetX() - KFPV.GetX(); + double dyTriplet3PV = KFGeoThreeProngBarrel.GetY() - KFPV.GetY(); + double dzTriplet3PV = KFGeoThreeProngBarrel.GetZ() - KFPV.GetZ(); + + if (fgUsedVars[kVertexingLxy] || fgUsedVars[kVertexingLz] || fgUsedVars[kVertexingLxyz] || fgUsedVars[kVertexingLxyErr] || fgUsedVars[kVertexingLzErr] || fgUsedVars[kVertexingTauxy] || fgUsedVars[kVertexingLxyOverErr] || fgUsedVars[kVertexingLzOverErr] || fgUsedVars[kVertexingLxyzOverErr] || fgUsedVars[kCosPointingAngle]) { + values[kVertexingLxy] = std::sqrt(dxTriplet3PV * dxTriplet3PV + dyTriplet3PV * dyTriplet3PV); + values[kVertexingLz] = std::sqrt(dzTriplet3PV * dzTriplet3PV); + values[kVertexingLxyz] = std::sqrt(dxTriplet3PV * dxTriplet3PV + dyTriplet3PV * dyTriplet3PV + dzTriplet3PV * dzTriplet3PV); + values[kVertexingLxyErr] = (KFPV.GetCovariance(0) + KFGeoThreeProngBarrel.GetCovariance(0)) * dxTriplet3PV * dxTriplet3PV + (KFPV.GetCovariance(2) + KFGeoThreeProngBarrel.GetCovariance(2)) * dyTriplet3PV * dyTriplet3PV + 2 * ((KFPV.GetCovariance(1) + KFGeoThreeProngBarrel.GetCovariance(1)) * dxTriplet3PV * dyTriplet3PV); + values[kVertexingLzErr] = (KFPV.GetCovariance(5) + KFGeoThreeProngBarrel.GetCovariance(5)) * dzTriplet3PV * dzTriplet3PV; + values[kVertexingLxyzErr] = (KFPV.GetCovariance(0) + KFGeoThreeProngBarrel.GetCovariance(0)) * dxTriplet3PV * dxTriplet3PV + (KFPV.GetCovariance(2) + KFGeoThreeProngBarrel.GetCovariance(2)) * dyTriplet3PV * dyTriplet3PV + (KFPV.GetCovariance(5) + KFGeoThreeProngBarrel.GetCovariance(5)) * dzTriplet3PV * dzTriplet3PV + 2 * ((KFPV.GetCovariance(1) + KFGeoThreeProngBarrel.GetCovariance(1)) * dxTriplet3PV * dyTriplet3PV + (KFPV.GetCovariance(3) + KFGeoThreeProngBarrel.GetCovariance(3)) * dxTriplet3PV * dzTriplet3PV + (KFPV.GetCovariance(4) + KFGeoThreeProngBarrel.GetCovariance(4)) * dyTriplet3PV * dzTriplet3PV); + if (fabs(values[kVertexingLxy]) < 1.e-8f) + values[kVertexingLxy] = 1.e-8f; + values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy]; + if (fabs(values[kVertexingLz]) < 1.e-8f) + values[kVertexingLz] = 1.e-8f; + values[kVertexingLzErr] = values[kVertexingLzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLzErr]) / values[kVertexingLz]; + if (fabs(values[kVertexingLxyz]) < 1.e-8f) + values[kVertexingLxyz] = 1.e-8f; + values[kVertexingLxyzErr] = values[kVertexingLxyzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyzErr]) / values[kVertexingLxyz]; + + if (fgUsedVars[kVertexingTauxy]) + values[kVertexingTauxy] = KFGeoThreeProngBarrel.GetPseudoProperDecayTime(KFPV, KFGeoThreeProngBarrel.GetMass()) / (o2::constants::physics::LightSpeedCm2NS); + if (fgUsedVars[kVertexingTauxyErr]) + values[kVertexingTauxyErr] = values[kVertexingLxyErr] * KFGeoThreeProngBarrel.GetMass() / (KFGeoThreeProngBarrel.GetPt() * o2::constants::physics::LightSpeedCm2NS); + + if (fgUsedVars[kCosPointingAngle]) + values[VarManager::kCosPointingAngle] = (dxTriplet3PV * KFGeoThreeProngBarrel.GetPx() + + dyTriplet3PV * KFGeoThreeProngBarrel.GetPy() + + dzTriplet3PV * KFGeoThreeProngBarrel.GetPz()) / + (KFGeoThreeProngBarrel.GetP() * values[VarManager::kVertexingLxyz]); + } // end calculate vertex variables + + // As defined in Run 2 (projected onto momentum) + if (fgUsedVars[kVertexingLxyProjected] || fgUsedVars[kVertexingLxyzProjected] || fgUsedVars[kVertexingLzProjected]) { + values[kVertexingLzProjected] = (dzTriplet3PV * KFGeoThreeProngBarrel.GetPz()) / TMath::Sqrt(KFGeoThreeProngBarrel.GetPz() * KFGeoThreeProngBarrel.GetPz()); + values[kVertexingLxyProjected] = (dxTriplet3PV * KFGeoThreeProngBarrel.GetPx()) + (dyTriplet3PV * KFGeoThreeProngBarrel.GetPy()); + values[kVertexingLxyProjected] = values[kVertexingLxyProjected] / TMath::Sqrt((KFGeoThreeProngBarrel.GetPx() * KFGeoThreeProngBarrel.GetPx()) + (KFGeoThreeProngBarrel.GetPy() * KFGeoThreeProngBarrel.GetPy())); + values[kVertexingLxyzProjected] = (dxTriplet3PV * KFGeoThreeProngBarrel.GetPx()) + (dyTriplet3PV * KFGeoThreeProngBarrel.GetPy()) + (dzTriplet3PV * KFGeoThreeProngBarrel.GetPz()); + values[kVertexingLxyzProjected] = values[kVertexingLxyzProjected] / TMath::Sqrt((KFGeoThreeProngBarrel.GetPx() * KFGeoThreeProngBarrel.GetPx()) + (KFGeoThreeProngBarrel.GetPy() * KFGeoThreeProngBarrel.GetPy()) + (KFGeoThreeProngBarrel.GetPz() * KFGeoThreeProngBarrel.GetPz())); + values[kVertexingTauxyProjected] = (values[kVertexingLxyProjected] * KFGeoThreeProngBarrel.GetMass()) / (KFGeoThreeProngBarrel.GetP()); + values[kVertexingTauxyProjectedNs] = values[kVertexingTauxyProjected] / o2::constants::physics::LightSpeedCm2NS; + values[kVertexingTauzProjected] = (values[kVertexingLzProjected] * KFGeoThreeProngBarrel.GetMass()) / KFGeoThreeProngBarrel.GetP(); + } // end Run 2 quantities + } // end eventHasVtxCov + } // end (candidateType == kBtoJpsiEEK) && trackHasCov + } // end KF } template diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index f1bee4f2598..bceba871f45 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -242,7 +242,7 @@ struct TableMaker { context.mOptions.get("processMuonOnlyWithMults") || context.mOptions.get("processMuonOnlyWithCentAndMults") || context.mOptions.get("processMuonOnlyWithCovAndCent") || context.mOptions.get("processMuonOnlyWithCov") || context.mOptions.get("processMuonOnlyWithCovAndEventFilter") || context.mOptions.get("processMuonOnlyWithEventFilter") || - context.mOptions.get("processAmbiguousMuonOnlyWithCov") || context.mOptions.get("processAmbiguousMuonOnly") || + context.mOptions.get("processMuonOnlyWithMultsAndEventFilter") || context.mOptions.get("processAmbiguousMuonOnlyWithCov") || context.mOptions.get("processAmbiguousMuonOnly") || context.mOptions.get("processMuonMLOnly") || context.mOptions.get("processMuonMLOnly")); if (enableBarrelHistos) { @@ -369,9 +369,9 @@ struct TableMaker { if (collision.sel7()) { tag |= (uint64_t(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map } - // Put the 32 first bits of the event filter in the last 32 bits of the tag + // Put the 8 first bits of the event filter in the last 8 bits of the tag if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0) { - tag |= (collision.eventFilter() << 32); + tag |= (collision.eventFilter() << 56); } VarManager::ResetValues(0, VarManager::kNEventWiseVariables); @@ -1338,6 +1338,21 @@ struct TableMaker { } } + // Produce muon tables only, with multiplicity and event filtering ---------------------------------------------------------------------------------------- + void processMuonOnlyWithMultsAndEventFilter(MyEventsWithMultsAndFilter::iterator const& collision, aod::BCsWithTimestamps const& bcs, + soa::Filtered const& tracksMuon) + { + for (int i = 0; i < kNaliases; i++) { + if (collision.alias_bit(i) > 0) { + (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); + } + } + (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(kNaliases)); + if (collision.eventFilter()) { + fullSkimming(collision, bcs, nullptr, tracksMuon, nullptr, nullptr); + } + } + // Produce MFT tracks tables and muons, with event filtering ------------------------------------------------------------------------------------------------------------------ void processMuonsAndMFTWithFilter(MyEventsWithFilter::iterator const& collision, aod::BCsWithTimestamps const& bcs, aod::MFTTracks const& tracksMft, soa::Filtered const& tracksMuon) @@ -1464,6 +1479,7 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processBarrelOnly, "Build barrel-only DQ skimmed data model, w/o centrality", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCent, "Build muon-only DQ skimmed data model, w/ centrality", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithMults, "Build muon-only DQ skimmed data model, w/ multiplicity", false); + PROCESS_SWITCH(TableMaker, processMuonOnlyWithMultsAndEventFilter, "Build muon-only DQ skimmed data model, w/ multiplicity, w/ event filter", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCentAndMults, "Build muon-only DQ skimmed data model, w/ centrality and multiplicities", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCovAndCent, "Build muon-only DQ skimmed data model, w/ centrality and muon cov matrix", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCov, "Build muon-only DQ skimmed data model, w/ muon cov matrix", false); diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index b848c7f9114..f02a07d5dee 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -860,7 +860,7 @@ struct TableMakerMC { fStatsList.setObject(new TList()); fStatsList->SetOwner(kTRUE); std::vector eventLabels{"BCs", "Collisions before filtering", "Before cuts", "After cuts"}; - TH2I* histEvents = new TH2I("EventStats", "Event statistics", eventLabels.size(), -0.5, eventLabels.size() - 0.5, kNaliases + 1, -0.5, kNaliases + 0.5); + TH2I* histEvents = new TH2I("EventStats", "Event statistics", eventLabels.size(), -0.5, eventLabels.size() - 0.5, (float)kNaliases + 1, -0.5, (float)kNaliases + 0.5); int ib = 1; for (auto label = eventLabels.begin(); label != eventLabels.end(); label++, ib++) { histEvents->GetXaxis()->SetBinLabel(ib, (*label).Data()); diff --git a/PWGDQ/Tasks/filterPbPb.cxx b/PWGDQ/Tasks/filterPbPb.cxx index 92499deea68..1e7bac9c9bc 100644 --- a/PWGDQ/Tasks/filterPbPb.cxx +++ b/PWGDQ/Tasks/filterPbPb.cxx @@ -9,6 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +#include +#include #include #include #include "Framework/AnalysisTask.h" @@ -33,12 +35,7 @@ using namespace o2::aod; using MyEvents = soa::Join; using MyBCs = soa::Join; -using MyBarrelTracks = soa::Join; - +using MyBarrelTracks = soa::Join; using MyMuons = aod::FwdTracks; constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision; @@ -48,9 +45,10 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses); struct DQFilterPbPbTask { Produces eventFilter; OutputObj fStats{"Statistics"}; - OutputObj fIsEventDGOutcome{TH1F("Filter outcome", "Filter outcome", 7, -0.5, 6.5)}; + OutputObj fIsEventDGOutcome{TH1F("Filter outcome", "Filter outcome", 8, -1.5, 6.5)}; Configurable fConfigBarrelSelections{"cfgBarrelSels", "jpsiPID1:2:5", "::,[::],..."}; + Configurable fConfigEventTypes{"cfgEventTypes", "doublegap,singlegap", "Which event types to select. doublegap, singlegap or both, comma separated"}; Configurable fConfigNDtColl{"cfgNDtColl", 4, "Number of standard deviations to consider in BC range"}; Configurable fConfigMinNBCs{"cfgMinNBCs", 7, "Minimum number of BCs to consider in BC range"}; Configurable fConfigMinNPVCs{"cfgMinNPVCs", 2, "Minimum number of PV contributors"}; @@ -73,17 +71,21 @@ struct DQFilterPbPbTask { std::vector fBarrelNminTracks; // minimal number of tracks in barrel std::vector fBarrelNmaxTracks; // maximal number of tracks in barrel + int eventTypeMap = 0; + std::vector eventTypeOptions = {"doublegap", "singlegap"}; // Map for which types of event to select + // Helper function for selecting DG events template uint64_t isEventDG(TEvent const& collision, TBCs const& bcs, TTracks const& tracks, TMuons const& muons, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds, - std::vector FITAmpLimits, int nDtColl, int minNBCs, int minNPVCs, int maxNPVCs, float maxFITTime, + int eventTypes, std::vector FITAmpLimits, int nDtColl, int minNBCs, int minNPVCs, int maxNPVCs, float maxFITTime, bool useFV0, bool useFT0, bool useFDD, bool doVetoFwd, bool doVetoBarrel) { fIsEventDGOutcome->Fill(0., 1.); // Find BC associated with collision if (!collision.has_foundBC()) { - return -1; + fIsEventDGOutcome->Fill(-1., 1); + return 0; } // foundBCId is stored in EvSels auto bc = collision.template foundBC_as(); @@ -207,12 +209,17 @@ struct DQFilterPbPbTask { // Compute FIT decision uint64_t FITDecision = 0; - if (isSideAClean && isSideCClean) { - FITDecision |= (uint64_t(1) << VarManager::kDoubleGap); - } else if (isSideAClean && !isSideCClean) { - FITDecision |= (uint64_t(1) << VarManager::kSingleGapA); - } else if (!isSideAClean && isSideCClean) { - FITDecision |= (uint64_t(1) << VarManager::kSingleGapC); + if (eventTypes & (uint32_t(1) << 0)) { + if (isSideAClean && isSideCClean) { + FITDecision |= (uint64_t(1) << VarManager::kDoubleGap); + } + } + if (eventTypes & (uint32_t(1) << 1)) { + if (isSideAClean && !isSideCClean) { + FITDecision |= (uint64_t(1) << VarManager::kSingleGapA); + } else if (!isSideAClean && isSideCClean) { + FITDecision |= (uint64_t(1) << VarManager::kSingleGapC); + } } if (!FITDecision) { fIsEventDGOutcome->Fill(2, 1); @@ -289,6 +296,17 @@ struct DQFilterPbPbTask { void init(o2::framework::InitContext&) { DefineCuts(); + + TString eventTypesString = fConfigEventTypes.value; + for (std::vector::size_type i = 0; i < eventTypeOptions.size(); i++) { + if (eventTypesString.Contains(eventTypeOptions[i])) { + eventTypeMap |= (uint32_t(1) << i); + LOGF(info, "filterPbPb will select '%s' events", eventTypeOptions[i]); + } + } + if (eventTypeMap == 0) { + LOGF(fatal, "No valid choice of event types to select. Use 'doublegap', 'singlegap' or both"); + } } template @@ -299,7 +317,7 @@ struct DQFilterPbPbTask { std::vector FITAmpLimits = {fConfigFV0AmpLimit, fConfigFT0AAmpLimit, fConfigFT0CAmpLimit, fConfigFDDAAmpLimit, fConfigFDDCAmpLimit}; uint64_t filter = isEventDG(collision, bcs, tracks, muons, ft0s, fv0as, fdds, - FITAmpLimits, fConfigNDtColl, fConfigMinNBCs, fConfigMinNPVCs, fConfigMaxNPVCs, fConfigMaxFITTime, + eventTypeMap, FITAmpLimits, fConfigNDtColl, fConfigMinNBCs, fConfigMinNPVCs, fConfigMaxNPVCs, fConfigMaxFITTime, fConfigUseFV0, fConfigUseFT0, fConfigUseFDD, fConfigVetoForward, fConfigVetoBarrel); bool isSelected = filter; diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 0989bb74ffe..bca09220b93 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -58,12 +58,22 @@ namespace dqanalysisflags // TODO: the barrel amd muon selection columns are bit maps so unsigned types should be used, however, for now this is not supported in Filter expressions // TODO: For now in the tasks we just statically convert from unsigned int to int, which should be fine as long as we do // not use a large number of bits (>=30) +// Bcandidate columns for ML analysis of B->Jpsi+K DECLARE_SOA_COLUMN(MixingHash, mixingHash, int); DECLARE_SOA_COLUMN(IsEventSelected, isEventSelected, int); DECLARE_SOA_COLUMN(IsBarrelSelected, isBarrelSelected, int); DECLARE_SOA_COLUMN(IsMuonSelected, isMuonSelected, int); DECLARE_SOA_COLUMN(IsBarrelSelectedPrefilter, isBarrelSelectedPrefilter, int); DECLARE_SOA_COLUMN(IsPrefilterVetoed, isPrefilterVetoed, int); +DECLARE_SOA_COLUMN(massBcandidate, MBcandidate, float); +DECLARE_SOA_COLUMN(pTBcandidate, PtBcandidate, float); +DECLARE_SOA_COLUMN(LxyBcandidate, lxyBcandidate, float); +DECLARE_SOA_COLUMN(LxyzBcandidate, lxyzBcandidate, float); +DECLARE_SOA_COLUMN(LzBcandidate, lzBcandidate, float); +DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); +DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); +DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); +DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); } // namespace dqanalysisflags DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); @@ -71,6 +81,7 @@ DECLARE_SOA_TABLE(MixingHashes, "AOD", "DQANAMIXHASH", dqanalysisflags::MixingHa DECLARE_SOA_TABLE(BarrelTrackCuts, "AOD", "DQANATRKCUTS", dqanalysisflags::IsBarrelSelected, dqanalysisflags::IsBarrelSelectedPrefilter); DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsPrefilterVetoed); +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); } // namespace o2::aod // Declarations of various short names @@ -1187,6 +1198,9 @@ struct AnalysisDileptonHadron { // This can be used also in the dilepton-hadron correlation analysis. However, in this model of the task, we use all the dileptons produced in the // lepton pairing task to combine them with the hadrons selected by the barrel track selection. // To be modified/adapted if new requirements appear + float mMagField = 0.0; + o2::parameters::GRPMagField* grpmag = nullptr; + int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. OutputObj fOutputList{"output"}; // TODO: For now this is only used to determine the position in the filter bit map for the hadron cut @@ -1196,9 +1210,17 @@ struct AnalysisDileptonHadron { Configurable fConfigMixingDepth{"cfgMixingDepth", 5, "Event mixing pool depth"}; Configurable fConfigDileptonLowMass{"cfgDileptonLowMass", 2.8, "Low mass cut for the dileptons used in analysis"}; Configurable fConfigDileptonHighMass{"cfgDileptonHighMass", 3.2, "High mass cut for the dileptons used in analysis"}; + Configurable fConfigDileptonpTCut{"cfgDileptonpTCut", 0.0, "pT cut for dileptons used in the triplet vertexing"}; + Configurable fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; + Configurable fUseRemoteField{"cfgUseRemoteField", false, "Chose whether to fetch the magnetic field from ccdb or set it manually"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"}; + + Service ccdb; + Produces BmesonsTable; Filter eventFilter = aod::dqanalysisflags::isEventSelected == 1; - Filter dileptonFilter = aod::reducedpair::mass > fConfigDileptonLowMass.value&& aod::reducedpair::mass < fConfigDileptonHighMass.value&& aod::reducedpair::sign == 0; + Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut.value&& aod::reducedpair::mass > fConfigDileptonLowMass.value&& aod::reducedpair::mass < fConfigDileptonHighMass.value&& aod::reducedpair::sign == 0; Filter filterBarrelTrackSelected = aod::dqanalysisflags::isBarrelSelected > 0; constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map @@ -1217,6 +1239,7 @@ struct AnalysisDileptonHadron { void init(o2::framework::InitContext& context) { + fCurrentRun = 0; fValuesDilepton = new float[VarManager::kNVars]; fValuesHadron = new float[VarManager::kNVars]; VarManager::SetDefaultVarNames(); @@ -1249,6 +1272,31 @@ struct AnalysisDileptonHadron { template void runDileptonHadron(TEvent const& event, TTracks const& tracks, soa::Filtered const& dileptons) { + + // set up KF or DCAfitter + if (fCurrentRun != event.runNumber()) { // start: runNumber + if (fUseRemoteField.value) { + grpmag = ccdb->getForTimeStamp(grpmagPath, event.timestamp()); + if (grpmag != nullptr) { + mMagField = grpmag->getNominalL3Field(); + } else { + LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", event.timestamp()); + } + if (fConfigUseKFVertexing.value) { + VarManager::SetupThreeProngKFParticle(mMagField); + } else { + VarManager::SetupThreeProngDCAFitter(); // TODO: get these parameters from Configurables + } + } else { + if (fConfigUseKFVertexing.value) { + VarManager::SetupThreeProngKFParticle(fConfigMagField.value); + } else { + VarManager::SetupThreeProngDCAFitter(); // TODO: get these parameters from Configurables + } + } + fCurrentRun = event.runNumber(); + } // end: runNumber + VarManager::ResetValues(0, VarManager::kNVars, fValuesHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDilepton); VarManager::FillEvent(event, fValuesHadron); @@ -1280,8 +1328,6 @@ struct AnalysisDileptonHadron { trackGlobalIndexes.clear(); // get full track info of tracks based on the index - std::cout << indexLepton1 - indexOffset << std::endl; - std::cout << indexLepton2 - indexOffset << std::endl; auto lepton1 = tracks.iteratorAt(indexLepton1 - indexOffset); auto lepton2 = tracks.iteratorAt(indexLepton2 - indexOffset); @@ -1311,6 +1357,8 @@ struct AnalysisDileptonHadron { VarManager::FillDileptonTrackVertexing(event, lepton1, lepton2, hadron, fValuesHadron); fHistMan->FillHistClass("DileptonHadronInvMass", fValuesHadron); fHistMan->FillHistClass("DileptonHadronCorrelation", fValuesHadron); + // table to be written out for ML analysis + BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA]); } } } diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index 6fa35ef2e7d..d50bd22ef08 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx @@ -15,6 +15,7 @@ /// /// \author Alessandro De Falco , Cagliari University +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "ReconstructionDataFormats/DCA.h" @@ -30,6 +31,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -79,7 +81,7 @@ struct HfCandidateCreatorChic { void init(InitContext const&) { - massJpsi = o2::analysis::pdg::MassJPsi; + massJpsi = MassJPsi; } void process(aod::Collision const& collision, @@ -243,19 +245,19 @@ struct HfCandidateCreatorChicMc { auto arrayJpsiDaughters = std::array{daughterPosJpsi, daughterNegJpsi}; // chi_c → J/ψ gamma - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { hMassJpsiToMuMuMatched->Fill(hfHelper.invMassJpsiToMuMu(candidate.prong0())); - int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(indexRec), pdg::Code::kChiC1); - int indexMotherGamma = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcparticleId()), pdg::Code::kChiC1); + int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(indexRec), Pdg::kChiC1); + int indexMotherGamma = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcparticleId()), Pdg::kChiC1); if (indexMother > -1 && indexMotherGamma == indexMother && candidate.prong1().mcparticle().pdgCode() == kGamma) { auto particleMother = mcParticles.rawIteratorAt(indexMother); hEphotonMatched->Fill(candidate.prong1().e()); hMassEMatched->Fill(sqrt(candidate.prong1().px() * candidate.prong1().px() + candidate.prong1().py() * candidate.prong1().py() + candidate.prong1().pz() * candidate.prong1().pz())); if (particleMother.has_daughters()) { std::vector arrAllDaughtersIndex; - RecoDecay::getDaughters(particleMother, &arrAllDaughtersIndex, std::array{static_cast(kGamma), static_cast(pdg::Code::kJPsi)}, 1); + RecoDecay::getDaughters(particleMother, &arrAllDaughtersIndex, std::array{static_cast(kGamma), static_cast(Pdg::kJPsi)}, 1); if (arrAllDaughtersIndex.size() == 2) { flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma; hMassChicToJpsiToMuMuGammaMatched->Fill(hfHelper.invMassChicToJpsiGamma(candidate)); @@ -277,17 +279,17 @@ struct HfCandidateCreatorChicMc { channel = 0; // chi_c → J/ψ gamma - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kChiC1, std::array{static_cast(pdg::Code::kJPsi), static_cast(kGamma)}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kChiC1, std::array{static_cast(Pdg::kJPsi), static_cast(kGamma)}, true)) { // Match J/psi --> e+e- std::vector arrDaughter; - RecoDecay::getDaughters(particle, &arrDaughter, std::array{static_cast(pdg::Code::kJPsi)}, 1); + RecoDecay::getDaughters(particle, &arrDaughter, std::array{static_cast(Pdg::kJPsi)}, 1); auto jpsiCandMC = mcParticles.rawIteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) { flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToEEGamma; } if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index db6bba712ee..7c0dad18ca3 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -16,6 +16,7 @@ /// \author Rik Spijkers , Utrecht University /// \author Luca Micheletti , INFN +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "ReconstructionDataFormats/DCA.h" @@ -30,6 +31,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -79,8 +81,8 @@ struct HfCandidateCreatorX { void init(InitContext const&) { - massPi = o2::analysis::pdg::MassPiPlus; - massJpsi = o2::analysis::pdg::MassJPsi; + massPi = MassPiPlus; + massJpsi = MassJPsi; } void process(aod::Collision const& collision, @@ -275,8 +277,8 @@ struct HfCandidateCreatorXMc { aod::McParticles const& mcParticles) { int indexRec = -1; - int pdgCodeX = pdg::Code::kX3872; - int pdgCodeJpsi = pdg::Code::kJPsi; + int pdgCodeX = Pdg::kX3872; + int pdgCodeJpsi = Pdg::kJPsi; int8_t sign = 0; int8_t flag = 0; int8_t origin = 0; @@ -299,7 +301,7 @@ struct HfCandidateCreatorXMc { // X → J/ψ π+ π− // J/ψ → e+ e− - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true); // X → π+ π− e+ e− if (indexRec > -1) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kElectron, -kElectron}, true, &sign, 2); @@ -310,7 +312,7 @@ struct HfCandidateCreatorXMc { // J/ψ → μ+ μ− if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); // X → π+ π− μ+ μ− if (indexRec > -1) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kMuonPlus, -kMuonPlus}, true, &sign, 2); diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx index 9105f3f6036..ca90be80670 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx @@ -15,6 +15,7 @@ /// /// \author Alessandro De Falco , Università/INFN Cagliari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -76,7 +77,7 @@ struct HfCandidateSelectorChicToJpsiGamma { return false; // check that the candidate pT is within the analysis range } - auto mchic = o2::analysis::pdg::MassChiC1; // chi_c1(1p) + auto mchic = o2::constants::physics::MassChiC1; // chi_c1(1p) if (std::abs(hfHelper.invMassChicToJpsiGamma(hfCandChic) - mchic) > cuts->get(pTBin, "m")) { // LOGF(debug, "Chic topol selection failed at mass diff check"); return false; // check that mass difference is within bounds diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx index 73a0904414f..5a1be3c0edc 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx @@ -15,6 +15,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -143,11 +144,11 @@ struct HfCandidateSelectorD0Alice3Barrel { // invariant-mass cut if (trackPion.sign() > 0) { - if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx index 782813029cf..3e70b4138e9 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx @@ -15,6 +15,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -143,11 +144,11 @@ struct HfCandidateSelectorD0Alice3Forward { // invariant-mass cut if (trackPion.sign() > 0) { - if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx index fe110affd66..778edb2d872 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx @@ -15,6 +15,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -143,11 +144,11 @@ struct HfCandidateSelectorD0ParametrizedPid { // invariant-mass cut if (trackPion.sign() > 0) { - if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx index d436ecd13e8..eb485c5c193 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx @@ -16,6 +16,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "ALICE3/DataModel/MID.h" @@ -123,12 +124,12 @@ struct HfCandidateSelectorJpsi { } // cut on e+ e− invariant mass - if (std::abs(hfHelper.invMassJpsiToEE(candidate) - o2::analysis::pdg::MassJPsi) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassJpsiToEE(candidate) - o2::constants::physics::MassJPsi) > cuts->get(pTBin, "m")) { selEE = 0; } // cut on μ+ μ− invariant mass - if (std::abs(hfHelper.invMassJpsiToMuMu(candidate) - o2::analysis::pdg::MassJPsi) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassJpsiToMuMu(candidate) - o2::constants::physics::MassJPsi) > cuts->get(pTBin, "m")) { selMuMu = 0; } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx index 0121da597cc..5c4bfa2a5f6 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx @@ -16,6 +16,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -133,11 +134,11 @@ struct HfCandidateSelectorLcAlice3 { } if (trackProton.globalIndex() == candidate.prong0Id()) { - if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx index 335008ef1e7..966716a9e60 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx @@ -16,6 +16,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -134,11 +135,11 @@ struct HfCandidateSelectorLcParametrizedPid { } if (trackProton.globalIndex() == candidate.prong0Id()) { - if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx index d56919dfe5a..3a70233484a 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx @@ -16,6 +16,7 @@ /// \author Rik Spijkers , Utrecht University /// \author Luca Micheletti , INFN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -83,7 +84,7 @@ struct HfCandidateSelectorXToJpsiPiPi { return false; // check that the candidate pT is within the analysis range } - if (std::abs(hfHelper.invMassXToJpsiPiPi(hfCandX) - o2::analysis::pdg::MassX3872) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassXToJpsiPiPi(hfCandX) - o2::constants::physics::MassX3872) > cuts->get(pTBin, "m")) { // LOGF(debug, "X topol selection failed at mass diff check"); return false; // check that mass difference is within bounds } diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 3ed3424e288..67883eff199 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx @@ -18,6 +18,7 @@ /// \author Alessandro De Falco , Università/INFN Cagliari /// \author Luca Micheletti , INFN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -207,7 +208,7 @@ struct HfTreeCreatorChicToJpsiGamma { } // Filling particle properties - float massChic = o2::analysis::pdg::MassChiC1; + float massChic = o2::constants::physics::MassChiC1; rowCandidateFullParticles.reserve(particles.size()); for (const auto& particle : particles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_chic::DecayType::ChicToJpsiToEEGamma || std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma) { diff --git a/PWGHF/ALICE3/Tasks/taskChic.cxx b/PWGHF/ALICE3/Tasks/taskChic.cxx index 84cbb958146..c2635bfb1ab 100644 --- a/PWGHF/ALICE3/Tasks/taskChic.cxx +++ b/PWGHF/ALICE3/Tasks/taskChic.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Alessandro De Falco , Cagliari University +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -82,7 +83,7 @@ struct HfTaskChic { } registry.fill(HIST("hMass"), hfHelper.invMassChicToJpsiGamma(candidate), candidate.pt()); - registry.fill(HIST("hDeltaMass"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::analysis::pdg::MassJPsi, candidate.pt()); + registry.fill(HIST("hDeltaMass"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::constants::physics::MassJPsi, candidate.pt()); registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); @@ -174,7 +175,7 @@ struct HfTaskChicMc { registry.fill(HIST("hCPARecSig"), candidate.cpa(), candidate.pt()); registry.fill(HIST("hEtaRecSig"), candidate.eta(), candidate.pt()); registry.fill(HIST("hDecLengthRecSig"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("hDeltaMassRecSig"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::analysis::pdg::MassJPsi), candidate.pt(); + registry.fill(HIST("hDeltaMassRecSig"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::constants::physics::MassJPsi), candidate.pt(); registry.fill(HIST("hMassRecSig"), hfHelper.invMassChicToJpsiGamma(candidate), candidate.pt()); registry.fill(HIST("hd0Prong0RecSig"), candidate.impactParameter0(), candidate.pt()); registry.fill(HIST("hd0Prong1RecSig"), candidate.impactParameter1(), candidate.pt()); @@ -188,7 +189,7 @@ struct HfTaskChicMc { registry.fill(HIST("hCPARecBg"), candidate.cpa(), candidate.pt()); registry.fill(HIST("hEtaRecBg"), candidate.eta(), candidate.pt()); registry.fill(HIST("hDecLengthRecBg"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("hDeltaMassRecBg"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::analysis::pdg::MassJPsi), candidate.pt(); + registry.fill(HIST("hDeltaMassRecBg"), hfHelper.invMassChicToJpsiGamma(candidate) - candidate.jpsiToMuMuMass() + o2::constants::physics::MassJPsi), candidate.pt(); registry.fill(HIST("hMassRecBg"), hfHelper.invMassChicToJpsiGamma(candidate), candidate.pt()); registry.fill(HIST("hd0Prong0RecBg"), candidate.impactParameter0(), candidate.pt()); registry.fill(HIST("hd0Prong1RecBg"), candidate.impactParameter1(), candidate.pt()); @@ -202,7 +203,7 @@ struct HfTaskChicMc { // MC gen. for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { - auto mchic = o2::analysis::pdg::MassChiC1; // chi_c1(1p) + auto mchic = o2::constants::physics::MassChiC1; // chi_c1(1p) if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, mchic)) > yCandMax) { continue; } diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx index b5af1967d3b..f5982974c1f 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -141,11 +142,11 @@ struct HfTaskD0Alice3Barrel { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0)) > 4.0) { + if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0)) > 4.0) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0); registry.fill(HIST("hMassGen"), ptGen, std::abs(yGen)); } } diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx index 5b880ad250e..66bd6e01e53 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -69,11 +70,11 @@ struct HfTaskD0Alice3Forward { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0)) > 4.0) { + if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0)) > 4.0) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0); registry.fill(HIST("hMassGen"), ptGen, std::abs(yGen)); } } diff --git a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx index 989ad01d0ca..27b431304e5 100644 --- a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -117,11 +118,11 @@ struct HfTaskD0ParametrizedPid { float maxFiducialY = 0.8; float minFiducialY = -0.8; if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0)) > 4.0) { + if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0)) > 4.0) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0); registry.fill(HIST("hGenPtVsY"), ptGen, std::abs(yGen)); if (ptGen < 5.0) { maxFiducialY = -0.2 / 15 * ptGen * ptGen + 1.9 / 15 * ptGen + 0.5; diff --git a/PWGHF/ALICE3/Tasks/taskJpsi.cxx b/PWGHF/ALICE3/Tasks/taskJpsi.cxx index 28d6e338766..3ca9cc21c16 100644 --- a/PWGHF/ALICE3/Tasks/taskJpsi.cxx +++ b/PWGHF/ALICE3/Tasks/taskJpsi.cxx @@ -16,6 +16,7 @@ /// \author Vít Kučera , CERN /// \author Biao Zhang , CCNU +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -236,7 +237,7 @@ struct HfTaskJpsiMc { } if (candidate.flagMcMatchRec() == 1 << decayMode) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as(), pdg::Code::kJPsi, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as(), o2::constants::physics::Pdg::kJPsi, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT registry.fill(HIST("hPtRecSig"), candidate.pt()); // rec. level pT @@ -255,7 +256,7 @@ struct HfTaskJpsiMc { registry.fill(HIST("hChi2PCASig"), candidate.chi2PCA(), candidate.pt()); registry.fill(HIST("hCtSig"), hfHelper.ctJpsi(candidate), candidate.pt()); registry.fill(HIST("hYSig"), hfHelper.yJpsi(candidate), candidate.pt()); - registry.fill(HIST("hYGenSig"), RecoDecay::y(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, o2::analysis::pdg::MassJPsi), particleMother.pt()); + registry.fill(HIST("hYGenSig"), RecoDecay::y(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, o2::constants::physics::MassJPsi), particleMother.pt()); } else { registry.fill(HIST("hPtRecBg"), candidate.pt()); @@ -279,12 +280,12 @@ struct HfTaskJpsiMc { // MC gen. for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassJPsi)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassJPsi)) > yCandMax) { continue; } registry.fill(HIST("hPtGen"), particle.pt()); registry.fill(HIST("hEtaGen"), particle.eta()); - registry.fill(HIST("hYGen"), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassJPsi), particle.pt()); + registry.fill(HIST("hYGen"), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassJPsi), particle.pt()); // registry.fill(HIST("hPtGenProng0"), particle.daughter0_as().pt(), particle.pt()); // registry.fill(HIST("hPtGenProng1"), particle.daughter1_as().pt(), particle.pt()); } diff --git a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx index 2f60fd79f3c..affabf17d13 100644 --- a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -137,11 +138,11 @@ struct HfTaskLcAlice3 { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus)) > 4.0) { + if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus)) > 4.0) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus); registry.fill(HIST("hMassGen"), ptGen, std::abs(yGen)); } } diff --git a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx index 8759f1a2956..bae14e8e40e 100644 --- a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -117,11 +118,11 @@ struct HfTaskLcParametrizedPid { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus)) > 4.0) { + if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus)) > 4.0) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus); registry.fill(HIST("hMassGen"), ptGen, std::abs(yGen)); } } diff --git a/PWGHF/ALICE3/Tasks/taskX.cxx b/PWGHF/ALICE3/Tasks/taskX.cxx index f5ae86c1516..245554e767e 100644 --- a/PWGHF/ALICE3/Tasks/taskX.cxx +++ b/PWGHF/ALICE3/Tasks/taskX.cxx @@ -16,6 +16,7 @@ /// \author Rik Spijkers , Utrecht University /// \author Luca Micheletti , INFN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -209,7 +210,7 @@ struct HfTaskXMc { // MC gen. for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassX3872)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassX3872)) > yCandMax) { continue; } registry.fill(HIST("hPtGen"), particle.pt()); diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index accb9182910..a0ac2a88baf 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -21,10 +21,11 @@ #include #include +#include "CommonConstants/PhysicsConstants.h" + #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelectorPID.h" -#include "PWGHF/Core/PDG.h" #include "PWGHF/Utils/utilsAnalysis.h" class HfHelper @@ -43,43 +44,43 @@ class HfHelper template auto ctD0(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassD0); + return candidate.ct(o2::constants::physics::MassD0); } template auto yD0(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassD0); + return candidate.y(o2::constants::physics::MassD0); } template auto eD0(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassD0); + return candidate.e(o2::constants::physics::MassD0); } template auto invMassD0ToPiK(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus}); + return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); } template auto invMassD0barToKPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); } template auto cosThetaStarD0(const T& candidate) { - return candidate.cosThetaStar(std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus}, o2::analysis::pdg::MassD0, 1); + return candidate.cosThetaStar(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}, o2::constants::physics::MassD0, 1); } template auto cosThetaStarD0bar(const T& candidate) { - return candidate.cosThetaStar(std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}, o2::analysis::pdg::MassD0, 0); + return candidate.cosThetaStar(std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}, o2::constants::physics::MassD0, 0); } // J/ψ @@ -87,33 +88,33 @@ class HfHelper template auto ctJpsi(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassJPsi); + return candidate.ct(o2::constants::physics::MassJPsi); } template auto yJpsi(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassJPsi); + return candidate.y(o2::constants::physics::MassJPsi); } template auto eJpsi(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassJPsi); + return candidate.e(o2::constants::physics::MassJPsi); } // J/ψ → e+ e− template auto invMassJpsiToEE(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassElectron, o2::analysis::pdg::MassElectron}); + return candidate.m(std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); } // J/ψ → μ+ μ− template auto invMassJpsiToMuMu(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassMuonPlus, o2::analysis::pdg::MassMuonMinus}); + return candidate.m(std::array{o2::constants::physics::MassMuonPlus, o2::constants::physics::MassMuonMinus}); } // hf_cand_casc @@ -121,25 +122,25 @@ class HfHelper template auto invMassLcToK0sP(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassProton, o2::analysis::pdg::MassK0Short}); // first daughter is bachelor + return candidate.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassK0Short}); // first daughter is bachelor } template auto invMassGammaToEE(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassElectron, o2::analysis::pdg::MassElectron}); + return candidate.m(std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); } template auto ctV0K0s(const T& candidate) { - return candidate.ctV0(o2::analysis::pdg::MassK0Short); + return candidate.ctV0(o2::constants::physics::MassK0Short); } template auto ctV0Lambda(const T& candidate) { - return candidate.ctV0(o2::analysis::pdg::MassLambda0); + return candidate.ctV0(o2::constants::physics::MassLambda0); } // B± → D0bar(D0) π± @@ -147,31 +148,31 @@ class HfHelper template auto ctBplus(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassBPlus); + return candidate.ct(o2::constants::physics::MassBPlus); } template auto yBplus(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassBPlus); + return candidate.y(o2::constants::physics::MassBPlus); } template auto eBplus(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassBPlus); + return candidate.e(o2::constants::physics::MassBPlus); } template auto invMassBplusToD0Pi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassD0, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassD0, o2::constants::physics::MassPiPlus}); } template auto cosThetaStarBplus(const T& candidate) { - return candidate.cosThetaStar(std::array{o2::analysis::pdg::MassD0, o2::analysis::pdg::MassPiPlus}, o2::analysis::pdg::MassBPlus, 1); + return candidate.cosThetaStar(std::array{o2::constants::physics::MassD0, o2::constants::physics::MassPiPlus}, o2::constants::physics::MassBPlus, 1); } // 3-prong @@ -181,32 +182,32 @@ class HfHelper template auto ctDplus(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassDPlus); + return candidate.ct(o2::constants::physics::MassDPlus); } template auto yDplus(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassDPlus); + return candidate.y(o2::constants::physics::MassDPlus); } template auto eDplus(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassDPlus); + return candidate.e(o2::constants::physics::MassDPlus); } template auto invMassDplusToPiKPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); } template auto invMassDplusToPiKPi(const T& pVec0, const T& pVec1, const T& pVec2) { return RecoDecay::m(std::array{pVec0, pVec1, pVec2}, - std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); } // Ds± → K± K∓ π± @@ -214,45 +215,45 @@ class HfHelper template auto ctDs(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassDS); + return candidate.ct(o2::constants::physics::MassDS); } template auto yDs(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassDS); + return candidate.y(o2::constants::physics::MassDS); } template auto eDs(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassDS); + return candidate.e(o2::constants::physics::MassDS); } template auto invMassDsToKKPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); } template auto invMassDsToPiKK(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassKPlus}); + return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); } template auto deltaMassPhiDsToKKPi(const T& candidate) { - double invMassKKpair = RecoDecay::m(std::array{candidate.pVectorProng0(), candidate.pVectorProng1()}, std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassKPlus}); - return std::abs(invMassKKpair - o2::analysis::pdg::MassPhi); + double invMassKKpair = RecoDecay::m(std::array{candidate.pVectorProng0(), candidate.pVectorProng1()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); + return std::abs(invMassKKpair - o2::constants::physics::MassPhi); } template auto deltaMassPhiDsToPiKK(const T& candidate) { - double invMassKKpair = RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng2()}, std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassKPlus}); - return std::abs(invMassKKpair - o2::analysis::pdg::MassPhi); + double invMassKKpair = RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng2()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); + return std::abs(invMassKKpair - o2::constants::physics::MassPhi); } /// Calculate the cosine of the angle between the pion and the opposite sign kaon in the phi rest frame @@ -277,9 +278,9 @@ class HfHelper momK2 = candidate.pVectorProng2(); } - ROOT::Math::PxPyPzMVector vecPi(momPi[0], momPi[1], momPi[2], o2::analysis::pdg::MassPiPlus); - ROOT::Math::PxPyPzMVector vecK1(momK1[0], momK1[1], momK1[2], o2::analysis::pdg::MassKPlus); - ROOT::Math::PxPyPzMVector vecK2(momK2[0], momK2[1], momK2[2], o2::analysis::pdg::MassKPlus); + ROOT::Math::PxPyPzMVector vecPi(momPi[0], momPi[1], momPi[2], o2::constants::physics::MassPiPlus); + ROOT::Math::PxPyPzMVector vecK1(momK1[0], momK1[1], momK1[2], o2::constants::physics::MassKPlus); + ROOT::Math::PxPyPzMVector vecK2(momK2[0], momK2[1], momK2[2], o2::constants::physics::MassKPlus); ROOT::Math::PxPyPzMVector vecPhi = vecK1 + vecK2; ROOT::Math::Boost boostToPhiRestFrame(vecPhi.BoostToCM()); @@ -308,31 +309,31 @@ class HfHelper template auto ctLc(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassLambdaCPlus); + return candidate.ct(o2::constants::physics::MassLambdaCPlus); } template auto yLc(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassLambdaCPlus); + return candidate.y(o2::constants::physics::MassLambdaCPlus); } template auto eLc(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassLambdaCPlus); + return candidate.e(o2::constants::physics::MassLambdaCPlus); } template auto invMassLcToPKPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassProton, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); } template auto invMassLcToPiKP(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassProton}); + return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton}); } // Ξc± → p± K∓ π± @@ -340,19 +341,19 @@ class HfHelper template auto ctXic(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassXiCPlus); + return candidate.ct(o2::constants::physics::MassXiCPlus); } template auto yXic(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassXiCPlus); + return candidate.y(o2::constants::physics::MassXiCPlus); } template auto eXic(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassXiCPlus); + return candidate.e(o2::constants::physics::MassXiCPlus); } template @@ -372,13 +373,13 @@ class HfHelper template auto invMassXiczeroToXiPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassXiMinus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}); } template auto invMassOmegaczeroToOmegaPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassOmegaMinus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}); } // hf_cand_casc_lf_3prong @@ -386,7 +387,7 @@ class HfHelper template auto invMassXicplusToXiPiPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassXiMinus, o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus, o2::constants::physics::MassPiPlus}); } // hf_cand_x @@ -395,25 +396,25 @@ class HfHelper template auto ctX(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassX3872); + return candidate.ct(o2::constants::physics::MassX3872); } template auto yX(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassX3872); + return candidate.y(o2::constants::physics::MassX3872); } template auto eX(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassX3872); + return candidate.e(o2::constants::physics::MassX3872); } template auto invMassXToJpsiPiPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassJPsi, o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassJPsi, o2::constants::physics::MassPiPlus, o2::constants::physics::MassPiPlus}); } /// Difference between the X mass and the sum of the J/psi and di-pion masses @@ -424,10 +425,10 @@ class HfHelper auto piVec2 = std::array{candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()}; auto arrayMomenta = std::array{piVec1, piVec2}; - double massPiPi = RecoDecay::m(arrayMomenta, std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassPiPlus}); + double massPiPi = RecoDecay::m(arrayMomenta, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassPiPlus}); double massJpsiPiPi = invMassXToJpsiPiPi(candidate); - return std::abs(massJpsiPiPi - o2::analysis::pdg::MassJPsi - massPiPi); + return std::abs(massJpsiPiPi - o2::constants::physics::MassJPsi - massPiPi); } /// Angular difference between the J/psi and the pion @@ -467,25 +468,25 @@ class HfHelper template auto ctXicc(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassXiCCPlusPlus); + return candidate.ct(o2::constants::physics::MassXiCCPlusPlus); } template auto yXicc(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassXiCCPlusPlus); + return candidate.y(o2::constants::physics::MassXiCCPlusPlus); } template auto eXicc(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassXiCCPlusPlus); + return candidate.e(o2::constants::physics::MassXiCCPlusPlus); } template auto invMassXiccToXicPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassXiCPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassXiCPlus, o2::constants::physics::MassPiPlus}); } // chic → Jpsi gamma @@ -493,24 +494,24 @@ class HfHelper template auto ctChic(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassChiC1); + return candidate.ct(o2::constants::physics::MassChiC1); } template auto yChic(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassChiC1); + return candidate.y(o2::constants::physics::MassChiC1); } template auto eChic(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassChiC1); + return candidate.e(o2::constants::physics::MassChiC1); } template auto invMassChicToJpsiGamma(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassJPsi, 0.}); + return candidate.m(std::array{o2::constants::physics::MassJPsi, 0.}); } // Λb → Λc+ π- → p K- π+ π- @@ -518,24 +519,24 @@ class HfHelper template auto ctLb(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassLambdaB0); + return candidate.ct(o2::constants::physics::MassLambdaB0); } template auto yLb(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassLambdaB0); + return candidate.y(o2::constants::physics::MassLambdaB0); } template auto eLb(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassLambdaB0); + return candidate.e(o2::constants::physics::MassLambdaB0); } template auto invMassLbToLcPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassLambdaCPlus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassLambdaCPlus, o2::constants::physics::MassPiPlus}); } // B0(B0bar) → D∓ π± @@ -543,31 +544,31 @@ class HfHelper template auto ctB0(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassB0); + return candidate.ct(o2::constants::physics::MassB0); } template auto yB0(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassB0); + return candidate.y(o2::constants::physics::MassB0); } template auto eB0(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassB0); + return candidate.e(o2::constants::physics::MassB0); } template auto invMassB0ToDPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassDMinus, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassDMinus, o2::constants::physics::MassPiPlus}); } template auto cosThetaStarB0(const T& candidate) { - return candidate.cosThetaStar(std::array{o2::analysis::pdg::MassDMinus, o2::analysis::pdg::MassPiPlus}, o2::analysis::pdg::MassB0, 1); + return candidate.cosThetaStar(std::array{o2::constants::physics::MassDMinus, o2::constants::physics::MassPiPlus}, o2::constants::physics::MassB0, 1); } // Bs(bar) → Ds∓ π± @@ -575,31 +576,31 @@ class HfHelper template auto ctBs(const T& candidate) { - return candidate.ct(o2::analysis::pdg::MassBS); + return candidate.ct(o2::constants::physics::MassBS); } template auto yBs(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassBS); + return candidate.y(o2::constants::physics::MassBS); } template auto eBs(const T& candidate) { - return candidate.e(o2::analysis::pdg::MassBS); + return candidate.e(o2::constants::physics::MassBS); } template auto invMassBsToDsPi(const T& candidate) { - return candidate.m(std::array{o2::analysis::pdg::MassDSBar, o2::analysis::pdg::MassPiPlus}); + return candidate.m(std::array{o2::constants::physics::MassDSBar, o2::constants::physics::MassPiPlus}); } template auto cosThetaStarBs(const T& candidate) { - return candidate.cosThetaStar(std::array{o2::analysis::pdg::MassDSBar, o2::analysis::pdg::MassPiPlus}, o2::analysis::pdg::MassBS, 1); + return candidate.cosThetaStar(std::array{o2::constants::physics::MassDSBar, o2::constants::physics::MassPiPlus}, o2::constants::physics::MassBS, 1); } /// Σc0,++ → Λc+(→pK-π+) π-,+ @@ -608,26 +609,26 @@ class HfHelper template auto invMassScRecoLcToPKPi(const T& candidateSc, const U& candidateLc) { - return candidateSc.m(std::array{static_cast(invMassLcToPKPi(candidateLc)), o2::analysis::pdg::MassPiPlus}); + return candidateSc.m(std::array{static_cast(invMassLcToPKPi(candidateLc)), o2::constants::physics::MassPiPlus}); } /// @brief Sc inv. mass using reco mass for Lc in piKp and PDG mass for pion template auto invMassScRecoLcToPiKP(const T& candidateSc, const U& candidateLc) { - return candidateSc.m(std::array{static_cast(invMassLcToPiKP(candidateLc)), o2::analysis::pdg::MassPiPlus}); + return candidateSc.m(std::array{static_cast(invMassLcToPiKP(candidateLc)), o2::constants::physics::MassPiPlus}); } template auto ySc0(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassSigmaC0); + return candidate.y(o2::constants::physics::MassSigmaC0); } template auto yScPlusPlus(const T& candidate) { - return candidate.y(o2::analysis::pdg::MassSigmaCPlusPlus); + return candidate.y(o2::constants::physics::MassSigmaCPlusPlus); } /// Apply topological cuts as defined in SelectorCuts.h @@ -654,7 +655,7 @@ class HfHelper // } // B0 mass cut - if (std::abs(invMassB0ToDPi(candB0) - o2::analysis::pdg::MassB0) > cuts->get(pTBin, "m")) { + if (std::abs(invMassB0ToDPi(candB0) - o2::constants::physics::MassB0) > cuts->get(pTBin, "m")) { // Printf("B0 topol selection failed at mass diff check"); return false; } @@ -671,7 +672,7 @@ class HfHelper /* // D mass cut | already applied in candidateSelectorDplusToPiKPi.cxx - if (std::abs(invMassDplusToPiKPi(hfCandD) - o2::analysis::pdg::MassDMinus) > cuts->get(pTBin, "DeltaMD")) { + if (std::abs(invMassDplusToPiKPi(hfCandD) - o2::constants::physics::MassDMinus) > cuts->get(pTBin, "DeltaMD")) { return false; } */ @@ -743,7 +744,7 @@ class HfHelper } // B+ mass cut - if (std::abs(invMassBplusToD0Pi(candBp) - o2::analysis::pdg::MassBPlus) > cuts->get(pTBin, "m")) { + if (std::abs(invMassBplusToD0Pi(candBp) - o2::constants::physics::MassBPlus) > cuts->get(pTBin, "m")) { return false; } @@ -810,7 +811,7 @@ class HfHelper } // Bs mass cut - if (std::abs(invMassBsToDsPi(candBs) - o2::analysis::pdg::MassBS) > cuts->get(pTBin, "m")) { + if (std::abs(invMassBsToDsPi(candBs) - o2::constants::physics::MassBS) > cuts->get(pTBin, "m")) { return false; } diff --git a/PWGHF/Core/HfMlResponseD0ToKPi.h b/PWGHF/Core/HfMlResponseD0ToKPi.h index 62e8c201e6b..65da2a822e0 100644 --- a/PWGHF/Core/HfMlResponseD0ToKPi.h +++ b/PWGHF/Core/HfMlResponseD0ToKPi.h @@ -21,9 +21,10 @@ #include #include +#include "CommonConstants/PhysicsConstants.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/HfMlResponse.h" -#include "PWGHF/Core/PDG.h" // Fill the map of available input features // the key is the feature's name (std::string) @@ -64,7 +65,7 @@ // is filled depending on whether it is a D0 or a D0bar #define CHECK_AND_FILL_VEC_D0_HFHELPER_SIGNED(OBJECT, FEATURE, GETTER1, GETTER2) \ case static_cast(InputFeaturesD0ToKPi::FEATURE): { \ - if (pdgCode == o2::analysis::pdg::kD0) { \ + if (pdgCode == o2::constants::physics::kD0) { \ inputFeatures.emplace_back(hfHelper.GETTER1(OBJECT)); \ } else { \ inputFeatures.emplace_back(hfHelper.GETTER2(OBJECT)); \ diff --git a/PWGHF/Core/HfMlResponseLcToK0sP.h b/PWGHF/Core/HfMlResponseLcToK0sP.h new file mode 100644 index 00000000000..2dc78cb19d1 --- /dev/null +++ b/PWGHF/Core/HfMlResponseLcToK0sP.h @@ -0,0 +1,208 @@ +// 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 HfMlResponseLcToK0sP.h +/// \brief Class to compute the ML response for Lc± → K0s p analysis selections +/// \author Alexandre Bigot , IPHC Strasbourg +/// \author Elisa Meninno , SMI Vienna + +#ifndef PWGHF_CORE_HFMLRESPONSELCTOK0SP_H_ +#define PWGHF_CORE_HFMLRESPONSELCTOK0SP_H_ + +#include +#include +#include + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMlResponse.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_LC(FEATURE) \ + { \ +#FEATURE, static_cast < uint8_t>(InputFeaturesLcToK0sP::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_LC_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesLcToK0sP::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_LC_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_LC(GETTER) \ + case static_cast(InputFeaturesLcToK0sP::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +// Variation of CHECK_AND_FILL_VEC_LC_FULL(OBJECT, FEATURE, GETTER) +// where GETTER is a method of hfHelper +#define CHECK_AND_FILL_VEC_LC_HFHELPER(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesLcToK0sP::FEATURE): { \ + inputFeatures.emplace_back(hfHelper.GETTER(OBJECT)); \ + break; \ + } + +namespace o2::analysis +{ +// possible input features for ML +enum class InputFeaturesLcToK0sP : uint8_t { + chi2PCA, + rSecondaryVertex, + decayLength, + decayLengthXY, + decayLengthNormalised, + decayLengthXYNormalised, + impactParameterNormalised0, + ptProng0, + impactParameterNormalised1, + ptProng1, + impactParameter0, + impactParameter1, + v0Radius, + v0cosPA, + v0MLambda, + v0MAntiLambda, + v0MK0Short, + v0MGamma, + ctV0, + dcaV0daughters, + ptV0Pos, + dcaPosToPV, + ptV0Neg, + dcaNegToPV, + nSigmaTpcPr0, + nSigmaTofPr0, + nSigmaTpcTofPr0, + cpa, + cpaXY, + ct +}; + +template +class HfMlResponseLcToK0sP : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseLcToK0sP() = default; + /// Default destructor + virtual ~HfMlResponseLcToK0sP() = default; + + HfHelper hfHelper; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the Lc candidate + /// \param bach is the bachelor candidate (proton) + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, + T2 const& bach) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + switch (idx) { + CHECK_AND_FILL_VEC_LC(chi2PCA); + CHECK_AND_FILL_VEC_LC(rSecondaryVertex); + CHECK_AND_FILL_VEC_LC(decayLength); + CHECK_AND_FILL_VEC_LC(decayLengthXY); + CHECK_AND_FILL_VEC_LC(decayLengthNormalised); + CHECK_AND_FILL_VEC_LC(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_LC(impactParameterNormalised0); + CHECK_AND_FILL_VEC_LC(ptProng0); + CHECK_AND_FILL_VEC_LC(impactParameterNormalised1); + CHECK_AND_FILL_VEC_LC(ptProng1); + CHECK_AND_FILL_VEC_LC(impactParameter0); + CHECK_AND_FILL_VEC_LC(impactParameter1); + CHECK_AND_FILL_VEC_LC_FULL(candidate, v0Radius, v0radius); + CHECK_AND_FILL_VEC_LC(v0cosPA); + CHECK_AND_FILL_VEC_LC_FULL(candidate, v0MLambda, mLambda); + CHECK_AND_FILL_VEC_LC_FULL(candidate, v0MAntiLambda, mAntiLambda); + CHECK_AND_FILL_VEC_LC_FULL(candidate, v0MK0Short, mK0Short); + CHECK_AND_FILL_VEC_LC_FULL(candidate, v0MGamma, mGamma); + CHECK_AND_FILL_VEC_LC_HFHELPER(candidate, ctV0, ctV0K0s); + // CHECK_AND_FILL_VEC_LC_HFHELPER(candidate, ctV0, ctV0Lambda); + CHECK_AND_FILL_VEC_LC(dcaV0daughters); + CHECK_AND_FILL_VEC_LC(ptV0Pos); + CHECK_AND_FILL_VEC_LC_FULL(candidate, dcaPosToPV, dcapostopv); + CHECK_AND_FILL_VEC_LC(ptV0Neg); + CHECK_AND_FILL_VEC_LC_FULL(candidate, dcaNegToPV, dcanegtopv); + CHECK_AND_FILL_VEC_LC(cpa); + CHECK_AND_FILL_VEC_LC(cpaXY); + CHECK_AND_FILL_VEC_LC_HFHELPER(candidate, ct, ctLc); + // TPC PID variables + CHECK_AND_FILL_VEC_LC_FULL(bach, nSigmaTpcPr0, tpcNSigmaPr); + // TOF PID variables + CHECK_AND_FILL_VEC_LC_FULL(bach, nSigmaTofPr0, tofNSigmaPr); + // Combined nSigma variable + CHECK_AND_FILL_VEC_LC_FULL(bach, nSigmaTpcTofPr0, tpcTofNSigmaPr); + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_LC(chi2PCA), + FILL_MAP_LC(rSecondaryVertex), + FILL_MAP_LC(decayLength), + FILL_MAP_LC(decayLengthXY), + FILL_MAP_LC(decayLengthNormalised), + FILL_MAP_LC(decayLengthXYNormalised), + FILL_MAP_LC(impactParameterNormalised0), + FILL_MAP_LC(ptProng0), + FILL_MAP_LC(impactParameterNormalised1), + FILL_MAP_LC(ptProng1), + FILL_MAP_LC(impactParameter0), + FILL_MAP_LC(impactParameter1), + FILL_MAP_LC(v0Radius), + FILL_MAP_LC(v0cosPA), + FILL_MAP_LC(v0MLambda), + FILL_MAP_LC(v0MAntiLambda), + FILL_MAP_LC(v0MK0Short), + FILL_MAP_LC(v0MGamma), + FILL_MAP_LC(ctV0), + FILL_MAP_LC(dcaV0daughters), + FILL_MAP_LC(ptV0Pos), + FILL_MAP_LC(dcaPosToPV), + FILL_MAP_LC(ptV0Neg), + FILL_MAP_LC(dcaNegToPV), + FILL_MAP_LC(cpa), + FILL_MAP_LC(cpaXY), + FILL_MAP_LC(ct), + // TPC PID variables + FILL_MAP_LC(nSigmaTpcPr0), + // TOF PID variables + FILL_MAP_LC(nSigmaTofPr0), + // Combined nSigma variable + FILL_MAP_LC(nSigmaTpcTofPr0)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_LC +#undef CHECK_AND_FILL_VEC_LC_FULL +#undef CHECK_AND_FILL_VEC_LC +#undef CHECK_AND_FILL_VEC_LC_HFHELPER + +#endif // PWGHF_CORE_HFMLRESPONSELCTOK0SP_H_ diff --git a/PWGHF/Core/PDG.h b/PWGHF/Core/PDG.h deleted file mode 100644 index 34d5dcd1a09..00000000000 --- a/PWGHF/Core/PDG.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file PDG.h -/// \brief PDG features -/// \note Use PWGHF/Core/make_pdg_header.py to generate the enums and mass declarations. - -#ifndef PWGHF_CORE_PDG_H_ -#define PWGHF_CORE_PDG_H_ - -namespace o2::analysis::pdg -{ -/// \brief Declarations of named PDG codes of particles missing in ROOT PDG_t -/// \note Follow kCamelCase naming convention -/// \link https://root.cern/doc/master/TPDGCode_8h.html -enum Code { - kB0 = 511, - kB0Bar = -511, - kBPlus = 521, - kBS = 531, - kBSBar = -531, - kD0 = 421, - kD0Bar = -421, - kDMinus = -411, - kDPlus = 411, - kDS = 431, - kDSBar = -431, - kDStar = 413, - kChiC1 = 20443, - kJPsi = 443, - kLambdaB0 = 5122, - kLambdaCPlus = 4122, - kOmegaC0 = 4332, - kPhi = 333, - kSigmaC0 = 4112, - kSigmaCPlusPlus = 4222, - kX3872 = 9920443, - kXi0 = 3322, - kXiB0 = 5232, - kXiCCPlusPlus = 4422, - kXiCPlus = 4232, - kXiCZero = 4132 -}; - -/// \brief Declarations of masses for additional particles -constexpr double MassB0 = 5.27953; -constexpr double MassB0Bar = 5.27953; -constexpr double MassBPlus = 5.27915; -constexpr double MassBS = 5.3663; -constexpr double MassBSBar = 5.3663; -constexpr double MassD0 = 1.86484; -constexpr double MassD0Bar = 1.86484; -constexpr double MassDMinus = 1.86962; -constexpr double MassDPlus = 1.86962; -constexpr double MassDS = 1.9685; -constexpr double MassDSBar = 1.9685; -constexpr double MassDStar = 2.01027; -constexpr double MassChiC1 = 3.51066; -constexpr double MassJPsi = 3.096916; -constexpr double MassLambdaB0 = 5.6202; -constexpr double MassLambdaCPlus = 2.28646; -constexpr double MassOmegaC0 = 2.6952; -constexpr double MassPhi = 1.019455; -constexpr double MassSigmaC0 = 2.45376; -constexpr double MassSigmaCPlusPlus = 2.45402; -constexpr double MassX3872 = 3.87165; -constexpr double MassXi0 = 1.31486; -constexpr double MassXiB0 = 5.7924; -constexpr double MassXiCCPlusPlus = 3.62155; -constexpr double MassXiCPlus = 2.4679; -constexpr double MassXiCZero = 2.471; - -/// \brief Declarations of masses for particles in ROOT PDG_t -constexpr double MassDown = 0.0048; -constexpr double MassDownBar = 0.0048; -constexpr double MassUp = 0.0024; -constexpr double MassUpBar = 0.0024; -constexpr double MassStrange = 0.104; -constexpr double MassStrangeBar = 0.104; -constexpr double MassCharm = 1.27; -constexpr double MassCharmBar = 1.27; -constexpr double MassBottom = 4.68; -constexpr double MassBottomBar = 4.68; -constexpr double MassTop = 171.2; -constexpr double MassTopBar = 171.2; -constexpr double MassGluon = 0.0; -constexpr double MassElectron = 0.00051099891; -constexpr double MassPositron = 0.00051099891; -constexpr double MassNuE = 0.0; -constexpr double MassNuEBar = 0.0; -constexpr double MassMuonMinus = 0.105658; -constexpr double MassMuonPlus = 0.105658; -constexpr double MassNuMu = 0.0; -constexpr double MassNuMuBar = 0.0; -constexpr double MassTauMinus = 1.77684; -constexpr double MassTauPlus = 1.77684; -constexpr double MassNuTau = 0.0; -constexpr double MassNuTauBar = 0.0; -constexpr double MassGamma = 0.0; -constexpr double MassZ0 = 91.187; -constexpr double MassWPlus = 80.398; -constexpr double MassWMinus = 80.398; -constexpr double MassPi0 = 0.134977; -constexpr double MassK0Long = 0.497614; -constexpr double MassPiPlus = 0.13957; -constexpr double MassPiMinus = 0.13957; -constexpr double MassProton = 0.938272; -constexpr double MassProtonBar = 0.938272; -constexpr double MassNeutron = 0.939565; -constexpr double MassNeutronBar = 0.939565; -constexpr double MassK0Short = 0.497614; -constexpr double MassK0 = 0.497614; -constexpr double MassK0Bar = 0.497614; -constexpr double MassKPlus = 0.493677; -constexpr double MassKMinus = 0.493677; -constexpr double MassLambda0 = 1.11568; -constexpr double MassLambda0Bar = 1.11568; -constexpr double MassLambda1520 = 1.5195; -constexpr double MassSigmaMinus = 1.19744; -constexpr double MassSigmaBarPlus = 1.19744; -constexpr double MassSigmaPlus = 1.18937; -constexpr double MassSigmaBarMinus = 1.18937; -constexpr double MassSigma0 = 1.192642; -constexpr double MassSigma0Bar = 1.192642; -constexpr double MassXiMinus = 1.32171; -constexpr double MassXiPlusBar = 1.32171; -constexpr double MassOmegaMinus = 1.67245; -constexpr double MassOmegaPlusBar = 1.67245; -} // namespace o2::analysis::pdg - -#endif // PWGHF_CORE_PDG_H_ diff --git a/PWGHF/Core/make_pdg_header.py b/PWGHF/Core/make_pdg_header.py deleted file mode 100644 index c9038196285..00000000000 --- a/PWGHF/Core/make_pdg_header.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python3 - -# 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 Generates the body of a C++ header with PDG codes and particle masses. -@author Vít Kučera , Inha University -@date 2023-09-21 -""" - -from ctypes import c_bool -from enum import Enum - -import ROOT # pylint: disable=import-error - - -# Enum of PDG_t particles -class PdgROOT(Enum): - kDown = ROOT.kDown - kDownBar = ROOT.kDownBar - kUp = ROOT.kUp - kUpBar = ROOT.kUpBar - kStrange = ROOT.kStrange - kStrangeBar = ROOT.kStrangeBar - kCharm = ROOT.kCharm - kCharmBar = ROOT.kCharmBar - kBottom = ROOT.kBottom - kBottomBar = ROOT.kBottomBar - kTop = ROOT.kTop - kTopBar = ROOT.kTopBar - kGluon = ROOT.kGluon - kElectron = ROOT.kElectron - kPositron = ROOT.kPositron - kNuE = ROOT.kNuE - kNuEBar = ROOT.kNuEBar - kMuonMinus = ROOT.kMuonMinus - kMuonPlus = ROOT.kMuonPlus - kNuMu = ROOT.kNuMu - kNuMuBar = ROOT.kNuMuBar - kTauMinus = ROOT.kTauMinus - kTauPlus = ROOT.kTauPlus - kNuTau = ROOT.kNuTau - kNuTauBar = ROOT.kNuTauBar - kGamma = ROOT.kGamma - kZ0 = ROOT.kZ0 - kWPlus = ROOT.kWPlus - kWMinus = ROOT.kWMinus - kPi0 = ROOT.kPi0 - kK0Long = ROOT.kK0Long - kPiPlus = ROOT.kPiPlus - kPiMinus = ROOT.kPiMinus - kProton = ROOT.kProton - kProtonBar = ROOT.kProtonBar - kNeutron = ROOT.kNeutron - kNeutronBar = ROOT.kNeutronBar - kK0Short = ROOT.kK0Short - kK0 = ROOT.kK0 - kK0Bar = ROOT.kK0Bar - kKPlus = ROOT.kKPlus - kKMinus = ROOT.kKMinus - kLambda0 = ROOT.kLambda0 - kLambda0Bar = ROOT.kLambda0Bar - kLambda1520 = ROOT.kLambda1520 - kSigmaMinus = ROOT.kSigmaMinus - kSigmaBarPlus = ROOT.kSigmaBarPlus - kSigmaPlus = ROOT.kSigmaPlus - kSigmaBarMinus = ROOT.kSigmaBarMinus - kSigma0 = ROOT.kSigma0 - kSigma0Bar = ROOT.kSigma0Bar - kXiMinus = ROOT.kXiMinus - kXiPlusBar = ROOT.kXiPlusBar - kOmegaMinus = ROOT.kOmegaMinus - kOmegaPlusBar = ROOT.kOmegaPlusBar - - -# Enum of additional particles -class Pdg(Enum): - kB0 = 511 - kB0Bar = -511 - kBPlus = 521 - kBS = 531 - kBSBar = -531 - kD0 = 421 - kD0Bar = -421 - kDMinus = -411 - kDPlus = 411 - kDS = 431 - kDSBar = -431 - kDStar = 413 - kChiC1 = 20443 - kJPsi = 443 - kLambdaB0 = 5122 - kLambdaCPlus = 4122 - kOmegaC0 = 4332 - kPhi = 333 - kSigmaC0 = 4112 - kSigmaCPlusPlus = 4222 - kX3872 = 9920443 - kXi0 = 3322 - kXiB0 = 5232 - kXiCCPlusPlus = 4422 - kXiCPlus = 4232 - kXiCZero = 4132 - - -def mass(code): - """Returns particle mass from o2::O2DatabasePDG except for special cases.""" - # Special cases (present in TDatabasePDG but with wrong values) - # Missing particles should be added in O2DatabasePDG.h. - if abs(code) == Pdg.kXiCCPlusPlus.value: - return 3.62155 # PDG 2022: https://pdg.lbl.gov/2022/listings/rpp2022-list-xicc-plus-plus.pdf - if abs(code) == Pdg.kOmegaC0.value: - return 2.69520 # PDG 2022: https://pdg.lbl.gov/2022/listings/rpp2022-list-omegac-zero.pdf - # Default case - success = c_bool(True) - return ROOT.o2.O2DatabasePDG.Mass(code, success) - - -def declare_mass(pdg, type="double") -> str: - """Returns a C++ declaration of a particle mass constant.""" - return f"constexpr {type} Mass{pdg.name[1:]} = {mass(pdg.value)};\n" - - -# Start of enum declarations of additional particles -str_enum_head = """/// \\brief Declarations of named PDG codes of particles missing in ROOT PDG_t -/// \\note Follow kCamelCase naming convention -/// \\link https://root.cern/doc/master/TPDGCode_8h.html -enum Code { -""" -# End of enum declarations of additional particles -str_enum_foot = "};\n" -# Documentation string for mass declarations of additional particles -str_mass_o2_head = """/// \\brief Declarations of masses for additional particles -""" -# Documentation string for mass declarations of PDG_t particles -str_mass_root_head = """/// \\brief Declarations of masses for particles in ROOT PDG_t -""" - -# Additional particles -str_enum = str_enum_head -str_mass_o2 = str_mass_o2_head -for c in Pdg: - str_enum += f" {c.name} = {c.value},\n" - str_mass_o2 += declare_mass(c) -str_enum = str_enum[:-2] + "\n" # Remove the last comma. -str_enum += str_enum_foot - -# PDG_t particles -str_mass_root = str_mass_root_head -for d in PdgROOT: - str_mass_root += declare_mass(d) - -# Header body -str_header = "\n".join([str_enum, str_mass_o2, str_mass_root]) -print(str_header) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx index 963dda509ec..fb5c9184f40 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx @@ -14,6 +14,7 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -71,9 +72,9 @@ struct HfCandidateCreatorB0Reduced { registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD = o2::analysis::pdg::MassDMinus; - massB0 = o2::analysis::pdg::MassB0; + massPi = o2::constants::physics::MassPiPlus; + massD = o2::constants::physics::MassDMinus; + massB0 = o2::constants::physics::MassB0; // Initialize fitter df2.setPropagateToPCA(propagateToPCA); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx index 0c5f3f9d7a8..8787de8d169 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx @@ -14,6 +14,7 @@ /// /// \author Antonio Palasciano , Università degli Studi di Bari +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -81,9 +82,9 @@ struct HfCandidateCreatorBplusReduced { df2.setWeightedFinalPCA(useWeightedFinalPCA); // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD0 = o2::analysis::pdg::MassD0; - massBplus = o2::analysis::pdg::MassBPlus; + massPi = o2::constants::physics::MassPiPlus; + massD0 = o2::constants::physics::MassD0; + massBplus = o2::constants::physics::MassBPlus; } void process(aod::HfRedCollisions const& collisions, diff --git a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx index 64d51116fed..62350c0f116 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx @@ -17,6 +17,7 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -36,6 +37,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -161,9 +163,9 @@ struct HfDataCreatorD0PiReduced { runNumber = 0; // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD0 = o2::analysis::pdg::MassD0; - massBplus = o2::analysis::pdg::MassBPlus; + massPi = MassPiPlus; + massD0 = MassD0; + massBplus = MassBPlus; invMass2D0PiMin = (massBplus - invMassWindowD0Pi) * (massBplus - invMassWindowD0Pi); invMass2D0PiMax = (massBplus + invMassWindowD0Pi) * (massBplus + invMassWindowD0Pi); } @@ -347,18 +349,18 @@ struct HfDataCreatorD0PiReduced { int8_t flag{0}; // B+ → D0(bar) π+ → (K+ π-) π+ // Printf("Checking B+ → D0bar π+"); - auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBplus, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBplus, Pdg::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { // D0bar → K+ π- // Printf("Checking D0bar → K+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD0, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1); if (indexRec > -1) { flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi); } else { LOGF(info, "WARNING: B+ decays in the expected final state but the condition on the intermediate state is not fulfilled"); } } - auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as

(), pdg::Code::kBPlus, true); + auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as

(), Pdg::kBPlus, true); auto particleMother = particlesMc.rawIteratorAt(indexMother); rowHfD0PiMcRecReduced(indexHfCand2Prong, selectedTracksPion[trackPion.globalIndex()], flag, particleMother.pt()); @@ -404,11 +406,11 @@ struct HfDataCreatorD0PiReduced { int8_t sign{0}; int8_t flag{0}; // B+ → D0bar π+ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kBPlus, std::array{static_cast(pdg::Code::kD0), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBPlus, std::array{static_cast(Pdg::kD0), +kPiPlus}, true)) { // Match D0bar -> π- K+ auto candD0MC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking D0bar -> π- K+"); - if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, static_cast(pdg::Code::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, static_cast(Pdg::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi); } } diff --git a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx index e92be945f36..b22f294688c 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx @@ -17,6 +17,7 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -36,6 +37,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -160,9 +162,9 @@ struct HfDataCreatorDplusPiReduced { runNumber = 0; // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD = o2::analysis::pdg::MassDMinus; - massB0 = o2::analysis::pdg::MassB0; + massPi = MassPiPlus; + massD = MassDMinus; + massB0 = MassB0; invMass2DPiMin = (massB0 - invMassWindowDPi) * (massB0 - invMassWindowDPi); invMass2DPiMax = (massB0 + invMassWindowDPi) * (massB0 + invMassWindowDPi); } @@ -350,11 +352,11 @@ struct HfDataCreatorDplusPiReduced { int8_t flag{0}; int8_t debug{0}; // B0 → D- π+ → (π- K+ π-) π+ - auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersB0, Pdg::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // D- → π- K+ π- // Printf("Checking D- → π- K+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD, Pdg::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } else { @@ -362,7 +364,7 @@ struct HfDataCreatorDplusPiReduced { LOGF(debug, "B0 decays in the expected final state but the condition on the intermediate state is not fulfilled"); } } - auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as

(), pdg::Code::kB0, true); + auto indexMother = RecoDecay::getMother(particlesMc, trackPion.template mcParticle_as

(), Pdg::kB0, true); auto particleMother = particlesMc.rawIteratorAt(indexMother); rowHfDPiMcRecReduced(indexHfCand3Prong, selectedTracksPion[trackPion.globalIndex()], flag, debug, particleMother.pt()); } @@ -408,11 +410,11 @@ struct HfDataCreatorDplusPiReduced { int8_t sign{0}; int8_t flag{0}; // B0 → D- π+ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDPlus), +kPiPlus}, true)) { // Match D- -> π- K+ π- auto candDMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking D- -> π- K+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMc, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(particlesMc, candDMC, -static_cast(Pdg::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } } diff --git a/PWGHF/D2H/Tasks/taskB0.cxx b/PWGHF/D2H/Tasks/taskB0.cxx index 6c7762d7e87..7525b5143ee 100644 --- a/PWGHF/D2H/Tasks/taskB0.cxx +++ b/PWGHF/D2H/Tasks/taskB0.cxx @@ -14,6 +14,7 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -209,7 +210,7 @@ struct HfTaskB0 { int flagMcMatchRecB0 = std::abs(candidate.flagMcMatchRec()); if (TESTBIT(flagMcMatchRecB0, hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi)) { - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kB0, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), o2::constants::physics::Pdg::kB0, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); @@ -270,7 +271,7 @@ struct HfTaskB0 { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_b0::DecayType::B0ToDPi)) { auto ptParticle = particle.pt(); - auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassB0); + auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassB0); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskBplus.cxx b/PWGHF/D2H/Tasks/taskBplus.cxx index b8e9cafbeb0..d721f5a0671 100644 --- a/PWGHF/D2H/Tasks/taskBplus.cxx +++ b/PWGHF/D2H/Tasks/taskBplus.cxx @@ -18,6 +18,7 @@ /// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari /// \author Deepa Thomas , UT Austin +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -217,7 +218,7 @@ struct HfTaskBplus { // auto candD0 = candidate.prong0_as(); if (TESTBIT(std::abs(candidate.flagMcMatchRec()), hf_cand_bplus::DecayType::BplusToD0Pi)) { - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBPlus, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), o2::constants::physics::Pdg::kBPlus, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), ptCandBplus); @@ -261,7 +262,7 @@ struct HfTaskBplus { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bplus::DecayType::BplusToD0Pi)) { auto ptParticle = particle.pt(); - auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassBPlus); + auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassBPlus); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskBs.cxx b/PWGHF/D2H/Tasks/taskBs.cxx index b429ca41803..619dadc188c 100644 --- a/PWGHF/D2H/Tasks/taskBs.cxx +++ b/PWGHF/D2H/Tasks/taskBs.cxx @@ -15,6 +15,7 @@ /// /// \author Phil Stahlhut +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -206,7 +207,7 @@ struct HfTaskBs { int flagMcMatchRecBs = std::abs(candidate.flagMcMatchRec()); if (TESTBIT(flagMcMatchRecBs, hf_cand_bs::DecayTypeMc::BsToDsPiToKKPiPi)) { - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBS, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), o2::constants::physics::Pdg::kBS, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); @@ -267,7 +268,7 @@ struct HfTaskBs { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bs::DecayTypeMc::BsToDsPiToKKPiPi)) { auto ptParticle = particle.pt(); - auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassBS); + auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassBS); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 35e8cc56beb..3b50057b720 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -15,6 +15,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -274,10 +275,10 @@ struct HfTaskD0 { } if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), pdg::Code::kD0, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), o2::constants::physics::Pdg::kD0, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); auto ptGen = particleMother.pt(); // gen. level pT - auto yGen = RecoDecay::y(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, o2::analysis::pdg::MassD0); // gen. level y + auto yGen = RecoDecay::y(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, o2::constants::physics::MassD0); // gen. level y registry.fill(HIST("hPtGenSig"), ptGen); // gen. level pT auto ptRec = candidate.pt(); auto yRec = hfHelper.yD0(candidate); @@ -423,11 +424,11 @@ struct HfTaskD0 { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - if (yCandGenMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0)) > yCandGenMax) { + if (yCandGenMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0)) > yCandGenMax) { continue; } auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0); registry.fill(HIST("hPtGen"), ptGen); registry.fill(HIST("hPtVsYGen"), ptGen, yGen); if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index a72ee9070f2..68fd2de83be 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -16,6 +16,7 @@ /// \author Fabio Catalano , Politecnico and INFN Torino /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -146,7 +147,7 @@ struct HfTaskDplus { } if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), pdg::Code::kDPlus, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), o2::constants::physics::Pdg::kDPlus, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT auto ptRec = candidate.pt(); @@ -196,7 +197,7 @@ struct HfTaskDplus { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { auto ptGen = particle.pt(); - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDPlus); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDPlus); if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index 25a865c1aa0..0d5a55eac84 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -16,6 +16,7 @@ /// \author Fabio Catalano , Universita and INFN Torino /// \author Stefano Politanò , Politecnico & INFN Torino +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -243,7 +244,7 @@ struct HfTaskDs { } auto prong0McPart = candidate.prong0_as().mcParticle_as(); - auto indexMother = RecoDecay::getMother(mcParticles, prong0McPart, pdg::Code::kDS, true); + auto indexMother = RecoDecay::getMother(mcParticles, prong0McPart, o2::constants::physics::Pdg::kDS, true); auto particleMother = mcParticles.iteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT @@ -276,7 +277,7 @@ struct HfTaskDs { continue; } auto pt = particle.pt(); - auto y = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDS); + auto y = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDS); if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskLb.cxx b/PWGHF/D2H/Tasks/taskLb.cxx index c34dc181934..03e70c486f9 100644 --- a/PWGHF/D2H/Tasks/taskLb.cxx +++ b/PWGHF/D2H/Tasks/taskLb.cxx @@ -14,6 +14,7 @@ /// /// \author Panos Christakoglou , Nikhef +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -199,7 +200,7 @@ struct HfTaskLbMc { auto candLc = candidate.prong0_as(); if (std::abs(candidate.flagMcMatchRec()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kLambdaB0, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), o2::constants::physics::Pdg::kLambdaB0, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), candidate.pt()); @@ -246,7 +247,7 @@ struct HfTaskLbMc { for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { - auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaB0); + auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaB0); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 3343ebf9663..1040f7fca96 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -17,6 +17,7 @@ /// \author Vít Kučera , CERN /// \author Annalena Kalteyer , GSI Darmstadt +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -326,7 +327,7 @@ struct HfTaskLc { // Get the corresponding MC particle. auto mcParticleProng0 = candidate.prong0_as().mcParticle_as>(); auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); - auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, pdg::Code::kLambdaCPlus, true); + auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, o2::constants::physics::Pdg::kLambdaCPlus, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("MC/generated/signal/hPtGenSig"), particleMother.pt()); // gen. level pT auto pt = candidate.pt(); @@ -456,7 +457,7 @@ struct HfTaskLc { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus); + auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus); if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 11ceb417481..5ff2edd58f3 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -15,6 +15,7 @@ /// /// \author Mattia Faggin , University and INFN PADOVA +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -454,7 +455,7 @@ struct HfTaskSigmac { OR consider the new parametrization of the fiducial acceptance (to be seen for reco signal in MC) */ - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassSigmaC0)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassSigmaC0)) > yCandMax) { continue; } @@ -473,7 +474,7 @@ struct HfTaskSigmac { double phiGenLc(-1.), phiGenSoftPi(-1.); int origin = -1; int8_t channel = -1; - if (std::abs(arrayDaughtersIds[0]) == pdg::Code::kLambdaCPlus) { + if (std::abs(arrayDaughtersIds[0]) == o2::constants::physics::Pdg::kLambdaCPlus) { /// daughter 0 is the Λc+, daughter 1 the soft π auto daugLc = mcParticlesLc.rawIteratorAt(arrayDaughtersIds[0]); auto daugSoftPi = mcParticles.rawIteratorAt(arrayDaughtersIds[1]); @@ -571,12 +572,12 @@ struct HfTaskSigmac { /// Reconstructed Σc0 signal if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi && (chargeSc == 0)) { // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaC0, true); + auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaC0, true); auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.prong0_as(), candidateLc.prong1_as(), candidateLc.prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); @@ -722,12 +723,12 @@ struct HfTaskSigmac { } else if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi && (std::abs(chargeSc) == 2)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaCPlusPlus, true); + auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.prong0_as(), candidateLc.prong1_as(), candidateLc.prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); diff --git a/PWGHF/D2H/Tasks/taskXic.cxx b/PWGHF/D2H/Tasks/taskXic.cxx index b48c9a1436e..8069681dc8b 100644 --- a/PWGHF/D2H/Tasks/taskXic.cxx +++ b/PWGHF/D2H/Tasks/taskXic.cxx @@ -19,6 +19,7 @@ /// \author Himanshu Sharma , University and INFN Padova /// \author Cristina Terrevoli , INFN Bari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -371,7 +372,7 @@ struct HfTaskXic { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::XicToPKPi) { - auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCPlus); + auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCPlus); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskXicc.cxx b/PWGHF/D2H/Tasks/taskXicc.cxx index cbaeacbe541..578869d67a1 100644 --- a/PWGHF/D2H/Tasks/taskXicc.cxx +++ b/PWGHF/D2H/Tasks/taskXicc.cxx @@ -16,6 +16,7 @@ /// \author Gian Michele Innocenti , CERN /// \author Jinjoo Seo , Inha University +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -263,13 +264,13 @@ struct HfTaskXiccMc { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi) { - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCCPlusPlus)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCCPlusPlus)) > yCandMax) { continue; } registry.fill(HIST("hPtGen"), particle.pt()); registry.fill(HIST("hEtaGen"), particle.eta()); - registry.fill(HIST("hYGen"), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCCPlusPlus)); - registry.fill(HIST("hPtvsEtavsYGen"), particle.pt(), particle.eta(), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCCPlusPlus)); + registry.fill(HIST("hYGen"), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCCPlusPlus)); + registry.fill(HIST("hPtvsEtavsYGen"), particle.pt(), particle.eta(), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCCPlusPlus)); } } // end of loop of MC particles } // end of process function diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 9801fd27cef..9b037afed4a 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -21,6 +21,7 @@ #include #include +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisDataModel.h" #include "ALICE3/DataModel/ECAL.h" @@ -31,7 +32,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/Core/PDG.h" namespace o2::aod { @@ -1050,8 +1050,8 @@ DECLARE_SOA_COLUMN(EtaPiFromCharmBaryon, etaPiFromCharmBaryon, double); DECLARE_SOA_COLUMN(EtaCharmBaryon, etaCharmBaryon, double); DECLARE_SOA_COLUMN(EtaCascade, etaCascade, double); DECLARE_SOA_COLUMN(EtaV0, etaV0, double); -DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); -DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); // pos dau +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); // neg dau DECLARE_SOA_COLUMN(DcaXYToPvCascDau, dcaXYToPvCascDau, float); DECLARE_SOA_COLUMN(DcaZToPvV0Dau0, dcaZToPvV0Dau0, float); DECLARE_SOA_COLUMN(DcaZToPvV0Dau1, dcaZToPvV0Dau1, float); diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index c3741d56d4f..d16afed3165 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -14,6 +14,7 @@ /// /// \author Fabio Colamaria , INFN Bari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -28,6 +29,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -396,10 +398,10 @@ struct HfCorrelatorD0D0bar { // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassD0); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -414,15 +416,15 @@ struct HfCorrelatorD0D0bar { // D-Dbar correlation dedicated section // if it's a D0 particle, search for D0bar and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (particle1.pdgCode() != Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) for (const auto& particle2 : mcParticles) { - if (particle2.pdgCode() != pdg::Code::kD0Bar) { // check that inner particle is D0bar + if (particle2.pdgCode() != Pdg::kD0Bar) { // check that inner particle is D0bar continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassD0Bar)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassD0Bar)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { @@ -497,7 +499,7 @@ struct HfCorrelatorD0D0bar { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassCharm); + double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } @@ -521,7 +523,7 @@ struct HfCorrelatorD0D0bar { if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassCharmBar)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassCharmBar)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index ee8520fd1c2..ebfa494537d 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -14,6 +14,7 @@ /// /// \author Fabio Colamaria , INFN Bari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -28,6 +29,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -397,10 +399,10 @@ struct HfCorrelatorD0D0barBarrelFullPid { // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassD0); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -415,15 +417,15 @@ struct HfCorrelatorD0D0barBarrelFullPid { // D-Dbar correlation dedicated section // if it's a D0 particle, search for D0bar and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (particle1.pdgCode() != Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) for (const auto& particle2 : mcParticles) { - if (particle2.pdgCode() != pdg::Code::kD0Bar) { // check that inner particle is D0bar + if (particle2.pdgCode() != Pdg::kD0Bar) { // check that inner particle is D0bar continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassD0Bar)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassD0Bar)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { @@ -498,7 +500,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassCharm); + double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } @@ -522,7 +524,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassCharmBar)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassCharmBar)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index d8b0b82d874..7a2aa274756 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -15,6 +15,7 @@ /// \author Samrangy Sadhu , INFN Bari /// \author Swapnesh Santosh Khade , IIT Indore +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -31,6 +32,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -145,10 +147,10 @@ struct HfCorrelatorD0HadronsSelection { { bool isD0Found = 0; for (const auto& particle1 : mcParticles) { - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassD0); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -201,7 +203,7 @@ struct HfCorrelatorD0Hadrons { (aod::track::dcaZ > static_cast(-dcaZTrackMax)) && (aod::track::dcaZ < static_cast(dcaZTrackMax)); Filter d0Filter = (aod::hf_sel_candidate_d0::isSelD0 >= 1) || (aod::hf_sel_candidate_d0::isSelD0bar >= 1); Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast(pdg::Code::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); HistogramRegistry registry{ "registry", @@ -238,9 +240,9 @@ struct HfCorrelatorD0Hadrons { void init(InitContext&) { - massD0 = o2::analysis::pdg::MassD0; - massPi = o2::analysis::pdg::MassPiPlus; - massK = o2::analysis::pdg::MassKPlus; + massD0 = MassD0; + massPi = MassPiPlus; + massK = MassKPlus; auto vbins = (std::vector)bins; registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -571,10 +573,10 @@ struct HfCorrelatorD0Hadrons { // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassD0); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -588,7 +590,7 @@ struct HfCorrelatorD0Hadrons { // =============== D-h correlation dedicated section ===================== - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } registry.fill(HIST("hCountD0TriggersGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) @@ -609,8 +611,8 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hTrackCounterGen"), 2); // fill before soft pi removal // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, pdg::Code::kDStar, true, nullptr, 1); + auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, Pdg::kDStar, true, nullptr, 1); if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) continue; @@ -832,11 +834,11 @@ struct HfCorrelatorD0Hadrons { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { // Check track t1 is D0 - if (std::abs(t1.pdgCode()) != pdg::Code::kD0) { + if (std::abs(t1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, o2::analysis::pdg::MassD0); + double yD = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -854,8 +856,8 @@ struct HfCorrelatorD0Hadrons { // ==============================soft pion removal================================ // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - auto indexMotherPi = RecoDecay::getMother(mcParticles, t2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(mcParticles, t1, pdg::Code::kDStar, true, nullptr, 1); + auto indexMotherPi = RecoDecay::getMother(mcParticles, t2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, t1, Pdg::kDStar, true, nullptr, 1); if (std::abs(t2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index 16209d40c32..54205bacb67 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -15,6 +15,7 @@ /// \author Fabio Colamaria , INFN Bari /// \author Andrea Tavira García , IJCLab Orsay +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -29,6 +30,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -190,14 +192,14 @@ struct HfCorrelatorDMesonPairs { if (!(TESTBIT(candidate.hfflag(), o2::aod::hf_cand_2prong::DecayType::D0ToPiK))) { return false; } - if (yCandMax >= 0. && std::abs(candidate.y(o2::analysis::pdg::MassD0)) > yCandMax) { + if (yCandMax >= 0. && std::abs(candidate.y(MassD0)) > yCandMax) { return false; } } else { if (!(TESTBIT(candidate.hfflag(), o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi))) { return false; } - if (yCandMax >= 0. && std::abs(candidate.y(o2::analysis::pdg::MassDPlus)) > yCandMax) { + if (yCandMax >= 0. && std::abs(candidate.y(MassDPlus)) > yCandMax) { return false; } } @@ -212,7 +214,7 @@ struct HfCorrelatorDMesonPairs { bool kinematicCutsGen(const T& particle) { // check if the particle is D or Dbar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle.pdgCode()) != pdg::Code::kDPlus && std::abs(particle.pdgCode()) != pdg::Code::kD0) { + if (std::abs(particle.pdgCode()) != Pdg::kDPlus && std::abs(particle.pdgCode()) != Pdg::kD0) { return false; } if (yCandMax >= 0. && std::abs(particle.y()) > yCandMax) { @@ -235,9 +237,9 @@ struct HfCorrelatorDMesonPairs { registry.fill(HIST("hEtaMcRec"), candidate.eta()); registry.fill(HIST("hPhiMcRec"), candidate.phi()); if (isD0) { - registry.fill(HIST("hYMcRec"), candidate.y(o2::analysis::pdg::MassD0)); + registry.fill(HIST("hYMcRec"), candidate.y(MassD0)); } else { - registry.fill(HIST("hYMcRec"), candidate.y(o2::analysis::pdg::MassDPlus)); + registry.fill(HIST("hYMcRec"), candidate.y(MassDPlus)); } } else { registry.fill(HIST("hPtCand"), candidate.pt()); @@ -246,9 +248,9 @@ struct HfCorrelatorDMesonPairs { registry.fill(HIST("hEta"), candidate.eta()); registry.fill(HIST("hPhi"), candidate.phi()); if (isD0) { - registry.fill(HIST("hY"), candidate.y(o2::analysis::pdg::MassD0)); + registry.fill(HIST("hY"), candidate.y(MassD0)); } else { - registry.fill(HIST("hY"), candidate.y(o2::analysis::pdg::MassDPlus)); + registry.fill(HIST("hY"), candidate.y(MassDPlus)); } } } @@ -313,10 +315,10 @@ struct HfCorrelatorDMesonPairs { uint8_t assignCandidateTypeGen(const T& candidate) { uint8_t candidateType(0); - if (candidate.pdgCode() == pdg::Code::kDPlus || candidate.pdgCode() == pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (candidate.pdgCode() == Pdg::kDPlus || candidate.pdgCode() == Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) SETBIT(candidateType, SelectedD); SETBIT(candidateType, TrueD); - } else if (candidate.pdgCode() == -pdg::Code::kDPlus || candidate.pdgCode() == -pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + } else if (candidate.pdgCode() == -Pdg::kDPlus || candidate.pdgCode() == -Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) SETBIT(candidateType, SelectedDbar); SETBIT(candidateType, TrueDbar); } @@ -331,10 +333,10 @@ struct HfCorrelatorDMesonPairs { for (const auto& particle1 : mcParticles) { // check if the particle is D0, D0bar, DPlus or DMinus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! auto pdgCode = std::abs(particle1.pdgCode()); - if (pdgCode != pdg::Code::kD0 && pdgCode != pdg::Code::kDPlus) { + if (pdgCode != Pdg::kD0 && pdgCode != Pdg::kDPlus) { continue; } - auto massD = pdgCode == pdg::Code::kD0 ? o2::analysis::pdg::MassD0 : o2::analysis::pdg::MassDPlus; + auto massD = pdgCode == Pdg::kD0 ? MassD0 : MassDPlus; double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, massD); if (!kinematicCutsGen(particle1)) { continue; @@ -367,15 +369,15 @@ struct HfCorrelatorDMesonPairs { int8_t matchedGen2 = particle2.flagMcMatchGen(); // If both particles are D0's, fill D0Pair table - if (std::abs(particle1.pdgCode()) == pdg::Code::kD0 && std::abs(particle2.pdgCode()) == pdg::Code::kD0) { + if (std::abs(particle1.pdgCode()) == Pdg::kD0 && std::abs(particle2.pdgCode()) == Pdg::kD0) { entryD0Pair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt(), particle1.y(), particle2.y(), - o2::analysis::pdg::MassD0, - o2::analysis::pdg::MassD0, + MassD0, + MassD0, candidateType1, candidateType2, 2); @@ -384,15 +386,15 @@ struct HfCorrelatorDMesonPairs { matchedGen1, matchedGen2); // If both particles are DPlus, fill DplusPair table - } else if (std::abs(particle1.pdgCode()) == pdg::Code::kDPlus && std::abs(particle2.pdgCode()) == pdg::Code::kDPlus) { + } else if (std::abs(particle1.pdgCode()) == Pdg::kDPlus && std::abs(particle2.pdgCode()) == Pdg::kDPlus) { entryDplusPair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt(), particle1.y(), particle2.y(), - o2::analysis::pdg::MassDPlus, - o2::analysis::pdg::MassDPlus, + MassDPlus, + MassDPlus, candidateType1, candidateType2, 2); diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index 72ff78a8e8b..d3c8fefec1e 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -14,6 +14,7 @@ /// /// \author Fabio Colamaria , INFN Bari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -28,6 +29,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -379,10 +381,10 @@ struct HfCorrelatorDplusDminus { // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is Dplus or Dminus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { + if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassDPlus); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassDPlus); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -397,15 +399,15 @@ struct HfCorrelatorDplusDminus { // D-Dbar correlation dedicated section // if it's a Dplus particle, search for Dminus and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (particle1.pdgCode() != Pdg::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } registry.fill(HIST("hCountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus (for normalisation) for (const auto& particle2 : mcParticles) { - if (particle2.pdgCode() != -pdg::Code::kDPlus) { // check that inner particle is a Dminus + if (particle2.pdgCode() != -Pdg::kDPlus) { // check that inner particle is a Dminus continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassDPlus)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassDPlus)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { @@ -415,8 +417,8 @@ struct HfCorrelatorDplusDminus { particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); - entryDplusDminusRecoInfo(o2::analysis::pdg::MassDPlus, - o2::analysis::pdg::MassDPlus, + entryDplusDminusRecoInfo(MassDPlus, + MassDPlus, 8); // Dummy double etaCut = 0.; double ptCut = 0.; @@ -479,7 +481,7 @@ struct HfCorrelatorDplusDminus { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassCharm); + double yC = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } @@ -503,7 +505,7 @@ struct HfCorrelatorDplusDminus { if (particle2.pdgCode() != PDG_t::kCharmBar) { continue; } - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, o2::analysis::pdg::MassCharmBar)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle2.px(), particle2.py(), particle2.pz()}, MassCharmBar)) > yCandMax) { continue; } if (ptCandMin >= 0. && particle2.pt() < ptCandMin) { diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 28aa06a3b01..9e9ea123395 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -12,6 +12,7 @@ /// \file correlatorDplusHadrons.cxx /// \author Shyam Kumar +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -29,6 +30,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -130,10 +132,10 @@ struct HfDplusSelection { { bool isDplusFound = 0; for (const auto& particle1 : mcParticles) { - if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { + if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassDPlus); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassDPlus); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -441,10 +443,10 @@ struct HfCorrelatorDplusHadrons { // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { + if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, o2::analysis::pdg::MassDPlus); + double yD = RecoDecay::y(std::array{particle1.px(), particle1.py(), particle1.pz()}, MassDPlus); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -458,7 +460,7 @@ struct HfCorrelatorDplusHadrons { counterDplusHadron++; // Dplus Hadron correlation dedicated section // if it's a Dplus particle, search for Hadron and evaluate correlations - if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation) @@ -567,11 +569,11 @@ struct HfCorrelatorDplusHadrons { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { // Check track t1 is Dplus - if (std::abs(t1.pdgCode()) != pdg::Code::kDPlus) { + if (std::abs(t1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, o2::analysis::pdg::MassDPlus); + double yD = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, MassDPlus); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index a4c4dc7821c..d62f04b746c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -14,6 +14,7 @@ /// \author Grazia Luparello /// \author Samuele Cattaruzzi +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -31,6 +32,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -137,10 +139,10 @@ struct HfCorrelatorDsHadronsSelCollision { { bool isDsFound = false; for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { + if (std::abs(particle.pdgCode()) != Pdg::kDS) { continue; } - double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDS); + double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, MassDS); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -597,11 +599,11 @@ struct HfCorrelatorDsHadrons { // MC gen level for Ds meson reconstruction's efficiency for (const auto& particle : mcParticles) { // check if the particle is Ds - if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { + if (std::abs(particle.pdgCode()) != Pdg::kDS) { continue; } if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { - double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDS); + double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, MassDS); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -653,11 +655,11 @@ struct HfCorrelatorDsHadrons { // MC gen level for (const auto& particle : mcParticles) { // check if the particle is Ds - if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { + if (std::abs(particle.pdgCode()) != Pdg::kDS) { continue; } if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { - double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDS); + double yD = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, MassDS); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -687,7 +689,7 @@ struct HfCorrelatorDsHadrons { particle.pt(), particleAssoc.pt(), poolBin); - entryDsHadronRecoInfo(o2::analysis::pdg::MassDS, true); + entryDsHadronRecoInfo(MassDS, true); entryDsHadronGenInfo(isDsPrompt); } } diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index c73c2a5315f..d3d64d7c9de 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -15,6 +15,7 @@ /// \author Marianna Mazzilli /// \author Zhen Zhang +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -32,6 +33,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -149,10 +151,10 @@ struct HfCorrelatorLcHadronsSelection { { bool isLcFound = 0; for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != pdg::Code::kLambdaCPlus) { + if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - double yL = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus); + double yL = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, MassLambdaCPlus); if (yCandMax >= 0. && std::abs(yL) > yCandMax) { continue; } @@ -514,11 +516,11 @@ struct HfCorrelatorLcHadrons { // Mc gen level for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != pdg::Code::kLambdaCPlus) { + if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; } if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - double yL = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus); + double yL = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, MassLambdaCPlus); if (yCandMax >= 0. && std::abs(yL) > yCandMax) { continue; } @@ -559,7 +561,7 @@ struct HfCorrelatorLcHadrons { particle.pt(), particleAssoc.pt(), poolBin); - entryLcHadronRecoInfo(o2::analysis::pdg::MassLambdaCPlus, true); + entryLcHadronRecoInfo(MassLambdaCPlus, true); } // end inner loop } } // end outer loop @@ -667,11 +669,11 @@ struct HfCorrelatorLcHadrons { for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { // Check track t1 is Lc - if (std::abs(t1.pdgCode()) != pdg::Code::kLambdaCPlus) { + if (std::abs(t1.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - double yL = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, o2::analysis::pdg::MassLambdaCPlus); + double yL = RecoDecay::y(std::array{t1.px(), t1.py(), t1.pz()}, MassLambdaCPlus); if (yCandMax >= 0. && std::abs(yL) > yCandMax) { continue; } diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 572e3dfab11..d81c5b74329 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -28,6 +28,7 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -42,6 +43,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod::hf_cand_2prong; +using namespace o2::constants::physics; using namespace o2::framework; /// Reconstruction of heavy-flavour 2-prong decay candidates @@ -105,8 +107,8 @@ struct HfCandidateCreator2Prong { hVertexerType->Fill(aod::hf_cand::VertexerType::KfParticle); } - massPi = o2::analysis::pdg::MassPiPlus; - massK = o2::analysis::pdg::MassKPlus; + massPi = MassPiPlus; + massK = MassKPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -443,14 +445,14 @@ struct HfCandidateCreator2ProngExpressions { auto arrayDaughters = std::array{candidate.prong0_as(), candidate.prong1_as()}; // D0(bar) → π± K∓ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { flag = sign * (1 << DecayType::D0ToPiK); } // J/ψ → e+ e− if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToEE; } @@ -458,7 +460,7 @@ struct HfCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToMuMu; } @@ -479,20 +481,20 @@ struct HfCandidateCreator2ProngExpressions { origin = 0; // D0(bar) → π± K∓ - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * (1 << DecayType::D0ToPiK); } // J/ψ → e+ e− if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) { flag = 1 << DecayType::JpsiToEE; } } // J/ψ → μ+ μ− if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << DecayType::JpsiToMuMu; } } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 94c396d2b5a..d734341d336 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -17,6 +17,7 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -30,6 +31,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod::hf_cand_3prong; +using namespace o2::constants::physics; using namespace o2::framework; /// Reconstruction of heavy-flavour 3-prong decay candidates @@ -81,8 +83,8 @@ struct HfCandidateCreator3Prong { LOGP(fatal, "Only one process function between processPvRefit and processNoPvRefit can be enabled at a time."); } - massPi = o2::analysis::pdg::MassPiPlus; - massK = o2::analysis::pdg::MassKPlus; + massPi = MassPiPlus; + massK = MassKPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -293,14 +295,14 @@ struct HfCandidateCreator3ProngExpressions { auto arrayDaughters = std::array{candidate.prong0_as(), candidate.prong1_as(), candidate.prong2_as()}; // D± → π± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::DplusToPiKPi); } // Ds± → K± K∓ π± if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::DsToKKPi); if (arrayDaughters[0].has_mcParticle()) { @@ -323,7 +325,7 @@ struct HfCandidateCreator3ProngExpressions { // Λc± → p± K∓ π± if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::LcToPKPi); @@ -350,7 +352,7 @@ struct HfCandidateCreator3ProngExpressions { // Ξc± → p± K∓ π± if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::XicToPKPi); } @@ -373,13 +375,13 @@ struct HfCandidateCreator3ProngExpressions { arrDaughIndex.clear(); // D± → π± K∓ π± - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::DplusToPiKPi); } // Ds± → K± K∓ π± if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::DsToKKPi); RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { @@ -398,7 +400,7 @@ struct HfCandidateCreator3ProngExpressions { // Λc± → p± K∓ π± if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::LcToPKPi); // Flagging the different Λc± → p± K∓ π± decay channels @@ -421,7 +423,7 @@ struct HfCandidateCreator3ProngExpressions { // Ξc± → p± K∓ π± if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::XicToPKPi); } } diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 4177584d33d..3e08a21c21f 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -15,6 +15,7 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -32,6 +33,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -125,9 +127,9 @@ struct HfCandidateCreatorB0 { runNumber = 0; // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD = o2::analysis::pdg::MassDMinus; - massB0 = o2::analysis::pdg::MassB0; + massPi = MassPiPlus; + massD = MassDMinus; + massB0 = MassB0; invMass2DPiMin = (massB0 - invMassWindowB0) * (massB0 - invMassWindowB0); invMass2DPiMax = (massB0 + invMassWindowB0) * (massB0 + invMassWindowB0); } @@ -369,10 +371,10 @@ struct HfCandidateCreatorB0Expressions { candD.prong2_as()}; // B0 → D- π+ → (π- K+ π-) π+ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, Pdg::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // D- → π- K+ π- - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, Pdg::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi); } else { @@ -383,10 +385,10 @@ struct HfCandidateCreatorB0Expressions { // B0 → Ds- π+ → (K- K+ π-) π+ if (!flag) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, Pdg::kB0, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Ds- → K- K+ π- - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, -pdg::Code::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi); } @@ -401,7 +403,7 @@ struct HfCandidateCreatorB0Expressions { auto particleProng2 = arrayDaughtersB0[2].mcParticle(); auto particleProng3 = arrayDaughtersB0[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {pdg::Code::kB0, pdg::Code::kBS, pdg::Code::kLambdaB0}; + std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); @@ -427,10 +429,10 @@ struct HfCandidateCreatorB0Expressions { flag = 0; origin = 0; // B0 → D- π+ - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDPlus), +kPiPlus}, true)) { // D- → π- K+ π- auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(Pdg::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } } diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index ced6eac6fcc..a8e0632319e 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -18,6 +18,7 @@ /// \author Deepa Thomas , UT Austin /// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -35,6 +36,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -126,9 +128,9 @@ struct HfCandidateCreatorBplus { runNumber = 0; // invariant-mass window cut - massPi = o2::analysis::pdg::MassPiPlus; - massD0 = o2::analysis::pdg::MassD0; - massBplus = o2::analysis::pdg::MassBPlus; + massPi = MassPiPlus; + massD0 = MassD0; + massBplus = MassBPlus; invMass2D0PiMin = (massBplus - invMassWindowBplus) * (massBplus - invMassWindowBplus); invMass2D0PiMax = (massBplus + invMassWindowBplus) * (massBplus + invMassWindowBplus); } @@ -352,7 +354,7 @@ struct HfCandidateCreatorBplusExpressions { int8_t signB = 0, signD0 = 0; int8_t flag = 0; int8_t origin = 0; - int kD0pdg = pdg::Code::kD0; + int kD0pdg = Pdg::kD0; // Match reconstructed candidates. // Spawned table can be used directly @@ -365,8 +367,8 @@ struct HfCandidateCreatorBplusExpressions { auto arrayDaughters = std::array{candidate.prong1_as(), candDaughterD0.prong0_as(), candDaughterD0.prong1_as()}; // B± → D0bar(D0) π± → (K± π∓) π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &signB, 2); - indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD0, -pdg::Code::kD0, std::array{+kKPlus, -kPiPlus}, true, &signD0, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &signB, 2); + indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD0, -Pdg::kD0, std::array{+kKPlus, -kPiPlus}, true, &signD0, 1); if (indexRecD0 > -1 && indexRec > -1) { flag = signB * (1 << hf_cand_bplus::DecayType::BplusToD0Pi); @@ -384,12 +386,12 @@ struct HfCandidateCreatorBplusExpressions { // B± → D0bar(D0) π± → (K± π∓) π± std::vector arrayDaughterB; - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBPlus, std::array{-kD0pdg, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kBPlus, std::array{-kD0pdg, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { // D0(bar) → π± K∓ for (auto iD : arrayDaughterB) { auto candDaughterMC = mcParticles.rawIteratorAt(iD); if (std::abs(candDaughterMC.pdgCode()) == kD0pdg) { - indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, pdg::Code::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); + indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); } } if (indexGenD0 > -1) { diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 6f7454d0ae0..3f6255730a4 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -15,6 +15,7 @@ /// /// \author Phil Stahlhut +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -32,6 +33,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -92,9 +94,9 @@ struct HfCandidateCreatorBs { void init(InitContext const&) { - massPi = o2::analysis::pdg::MassPiPlus; - massDs = o2::analysis::pdg::MassDSBar; - massBs = o2::analysis::pdg::MassBS; + massPi = MassPiPlus; + massDs = MassDSBar; + massBs = MassBS; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -339,7 +341,7 @@ struct HfCandidateCreatorBsExpressions { int8_t flag = 0; std::vector arrDaughDsIndex; std::array arrPDGDaughDs; - std::array arrPDGResonantDsPhiPi = {pdg::Code::kPhi, kPiPlus}; // Ds± → Phi π± + std::array arrPDGResonantDsPhiPi = {Pdg::kPhi, kPiPlus}; // Ds± → Phi π± // Match reconstructed candidates. // Spawned table can be used directly @@ -356,10 +358,10 @@ struct HfCandidateCreatorBsExpressions { candDs.prong2_as()}; // Checking Bs0(bar) → Ds∓ π± → (K- K+ π∓) π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, pdg::Code::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, Pdg::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Checking Ds∓ → K- K+ π∓ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, Pdg::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { @@ -376,10 +378,10 @@ struct HfCandidateCreatorBsExpressions { if (!flag) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, Pdg::kB0, std::array{-kKPlus, +kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Checking Ds± → K- K+ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, Pdg::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { @@ -403,7 +405,7 @@ struct HfCandidateCreatorBsExpressions { auto particleProng2 = arrayDaughtersBs[2].mcParticle(); auto particleProng3 = arrayDaughtersBs[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {pdg::Code::kB0, pdg::Code::kBPlus, pdg::Code::kBS, pdg::Code::kLambdaB0}; + std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); @@ -430,10 +432,10 @@ struct HfCandidateCreatorBsExpressions { arrDaughDsIndex.clear(); // Checking Bs0(bar) → Ds∓ π± → (K- K+ π∓) π± - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBS, std::array{+pdg::Code::kDSBar, +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kBS, std::array{+Pdg::kDSBar, +kPiPlus}, true)) { // Checking Ds∓ → K- K+ π∓ auto candDsMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, Pdg::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { RecoDecay::getDaughters(candDsMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { @@ -449,10 +451,10 @@ struct HfCandidateCreatorBsExpressions { if (!flag) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{+pdg::Code::kDS, -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kB0, std::array{+Pdg::kDS, -kPiPlus}, true)) { // Checking Ds± → K- K+ π± auto candDsMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, Pdg::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2)) { RecoDecay::getDaughters(candDsMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index d3aa264b108..b848651179b 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -17,6 +17,7 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -30,6 +31,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; /// Reconstruction of heavy-flavour cascade decay candidates @@ -72,10 +74,10 @@ struct HfCandidateCreatorCascade { void init(InitContext const&) { - massP = o2::analysis::pdg::MassProton; - massK0s = o2::analysis::pdg::MassK0Short; - massPi = o2::analysis::pdg::MassPiPlus; - massLc = o2::analysis::pdg::MassLambdaCPlus; + massP = MassProton; + massK0s = MassK0Short; + massPi = MassPiPlus; + massLc = MassLambdaCPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -101,7 +103,7 @@ struct HfCandidateCreatorCascade { df.setUseAbsDCA(useAbsDCA); df.setWeightedFinalPCA(useWeightedFinalPCA); - // loop over pairs of track indeces + // loop over pairs of track indices for (const auto& casc : rowsTrackIndexCasc) { const auto& bach = casc.prong0_as(); @@ -252,7 +254,7 @@ struct HfCandidateCreatorCascadeMc { RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, kK0Short, std::array{+kPiPlus, -kPiPlus}, false, &sign, 1); if (sign != 0) { // we have already positively checked the K0s // then we check the Lc - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, +kPiPlus, -kPiPlus}, true, &sign, 3); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi- + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, Pdg::kLambdaCPlus, std::array{+kProton, +kPiPlus, -kPiPlus}, true, &sign, 3); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi- } // Check whether the particle is non-prompt (from a b quark). @@ -269,9 +271,9 @@ struct HfCandidateCreatorCascadeMc { for (const auto& particle : mcParticles) { origin = 0; // checking if I have a Lc --> K0S + p - RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, +kK0Short}, false, &sign, 2); + RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, +kK0Short}, false, &sign, 2); if (sign == 0) { // now check for anti-Lc - RecoDecay::isMatchedMCGen(mcParticles, particle, -pdg::Code::kLambdaCPlus, std::array{-kProton, +kK0Short}, false, &sign, 2); + RecoDecay::isMatchedMCGen(mcParticles, particle, -Pdg::kLambdaCPlus, std::array{-kProton, +kK0Short}, false, &sign, 2); sign = -sign; } if (sign != 0) { diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 1924a3aca87..68394e24d4e 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -14,12 +14,14 @@ /// /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" using namespace o2; +using namespace o2::constants::physics; using namespace o2::framework; /// Reconstruction of D* decay candidates @@ -37,8 +39,8 @@ struct HfCandidateCreatorDstar { aod::Tracks const&, aod::Hf2Prongs const&) { - auto massPi = o2::analysis::pdg::MassPiPlus; - auto massD0 = o2::analysis::pdg::MassD0; + auto massPi = MassPiPlus; + auto massD0 = MassD0; // loop over pairs of prong indices for (const auto& rowTrackIndexDstar : rowsTrackIndexDstar) { diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index 018608984ba..39c12099fcc 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -15,6 +15,7 @@ /// /// \author Panos Christakoglou , Nikhef +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "ReconstructionDataFormats/DCA.h" @@ -29,6 +30,7 @@ using namespace o2; using namespace o2::analysis; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -76,8 +78,8 @@ struct HfCandidateCreatorLb { void init(InitContext const&) { - massPi = o2::analysis::pdg::MassPiMinus; - massLc = o2::analysis::pdg::MassLambdaCPlus; + massPi = MassPiMinus; + massLc = MassLambdaCPlus; } void process(aod::Collision const& collision, @@ -259,10 +261,10 @@ struct HfCandidateCreatorLbMc { lcCand.prong1_as(), lcCand.prong2_as()}; // Λb → Λc+ π- - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { // Λb → Λc+ π- - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } else { @@ -278,10 +280,10 @@ struct HfCandidateCreatorLbMc { flag = 0; origin = 0; // Λb → Λc+ π- - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaB0, std::array{static_cast(pdg::Code::kLambdaCPlus), -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaB0, std::array{static_cast(Pdg::kLambdaCPlus), -kPiPlus}, true)) { // Λc+ → p K- π+ auto LcCandMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, LcCandMC, static_cast(pdg::Code::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, LcCandMC, static_cast(Pdg::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { flag = sign * (1 << hf_cand_lb::DecayType::LbToLcPi); } } diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index c450e60d5c0..14c44c14adb 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -16,6 +16,7 @@ /// \author Mattia Faggin , University and INFN PADOVA #include "CCDB/BasicCCDBManager.h" // for dca recalculation +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPMagField.h" // for dca recalculation #include "DataFormatsParameters/GRPObject.h" // for dca recalculation #include "DetectorsBase/GeometryManager.h" // for dca recalculation @@ -35,6 +36,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -178,10 +180,10 @@ struct HfCandidateCreatorSigmac0plusplus { mPiKPCandLcMax = cutsMassLcMax->get(pTBin, "max piKp mass Lc"); } - if (candLc.isSelLcToPKPi() >= 1 && std::abs(hfHelper.invMassLcToPKPi(candLc) - o2::analysis::pdg::MassLambdaCPlus) <= mPKPiCandLcMax) { + if (candLc.isSelLcToPKPi() >= 1 && std::abs(hfHelper.invMassLcToPKPi(candLc) - MassLambdaCPlus) <= mPKPiCandLcMax) { statusSpreadMinvPKPiFromPDG = 1; } - if (candLc.isSelLcToPiKP() >= 1 && std::abs(hfHelper.invMassLcToPiKP(candLc) - o2::analysis::pdg::MassLambdaCPlus) <= mPiKPCandLcMax) { + if (candLc.isSelLcToPiKP() >= 1 && std::abs(hfHelper.invMassLcToPiKP(candLc) - MassLambdaCPlus) <= mPiKPCandLcMax) { statusSpreadMinvPiKPFromPDG = 1; } if (statusSpreadMinvPKPiFromPDG == 0 && statusSpreadMinvPiKPFromPDG == 0) { @@ -422,7 +424,7 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); } @@ -432,7 +434,7 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); } @@ -458,29 +460,29 @@ struct HfCandidateSigmac0plusplusMc { /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ /// → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kSigmaC0, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaC0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { // generated Σc0 // for (const auto& daughter : particle.daughters_as()) { for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != pdg::Code::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) continue; // if (std::abs(daughter.flagMcMatchGen()) == (1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); break; } } - } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kSigmaCPlusPlus, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { // generated Σc++ // for (const auto& daughter : particle.daughters_as()) { for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != pdg::Code::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) continue; // if (std::abs(daughter.flagMcMatchGen()) == (1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); break; diff --git a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx index e1236f47057..04a4c3024ec 100644 --- a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx @@ -12,7 +12,9 @@ /// \file candidateCreatorToXiPi.cxx /// \brief Reconstruction of Omegac0 and Xic0 -> xi pi candidates /// \author Federica Zanone , Heidelberg University + #include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" #include "DCAFitter/DCAFitterN.h" @@ -39,10 +41,11 @@ using namespace o2; using namespace o2::analysis; -// using namespace o2::analysis::pdg; using namespace o2::aod; using namespace o2::aod::cascdata; using namespace o2::aod::v0data; +using namespace o2::aod::hf_track_index; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -87,15 +90,18 @@ struct HfCandidateCreatorToXiPi { using FilteredHfTrackAssocSel = soa::Filtered>; using MyCascTable = soa::Join; // to use strangeness tracking, use aod::TraCascDatas instead of aod::CascDatas using MyV0Table = soa::Join; + using MySkimIdx = soa::Filtered; Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); // filter to use only HF selected collisions - Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng >= 4); + Filter filterSelectIndexes = (aod::hf_track_index::hfflag == static_cast(1)); + Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng > 0); - Preslice tracksPerCollision = aod::track::collisionId; // needed for PV refit Preslice trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId Preslice cascadesPerCollision = aod::cascdata::collisionId; + Preslice candidatesPerCollision = hf_track_index::collisionId; OutputObj hInvMassCharmBaryon{TH1F("hInvMassCharmBaryon", "Charm baryon invariant mass;inv mass;entries", 500, 2.2, 3.1)}; + OutputObj hFitterExceptions{TH1F("hFitterExceptions", "Charm DCAFitter exceptions;status;entries", 3, 0.0, 3.0)}; void init(InitContext const&) { @@ -106,20 +112,20 @@ struct HfCandidateCreatorToXiPi { runNumber = 0; } - void process(SelectedCollisions const& collisions, - aod::BCsWithTimestamps const& bcWithTimeStamps, - MyTracks const& tracks, - FilteredHfTrackAssocSel const& trackIndices, - MyCascTable const& cascades, - MyV0Table const&, - aod::V0sLinked const&) + void processIdxCombinatorics(SelectedCollisions const& collisions, + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyTracks const& tracks, + FilteredHfTrackAssocSel const& trackIndices, + MyCascTable const& cascades, + MyV0Table const&, + aod::V0sLinked const&) { - double massPionFromPDG = o2::analysis::pdg::MassPiPlus; // pdg code 211 - double massLambdaFromPDG = o2::analysis::pdg::MassLambda0; // pdg code 3122 - double massXiFromPDG = o2::analysis::pdg::MassXiMinus; // pdg code 3312 - double massOmegacFromPDG = o2::analysis::pdg::MassOmegaC0; // pdg code 4332 - double massXicFromPDG = o2::analysis::pdg::MassXiCZero; // pdg code 4132 + double massPionFromPDG = MassPiPlus; // pdg code 211 + double massLambdaFromPDG = MassLambda0; // pdg code 3122 + double massXiFromPDG = MassXiMinus; // pdg code 3312 + double massOmegacFromPDG = MassOmegaC0; // pdg code 4332 + double massXicFromPDG = MassXiCZero; // pdg code 4132 // 2-prong vertex fitter to build the omegac/xic vertex o2::vertexing::DCAFitterN<2> df; @@ -186,8 +192,8 @@ struct HfCandidateCreatorToXiPi { //-------------------------- V0 info--------------------------- // pseudorapidity - double pseudorapV0PosDau = trackV0Dau0.eta(); - double pseudorapV0NegDau = trackV0Dau1.eta(); + double pseudorapV0Dau0 = trackV0Dau0.eta(); + double pseudorapV0Dau1 = trackV0Dau1.eta(); // pion & p <- V0 tracks auto trackParCovV0Dau0 = getTrackParCov(trackV0Dau0); @@ -203,7 +209,7 @@ struct HfCandidateCreatorToXiPi { // pseudorapidity double pseudorapPiFromCas = trackXiDauCharged.eta(); - // pion <- casc track to be processed with DCAfitter + // pion <- casc track auto trackParCovXiDauCharged = getTrackParCov(trackXiDauCharged); // info from LF table @@ -233,6 +239,11 @@ struct HfCandidateCreatorToXiPi { auto groupedTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& trackIndexPion : groupedTrackIndices) { + // use bachelor selections from HfTrackIndexSkimCreatorTagSelTracks --> bit =2 is CandidateType::CandV0bachelor + if (!TESTBIT(trackIndexPion.isSelProng(), 2)) { + continue; + } + auto trackPion = trackIndexPion.track_as(); if ((rejDiffCollTrack) && (trackXiDauCharged.collisionId() != trackPion.collisionId())) { @@ -256,10 +267,18 @@ struct HfCandidateCreatorToXiPi { auto trackParVarPi = getTrackParCov(trackPion); // reconstruct charm baryon with DCAFitter - int nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi); + int nVtxFromFitterCharmBaryon = 0; + try { + nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi); + } catch (...) { + LOG(error) << "Exception caught in charm DCA fitter process call!"; + hFitterExceptions->Fill(1); + continue; + } if (nVtxFromFitterCharmBaryon == 0) { continue; } + hFitterExceptions->Fill(0); auto vertexCharmBaryonFromFitter = df.getPCACandidate(); auto chi2PCACharmBaryon = df.getChi2AtPCACandidate(); std::array pVecCascAsD; @@ -390,7 +409,7 @@ struct HfCandidateCreatorToXiPi { mLambda, mCasc, mCharmBaryon, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, ctOmegac, ctCascade, ctV0, ctXic, - pseudorapV0PosDau, pseudorapV0NegDau, pseudorapPiFromCas, pseudorapPiFromCharmBaryon, + pseudorapV0Dau0, pseudorapV0Dau1, pseudorapPiFromCas, pseudorapPiFromCharmBaryon, pseudorapCharmBaryon, pseudorapCascade, pseudorapV0, dcaxyV0Dau0, dcaxyV0Dau1, dcaxyPiFromCasc, dcazV0Dau0, dcazV0Dau1, dcazPiFromCasc, @@ -402,7 +421,266 @@ struct HfCandidateCreatorToXiPi { } // loop over cascades } // close loop collisions } // end of process -}; // end of struct + PROCESS_SWITCH(HfCandidateCreatorToXiPi, processIdxCombinatorics, "Do indexes combinatorics", true); + + void processDerivedData(SelectedCollisions const& collisions, + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyTracks const& tracks, + MyCascTable const& cascades, + MyV0Table const&, + aod::V0sLinked const&, + MySkimIdx const& candidates) + { + + double massPionFromPDG = MassPiPlus; // pdg code 211 + double massLambdaFromPDG = MassLambda0; // pdg code 3122 + double massXiFromPDG = MassXiMinus; // pdg code 3312 + double massOmegacFromPDG = MassOmegaC0; // pdg code 4332 + double massXicFromPDG = MassXiCZero; // pdg code 4132 + + // 2-prong vertex fitter to build the omegac/xic vertex + o2::vertexing::DCAFitterN<2> df; + df.setPropagateToPCA(propagateToPCA); + df.setMaxR(maxR); + df.setMaxDZIni(maxDZIni); + df.setMaxDXYIni(maxDXYIni); + df.setMinParamChange(minParamChange); + df.setMinRelChi2Change(minRelChi2Change); + df.setMaxChi2(maxChi2); + df.setUseAbsDCA(useAbsDCA); + df.setWeightedFinalPCA(useWeightedFinalPCA); + + for (const auto& collision : collisions) { + + // set the magnetic field from CCDB + auto bc = collision.bc_as(); + initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); + auto magneticField = o2::base::Propagator::Instance()->getNominalBz(); // z component + + df.setBz(magneticField); + df.setRefitWithMatCorr(refitWithMatCorr); + + // loop over cascades reconstructed by cascadebuilder.cxx + auto thisCollId = collision.globalIndex(); + auto groupedCandidates = candidates.sliceBy(candidatesPerCollision, thisCollId); + + for (const auto& cand : groupedCandidates) { + + auto casc = cand.cascade_as(); + auto trackPion = cand.prong0_as(); // pi <-- charm baryon + auto trackXiDauCharged = casc.bachelor_as(); // pion <- xi track + auto v0 = casc.v0_as(); + auto v0Element = v0.v0Data_as(); // V0 <-- xi + auto trackV0Dau0 = v0Element.posTrack_as(); // V0 positive daughter track + auto trackV0Dau1 = v0Element.negTrack_as(); // V0 negative daughter track + + //-------------------------- V0 info--------------------------- + // pseudorapidity + double pseudorapV0Dau0 = trackV0Dau0.eta(); + double pseudorapV0Dau1 = trackV0Dau1.eta(); + + // pion & p <- V0 tracks + auto trackParCovV0Dau0 = getTrackParCov(trackV0Dau0); + auto trackParCovV0Dau1 = getTrackParCov(trackV0Dau1); + + // info from LF table + std::array pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; + std::array vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; + std::array pVecV0Dau0 = {casc.pxpos(), casc.pypos(), casc.pzpos()}; + std::array pVecV0Dau1 = {casc.pxneg(), casc.pyneg(), casc.pzneg()}; + + //-------------------reconstruct cascade track------------------ + // pseudorapidity + double pseudorapPiFromCas = trackXiDauCharged.eta(); + + auto trackParCovXiDauCharged = getTrackParCov(trackXiDauCharged); + + // info from LF table + std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; + std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; + std::array covCasc = {0.}; + constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component + for (int i = 0; i < 6; i++) { + covCasc[MomInd[i]] = casc.momentumCovMat()[i]; + covCasc[i] = casc.positionCovMat()[i]; + } + // create cascade track + o2::track::TrackParCov trackCasc; + if (trackXiDauCharged.sign() > 0) { + trackCasc = o2::track::TrackParCov(vertexCasc, pVecCasc, covCasc, 1, true); + } else if (trackXiDauCharged.sign() < 0) { + trackCasc = o2::track::TrackParCov(vertexCasc, pVecCasc, covCasc, -1, true); + } else { + continue; + } + trackCasc.setAbsCharge(1); + trackCasc.setPID(o2::track::PID::XiMinus); + + std::array pVecPionFromCasc = {casc.pxbach(), casc.pybach(), casc.pzbach()}; + + //------------reconstruct charm baryon decay vtx--------------- + auto trackParVarPi = getTrackParCov(trackPion); // charm bachelor pion track to be processed with DCAFitter + + // reconstruct charm baryon with DCAFitter + int nVtxFromFitterCharmBaryon = 0; + try { + nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi); + } catch (...) { + LOG(error) << "Exception caught in charm DCA fitter process call!"; + hFitterExceptions->Fill(1); + continue; + } + if (nVtxFromFitterCharmBaryon == 0) { + continue; + } + hFitterExceptions->Fill(0); + auto vertexCharmBaryonFromFitter = df.getPCACandidate(); + auto chi2PCACharmBaryon = df.getChi2AtPCACandidate(); + std::array pVecCascAsD; + std::array pVecPionFromCharmBaryon; + df.propagateTracksToVertex(); + if (!df.isPropagateTracksToVertexDone()) { + continue; + } + df.getTrack(0).getPxPyPzGlo(pVecCascAsD); + df.getTrack(1).getPxPyPzGlo(pVecPionFromCharmBaryon); + std::array pVecCharmBaryon = {pVecCascAsD[0] + pVecPionFromCharmBaryon[0], pVecCascAsD[1] + pVecPionFromCharmBaryon[1], pVecCascAsD[2] + pVecPionFromCharmBaryon[2]}; + + std::array coordVtxCharmBaryon = df.getPCACandidatePos(); + std::array covVtxCharmBaryon = df.calcPCACovMatrixFlat(); + + // pseudorapidity + double pseudorapPiFromCharmBaryon = trackPion.eta(); + + // DCAxy (computed with propagateToDCABxByBz method) + float dcaxyV0Dau0 = trackV0Dau0.dcaXY(); + float dcaxyV0Dau1 = trackV0Dau1.dcaXY(); + float dcaxyPiFromCasc = trackXiDauCharged.dcaXY(); + + // DCAz (computed with propagateToDCABxByBz method) + float dcazV0Dau0 = trackV0Dau0.dcaZ(); + float dcazV0Dau1 = trackV0Dau1.dcaZ(); + float dcazPiFromCasc = trackXiDauCharged.dcaZ(); + + // primary vertex of the collision + auto primaryVertex = getPrimaryVertex(collision); // get the associated covariance matrix with auto covMatrixPV = primaryVertex.getCov(); + std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; + + if (doPvRefit && ((trackPion.pvRefitSigmaX2() != 1e10f) || (trackPion.pvRefitSigmaY2() != 1e10f) || (trackPion.pvRefitSigmaZ2() != 1e10f))) { // if I asked for PV refit in trackIndexSkimCreator.cxx + pvCoord[0] = trackPion.pvRefitX(); + pvCoord[1] = trackPion.pvRefitY(); + pvCoord[2] = trackPion.pvRefitZ(); + + // o2::dataformats::VertexBase Pvtx; + primaryVertex.setX(trackPion.pvRefitX()); + primaryVertex.setY(trackPion.pvRefitY()); + primaryVertex.setZ(trackPion.pvRefitZ()); + primaryVertex.setCov(trackPion.pvRefitSigmaX2(), trackPion.pvRefitSigmaXY(), trackPion.pvRefitSigmaY2(), trackPion.pvRefitSigmaXZ(), trackPion.pvRefitSigmaYZ(), trackPion.pvRefitSigmaZ2()); + + o2::dataformats::DCA impactParameterV0Dau0; + o2::dataformats::DCA impactParameterV0Dau1; + o2::dataformats::DCA impactParameterPiFromCasc; + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParCovXiDauCharged, 2.f, matCorr, &impactParameterPiFromCasc); + dcaxyV0Dau0 = impactParameterV0Dau0.getY(); + dcaxyV0Dau1 = impactParameterV0Dau1.getY(); + dcaxyPiFromCasc = impactParameterPiFromCasc.getY(); + dcazV0Dau0 = impactParameterV0Dau0.getZ(); + dcazV0Dau1 = impactParameterV0Dau1.getZ(); + dcazPiFromCasc = impactParameterPiFromCasc.getZ(); + } + + // impact parameters + o2::dataformats::DCA impactParameterCasc; + o2::dataformats::DCA impactParameterPiFromCharmBaryon; + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackCasc, 2.f, matCorr, &impactParameterCasc); + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarPi, 2.f, matCorr, &impactParameterPiFromCharmBaryon); + float impactParPiFromCharmBaryonXY = impactParameterPiFromCharmBaryon.getY(); + float impactParPiFromCharmBaryonZ = impactParameterPiFromCharmBaryon.getZ(); + + // invariant mass under the hypothesis of particles ID corresponding to the decay chain + double mLambda = casc.mLambda(); // from LF table, V0 mass under lambda hypothesis + double mCasc = casc.mXi(); + const std::array arrMassCharmBaryon = {massXiFromPDG, massPionFromPDG}; + double mCharmBaryon = RecoDecay::m(std::array{pVecCascAsD, pVecPionFromCharmBaryon}, arrMassCharmBaryon); + + // computing cosPA + double cpaV0 = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); + double cpaCharmBaryon = RecoDecay::cpa(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); + double cpaCasc = RecoDecay::cpa(coordVtxCharmBaryon, vertexCasc, pVecCasc); + double cpaxyV0 = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); + double cpaxyCharmBaryon = RecoDecay::cpaXY(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); + double cpaxyCasc = RecoDecay::cpaXY(coordVtxCharmBaryon, vertexCasc, pVecCasc); + + // computing decay length and ctau + double decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); + double decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); + double decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); + + double phiCharmBaryon, thetaCharmBaryon; + getPointDirection(std::array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, coordVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon); + auto errorDecayLengthCharmBaryon = std::sqrt(getRotatedCovMatrixXX(primaryVertex.getCov(), phiCharmBaryon, thetaCharmBaryon) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon)); + auto errorDecayLengthXYCharmBaryon = std::sqrt(getRotatedCovMatrixXX(primaryVertex.getCov(), phiCharmBaryon, 0.) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, 0.)); + + double ctOmegac = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, massOmegacFromPDG); + double ctXic = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, massXicFromPDG); + double ctCascade = RecoDecay::ct(pVecCasc, decLenCascade, massXiFromPDG); + double ctV0 = RecoDecay::ct(pVecV0, decLenV0, massLambdaFromPDG); + + // computing eta + double pseudorapCharmBaryon = RecoDecay::eta(pVecCharmBaryon); + double pseudorapCascade = RecoDecay::eta(pVecCasc); + double pseudorapV0 = RecoDecay::eta(pVecV0); + + // DCA between daughters + float dcaCascDau = casc.dcacascdaughters(); + float dcaV0Dau = casc.dcaV0daughters(); + float dcaCharmBaryonDau = std::sqrt(df.getChi2AtPCACandidate()); + + // set hfFlag + int hfFlag = 1 << aod::hf_cand_toxipi::DecayType::DecayToXiPi; + + // fill test histograms + hInvMassCharmBaryon->Fill(mCharmBaryon); + + // fill the table + rowCandidate(collision.globalIndex(), + pvCoord[0], pvCoord[1], pvCoord[2], + vertexCharmBaryonFromFitter[0], vertexCharmBaryonFromFitter[1], vertexCharmBaryonFromFitter[2], + vertexCasc[0], vertexCasc[1], vertexCasc[2], + vertexV0[0], vertexV0[1], vertexV0[2], + trackXiDauCharged.sign(), + chi2PCACharmBaryon, covVtxCharmBaryon[0], covVtxCharmBaryon[1], covVtxCharmBaryon[2], covVtxCharmBaryon[3], covVtxCharmBaryon[4], covVtxCharmBaryon[5], + pVecCharmBaryon[0], pVecCharmBaryon[1], pVecCharmBaryon[2], + pVecCasc[0], pVecCasc[1], pVecCasc[2], + pVecPionFromCharmBaryon[0], pVecPionFromCharmBaryon[1], pVecPionFromCharmBaryon[2], + pVecV0[0], pVecV0[1], pVecV0[2], + pVecPionFromCasc[0], pVecPionFromCasc[1], pVecPionFromCasc[2], + pVecV0Dau0[0], pVecV0Dau0[1], pVecV0Dau0[2], + pVecV0Dau1[0], pVecV0Dau1[1], pVecV0Dau1[2], + impactParameterCasc.getY(), impactParPiFromCharmBaryonXY, + impactParameterCasc.getZ(), impactParPiFromCharmBaryonZ, + std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterPiFromCharmBaryon.getSigmaY2()), + v0Element.globalIndex(), v0Element.posTrackId(), v0Element.negTrackId(), + casc.globalIndex(), trackPion.globalIndex(), trackXiDauCharged.globalIndex(), + mLambda, mCasc, mCharmBaryon, + cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, + ctOmegac, ctCascade, ctV0, ctXic, + pseudorapV0Dau0, pseudorapV0Dau1, pseudorapPiFromCas, pseudorapPiFromCharmBaryon, + pseudorapCharmBaryon, pseudorapCascade, pseudorapV0, + dcaxyV0Dau0, dcaxyV0Dau1, dcaxyPiFromCasc, + dcazV0Dau0, dcazV0Dau1, dcazPiFromCasc, + dcaCascDau, dcaV0Dau, dcaCharmBaryonDau, + decLenCharmBaryon, decLenCascade, decLenV0, errorDecayLengthCharmBaryon, errorDecayLengthXYCharmBaryon, + hfFlag); + + } // loop over LF Cascade-bachelor candidates + } // loop over collisions + } // end of process + PROCESS_SWITCH(HfCandidateCreatorToXiPi, processDerivedData, "Process derived data", false); + +}; // end of struct /// Performs MC matching. struct HfCandidateCreatorToXiPiMc { @@ -434,8 +712,8 @@ struct HfCandidateCreatorToXiPiMc { int8_t debugGenXi = 0; int8_t debugGenLambda = 0; - int pdgCodeOmegac0 = pdg::Code::kOmegaC0; // 4332 - int pdgCodeXic0 = pdg::Code::kXiCZero; // 4132 + int pdgCodeOmegac0 = Pdg::kOmegaC0; // 4332 + int pdgCodeXic0 = Pdg::kXiCZero; // 4132 int pdgCodeXiMinus = kXiMinus; // 3312 int pdgCodeLambda = kLambda0; // 3122 int pdgCodePiPlus = kPiPlus; // 211 diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index a6a2c2305c0..1a80868b211 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -17,6 +17,7 @@ /// \author Luigi Dello Stritto , SALERNO /// \author Mattia Faggin , University and INFN PADOVA +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" #include "ReconstructionDataFormats/DCA.h" @@ -30,6 +31,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -73,9 +75,9 @@ struct HfCandidateCreatorXicc { void init(InitContext const&) { - massPi = o2::analysis::pdg::MassPiPlus; - massK = o2::analysis::pdg::MassKPlus; - massXic = o2::analysis::pdg::MassXiCPlus; + massPi = MassPiPlus; + massK = MassKPlus; + massXic = MassXiCPlus; } void process(aod::Collision const& collision, @@ -236,10 +238,10 @@ struct HfCandidateCreatorXiccMc { xicCand.prong1_as(), xicCand.prong2_as()}; // Ξcc±± → p± K∓ π± π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { // Ξc± → p± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersXic, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersXic, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi; } else { @@ -255,10 +257,10 @@ struct HfCandidateCreatorXiccMc { flag = 0; origin = 0; // Ξcc±± → Ξc± + π± - if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kXiCCPlusPlus, std::array{static_cast(pdg::Code::kXiCPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCCPlusPlus, std::array{static_cast(Pdg::kXiCPlus), +kPiPlus}, true)) { // Ξc± → p± K∓ π± auto candXicMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, candXicMC, static_cast(pdg::Code::kXiCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candXicMC, static_cast(Pdg::kXiCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { flag = sign * (1 << aod::hf_cand_xicc::DecayType::XiccToXicPi); } } diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index 24c78e9aa32..e302d1f0f3b 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -15,6 +15,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -209,11 +210,11 @@ struct HfCandidateSelectorD0 { massD0bar = hfHelper.invMassD0barToKPi(candidate); } if (trackPion.sign() > 0) { - if (std::abs(massD0 - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(massD0 - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(massD0bar - o2::analysis::pdg::MassD0) > cuts->get(pTBin, "m")) { + if (std::abs(massD0bar - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } } @@ -242,11 +243,11 @@ struct HfCandidateSelectorD0 { // in case only sideband candidates have to be stored, additional invariant-mass cut if (keepOnlySidebandCandidates) { if (trackPion.sign() > 0) { - if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::analysis::pdg::MassD0) < distanceFromD0MassForSidebands) { + if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::constants::physics::MassD0) < distanceFromD0MassForSidebands) { return false; } } else { - if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::analysis::pdg::MassD0) < distanceFromD0MassForSidebands) { + if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::constants::physics::MassD0) < distanceFromD0MassForSidebands) { return false; } } @@ -373,11 +374,11 @@ struct HfCandidateSelectorD0 { bool isSelectedMlD0bar = false; if (statusD0 > 0) { - std::vector inputFeaturesD0 = hfMlResponse.getInputFeatures(candidate, trackPos, trackNeg, o2::analysis::pdg::kD0); + std::vector inputFeaturesD0 = hfMlResponse.getInputFeatures(candidate, trackPos, trackNeg, o2::constants::physics::kD0); isSelectedMlD0 = hfMlResponse.isSelectedMl(inputFeaturesD0, ptCand, outputMlD0); } if (statusD0bar > 0) { - std::vector inputFeaturesD0bar = hfMlResponse.getInputFeatures(candidate, trackPos, trackNeg, o2::analysis::pdg::kD0Bar); + std::vector inputFeaturesD0bar = hfMlResponse.getInputFeatures(candidate, trackPos, trackNeg, o2::constants::physics::kD0Bar); isSelectedMlD0bar = hfMlResponse.isSelectedMl(inputFeaturesD0bar, ptCand, outputMlD0bar); } diff --git a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx index 028c68e6594..d10f313109a 100644 --- a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx @@ -15,6 +15,7 @@ /// \author Fabio Catalano , Politecnico and INFN Torino /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -146,7 +147,7 @@ struct HfCandidateSelectorDplusToPiKPi { return false; } // invariant-mass cut - if (std::abs(hfHelper.invMassDplusToPiKPi(candidate) - o2::analysis::pdg::MassDPlus) > cuts->get(pTBin, "deltaM")) { + if (std::abs(hfHelper.invMassDplusToPiKPi(candidate) - o2::constants::physics::MassDPlus) > cuts->get(pTBin, "deltaM")) { return false; } if (candidate.decayLength() < cuts->get(pTBin, "decay length")) { diff --git a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx index 7c2fcd9792e..451a3cb157e 100644 --- a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx @@ -15,6 +15,7 @@ /// \author Fabio Catalano , Universita and INFN Torino /// \author Stefano Politano , Politecnico and INFN Torino +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -159,7 +160,7 @@ struct HfCandidateSelectorDsToKKPi { if (trackKaon1.pt() < cuts->get(pTBin, "pT K") || trackKaon2.pt() < cuts->get(pTBin, "pT K") || trackPion.pt() < cuts->get(pTBin, "pT Pi")) { return false; } - if (std::abs(hfHelper.invMassDsToKKPi(candidate) - o2::analysis::pdg::MassDS) > cuts->get(pTBin, "deltaM")) { + if (std::abs(hfHelper.invMassDsToKKPi(candidate) - o2::constants::physics::MassDS) > cuts->get(pTBin, "deltaM")) { return false; } if (hfHelper.deltaMassPhiDsToKKPi(candidate) > cuts->get(pTBin, "deltaM Phi")) { @@ -188,7 +189,7 @@ struct HfCandidateSelectorDsToKKPi { if (trackKaon1.pt() < cuts->get(pTBin, "pT K") || trackKaon2.pt() < cuts->get(pTBin, "pT K") || trackPion.pt() < cuts->get(pTBin, "pT Pi")) { return false; } - if (std::abs(hfHelper.invMassDsToPiKK(candidate) - o2::analysis::pdg::MassDS) > cuts->get(pTBin, "deltaM")) { + if (std::abs(hfHelper.invMassDsToPiKK(candidate) - o2::constants::physics::MassDS) > cuts->get(pTBin, "deltaM")) { return false; } if (hfHelper.deltaMassPhiDsToPiKK(candidate) > cuts->get(pTBin, "deltaM Phi")) { diff --git a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx index bacfb79d983..af29313e40f 100644 --- a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx @@ -14,6 +14,7 @@ /// /// \author Panos Christakoglou , Nikhef +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -66,7 +67,7 @@ struct HfCandidateSelectorLbToLcPi { } //Λb0 mass cut - if (std::abs(hfHelper.invMassLbToLcPi(hfCandLb) - o2::analysis::pdg::MassLambdaB0) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLbToLcPi(hfCandLb) - o2::constants::physics::MassLambdaB0) > cuts->get(pTBin, "m")) { // LOGF(debug, "Lb topol selection failed at mass diff check"); return false; } @@ -83,7 +84,7 @@ struct HfCandidateSelectorLbToLcPi { // Lc mass // if (trackPi.sign() < 0) { - // if (std::abs(hfHelper.invMassLcToPKPi(hfCandLc) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "DeltaMLc")) { + // if (std::abs(hfHelper.invMassLcToPKPi(hfCandLc) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "DeltaMLc")) { // return false; // } // } diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index 7dc2f99f979..1de65bed0a7 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -16,6 +16,7 @@ /// \author Nima Zardoshti , CERN /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -135,11 +136,11 @@ struct HfCandidateSelectorLc { } if (trackProton.globalIndex() == candidate.prong0Id()) { - if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPKPi(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::analysis::pdg::MassLambdaCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassLcToPiKP(candidate) - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/TableProducer/candidateSelectorLcMl.cxx b/PWGHF/TableProducer/candidateSelectorLcMl.cxx index 4cdd47caaab..f133daa65ac 100644 --- a/PWGHF/TableProducer/candidateSelectorLcMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcMl.cxx @@ -17,6 +17,7 @@ /// \author Vít Kučera , CERN /// \author Maja Kabus , CERN, Warsaw University of Technology +#include "CommonConstants/PhysicsConstants.h" #include "CCDB/CcdbApi.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -252,10 +253,10 @@ struct HfCandidateSelectorLcMl { std::array pVecPos1 = {trackPos1.px(), trackPos1.py(), trackPos1.pz()}; std::array pVecNeg = {trackNeg.px(), trackNeg.py(), trackNeg.pz()}; std::array pVecPos2 = {trackPos2.px(), trackPos2.py(), trackPos2.pz()}; - const float massPi = o2::analysis::pdg::MassPiPlus; - const float massK = o2::analysis::pdg::MassKPlus; - const float massProton = o2::analysis::pdg::MassProton; - const float massLc = o2::analysis::pdg::MassLambdaCPlus; + const float massPi = o2::constants::physics::MassPiPlus; + const float massK = o2::constants::physics::MassKPlus; + const float massProton = o2::constants::physics::MassProton; + const float massLc = o2::constants::physics::MassLambdaCPlus; if (statusLcToPiKP == 1) { auto invMassLcToPiKP = RecoDecay::m(std::array{pVecPos1, pVecNeg, pVecPos2}, std::array{massPi, massK, massProton}); if (std::abs(invMassLcToPiKP - massLc) >= maxDeltaMass && candidate.pt() < 10) { diff --git a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx index d5575866fa2..ced31b34d11 100644 --- a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx @@ -15,7 +15,9 @@ /// /// \author Chiara Zampolli , CERN /// Daniel Samitz, , Vienna +/// Elisa Meninno, , Vienna +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -23,6 +25,7 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/HfMlResponse.h" +#include "PWGHF/Core/HfMlResponseLcToK0sP.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -30,74 +33,9 @@ using namespace o2; using namespace o2::analysis; using namespace o2::framework; -// possible input features for ML -enum MLInputFeatures { - numContrib = 0, - posX, - posY, - posZ, - xSecondaryVertex, - ySecondaryVertex, - zSecondaryVertex, - errorDecayLength, - errorDecayLengthXY, - chi2PCA, - rSecondaryVertex, - decayLength, - decayLengthXY, - decayLengthNormalised, - decayLengthXYNormalised, - impactParameterNormalised0, - ptProng0, - pProng0, - impactParameterNormalised1, - ptProng1, - pProng1, - pxProng0, - pyProng0, - pzProng0, - pxProng1, - pyProng1, - pzProng1, - impactParameter0, - impactParameter1, - errorImpactParameter0, - errorImpactParameter1, - v0X, - v0Y, - v0Z, - v0Radius, - v0CosPA, - v0MLambda, - v0MAntiLambda, - v0MK0Short, - v0MGamma, - v0CtK0Short, - v0CtLambda, - dcaV0Daughters, - pxPos, - pyPos, - pzPos, - ptV0Pos, - dcaPosToPV, - pxNeg, - pyNeg, - pzNeg, - ptV0Neg, - dcaNegToPV, - nSigmaTPCPr0, - nSigmaTOFPr0, - m, - pt, - p, - cpa, - cpaXY, - ct, - eta, - phi, - y, - e, - NInputFeatures +/// Struct to extend TracksPidPr table +struct HfCandidateSelectorLcToK0sPExpressions { + Spawns rowTracksPidFullPr; }; struct HfCandidateSelectorLcToK0sP { @@ -130,7 +68,7 @@ struct HfCandidateSelectorLcToK0sP { Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; Configurable> cutsMl{"cutsMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; Configurable nClassesMl{"nClassesMl", (int8_t)hf_cuts_ml::nCutScores, "Number of classes in ML model"}; - Configurable> inputFeaturesML{"inputFeaturesML", {""}, "List of input features for the ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; // CCDB configuration Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTLc"}, "Paths of models on CCDB"}; @@ -142,15 +80,14 @@ struct HfCandidateSelectorLcToK0sP { TrackSelectorPr selectorProtonLowP; TrackSelectorPr selectorProtonHighP; - o2::analysis::HfMlResponse hfMlResponse; - std::vector selectedInputFeatures{std::vector(MLInputFeatures::NInputFeatures, false)}; + o2::analysis::HfMlResponseLcToK0sP hfMlResponse; o2::ccdb::CcdbApi ccdbApi; std::vector> hModelScore; std::vector> hModelScoreVsPtCand; - using TracksSel = soa::Join; + using TracksSel = soa::Join; using TracksSelBayes = soa::Join; HistogramRegistry registry{"registry", {}}; @@ -184,319 +121,17 @@ struct HfCandidateSelectorLcToK0sP { } else { hfMlResponse.setModelPathsLocal(onnxFileNames); } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); hfMlResponse.init(); // load histograms for ML score AxisSpec axisScore = {100, 0, 1, "score"}; AxisSpec axisBinsPt = {binsPtMl, "#it{p}_{T} (GeV/#it{c})"}; for (int classMl = 0; classMl < nClassesMl; classMl++) { - hModelScore.push_back(registry.add(Form("hMlScoreClass%d", classMl), "Model core distribution for Lc;Model score;counts", HistType::kTH1F, {axisScore})); + hModelScore.push_back(registry.add(Form("hMlScoreClass%d", classMl), "Model score distribution for Lc;Model score;counts", HistType::kTH1F, {axisScore})); hModelScoreVsPtCand.push_back(registry.add(Form("hMlScoreClass%dVsPtCand", classMl), "Model score distribution for Lc;Model score;counts", HistType::kTH2F, {axisScore, axisBinsPt})); } - - // set the selected input features - initInputFeatures(); - } - } - - // Check the list of selected input features for ML model - void initInputFeatures() - { - std::map inputFeatureNames{ - {numContrib, "numContrib"}, - {posX, "posX"}, - {posY, "posY"}, - {posZ, "posZ"}, - {xSecondaryVertex, "xSecondaryVertex"}, - {ySecondaryVertex, "ySecondaryVertex"}, - {zSecondaryVertex, "zSecondaryVertex"}, - {errorDecayLength, "errorDecayLength"}, - {errorDecayLengthXY, "errorDecayLengthXY"}, - {chi2PCA, "chi2PCA"}, - {rSecondaryVertex, "rSecondaryVertex"}, - {decayLength, "decayLength"}, - {decayLengthXY, "decayLengthXY"}, - {decayLengthNormalised, "decayLengthNormalised"}, - {decayLengthXYNormalised, "decayLengthXYNormalised"}, - {impactParameterNormalised0, "impactParameterNormalised0"}, - {ptProng0, "ptProng0"}, - {pProng0, "pProng0"}, - {impactParameterNormalised1, "impactParameterNormalised1"}, - {ptProng1, "ptProng1"}, - {pProng1, "pProng1"}, - {pxProng0, "pxProng0"}, - {pyProng0, "pyProng0"}, - {pzProng0, "pzProng0"}, - {pxProng1, "pxProng1"}, - {pyProng1, "pyProng1"}, - {pzProng1, "pzProng1"}, - {impactParameter0, "impactParameter0"}, - {impactParameter1, "impactParameter1"}, - {errorImpactParameter0, "errorImpactParameter0"}, - {errorImpactParameter1, "errorImpactParameter1"}, - {v0X, "v0X"}, - {v0Y, "v0Y"}, - {v0Z, "v0Z"}, - {v0Radius, "v0Radius"}, - {v0CosPA, "v0CosPA"}, - {v0MLambda, "v0MLambda"}, - {v0MAntiLambda, "v0MAntiLambda"}, - {v0MK0Short, "v0MK0Short"}, - {v0MGamma, "v0MGamma"}, - {v0CtK0Short, "v0CtK0Short"}, - {v0CtLambda, "v0CtLambda"}, - {dcaV0Daughters, "dcaV0Daughters"}, - {pxPos, "pxPos"}, - {pyPos, "pyPos"}, - {pzPos, "pzPos"}, - {ptV0Pos, "ptV0Pos"}, - {dcaPosToPV, "dcaPosToPV"}, - {pxNeg, "pxNeg"}, - {pyNeg, "pyNeg"}, - {pzNeg, "pzNeg"}, - {ptV0Neg, "ptV0Neg"}, - {dcaNegToPV, "dcaNegToPV"}, - {nSigmaTPCPr0, "nSigmaTPCPr0"}, - {nSigmaTOFPr0, "nSigmaTOFPr0"}, - {m, "m"}, - {pt, "pt"}, - {p, "p"}, - {cpa, "cpa"}, - {cpaXY, "cpaXY"}, - {ct, "ct"}, - {eta, "eta"}, - {phi, "phi"}, - {y, "y"}, - {e, "e"}}; - - // check for each possible input feature if it is included in the list of selected input features or not - for (const auto& inputFeature : inputFeatureNames) { - if (std::find(std::begin(inputFeaturesML.value), std::end(inputFeaturesML.value), inputFeature.second) != std::end(inputFeaturesML.value)) { - selectedInputFeatures[inputFeature.first] = true; - LOG(info) << "Included \'" << inputFeature.second << "\' in list of ML input features."; - } else { - selectedInputFeatures[inputFeature.first] = false; - } - } - - // check if all given input features are recongnized - for (const auto& inputFeature : inputFeaturesML.value) { - bool found = false; - for (const auto& inputFeatureName : inputFeatureNames) { - if (inputFeatureName.second == inputFeature) { - found = true; - break; - } - } - if (!found) { - LOG(fatal) << "Can not find \'" << inputFeature << "\' in list of possible ML input features."; - } - } - } - - // fill only the selcted input features into the the vector of ML input features - template - std::vector setInputFeatures(const T& candidate, const U& bach) - { - std::vector inputFeatures; - - if (selectedInputFeatures[MLInputFeatures::numContrib]) { - inputFeatures.push_back(bach.collision().numContrib()); - } - if (selectedInputFeatures[MLInputFeatures::posX]) { - inputFeatures.push_back(candidate.posX()); - } - if (selectedInputFeatures[MLInputFeatures::posY]) { - inputFeatures.push_back(candidate.posY()); - } - if (selectedInputFeatures[MLInputFeatures::posZ]) { - inputFeatures.push_back(candidate.posZ()); - } - if (selectedInputFeatures[MLInputFeatures::xSecondaryVertex]) { - inputFeatures.push_back(candidate.xSecondaryVertex()); - } - if (selectedInputFeatures[MLInputFeatures::ySecondaryVertex]) { - inputFeatures.push_back(candidate.ySecondaryVertex()); - } - if (selectedInputFeatures[MLInputFeatures::zSecondaryVertex]) { - inputFeatures.push_back(candidate.zSecondaryVertex()); - } - if (selectedInputFeatures[MLInputFeatures::errorDecayLength]) { - inputFeatures.push_back(candidate.errorDecayLength()); - } - if (selectedInputFeatures[MLInputFeatures::errorDecayLengthXY]) { - inputFeatures.push_back(candidate.errorDecayLengthXY()); - } - if (selectedInputFeatures[MLInputFeatures::chi2PCA]) { - inputFeatures.push_back(candidate.chi2PCA()); - } - if (selectedInputFeatures[MLInputFeatures::rSecondaryVertex]) { - inputFeatures.push_back(candidate.rSecondaryVertex()); - } - if (selectedInputFeatures[MLInputFeatures::decayLength]) { - inputFeatures.push_back(candidate.decayLength()); - } - if (selectedInputFeatures[MLInputFeatures::decayLengthXY]) { - inputFeatures.push_back(candidate.decayLengthXY()); - } - if (selectedInputFeatures[MLInputFeatures::decayLengthNormalised]) { - inputFeatures.push_back(candidate.decayLengthNormalised()); - } - if (selectedInputFeatures[MLInputFeatures::decayLengthXYNormalised]) { - inputFeatures.push_back(candidate.decayLengthXYNormalised()); - } - if (selectedInputFeatures[MLInputFeatures::impactParameterNormalised0]) { - inputFeatures.push_back(candidate.impactParameterNormalised0()); - } - if (selectedInputFeatures[MLInputFeatures::ptProng0]) { - inputFeatures.push_back(candidate.ptProng0()); - } - if (selectedInputFeatures[MLInputFeatures::pProng0]) { - inputFeatures.push_back(RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0())); - } - if (selectedInputFeatures[MLInputFeatures::impactParameterNormalised1]) { - inputFeatures.push_back(candidate.impactParameterNormalised1()); - } - if (selectedInputFeatures[MLInputFeatures::ptProng1]) { - inputFeatures.push_back(candidate.ptProng1()); - } - if (selectedInputFeatures[MLInputFeatures::pProng1]) { - inputFeatures.push_back(RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1())); - } - if (selectedInputFeatures[MLInputFeatures::pxProng0]) { - inputFeatures.push_back(candidate.pxProng0()); - } - if (selectedInputFeatures[MLInputFeatures::pyProng0]) { - inputFeatures.push_back(candidate.pyProng0()); - } - if (selectedInputFeatures[MLInputFeatures::pzProng0]) { - inputFeatures.push_back(candidate.pzProng0()); - } - if (selectedInputFeatures[MLInputFeatures::pxProng1]) { - inputFeatures.push_back(candidate.pxProng1()); } - if (selectedInputFeatures[MLInputFeatures::pyProng1]) { - inputFeatures.push_back(candidate.pyProng1()); - } - if (selectedInputFeatures[MLInputFeatures::pzProng1]) { - inputFeatures.push_back(candidate.pzProng1()); - } - if (selectedInputFeatures[MLInputFeatures::errorImpactParameter0]) { - inputFeatures.push_back(candidate.impactParameter0()); - } - if (selectedInputFeatures[MLInputFeatures::impactParameter1]) { - inputFeatures.push_back(candidate.impactParameter1()); - } - if (selectedInputFeatures[MLInputFeatures::errorImpactParameter0]) { - inputFeatures.push_back(candidate.errorImpactParameter0()); - } - if (selectedInputFeatures[MLInputFeatures::errorImpactParameter1]) { - inputFeatures.push_back(candidate.errorImpactParameter1()); - } - if (selectedInputFeatures[MLInputFeatures::v0X]) { - inputFeatures.push_back(candidate.v0x()); - } - if (selectedInputFeatures[MLInputFeatures::v0Y]) { - inputFeatures.push_back(candidate.v0y()); - } - if (selectedInputFeatures[MLInputFeatures::v0Z]) { - inputFeatures.push_back(candidate.v0z()); - } - if (selectedInputFeatures[MLInputFeatures::v0Radius]) { - inputFeatures.push_back(candidate.v0radius()); - } - if (selectedInputFeatures[MLInputFeatures::v0CosPA]) { - inputFeatures.push_back(candidate.v0cosPA()); - } - if (selectedInputFeatures[MLInputFeatures::v0MLambda]) { - inputFeatures.push_back(candidate.mLambda()); - } - if (selectedInputFeatures[MLInputFeatures::v0MAntiLambda]) { - inputFeatures.push_back(candidate.mAntiLambda()); - } - if (selectedInputFeatures[MLInputFeatures::v0MK0Short]) { - inputFeatures.push_back(candidate.mK0Short()); - } - if (selectedInputFeatures[MLInputFeatures::v0MGamma]) { - inputFeatures.push_back(candidate.mGamma()); - } - if (selectedInputFeatures[MLInputFeatures::v0CtK0Short]) { - inputFeatures.push_back(hfHelper.ctV0K0s(candidate)); - } - if (selectedInputFeatures[MLInputFeatures::v0CtK0Short]) { - inputFeatures.push_back(hfHelper.ctV0Lambda(candidate)); - } - if (selectedInputFeatures[MLInputFeatures::dcaV0Daughters]) { - inputFeatures.push_back(candidate.dcaV0daughters()); - } - if (selectedInputFeatures[MLInputFeatures::pxPos]) { - inputFeatures.push_back(candidate.pxpos()); - } - if (selectedInputFeatures[MLInputFeatures::pyPos]) { - inputFeatures.push_back(candidate.pypos()); - } - if (selectedInputFeatures[MLInputFeatures::pzPos]) { - inputFeatures.push_back(candidate.pzpos()); - } - if (selectedInputFeatures[MLInputFeatures::ptV0Pos]) { - inputFeatures.push_back(candidate.ptV0Pos()); - } - if (selectedInputFeatures[MLInputFeatures::dcaPosToPV]) { - inputFeatures.push_back(candidate.dcapostopv()); - } - if (selectedInputFeatures[MLInputFeatures::pxNeg]) { - inputFeatures.push_back(candidate.pxneg()); - } - if (selectedInputFeatures[MLInputFeatures::pyNeg]) { - inputFeatures.push_back(candidate.pyneg()); - } - if (selectedInputFeatures[MLInputFeatures::pzNeg]) { - inputFeatures.push_back(candidate.pzneg()); - } - if (selectedInputFeatures[MLInputFeatures::ptV0Neg]) { - inputFeatures.push_back(candidate.ptV0Neg()); - } - if (selectedInputFeatures[MLInputFeatures::dcaNegToPV]) { - inputFeatures.push_back(candidate.dcanegtopv()); - } - if (selectedInputFeatures[MLInputFeatures::nSigmaTPCPr0]) { - inputFeatures.push_back(bach.tpcNSigmaPr()); - } - if (selectedInputFeatures[MLInputFeatures::nSigmaTOFPr0]) { - inputFeatures.push_back(bach.tofNSigmaPr()); - } - if (selectedInputFeatures[MLInputFeatures::m]) { - inputFeatures.push_back(hfHelper.invMassLcToK0sP(candidate)); - } - if (selectedInputFeatures[MLInputFeatures::pt]) { - inputFeatures.push_back(candidate.pt()); - } - if (selectedInputFeatures[MLInputFeatures::p]) { - inputFeatures.push_back(candidate.p()); - } - if (selectedInputFeatures[MLInputFeatures::cpa]) { - inputFeatures.push_back(candidate.cpa()); - } - if (selectedInputFeatures[MLInputFeatures::cpaXY]) { - inputFeatures.push_back(candidate.cpaXY()); - } - if (selectedInputFeatures[MLInputFeatures::ct]) { - inputFeatures.push_back(hfHelper.ctLc(candidate)); - } - if (selectedInputFeatures[MLInputFeatures::eta]) { - inputFeatures.push_back(candidate.eta()); - } - if (selectedInputFeatures[MLInputFeatures::phi]) { - inputFeatures.push_back(candidate.phi()); - } - if (selectedInputFeatures[MLInputFeatures::y]) { - inputFeatures.push_back(hfHelper.yLc(candidate)); - } - if (selectedInputFeatures[MLInputFeatures::e]) { - inputFeatures.push_back(hfHelper.eLc(candidate)); - } - - return inputFeatures; } /// Conjugate independent topological cuts @@ -515,15 +150,15 @@ struct HfCandidateSelectorLcToK0sP { return false; // check that the candidate pT is within the analysis range } - if (std::abs(hfCandCascade.mK0Short() - o2::analysis::pdg::MassK0Short) > cuts->get(ptBin, "mK0s")) { + if (std::abs(hfCandCascade.mK0Short() - o2::constants::physics::MassK0Short) > cuts->get(ptBin, "mK0s")) { return false; // mass of the K0s } - if ((std::abs(hfCandCascade.mLambda() - o2::analysis::pdg::MassLambda0) < cuts->get(ptBin, "mLambda")) || (std::abs(hfCandCascade.mAntiLambda() - o2::analysis::pdg::MassLambda0) < cuts->get(ptBin, "mLambda"))) { + if ((std::abs(hfCandCascade.mLambda() - o2::constants::physics::MassLambda0) < cuts->get(ptBin, "mLambda")) || (std::abs(hfCandCascade.mAntiLambda() - o2::constants::physics::MassLambda0) < cuts->get(ptBin, "mLambda"))) { return false; // mass of the Lambda } - if (std::abs(hfCandCascade.mGamma() - o2::analysis::pdg::MassGamma) < cuts->get(ptBin, "mGamma")) { + if (std::abs(hfCandCascade.mGamma() - o2::constants::physics::MassGamma) < cuts->get(ptBin, "mGamma")) { return false; // mass of the Gamma } @@ -590,7 +225,7 @@ struct HfCandidateSelectorLcToK0sP { { auto ptCand = hfCandCascade.pt(); - std::vector inputFeatures = setInputFeatures(hfCandCascade, bach); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandCascade, bach); std::vector outputMl = {}; bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMl); @@ -608,8 +243,8 @@ struct HfCandidateSelectorLcToK0sP { { int statusLc = 0; // final selection flag : 0-rejected 1-accepted - for (const auto& candidate : candidates) { // looping over cascade candidates - const auto& bach = candidate.prong0_as(); // bachelor track + for (const auto& candidate : candidates) { // looping over cascade candidates + const auto& bach = candidate.prong0_as(); // bachelor track statusLc = 0; @@ -642,8 +277,8 @@ struct HfCandidateSelectorLcToK0sP { { int statusLc = 0; // final selection flag : 0-rejected 1-accepted - for (const auto& candidate : candidates) { // looping over cascade candidates - const auto& bach = candidate.prong0_as(); // bachelor track + for (const auto& candidate : candidates) { // looping over cascade candidates + const auto& bach = candidate.prong0_as(); // bachelor track statusLc = 0; @@ -673,5 +308,6 @@ struct HfCandidateSelectorLcToK0sP { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ + adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/TableProducer/candidateSelectorToXiPi.cxx b/PWGHF/TableProducer/candidateSelectorToXiPi.cxx index 7962224f4d3..e0c6220e7ce 100644 --- a/PWGHF/TableProducer/candidateSelectorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorToXiPi.cxx @@ -13,6 +13,7 @@ /// \brief Xic0 and Omegac0 → Xi Pi selection task /// \author Federica Zanone , Heidelberg University +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -25,7 +26,6 @@ using namespace o2; using namespace o2::aod; using namespace o2::framework; -using namespace o2::analysis::pdg; enum pidInfoStored { kPiFromLam = 0, @@ -39,16 +39,17 @@ struct HfCandidateSelectorToXiPi { Produces hfSelToXiPi; // LF analysis selections - // zPV -> can be already set in HFeventselection -> 10 cm - // sel8 -> can be already set in HFeventselection -> true Configurable radiusCascMin{"radiusCascMin", 0.6, "Min cascade radius"}; Configurable radiusV0Min{"radiusV0Min", 1.2, "Min V0 radius"}; Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; - - Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; + Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; + Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; + Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; + Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; // limit charm baryon invariant mass spectrum Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only @@ -73,6 +74,8 @@ struct HfCandidateSelectorToXiPi { Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; + Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; + // PID options Configurable usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"}; Configurable usePidTpcTofCombined{"usePidTpcTofCombined", true, "Perform PID using TPC & TOF"}; @@ -99,11 +102,6 @@ struct HfCandidateSelectorToXiPi { Configurable nSigmaTofPrMax{"nSigmaTofPrMax", 3., "Nsigma cut on TOF only for proton selection"}; Configurable nSigmaTofCombinedPrMax{"nSigmaTofCombinedPrMax", 0., "Nsigma cut on TOF combined with TPC for proton selection"}; - // invariant mass cuts - Configurable sigmaInvMassLambda{"sigmaInvMassLambda", 0.0025, "Invariant mass cut for lambda (sigma)"}; - Configurable sigmaInvMassCascade{"sigmaInvMassCascade", 0.0025, "Invariant mass cut for cascade (sigma)"}; - Configurable nSigmaInvMassCut{"nSigmaInvMassCut", 4, "Number of sigma for invariant mass cut"}; - // detector clusters selections Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement"}; Configurable nTpcCrossedRowsMin{"nTpcCrossedRowsMin", 70, "Minimum number of TPC crossed rows requirement"}; @@ -140,7 +138,7 @@ struct HfCandidateSelectorToXiPi { registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1F, {{12, 0., 12.}}}); // for QA of the selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) - registry.add("hSelSignDec", "hSelSignDec;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); + registry.add("hSelSignDec", "hSelSignDec;status;entries", {HistType::kTH1F, {{3, 0., 3.}}}); registry.add("hSelEtaPosV0Dau", "hSelEtaPosV0Dau;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); registry.add("hSelEtaNegV0Dau", "hSelEtaNegV0Dau;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); registry.add("hSelEtaPiFromCasc", "hSelEtaPiFromCasc;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); @@ -172,13 +170,16 @@ struct HfCandidateSelectorToXiPi { registry.add("hSelMassLam", "hSelMassLam;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); registry.add("hSelMassCasc", "hSelMassCasc;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); registry.add("hSelMassCharmBaryon", "hSelMassCharmBaryon;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); + registry.add("hSelDcaXYToPvV0Daughters", "hSelDcaXYToPvV0Daughters;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); + registry.add("hSelDcaXYToPvPiFromCasc", "hSelDcaXYToPvPiFromCasc;status;entries", {HistType::kTH1F, {{5, 0., 5.}}}); } void process(aod::HfCandToXiPi const& candidates, TracksSel const&) { - double massLambdaFromPDG = o2::analysis::pdg::MassLambda0; - double massXiFromPDG = o2::analysis::pdg::MassXiMinus; + + double massLambdaFromPDG = o2::constants::physics::MassLambda0; + double massXiFromPDG = o2::constants::physics::MassXiMinus; // looping over charm baryon candidates for (const auto& candidate : candidates) { @@ -198,12 +199,9 @@ struct HfCandidateSelectorToXiPi { if (signDecay > 0) { trackPiFromLam = trackV0PosDau; trackPrFromLam = trackV0NegDau; - registry.fill(HIST("hSelSignDec"), 1); - } else if (signDecay == 0) { - resultSelections = false; - registry.fill(HIST("hSelSignDec"), 0); - } else { - registry.fill(HIST("hSelSignDec"), 1); + registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay + } else if (signDecay < 0) { + registry.fill(HIST("hSelSignDec"), 0); // particle decay } // eta selection @@ -287,6 +285,22 @@ struct HfCandidateSelectorToXiPi { registry.fill(HIST("hSelDCACharmDau"), 1); } + // dcaXY v0 daughters to PV cut + if (candidate.dcaXYToPvV0Dau0() < dcaPosToPvMin || candidate.dcaXYToPvV0Dau1() < dcaNegToPvMin) { + resultSelections = false; + registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 0); + } else { + registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 1); + } + + // dcaXY pi <-- cascade to PV cut + if (candidate.dcaXYToPvCascDau() < dcaBachToPvMin) { + resultSelections = false; + registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 0); + } else { + registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 1); + } + // cut on charm bachelor pion dcaXY and dcaZ if ((std::abs(candidate.impactParPiFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParPiFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { resultSelections = false; @@ -509,7 +523,7 @@ struct HfCandidateSelectorToXiPi { double invMassCascade = candidate.invMassCascade(); double invMassCharmBaryon = candidate.invMassCharmBaryon(); - if (std::abs(invMassLambda - massLambdaFromPDG) < (nSigmaInvMassCut * sigmaInvMassLambda)) { + if (std::abs(invMassLambda - massLambdaFromPDG) < v0MassWindow) { statusInvMassLambda = true; registry.fill(HIST("hSelMassLam"), 1); if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && resultSelections) { @@ -519,7 +533,7 @@ struct HfCandidateSelectorToXiPi { registry.fill(HIST("hSelMassLam"), 0); } - if (std::abs(invMassCascade - massXiFromPDG) < (nSigmaInvMassCut * sigmaInvMassCascade)) { + if (std::abs(invMassCascade - massXiFromPDG) < cascadeMassWindow) { statusInvMassCascade = true; registry.fill(HIST("hSelMassCasc"), 1); if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && resultSelections) { @@ -586,8 +600,8 @@ struct HfCandidateSelectorToXiPi { hInvMassCharmBaryon->Fill(invMassCharmBaryon); } } - } -}; + } // end process +}; // end struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx index 0b66480b35b..65777de8ab6 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx @@ -16,6 +16,7 @@ /// \author Mattia Faggin , University and INFN PADOVA /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -152,11 +153,11 @@ struct HfCandidateSelectorXicToPKPi { } if (trackProton.globalIndex() == candidate.prong0Id()) { - if (std::abs(hfHelper.invMassXicToPKPi(candidate) - o2::analysis::pdg::MassXiCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassXicToPKPi(candidate) - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } } else { - if (std::abs(hfHelper.invMassXicToPiKP(candidate) - o2::analysis::pdg::MassXiCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassXicToPiKP(candidate) - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } } diff --git a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx index f2d12003403..ce9a5f3375f 100644 --- a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx @@ -14,6 +14,7 @@ /// /// \author Gian Michele Innocenti , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -81,7 +82,7 @@ struct HfCandidateSelectorXiccToPKPiPi { } // check candidate mass is within a defined mass window - if (std::abs(hfHelper.invMassXiccToXicPi(hfCandXicc) - o2::analysis::pdg::MassXiCCPlusPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfHelper.invMassXiccToXicPi(hfCandXicc) - o2::constants::physics::MassXiCCPlusPlus) > cuts->get(pTBin, "m")) { return false; } diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index d72d39631ce..0f431da044a 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -25,6 +25,7 @@ #include // std::string #include // std::vector +#include "CommonConstants/PhysicsConstants.h" #include "CCDB/BasicCCDBManager.h" // for PV refit #include "DataFormatsParameters/GRPMagField.h" // for PV refit #include "DataFormatsParameters/GRPObject.h" // for PV refit @@ -1324,13 +1325,13 @@ struct HfTrackIndexSkimCreator { return; } - massPi = o2::analysis::pdg::MassPiPlus; - massK = o2::analysis::pdg::MassKPlus; - massProton = o2::analysis::pdg::MassProton; - massElectron = o2::analysis::pdg::MassElectron; - massMuon = o2::analysis::pdg::MassMuonPlus; - massDzero = o2::analysis::pdg::MassD0; - massPhi = o2::analysis::pdg::MassPhi; + massPi = o2::constants::physics::MassPiPlus; + massK = o2::constants::physics::MassKPlus; + massProton = o2::constants::physics::MassProton; + massElectron = o2::constants::physics::MassElectron; + massMuon = o2::constants::physics::MassMuonPlus; + massDzero = o2::constants::physics::MassD0; + massPhi = o2::constants::physics::MassPhi; arrMass2Prong[hf_cand_2prong::DecayType::D0ToPiK] = std::array{std::array{massPi, massK}, std::array{massK, massPi}}; @@ -2924,10 +2925,10 @@ struct HfTrackIndexSkimCreatorCascades { etaMinV0Daugh.value = -etaMaxV0Daugh; } - massP = o2::analysis::pdg::MassProton; - massK0s = o2::analysis::pdg::MassK0Short; - massPi = o2::analysis::pdg::MassPiPlus; - massLc = o2::analysis::pdg::MassLambdaCPlus; + massP = o2::constants::physics::MassProton; + massK0s = o2::constants::physics::MassK0Short; + massPi = o2::constants::physics::MassPiPlus; + massLc = o2::constants::physics::MassLambdaCPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); @@ -3200,13 +3201,13 @@ struct HfTrackIndexSkimCreatorLfCascades { return; } - massP = o2::analysis::pdg::MassProton; - massPi = o2::analysis::pdg::MassPiPlus; - massXi = o2::analysis::pdg::MassXiMinus; - massOmega = o2::analysis::pdg::MassOmegaMinus; - massLambda = o2::analysis::pdg::MassLambda0; - massXiczero = o2::analysis::pdg::MassXiCZero; - massXicplus = o2::analysis::pdg::MassXiCPlus; + massP = o2::constants::physics::MassProton; + massPi = o2::constants::physics::MassPiPlus; + massXi = o2::constants::physics::MassXiMinus; + massOmega = o2::constants::physics::MassOmegaMinus; + massLambda = o2::constants::physics::MassLambda0; + massXiczero = o2::constants::physics::MassXiCZero; + massXicplus = o2::constants::physics::MassXiCPlus; arrMass2Prong[hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi] = std::array{massXi, massPi}; arrMass2Prong[hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi] = std::array{massOmega, massPi}; @@ -3251,14 +3252,14 @@ struct HfTrackIndexSkimCreatorLfCascades { } } - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); - Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng > 0); - using SelectedCollisions = soa::Filtered>; using SelectedHfTrackAssoc = soa::Filtered>; using CascFull = soa::Join; using V0Full = soa::Join; + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); + Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng > 0); + Preslice tracksPerCollision = aod::track::collisionId; // needed for PV refit Preslice trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId Preslice cascadesPerCollision = aod::cascdata::collisionId; diff --git a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx index ce4d0dc42a0..b169d4e2866 100644 --- a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx +++ b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx @@ -16,6 +16,7 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -366,7 +367,7 @@ struct HfTreeCreatorB0ToDPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassB0), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassB0), particle.flagMcMatchGen(), particle.originMcGen()); } diff --git a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx index 71bb6153562..89598a69392 100644 --- a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx @@ -17,6 +17,7 @@ /// /// \author Antonio Palasciano , Università & INFN, Bari +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -324,7 +325,7 @@ struct HfTreeCreatorBplusToD0Pi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassBPlus), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassBPlus), particle.flagMcMatchGen(), particle.globalIndex()); } diff --git a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx index ef842de5d01..4e43a388516 100644 --- a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx +++ b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx @@ -16,6 +16,7 @@ /// \note Adapted from treeCreatorB0T0DPi.cxx /// \author Phil Stahlhut +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -356,7 +357,7 @@ struct HfTreeCreatorBsToDsPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassBS), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassBS), particle.flagMcMatchGen()); } } diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index c27465c818e..9aaaa191ffe 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -17,6 +17,7 @@ /// \author Nicolo' Jacazio , CERN /// \author Andrea Tavira García , IJCLab +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -492,7 +493,7 @@ struct HfTreeCreatorD0ToKPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassD0), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassD0), particle.flagMcMatchGen(), particle.originMcGen(), particle.globalIndex()); diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index 7f3ae9125c7..90cc819e9ea 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -16,6 +16,7 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -447,7 +448,7 @@ struct HfTreeCreatorDplusToPiKPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDPlus), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDPlus), particle.flagMcMatchGen(), particle.originMcGen()); } diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index d36515e053d..9673af10e6e 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -17,6 +17,7 @@ /// \author Stefano Politanò , Politecnico & INFN, Torino /// \author Fabio Catalano , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -508,7 +509,7 @@ struct HfTreeCreatorDsToKKPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassDS), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDS), particle.flagMcMatchGen(), particle.originMcGen()); } diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index 80f91610d86..74392ee0cf9 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -17,6 +17,7 @@ /// /// \author Daniel Samitz +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -388,7 +389,7 @@ struct HfTreeCreatorLcToK0sP { particle.eta(), particle.phi(), RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, - o2::analysis::pdg::MassLambdaCPlus), + o2::constants::physics::MassLambdaCPlus), particle.flagMcMatchGen(), particle.originMcGen()); } diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 3af8767b0a9..34a0a30537e 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -16,6 +16,7 @@ /// /// \author Nicolo' Jacazio , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -340,7 +341,7 @@ struct HfTreeCreatorLcToPKPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus), particle.flagMcMatchGen(), particle.originMcGen(), particle.globalIndex()); diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index adee3d76e49..1ad353e67b1 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -18,6 +18,7 @@ #include #include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" #include "DCAFitter/DCAFitterN.h" @@ -35,7 +36,6 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGHF/Core/PDG.h" #include "PWGHF/Core/SelectorCuts.h" using namespace o2; @@ -56,12 +56,14 @@ DECLARE_SOA_COLUMN(NSigmaTpcKa, nSigmaTpcKa, float); DECLARE_SOA_COLUMN(NSigmaTofKa, nSigmaTofKa, float); DECLARE_SOA_COLUMN(NSigmaTpcPi, nSigmaTpcPi, float); DECLARE_SOA_COLUMN(NSigmaTofPi, nSigmaTofPi, float); -DECLARE_SOA_COLUMN(PxOmega, pxOmega, float); // TODO: what about sign? +DECLARE_SOA_COLUMN(PxOmega, pxOmega, float); DECLARE_SOA_COLUMN(PyOmega, pyOmega, float); DECLARE_SOA_COLUMN(PzOmega, pzOmega, float); -DECLARE_SOA_COLUMN(PxPion, pxPion, float); // TODO: what about sign? +DECLARE_SOA_COLUMN(IsPositiveOmega, isPositiveOmega, bool); +DECLARE_SOA_COLUMN(PxPion, pxPion, float); DECLARE_SOA_COLUMN(PyPion, pyPion, float); DECLARE_SOA_COLUMN(PzPion, pzPion, float); +DECLARE_SOA_COLUMN(IsPositivePion, isPositivePion, bool); DECLARE_SOA_COLUMN(CpaOmegac, cpaOmegac, float); DECLARE_SOA_COLUMN(CpaOmega, cpaOmega, float); DECLARE_SOA_COLUMN(DcaXYOmega, dcaXYOmega, float); @@ -84,12 +86,14 @@ DECLARE_SOA_COLUMN(DecayLengthXYOmega, decayLengthXYOmega, float); namespace st_omegac_gen { -DECLARE_SOA_COLUMN(PxOmegac, pxOmegac, float); // TODO: what about sign? +DECLARE_SOA_COLUMN(PxOmegac, pxOmegac, float); DECLARE_SOA_COLUMN(PyOmegac, pyOmegac, float); DECLARE_SOA_COLUMN(PzOmegac, pzOmegac, float); -DECLARE_SOA_COLUMN(PxOmega, pxOmega, float); // TODO: what about sign? +DECLARE_SOA_COLUMN(IsPositiveOmegac, isPositiveOmegac, bool); +DECLARE_SOA_COLUMN(PxOmega, pxOmega, float); DECLARE_SOA_COLUMN(PyOmega, pyOmega, float); DECLARE_SOA_COLUMN(PzOmega, pzOmega, float); +DECLARE_SOA_COLUMN(IsPositiveOmega, isPositiveOmega, bool); DECLARE_SOA_COLUMN(DecayLengthOmegac, decayLengthOmegac, float); DECLARE_SOA_COLUMN(DecayLengthXYOmegac, decayLengthXYOmegac, float); DECLARE_SOA_COLUMN(DecayLengthOmega, decayLengthOmega, float); @@ -110,9 +114,11 @@ DECLARE_SOA_TABLE(HfOmegacSt, "AOD", "HFOMEGACST", st_omegac::PxOmega, st_omegac::PyOmega, st_omegac::PzOmega, + st_omegac::IsPositiveOmega, st_omegac::PxPion, st_omegac::PyPion, st_omegac::PzPion, + st_omegac::IsPositivePion, st_omegac::CpaOmegac, st_omegac::CpaOmega, st_omegac::DcaXYOmega, @@ -136,9 +142,11 @@ DECLARE_SOA_TABLE(HfOmegaStGen, "AOD", "HFOMEGACSTGEN", st_omegac_gen::PxOmegac, st_omegac_gen::PyOmegac, st_omegac_gen::PzOmegac, + st_omegac_gen::IsPositiveOmegac, st_omegac_gen::PxOmega, st_omegac_gen::PyOmega, st_omegac_gen::PzOmega, + st_omegac_gen::IsPositiveOmega, st_omegac_gen::DecayLengthOmegac, st_omegac_gen::DecayLengthXYOmegac, st_omegac_gen::DecayLengthOmega, @@ -202,7 +210,7 @@ struct HfTreeCreatorOmegacSt { {"hMassOmegacVsPt", "inv. mass #Omega + #pi;inv. mass (GeV/#it{c}^{2});p_{T} (GeV/#it{c})", {HistType::kTH2D, {{400, 1.5, 3.}, {10, 0., 10.}}}}, {"hMassOmegacId", "inv. mass #Omega + #pi (MC ID);inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.5, 3.}}}}, {"hMassOmegacGen", "inv. mass #Omega + #pi (from MC);inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.5, 3.}}}}, - {"hMassVsPt", "DCA;Mass (GeV/#it{c}^2);p_{T} (GeV/#it{c})", {HistType::kTH2D, {{200, 0., 10.}, {200, 0., 10.}}}}, + {"hPtVsMassOmega", "#Omega mass;p_{T} (GeV/#it{c});m (GeV/#it{c}^3)", {HistType::kTH2D, {{200, 0., 10.}, {1000, 1., 3.}}}}, {"hDeltaPtVsPt", "Delta pt;p_{T} (GeV/#it{c});#Delta p_{T} / p_{T}", {HistType::kTH2D, {{200, 0., 10.}, {200, -1., 1.}}}}, }}; @@ -236,12 +244,12 @@ struct HfTreeCreatorOmegacSt { for (const auto& mcParticle : mcParticles) { if ((mcParticle.pdgCode() == kOmegaMinus) && mcParticle.has_mothers() && - (mcParticle.mothers_first_as().pdgCode() == analysis::pdg::Code::kOmegaC0)) { + (mcParticle.mothers_first_as().pdgCode() == constants::physics::Pdg::kOmegaC0)) { const auto& mcColl = mcParticle.mcCollision(); std::array primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; std::array secondaryVertexGen = {mcParticle.vx(), mcParticle.vy(), mcParticle.vz()}; const auto decayLengthGen = RecoDecay::distance(secondaryVertexGen, primaryVertexPosGen); - registry.fill(HIST("hDecayLengthScaledMc"), decayLengthGen * o2::analysis::pdg::MassOmegaC0 / mcParticle.mothers_first_as().p() * 1e4); + registry.fill(HIST("hDecayLengthScaledMc"), decayLengthGen * o2::constants::physics::MassOmegaC0 / mcParticle.mothers_first_as().p() * 1e4); } } } @@ -297,33 +305,30 @@ struct HfTreeCreatorOmegacSt { continue; } - const auto& v0TrackPr = trackCasc.sign() > 0 ? v0TrackPos : v0TrackNeg; - const auto& v0TrackPi = trackCasc.sign() > 0 ? v0TrackNeg : v0TrackPos; + const auto& v0TrackPr = trackCasc.sign() < 0 ? v0TrackPos : v0TrackNeg; + const auto& v0TrackPi = trackCasc.sign() < 0 ? v0TrackNeg : v0TrackPos; // track propagation - o2::track::TrackParCov trackParCovV0; - o2::track::TrackPar trackParV0; - o2::track::TrackPar trackParBachelor; - std::array, 2> momentaOmegaDaughters; if (!df2.process(getTrackParCov(v0TrackNeg), getTrackParCov(v0TrackPos))) { continue; } - trackParCovV0 = df2.createParentTrackParCov(0); + o2::track::TrackParCov trackParCovV0 = df2.createParentTrackParCov(0); if (!df2.process(trackParCovV0, getTrackParCov(bachelor))) { continue; } const auto& secondaryVertex = df2.getPCACandidate(); const auto decayLengthOmega = RecoDecay::distance(secondaryVertex, primaryVertexPos); const auto decayLengthOmegaXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); - trackParV0 = df2.getTrackParamAtPCA(0); - trackParBachelor = df2.getTrackParamAtPCA(1); + o2::track::TrackPar trackParV0 = df2.getTrackParamAtPCA(0); + o2::track::TrackPar trackParBachelor = df2.getTrackParamAtPCA(1); + std::array, 2> momentaOmegaDaughters; trackParV0.getPxPyPzGlo(momentaOmegaDaughters[0]); trackParBachelor.getPxPyPzGlo(momentaOmegaDaughters[1]); - std::array pVec; - df2.createParentTrackParCov().getPxPyPzGlo(pVec); - const auto cpaOmega = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pVec); + std::array pOmega; + df2.createParentTrackParCov().getPxPyPzGlo(pOmega); + const auto cpaOmega = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pOmega); - std::array masses = {o2::analysis::pdg::MassLambda0, o2::analysis::pdg::MassKPlus}; + std::array masses = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; const auto massOmega = RecoDecay::m(momentaOmegaDaughters, masses); registry.fill(HIST("hDca"), std::sqrt(impactParameterTrk.getR2())); @@ -333,15 +338,15 @@ struct HfTreeCreatorOmegacSt { registry.fill(HIST("hDcaZVsPt"), trackParCovTrk.getPt(), impactParameterTrk.getZ()); registry.fill(HIST("hDcaVsPt"), impactParameterTrk.getY(), trackCasc.pt()); registry.fill(HIST("hDcaVsR"), impactParameterTrk.getY(), RecoDecay::sqrtSumOfSquares(trackCasc.x(), trackCasc.y())); - registry.fill(HIST("hMassVsPt"), massOmega, trackCasc.pt()); + registry.fill(HIST("hPtVsMassOmega"), trackCasc.pt(), massOmega); - if ((std::abs(massOmega - o2::analysis::pdg::MassOmegaMinus) < massWindowTrackedOmega)) { + if ((std::abs(massOmega - o2::constants::physics::MassOmegaMinus) < massWindowTrackedOmega)) { LOGF(debug, "found candidate in mass range"); if ((std::abs(bachelor.tpcNSigmaKa()) < maxNSigmaBachelor) && (std::abs(v0TrackPr.tpcNSigmaPr()) < maxNSigmaV0Pr) && (std::abs(v0TrackPi.tpcNSigmaPi()) < maxNSigmaV0Pi)) { LOGF(debug, ".. species compatible with Omega"); - std::array masses{o2::analysis::pdg::MassOmegaMinus, o2::analysis::pdg::MassPiPlus}; + std::array masses{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; std::array, 2> momenta; auto trackParCovPr = getTrackParCov(v0TrackPr); @@ -363,9 +368,6 @@ struct HfTreeCreatorOmegacSt { for (const auto& track : tracks) { if (std::abs(track.tpcNSigmaPi()) < maxNSigmaPion) { LOGF(debug, " .. combining with pion candidate %d", track.globalIndex()); - if (trackCasc.sign() == track.sign()) { - continue; - } auto trackParCovPion = getTrackParCov(track); o2::dataformats::DCA impactParameterPion; if (bzOnly) { @@ -385,13 +387,13 @@ struct HfTreeCreatorOmegacSt { const auto decayLength = RecoDecay::distance(secondaryVertex, primaryVertexPos); const auto decayLengthXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); const auto chi2TopOmegac = df2.getChi2AtPCACandidate(); - std::array pVec; - df2.createParentTrackParCov().getPxPyPzGlo(pVec); - const auto cpaOmegaC = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pVec); + std::array pOmegac; + df2.createParentTrackParCov().getPxPyPzGlo(pOmegac); + const auto cpaOmegaC = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pOmegac); - if (std::abs(massOmegaC - o2::analysis::pdg::MassOmegaC0) < massWindowOmegaC) { + if (std::abs(massOmegaC - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) { registry.fill(HIST("hDecayLength"), decayLength * 1e4); - registry.fill(HIST("hDecayLengthScaled"), decayLength * o2::analysis::pdg::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); + registry.fill(HIST("hDecayLengthScaled"), decayLength * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); outputTable(massOmegaC, massOmega, track.tpcNSigmaPi(), @@ -405,9 +407,11 @@ struct HfTreeCreatorOmegacSt { momenta[0][0], // omega momentum momenta[0][1], momenta[0][2], + trackCasc.sign() > 0 ? true : false, momenta[1][0], // pion momentum momenta[1][1], momenta[1][2], + track.sign() > 0 ? true : false, cpaOmegaC, cpaOmega, impactParameterTrk.getY(), @@ -498,7 +502,7 @@ struct HfTreeCreatorOmegacSt { LOG(debug) << "cascade with PDG code: " << pdgCode; if (std::abs(pdgCode) == kOmegaMinus) { LOG(debug) << "found Omega, looking for pions"; - std::array masses{o2::analysis::pdg::MassOmegaMinus, o2::analysis::pdg::MassPiPlus}; + std::array masses{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; std::array, 2> momenta; std::array primaryVertexPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; const auto& mcColl = mother.mcCollision(); @@ -529,15 +533,15 @@ struct HfTreeCreatorOmegacSt { const auto decayLength = RecoDecay::distance(secondaryVertex, primaryVertexPos); if (mother.has_mothers()) { const auto& cand = mother.template mothers_first_as(); - if (std::abs(cand.pdgCode()) == analysis::pdg::Code::kOmegaC0 && mcpart.has_mothers()) { + if (std::abs(cand.pdgCode()) == constants::physics::Pdg::kOmegaC0 && mcpart.has_mothers()) { if (mcpart.mothersIds()[0] == cand.globalIndex()) { registry.fill(HIST("hDecayLengthId"), decayLength * 1e4); - registry.fill(HIST("hDecayLengthScaledId"), decayLength * o2::analysis::pdg::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); + registry.fill(HIST("hDecayLengthScaledId"), decayLength * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); std::array secondaryVertexGen = {mother.vx(), mother.vy(), mother.vz()}; const auto decayLengthGen = RecoDecay::distance(secondaryVertexGen, primaryVertexPosGen); registry.fill(HIST("hDecayLengthGen"), decayLengthGen * 1e4); - registry.fill(HIST("hDecayLengthScaledGen"), decayLengthGen * o2::analysis::pdg::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); + registry.fill(HIST("hDecayLengthScaledGen"), decayLengthGen * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); registry.fill(HIST("hDeltaDecayLength"), (decayLength - decayLengthGen) * 1e4); } diff --git a/PWGHF/TableProducer/treeCreatorToXiPi.cxx b/PWGHF/TableProducer/treeCreatorToXiPi.cxx index 56016610ed6..ade6b9d69fe 100644 --- a/PWGHF/TableProducer/treeCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorToXiPi.cxx @@ -291,7 +291,7 @@ struct HfTreeCreatorToXiPi { fillCandidate(candidate, -7, -7, RecoDecay::OriginType::None); } } - PROCESS_SWITCH(HfTreeCreatorToXiPi, processData, "Process data tree writer", true); + PROCESS_SWITCH(HfTreeCreatorToXiPi, processData, "Process data", true); void processMc(aod::Collisions const& collisions, soa::Join const& candidates) @@ -302,8 +302,9 @@ struct HfTreeCreatorToXiPi { fillCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec()); } } - PROCESS_SWITCH(HfTreeCreatorToXiPi, processMc, "Process MC tree writer", false); -}; + PROCESS_SWITCH(HfTreeCreatorToXiPi, processMc, "Process MC", false); + +}; // end of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index b18d1c44470..67022a16f09 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -15,6 +15,7 @@ /// \author Himanshu Sharma , INFN Padova +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -320,7 +321,7 @@ struct HfTreeCreatorXicToPKPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCPlus), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCPlus), particle.flagMcMatchGen(), particle.originMcGen(), particle.globalIndex()); diff --git a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx index c3472b9aa06..15637cff096 100644 --- a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx @@ -17,6 +17,7 @@ /// /// \author Jinjoo Seo , Inha University +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -269,7 +270,7 @@ struct HfTreeCreatorXiccToPKPiPi { particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassXiCCPlusPlus), + RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassXiCCPlusPlus), particle.flagMcMatchGen(), particle.originMcGen()); } diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index 149d33e738b..1e6d2b1e872 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -16,6 +16,7 @@ /// \author Luigi Dello Stritto , University and INFN SALERNO /// \author Vít Kučera , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -161,7 +162,7 @@ struct HfTaskLcCentralityMc { } if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), pdg::Code::kLambdaCPlus, true); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), o2::constants::physics::Pdg::kLambdaCPlus, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT auto ptRec = candidate.pt(); @@ -182,7 +183,7 @@ struct HfTaskLcCentralityMc { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::analysis::pdg::MassLambdaCPlus)) > yCandMax) { + if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassLambdaCPlus)) > yCandMax) { continue; } auto ptGen = particle.pt(); diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index f6b67fb0ad1..d5894e59ed3 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -14,6 +14,7 @@ /// /// \author Jan Fiete Grosse-Oetringhaus, CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" @@ -28,6 +29,7 @@ using namespace o2; using namespace o2::analysis; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; @@ -113,17 +115,17 @@ struct HfTaskMcEfficiency { auto decayType = -1; std::array pdgDaughters; - if (pdgCode == pdg::kDPlus) { + if (pdgCode == Pdg::kDPlus) { decayType = 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; pdgDaughters[0] = +kPiPlus; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; - } else if (pdgCode == pdg::kDS) { + } else if (pdgCode == Pdg::kDS) { decayType = 1 << aod::hf_cand_3prong::DecayType::DsToKKPi; pdgDaughters[0] = +kKPlus; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; - } else if (pdgCode == pdg::kLambdaCPlus) { + } else if (pdgCode == Pdg::kLambdaCPlus) { decayType = 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; pdgDaughters[0] = +kProton; pdgDaughters[1] = -kKPlus; @@ -146,18 +148,18 @@ struct HfTaskMcEfficiency { bool isHypoMass2SelStep = false; /// selections from candidate selectors if constexpr (hasDplus) { - if (pdgCode == pdg::kDPlus) { + if (pdgCode == Pdg::kDPlus) { isHypoMass1SelStep = candidate.isSelDplusToPiKPi(); // only one mass hypo for D+ } } if constexpr (hasDs) { - if (pdgCode == pdg::kDS) { + if (pdgCode == Pdg::kDS) { isHypoMass1SelStep = candidate.isSelDsToKKPi(); isHypoMass2SelStep = candidate.isSelDsToPiKK(); } } if constexpr (hasLc) { - if (pdgCode == pdg::kLambdaCPlus) { + if (pdgCode == Pdg::kLambdaCPlus) { isHypoMass1SelStep = candidate.isSelLcToPKPi(); isHypoMass2SelStep = candidate.isSelLcToPiKP(); } @@ -175,7 +177,7 @@ struct HfTaskMcEfficiency { origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticles.rawIteratorAt(indexRec)); - if (pdgCode == pdg::kLambdaCPlus) { + if (pdgCode == Pdg::kLambdaCPlus) { auto daughter = trackPos.mcParticle(); if (std::abs(daughter.pdgCode()) == kProton) { isHypoMass1TrackStep = true; @@ -203,19 +205,19 @@ struct HfTaskMcEfficiency { /// all candidates if (isHypoMass1TrackStep) { - if (pdgCode == pdg::kLambdaCPlus) { + if (pdgCode == Pdg::kLambdaCPlus) { massHypo1 = hfHelper.invMassLcToPKPi(candidate); - } else if (pdgCode == pdg::kDPlus) { + } else if (pdgCode == Pdg::kDPlus) { massHypo1 = hfHelper.invMassDplusToPiKPi(candidate); - } else if (pdgCode == pdg::kDS) { + } else if (pdgCode == Pdg::kDS) { massHypo1 = hfHelper.invMassDsToKKPi(candidate); } hCandidates->Fill(kHFStepTracked, pt, massHypo1, pdgCode, cpa, collisionMatched, origin); } if (isHypoMass2TrackStep) { - if (pdgCode == pdg::kLambdaCPlus) { + if (pdgCode == Pdg::kLambdaCPlus) { massHypo2 = hfHelper.invMassLcToPiKP(candidate); - } else if (pdgCode == pdg::kDS) { + } else if (pdgCode == Pdg::kDS) { massHypo2 = hfHelper.invMassDsToPiKK(candidate); } hCandidates->Fill(kHFStepTracked, pt, massHypo2, pdgCode, cpa, collisionMatched, origin); @@ -279,11 +281,11 @@ struct HfTaskMcEfficiency { auto decayType = -1; std::array pdgDaughters; - if (pdgCode == pdg::kD0) { + if (pdgCode == Pdg::kD0) { decayType = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; pdgDaughters[0] = +kPiPlus; pdgDaughters[1] = -kKPlus; - } else if (pdgCode == pdg::kD0Bar) { + } else if (pdgCode == Pdg::kD0Bar) { decayType = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; pdgDaughters[0] = -kPiPlus; pdgDaughters[1] = +kKPlus; @@ -317,10 +319,10 @@ struct HfTaskMcEfficiency { float cpa = candidate.cpa(); float pt = candidate.pt(); bool selected = false; - if (pdgCode == pdg::kD0) { + if (pdgCode == Pdg::kD0) { mass = hfHelper.invMassD0ToPiK(candidate); selected = candidate.isSelD0() >= selectionFlagD0; - } else if (pdgCode == pdg::kD0Bar) { + } else if (pdgCode == Pdg::kD0Bar) { mass = hfHelper.invMassD0barToKPi(candidate); selected = candidate.isSelD0bar() >= selectionFlagD0bar; } @@ -403,7 +405,7 @@ struct HfTaskMcEfficiency { } /// check if we end-up with the correct final state using MC info int8_t sign = 0; - if (std::abs(mcParticle.pdgCode()) == pdg::kD0 && !RecoDecay::isMatchedMCGen(mcParticles, mcParticle, pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { + if (std::abs(mcParticle.pdgCode()) == Pdg::kD0 && !RecoDecay::isMatchedMCGen(mcParticles, mcParticle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { /// check if we have D0(bar) → π± K∓ continue; } @@ -521,15 +523,15 @@ struct HfTaskMcEfficiency { } std::array pdgDaughters; - if (pdgCode == pdg::kDPlus) { + if (pdgCode == Pdg::kDPlus) { pdgDaughters[0] = +kPiPlus; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; - } else if (pdgCode == pdg::kDS) { + } else if (pdgCode == Pdg::kDS) { pdgDaughters[0] = +kKPlus; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; - } else if (pdgCode == pdg::kLambdaCPlus) { + } else if (pdgCode == Pdg::kLambdaCPlus) { pdgDaughters[0] = +kProton; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; @@ -650,7 +652,7 @@ struct HfTaskMcEfficiency { void processDataD0(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kD0Bar, pdg::kD0}; + std::vector pdgCodes{Pdg::kD0Bar, Pdg::kD0}; candidate2ProngLoop(candidates, tracks, tracks, pdgCodes); // NOTE third argument has to be provided but is not used as template argument is } PROCESS_SWITCH(HfTaskMcEfficiency, processDataD0, "Process D0 data (no MC information needed)", false); @@ -658,7 +660,7 @@ struct HfTaskMcEfficiency { void processDataDplus(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDPlus}; + std::vector pdgCodes{Pdg::kDPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplus, "Process D+ data (no MC information needed)", false); @@ -666,7 +668,7 @@ struct HfTaskMcEfficiency { void processDataDs(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDS}; + std::vector pdgCodes{Pdg::kDS}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDs, "Process Ds+ data (no MC information needed)", false); @@ -674,7 +676,7 @@ struct HfTaskMcEfficiency { void processDataLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataLc, "Process Lc data (no MC information needed)", false); @@ -682,7 +684,7 @@ struct HfTaskMcEfficiency { void processDataDplusDs(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDPlus, pdg::kDS}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDs, "Process D+ and Ds+ data (no MC information needed)", false); @@ -690,7 +692,7 @@ struct HfTaskMcEfficiency { void processDataDplusDsLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDPlus, pdg::kDS, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDsLc, "Process D+, Ds+, and Lc data (no MC information needed)", false); @@ -698,7 +700,7 @@ struct HfTaskMcEfficiency { void processDataDplusLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDPlus, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusLc, "Process D+ and Lc data (no MC information needed)", false); @@ -706,7 +708,7 @@ struct HfTaskMcEfficiency { void processDataDsLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{pdg::kDPlus, pdg::kDS, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDsLc, "Process Ds+ and Lc data (no MC information needed)", false); @@ -717,7 +719,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kD0Bar, pdg::kD0}; + std::vector pdgCodes{Pdg::kD0Bar, Pdg::kD0}; candidate2ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcD0, "Process MC for D0 signal", true); @@ -727,7 +729,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDPlus}; + std::vector pdgCodes{Pdg::kDPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplus, "Process MC for D+ signal", false); @@ -737,7 +739,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDS}; + std::vector pdgCodes{Pdg::kDS}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDs, "Process MC for Ds+ signal", false); @@ -747,7 +749,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcLc, "Process MC for Lc signal", false); @@ -757,7 +759,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDPlus, pdg::kDS}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDs, "Process MC for D+ and Ds+ signals", false); @@ -767,7 +769,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDPlus, pdg::kDS, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDsLc, "Process MC for D+, Ds+, and Lc signals", false); @@ -777,7 +779,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDPlus, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusLc, "Process MC for D+ and Lc signals", false); @@ -787,7 +789,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{pdg::kDS, pdg::kLambdaCPlus}; + std::vector pdgCodes{Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDsLc, "Process MC for Ds+ and Lc signals", false); diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index ece16529571..fabac15c8ad 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -17,6 +17,7 @@ /// \author Vít Kučera , CERN /// \author Fabrizio Grosa , CERN +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -35,7 +36,7 @@ using namespace o2::framework::expressions; namespace { static const int nCharmHadrons = 7; -static const std::array PDGArrayParticle = {pdg::Code::kDPlus, pdg::Code::kDStar, pdg::Code::kD0, pdg::Code::kDS, pdg::Code::kLambdaCPlus, pdg::Code::kXiCPlus, pdg::Code::kJPsi}; +static const std::array PDGArrayParticle = {o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDStar, o2::constants::physics::Pdg::kD0, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kJPsi}; static const std::array nDaughters = {3, 3, 2, 3, 3, 3, 2}; static const std::array, nCharmHadrons> arrPDGFinal = {{{kPiPlus, kPiPlus, -kKPlus}, {kPiPlus, kPiPlus, -kKPlus}, {-kKPlus, kPiPlus, 0}, {kPiPlus, kKPlus, -kKPlus}, {kProton, -kKPlus, kPiPlus}, {kProton, -kKPlus, kPiPlus}, {kElectron, -kElectron, 0}}}; static const std::array labels = {"D^{+}", "D*^{+}", "D^{0}", "D_{s}^{+}", "#Lambda_{c}^{+}", "#Xi_{c}^{+}", "J/#psi"}; diff --git a/PWGJE/TableProducer/jetfinder.h b/PWGJE/TableProducer/jetfinder.h index 86c03060dd6..a7da5143e17 100644 --- a/PWGJE/TableProducer/jetfinder.h +++ b/PWGJE/TableProducer/jetfinder.h @@ -36,7 +36,6 @@ #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Core/PDG.h" // #include "PWGJE/Core/JetBkgSubUtils.h" #include "PWGJE/Core/FastJetUtilities.h" diff --git a/PWGJE/TableProducer/jetfinderhf.cxx b/PWGJE/TableProducer/jetfinderhf.cxx index ceaee721dbf..dc3d96a307a 100644 --- a/PWGJE/TableProducer/jetfinderhf.cxx +++ b/PWGJE/TableProducer/jetfinderhf.cxx @@ -14,9 +14,12 @@ /// \author Nima Zardoshti /// \author Jochen Klein -#include "PWGJE/TableProducer/jetfinder.h" +#include "CommonConstants/PhysicsConstants.h" + #include "Common/Core/RecoDecay.h" +#include "PWGJE/TableProducer/jetfinder.h" + using namespace o2; using namespace o2::analysis; using namespace o2::framework; @@ -130,15 +133,15 @@ struct JetFinderHFTask { jetFinder.ghostRepeatN = ghostRepeat; if constexpr (std::is_same_v, CandidatesD0Data>) { // Note : need to be careful if configurable workflow options are added later - candMass = pdg::MassD0; + candMass = o2::constants::physics::MassD0; candDecay = static_cast(aod::hf_cand_2prong::DecayType::D0ToPiK); } if constexpr (std::is_same_v, CandidatesBplusData>) { - candMass = pdg::MassBPlus; + candMass = o2::constants::physics::MassBPlus; candDecay = static_cast(aod::hf_cand_bplus::DecayType::BplusToD0Pi); } if constexpr (std::is_same_v, CandidatesLcData>) { - candMass = pdg::MassLambdaCPlus; + candMass = o2::constants::physics::MassLambdaCPlus; candDecay = static_cast(aod::hf_cand_3prong::DecayType::LcToPKPi); } } diff --git a/PWGJE/Tasks/FullJetTriggerQATask.cxx b/PWGJE/Tasks/FullJetTriggerQATask.cxx index a31c2eff6c6..44247cc960b 100644 --- a/PWGJE/Tasks/FullJetTriggerQATask.cxx +++ b/PWGJE/Tasks/FullJetTriggerQATask.cxx @@ -160,7 +160,7 @@ struct JetTriggerQA { histProcessed->GetXaxis()->SetBinLabel(15, "Selected Gamma very low DCAL"); std::array triggerlabels = {{"MB", "EMC Any", "EMC MB", "EMC jet full high", "EMC jet full low", "EMC jet neutral high", "EMC jet neutral low", "EMC gamma very high", "DCL gamma very high", "EMC gamma high", "DCL gamma high", "EMC gamma low", "DCL gamma low", "EMC gamma very low", "DCL gamma very low"}}; - registry.add("hTriggerCorrelation", "Correlation between EMCAL triggers", HistType::kTH2D, {{TriggerType_t::kNTriggers, -0.5, TriggerType_t::kNTriggers - 0.5, "Main trigger"}, {TriggerType_t::kNTriggers, -0.5, TriggerType_t::kNTriggers - 0.5, "Associated trigger"}}); + registry.add("hTriggerCorrelation", "Correlation between EMCAL triggers", HistType::kTH2D, {{TriggerType_t::kNTriggers, -0.5, (double)TriggerType_t::kNTriggers - 0.5, "Main trigger"}, {TriggerType_t::kNTriggers, -0.5, (double)TriggerType_t::kNTriggers - 0.5, "Associated trigger"}}); auto triggerCorrelation = registry.get(HIST("hTriggerCorrelation")); for (std::size_t triggertype = 0; triggertype < TriggerType_t::kNTriggers; triggertype++) { triggerCorrelation->GetXaxis()->SetBinLabel(triggertype + 1, triggerlabels[triggertype].data()); diff --git a/PWGJE/Tasks/jetfinderfullQA.cxx b/PWGJE/Tasks/jetfinderfullQA.cxx index 0a1fc994ab2..82a51a80f05 100644 --- a/PWGJE/Tasks/jetfinderfullQA.cxx +++ b/PWGJE/Tasks/jetfinderfullQA.cxx @@ -13,6 +13,7 @@ // /// \author Nima Zardoshti +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -25,7 +26,6 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/PDG.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" diff --git a/PWGJE/Tasks/jetfinderhfQA.cxx b/PWGJE/Tasks/jetfinderhfQA.cxx index ab9fccb1dc7..52594d6d62a 100644 --- a/PWGJE/Tasks/jetfinderhfQA.cxx +++ b/PWGJE/Tasks/jetfinderhfQA.cxx @@ -13,6 +13,7 @@ // /// \author Nima Zardoshti +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -27,7 +28,6 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Core/PDG.h" #include "PWGJE/DataModel/Jet.h" @@ -74,13 +74,13 @@ struct JetFinderHFQATask { trackSelection = JetDerivedDataUtilities::initialiseTrackSelection(static_cast(trackSelections)); if constexpr (std::is_same_v, soa::Join>) { // Note : need to be careful if configurable workflow options are added later - candMass = pdg::MassD0; + candMass = o2::constants::physics::MassD0; } if constexpr (std::is_same_v, soa::Join>) { - candMass = pdg::MassLambdaCPlus; + candMass = o2::constants::physics::MassLambdaCPlus; } if constexpr (std::is_same_v, soa::Join>) { - candMass = pdg::MassBPlus; + candMass = o2::constants::physics::MassBPlus; } jetRadiiValues = (std::vector)jetRadii; diff --git a/PWGJE/Tasks/jetsubstructurehf.cxx b/PWGJE/Tasks/jetsubstructurehf.cxx index 62fb88e10eb..c7fc671bda9 100644 --- a/PWGJE/Tasks/jetsubstructurehf.cxx +++ b/PWGJE/Tasks/jetsubstructurehf.cxx @@ -17,6 +17,7 @@ #include "fastjet/PseudoJet.hh" #include "fastjet/ClusterSequenceArea.hh" +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -73,13 +74,13 @@ struct JetSubstructureHFTask { jetReclusterer.algorithm = fastjet::JetAlgorithm::cambridge_algorithm; if constexpr (std::is_same_v, soa::Join>) { - candPDG = static_cast(pdg::Code::kD0); + candPDG = static_cast(o2::constants::physics::Pdg::kD0); } if constexpr (std::is_same_v, soa::Join>) { - candPDG = static_cast(pdg::Code::kBPlus); + candPDG = static_cast(o2::constants::physics::Pdg::kBPlus); } if constexpr (std::is_same_v, soa::Join>) { - candPDG = static_cast(pdg::Code::kLambdaCPlus); + candPDG = static_cast(o2::constants::physics::Pdg::kLambdaCPlus); } } diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index cf044640ac7..e2237723580 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -31,8 +31,8 @@ namespace o2::aod /// Resonance Collisions namespace resocollision { -DECLARE_SOA_COLUMN(MultV0M, multV0M, float); //! V0M multiplicity percentile (run2: V0M, run3: FT0A/C/M) -DECLARE_SOA_COLUMN(MultFT0, multFT0, int); //! FT0 multiplicity +DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality (Multiplicity) percentile (Default: FT0M) +DECLARE_SOA_COLUMN(Mult, mult, int); //! FT0 multiplicity DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity of the event DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field } // namespace resocollision @@ -41,8 +41,8 @@ DECLARE_SOA_TABLE(ResoCollisions, "AOD", "RESOCOL", collision::PosX, collision::PosY, collision::PosZ, - resocollision::MultV0M, - resocollision::MultFT0, + resocollision::Cent, + resocollision::Mult, resocollision::Spherocity, resocollision::BMagField, timestamp::Timestamp); diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 661679a5049..16e36cf7c7e 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -459,7 +459,7 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! // FOR DERIVED DECLARE_SOA_INDEX_COLUMN_FULL(PosTrackExtra, posTrackExtra, int, DauTrackExtras, "_PosExtra"); //! DECLARE_SOA_INDEX_COLUMN_FULL(NegTrackExtra, negTrackExtra, int, DauTrackExtras, "_NegExtra"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(BachTrackExtra, bachTrackExtra, int, DauTrackExtras, "_NegExtra"); //! +DECLARE_SOA_INDEX_COLUMN_FULL(BachTrackExtra, bachTrackExtra, int, DauTrackExtras, "_BachExtra"); //! DECLARE_SOA_INDEX_COLUMN_FULL(StrangeTrackExtra, strangeTrackExtra, int, DauTrackExtras, "_StrangeExtra"); //! DECLARE_SOA_INDEX_COLUMN(StraCollision, straCollision); //! diff --git a/PWGLF/TableProducer/f1protonInitializer.cxx b/PWGLF/TableProducer/f1protonInitializer.cxx index a39b6678cbe..e7240c72f90 100644 --- a/PWGLF/TableProducer/f1protonInitializer.cxx +++ b/PWGLF/TableProducer/f1protonInitializer.cxx @@ -33,7 +33,7 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" #include "Common/Core/trackUtilities.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/EventSelection.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -181,7 +181,7 @@ struct f1protoninitializer { if (fabs(candidate.dcav0topv()) > cMaxV0DCA) { return false; } - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0; float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0; if (fabs(CtauK0s) > cMaxV0LifeTime || candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) { @@ -191,9 +191,9 @@ struct f1protoninitializer { } ///////////////////////////////////////////////////////////// - double massPi = o2::analysis::pdg::MassPiPlus; - double massKa = o2::analysis::pdg::MassKPlus; - double massK0s = o2::analysis::pdg::MassK0Short; + double massPi = o2::constants::physics::MassPiPlus; + double massKa = o2::constants::physics::MassKPlus; + double massK0s = o2::constants::physics::MassK0Short; double massF1{0.}; double masskKs0{0.}; double pT{0.}; diff --git a/PWGLF/TableProducer/filterf1proton.cxx b/PWGLF/TableProducer/filterf1proton.cxx index 4783829ca5a..831209b0905 100644 --- a/PWGLF/TableProducer/filterf1proton.cxx +++ b/PWGLF/TableProducer/filterf1proton.cxx @@ -39,7 +39,7 @@ #include "DataFormatsTPC/BetheBlochAleph.h" #include "CCDB/BasicCCDBManager.h" #include "CCDB/CcdbApi.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" using namespace o2; using namespace o2::framework; @@ -316,7 +316,7 @@ struct filterf1proton { const float dcaDaughv0 = candidate.dcaV0daughters(); const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0; float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0; @@ -390,10 +390,10 @@ struct filterf1proton { std::vector BBProton, BBAntiproton, BBPion, BBAntipion, BBKaon, BBAntikaon; ROOT::Math::PtEtaPhiMVector F1Vector, KKs0Vector; - double massPi = o2::analysis::pdg::MassPiPlus; - double massKa = o2::analysis::pdg::MassKPlus; + double massPi = o2::constants::physics::MassPiPlus; + double massKa = o2::constants::physics::MassKPlus; double massPr = o2::constants::physics::MassProton; - double massK0s = o2::analysis::pdg::MassK0Short; + double massK0s = o2::constants::physics::MassK0Short; double massF1{0.}; double masskKs0{0.}; double pT{0.}; diff --git a/PWGLF/TableProducer/hypertriton3bodybuilder.cxx b/PWGLF/TableProducer/hypertriton3bodybuilder.cxx index 980c55a8b23..5d54cad115f 100644 --- a/PWGLF/TableProducer/hypertriton3bodybuilder.cxx +++ b/PWGLF/TableProducer/hypertriton3bodybuilder.cxx @@ -77,7 +77,7 @@ struct hypertriton3bodyBuilder { // Selection criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; - Configurable minCosPA3body{"minCosPA3body", 0.8, "minCosPA3body"}; + Configurable minCosPA3body{"minCosPA3body", 0.9, "minCosPA3body"}; Configurable dcavtxdau{"dcavtxdau", 2.0, "DCA Vtx Daughters"}; Configurable useMatCorrType{"useMatCorrType", 0, "0: none, 1: TGeo, 2: LUT"}; @@ -339,7 +339,7 @@ struct hypertriton3bodyLabelBuilder { } PROCESS_SWITCH(hypertriton3bodyLabelBuilder, processDoNotBuildLabels, "Do not produce MC label tables", true); - void processBuildLabels(aod::Collisions::iterator const& collision, aod::Decay3BodysLinked const& decay3bodys, aod::Vtx3BodyDatas const& vtx3bodydatas, LabeledTracks const&, aod::McParticles const& particlesMC) + void processBuildLabels(aod::Decay3BodysLinked const& decay3bodys, aod::Vtx3BodyDatas const& vtx3bodydatas, LabeledTracks const&, aod::McParticles const& particlesMC) { std::vector lIndices; lIndices.reserve(vtx3bodydatas.size()); diff --git a/PWGLF/TableProducer/hypertriton3bodyfinder.cxx b/PWGLF/TableProducer/hypertriton3bodyfinder.cxx index 00ba8b41214..2b29305dc5c 100644 --- a/PWGLF/TableProducer/hypertriton3bodyfinder.cxx +++ b/PWGLF/TableProducer/hypertriton3bodyfinder.cxx @@ -163,6 +163,7 @@ struct hypertriton3bodyFinder { // Configurables Configurable UseCFFilter{"UseCFFilter", true, "Reject event without CF LD trigger"}; Configurable RejectBkgInMC{"RejectBkgInMC", false, "Reject fake 3-body pairs in MC check"}; + Configurable KeepSignalInMC{"KeepSignalInMC", false, "Reject fake 3-body pairs in MC check"}; Configurable d_UseAbsDCA{"d_UseAbsDCA", true, "Use Abs DCAs"}; Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; @@ -186,10 +187,9 @@ struct hypertriton3bodyFinder { // for DCA Configurable dcavtxdau{"dcavtxdau", 2.0, "DCA Vtx Daughters"}; - - // for track cut in SVertexer, Can we use it in the production of goodtrack table? - // float maxDCAXY3Body = 0.3; // max DCA of 3 body decay to PV in XY? - // float maxDCAZ3Body = 0.3; // max DCA of 3 body decay to PV in Z + Configurable d_UseH3LDCACut{"d_UseH3LDCACut", true, "Use Cuts for H3L DCA to PV"}; + Configurable maxDCAXY3Body{"maxDCAXY3Body", 0.5, "DCAXY H3L to PV"}; // max DCA of 3 body decay to PV in XY + Configurable maxDCAZ3Body{"maxDCAZ3Body", 1.0, "DCAZ H3L to PV"}; // max DCA of 3 body decay to PV in Z Configurable useMatCorrType{"useMatCorrType", 2, "0: none, 1: TGeo, 2: LUT"}; // CCDB options @@ -213,8 +213,8 @@ struct hypertriton3bodyFinder { {"hDauTrackCounter", "hDauTrackCounter", {HistType::kTH1F, {{3, 0.0f, 3.0f}}}}, {"hV0Counter", "hV0Counter", {HistType::kTH1F, {{8, -0.5f, 7.5f}}}}, {"hTrueV0Counter", "hTrueV0Counter", {HistType::kTH1F, {{8, -0.5f, 7.5f}}}}, - {"hVtx3BodyCounter", "hVtx3BodyCounter", {HistType::kTH1F, {{8, -0.5f, 7.5f}}}}, - {"hTrueVtx3BodyCounter", "hTrueVtx3BodyCounter", {HistType::kTH1F, {{8, -0.5f, 7.5f}}}}, + {"hVtx3BodyCounter", "hVtx3BodyCounter", {HistType::kTH1F, {{9, -0.5f, 8.5f}}}}, + {"hTrueVtx3BodyCounter", "hTrueVtx3BodyCounter", {HistType::kTH1F, {{9, -0.5f, 8.5f}}}}, {"hVirtLambaCounter", "hVirtualLambaCounter", {HistType::kTH1F, {{6, -0.5f, 5.5f}}}}, {"hCFFilteredVirtLambaCounter", "hCFFilteredVirtLambaCounter", {HistType::kTH1F, {{6, -0.5f, 5.5f}}}}, }, @@ -239,6 +239,7 @@ struct hypertriton3bodyFinder { kVtxTgLamda, kVtxCosPA, kVtxDcaDau, + kVtxDcaH3L, kNVtxSteps }; // Helper struct to do bookkeeping of building parameters @@ -318,7 +319,7 @@ struct hypertriton3bodyFinder { TString DauCounterbinLabel[3] = {"Proton", "Pion", "Deuteron"}; TString V0CounterbinLabel[8] = {"Total", "hasSV", "V0R", "V0Pt", "TgLambda", "V0Mass", "DcaXY", "CosPA"}; - TString VtxCounterbinLabel[8] = {"Total", "bachPt", "hasSV", "VtxR", "VtxPt", "TgLambda", "CosPA", "DcaDau"}; + TString VtxCounterbinLabel[9] = {"Total", "bachPt", "hasSV", "VtxR", "VtxPt", "TgLambda", "CosPA", "DcaDau", "DcaH3L"}; for (int i{0}; i < 3; i++) { registry.get(HIST("hDauTrackCounter"))->GetXaxis()->SetBinLabel(i + 1, DauCounterbinLabel[i]); } @@ -327,8 +328,8 @@ struct hypertriton3bodyFinder { registry.get(HIST("hTrueV0Counter"))->GetXaxis()->SetBinLabel(i + 1, V0CounterbinLabel[i]); } for (int i{0}; i < kNVtxSteps; i++) { - registry.get(HIST("hVtx3BodyCounter"))->GetXaxis()->SetBinLabel(i + 1, V0CounterbinLabel[i]); - registry.get(HIST("hTrueVtx3BodyCounter"))->GetXaxis()->SetBinLabel(i + 1, V0CounterbinLabel[i]); + registry.get(HIST("hVtx3BodyCounter"))->GetXaxis()->SetBinLabel(i + 1, VtxCounterbinLabel[i]); + registry.get(HIST("hTrueVtx3BodyCounter"))->GetXaxis()->SetBinLabel(i + 1, VtxCounterbinLabel[i]); } ccdb->setURL(ccdburl); @@ -859,6 +860,15 @@ struct hypertriton3bodyFinder { auto Track2dcaXY = dcaInfo[0]; // Not involved: H3L DCA Check + // auto track3B = o2::track::TrackParCov(vertexXYZ, p3B, fitter3body.calcPCACovMatrixFlat(cand3B), t2.sign()); + auto track3B = o2::track::TrackParCov(vertexXYZ, p3B, t2.sign()); + o2::dataformats::DCA dca; + if (d_UseH3LDCACut && (!track3B.propagateToDCA({{dCollision.posX(), dCollision.posY(), dCollision.posZ()}, {dCollision.covXX(), dCollision.covXY(), dCollision.covYY(), dCollision.covXZ(), dCollision.covYZ(), dCollision.covZZ()}}, fitter3body.getBz(), &dca, 5.) || + std::abs(dca.getY()) > maxDCAXY3Body || std::abs(dca.getZ()) > maxDCAZ3Body)) { + continue; + } + FillVtxCounter(kVtxDcaH3L, isTrue3bodyVtx); + vtx3bodydata( t0.globalIndex(), t1.globalIndex(), t2.globalIndex(), dCollision.globalIndex(), 0, vertexXYZ[0], vertexXYZ[1], vertexXYZ[2], @@ -912,7 +922,6 @@ struct hypertriton3bodyFinder { auto bc = collision.bc_as(); initCCDB(bc); registry.fill(HIST("hEventCounter"), 0.5); - registry.fill(HIST("hEventCounter"), 1.5); DecayFinder(collision, ptracks, ntracks, goodtracks); } @@ -941,13 +950,13 @@ struct hypertriton3bodyFinder { } PROCESS_SWITCH(hypertriton3bodyFinder, processCFFilteredData, "Produce StoredVtx3BodyDatas with data using CFtriggers", true); - void processMC(aod::Collision const& collision, aod::V0GoodPosTracks const& ptracks, aod::V0GoodNegTracks const& ntracks, aod::V0GoodTracks const& goodtracks, aod::McParticles const& mcparticles, FullTracksExtIU const&, aod::BCsWithTimestamps const&) + void processMC(aod::Collision const& collision, aod::V0GoodPosTracks const& ptracks, aod::V0GoodNegTracks const& ntracks, aod::V0GoodTracks const& goodtracks, aod::McParticles const& mcparticles, FullTracksExtMCIU const&, aod::BCsWithTimestamps const&) { auto bc = collision.bc_as(); initCCDB(bc); registry.fill(HIST("hEventCounter"), 0.5); - registry.fill(HIST("hEventCounter"), 1.5); + CheckGoodTracks(goodtracks, mcparticles); DecayFinderMC(collision, ptracks, ntracks, goodtracks); } PROCESS_SWITCH(hypertriton3bodyFinder, processMC, "Produce StoredVtx3BodyDatas with MC", false); @@ -1028,7 +1037,7 @@ struct hypertriton3bodyLabelBuilder { } PROCESS_SWITCH(hypertriton3bodyLabelBuilder, processDoNotBuildLabels, "Do not produce MC label tables", true); - void processBuildLabels(aod::Collisions::iterator const& collision, aod::Vtx3BodyDatas const& vtx3bodydatas, LabeledTracks const&, aod::McParticles const& particlesMC) + void processBuildLabels(aod::Vtx3BodyDatas const& vtx3bodydatas, LabeledTracks const&, aod::McParticles const& particlesMC) { std::vector lIndices; lIndices.reserve(vtx3bodydatas.size()); diff --git a/PWGLF/TableProducer/nucleiSpectra.cxx b/PWGLF/TableProducer/nucleiSpectra.cxx index 00f1490d6a4..76631200928 100644 --- a/PWGLF/TableProducer/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/nucleiSpectra.cxx @@ -288,7 +288,7 @@ struct nucleiSpectra { for (int iPID{0}; iPID < 2; ++iPID) { nuclei::hDCAxy[iPID][iS][iC] = spectra.add(fmt::format("hDCAxy{}_{}_{}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("DCAxy {} {} {}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], dcaxyAxes[iS]}); nuclei::hDCAz[iPID][iS][iC] = spectra.add(fmt::format("hDCAz{}_{}_{}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("DCAz {} {} {}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], dcazAxes[iS]}); - nuclei::hDeltaP[iPID][iS] = spectra.add(fmt::format("hDeltaP{}_{}", nuclei::pidName[iPID], nuclei::names[iS]).data(), fmt::format("#Delta#it{p}/#it{p} {} {}", nuclei::pidName[iPID], nuclei::names[iS]).data(), HistType::kTH2D, {{232, 0.2, 6., "#it{p} (GeV/#it{c})"}, {200, -1, 1, "(#it{p}_{IU} - #it{p}_{TPC}) / #it{p}"}}); + nuclei::hDeltaP[iPID][iS] = spectra.add(fmt::format("hDeltaP{}_{}", nuclei::pidName[iPID], nuclei::names[iS]).data(), fmt::format("#Delta#it{{p}}/#it{{p}} {} {}", nuclei::pidName[iPID], nuclei::names[iS]).data(), HistType::kTH2D, {{232, 0.2, 6., "#it{{p}} (GeV/#it{{c}})"}, {200, -1, 1, "(#it{{p}}_{{IU}} - #it{{p}}_{{TPC}}) / #it{{p}}"}}); } nuclei::hTOFmass[iS][iC] = spectra.add(fmt::format("h{}TOFmass{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("TOF mass - {} PDG mass", nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], tofMassAxis}); nuclei::hTOFmassEta[iS][iC] = spectra.add(fmt::format("h{}TOFmassEta{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("TOF mass - {} PDG mass", nuclei::names[iS]).data(), HistType::kTH3D, {etaAxis, ptAxes[iS], tofMassAxis}); diff --git a/PWGLF/TableProducer/strangederivedbuilder.cxx b/PWGLF/TableProducer/strangederivedbuilder.cxx index 49bc1d8f6c5..dd8f7aa5ee5 100644 --- a/PWGLF/TableProducer/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/strangederivedbuilder.cxx @@ -44,6 +44,7 @@ #include "CommonConstants/PhysicsConstants.h" #include "Common/TableProducer/PID/pidTOFBase.h" #include "Common/DataModel/PIDResponse.h" +#include "Framework/StaticFor.h" using namespace o2; using namespace o2::framework; @@ -52,6 +53,10 @@ using std::array; using TracksWithExtra = soa::Join; +// simple checkers +#define bitset(var, nbit) ((var) |= (1 << (nbit))) +#define bitcheck(var, nbit) ((var) & (1 << (nbit))) + struct strangederivedbuilder { //__________________________________________________ // fundamental building blocks of derived data @@ -79,8 +84,28 @@ struct strangederivedbuilder { Produces kfToCascRefs; // KF -> cascades - //__________________________________________________ - // correlation information between cascades: standard<->KF, standard<->tracked, KF<->tracked + // histogram registry for bookkeeping + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + static constexpr int nSpecies = 14; + static constexpr int nParameters = 1; + static const std::vector particleNames; + static const std::vector particlePDGCodes; + static const std::vector parameterNames; + static const int defaultParameters[nSpecies][nParameters]; + static constexpr std::string_view particleNamesConstExpr[] = {"Gamma", "K0Short", "Lambda", "AntiLambda", + "Sigma0", "AntiSigma0", "SigmaPlus", "SigmaMinus", + "Hypertriton", "AntiHypertriton", + "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus"}; + + uint32_t enabledBits = 0; + + Configurable> enableGeneratedInfo{"enableGeneratedInfo", + {defaultParameters[0], nSpecies, + nParameters, particleNames, parameterNames}, + "Fill generated particle histograms for each species. 0: no, 1: yes"}; + + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; Configurable fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"}; @@ -92,6 +117,39 @@ struct strangederivedbuilder { void init(InitContext& context) { + // setup map for fast checking if enabled + static_for<0, nSpecies - 1>([&](auto i) { + constexpr int index = i.value; + int f = enableGeneratedInfo->get(particleNames[index].c_str(), "Enable"); + if (f == 1) { + bitset(enabledBits, index); + } + }); + + // Creation of histograms: MC generated + for (Int_t i = 0; i < nSpecies; i++) + histos.add(Form("hGen%s", particleNames[i].data()), Form("hGen%s", particleNames[i].data()), kTH1D, {axisPt}); + } + + void processCollisionsV0sOnly(soa::Join const& collisions, aod::V0Datas const& V0s) + { + int currentCollIdx = -1; + for (const auto& collision : collisions) { + const uint64_t collIdx = collision.globalIndex(); + auto V0Table_thisColl = V0s.sliceBy(V0perCollision, collIdx); + bool strange = V0Table_thisColl.size() > 0; + // casc table sliced + if (strange || fillEmptyCollisions) { + if (currentCollIdx != collIdx) { + strangeColl(collision.posX(), collision.posY(), collision.posZ(), + collision.centFT0M(), collision.centFT0A(), + collision.centFT0C(), collision.centFV0A()); + currentCollIdx = collIdx; + } + } + for (int i = 0; i < V0Table_thisColl.size(); i++) + v0collref(strangeColl.lastIndex()); + } } void processCollisions(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades) @@ -127,7 +185,47 @@ struct strangederivedbuilder { } } - void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, TracksWithExtra const& tracksExtra) + void processTrackExtrasV0sOnly(aod::V0Datas const& V0s, TracksWithExtra const& tracksExtra) + { + std::vector trackMap(tracksExtra.size(), -1); // index -1: not used + + //__________________________________________________ + // mark tracks that belong to V0s + for (auto const& v0 : V0s) { + auto const& posTrack = v0.posTrack_as(); + auto const& negTrack = v0.negTrack_as(); + trackMap[posTrack.globalIndex()] = 0; + trackMap[negTrack.globalIndex()] = 0; + } + //__________________________________________________ + // Figure out the numbering of the new tracks table + // assume filling per order + int nTracks = 0; + for (int i = 0; i < trackMap.size(); i++) { + if (trackMap[i] >= 0) { + trackMap[i] = nTracks++; + } + } + //__________________________________________________ + // populate track references + for (auto const& v0 : V0s) { + auto const& posTrack = v0.posTrack_as(); + auto const& negTrack = v0.negTrack_as(); + v0Extras(trackMap[posTrack.globalIndex()], + trackMap[negTrack.globalIndex()]); // joinable with V0Datas + } + //__________________________________________________ + // circle back and populate actual DauTrackExtra table + for (auto const& tr : tracksExtra) { + if (trackMap[tr.globalIndex()] >= 0) { + dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(), + tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); + } + } + // done! + } + + void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, TracksWithExtra const& tracksExtra, aod::V0s const&) { std::vector trackMap(tracksExtra.size(), -1); // index -1: not used @@ -276,9 +374,27 @@ struct strangederivedbuilder { } } - PROCESS_SWITCH(strangederivedbuilder, processCollisions, "Produce collisions", true); - PROCESS_SWITCH(strangederivedbuilder, processTrackExtras, "Produce track extra information", true); - PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlink, "Produce tables connecting cascades", true); + void processSimulation(aod::McParticles const& mcParticles) + { + // check if collision successfully reconstructed + for (auto& mcp : mcParticles) { + if (TMath::Abs(mcp.y()) < 0.5) { + static_for<0, nSpecies - 1>([&](auto i) { + constexpr int index = i.value; + if (mcp.pdgCode() == particlePDGCodes[index] && bitcheck(enabledBits, index)) { + histos.fill(HIST("hGen") + HIST(particleNamesConstExpr[index]), mcp.pt()); + } + }); + } + } + } + + PROCESS_SWITCH(strangederivedbuilder, processCollisionsV0sOnly, "Produce collisions (V0s only)", true); + PROCESS_SWITCH(strangederivedbuilder, processCollisions, "Produce collisions (V0s + casc)", true); + PROCESS_SWITCH(strangederivedbuilder, processTrackExtrasV0sOnly, "Produce track extra information (V0s only)", true); + PROCESS_SWITCH(strangederivedbuilder, processTrackExtras, "Produce track extra information (V0s + casc)", true); + PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlink, "Produce tables interconnecting cascades", true); + PROCESS_SWITCH(strangederivedbuilder, processSimulation, "Produce simulated information", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) @@ -286,3 +402,15 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc)}; } + +//__________________________________________________ +// do not over-populate general namespace, keep scope strangederivedbuilder:: +const std::vector strangederivedbuilder::particleNames{"Gamma", "K0Short", "Lambda", "AntiLambda", + "Sigma0", "AntiSigma0", "SigmaPlus", "SigmaMinus", + "Hypertriton", "AntiHypertriton", + "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus"}; +const std::vector strangederivedbuilder::particlePDGCodes{22, 310, 3122, -3122, 3212, -3212, 3222, 3112, + 1010010030, -1010010030, 3312, -3312, 3334, -3334}; +const std::vector strangederivedbuilder::parameterNames{"Enable"}; + +const int strangederivedbuilder::defaultParameters[strangederivedbuilder::nSpecies][strangederivedbuilder::nParameters] = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}; \ No newline at end of file diff --git a/PWGLF/TableProducer/v0qaanalysis.cxx b/PWGLF/TableProducer/v0qaanalysis.cxx index 936b7380294..24d0a2e23c2 100644 --- a/PWGLF/TableProducer/v0qaanalysis.cxx +++ b/PWGLF/TableProducer/v0qaanalysis.cxx @@ -21,7 +21,7 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" using namespace o2; using namespace o2::framework; @@ -120,9 +120,9 @@ struct LfV0qaanalysis { for (auto& v0 : V0s) { // loop over V0s // c tau - float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0; - float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0Bar; - float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0Bar; + float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; // ITS clusters int posITSNhits = 0, negITSNhits = 0; @@ -236,9 +236,9 @@ struct LfV0qaanalysis { evFlag = 1; } - float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0; - float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0Bar; - float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0Bar; + float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; if (v0.v0radius() > v0radius && v0.v0cosPA() > v0cospa && diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index ea0ac8983c3..0746d4640ab 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -220,3 +220,8 @@ o2physics_add_dpl_workflow(nuclei-in-jets SOURCES nuclei_in_jets.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(helium-flow + SOURCES helium_flow.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/QAHistTask.cxx b/PWGLF/Tasks/QAHistTask.cxx index ab980aedf1e..d59d946aa86 100644 --- a/PWGLF/Tasks/QAHistTask.cxx +++ b/PWGLF/Tasks/QAHistTask.cxx @@ -53,12 +53,16 @@ struct QAHistTask { void init(o2::framework::InitContext&) { - if ((process_proton == true && (process_deuteron == true || process_triton == true || process_He3 == true || process_He4 == true)) || (process_deuteron == true && (process_triton == true || process_He3 == true || process_He4 == true)) || (process_triton == true && (process_He3 == true || process_He4 == true)) || (process_He3 == true && process_He4 == true)) { + if ((process_pion == true && (process_kaon == true || process_proton == true || process_deuteron == true || process_triton == true || process_He3 == true || process_He4 == true)) || (process_kaon == true && (process_proton == true || process_deuteron == true || process_triton == true || process_He3 == true || process_He4 == true)) || (process_proton == true && (process_deuteron == true || process_triton == true || process_He3 == true || process_He4 == true)) || (process_deuteron == true && (process_triton == true || process_He3 == true || process_He4 == true)) || (process_triton == true && (process_He3 == true || process_He4 == true)) || (process_He3 == true && process_He4 == true)) { LOG(fatal) << "++++++++ Can't enable more than one species at a time, use subwagons for that purpose. ++++++++"; } std::string species; + if (process_pion) + species = "pi"; + if (process_kaon) + species = "ka"; if (process_proton) species = "p"; if (process_deuteron) @@ -198,6 +202,8 @@ struct QAHistTask { } // Configurables + Configurable process_pion{"process_pion", false, "0: disabled, 1: enabled"}; + Configurable process_kaon{"process_kaon", false, "0: disabled, 1: enabled"}; Configurable process_proton{"process_proton", false, "0: disabled, 1: enabled"}; Configurable process_deuteron{"process_deuteron", false, "0: disabled, 1: enabled"}; Configurable process_triton{"process_triton", false, "0: disabled, 1: enabled"}; @@ -255,6 +261,10 @@ struct QAHistTask { float nSigmaSpecies = 999.0; + if (process_pion) + nSigmaSpecies = track.tpcNSigmaPi(); + if (process_kaon) + nSigmaSpecies = track.tpcNSigmaKa(); if (process_proton) nSigmaSpecies = track.tpcNSigmaPr(); if (process_deuteron) @@ -360,7 +370,7 @@ struct QAHistTask { QA_reg.fill(HIST("histTofSignalData"), track.tpcInnerParam() * track.sign(), track.beta()); } - // fill QA histograms (proton) + // fill QA histograms if (TMath::Abs(nSigmaSpecies) < nsigmacut) { if (track.sign() > 0) { QA_species_pos.fill(HIST("histDcaVsPtData"), track.pt(), track.dcaXY()); @@ -483,11 +493,11 @@ struct QAHistTask { using EventCandidatesDataCent = soa::Filtered>; - using TrackCandidatesData = soa::Filtered>; + using TrackCandidatesData = soa::Filtered>; using EventCandidatesMC = soa::Filtered>; - using TrackCandidatesMC = soa::Filtered>; + using TrackCandidatesMC = soa::Filtered>; void processData(EventCandidatesData::iterator const& event, TrackCandidatesData const& tracks) { diff --git a/PWGLF/Tasks/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index 24e51b893fe..49d97a2b20d 100644 --- a/PWGLF/Tasks/QC/CMakeLists.txt +++ b/PWGLF/Tasks/QC/CMakeLists.txt @@ -39,6 +39,11 @@ o2physics_add_dpl_workflow(kfperformancestudy PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(lfpropstudy + SOURCES lfpropStudy.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tpc-dedx-postcalibration SOURCES tpc_dEdx_postcalibration.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/Tasks/QC/lfpropStudy.cxx b/PWGLF/Tasks/QC/lfpropStudy.cxx new file mode 100644 index 00000000000..a9e9b127660 --- /dev/null +++ b/PWGLF/Tasks/QC/lfpropStudy.cxx @@ -0,0 +1,264 @@ +// 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 lfpropStudy.cxx +/// \since 27-11-2023 +/// \author Carolina Reetz +/// \brief QA task to study properties of propagated tracks + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "ReconstructionDataFormats/Track.h" +#include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" +#include "TPDGCode.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +using TracksLabeled = soa::Join; +using Tracks = soa::Join; + +struct lfpropStudy { + + ConfigurableAxis axisDCAxy{"axisDCAxy", {1000, -10.f, 10.f}, "DCA_{xy} (cm)"}; + ConfigurableAxis axisDCAz{"axisDCAz", {1000, -10.f, 10.f}, "DCA_{z} (cm)"}; + ConfigurableAxis axisMom{"axisMom", {1000, 0.0f, 10.f}, "p (GeV/c)"}; + + Configurable d_noITS{"d_noITS", true, "flag to select tracks without ITS"}; + Configurable d_pTMin{"d_pTMin", 0.3, "minimum track momentum"}; + Configurable d_TPCrowsMin{"d_TPCrowsMin", 70, "minimum number of TPC crossed rows"}; + Configurable d_TPCrowsOverFindMin{"d_TPCrowsOverFindMin", 0.8, "minimum for ratio of TPC crossed rows over findable"}; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Filter collisionFilter = (aod::evsel::sel8 == true); + + void init(InitContext const&) + { + histos.add("hEventCounter", "hEventCounter", kTH1F, {{1, 0.0f, 1.0f}}); + + // momentum + histos.add("hPxEl", "hPxEl", kTH1F, {axisMom}); + histos.add("hPyEl", "hPyEl", kTH1F, {axisMom}); + histos.add("hPzEl", "hPzEl", kTH1F, {axisMom}); + histos.add("hPtEl", "hPtEl", kTH1F, {axisMom}); + histos.add("hPxPi", "hPxPi", kTH1F, {axisMom}); + histos.add("hPyPi", "hPyPi", kTH1F, {axisMom}); + histos.add("hPzPi", "hPzPi", kTH1F, {axisMom}); + histos.add("hPtPi", "hPtPi", kTH1F, {axisMom}); + histos.add("hPxKa", "hPxKa", kTH1F, {axisMom}); + histos.add("hPyKa", "hPyKa", kTH1F, {axisMom}); + histos.add("hPzKa", "hPzKa", kTH1F, {axisMom}); + histos.add("hPtKa", "hPtKa", kTH1F, {axisMom}); + histos.add("hPxPr", "hPxPr", kTH1F, {axisMom}); + histos.add("hPyPr", "hPyPr", kTH1F, {axisMom}); + histos.add("hPzPr", "hPzPr", kTH1F, {axisMom}); + histos.add("hPtPr", "hPtPr", kTH1F, {axisMom}); + histos.add("hPxDe", "hPxDe", kTH1F, {axisMom}); + histos.add("hPyDe", "hPyDe", kTH1F, {axisMom}); + histos.add("hPzDe", "hPzDe", kTH1F, {axisMom}); + histos.add("hPtDe", "hPtDe", kTH1F, {axisMom}); + histos.add("hPxTr", "hPxTr", kTH1F, {axisMom}); + histos.add("hPyTr", "hPyTr", kTH1F, {axisMom}); + histos.add("hPzTr", "hPzTr", kTH1F, {axisMom}); + histos.add("hPtTr", "hPtTr", kTH1F, {axisMom}); + histos.add("hPxHe", "hPxHe", kTH1F, {axisMom}); + histos.add("hPyHe", "hPyHe", kTH1F, {axisMom}); + histos.add("hPzHe", "hPzHe", kTH1F, {axisMom}); + histos.add("hPtHe", "hPtHe", kTH1F, {axisMom}); + histos.add("hPxAl", "hPxAl", kTH1F, {axisMom}); + histos.add("hPyAl", "hPyAl", kTH1F, {axisMom}); + histos.add("hPzAl", "hPzAl", kTH1F, {axisMom}); + histos.add("hPtAl", "hPtAl", kTH1F, {axisMom}); + + // DCA + histos.add("hDCAxyEl", "hDCAxyEl", kTH1F, {axisDCAxy}); + histos.add("hDCAzEl", "hDCAzEl", kTH1F, {axisDCAz}); + histos.add("hDCAxyPi", "hDCAxyPi", kTH1F, {axisDCAxy}); + histos.add("hDCAzPi", "hDCAzPi", kTH1F, {axisDCAz}); + histos.add("hDCAxyKa", "hDCAxyKa", kTH1F, {axisDCAxy}); + histos.add("hDCAzKa", "hDCAzKa", kTH1F, {axisDCAz}); + histos.add("hDCAxyPr", "hDCAxyPr", kTH1F, {axisDCAxy}); + histos.add("hDCAzPr", "hDCAzPr", kTH1F, {axisDCAz}); + histos.add("hDCAxyDe", "hDCAxyDe", kTH1F, {axisDCAxy}); + histos.add("hDCAzDe", "hDCAzDe", kTH1F, {axisDCAz}); + histos.add("hDCAxyTr", "hDCAxyTr", kTH1F, {axisDCAxy}); + histos.add("hDCAzTr", "hDCAzTr", kTH1F, {axisDCAz}); + histos.add("hDCAxyHe", "hDCAxyHe", kTH1F, {axisDCAxy}); + histos.add("hDCAzHe", "hDCAzHe", kTH1F, {axisDCAz}); + histos.add("hDCAxyAl", "hDCAxyAl", kTH1F, {axisDCAxy}); + histos.add("hDCAzAl", "hDCAzAl", kTH1F, {axisDCAz}); + } + + void processData(soa::Filtered>::iterator const& collision, Tracks const& Tracks) + { + histos.fill(HIST("hEventCounter"), 0.5); + for (auto& track : Tracks) { + + // track selection + if (d_noITS && track.hasITS()) + continue; // optional: only look at tracks which start outside the ITS + if (track.trackType() == aod::track::TrackIU) + continue; // only look at tracks which were propagated + if (track.tpcNClsCrossedRows() < d_TPCrowsMin || track.tpcCrossedRowsOverFindableCls() < d_TPCrowsOverFindMin) + continue; + + if (track.pidForTracking() == o2::track::PID::Electron) { + histos.fill(HIST("hPxEl"), track.px()); + histos.fill(HIST("hPyEl"), track.py()); + histos.fill(HIST("hPzEl"), track.pz()); + histos.fill(HIST("hPtEl"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyEl"), track.dcaXY()); + histos.fill(HIST("hDCAzEl"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Pion) { + histos.fill(HIST("hPxPi"), track.px()); + histos.fill(HIST("hPyPi"), track.py()); + histos.fill(HIST("hPzPi"), track.pz()); + histos.fill(HIST("hPtPi"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyPi"), track.dcaXY()); + histos.fill(HIST("hDCAzPi"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Kaon) { + histos.fill(HIST("hPxKa"), track.px()); + histos.fill(HIST("hPyKa"), track.py()); + histos.fill(HIST("hPzKa"), track.pz()); + histos.fill(HIST("hPtKa"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyKa"), track.dcaXY()); + histos.fill(HIST("hDCAzKa"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Proton) { + histos.fill(HIST("hPxPr"), track.px()); + histos.fill(HIST("hPyPr"), track.py()); + histos.fill(HIST("hPzPr"), track.pz()); + histos.fill(HIST("hPtPr"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyPr"), track.dcaXY()); + histos.fill(HIST("hDCAzPr"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Deuteron) { + histos.fill(HIST("hPxDe"), track.px()); + histos.fill(HIST("hPyDe"), track.py()); + histos.fill(HIST("hPzDe"), track.pz()); + histos.fill(HIST("hPtDe"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyDe"), track.dcaXY()); + histos.fill(HIST("hDCAzDe"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Triton) { + histos.fill(HIST("hPxTr"), track.px()); + histos.fill(HIST("hPyTr"), track.py()); + histos.fill(HIST("hPzTr"), track.pz()); + histos.fill(HIST("hPtTr"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyTr"), track.dcaXY()); + histos.fill(HIST("hDCAzTr"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Helium3) { + histos.fill(HIST("hPxHe"), track.px()); + histos.fill(HIST("hPyHe"), track.py()); + histos.fill(HIST("hPzHe"), track.pz()); + histos.fill(HIST("hPtHe"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyHe"), track.dcaXY()); + histos.fill(HIST("hDCAzHe"), track.dcaZ()); + } else if (track.pidForTracking() == o2::track::PID::Alpha) { + histos.fill(HIST("hPxAl"), track.px()); + histos.fill(HIST("hPyAl"), track.py()); + histos.fill(HIST("hPzAl"), track.pz()); + histos.fill(HIST("hPtAl"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyAl"), track.dcaXY()); + histos.fill(HIST("hDCAzAl"), track.dcaZ()); + } + } + } + PROCESS_SWITCH(lfpropStudy, processData, "process data", true); + + void processMC(soa::Filtered>::iterator const& collision, TracksLabeled const& Tracks, aod::McParticles const& particlesMC) + { + histos.fill(HIST("hEventCounter"), 0.5); + for (auto& track : Tracks) { + + if (!track.has_mcParticle() || track.mcParticleId() <= -1 || track.mcParticleId() > particlesMC.size()) + continue; + if (d_noITS && track.hasITS()) + continue; // optional: only look at tracks which start outside the ITS + if (track.trackType() == aod::track::TrackIU) + continue; // only look at tracks which were propagated + + if (track.mcParticle().pdgCode() == kElectron) { + histos.fill(HIST("hPxEl"), track.px()); + histos.fill(HIST("hPyEl"), track.py()); + histos.fill(HIST("hPzEl"), track.pz()); + histos.fill(HIST("hPtEl"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyEl"), track.dcaXY()); + histos.fill(HIST("hDCAzEl"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == kPiPlus) { + histos.fill(HIST("hPxPi"), track.px()); + histos.fill(HIST("hPyPi"), track.py()); + histos.fill(HIST("hPzPi"), track.pz()); + histos.fill(HIST("hPtPi"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyPi"), track.dcaXY()); + histos.fill(HIST("hDCAzPi"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == kKPlus) { + histos.fill(HIST("hPxKa"), track.px()); + histos.fill(HIST("hPyKa"), track.py()); + histos.fill(HIST("hPzKa"), track.pz()); + histos.fill(HIST("hPtKa"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyKa"), track.dcaXY()); + histos.fill(HIST("hDCAzKa"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == kProton) { + histos.fill(HIST("hPxPr"), track.px()); + histos.fill(HIST("hPyPr"), track.py()); + histos.fill(HIST("hPzPr"), track.pz()); + histos.fill(HIST("hPtPr"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyPr"), track.dcaXY()); + histos.fill(HIST("hDCAzPr"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == 1000010020) { + histos.fill(HIST("hPxDe"), track.px()); + histos.fill(HIST("hPyDe"), track.py()); + histos.fill(HIST("hPzDe"), track.pz()); + histos.fill(HIST("hPtDe"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyDe"), track.dcaXY()); + histos.fill(HIST("hDCAzDe"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == 1000010030) { + histos.fill(HIST("hPxTr"), track.px()); + histos.fill(HIST("hPyTr"), track.py()); + histos.fill(HIST("hPzTr"), track.pz()); + histos.fill(HIST("hPtTr"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyTr"), track.dcaXY()); + histos.fill(HIST("hDCAzTr"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == 1000020030) { + histos.fill(HIST("hPxHe"), track.px()); + histos.fill(HIST("hPyHe"), track.py()); + histos.fill(HIST("hPzHe"), track.pz()); + histos.fill(HIST("hPtHe"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyHe"), track.dcaXY()); + histos.fill(HIST("hDCAzHe"), track.dcaZ()); + } else if (track.mcParticle().pdgCode() == 1000020040) { + histos.fill(HIST("hPxAl"), track.px()); + histos.fill(HIST("hPyAl"), track.py()); + histos.fill(HIST("hPzAl"), track.pz()); + histos.fill(HIST("hPtAl"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxyAl"), track.dcaXY()); + histos.fill(HIST("hDCAzAl"), track.dcaZ()); + } + } + } + PROCESS_SWITCH(lfpropStudy, processMC, "process MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/QC/resonanceqa.cxx b/PWGLF/Tasks/QC/resonanceqa.cxx index ba0672d82ff..cc1881dbb9c 100644 --- a/PWGLF/Tasks/QC/resonanceqa.cxx +++ b/PWGLF/Tasks/QC/resonanceqa.cxx @@ -44,7 +44,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/Core/trackUtilities.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/TrackSelection.h" #include "Framework/ASoAHelpers.h" @@ -124,8 +124,8 @@ struct resonanceqa { histos.add("h1LambdastarRec", "Lambdastar meson Rec", kTH1F, {{100, 0.0f, 10.0f}}); } } - double massPi = o2::analysis::pdg::MassPiPlus; - double massKa = o2::analysis::pdg::MassKPlus; + double massPi = o2::constants::physics::MassPiPlus; + double massKa = o2::constants::physics::MassKPlus; double massPr = 0.938272088f; double rapidity; double genMass, recMass, resolution; diff --git a/PWGLF/Tasks/QC/v0cascadesqa.cxx b/PWGLF/Tasks/QC/v0cascadesqa.cxx index f6f5723b18b..30d2a5bad0c 100644 --- a/PWGLF/Tasks/QC/v0cascadesqa.cxx +++ b/PWGLF/Tasks/QC/v0cascadesqa.cxx @@ -21,7 +21,7 @@ #include "Framework/AnalysisDataModel.h" #include "Framework/ASoAHelpers.h" #include "ReconstructionDataFormats/Track.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/trackUtilities.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/TrackSelection.h" @@ -389,8 +389,8 @@ struct v0cascadesQA { float decayLength = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(v0.px(), v0.py(), v0.pz()); histos_V0.fill(HIST("DecayLength"), decayLength); - float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0; - float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; if (v0.v0cosPA() > V0_cosPA && v0.v0radius() > V0_radius && @@ -427,7 +427,7 @@ struct v0cascadesQA { if (doextraanalysis) histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mLambda()); histos_V0.fill(HIST("V0DCAV0ToPVLambda"), v0.dcav0topv()); - if (v0.v0cosPA() > 0.999 && v0.dcaV0daughters() < 1 && TMath::Abs(v0.mK0Short() - o2::analysis::pdg::MassK0Short) > 0.012 && TMath::Abs(v0.mAntiLambda() - o2::analysis::pdg::MassLambda0) > 0.08 && TMath::Abs(v0.mLambda() - o2::analysis::pdg::MassLambda0) < 0.002) { + if (v0.v0cosPA() > 0.999 && v0.dcaV0daughters() < 1 && TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) > 0.012 && TMath::Abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) > 0.08 && TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < 0.002) { histos_V0.fill(HIST("ResponsePionFromLambda"), v0.pt(), negdau.tpcNSigmaPi()); histos_V0.fill(HIST("ResponseProtonFromLambda"), v0.pt(), posdau.tpcNSigmaPr()); } @@ -487,8 +487,8 @@ struct v0cascadesQA { lPDG = v0mcparticle.pdgCode(); } - float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0; - float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short; + float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; if (v0.v0cosPA() > V0_cosPA && v0.v0radius() > V0_radius && @@ -588,12 +588,12 @@ struct v0cascadesQA { histos_Casc.fill(HIST("CascDecayLengthOmega"), cascDecayLength, casc.sign()); float cascTotalMomentum = RecoDecay::sqrtSumOfSquares(casc.px(), casc.py(), casc.pz()); - float CtauXi = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::analysis::pdg::MassXi0; // see O2Physics/Common/Core/MC.h for codes and names accepted - float CtauOmega = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::analysis::pdg::MassOmegaMinus; + float CtauXi = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::constants::physics::MassXi0; // see O2Physics/Common/Core/MC.h for codes and names accepted + float CtauOmega = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::constants::physics::MassOmegaMinus; float v0TotalMomentum = RecoDecay::sqrtSumOfSquares(casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()); float v0DecayLength = std::sqrt(std::pow(casc.xlambda() - casc.x(), 2) + std::pow(casc.ylambda() - casc.y(), 2) + std::pow(casc.zlambda() - casc.z(), 2)); - float CtauV0 = v0DecayLength / (v0TotalMomentum + 1E-10) * o2::analysis::pdg::MassLambda0; + float CtauV0 = v0DecayLength / (v0TotalMomentum + 1E-10) * o2::constants::physics::MassLambda0; histos_Casc.fill(HIST("CascCtauXi"), CtauXi, casc.sign()); histos_Casc.fill(HIST("CascCtauOmega"), CtauOmega, casc.sign()); diff --git a/PWGLF/Tasks/f0980analysis.cxx b/PWGLF/Tasks/f0980analysis.cxx index 080d18fa4bf..2eeacf9aebf 100644 --- a/PWGLF/Tasks/f0980analysis.cxx +++ b/PWGLF/Tasks/f0980analysis.cxx @@ -183,7 +183,7 @@ struct f0980analysis { LHphi = trk.phi(); } } - histos.fill(HIST("QA/LTpt"), LHpt, collision.multV0M(), LHphi); + histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi); TLorentzVector Pion1, Pion2, Reco; for (auto& [trk1, trk2] : @@ -211,7 +211,7 @@ struct f0980analysis { if (trk1.sign() * trk2.sign() < 0) { histos.fill(HIST("hInvMass_f0980_US"), Reco.M(), Reco.Pt(), - collision.multV0M(), RTIndex(Reco.Phi(), LHphi), LHpt); + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); if constexpr (IsMC) { if (abs(trk1.pdgCode()) != 211 || abs(trk2.pdgCode()) != 211) continue; @@ -220,14 +220,14 @@ struct f0980analysis { if (abs(trk1.motherPDG()) != 9010221) continue; histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(), - collision.multV0M()); + collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { histos.fill(HIST("hInvMass_f0980_LSpp"), Reco.M(), Reco.Pt(), - collision.multV0M(), RTIndex(Reco.Phi(), LHphi), LHpt); + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); } else if (trk1.sign() < 0 && trk2.sign() < 0) { histos.fill(HIST("hInvMass_f0980_LSmm"), Reco.M(), Reco.Pt(), - collision.multV0M(), RTIndex(Reco.Phi(), LHphi), LHpt); + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); } } } diff --git a/PWGLF/Tasks/helium_flow.cxx b/PWGLF/Tasks/helium_flow.cxx new file mode 100644 index 00000000000..cc791f7fb2f --- /dev/null +++ b/PWGLF/Tasks/helium_flow.cxx @@ -0,0 +1,230 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \author Alberto Caliva (alberto.caliva@cern.ch) +/// \since November 27, 2023 + +#include +#include +#include +#include +#include +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/DataTypes.h" +#include "ReconstructionDataFormats/Track.h" +#include "ReconstructionDataFormats/PID.h" +#include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponse.h" + +using namespace std; +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using std::array; + +using SelectedCollisions = soa::Join; + +using FullTracks = soa::Join; + +using MCTracks = soa::Join; + +struct helium_flow { + + // QC Histograms + HistogramRegistry registryQC{ + "registryQC", + {}, + OutputObjHandlingPolicy::AnalysisObject, + true, + true}; + + // Analysis Histograms: Data + HistogramRegistry registryData{ + "registryData", + {}, + OutputObjHandlingPolicy::AnalysisObject, + true, + true}; + + // Analysis Histograms: MC + HistogramRegistry registryMC{ + "registryMC", + {}, + OutputObjHandlingPolicy::AnalysisObject, + true, + true}; + + // Global Parameters + Configurable particle_of_interest{"particle_of_interest", 0, "0=antihelium3, 1=antitriton, 2=antihelium4"}; + + // Track Parameters + Configurable min_ITS_nClusters{"min_ITS_nClusters", 4, "minimum number of found ITS clusters"}; + Configurable min_TPC_nClusters{"min_TPC_nClusters", 80, "minimum number of found TPC clusters"}; + Configurable min_TPC_nCrossedRows{"min_TPC_nCrossedRows", 80, "minimum number of TPC crossed pad rows"}; + Configurable max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"}; + Configurable max_chi2_ITS{"max_chi2_ITS", 36.0f, "maximum ITS chi^2/Ncls"}; + Configurable min_pt{"min_pt", 1.0f, "minimum pt of the tracks"}; + Configurable min_eta{"min_eta", -0.8f, "minimum_eta"}; + Configurable max_eta{"max_eta", +0.8f, "maximum_eta"}; + Configurable max_dcaxy{"max_dcaxy", 0.1f, "Maximum DCAxy"}; + Configurable max_dcaz{"max_dcaz", 0.1f, "Maximum DCAz"}; + Configurable min_nsigmaTPC{"min_nsigmaTPC", -3.0f, "Minimum nsigma TPC"}; + Configurable max_nsigmaTPC{"max_nsigmaTPC", +3.0f, "Maximum nsigma TPC"}; + Configurable require_primVtx_contributor{"require_primVtx_contributor", true, "require that the track is a PV contributor"}; + + // List of Particles + enum particle { antihelium3, + antitriton, + antihelium4 }; + + void init(InitContext const&) + { + // Global Properties + registryQC.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{4, 0, 4, "1 = all, 2 = selected, 3 = events with particle of interest"}}); + } + + // Single-Track Selection for the Particle of Interest + template + bool passedTrackSelection(const T1& track) + { + if (!track.hasITS()) + return false; + if (track.itsNCls() < min_ITS_nClusters) + return false; + if (!track.hasTPC()) + return false; + if (track.tpcNClsFound() < min_TPC_nClusters) + return false; + if (track.tpcNClsCrossedRows() < min_TPC_nCrossedRows) + return false; + if (track.tpcChi2NCl() > max_chi2_TPC) + return false; + if (track.itsChi2NCl() > max_chi2_ITS) + return false; + if (track.eta() < min_eta || track.eta() > max_eta) + return false; + if (track.pt() < min_pt) + return false; + if (TMath::Abs(track.dcaXY()) > max_dcaxy) + return false; + if (TMath::Abs(track.dcaZ()) > max_dcaz) + return false; + + return true; + } + + template + bool isParticleOfInterest(const T2& track) + { + // Variables + float nsigmaTPCHe3 = track.tpcNSigmaHe(); + float nsigmaTPCH3 = track.tpcNSigmaTr(); + float nsigmaTOFH3 = track.tofNSigmaTr(); + float nsigmaTPCHe4 = track.tpcNSigmaAl(); + float pt = track.pt(); + + // Antimatter Only + if (track.sign() > 0) + return false; + + // Antihelium3 ID + if (particle_of_interest == particle::antihelium3) { + if (pt >= 1.0 && TMath::Abs(nsigmaTPCHe3) < 8.0) + return true; + return false; + } + + // Antitriton ID + if (particle_of_interest == particle::antitriton) { + if (pt >= 1.0 && pt < 2.0 && TMath::Abs(nsigmaTPCH3) < 8.0) + return true; + if (pt >= 2.0 && pt < 4.0 && track.hasTOF() && nsigmaTPCH3 > min_nsigmaTPC && nsigmaTPCH3 < max_nsigmaTPC && TMath::Abs(nsigmaTOFH3) < 8.0) + return true; + return false; + } + + // Antihelium4 ID + if (particle_of_interest == particle::antihelium4) { + if (pt >= 1.0 && TMath::Abs(nsigmaTPCHe4) < 8.0) + return true; + return false; + } + return false; + } + + // Process Data + void processData(SelectedCollisions::iterator const& collision, FullTracks const& tracks) + { + // Event Counter (before event selection) + registryQC.fill(HIST("number_of_events_data"), 0.5); + + // Event Selection + if (!collision.sel8()) + return; + + // Event Counter (after event selection) + registryQC.fill(HIST("number_of_events_data"), 1.5); + + // Reduced Event + std::vector particle_ID; + bool containsParticleOfInterest(false); + + // Loop over Reconstructed Tracks + for (auto track : tracks) { + + // Track Selection + if (!passedTrackSelection(track)) + continue; + if (!track.passedITSRefit()) + continue; + if (!track.passedTPCRefit()) + continue; + + // Track Index + int i = track.globalIndex(); + + // Trigger: Particle of Interest + if (isParticleOfInterest(track)) + containsParticleOfInterest = true; + + // Store Array Element + particle_ID.push_back(i); + } + + // Skip Events with no Particle of Interest + if (!containsParticleOfInterest) + return; + + // Event Counter (events with particle of interest) + registryQC.fill(HIST("number_of_events_data"), 3.5); + + } // end processData + PROCESS_SWITCH(helium_flow, processData, "Process data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/hyperon-reco-test.cxx b/PWGLF/Tasks/hyperon-reco-test.cxx index e866c194486..d1abec75651 100644 --- a/PWGLF/Tasks/hyperon-reco-test.cxx +++ b/PWGLF/Tasks/hyperon-reco-test.cxx @@ -21,7 +21,7 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -101,7 +101,7 @@ struct myLambda { TMath::Abs(posdau.eta()) < rapidity && TMath::Abs(negdau.eta()) < rapidity && posdau.tpcNClsCrossedRows() > tpcNcl && negdau.tpcNClsCrossedRows() > tpcNcl && TMath::Abs(posdau.tpcNSigmaPr()) < tpcsigma && TMath::Abs(negdau.tpcNSigmaPi()) < tpcsigma && // V0 cuts - v0.pt() > minpt && v0.v0radius() > v0radius && v0.v0cosPA() > v0cospa && TMath::Abs(v0.mK0Short() - o2::analysis::pdg::MassK0Short) > removeKs) { + v0.pt() > minpt && v0.v0radius() > v0radius && v0.v0cosPA() > v0cospa && TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) > removeKs) { registry.fill(HIST("hReduction"), 1.5); registry.fill(HIST("hmyLambda_after"), v0.mLambda(), v0.pt()); registry.fill(HIST("hmyLambda_after_b"), v0.mLambda()); @@ -190,10 +190,10 @@ struct myXi { casc.v0radius() > v0radius && casc.dcaV0daughters() < dcav0dau && v0.dcav0topv() > dcav0topv && casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa) { registry.fill(HIST("hmyLambda"), v0.mLambda()); - if (TMath::Abs(v0.mLambda() - o2::analysis::pdg::MassLambda0) < v0masswindow && + if (TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < v0masswindow && // Cascade cut - casc.cascradius() > cascradius && casc.dcacascdaughters() < dcacascdau && casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa && TMath::Abs(casc.mOmega() - o2::analysis::pdg::MassOmegaMinus) > removeOmega && casc.sign() < 0) { + casc.cascradius() > cascradius && casc.dcacascdaughters() < dcacascdau && casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa && TMath::Abs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > removeOmega && casc.sign() < 0) { registry.fill(HIST("hReduction"), 1.5); registry.fill(HIST("hmyXi_after"), casc.mXi(), casc.pt()); registry.fill(HIST("hmyXi_after_b"), casc.mXi()); @@ -288,10 +288,10 @@ struct myOmega { casc.v0radius() > v0radius && casc.dcaV0daughters() < dcav0dau && v0.dcav0topv() > dcav0topv && casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa) { registry.fill(HIST("hmyLambda"), v0.mLambda()); - if (TMath::Abs(v0.mLambda() - o2::analysis::pdg::MassLambda0) < v0masswindow && + if (TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < v0masswindow && // Cascade cut - casc.cascradius() > cascradius && casc.dcacascdaughters() < dcacascdau && casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa && TMath::Abs(casc.mXi() - o2::analysis::pdg::MassXiMinus) > removeXi && casc.sign() < 0) { + casc.cascradius() > cascradius && casc.dcacascdaughters() < dcacascdau && casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa && TMath::Abs(casc.mXi() - o2::constants::physics::MassXiMinus) > removeXi && casc.sign() < 0) { registry.fill(HIST("hReduction"), 1.5); registry.fill(HIST("hmyOmega_after"), casc.mOmega(), casc.pt()); registry.fill(HIST("hmyOmega_after_b"), casc.mOmega()); diff --git a/PWGLF/Tasks/hypertriton3bodyMCQA.cxx b/PWGLF/Tasks/hypertriton3bodyMCQA.cxx index 49f056fe9e2..4c1b0884a53 100644 --- a/PWGLF/Tasks/hypertriton3bodyMCQA.cxx +++ b/PWGLF/Tasks/hypertriton3bodyMCQA.cxx @@ -44,8 +44,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -// using MyTracks = soa::Join; -using MyTracks = soa::Join; +using MyTracks = soa::Join; template bool is3bodyDecayedH3L(TMCParticle const& particle) @@ -77,6 +76,27 @@ bool is3bodyDecayedH3L(TMCParticle const& particle) return false; } +/* template + bool is3bodyDecayedH3L(TMCParticle const& mctrack0, TMCParticle const& mctrack1, TMCParticle const& mctrack2) + { + bool flag = false; + for (auto& particleMother : mctrack0.mothers_as()) { + if (particleMother.pdgCode() != 1010010030 && particleMother.pdgCode() != -1010010030) { + continue; + } + bool flag1 = false, flag2 = false; + for (auto& mcparticleDaughter : particle.template daughters_as()) { + if(mcparticleDaughter.globalIndex() == mctrack1.globalIndex()) + flag1 = true; + if(mcparticleDaughter.globalIndex() == mctrack2.globalIndex()) + flag2 = true; + } + if (flag1 && flag2) + flag = true; + } + return flag; + }*/ + struct hypertriton3bodyQaMc { // Basic checks HistogramRegistry registry{ @@ -123,15 +143,40 @@ struct hypertriton3bodyQaMc { struct hypertriton3bodyAnalysisMc { + // Selection criteria + Configurable vtxcospa{"vtxcospa", 0.9, "Vtx CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) + Configurable dcavtxdau{"dcavtxdau", 1.0, "DCA Vtx Daughters"}; // loose cut + Configurable dcapiontopv{"dcapiontopv", .00, "DCA Pion To PV"}; + Configurable etacut{"etacut", 1, "etacut"}; + Configurable rapidity{"rapidity", 1, "rapidity"}; + Configurable TofPidNsigmaMin{"TofPidNsigmaMin", -4, "TofPidNsigmaMin"}; + Configurable TofPidNsigmaMax{"TofPidNsigmaMax", 8, "TofPidNsigmaMax"}; + Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; + Configurable eventSelection{"eventSelection", true, "event selection"}; + Configurable lifetimecut{"lifetimecut", 40., "lifetimecut"}; + Configurable minProtonPt{"minProtonPt", 0.3, "minProtonPt"}; + Configurable maxProtonPt{"maxProtonPt", 5, "maxProtonPt"}; + Configurable minPionPt{"minPionPt", 0.1, "minPionPt"}; + Configurable maxPionPt{"maxPionPt", 1.2, "maxPionPt"}; + Configurable minDeuteronPt{"minDeuteronPt", 0.6, "minDeuteronPt"}; + Configurable maxDeuteronPt{"maxDeuteronPt", 10, "maxDeuteronPt"}; + Configurable minDeuteronPUseTOF{"minDeuteronPUseTOF", 1, "minDeuteronPt Enable TOF PID"}; + Configurable h3LMassLowerlimit{"h3LMassLowerlimit", 2.96, "Hypertriton mass lower limit"}; + Configurable h3LMassUpperlimit{"h3LMassUpperlimit", 3.04, "Hypertriton mass upper limit"}; + Configurable mincrossedrowsproton{"mincrossedrowsproton", 90, "min tpc crossed rows for pion"}; + Configurable mincrossedrowspion{"mincrossedrowspion", 70, "min tpc crossed rows"}; + Configurable mincrossedrowsdeuteron{"mincrossedrowsdeuteron", 100, "min tpc crossed rows for deuteron"}; + Configurable mcsigma{"mcsigma", 0.0015, "sigma of mc invariant mass fit"}; // obtained from MC + HistogramRegistry registry{ "registry", { - {"hSelectedEventCounter", "hSelectedEventCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}, - {"hSelectedCandidatesCounter", "hSelectedCandidatesCounter", {HistType::kTH1F, {{9, 0.0f, 9.0f}}}}, - {"hSelectedTrueHypertritonCounter", "hSelectedTrueHypertritonCounter", {HistType::kTH1F, {{9, 0.0f, 9.0f}}}}, + {"hSelectedEventCounter", "hSelectedEventCounter", {HistType::kTH1F, {{3, 0.0f, 3.0f}}}}, + {"hSelectedCandidatesCounter", "hSelectedCandidatesCounter", {HistType::kTH1F, {{11, 0.0f, 11.0f}}}}, + {"hSelectedTrueHypertritonCounter", "hSelectedTrueHypertritonCounter", {HistType::kTH1F, {{11, 0.0f, 11.0f}}}}, {"hTestCounter", "hTestCounter", {HistType::kTH1F, {{9, 0.0f, 9.0f}}}}, - {"hMassHypertriton", "hMassHypertriton", {HistType::kTH1F, {{100, 2.95f, 3.05f}}}}, - {"hMassAntiHypertriton", "hMassAntiHypertriton", {HistType::kTH1F, {{100, 2.95f, 3.05f}}}}, + {"hMassHypertriton", "hMassHypertriton", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, + {"hMassAntiHypertriton", "hMassAntiHypertriton", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, {"hMassHypertritonTotal", "hMassHypertritonTotal", {HistType::kTH1F, {{300, 2.9f, 3.2f}}}}, {"hPtProton", "hPtProton", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, {"hPtAntiPion", "hPtAntiPion", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, @@ -139,65 +184,78 @@ struct hypertriton3bodyAnalysisMc { {"hPtAntiProton", "hPtAntiProton", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, {"hPtPion", "hPtPion", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, {"hPtAntiDeuteron", "hPtAntiDeuteron", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, - {"h3dMassHypertriton", "h3dMassHypertriton", {HistType::kTH3F, {{20, 0.0f, 100.0f, "Cent (%)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {40, 2.95f, 3.05f, "Inv. Mass (GeV/c^{2})"}}}}, - {"h3dMassAntiHypertriton", "h3dMassAntiHypertriton", {HistType::kTH3F, {{20, 0.0f, 100.0f, "Cent (%)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {40, 2.95f, 3.05f, "Inv. Mass (GeV/c^{2})"}}}}, - {"h3dTotalHypertriton", "h3dTotalHypertriton", {HistType::kTH3F, {{50, 0, 50, "ct(cm)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {40, 2.95f, 3.05f, "Inv. Mass (GeV/c^{2})"}}}}, - {"h3dTotalTrueHypertriton", "h3dTotalTrueHypertriton", {HistType::kTH3F, {{50, 0, 50, "ct(cm)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {40, 2.95f, 3.05f, "Inv. Mass (GeV/c^{2})"}}}}, + {"hDCAProtonToPV", "hDCAProtonToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, + {"hDCAPionToPV", "hDCAPionToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, + {"hDCADeuteronToPV", "hDCADeuteronToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, + {"hProtonTPCNcls", "hProtonTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hPionTPCNcls", "hPionTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hDeuteronTPCNcls", "hDeuteronTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hVtxCosPA", "hVtxCosPA", {HistType::kTH1F, {{1000, 0.9f, 1.0f}}}}, + {"hDCAVtxDau", "hDCAVtxDau", {HistType::kTH1F, {{1000, 0.0f, 10.0f, "cm^{2}"}}}}, + {"hTOFPIDDeuteron", "hTOFPIDDeuteron", {HistType::kTH1F, {{2000, -100.0f, 100.0f}}}}, + {"hTPCPIDProton", "hTPCPIDProton", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, + {"hTPCPIDPion", "hTPCPIDPion", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, + {"hTPCPIDDeuteron", "hTPCPIDDeuteron", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, + {"hProtonTPCBB", "hProtonTPCBB", {HistType::kTH2F, {{160, -8.0f, 8.0f, "p/z(GeV/c)"}, {200, 0.0f, 1000.0f, "TPCSignal"}}}}, + {"hPionTPCBB", "hPionTPCBB", {HistType::kTH2F, {{160, -8.0f, 8.0f, "p/z(GeV/c)"}, {200, 0.0f, 1000.0f, "TPCSignal"}}}}, + {"hDeuteronTPCBB", "hDeuteronTPCBB", {HistType::kTH2F, {{160, -8.0f, 8.0f, "p/z(GeV/c)"}, {200, 0.0f, 1000.0f, "TPCSignal"}}}}, + {"hProtonTPCVsPt", "hProtonTPCVsPt", {HistType::kTH2F, {{50, 0.0f, 5.0f, "#it{p}_{T} (GeV/c)"}, {240, -6.0f, 6.0f, "TPC n#sigma"}}}}, + {"hPionTPCVsPt", "hPionTPCVsPt", {HistType::kTH2F, {{20, 0.0f, 2.0f, "#it{p}_{T} (GeV/c)"}, {240, -6.0f, 6.0f, "TPC n#sigma"}}}}, + {"hDeuteronTPCVsPt", "hDeuteronTPCVsPt", {HistType::kTH2F, {{80, 0.0f, 8.0f, "#it{p}_{T} (GeV/c)"}, {240, -6.0f, 6.0f, "TPC n#sigma"}}}}, + + {"hDalitz", "hDalitz", {HistType::kTH2F, {{120, 7.85, 8.45, "M^{2}(dp) (GeV^{2}/c^{4})"}, {60, 1.1, 1.4, "M^{2}(p#pi) (GeV^{2}/c^{4})"}}}}, + {"h3dMassHypertriton", "h3dMassHypertriton", {HistType::kTH3F, {{20, 0.0f, 100.0f, "Cent (%)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {80, 2.96f, 3.04f, "Inv. Mass (GeV/c^{2})"}}}}, + {"h3dMassAntiHypertriton", "h3dMassAntiHypertriton", {HistType::kTH3F, {{20, 0.0f, 100.0f, "Cent (%)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {80, 2.96f, 3.04f, "Inv. Mass (GeV/c^{2})"}}}}, + {"h3dTotalHypertriton", "h3dTotalHypertriton", {HistType::kTH3F, {{50, 0, 50, "ct(cm)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {80, 2.96f, 3.04f, "Inv. Mass (GeV/c^{2})"}}}}, + {"h3dTotalTrueHypertriton", "h3dTotalTrueHypertriton", {HistType::kTH3F, {{50, 0, 50, "ct(cm)"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {80, 2.96f, 3.04f, "Inv. Mass (GeV/c^{2})"}}}}, }, }; - Configurable saveDcaHist{"saveDcaHist", 0, "saveDcaHist"}; + //------------------------------------------------------------------ + // Fill stats histograms + enum vtxstep { kCandAll = 0, + kCandCosPA, + kCandDauEta, + kCandRapidity, + kCandct, + kCandDcaDau, + kCandTOFPID, + kCandTPCPID, + kCandTPCNcls, + kCandDauPt, + kCandDcaToPV, + kNVtxSteps }; + Configurable saveDcaHist{"saveDcaHist", 0, "saveDcaHist"}; ConfigurableAxis dcaBinning{"dca-binning", {200, 0.0f, 1.0f}, ""}; ConfigurableAxis ptBinning{"pt-binning", {200, 0.0f, 10.0f}, ""}; + void FillCandCounter(int kn, bool istrue = false) + { + registry.fill(HIST("hSelectedCandidatesCounter"), kn); + if (istrue) { + registry.fill(HIST("hSelectedTrueHypertritonCounter"), kn); + } + } + void init(InitContext const&) { AxisSpec dcaAxis = {dcaBinning, "DCA (cm)"}; AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/c)"}; - AxisSpec massAxisHypertriton = {40, 2.95f, 3.05f, "Inv. Mass (GeV/c^{2})"}; + AxisSpec massAxisHypertriton = {80, 2.96f, 3.04f, "Inv. Mass (GeV/c^{2})"}; if (saveDcaHist == 1) { registry.add("h3dMassHypertritonDca", "h3dMassHypertritonDca", {HistType::kTH3F, {dcaAxis, ptAxis, massAxisHypertriton}}); registry.add("h3dMassAntiHypertritonDca", "h3dMassAntiHypertritonDca", {HistType::kTH3F, {dcaAxis, ptAxis, massAxisHypertriton}}); } - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(1, "Readin"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(2, "VtxCosPA"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(3, "TrackEta"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(4, "MomRapidity"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(5, "Lifetime"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(6, "DcaV0Dau"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(7, "TPCPID"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(8, "PtCut"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(9, "PionDcatoPV"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(1, "Readin"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(2, "VtxCosPA"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(3, "TrackEta"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(4, "MomRapidity"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(5, "Lifetime"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(6, "DcaV0Dau"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(7, "TPCPID"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(8, "PtCut"); - registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(9, "PionDcatoPV"); + TString CandCounterbinLabel[11] = {"Total", "VtxCosPA", "TrackEta", "MomRapidity", "Lifetime", "DcaV0Dau", "d TOFPID", "TPCPID&Mass", "TPCNcls", "DauPt", "PionDcatoPV"}; + for (int i{0}; i < kNVtxSteps; i++) { + registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + registry.get(HIST("hSelectedTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + } } - // Selection criteria - Configurable vtxcospa{"vtxcospa", 0.9, "Vtx CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable dcavtxdau{"dcavtxdau", 1.0, "DCA Vtx Daughters"}; // loose cut - Configurable dcapiontopv{"dcapiontopv", .00, "DCA Pion To PV"}; - Configurable etacut{"etacut", 1, "etacut"}; - Configurable rapidity{"rapidity", 1, "rapidity"}; - Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; - Configurable eventSelection{"eventSelection", true, "event selection"}; - Configurable lifetimecut{"lifetimecut", 40., "lifetimecut"}; - Configurable minProtonPt{"minProtonPt", 0.3, "minProtonPt"}; - Configurable maxProtonPt{"maxProtonPt", 5, "maxProtonPt"}; - Configurable minPionPt{"minPionPt", 0.1, "minPionPt"}; - Configurable maxPionPt{"maxPionPt", 1.2, "maxPionPt"}; - Configurable minDeuteronPt{"minDeuteronPt", 0.6, "minDeuteronPt"}; - Configurable maxDeuteronPt{"maxDeuteronPt", 10, "maxDeuteronPt"}; - void process(soa::Join::iterator const& collision, aod::Vtx3BodyDatas const& vtx3bodydatas, MyTracks const& tracks, aod::McParticles const& particlesMC) { registry.fill(HIST("hSelectedEventCounter"), 0.5); @@ -206,6 +264,8 @@ struct hypertriton3bodyAnalysisMc { } registry.fill(HIST("hSelectedEventCounter"), 1.5); + bool if_hasvtx = false; + for (auto& vtx : vtx3bodydatas) { // couldn't filter cosPA and radius variables (dynamic columns) @@ -214,13 +274,13 @@ struct hypertriton3bodyAnalysisMc { float lPt = -1; double MClifetime = -1; bool isFromHypertriton = false; - auto lTrack0 = vtx.track0_as(); - auto lTrack1 = vtx.track1_as(); - auto lTrack2 = vtx.track2_as(); - if (lTrack0.has_mcParticle() && lTrack1.has_mcParticle() && lTrack2.has_mcParticle()) { - auto lMCTrack0 = lTrack0.mcParticle_as(); - auto lMCTrack1 = lTrack1.mcParticle_as(); - auto lMCTrack2 = lTrack2.mcParticle_as(); + auto track0 = vtx.track0_as(); + auto track1 = vtx.track1_as(); + auto track2 = vtx.track2_as(); + if (track0.has_mcParticle() && track1.has_mcParticle() && track2.has_mcParticle()) { + auto lMCTrack0 = track0.mcParticle_as(); + auto lMCTrack1 = track1.mcParticle_as(); + auto lMCTrack2 = track2.mcParticle_as(); if (lMCTrack0.has_mothers() && lMCTrack1.has_mothers() && lMCTrack2.has_mothers()) { for (auto& lMother0 : lMCTrack0.mothers_as()) { for (auto& lMother1 : lMCTrack1.mothers_as()) { @@ -241,157 +301,176 @@ struct hypertriton3bodyAnalysisMc { } } - registry.fill(HIST("hSelectedCandidatesCounter"), 0.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 0.5); - } + FillCandCounter(kCandAll, isFromHypertriton); if (vtx.vtxcosPA(collision.posX(), collision.posY(), collision.posZ()) < vtxcospa) { continue; } - registry.fill(HIST("hSelectedCandidatesCounter"), 1.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 1.5); - } + FillCandCounter(kCandCosPA, isFromHypertriton); if (TMath::Abs(vtx.track0_as().eta()) > etacut || TMath::Abs(vtx.track1_as().eta()) > etacut || TMath::Abs(vtx.track2_as().eta()) > etacut) { continue; } - registry.fill(HIST("hSelectedCandidatesCounter"), 2.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 2.5); - } + FillCandCounter(kCandDauEta, isFromHypertriton); if (TMath::Abs(vtx.yHypertriton()) > rapidity) { continue; } - registry.fill(HIST("hSelectedCandidatesCounter"), 3.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 3.5); - } + FillCandCounter(kCandRapidity, isFromHypertriton); double ct = vtx.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassHyperTriton; if (ct > lifetimecut) { continue; } - registry.fill(HIST("hSelectedCandidatesCounter"), 4.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 4.5); - } + FillCandCounter(kCandct, isFromHypertriton); if (vtx.dcaVtxdaughters() > dcavtxdau) { continue; } - registry.fill(HIST("hSelectedCandidatesCounter"), 5.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 5.5); + FillCandCounter(kCandDcaDau, isFromHypertriton); + if ((track2.tofNSigmaDe() < TofPidNsigmaMin || track2.tofNSigmaDe() > TofPidNsigmaMax) && track2.p() > minDeuteronPUseTOF) { + continue; } + FillCandCounter(kCandTOFPID, isFromHypertriton); // 3sigma region for Dalitz plot - double mcsigma = 0.0015; // from local MC double lowerlimit = o2::constants::physics::MassHyperTriton - 3 * mcsigma; double upperlimit = o2::constants::physics::MassHyperTriton + 3 * mcsigma; // Hypertriton - if (TMath::Abs(vtx.track0_as().tpcNSigmaPr()) < TpcPidNsigmaCut && TMath::Abs(vtx.track1_as().tpcNSigmaPi()) < TpcPidNsigmaCut && TMath::Abs(vtx.track2_as().tpcNSigmaDe()) < TpcPidNsigmaCut) { - registry.fill(HIST("hSelectedCandidatesCounter"), 6.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 6.5); - } + if (TMath::Abs(vtx.track0_as().tpcNSigmaPr()) < TpcPidNsigmaCut && TMath::Abs(vtx.track1_as().tpcNSigmaPi()) < TpcPidNsigmaCut && TMath::Abs(vtx.track2_as().tpcNSigmaDe()) < TpcPidNsigmaCut && vtx.mHypertriton() > h3LMassLowerlimit && vtx.mHypertriton() < h3LMassUpperlimit) { - registry.fill(HIST("hTestCounter"), 0.5); - if (vtx.track1pt() > minPionPt && vtx.track1pt() < maxPionPt) { - registry.fill(HIST("hTestCounter"), 1.5); - if (vtx.track0pt() > minProtonPt && vtx.track0pt() < maxProtonPt) { - registry.fill(HIST("hTestCounter"), 2.5); - if (vtx.pt() > minDeuteronPt && vtx.pt() < maxDeuteronPt) { - registry.fill(HIST("hTestCounter"), 3.5); - } - } - } + FillCandCounter(kCandTPCPID, isFromHypertriton); - if (vtx.track0pt() > minProtonPt && vtx.track0pt() < maxProtonPt && vtx.track1pt() > minPionPt && vtx.track1pt() < maxPionPt && vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { - registry.fill(HIST("hSelectedCandidatesCounter"), 7.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 7.5); - } + if (track0.tpcNClsCrossedRows() > mincrossedrowsproton && track1.tpcNClsCrossedRows() > mincrossedrowspion && track2.tpcNClsCrossedRows() > mincrossedrowsdeuteron) { - if (TMath::Abs(vtx.dcatrack1topv()) > dcapiontopv) { - registry.fill(HIST("hSelectedCandidatesCounter"), 8.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 8.5); - } + FillCandCounter(kCandTPCNcls, isFromHypertriton); - registry.fill(HIST("hPtProton"), vtx.track0pt()); - registry.fill(HIST("hPtAntiPion"), vtx.track1pt()); - registry.fill(HIST("hPtDeuteron"), vtx.track2pt()); - registry.fill(HIST("hMassHypertriton"), vtx.mHypertriton()); - registry.fill(HIST("hMassHypertritonTotal"), vtx.mHypertriton()); - registry.fill(HIST("h3dMassHypertriton"), 0., vtx.pt(), vtx.mHypertriton()); // collision.centV0M() instead of 0. once available - registry.fill(HIST("h3dTotalHypertriton"), ct, vtx.pt(), vtx.mHypertriton()); - if (vtx.mHypertriton() > lowerlimit && vtx.mHypertriton() < upperlimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}, array{vtx.pxtrack2(), vtx.pytrack2(), vtx.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), - RecoDecay::m2(array{array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}, array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + registry.fill(HIST("hTestCounter"), 0.5); + if (vtx.track1pt() > minPionPt && vtx.track1pt() < maxPionPt) { + registry.fill(HIST("hTestCounter"), 1.5); + if (vtx.track0pt() > minProtonPt && vtx.track0pt() < maxProtonPt) { + registry.fill(HIST("hTestCounter"), 2.5); + if (vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { + registry.fill(HIST("hTestCounter"), 3.5); + } } + } - if (isFromHypertriton) { - registry.fill(HIST("h3dTotalTrueHypertriton"), MClifetime, lPt, vtx.mHypertriton()); - } - if (saveDcaHist == 1) { - registry.fill(HIST("h3dMassHypertritonDca"), vtx.dcaVtxdaughters(), vtx.pt(), vtx.mHypertriton()); + if (vtx.track0pt() > minProtonPt && vtx.track0pt() < maxProtonPt && vtx.track1pt() > minPionPt && vtx.track1pt() < maxPionPt && vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { + FillCandCounter(kCandDauPt, isFromHypertriton); + + if (TMath::Abs(vtx.dcatrack1topv()) > dcapiontopv) { + if_hasvtx = true; + FillCandCounter(kCandDcaToPV, isFromHypertriton); + + registry.fill(HIST("hVtxCosPA"), vtx.vtxcosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAVtxDau"), vtx.dcaVtxdaughters()); + registry.fill(HIST("hPtProton"), vtx.track0pt()); + registry.fill(HIST("hPtAntiPion"), vtx.track1pt()); + registry.fill(HIST("hPtDeuteron"), vtx.track2pt()); + registry.fill(HIST("hDCAProtonToPV"), vtx.dcatrack0topv()); + registry.fill(HIST("hDCAPionToPV"), vtx.dcatrack1topv()); + registry.fill(HIST("hDCADeuteronToPV"), vtx.dcatrack2topv()); + registry.fill(HIST("hProtonTPCNcls"), track0.tpcNClsCrossedRows()); + registry.fill(HIST("hPionTPCNcls"), track1.tpcNClsCrossedRows()); + registry.fill(HIST("hDeuteronTPCNcls"), track2.tpcNClsCrossedRows()); + registry.fill(HIST("hTOFPIDDeuteron"), track2.tofNSigmaDe()); + registry.fill(HIST("hTPCPIDProton"), track0.tpcNSigmaPr()); + registry.fill(HIST("hTPCPIDPion"), track1.tpcNSigmaPi()); + registry.fill(HIST("hTPCPIDDeuteron"), track2.tpcNSigmaDe()); + registry.fill(HIST("hProtonTPCBB"), track0.p(), track0.tpcSignal()); + registry.fill(HIST("hPionTPCBB"), -track1.p(), track1.tpcSignal()); + registry.fill(HIST("hDeuteronTPCBB"), track2.p(), track0.tpcSignal()); + registry.fill(HIST("hProtonTPCVsPt"), vtx.track0pt(), track0.tpcNSigmaPr()); + registry.fill(HIST("hPionTPCVsPt"), vtx.track1pt(), track1.tpcNSigmaPi()); + registry.fill(HIST("hDeuteronTPCVsPt"), vtx.track2pt(), track2.tpcNSigmaDe()); + registry.fill(HIST("hMassHypertriton"), vtx.mHypertriton()); + registry.fill(HIST("hMassHypertritonTotal"), vtx.mHypertriton()); + registry.fill(HIST("h3dMassHypertriton"), 0., vtx.pt(), vtx.mHypertriton()); // collision.centV0M() instead of 0. once available + registry.fill(HIST("h3dTotalHypertriton"), ct, vtx.pt(), vtx.mHypertriton()); + if (vtx.mHypertriton() > lowerlimit && vtx.mHypertriton() < upperlimit) { + registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}, array{vtx.pxtrack2(), vtx.pytrack2(), vtx.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), + RecoDecay::m2(array{array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}, array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + } + + if (isFromHypertriton) { + registry.fill(HIST("h3dTotalTrueHypertriton"), MClifetime, lPt, vtx.mHypertriton()); + } + if (saveDcaHist == 1) { + registry.fill(HIST("h3dMassHypertritonDca"), vtx.dcaVtxdaughters(), vtx.pt(), vtx.mHypertriton()); + } } } } } // AntiHypertriton - if (TMath::Abs(vtx.track0_as().tpcNSigmaPi()) < TpcPidNsigmaCut && TMath::Abs(vtx.track1_as().tpcNSigmaPr()) < TpcPidNsigmaCut && TMath::Abs(vtx.track2_as().tpcNSigmaDe()) < TpcPidNsigmaCut) { + if (TMath::Abs(vtx.track0_as().tpcNSigmaPi()) < TpcPidNsigmaCut && TMath::Abs(vtx.track1_as().tpcNSigmaPr()) < TpcPidNsigmaCut && TMath::Abs(vtx.track2_as().tpcNSigmaDe()) < TpcPidNsigmaCut && vtx.mAntiHypertriton() > h3LMassLowerlimit && vtx.mAntiHypertriton() < h3LMassUpperlimit) { + FillCandCounter(kCandTPCPID, isFromHypertriton); - registry.fill(HIST("hSelectedCandidatesCounter"), 6.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 6.5); - } + if (track0.tpcNClsCrossedRows() > mincrossedrowspion && track1.tpcNClsCrossedRows() > mincrossedrowsproton && track2.tpcNClsCrossedRows() > mincrossedrowsdeuteron) { - registry.fill(HIST("hTestCounter"), 0.5); - if (vtx.track0pt() > minPionPt && vtx.track0pt() < maxPionPt) { - registry.fill(HIST("hTestCounter"), 1.5); - if (vtx.track1pt() > minProtonPt && vtx.track1pt() < maxProtonPt) { - registry.fill(HIST("hTestCounter"), 2.5); - if (vtx.pt() > minDeuteronPt && vtx.pt() < maxDeuteronPt) { - registry.fill(HIST("hTestCounter"), 3.5); - } - } - } + FillCandCounter(kCandTPCNcls, isFromHypertriton); - if (vtx.track1pt() > minPionPt && vtx.track1pt() < maxPionPt && vtx.track0pt() > minProtonPt && vtx.track0pt() < maxProtonPt && vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { - registry.fill(HIST("hSelectedCandidatesCounter"), 7.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 7.5); - } - if (TMath::Abs(vtx.dcatrack0topv()) > dcapiontopv) { - registry.fill(HIST("hSelectedCandidatesCounter"), 8.5); - if (isFromHypertriton) { - registry.fill(HIST("hSelectedTrueHypertritonCounter"), 8.5); + registry.fill(HIST("hTestCounter"), 0.5); + if (vtx.track0pt() > minPionPt && vtx.track0pt() < maxPionPt) { + registry.fill(HIST("hTestCounter"), 1.5); + if (vtx.track1pt() > minProtonPt && vtx.track1pt() < maxProtonPt) { + registry.fill(HIST("hTestCounter"), 2.5); + if (vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { + registry.fill(HIST("hTestCounter"), 3.5); + } } + } - registry.fill(HIST("hPtAntiProton"), vtx.track1pt()); - registry.fill(HIST("hPtPion"), vtx.track0pt()); - registry.fill(HIST("hPtAntiDeuteron"), vtx.track2pt()); - registry.fill(HIST("hMassAntiHypertriton"), vtx.mAntiHypertriton()); - registry.fill(HIST("hMassHypertritonTotal"), vtx.mAntiHypertriton()); - registry.fill(HIST("h3dMassAntiHypertriton"), 0., vtx.pt(), vtx.mAntiHypertriton()); // collision.centV0M() instead of 0. once available - registry.fill(HIST("h3dTotalHypertriton"), ct, vtx.pt(), vtx.mAntiHypertriton()); - if (vtx.mAntiHypertriton() > lowerlimit && vtx.mAntiHypertriton() < upperlimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}, array{vtx.pxtrack2(), vtx.pytrack2(), vtx.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), - RecoDecay::m2(array{array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}, array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); - } + if (vtx.track0pt() > minPionPt && vtx.track0pt() < maxPionPt && vtx.track1pt() > minProtonPt && vtx.track1pt() < maxProtonPt && vtx.track2pt() > minDeuteronPt && vtx.track2pt() < maxDeuteronPt) { + FillCandCounter(kCandDauPt, isFromHypertriton); + + if (TMath::Abs(vtx.dcatrack0topv()) > dcapiontopv) { + if_hasvtx = true; + FillCandCounter(kCandDcaToPV, isFromHypertriton); + + registry.fill(HIST("hVtxCosPA"), vtx.vtxcosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAVtxDau"), vtx.dcaVtxdaughters()); + registry.fill(HIST("hPtAntiProton"), vtx.track1pt()); + registry.fill(HIST("hPtPion"), vtx.track0pt()); + registry.fill(HIST("hPtAntiDeuteron"), vtx.track2pt()); + registry.fill(HIST("hDCAProtonToPV"), vtx.dcatrack1topv()); + registry.fill(HIST("hDCAPionToPV"), vtx.dcatrack0topv()); + registry.fill(HIST("hDCADeuteronToPV"), vtx.dcatrack2topv()); + registry.fill(HIST("hProtonTPCNcls"), track1.tpcNClsCrossedRows()); + registry.fill(HIST("hPionTPCNcls"), track0.tpcNClsCrossedRows()); + registry.fill(HIST("hDeuteronTPCNcls"), track2.tpcNClsCrossedRows()); + registry.fill(HIST("hTOFPIDDeuteron"), track2.tofNSigmaDe()); + registry.fill(HIST("hTPCPIDProton"), track1.tpcNSigmaPr()); + registry.fill(HIST("hTPCPIDPion"), track0.tpcNSigmaPi()); + registry.fill(HIST("hTPCPIDDeuteron"), track2.tpcNSigmaDe()); + registry.fill(HIST("hProtonTPCBB"), -track1.p(), track1.tpcSignal()); + registry.fill(HIST("hPionTPCBB"), track0.p(), track0.tpcSignal()); + registry.fill(HIST("hDeuteronTPCBB"), -track2.p(), track0.tpcSignal()); + registry.fill(HIST("hProtonTPCVsPt"), vtx.track1pt(), track1.tpcNSigmaPr()); + registry.fill(HIST("hPionTPCVsPt"), vtx.track0pt(), track0.tpcNSigmaPi()); + registry.fill(HIST("hDeuteronTPCVsPt"), vtx.track2pt(), track2.tpcNSigmaDe()); + registry.fill(HIST("hMassAntiHypertriton"), vtx.mAntiHypertriton()); + registry.fill(HIST("hMassHypertritonTotal"), vtx.mAntiHypertriton()); + registry.fill(HIST("h3dMassAntiHypertriton"), 0., vtx.pt(), vtx.mAntiHypertriton()); // collision.centV0M() instead of 0. once available + registry.fill(HIST("h3dTotalHypertriton"), ct, vtx.pt(), vtx.mAntiHypertriton()); + if (vtx.mAntiHypertriton() > lowerlimit && vtx.mAntiHypertriton() < upperlimit) { + registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}, array{vtx.pxtrack2(), vtx.pytrack2(), vtx.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), + RecoDecay::m2(array{array{vtx.pxtrack1(), vtx.pytrack1(), vtx.pztrack1()}, array{vtx.pxtrack0(), vtx.pytrack0(), vtx.pztrack0()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + } - if (isFromHypertriton) { - registry.fill(HIST("h3dTotalTrueHypertriton"), MClifetime, lPt, vtx.mAntiHypertriton()); - } - if (saveDcaHist == 1) { - registry.fill(HIST("h3dMassAntiHypertritonDca"), vtx.dcaVtxdaughters(), vtx.pt(), vtx.mAntiHypertriton()); + if (isFromHypertriton) { + registry.fill(HIST("h3dTotalTrueHypertriton"), MClifetime, lPt, vtx.mAntiHypertriton()); + } + if (saveDcaHist == 1) { + registry.fill(HIST("h3dMassAntiHypertritonDca"), vtx.dcaVtxdaughters(), vtx.pt(), vtx.mAntiHypertriton()); + } } } } } } + + if (if_hasvtx) + registry.fill(HIST("hSelectedEventCounter"), 2.5); } }; @@ -401,9 +480,9 @@ struct hypertriton3bodyLabelCheck { "registry", { {"hLabeledVtxCounter", "hLabeledVtxCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}, - {"hMassTrueH3L", "hMassTrueH3L", {HistType::kTH1F, {{100, 2.95f, 3.05f}}}}, - {"hMassTrueH3LMatter", "hMassTrueH3LMatter", {HistType::kTH1F, {{100, 2.95f, 3.05f}}}}, - {"hMassTrueH3LAntiMatter", "hMassTrueH3LAntiMatter", {HistType::kTH1F, {{100, 2.95f, 3.05f}}}}, + {"hMassTrueH3L", "hMassTrueH3L", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, + {"hMassTrueH3LMatter", "hMassTrueH3LMatter", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, + {"hMassTrueH3LAntiMatter", "hMassTrueH3LAntiMatter", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, }, }; @@ -454,8 +533,6 @@ struct hypertriton3bodyTrackMcinfo { { {"hTotalCollCounter", "hTotalCollCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}, {"hParticleCount", "hParticleCount", {HistType::kTH1F, {{7, 0.0f, 7.0f}}}}, - {"hParticleCount2", "hParticleCount2", {HistType::kTH1F, {{7, 0.0f, 7.0f}}}}, // for tpcncls > 70 - {"hBackgroundPionCount", "hBackgroundPionCount", {HistType::kTH1F, {{5, 0.0f, 5.0f}}}}, {"hTPCNClsCrossedRows", "hTPCNClsCrossedRows", {HistType::kTH1F, {{240, 0.0f, 240.0f}}}}, {"hTrackEta", "hTrackEta", {HistType::kTH1F, {{200, -10.0f, 10.0f}}}}, @@ -530,14 +607,6 @@ struct hypertriton3bodyTrackMcinfo { registry.get(HIST("hParticleCount"))->GetXaxis()->SetBinLabel(6, "McisPion"); registry.get(HIST("hParticleCount"))->GetXaxis()->SetBinLabel(7, "McisDeuteron"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(1, "Readin"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(2, "Has_mcparticle"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(3, "Rapidity Cut(off)"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(4, "McisHypertriton"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(5, "McisProton"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(6, "McisPion"); - registry.get(HIST("hParticleCount2"))->GetXaxis()->SetBinLabel(7, "McisDeuteron"); - registry.get(HIST("hProtonCount"))->GetXaxis()->SetBinLabel(1, "hasMom"); registry.get(HIST("hProtonCount"))->GetXaxis()->SetBinLabel(2, "FromHypertriton"); registry.get(HIST("hProtonCount"))->GetXaxis()->SetBinLabel(3, "TPCNcls"); @@ -557,11 +626,6 @@ struct hypertriton3bodyTrackMcinfo { registry.get(HIST("hDeuteronCount"))->GetXaxis()->SetBinLabel(4, "Eta"); registry.get(HIST("hDeuteronCount"))->GetXaxis()->SetBinLabel(5, "Pt"); registry.get(HIST("hDeuteronCount"))->GetXaxis()->SetBinLabel(6, "TPCPID"); - registry.get(HIST("hBackgroundPionCount"))->GetXaxis()->SetBinLabel(1, "NotFromHypertriton"); - registry.get(HIST("hBackgroundPionCount"))->GetXaxis()->SetBinLabel(2, "TPCNcls"); - registry.get(HIST("hBackgroundPionCount"))->GetXaxis()->SetBinLabel(3, "Eta"); - registry.get(HIST("hBackgroundPionCount"))->GetXaxis()->SetBinLabel(4, "Pt"); - registry.get(HIST("hBackgroundPionCount"))->GetXaxis()->SetBinLabel(5, "TPCPID"); } Configurable dcapiontopv{"dcapiontopv", .05, "DCA Pion To PV"}; @@ -582,12 +646,11 @@ struct hypertriton3bodyTrackMcinfo { } registry.fill(HIST("hTotalCollCounter"), 1.5); + std::vector protons, pions, deuterons; // index for daughter tracks + for (auto& track : tracks) { registry.fill(HIST("hParticleCount"), 0.5); registry.fill(HIST("hTrackITSNcls"), track.itsNCls()); - if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 0.5); - } registry.fill(HIST("hTPCNClsCrossedRows"), track.tpcNClsCrossedRows()); registry.fill(HIST("hTrackNsigmaDeuteron"), track.tpcNSigmaDe()); registry.fill(HIST("hTrackNsigmaProton"), track.tpcNSigmaPr()); @@ -598,25 +661,16 @@ struct hypertriton3bodyTrackMcinfo { } registry.fill(HIST("hParticleCount"), 1.5); auto mcparticle = track.mcParticle_as(); - if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 1.5); - } registry.fill(HIST("hTPCBB"), track.p() * track.sign(), track.tpcSignal()); // if (TMath::Abs(mcparticle.y()) > 0.9) {continue;} registry.fill(HIST("hParticleCount"), 2.5); - if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 2.5); - } registry.fill(HIST("hTrackEta"), track.eta()); registry.fill(HIST("hTrackMcRapidity"), mcparticle.y()); // Hypertriton detected directly if (mcparticle.pdgCode() == 1010010030 || mcparticle.pdgCode() == -1010010030) { registry.fill(HIST("hParticleCount"), 3.5); - if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 3.5); - } registry.fill(HIST("hHypertritonMcPt"), mcparticle.pt()); registry.fill(HIST("hHypertritonEta"), track.eta()); registry.fill(HIST("hHypertritonMcRapidity"), mcparticle.y()); @@ -626,7 +680,6 @@ struct hypertriton3bodyTrackMcinfo { if (mcparticle.pdgCode() == 2212 || mcparticle.pdgCode() == -2212) { registry.fill(HIST("hParticleCount"), 4.5); if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 4.5); registry.fill(HIST("hProtonTPCBBAfterTPCNclsCut"), track.p() * track.sign(), track.tpcSignal()); } @@ -637,6 +690,7 @@ struct hypertriton3bodyTrackMcinfo { if (!flag_H3L) { continue; } + protons.push_back(track.globalIndex()); registry.fill(HIST("hProtonCount"), 1.5); registry.fill(HIST("hDauProtonPt"), track.pt()); registry.fill(HIST("hDauProtonMcPt"), mcparticle.pt()); @@ -677,7 +731,6 @@ struct hypertriton3bodyTrackMcinfo { if (mcparticle.pdgCode() == 211 || mcparticle.pdgCode() == -211) { registry.fill(HIST("hParticleCount"), 5.5); if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 5.5); registry.fill(HIST("hPionTPCBBAfterTPCNclsCut"), track.p() * track.sign(), track.tpcSignal()); } @@ -688,6 +741,7 @@ struct hypertriton3bodyTrackMcinfo { if (!flag_H3L) { continue; } + pions.push_back(track.globalIndex()); registry.fill(HIST("hPionCount"), 1.5); registry.fill(HIST("hDauPionPt"), track.pt()); registry.fill(HIST("hDauPionMcPt"), mcparticle.pt()); @@ -715,36 +769,6 @@ struct hypertriton3bodyTrackMcinfo { } } - bool isFromHypertriton = false; - if (mcparticle.has_mothers()) { - for (auto& particleMother : mcparticle.mothers_as()) { - if (particleMother.pdgCode() == 1010010030 || particleMother.pdgCode() == -1010010030) { - isFromHypertriton = true; - } - } - } - - while (!isFromHypertriton) { - registry.fill(HIST("hBackgroundPionCount"), 0.5); - if (track.tpcNClsCrossedRows() < 70) { - break; - } - registry.fill(HIST("hBackgroundPionCount"), 1.5); - if (TMath::Abs(track.eta()) > 0.9) { - break; - } - registry.fill(HIST("hBackgroundPionCount"), 2.5); - if (track.pt() < minPionPt || track.pt() > maxPionPt) { - break; - } - registry.fill(HIST("hBackgroundPionCount"), 3.5); - if (TMath::Abs(track.tpcNSigmaPi()) > 5) { - break; - } - registry.fill(HIST("hBackgroundPionCount"), 4.5); - break; - } - registry.fill(HIST("hPionMcPt"), mcparticle.pt()); registry.fill(HIST("hPionMcP"), mcparticle.p()); registry.fill(HIST("hPionPt"), track.pt()); @@ -761,7 +785,6 @@ struct hypertriton3bodyTrackMcinfo { if (mcparticle.pdgCode() == 1000010020 || mcparticle.pdgCode() == -1000010020) { registry.fill(HIST("hParticleCount"), 6.5); if (track.tpcNClsCrossedRows() > 70) { - registry.fill(HIST("hParticleCount2"), 6.5); registry.fill(HIST("hDeuteronTPCBBAfterTPCNclsCut"), track.p() * track.sign(), track.tpcSignal()); } @@ -772,6 +795,7 @@ struct hypertriton3bodyTrackMcinfo { if (!flag_H3L) { continue; } + deuterons.push_back(track.globalIndex()); registry.fill(HIST("hDeuteronCount"), 1.5); registry.fill(HIST("hDauDeuteronPt"), track.pt()); registry.fill(HIST("hDauDeuteronMcPt"), mcparticle.pt()); @@ -806,6 +830,15 @@ struct hypertriton3bodyTrackMcinfo { registry.fill(HIST("hDeuteronMcRapidity"), mcparticle.y()); registry.fill(HIST("hDeuteronTPCBB"), track.p() * track.sign(), track.tpcSignal()); } + + /*for(int iproton = 0; iproton < protons.size(); iproton++){ + for(int ipion = 0; ipion < pions.size(); ipion++){ + for(int ideuteron = 0; ideuteron < deuterons.size(); ideuteron++){ + auto track0 = tracks.A + if(!isPaired3body() + } + } + }*/ } } }; @@ -821,8 +854,7 @@ struct hypertriton3bodyMcParticleCount { {"h3dMCDecayedHypertriton", "h3dMCDecayedHypertriton", {HistType::kTH3F, {{20, -1.0f, 1.0f, "Rapidity"}, {200, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}, {50, 0.0f, 50.0f, "ct(cm)"}}}}, {"hMcPhysicalPrimaryParticleCount", "hMcPhysicalPrimaryParticleCount", {HistType::kTH1F, {{8, 0.0f, 8.0f}}}}, - {"hMcHypertritonCount", "hMcHypertritonCount", {HistType::kTH1F, {{5, 0.0f, 5.0f}}}}, - {"hMcHypertritonCheck", "hMcHypertritonCheck", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, + {"hMcHypertritonCount", "hMcHypertritonCount", {HistType::kTH1F, {{8, 0.0f, 8.0f}}}}, {"hMcHypertritonPt", "hMcHypertritonPt", {HistType::kTH1F, {{300, 0.0f, 15.0f}}}}, {"hMcProtonPt", "hMcProtonPt", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, {"hMcPionPt", "hMcPionPt", {HistType::kTH1F, {{200, 0.0f, 10.0f}}}}, @@ -837,11 +869,6 @@ struct hypertriton3bodyMcParticleCount { registry.get(HIST("hTotalMcCollCounter"))->GetXaxis()->SetBinLabel(1, "Total Count"); registry.get(HIST("hTotalMcCollCounter"))->GetXaxis()->SetBinLabel(2, "Recoonstructed"); - registry.get(HIST("hMcHypertritonCheck"))->GetXaxis()->SetBinLabel(1, "PdgCode"); - registry.get(HIST("hMcHypertritonCheck"))->GetXaxis()->SetBinLabel(2, "Rapidity"); - registry.get(HIST("hMcHypertritonCheck"))->GetXaxis()->SetBinLabel(3, "Lifetime"); - registry.get(HIST("hMcHypertritonCheck"))->GetXaxis()->SetBinLabel(4, "PtCut"); - registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(1, "Readin"); registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(2, "IsPhysicalPrimary"); registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(3, "y<0.9(off)"); @@ -850,11 +877,14 @@ struct hypertriton3bodyMcParticleCount { registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(6, "(Anti)Deuteron"); registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(7, "(Anti)Hypertriton"); registry.get(HIST("hMcPhysicalPrimaryParticleCount"))->GetXaxis()->SetBinLabel(8, "HasDaughter"); - registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(1, "Generated hypertriton"); - registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(2, "Generated anti-hypertriton"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(1, "Hypertriton All"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(2, "AntiHypertriton All"); registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(3, "confirm to 3-body decay"); - registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(4, "Hypertriton Candidates"); - registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(5, "AntiHypertriton Candidates"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(4, "Hypertriton"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(5, "AntiHypertriton"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(6, "Rapidity"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(7, "Lifetime"); + registry.get(HIST("hMcHypertritonCount"))->GetXaxis()->SetBinLabel(8, "PtCut"); } Configurable rapidityMCcut{"rapidityMCcut", 0.9, "rapidity cut MC count"}; @@ -894,61 +924,54 @@ struct hypertriton3bodyMcParticleCount { registry.fill(HIST("hMcDeuteronPt"), mcparticle.pt()); } if (mcparticle.pdgCode() == 1010010030) { - registry.fill(HIST("hMcHypertritonCount"), 0.5); - } else if (mcparticle.pdgCode() == -1010010030) { registry.fill(HIST("hMcHypertritonCount"), 1.5); + } else if (mcparticle.pdgCode() == -1010010030) { + registry.fill(HIST("hMcHypertritonCount"), 2.5); } if (mcparticle.pdgCode() == 1010010030 || mcparticle.pdgCode() == -1010010030) { - registry.fill(HIST("hMcHypertritonCheck"), 0.5); + registry.fill(HIST("hMcHypertritonCount"), 0.5); registry.fill(HIST("hMcHypertritonPt"), mcparticle.pt()); - // double dauProtonPos[3] = {-999, -999, -999}; - // double dauPionPos[3] = {-999, -999, -999}; double dauDeuteronPos[3] = {-999, -999, -999}; double dauProtonMom[3] = {-999, -999, -999}; double dauPionMom[3] = {-999, -999, -999}; double dauDeuteronMom[3] = {-999, -999, -999}; double MClifetime = 999; bool flag_H3L = is3bodyDecayedH3L(mcparticle); - if (flag_H3L) { - for (auto& mcparticleDaughter : mcparticle.daughters_as()) { - if (std::abs(mcparticleDaughter.pdgCode()) == 2212) { - /*dauProtonPos[0] = mcparticleDaughter.vx(); - dauProtonPos[1] = mcparticleDaughter.vy(); - dauProtonPos[2] = mcparticleDaughter.vz();*/ - dauProtonMom[0] = mcparticleDaughter.px(); - dauProtonMom[1] = mcparticleDaughter.py(); - dauProtonMom[2] = mcparticleDaughter.pz(); - } - if (std::abs(mcparticleDaughter.pdgCode()) == 211) { - /*dauPionPos[0] = mcparticleDaughter.vx(); - dauPionPos[1] = mcparticleDaughter.vy(); - dauPionPos[2] = mcparticleDaughter.vz();*/ - dauPionMom[0] = mcparticleDaughter.px(); - dauPionMom[1] = mcparticleDaughter.py(); - dauPionMom[2] = mcparticleDaughter.pz(); - } - if (std::abs(mcparticleDaughter.pdgCode()) == 1000010020) { - dauDeuteronPos[0] = mcparticleDaughter.vx(); - dauDeuteronPos[1] = mcparticleDaughter.vy(); - dauDeuteronPos[2] = mcparticleDaughter.vz(); - dauDeuteronMom[0] = mcparticleDaughter.px(); - dauDeuteronMom[1] = mcparticleDaughter.py(); - dauDeuteronMom[2] = mcparticleDaughter.pz(); - } + if (!flag_H3L) { + continue; + } + for (auto& mcparticleDaughter : mcparticle.daughters_as()) { + if (std::abs(mcparticleDaughter.pdgCode()) == 2212) { + dauProtonMom[0] = mcparticleDaughter.px(); + dauProtonMom[1] = mcparticleDaughter.py(); + dauProtonMom[2] = mcparticleDaughter.pz(); } - if (mcparticle.pdgCode() == 1010010030) { - registry.fill(HIST("hMcHypertritonCount"), 2.5); - registry.fill(HIST("hMcHypertritonCount"), 3.5); + if (std::abs(mcparticleDaughter.pdgCode()) == 211) { + dauPionMom[0] = mcparticleDaughter.px(); + dauPionMom[1] = mcparticleDaughter.py(); + dauPionMom[2] = mcparticleDaughter.pz(); } - if (mcparticle.pdgCode() == -1010010030) { - registry.fill(HIST("hMcHypertritonCount"), 2.5); - registry.fill(HIST("hMcHypertritonCount"), 4.5); + if (std::abs(mcparticleDaughter.pdgCode()) == 1000010020) { + dauDeuteronPos[0] = mcparticleDaughter.vx(); + dauDeuteronPos[1] = mcparticleDaughter.vy(); + dauDeuteronPos[2] = mcparticleDaughter.vz(); + dauDeuteronMom[0] = mcparticleDaughter.px(); + dauDeuteronMom[1] = mcparticleDaughter.py(); + dauDeuteronMom[2] = mcparticleDaughter.pz(); } - MClifetime = RecoDecay::sqrtSumOfSquares(dauDeuteronPos[0] - mcparticle.vx(), dauDeuteronPos[1] - mcparticle.vy(), dauDeuteronPos[2] - mcparticle.vz()) * o2::constants::physics::MassHyperTriton / mcparticle.p(); - registry.fill(HIST("hMcRecoInvMass"), RecoDecay::m(array{array{dauProtonMom[0], dauProtonMom[1], dauProtonMom[2]}, array{dauPionMom[0], dauPionMom[1], dauPionMom[2]}, array{dauDeuteronMom[0], dauDeuteronMom[1], dauDeuteronMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron})); - registry.fill(HIST("h3dMCDecayedHypertriton"), mcparticle.y(), mcparticle.pt(), MClifetime); } + if (mcparticle.pdgCode() == 1010010030) { + registry.fill(HIST("hMcHypertritonCount"), 3.5); + registry.fill(HIST("hMcHypertritonCount"), 4.5); + } + if (mcparticle.pdgCode() == -1010010030) { + registry.fill(HIST("hMcHypertritonCount"), 3.5); + registry.fill(HIST("hMcHypertritonCount"), 5.5); + } + MClifetime = RecoDecay::sqrtSumOfSquares(dauDeuteronPos[0] - mcparticle.vx(), dauDeuteronPos[1] - mcparticle.vy(), dauDeuteronPos[2] - mcparticle.vz()) * o2::constants::physics::MassHyperTriton / mcparticle.p(); + registry.fill(HIST("hMcRecoInvMass"), RecoDecay::m(array{array{dauProtonMom[0], dauProtonMom[1], dauProtonMom[2]}, array{dauPionMom[0], dauPionMom[1], dauPionMom[2]}, array{dauDeuteronMom[0], dauDeuteronMom[1], dauDeuteronMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron})); + registry.fill(HIST("h3dMCDecayedHypertriton"), mcparticle.y(), mcparticle.pt(), MClifetime); int daughterPionCount = 0; for (auto& mcparticleDaughter : mcparticle.daughters_as()) { @@ -959,11 +982,11 @@ struct hypertriton3bodyMcParticleCount { // Count for hypertriton N_gen if (TMath::Abs(mcparticle.y()) < 1) { - registry.fill(HIST("hMcHypertritonCheck"), 1.5); + registry.fill(HIST("hMcHypertritonCount"), 6.5); if (MClifetime < 40) { - registry.fill(HIST("hMcHypertritonCheck"), 2.5); + registry.fill(HIST("hMcHypertritonCount"), 7.5); if (mcparticle.pt() > 1 && mcparticle.pt() < 10) { - registry.fill(HIST("hMcHypertritonCheck"), 3.5); + registry.fill(HIST("hMcHypertritonCount"), 8.5); } } } diff --git a/PWGLF/Tasks/hypertriton3bodyanalysis.cxx b/PWGLF/Tasks/hypertriton3bodyanalysis.cxx index 3d44c8647ec..97cb130d10d 100644 --- a/PWGLF/Tasks/hypertriton3bodyanalysis.cxx +++ b/PWGLF/Tasks/hypertriton3bodyanalysis.cxx @@ -137,7 +137,7 @@ struct hypertriton3bodyAnalysis { Configurable etacut{"etacut", 1, "etacut"}; Configurable rapidity{"rapidity", 1, "rapidity"}; Configurable TofPidNsigmaMin{"TofPidNsigmaMin", -4, "TofPidNsigmaMin"}; - Configurable TofPidNsigmaMax{"TofPidNsigmaMax", 7, "TofPidNsigmaMax"}; + Configurable TofPidNsigmaMax{"TofPidNsigmaMax", 8, "TofPidNsigmaMax"}; Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; Configurable eventSelection{"eventSelection", true, "event selection"}; Configurable lifetimecut{"lifetimecut", 40., "lifetimecut"}; // ct @@ -173,10 +173,10 @@ struct hypertriton3bodyAnalysis { {"hDCAProtonToPV", "hDCAProtonToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, {"hDCAPionToPV", "hDCAPionToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, {"hDCADeuteronToPV", "hDCADeuteronToPV", {HistType::kTH1F, {{1000, -10.0f, 10.0f, "cm"}}}}, - {"hProtonTPCNcls", "hProtonTPCNcls", {HistType::kTH1F, {{300, 0, 300, "TPC cluster"}}}}, - {"hPionTPCNcls", "hPionTPCNcls", {HistType::kTH1F, {{300, 0, 300, "TPC cluster"}}}}, - {"hDeuteronTPCNcls", "hDeuteronTPCNcls", {HistType::kTH1F, {{300, 0, 300, "TPC cluster"}}}}, - {"hVtxCosPA", "hVtxCosPA", {HistType::kTH1F, {{1000, 0.99f, 1.0f}}}}, + {"hProtonTPCNcls", "hProtonTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hPionTPCNcls", "hPionTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hDeuteronTPCNcls", "hDeuteronTPCNcls", {HistType::kTH1F, {{180, 0, 180, "TPC cluster"}}}}, + {"hVtxCosPA", "hVtxCosPA", {HistType::kTH1F, {{1000, 0.9f, 1.0f}}}}, {"hDCAVtxDau", "hDCAVtxDau", {HistType::kTH1F, {{1000, 0.0f, 10.0f, "cm^{2}"}}}}, {"hTOFPIDDeuteron", "hTOFPIDDeuteron", {HistType::kTH1F, {{2000, -100.0f, 100.0f}}}}, {"hTPCPIDProton", "hTPCPIDProton", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, @@ -225,17 +225,10 @@ struct hypertriton3bodyAnalysis { registry.add("h3dMassAntiHypertritonDca", "h3dMassAntiHypertritonDca", {HistType::kTH3F, {dcaAxis, ptAxis, massAxisHypertriton}}); } - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(1, "Readin"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(2, "VtxCosPA"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(3, "TrackEta"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(4, "MomRapidity"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(5, "Lifetime"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(6, "DcaV0Dau"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(7, "d TOFPID"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(8, "TPCPID&Mass"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(9, "TPCNcls"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(10, "DauPt"); - registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(11, "PionDcatoPV"); + TString CandCounterbinLabel[11] = {"Total", "VtxCosPA", "TrackEta", "MomRapidity", "Lifetime", "DcaV0Dau", "d TOFPID", "TPCPID&Mass", "TPCNcls", "DauPt", "PionDcatoPV"}; + for (int i{0}; i < kNVtxSteps; i++) { + registry.get(HIST("hSelectedCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + } } void process(soa::Join::iterator const& collision, aod::Vtx3BodyDatas const& vtx3bodydatas, MyTracks const& tracks) diff --git a/PWGLF/Tasks/k1analysis.cxx b/PWGLF/Tasks/k1analysis.cxx index fe96efcb482..eb8117ee717 100644 --- a/PWGLF/Tasks/k1analysis.cxx +++ b/PWGLF/Tasks/k1analysis.cxx @@ -282,6 +282,7 @@ struct k1analysis { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { + auto multiplicity = collision.cent(); TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonanceK892, lDecayDaughter_bach, lResonanceK1; for (auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks2, dTracks2))) { // Full index policy is needed to consider all possible combinations @@ -341,14 +342,14 @@ struct k1analysis { histos.fill(HIST("k892invmass"), lResonanceK892.M()); // quick check if (trk1.sign() > 0) { // Positive pion if (trk2.sign() > 0) // Positive kaon - histos.fill(HIST("hK892invmass_PP"), collision.multV0M(), lResonanceK892.Pt(), lResonanceK892.M()); + histos.fill(HIST("hK892invmass_PP"), multiplicity, lResonanceK892.Pt(), lResonanceK892.M()); else // Negative kaon - histos.fill(HIST("hK892invmass_PN"), collision.multV0M(), lResonanceK892.Pt(), lResonanceK892.M()); // Anti-K(892)0 + histos.fill(HIST("hK892invmass_PN"), multiplicity, lResonanceK892.Pt(), lResonanceK892.M()); // Anti-K(892)0 } else { // Negative pion if (trk2.sign() > 0) // Positive kaon - histos.fill(HIST("hK892invmass_NP"), collision.multV0M(), lResonanceK892.Pt(), lResonanceK892.M()); // K(892)0 + histos.fill(HIST("hK892invmass_NP"), multiplicity, lResonanceK892.Pt(), lResonanceK892.M()); // K(892)0 else // Negative kaon - histos.fill(HIST("hK892invmass_NN"), collision.multV0M(), lResonanceK892.Pt(), lResonanceK892.M()); + histos.fill(HIST("hK892invmass_NN"), multiplicity, lResonanceK892.Pt(), lResonanceK892.M()); } } // Like-sign rejection for K(892)0 - disabled for further LS bkg study @@ -427,32 +428,32 @@ struct k1analysis { if (bTrack.sign() > 0) { // bachelor pi+ if (trk2.sign() > 0) { // kaon + means K(892)0 is matter. histos.fill(HIST("k1invmass"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_NPP"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NPP"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { histos.fill(HIST("k1invmass_LS"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_PNP"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PNP"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } else { // bachelor pi- if (trk2.sign() > 0) { // kaon + means K(892)0 is matter. histos.fill(HIST("k1invmass_LS"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_NPN"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NPN"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { histos.fill(HIST("k1invmass"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_PNN"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PNN"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } } else { // K892-LS (false) if (bTrack.sign() > 0) { // bachelor pi+ if (trk2.sign() > 0) { // Kaon+ - histos.fill(HIST("hK1invmass_PPP"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PPP"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { - histos.fill(HIST("hK1invmass_PPN"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PPN"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } else { // bachelor pi- if (trk2.sign() > 0) { // Kaon_ - histos.fill(HIST("hK1invmass_NNN"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NNN"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { - histos.fill(HIST("hK1invmass_NNP"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NNP"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } } @@ -466,11 +467,11 @@ struct k1analysis { histos.fill(HIST("QAMC/K1PairAsymm"), lPairAsym); if ((bTrack.sign() > 0) && (trk2.sign() > 0)) { // Matter - histos.fill(HIST("hK1invmass_NPP_MC"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NPP_MC"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); histos.fill(HIST("k1invmass_MC"), lResonanceK1.M()); // quick check } if ((bTrack.sign() < 0) && (trk2.sign() < 0)) { // Anti-matter - histos.fill(HIST("hK1invmass_PNN_MC"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PNN_MC"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); histos.fill(HIST("k1invmass_MC"), lResonanceK1.M()); // quick check } histos.fill(HIST("hTrueK1pt"), lResonanceK1.Pt()); @@ -484,16 +485,16 @@ struct k1analysis { if (bTrack.sign() > 0) { // bachelor pi+ if (trk2.sign() > 0) { // kaon + means K(892)0 is matter. histos.fill(HIST("k1invmass_Mix"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_NPP_Mix"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NPP_Mix"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { - histos.fill(HIST("hK1invmass_PNP_Mix"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PNP_Mix"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } else { // bachelor pi- if (trk2.sign() > 0) { // kaon + means K(892)0 is matter. - histos.fill(HIST("hK1invmass_NPN_Mix"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_NPN_Mix"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } else { histos.fill(HIST("k1invmass_Mix"), lResonanceK1.M()); // quick check - histos.fill(HIST("hK1invmass_PNN_Mix"), collision.multV0M(), lResonanceK1.Pt(), lResonanceK1.M()); + histos.fill(HIST("hK1invmass_PNN_Mix"), multiplicity, lResonanceK1.Pt(), lResonanceK1.M()); } } } @@ -540,7 +541,7 @@ struct k1analysis { PROCESS_SWITCH(k1analysis, processMCTrue, "Process Event for MC", false); // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; + using BinningTypeVtxZT0M = ColumnBinningPolicy; void processME(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks) { auto tracksTuple = std::make_tuple(resotracks); diff --git a/PWGLF/Tasks/k892analysis.cxx b/PWGLF/Tasks/k892analysis.cxx index 3a13f433617..a298f4b9354 100644 --- a/PWGLF/Tasks/k892analysis.cxx +++ b/PWGLF/Tasks/k892analysis.cxx @@ -219,6 +219,7 @@ struct k892analysis { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { + auto multiplicity = collision.cent(); TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; for (auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks1, dTracks2))) { // Full index policy is needed to consider all possible combinations @@ -303,14 +304,14 @@ struct k892analysis { if constexpr (!IsMix) { if (trk1.sign() > 0) { histos.fill(HIST("k892invmassDS"), lResonance.M()); - histos.fill(HIST("h3k892invmassDS"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3k892invmassDS"), multiplicity, lResonance.Pt(), lResonance.M()); } else { histos.fill(HIST("k892invmassDSAnti"), lResonance.M()); - histos.fill(HIST("h3k892invmassDSAnti"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3k892invmassDSAnti"), multiplicity, lResonance.Pt(), lResonance.M()); } } else { histos.fill(HIST("k892invmassME"), lResonance.M()); - histos.fill(HIST("h3k892invmassME"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3k892invmassME"), multiplicity, lResonance.Pt(), lResonance.M()); } // MC @@ -332,11 +333,11 @@ struct k892analysis { if (trk1.motherPDG() > 0) { histos.fill(HIST("k892Rec"), lResonance.Pt()); histos.fill(HIST("k892Recinvmass"), lResonance.M()); - histos.fill(HIST("h3Reck892invmass"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3Reck892invmass"), multiplicity, lResonance.Pt(), lResonance.M()); } else { histos.fill(HIST("k892RecAnti"), lResonance.Pt()); histos.fill(HIST("k892Recinvmass"), lResonance.M()); - histos.fill(HIST("h3Reck892invmassAnti"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3Reck892invmassAnti"), multiplicity, lResonance.Pt(), lResonance.M()); } } } else { @@ -344,10 +345,10 @@ struct k892analysis { continue; if (trk1.sign() > 0) { histos.fill(HIST("k892invmassLS"), lResonance.M()); - histos.fill(HIST("h3k892invmassLS"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3k892invmassLS"), multiplicity, lResonance.Pt(), lResonance.M()); } else { histos.fill(HIST("k892invmassLSAnti"), lResonance.M()); - histos.fill(HIST("h3k892invmassLSAnti"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3k892invmassLSAnti"), multiplicity, lResonance.Pt(), lResonance.M()); } } } @@ -395,7 +396,7 @@ struct k892analysis { PROCESS_SWITCH(k892analysis, processMCTrue, "Process Event for MC", false); // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; + using BinningTypeVtxZT0M = ColumnBinningPolicy; void processMELight(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks) { auto tracksTuple = std::make_tuple(resotracks); diff --git a/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx b/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx index 8806174cf7b..afedb50ec4d 100644 --- a/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx +++ b/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx @@ -400,11 +400,11 @@ struct lambdaAnalysis { void processData(resoCols::iterator const& collision, resoTracks const& tracks) { - histos.fill(HIST("Event/hCent"), collision.multV0M()); + histos.fill(HIST("Event/hCent"), collision.cent()); histos.fill(HIST("Event/hSph"), collision.spherocity()); - histos.fill(HIST("Event/hSpCent"), collision.multV0M(), collision.spherocity()); + histos.fill(HIST("Event/hSpCent"), collision.cent(), collision.spherocity()); - fillDataHistos(tracks, tracks, collision.spherocity(), collision.multV0M()); + fillDataHistos(tracks, tracks, collision.spherocity(), collision.cent()); } PROCESS_SWITCH(lambdaAnalysis, processData, "Process for Same Event Data", true); @@ -414,8 +414,8 @@ struct lambdaAnalysis { { histos.fill(HIST("Event/hSphRec"), collision.spherocity()); - histos.fill(HIST("Event/hSpCentRec"), collision.multV0M(), collision.spherocity()); - fillDataHistos(tracks, tracks, collision.spherocity(), collision.multV0M()); + histos.fill(HIST("Event/hSpCentRec"), collision.cent(), collision.spherocity()); + fillDataHistos(tracks, tracks, collision.spherocity(), collision.cent()); } PROCESS_SWITCH(lambdaAnalysis, processMC, "Process Event for MC", false); @@ -452,8 +452,8 @@ struct lambdaAnalysis { PROCESS_SWITCH(lambdaAnalysis, processMCTrue, "Process Event for MC", false); // Processing Event Mixing - using BinningType1 = ColumnBinningPolicy; - using BinningType2 = ColumnBinningPolicy; + using BinningType1 = ColumnBinningPolicy; + using BinningType2 = ColumnBinningPolicy; void processMix(resoCols& collisions, resoTracks const& tracks) { @@ -464,12 +464,12 @@ struct lambdaAnalysis { if (doSphMix) { SameKindPair pairs{binningPositions1, nMix, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto& [c1, t1, c2, t2] : pairs) { - fillDataHistos(t1, t2, c1.spherocity(), c1.multV0M()); + fillDataHistos(t1, t2, c1.spherocity(), c1.cent()); } } else { SameKindPair pairs{binningPositions2, nMix, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto& [c1, t1, c2, t2] : pairs) { - fillDataHistos(t1, t2, c1.spherocity(), c1.multV0M()); + fillDataHistos(t1, t2, c1.spherocity(), c1.cent()); } } } diff --git a/PWGLF/Tasks/lambda1520analysis.cxx b/PWGLF/Tasks/lambda1520analysis.cxx index 6ba4806d0ee..655bde3a8f6 100644 --- a/PWGLF/Tasks/lambda1520analysis.cxx +++ b/PWGLF/Tasks/lambda1520analysis.cxx @@ -456,23 +456,23 @@ struct lambda1520analysis { if (trk1.sign() * trk2.sign() < 0) { if constexpr (!IsMix) { histos.fill(HIST("Result/Data/lambda1520invmass"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmass"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmass"), collision.cent(), lResonance.Pt(), lResonance.M()); if (isEtaAssym && trk1.eta() > 0.2 && trk1.eta() < 0.8 && trk2.eta() > 0.2 && trk2.eta() < 0.8) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassUnlikeSignAside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassUnlikeSignAside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassUnlikeSignAside"), collision.cent(), lResonance.Pt(), lResonance.M()); } else if (isEtaAssym && trk1.eta() > -0.6 && trk1.eta() < 0.0 && trk2.eta() > -0.6 && trk2.eta() < 0.0) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassUnlikeSignCside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassUnlikeSignCside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassUnlikeSignCside"), collision.cent(), lResonance.Pt(), lResonance.M()); } } else { histos.fill(HIST("Result/Data/lambda1520invmassME"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassME"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassME"), collision.cent(), lResonance.Pt(), lResonance.M()); if (isEtaAssym && trk1.eta() > 0.2 && trk1.eta() < 0.8 && trk2.eta() > 0.2 && trk2.eta() < 0.8) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassMixedAside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassMixedAside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassMixedAside"), collision.cent(), lResonance.Pt(), lResonance.M()); } else if (isEtaAssym && trk1.eta() > -0.6 && trk1.eta() < 0.0 && trk2.eta() > -0.6 && trk2.eta() < 0.0) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassMixedCside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassMixedCside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassMixedCside"), collision.cent(), lResonance.Pt(), lResonance.M()); } } @@ -497,29 +497,29 @@ struct lambda1520analysis { if (trk1.motherPDG() > 0) { histos.fill(HIST("Result/MC/lambda1520Reco"), lResonance.Pt()); histos.fill(HIST("Result/MC/hlambda1520Recoinvmass"), lResonance.M()); - histos.fill(HIST("Result/MC/h3lambda1520Recoinvmass"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/MC/h3lambda1520Recoinvmass"), collision.cent(), lResonance.Pt(), lResonance.M()); } else { histos.fill(HIST("Result/MC/antilambda1520Reco"), lResonance.Pt()); histos.fill(HIST("Result/MC/hantilambda1520Recoinvmass"), lResonance.M()); - histos.fill(HIST("Result/MC/h3antilambda1520Recoinvmass"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/MC/h3antilambda1520Recoinvmass"), collision.cent(), lResonance.Pt(), lResonance.M()); } } } else { if constexpr (!IsMix) { if (isEtaAssym && trk1.eta() > 0.2 && trk1.eta() < 0.8 && trk2.eta() > 0.2 && trk2.eta() < 0.8) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassLikeSignAside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassLikeSignAside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassLikeSignAside"), collision.cent(), lResonance.Pt(), lResonance.M()); } else if (isEtaAssym && trk1.eta() > -0.6 && trk1.eta() < 0.0 && trk2.eta() > -0.6 && trk2.eta() < 0.0) { // Eta-range will be updated histos.fill(HIST("Result/Data/hlambda1520invmassLikeSignCside"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassLikeSignCside"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassLikeSignCside"), collision.cent(), lResonance.Pt(), lResonance.M()); } // Like sign pair ++ if (trk1.sign() > 0) { histos.fill(HIST("Result/Data/lambda1520invmassLSPP"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassLSPP"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassLSPP"), collision.cent(), lResonance.Pt(), lResonance.M()); } else { // Like sign pair -- histos.fill(HIST("Result/Data/lambda1520invmassLSMM"), lResonance.M()); - histos.fill(HIST("Result/Data/h3lambda1520invmassLSMM"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassLSMM"), collision.cent(), lResonance.Pt(), lResonance.M()); } } } @@ -568,7 +568,7 @@ struct lambda1520analysis { PROCESS_SWITCH(lambda1520analysis, processMCTrue, "Process Event for MC only", false); // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; + using BinningTypeVtxZT0M = ColumnBinningPolicy; void processME(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks) { auto tracksTuple = std::make_tuple(resotracks); diff --git a/PWGLF/Tasks/lambdakzeroanalysis.cxx b/PWGLF/Tasks/lambdakzeroanalysis.cxx index 6b8208d119c..c009dab1235 100644 --- a/PWGLF/Tasks/lambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/lambdakzeroanalysis.cxx @@ -26,7 +26,7 @@ #include "Framework/AnalysisDataModel.h" #include "Framework/ASoAHelpers.h" #include "ReconstructionDataFormats/Track.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/trackUtilities.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/TrackSelection.h" @@ -182,7 +182,7 @@ struct lambdakzeroAnalysis { registry.fill(HIST("V0loopFiltersCounts"), 1.5); if (TMath::Abs(v0.yLambda()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 3.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { registry.fill(HIST("V0loopFiltersCounts"), 4.5); // Lambda @@ -210,7 +210,7 @@ struct lambdakzeroAnalysis { // K0Short if (TMath::Abs(v0.yK0Short()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 7.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short < lifetimecut->get("lifetimecutK0S")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < lifetimecut->get("lifetimecutK0S")) { registry.fill(HIST("V0loopFiltersCounts"), 8.5); if ((v0.qtarm() > paramArmenterosCut * TMath::Abs(v0.alpha())) || !boolArmenterosCut) { registry.fill(HIST("V0loopFiltersCounts"), 9.5); @@ -249,7 +249,7 @@ struct lambdakzeroAnalysis { registry.fill(HIST("V0loopFiltersCounts"), 1.5); if (TMath::Abs(v0.yLambda()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 3.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { registry.fill(HIST("V0loopFiltersCounts"), 4.5); // Lambda @@ -277,7 +277,7 @@ struct lambdakzeroAnalysis { // K0Short if (TMath::Abs(v0.yK0Short()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 7.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short < lifetimecut->get("lifetimecutK0S")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < lifetimecut->get("lifetimecutK0S")) { registry.fill(HIST("V0loopFiltersCounts"), 8.5); if ((v0.qtarm() > paramArmenterosCut * v0.alpha()) || !boolArmenterosCut) { registry.fill(HIST("V0loopFiltersCounts"), 9.5); diff --git a/PWGLF/Tasks/lambdakzeroanalysisMC.cxx b/PWGLF/Tasks/lambdakzeroanalysisMC.cxx index 4134167d389..b83a2b72e52 100644 --- a/PWGLF/Tasks/lambdakzeroanalysisMC.cxx +++ b/PWGLF/Tasks/lambdakzeroanalysisMC.cxx @@ -27,7 +27,7 @@ #include "Framework/AnalysisDataModel.h" #include "Framework/ASoAHelpers.h" #include "ReconstructionDataFormats/Track.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/trackUtilities.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/TrackSelection.h" @@ -238,7 +238,7 @@ struct lambdakzeroAnalysisMc { if (TMath::Abs(v0.yLambda()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 3.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { registry.fill(HIST("V0loopFiltersCounts"), 4.5); // Lambda @@ -312,7 +312,7 @@ struct lambdakzeroAnalysisMc { // K0Short if (TMath::Abs(v0.yK0Short()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 7.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short < lifetimecut->get("lifetimecutK0S")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < lifetimecut->get("lifetimecutK0S")) { registry.fill(HIST("V0loopFiltersCounts"), 8.5); if ((v0.qtarm() > paramArmenterosCut * TMath::Abs(v0.alpha())) || !boolArmenterosCut) { registry.fill(HIST("V0loopFiltersCounts"), 9.5); @@ -370,7 +370,7 @@ struct lambdakzeroAnalysisMc { if (TMath::Abs(v0.yLambda()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 3.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 < lifetimecut->get("lifetimecutLambda")) { registry.fill(HIST("V0loopFiltersCounts"), 4.5); registry.fill(HIST("h3dMassLambda"), collision.centRun2V0M(), v0.pt(), v0.mLambda()); registry.fill(HIST("h3dMassAntiLambda"), collision.centRun2V0M(), v0.pt(), v0.mAntiLambda()); @@ -403,7 +403,7 @@ struct lambdakzeroAnalysisMc { } if (TMath::Abs(v0.yK0Short()) < rapidity) { registry.fill(HIST("V0loopFiltersCounts"), 7.5); - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short < lifetimecut->get("lifetimecutK0S")) { + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < lifetimecut->get("lifetimecutK0S")) { registry.fill(HIST("V0loopFiltersCounts"), 8.5); registry.fill(HIST("h3dMassK0Short"), collision.centRun2V0M(), v0.pt(), v0.mK0Short()); registry.fill(HIST("hArmenterosPostAnalyserCuts"), v0.alpha(), v0.qtarm()); diff --git a/PWGLF/Tasks/nuclei_in_jets.cxx b/PWGLF/Tasks/nuclei_in_jets.cxx index 546ebe69f30..5bddadc987b 100644 --- a/PWGLF/Tasks/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/nuclei_in_jets.cxx @@ -104,7 +104,7 @@ struct nuclei_in_jets { void init(InitContext const&) { // Global Properties and QC - registryQC.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{4, 0, 4, "1 = all events, 2 = selected events, 3 = events with pt>pt_threshold, 4 = events with pt>pt_threshold and particle of interest"}}); + registryQC.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{5, 0, 5, "1 = all events, 2 = selected events, 3 = events with pt>pt_threshold, 4 = events with pt>pt_threshold and particle of interest"}}); registryQC.add("jet_plus_ue_multiplicity", "jet + underlying-event multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); registryQC.add("jet_multiplicity", "jet multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); registryQC.add("ue_multiplicity", "underlying-event multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); @@ -262,9 +262,15 @@ struct nuclei_in_jets { bool containsParticleOfInterest(false); float pt_max(0); + // Track Index Initialization + int i = -1; + // Loop over Reconstructed Tracks for (auto track : tracks) { + // Track Index + i++; + // Track Selection for Jet if (!passedMinimalTrackSelection(track)) continue; @@ -274,7 +280,7 @@ struct nuclei_in_jets { continue; // Track Index - int i = track.globalIndex(); + // int i = track.globalIndex(); // Trigger: Particle of Interest if (isParticleOfInterest(track)) @@ -293,8 +299,11 @@ struct nuclei_in_jets { // Histogram with pt_leading registryQC.fill(HIST("pt_leading"), pt_max); + // Number of Stored Particles + int nParticles = static_cast(particle_ID.size()); + // Selection of Events with pt > pt_leading - if (particle_ID.size() < 2) + if (nParticles < 2) return; if (pt_max < min_pt_leading) return; @@ -309,13 +318,14 @@ struct nuclei_in_jets { // Event Counter (events with pt > pt_max that contain particle of interest) registryQC.fill(HIST("number_of_events_data"), 3.5); - // Number of Stored Particles - int nParticles = static_cast(particle_ID.size()); - // Momentum of the Leading Particle - auto leading_track = tracks.iteratorAt(leading_ID); + auto const& leading_track = tracks.iteratorAt(leading_ID); TVector3 p_leading(leading_track.px(), leading_track.py(), leading_track.pz()); + // Instruction to be removed + registryQC.fill(HIST("number_of_events_data"), 4.5); + + /* // Array of Particles inside Jet std::vector jet_particle_ID; jet_particle_ID.push_back(leading_ID); @@ -389,10 +399,12 @@ struct nuclei_in_jets { } while (exit == 0); + // Multiplicity inside Jet + UE + int nParticlesJetUE = static_cast(jet_particle_ID.size()); + // Fill Jet Multiplicity - registryQC.fill(HIST("jet_plus_ue_multiplicity"), static_cast(jet_particle_ID.size())); + registryQC.fill(HIST("jet_plus_ue_multiplicity"), nParticlesJetUE); - /* // Perpendicular Cones for UE Estimate TVector3 z_positive(0.0, 0.0, 1.0); diff --git a/PWGLF/Tasks/phianalysis.cxx b/PWGLF/Tasks/phianalysis.cxx index 0e1a98e51db..93f038e28cb 100644 --- a/PWGLF/Tasks/phianalysis.cxx +++ b/PWGLF/Tasks/phianalysis.cxx @@ -235,12 +235,12 @@ struct phianalysis { if constexpr (!IsMix) { if (trk1.sign() > 0) { histos.fill(HIST("phiinvmassDS"), lResonance.M()); - histos.fill(HIST("h3phiinvmassDS"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3phiinvmassDS"), collision.cent(), lResonance.Pt(), lResonance.M()); } else { } } else { histos.fill(HIST("phiinvmassME"), lResonance.M()); - histos.fill(HIST("h3phiinvmassME"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3phiinvmassME"), collision.cent(), lResonance.Pt(), lResonance.M()); } // MC @@ -259,14 +259,14 @@ struct phianalysis { // MC histograms histos.fill(HIST("phiRec"), lResonance.Pt()); histos.fill(HIST("phiRecinvmass"), lResonance.M()); - histos.fill(HIST("h3Recphiinvmass"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3Recphiinvmass"), collision.cent(), lResonance.Pt(), lResonance.M()); } } else { if constexpr (!IsMix) continue; if (trk1.sign() > 0) { histos.fill(HIST("phiinvmassLS"), lResonance.M()); - histos.fill(HIST("h3phiinvmassLS"), collision.multV0M(), lResonance.Pt(), lResonance.M()); + histos.fill(HIST("h3phiinvmassLS"), collision.cent(), lResonance.Pt(), lResonance.M()); } else { } } @@ -305,7 +305,7 @@ struct phianalysis { PROCESS_SWITCH(phianalysis, processMCTrue, "Process Event for MC", false); // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; + using BinningTypeVtxZT0M = ColumnBinningPolicy; void processMELight(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks) { auto tracksTuple = std::make_tuple(resotracks); diff --git a/PWGLF/Tasks/phianalysisTHnSparse.cxx b/PWGLF/Tasks/phianalysisTHnSparse.cxx index 45fafe3a2d2..48219fc2e7f 100644 --- a/PWGLF/Tasks/phianalysisTHnSparse.cxx +++ b/PWGLF/Tasks/phianalysisTHnSparse.cxx @@ -98,8 +98,8 @@ struct phianalysisTHnSparse { AxisSpec ptAxis = {ptaxis, "p_{T} (GeV/c)", "pt"}; AxisSpec mAxis = {multiplicityaxis, "N", "m"}; AxisSpec yAxis = {rapidityaxis, "y", "y"}; - AxisSpec nsigmatrackaxis1 = {nsigmaaxis1, fmt::format("nSigma particle X({})", mass1), "sx"}; - AxisSpec nsigmatrackaxis2 = {nsigmaaxis1, fmt::format("nSigma particle Y({})", mass2), "sy"}; + AxisSpec nsigmatrackaxis1 = {nsigmaaxis1, fmt::format("nSigma particle 1({})", mass1), "ns1"}; + AxisSpec nsigmatrackaxis2 = {nsigmaaxis1, fmt::format("nSigma particle 2({})", mass2), "ns2"}; HistogramConfigSpec pairHisto({HistType::kTHnSparseF, {invAxis, ptAxis, mAxis, nsigmatrackaxis1, nsigmatrackaxis2, yAxis}}); registry.add("unlike", "Unlike", pairHisto); registry.add("likep", "Likep", pairHisto); @@ -170,7 +170,7 @@ struct phianalysisTHnSparse { if (verboselevel > 1) LOGF(info, "Unlike-sign: d1=%ld , d2=%ld , mother=%f", track1.globalIndex(), track2.globalIndex(), mother.Mag()); - registry.fill(HIST("unlike"), mother.Mag(), mother.Pt(), multiplicity, track1.tpcNSigmaKa(), track2.tpcNSigmaKa(), mother.Rapidity()); + registry.fill(HIST("unlike"), mother.Mag(), mother.Pt(), multiplicity, std::abs(track1.tpcNSigmaKa()), std::abs(track2.tpcNSigmaKa()), mother.Rapidity()); } for (auto& [track1, track2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posDauthers, posDauthers))) { @@ -186,7 +186,7 @@ struct phianalysisTHnSparse { if (verboselevel > 1) LOGF(info, "Like-sign positive: d1=%ld , d2=%ld , mother=%f", track1.globalIndex(), track2.globalIndex(), mother.Mag()); - registry.fill(HIST("likep"), mother.Mag(), mother.Pt(), multiplicity, track1.tpcNSigmaKa(), track2.tpcNSigmaKa(), mother.Rapidity()); + registry.fill(HIST("likep"), mother.Mag(), mother.Pt(), multiplicity, std::abs(track1.tpcNSigmaKa()), std::abs(track2.tpcNSigmaKa()), mother.Rapidity()); } for (auto& [track1, track2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negDauthers, negDauthers))) { @@ -202,7 +202,7 @@ struct phianalysisTHnSparse { if (verboselevel > 1) LOGF(info, "Like-sign negative: d1=%ld , d2=%ld , mother=%f", track1.globalIndex(), track2.globalIndex(), mother.Mag()); - registry.fill(HIST("liken"), mother.Mag(), mother.Pt(), multiplicity, track1.tpcNSigmaKa(), track2.tpcNSigmaKa(), mother.Rapidity()); + registry.fill(HIST("liken"), mother.Mag(), mother.Pt(), multiplicity, std::abs(track1.tpcNSigmaKa()), std::abs(track2.tpcNSigmaKa()), mother.Rapidity()); } } @@ -268,12 +268,12 @@ struct phianalysisTHnSparse { registry.fill(HIST("motherTrue"), mothertrack1.pt()); n++; - if (verboselevel > 0) + if (verboselevel > 1) LOGF(info, "True: %d, d1=%d (%ld), d2=%d (%ld), mother=%d (%ld)", n, mctrack1.pdgCode(), mctrack1.globalIndex(), mctrack2.pdgCode(), mctrack2.globalIndex(), mothertrack1.pdgCode(), mothertrack1.globalIndex()); if (!selectedPair(mother, mctrack1, mctrack2)) continue; - registry.fill(HIST("unlikeTrue"), mother.Mag(), mother.Pt(), multiplicityMC, tpcnSigma1 / 2.0, tpcnSigma2 / 2.0, mother.Rapidity()); + registry.fill(HIST("unlikeTrue"), mother.Mag(), mother.Pt(), multiplicityMC, std::abs(track1.tpcNSigmaKa()), std::abs(track2.tpcNSigmaKa()), mother.Rapidity()); } } } @@ -326,7 +326,7 @@ struct phianalysisTHnSparse { nuberofPhi++; numberofEntries++; - if (verboselevel > 0) + if (verboselevel > 1) LOGF(info, "Gen: %d, #Phi =%d, mother=%d (%ld), Inv.mass:%f, Pt= %f", numberofEntries, nuberofPhi, particle.pdgCode(), particle.globalIndex(), mother.Mag(), mother.Pt()); } else { registry.fill(HIST("motherBgr"), particle.pt()); diff --git a/PWGLF/Tasks/phianalysisrun3.cxx b/PWGLF/Tasks/phianalysisrun3.cxx index 7299925e3a9..a19162f8562 100644 --- a/PWGLF/Tasks/phianalysisrun3.cxx +++ b/PWGLF/Tasks/phianalysisrun3.cxx @@ -44,7 +44,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/Core/trackUtilities.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" #include "Common/Core/TrackSelection.h" #include "Framework/ASoAHelpers.h" @@ -100,7 +100,7 @@ struct phianalysisrun3 { } } - double massKa = o2::analysis::pdg::MassKPlus; + double massKa = o2::constants::physics::MassKPlus; double rapidity; double genMass, recMass, resolution; double mass{0.}; diff --git a/PWGLF/Tasks/v0postprocessing.cxx b/PWGLF/Tasks/v0postprocessing.cxx index 7921cc7369f..50ceab1ed5b 100644 --- a/PWGLF/Tasks/v0postprocessing.cxx +++ b/PWGLF/Tasks/v0postprocessing.cxx @@ -20,7 +20,7 @@ #include "PWGLF/DataModel/v0qaanalysis.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" -#include "PWGHF/Core/PDG.h" +#include "CommonConstants/PhysicsConstants.h" using namespace o2; using namespace o2::framework; @@ -142,8 +142,8 @@ struct v0postprocessing { if (candidate.v0cospa() > cospaK0s && TMath::Abs(candidate.rapk0short()) < rap && candidate.ctauk0short() < ctauK0s && - TMath::Abs(candidate.massk0short() - o2::analysis::pdg::MassK0Short) < 0.075 && - TMath::Abs(candidate.masslambda() - o2::analysis::pdg::MassLambda0) > v0rejK0s) { + TMath::Abs(candidate.massk0short() - o2::constants::physics::MassK0Short) < 0.075 && + TMath::Abs(candidate.masslambda() - o2::constants::physics::MassLambda0) > v0rejK0s) { registry.fill(HIST("hMassK0Short"), candidate.massk0short()); registry.fill(HIST("hMassVsPtK0Short"), candidate.v0pt(), candidate.massk0short()); @@ -169,8 +169,8 @@ struct v0postprocessing { /* if (candidate.v0cospa() > cospaLambda && TMath::Abs(candidate.raplambda()) < rap && candidate.ctaulambda() < ctauK0s && - TMath::Abs(candidate.masslambda() - o2::analysis::pdg::MassLambda0) < 0.075 && - TMath::Abs(candidate.massk0short() - o2::analysis::pdg::MassK0Short) > v0rejLambda) { + TMath::Abs(candidate.masslambda() - o2::constants::physics::MassLambda0) < 0.075 && + TMath::Abs(candidate.massk0short() - o2::constants::physics::MassK0Short) > v0rejLambda) { registry.fill(HIST("hMassLambda"), candidate.masslambda()); registry.fill(HIST("hMassVsPtLambda"), candidate.v0pt(), candidate.masslambda()); @@ -203,8 +203,8 @@ struct v0postprocessing { if (candidate.v0cospa() > cospaK0s && TMath::Abs(candidate.rapk0short()) < rap && candidate.ctauk0short() < ctauK0s && - TMath::Abs(candidate.massk0short() - o2::analysis::pdg::MassK0Short) < 0.075 && - TMath::Abs(candidate.masslambda() - o2::analysis::pdg::MassLambda0) > v0rejK0s && + TMath::Abs(candidate.massk0short() - o2::constants::physics::MassK0Short) < 0.075 && + TMath::Abs(candidate.masslambda() - o2::constants::physics::MassLambda0) > v0rejK0s && (candidate.pdgcode() == 310)) { registry.fill(HIST("hMassK0Short_MC"), candidate.massk0short()); diff --git a/PWGMM/Lumi/Tasks/fitLumi.cxx b/PWGMM/Lumi/Tasks/fitLumi.cxx index b1f153c3be9..f04fbed3f7d 100644 --- a/PWGMM/Lumi/Tasks/fitLumi.cxx +++ b/PWGMM/Lumi/Tasks/fitLumi.cxx @@ -33,31 +33,57 @@ using namespace o2::framework::expressions; using BCPattern = std::bitset; const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; -struct fitLumi { - int nTF = 0; +struct VdMAO2D { + Configurable> collBCArray{"collBCArray", {}, "Colliding BC for the VdM"}; + Configurable fillNumber{"fillNumber", -1, "fill nuber to select the SOR and EOR ts"}; + HistogramRegistry registry; + BCPattern CollidingBunch; + std::vector collBCArrayFromCCDB; + int newRunNumber = -999; + int oldRunNumber = -999; + int nTF = 0; int nBins, nCollBins; int relTS; - Configurable startTimeInS{"startTime", 1668079200, "unix start time"}; - Configurable endTimeInS{"endTime", 1668098700, "unix end time"}; - Configurable> collBCArray{"collBCArray", {1022, 1062, 1102, 1142, 2015, 2055, 2161, 2201, 2241, 2281, 2321, 2361, 2401, 2441, 2481, 2521, 2561, 2601, 2641, 2681}, "Colliding BC for the VdM"}; + uint64_t startTimeInS, endTimeInS; void init(InitContext&) { - nBins = uint64_t(endTimeInS - startTimeInS) / 2.; + if (fillNumber == 8379) { /// VdM Nov22, pp 13.6 TeV + startTimeInS = 1668079200; + endTimeInS = 1668098700; + } else if (fillNumber == 9126) { /// VdM 23, pp 13.6 TeV + startTimeInS = 1694118600; + endTimeInS = 1694138220; + } else if (fillNumber == 9140) { /// VdM 23, Pb-Pb 5.36 ATeV + startTimeInS = 1696962082; + endTimeInS = 1696973263; + } + if (!fillNumber) { + LOG(info) << " No valid fill number"; + return; + } + + nBins = static_cast(endTimeInS - startTimeInS); nCollBins = collBCArray->size(); // Hist for FT0 registry.add("FT0/VtxTrig", "vertex trigger;ts (s); Counts", {HistType::kTH1F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}}}); registry.add("FT0/VtxTrigPerBC", "vertex trigger per BC;ts (s); Counts", {HistType::kTH2F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}, {nCollBins - 1, 0., static_cast(nCollBins)}}}); registry.add("FT0/TF", "TF ;ts (s); Counts (nTF)", {HistType::kTH1F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}}}); registry.add("FT0/CollBCMap", "BC map for the colliding bcsr;BC entry; entries", {HistType::kTH1F, {{nCollBins - 1, 0., static_cast(nCollBins)}}}); + registry.add("FT0/bcVertex", "BC distribution (FT0 vertex);ts (s); Counts", {HistType::kTH1F, {{nBCsPerOrbit, 0., nBCsPerOrbit}}}); + registry.add("FT0/bcVertexCollBC", "BC distribution (FT0 vertex-CollBC);ts (s); Counts", {HistType::kTH1F, {{nBCsPerOrbit, 0., nBCsPerOrbit}}}); // Hist for FDD registry.add("FDD/VtxTrig", "vertex trigger;ts (s); Counts", {HistType::kTH1F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}}}); + registry.add("FDD/TrigCoincidence", "Coincidence trigger;ts (s); Counts", {HistType::kTH1F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}}}); registry.add("FDD/VtxTrigPerBC", "vertex trigger per BC;ts (s); Counts", {HistType::kTH2F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}, {nCollBins - 1, 0., static_cast(nCollBins)}}}); + registry.add("FDD/CoincidenceTrigPerBC", "coincidence trigger per BC;ts (s); Counts", {HistType::kTH2F, {{nBins, 0., static_cast(endTimeInS - startTimeInS)}, {nCollBins - 1, 0., static_cast(nCollBins)}}}); + registry.add("FDD/bcVertex", "BC distribution (FDD vertex);ts (s); Counts", {HistType::kTH1F, {{nBCsPerOrbit, 0., nBCsPerOrbit}}}); + registry.add("FDD/bcVertexCollBC", "BC distribution (FDD vertex-CollBC);ts (s); Counts", {HistType::kTH1F, {{nBCsPerOrbit, 0., nBCsPerOrbit}}}); } using BCsWithTimestamps = soa::Join; - void process(aod::FT0s const& ft0s, aod::FDDs const& fdds, aod::BCsWithTimestamps const&) + void processFT0(aod::FT0s const& ft0s, aod::BCsWithTimestamps const&) { if (nTF < 1) { for (int iBin = 0; iBin < nCollBins; iBin++) { @@ -75,15 +101,36 @@ struct fitLumi { auto localBC = bc.globalBC() % nBCsPerOrbit; auto pos = std::find(collBCArray->begin(), collBCArray->end(), localBC); bool vertex = fT0Triggers[o2::fdd::Triggers::bitVertex]; - auto tsInSecond = ((bc.timestamp() * 1.e-3) - startTimeInS); // covert ts from ms to second + auto tsInSecond = ((bc.timestamp() * 1.e-3) - startTimeInS); // convert ts from ms to second if (vertex) { registry.get(HIST("FT0/VtxTrig"))->Fill(tsInSecond); + if (tsInSecond > 1600 && tsInSecond < 2400) + registry.get(HIST("FT0/bcVertex"))->Fill(localBC); if (pos != collBCArray->end()) { - registry.get(HIST("FT0/VtxTrigPerBC"))->Fill(tsInSecond, std::distance(collBCArray->begin(), pos)); + registry.get(HIST("FT0/VtxTrigPerBC"))->Fill(tsInSecond, 1 + (std::distance(collBCArray->begin(), pos))); + registry.get(HIST("FT0/bcVertexCollBC"))->Fill(localBC); } } // vertex } // ft0 + nTF++; + } // process + + PROCESS_SWITCH(VdMAO2D, processFT0, "Process FT0 trigger rates for VdM", true); + bool checkAnyCoincidence(const std::vector& channels) + { + std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; + for (const auto& pair : channelPairs) { + if (std::find(channels.begin(), channels.end(), pair.first) != channels.end() && + std::find(channels.begin(), channels.end(), pair.second) != channels.end()) { + return true; + } + } + return false; + } + + void processFDD(aod::FDDs const& fdds, aod::BCsWithTimestamps const&) + { for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); if (!bc.timestamp()) { @@ -93,23 +140,61 @@ struct fitLumi { auto localBC = bc.globalBC() % nBCsPerOrbit; auto pos = std::find(collBCArray->begin(), collBCArray->end(), localBC); bool vertex = fddTriggers[o2::fdd::Triggers::bitVertex]; - auto tsInSecond = ((bc.timestamp() * 1.e-3) - startTimeInS); // covert ts from ms to second + auto tsInSecond = ((bc.timestamp() * 1.e-3) - startTimeInS); // convert ts from ms to second + auto SideA = fdd.chargeA(); + auto SideC = fdd.chargeC(); + std::vector channelA; + std::vector channelC; + for (auto i = 0; i < 8; i++) { + if (SideA[i] > 0) { + channelA.push_back(i); + } + + if (SideC[i] > 0) { + channelC.push_back(i); + } + } + + bool isCoinA = checkAnyCoincidence(channelA); + bool isCoinC = checkAnyCoincidence(channelC); + if (vertex) { registry.get(HIST("FDD/VtxTrig"))->Fill(tsInSecond); + if (isCoinA && isCoinC) { + registry.get(HIST("FDD/TrigCoincidence"))->Fill(tsInSecond); + } + if (tsInSecond > 1600 && tsInSecond < 2400) + registry.get(HIST("FDD/bcVertex"))->Fill(localBC); if (pos != collBCArray->end()) { - registry.get(HIST("FDD/VtxTrigPerBC"))->Fill(tsInSecond, std::distance(collBCArray->begin(), pos)); + registry.get(HIST("FDD/VtxTrigPerBC"))->Fill(tsInSecond, 1 + (std::distance(collBCArray->begin(), pos))); + if (isCoinA && isCoinC) { + registry.get(HIST("FDD/CoincidenceTrigPerBC"))->Fill(tsInSecond, 1 + (std::distance(collBCArray->begin(), pos))); + } + registry.get(HIST("FDD/bcVertexCollBC"))->Fill(localBC); } + } // vertex } // fdd + } + PROCESS_SWITCH(VdMAO2D, processFDD, "Process FDD trigger rates for VdM", true); - auto timeFirstInTFinS = ft0s.iteratorAt(0).bc_as().timestamp() * 1.e-3; - registry.get(HIST("FT0/TF"))->Fill(timeFirstInTFinS - startTimeInS); - nTF++; - } // process + void processBCTable(aod::BCsWithTimestamps const& bcWTimeStamps) + { + for (auto const& bc : bcWTimeStamps) { + if (!bc.timestamp()) { + continue; + } else { + auto timeFirstInTFinS = bc.timestamp() * 1.e-3; + registry.get(HIST("FT0/TF"))->Fill(timeFirstInTFinS - startTimeInS); + } + } + } + + PROCESS_SWITCH(VdMAO2D, processBCTable, "Process BC table for VdM", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"ft0qavdm"})}; + adaptAnalysisTask(cfgc, TaskName{"VdMAO2D"})}; } diff --git a/Tutorials/PWGHF/skimCreatorMini.cxx b/Tutorials/PWGHF/skimCreatorMini.cxx index 68550e2fa0b..6f20d6ac6fb 100644 --- a/Tutorials/PWGHF/skimCreatorMini.cxx +++ b/Tutorials/PWGHF/skimCreatorMini.cxx @@ -15,6 +15,7 @@ /// \author Vít Kučera , Inha University // O2 +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -27,7 +28,6 @@ #include "Common/DataModel/TrackSelectionTables.h" // PWGHF -#include "PWGHF/Core/PDG.h" #include "Tutorials/PWGHF/DataModelMini.h" using namespace o2; @@ -186,7 +186,7 @@ struct HfTrackIndexSkimCreator { registry.fill(HIST("hVtx2ProngY"), secondaryVertex[1]); registry.fill(HIST("hVtx2ProngZ"), secondaryVertex[2]); std::array, 2> arrMom = {pVec0, pVec1}; - auto mass2Prong = RecoDecay::m(arrMom, std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus}); + auto mass2Prong = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); registry.fill(HIST("hMassD0ToPiK"), mass2Prong); } } diff --git a/Tutorials/PWGHF/taskMini.cxx b/Tutorials/PWGHF/taskMini.cxx index c66226058c1..8d53fe05251 100644 --- a/Tutorials/PWGHF/taskMini.cxx +++ b/Tutorials/PWGHF/taskMini.cxx @@ -15,6 +15,7 @@ /// \author Vít Kučera , Inha University // O2 +#include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -109,8 +110,8 @@ struct HfCandidateCreator2Prong { // fill histograms // calculate invariant masses auto arrayMomenta = std::array{pVec0, pVec1}; - massPiK = RecoDecay::m(arrayMomenta, std::array{o2::analysis::pdg::MassPiPlus, o2::analysis::pdg::MassKPlus}); - massKPi = RecoDecay::m(arrayMomenta, std::array{o2::analysis::pdg::MassKPlus, o2::analysis::pdg::MassPiPlus}); + massPiK = RecoDecay::m(arrayMomenta, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); + massKPi = RecoDecay::m(arrayMomenta, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); hMass->Fill(massPiK); // hMass->Fill(massKPi); } @@ -183,11 +184,11 @@ struct HfCandidateSelectorD0 { { // invariant-mass cut if (trackPion.sign() > 0) { - if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::analysis::pdg::MassD0) > massWindow) { + if (std::abs(hfHelper.invMassD0ToPiK(candidate) - o2::constants::physics::MassD0) > massWindow) { return false; } } else { - if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::analysis::pdg::MassD0) > massWindow) { + if (std::abs(hfHelper.invMassD0barToKPi(candidate) - o2::constants::physics::MassD0) > massWindow) { return false; } } diff --git a/Tutorials/PWGLF/Resonance/resonances_step1.cxx b/Tutorials/PWGLF/Resonance/resonances_step1.cxx index 915b1248424..2f566ace97c 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step1.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step1.cxx @@ -16,11 +16,11 @@ #include #include +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" -#include "PWGHF/Core/PDG.h" using namespace o2; using namespace o2::framework; @@ -53,7 +53,7 @@ struct resonances_tutorial { Configurable nsigmacutTOF{"nsigmacutTOF", 3.0, "Value of the TOF Nsigma cut"}; // variables - double massKa = o2::analysis::pdg::MassKPlus; + double massKa = o2::constants::physics::MassKPlus; // Initialize the ananlysis task void init(o2::framework::InitContext&) @@ -116,7 +116,7 @@ struct resonances_tutorial { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { - auto multiplicity = collision.multV0M(); + auto multiplicity = collision.cent(); for (auto track1 : dTracks1) { // loop over all dTracks1 if (!trackCut(track1) || !selectionPID(track1)) { continue; // track selection and PID selection @@ -168,7 +168,7 @@ struct resonances_tutorial { { // Fill the event counter histos.fill(HIST("hVertexZ"), collision.posZ()); - histos.fill(HIST("hMultiplicityPercent"), collision.multV0M()); + histos.fill(HIST("hMultiplicityPercent"), collision.cent()); fillHistograms(collision, resotracks, resotracks); // Fill histograms, no MC, no mixing } diff --git a/Tutorials/PWGLF/Resonance/resonances_step2.cxx b/Tutorials/PWGLF/Resonance/resonances_step2.cxx index 930f7d44abb..000bbf1e501 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step2.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step2.cxx @@ -15,11 +15,11 @@ #include +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" -#include "PWGHF/Core/PDG.h" using namespace o2; using namespace o2::framework; @@ -58,7 +58,7 @@ struct resonances_tutorial { ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0., 1., 5., 10., 30., 50., 70., 100., 110.}, "Mixing bins - multiplicity"}; // variables - double massKa = o2::analysis::pdg::MassKPlus; + double massKa = o2::constants::physics::MassKPlus; // Initialize the ananlysis task void init(o2::framework::InitContext&) @@ -123,7 +123,7 @@ struct resonances_tutorial { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { - auto multiplicity = collision.multV0M(); + auto multiplicity = collision.cent(); for (auto track1 : dTracks1) { // loop over all dTracks1 if (!trackCut(track1) || !selectionPID(track1)) { continue; // track selection and PID selection @@ -182,14 +182,14 @@ struct resonances_tutorial { { // Fill the event counter histos.fill(HIST("hVertexZ"), collision.posZ()); - histos.fill(HIST("hMultiplicityPercent"), collision.multV0M()); + histos.fill(HIST("hMultiplicityPercent"), collision.cent()); fillHistograms(collision, resotracks, resotracks); // Fill histograms, no MC, no mixing } PROCESS_SWITCH(resonances_tutorial, process, "Process event for data", true); // Basic processing // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; + using BinningTypeVtxZT0M = ColumnBinningPolicy; void processME(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks) { auto tracksTuple = std::make_tuple(resotracks);