From dd98e1f07a4b3c77a68395b63932030d4a6b7340 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Thu, 14 Oct 2021 16:51:32 +0200 Subject: [PATCH 01/22] Adding the first incomplete version of the creator and the selector --- PWGHF/Core/HFSelectorCuts.h | 57 +++ PWGHF/DataModel/HFCandidateSelectionTables.h | 7 + PWGHF/DataModel/HFSecondaryVertex.h | 96 ++++- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 389 ++++++++++++++++++ .../HFLbToLcPiCandidateSelector.cxx | 158 +++++++ 5 files changed, 705 insertions(+), 2 deletions(-) create mode 100644 PWGHF/TableProducer/HFCandidateCreatorLb.cxx create mode 100644 PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx diff --git a/PWGHF/Core/HFSelectorCuts.h b/PWGHF/Core/HFSelectorCuts.h index 571da8ba6d8..7252b9aeb3f 100644 --- a/PWGHF/Core/HFSelectorCuts.h +++ b/PWGHF/Core/HFSelectorCuts.h @@ -30,6 +30,7 @@ enum Code { kLambdaCPlus = 4122, kXiCPlus = 4232, kXiCCPlusPlus = 4422, + kLambdaB0 = 5122, kJpsi = 443, kChic1 = 20443, kBPlus = 521, @@ -536,6 +537,62 @@ static const std::vector pTBinLabels = { static const std::vector cutVarLabels = {"m", "CPA", "d0 D0", "d0 Pi", "pT D0", "pT Pi", "B decLen", "B decLenXY", "Imp. Par. Product", "DeltaMD0", "Cos ThetaStar"}; } // namespace hf_cuts_bplus_tod0pi +namespace hf_cuts_lb_tolcpi +{ +static constexpr int npTBins = 12; +static constexpr int nCutVars = 11; +// default values for the pT bin edges (can be used to configure histogram axis) +// offset by 1 from the bin numbers in cuts array +constexpr double pTBins[npTBins + 1] = { + 0, + 0.5, + 1.0, + 2.0, + 3.0, + 4.0, + 5.0, + 7.0, + 10.0, + 13.0, + 16.0, + 20.0, + 24.0}; + +auto pTBins_v = std::vector{pTBins, pTBins + npTBins + 1}; + +// default values for the cuts +// DeltaM CPA d0Lc d0Pi pTLc pTPi LbDecayLength LbDecayLengthXY IPProd DeltaMLc CthetaStr +constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 1 < pt < 2 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 2 < pt < 3 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 3 < pt < 4 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 4 < pt < 5 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 5 < pt < 7 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 7 < pt < 10 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 10 < pt < 13 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 13 < pt < 16 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 16 < pt < 20 */ + {1., 0.8, 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}}; /* 20 < pt < 24 */ +// row labels +static const std::vector pTBinLabels = { + "pT bin 0", + "pT bin 1", + "pT bin 2", + "pT bin 3", + "pT bin 4", + "pT bin 5", + "pT bin 6", + "pT bin 7", + "pT bin 8", + "pT bin 9", + "pT bin 10", + "pT bin 11"}; + +// column labels +static const std::vector cutVarLabels = {"m", "CPA", "d0 Lc+", "d0 Pi", "pT Lc+", "pT Pi", "Lb decLen", "Lb decLenXY", "Imp. Par. Product", "DeltaMLc", "Cos ThetaStar"}; +} // namespace hf_cuts_lb_tolcpi + namespace hf_cuts_x_tojpsipipi { static constexpr int npTBins = 9; diff --git a/PWGHF/DataModel/HFCandidateSelectionTables.h b/PWGHF/DataModel/HFCandidateSelectionTables.h index 896f5204627..50d790f4c7a 100644 --- a/PWGHF/DataModel/HFCandidateSelectionTables.h +++ b/PWGHF/DataModel/HFCandidateSelectionTables.h @@ -176,6 +176,13 @@ DECLARE_SOA_COLUMN(IsSelBPlusToD0Pi, isSelBPlusToD0Pi, int); //! DECLARE_SOA_TABLE(HFSelBPlusToD0PiCandidate, "AOD", "HFSELBPLUSCAND", //! hf_selcandidate_bplus::IsSelBPlusToD0Pi); +namespace hf_selcandidate_lb +{ +DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //! +} // namespace hf_selcandidate_lb +DECLARE_SOA_TABLE(HFSelLbToLcPiCandidate, "AOD", "HFSELLBCAND", //! + hf_selcandidate_lb::IsSelLbToLcPi); + namespace hf_selcandidate_x { DECLARE_SOA_COLUMN(IsSelXToJpsiToEEPiPi, isSelXToJpsiToEEPiPi, int); //! diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 81711a84a73..cb49959b597 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -300,13 +300,11 @@ auto EJpsi(const T& candidate) } // J/ψ → e+ e− - template auto InvMassJpsiToEE(const T& candidate) { return candidate.m(array{RecoDecay::getMassPDG(kElectron), RecoDecay::getMassPDG(kElectron)}); } - // J/ψ → μ+ μ− template @@ -1064,6 +1062,100 @@ DECLARE_SOA_TABLE(HfCandChicMCGen, "AOD", "HFCANDCHICMCGEN", //! hf_cand_chic::FlagMCMatchGen, hf_cand_chic::OriginMCGen, hf_cand_chic::FlagMCDecayChanGen); + + + +// specific Lb candidate properties +namespace hf_cand_lb +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, HfCandProng3, "_0"); // Lb index +// MC matching result: +DECLARE_SOA_COLUMN(FlagMCMatchRec, flagMCMatchRec, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(FlagMCMatchGen, flagMCMatchGen, int8_t); // generator level +DECLARE_SOA_COLUMN(OriginMCRec, originMCRec, int8_t); // particle origin, reconstruction level +DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); // particle origin, generator level +DECLARE_SOA_COLUMN(FlagMCDecayChanRec, flagMCDecayChanRec, int8_t); // resonant decay channel flag, reconstruction level +DECLARE_SOA_COLUMN(FlagMCDecayChanGen, flagMCDecayChanGen, int8_t); // resonant decay channel flag, generator level +// mapping of decay types +enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? +} // namespace hf_cand_lb + +// Λb → Λc+ π- → p K- π+ π- +float massLb = RecoDecay::getMassPDG(5122); // replace this with: "RecoDecay::getMassPDG(9920443)" when pdg is added +template +auto CtLb(const T& candidate) +{ + return candidate.ct(massLb); +} + +template +auto YLb(const T& candidate) +{ + return candidate.y(massLb); +} + +template +auto ELb(const T& candidate) +{ + return candidate.e(massLb); +} +template +auto InvMassLbToLcPi(const T& candidate) +{ + return candidate.m(array{RecoDecay::getMassPDG(4122), RecoDecay::getMassPDG(kPiPlus)}); +} + +// declare dedicated Lb candidate table +DECLARE_SOA_TABLE(HfCandLbBase, "AOD", "HFCANDLBBASE", + // general columns + HFCAND_COLUMNS, + // 3-prong specific columns + hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, + hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, + hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, + hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, + hf_cand_lb::Index0Id, hf_track_index::Index1Id, + hf_track_index::HFflag, + /* dynamic columns */ + hf_cand_prong2::M, + hf_cand_prong2::M2, + /* dynamic columns that use candidate momentum components */ + hf_cand::Pt, + hf_cand::Pt2, + hf_cand::P, + hf_cand::P2, + hf_cand::PVector, + hf_cand::CPA, + hf_cand::CPAXY, + hf_cand::Ct, + hf_cand::ImpactParameterXY, + hf_cand_prong2::MaxNormalisedDeltaIP, + hf_cand::Eta, + hf_cand::Phi, + hf_cand::Y, + hf_cand::E, + hf_cand::E2); + +// extended table with expression columns that can be used as arguments of dynamic columns +DECLARE_SOA_EXTENDED_TABLE_USER(HfCandLbExt, HfCandLbBase, "HFCANDLBEXT", + hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz); + +using HfCandLb = HfCandLbExt; + +// table with results of reconstruction level MC matching +DECLARE_SOA_TABLE(HfCandLbMCRec, "AOD", "HFCANDLbMCREC", //! + hf_cand_lb::FlagMCMatchRec, + hf_cand_lb::OriginMCRec, + hf_cand_lb::FlagMCDecayChanRec); + +// table with results of generator level MC matching +DECLARE_SOA_TABLE(HfCandLbMCGen, "AOD", "HFCANDLBMCGEN", //! + hf_cand_lb::FlagMCMatchGen, + hf_cand_lb::OriginMCGen, + hf_cand_lb::FlagMCDecayChanGen); + } // namespace o2::aod + + #endif // O2_ANALYSIS_HFSECONDARYVERTEX_H_ diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx new file mode 100644 index 00000000000..bc7f3609aa8 --- /dev/null +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -0,0 +1,389 @@ +// 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 HFCandidateCreatorX.cxx +/// \brief Reconstruction of X(3872) candidates +/// \note Adapted from HFCandidateCreator3Prong +/// +/// \author Panos Christakoglou , Nikhef + +#include "Framework/AnalysisTask.h" +#include "DetectorsVertexing/DCAFitterN.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "Common/Core/trackUtilities.h" +#include "ReconstructionDataFormats/DCA.h" +#include "ReconstructionDataFormats/V0.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::aod::hf_cand; +using namespace o2::aod::hf_cand_prong2; +using namespace o2::aod::hf_cand_prong3; +using namespace o2::aod::hf_cand_lb; +using namespace o2::framework::expressions; + +void customize(std::vector& workflowOptions) +{ + ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, true, {"Perform MC matching."}}; + workflowOptions.push_back(optionDoMC); +} + +#include "Framework/runDataProcessing.h" + +/// Reconstruction of Λb candidates +struct HFCandidateCreatorLb { + Produces rowCandidateBase; + + Configurable magneticField{"magneticField", 5., "magnetic field"}; + Configurable b_propdca{"b_propdca", true, "create tracks version propagated to PCA"}; + Configurable d_maxr{"d_maxr", 200., "reject PCA's above this radius"}; + Configurable d_maxdzini{"d_maxdzini", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable d_minparamchange{"d_minparamchange", 1.e-3, "stop iterations if largest change of any Lb is smaller than this"}; + Configurable d_minrelchi2change{"d_minrelchi2change", 0.9, "stop iterations is chi2/chi2old > this"}; + Configurable ptPionMin{"ptPionMin", 0.15, "minimum pion pT threshold (GeV/c)"}; + Configurable b_dovalplots{"b_dovalplots", true, "do validation plots"}; + + OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "Lc+ candidates;inv. mass (#mu^{#plus} #mu^{#minus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; + OutputObj hPtLc{TH1F("hPtLc", "J/#psi candidates;candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; + OutputObj hPtPion{TH1F("hPtPion", "#pi candidates;candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; + OutputObj hCPALc{TH1F("hCPALc", "J/#psi candidates;cosine of pointing angle;entries", 110, -1.1, 1.1)}; + OutputObj hMassLbToLcPi{TH1F("hMassLbToLcPi", "3-prong candidates;inv. mass (Lc+ (#rightarrow pKpi) #pi-) (GeV/#it{c}^{2});entries", 500, 3., 8.)}; + OutputObj hCovPVXX{TH1F("hCovPVXX", "3-prong candidates;XX element of cov. matrix of prim. vtx position (cm^{2});entries", 100, 0., 1.e-4)}; + OutputObj hCovSVXX{TH1F("hCovSVXX", "3-prong candidates;XX element of cov. matrix of sec. vtx position (cm^{2});entries", 100, 0., 0.2)}; + + double massPi = RecoDecay::getMassPDG(kPiMinus); + double massLc = RecoDecay::getMassPDG(4122); + double massLcPi; + + Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; + Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; + Filter filterSelectCandidates = (aod::hf_selcandidate_lc::isSelLcpKpi >= d_selectionFlagLc || aod::hf_selcandidate_lc::isSelLcpiKp >= d_selectionFlagLc); + + void process(aod::Collision const& collision, + soa::Filtered> const& lcCands, + aod::BigTracks const& tracks) + { + // 3-prong vertex fitter (to rebuild Lc vertex) + o2::vertexing::DCAFitterN<2> df2; + df2.setBz(magneticField); + df2.setPropagateToPCA(b_propdca); + df2.setMaxR(d_maxr); + df2.setMaxDZIni(d_maxdzini); + df2.setMinParamChange(d_minparamchange); + df2.setMinRelChi2Change(d_minrelchi2change); + df2.setUseAbsDCA(true); + + // 3-prong vertex fitter + o2::vertexing::DCAFitterN<3> df3; + df3.setBz(magneticField); + df3.setPropagateToPCA(b_propdca); + df3.setMaxR(d_maxr); + df3.setMaxDZIni(d_maxdzini); + df3.setMinParamChange(d_minparamchange); + df3.setMinRelChi2Change(d_minrelchi2change); + df3.setUseAbsDCA(true); + + // loop over Lc candidates + for (auto& lcCand : lcCands) { + if (!(lcCand.hfflag() & 1 << hf_cand_prong3::DecayType::LcToPKPi) && !(lcCand.hfflag() & 1 << hf_cand_prong3::DecayType::LcToPKPi)) { + continue; + } + if (cutYCandMax >= 0. && std::abs(YLc(lcCand)) > cutYCandMax) { + continue; + } + if (lcCand.isSelLcpKpi() > 0) { + hMassLcToPKPi->Fill(InvMassLcpKpi(lcCand)); + } + //if (jpsiCand.isSelLcToPiKP() > 0) { + //hMassLcToPKPi->Fill(InvMassLcToMuMu(jpsiCand)); + //} + hPtLc->Fill(lcCand.pt()); + hCPALc->Fill(lcCand.cpa()); + // create Lc track to pass to DCA fitter; use cand table + rebuild vertex + const std::array vertexLc = {lcCand.xSecondaryVertex(), lcCand.ySecondaryVertex(), lcCand.zSecondaryVertex()}; + array pvecLc = {lcCand.px(), lcCand.py(), lcCand.pz()}; + auto prong0 = lcCand.index0_as(); + auto prong1 = lcCand.index1_as(); + auto prong2 = lcCand.index2_as(); + auto prong0TrackParCov = getTrackParCov(prong0); + auto prong1TrackParCov = getTrackParCov(prong1); + auto prong2TrackParCov = getTrackParCov(prong1); + + if (df3.process(prong0TrackParCov, prong1TrackParCov, prong2TrackParCov) == 0) { + continue; + } + + // propogate prong tracks to Lc vertex + prong0TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); + prong1TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); + prong2TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); + const std::array covLc = df3.calcPCACovMatrixFlat(); + // define the Lc track + auto trackLc = o2::dataformats::V0(vertexLc, pvecLc, covLc, prong0TrackParCov, prong1TrackParCov, {0, 0}, {0, 0}); //FIXME: also needs covxyz??? + + // used to check that prongs used for Lc and X reco are not the same prongs + int index0Lc = lcCand.index0Id(); + int index1Lc = lcCand.index1Id(); + int index2Lc = lcCand.index2Id(); + + // loop over pi- candidates + for (auto& trackNeg : tracks) { + if (trackNeg.sign() > 0) { // select only negative tracks - use partitions? + continue; + } + if (trackNeg.globalIndex() == index2Lc) { + continue; + } + if (trackNeg.pt() < ptPionMin) { + continue; + } + hPtPion->Fill(trackNeg.pt()); + + auto trackParVarNeg = getTrackParCov(trackNeg); + array pvecNeg; + + // reconstruct the 3-prong X vertex + if (df2.process(trackLc, trackParVarNeg) == 0) { + continue; + } + + // calculate relevant properties + const auto& LbsecondaryVertex = df2.getPCACandidate(); + auto chi2PCA = df2.getChi2AtPCACandidate(); + auto covMatrixPCA = df2.calcPCACovMatrix().Array(); + hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line. + + df2.propagateTracksToVertex(); // propagate the pions and Lc to the X vertex + df2.getTrack(0).getPxPyPzGlo(pvecLc); // update momentum of Lc at the Lb vertex + df2.getTrack(1).getPxPyPzGlo(pvecNeg); // momentum of pi- at the Lb vertex + + // get track impact parameters + // This modifies track momenta! + auto primaryVertex = getPrimaryVertex(collision); + auto covMatrixPV = primaryVertex.getCov(); + hCovPVXX->Fill(covMatrixPV[0]); + o2::dataformats::DCA impactParameter0; + o2::dataformats::DCA impactParameter1; + trackParVarNeg.propagateToDCA(primaryVertex, magneticField, &impactParameter1); + + // get uncertainty of the decay length + double phi, theta; + getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, LbsecondaryVertex, phi, theta); + auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); + auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); + + int hfFlag = 0; + if (TESTBIT(lcCand.hfflag(), hf_cand_prong3::DecayType::LcToPKPi)) { + SETBIT(hfFlag, hf_cand_lb::DecayType::LbToLcPi); + } + /* if (TESTBIT(jpsiCand.hfflag(), hf_cand_prong2::DecayType::LcToEE)) { + SETBIT(hfFlag, hf_cand_x::DecayType::XToLcToEEPiPi); // dielectron channel + }*/ + + // fill the candidate table for the Lb here: + rowCandidateBase(collision.globalIndex(), + collision.posX(), collision.posY(), collision.posZ(), + LbsecondaryVertex[0], LbsecondaryVertex[1], LbsecondaryVertex[2], + errorDecayLength, errorDecayLengthXY, + chi2PCA, + pvecLc[0], pvecLc[1], pvecLc[2], + pvecNeg[0], pvecNeg[1], pvecNeg[2], + impactParameter0.getY(), impactParameter1.getY(), + std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), + lcCand.globalIndex(), trackNeg.globalIndex(), + hfFlag); + + // calculate invariant mass + auto arrayMomenta = array{pvecLc, pvecNeg}; + massLcPi = RecoDecay::M(std::move(arrayMomenta), array{massLc, massPi}); + if (lcCand.isSelLcpKpi() > 0) { + hMassLbToLcPi->Fill(massLcPi); + } + } // pi- loop + } // Lc loop + } // process +}; // struct + +/// Extends the base table with expression columns. +struct HFCandidateCreatorLbExpressions { + Spawns rowCandidateLb; + void init(InitContext const&) {} +}; + +/// Performs MC matching. +/*struct HfCandidateCreatorLbMc { + Produces rowMCMatchRec; + Produces rowMCMatchGen; + + void process(aod::HfCandLb const& candidates, + aod::HfCandProng2, + aod::BigTracksMC const& tracks, + aod::McParticles const& particlesMC) + { + int indexRec = -1, indexRecLc = -1; + int8_t signLb = 0, signLc = 0; + int8_t flag = 0; + int kLcpdg = pdg::Code::kLambdaCPlus; + + // Match reconstructed candidates. + for (auto& candidate : candidates) { + //Printf("New rec. candidate"); + + flag = 0; + auto candDaughterLc = candidate.index0_as(); + auto arrayDaughtersLc = array{candDaughterLc.index0_as(), candDaughterLc.index1_as(), candDaughterLc.index2_as()}; + auto arrayDaughters = array{candidate.index1_as(), candDaughterLc.index0_as(), candDaughterLc.index1_as(), candDaughterLc.index2_as()}; + + // Λb → Λc+ π- → (p K± π∓) π± + //Printf("Checking Λb → Λc+ π- → (p K± π∓) π±"); + indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{+kProton, kKPlus, -kPiPlus}, true); + if (indexRecLc > -1) { + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{+kProton, kKPlus, -kPiPlus, -kPiPlus}, true, &signLb, 2); + if (indexRec > -1) { + flag = 1 << hf_cand_x::DecayType::LbToLcPi; + } + } + + if (indexRecLc > -1 && indexRec > -1) { + flag = signLb * (1 << hf_cand_lb::DecayType::LbToLcPi); + } + rowMCMatchRec(flag); + } + + // Match generated particles. + for (auto& particle : particlesMC) { + //Printf("New gen. candidate"); + flag = 0; + signLb = 0; + signLc = 0; + int indexGenLc = -1; + + // Λb → Λc+ π- → (p K± π∓) π± + //Printf("Checking Λb → Λc+ π- → (p K± π∓) π±"); + std::vector arrayDaughterLb; + if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, array{pdg::Code::kLambdaCPlus, -kPiPlus}, true, &signLb, 1, &arrayDaughterLb)) { + // Λc+ → p K± π∓ + //Printf("Checking Λc+ → p K± π∓"); + for (auto iD : arrayDaughterLb) { + auto candDaughterMC = particlesMC.iteratorAt(iD); + if (std::abs(candDaughterMC.pdgCode()) == pdg::Code::kLambdaCPlus) { + indexGenLc = RecoDecay::isMatchedMCGen(particlesMC, candDaughterMC, pdg::Code::kLambdaCPlus, array{kProton, kKPlus, -kPiPlus}, true, &signLc, 1); + } + } + if (indexGenLc > -1) { + flag = signLb * (1 << hf_cand_lb::DecayType::LbToLcPi); + } + } + rowMCMatchGen(flag); + } //Lb candidate + } // process +}; */ // struct + +/// Performs MC matching. +struct HFCandidateCreatorLbMC { + Produces rowMCMatchRec; + Produces rowMCMatchGen; + + void process(aod::HfCandLb const& candidates, + aod::HfCandProng2, + aod::BigTracksMC const& tracks, + aod::McParticles const& particlesMC) + { + int indexRec = -1; + int indexRecLc = -1; + int pdgCodeLb = 4122;//pdg::Code::kLb; + int pdgCodeLc = 5122;//pdg::Code::kLc; + int8_t sign = 0; + int8_t flag = 0; + int8_t origin = 0; + int8_t channel = 0; + + // Match reconstructed candidates. + for (auto& candidate : candidates) { + //Printf("New rec. candidate"); + flag = 0; + origin = 0; + channel = 0; + auto lcTrack = candidate.index0(); + auto daughter0Lc = lcTrack.index0_as(); + auto daughter1Lc = lcTrack.index1_as(); + auto daughter2Lc = lcTrack.index2_as(); + auto arrayLcDaughters = array{daughter0Lc, daughter1Lc, daughter2Lc}; + auto arrayDaughters = array{candidate.index0_as(), + candidate.index1_as(), + daughter0Lc, + daughter1Lc, + daughter2Lc}; + + //Fix this part + // Λb → Λc+ π- + //Printf("Checking Λb → Λc+ π-"); + indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdgCodeLc, array{+kProton, kKPlus, -kPiPlus}, true); + if (indexRecLc > -1) { + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeLb, array{+kProton, kKPlus, -kPiPlus, -kPiPlus}, true, &sign, 2); + if (indexRec > -1) { + flag = 1 << hf_cand_lb::DecayType::LbToLcPi; + } + } + + // Check whether the particle is non-prompt (from a b quark). + if (flag != 0) { + auto particle = particlesMC.iteratorAt(indexRec); + origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); + } + + rowMCMatchRec(flag, origin, channel); + } + + // Match generated particles. + for (auto& particle : particlesMC) { + //Printf("New gen. candidate"); + flag = 0; + origin = 0; + channel = 0; + + // Λb → Λc+ π- + //Printf("Checking Λb → Λc+ π-"); + if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodeLb, array{pdgCodeLc, -kPiPlus}, true)) { + // Match Λc+ --> pKπ- + std::vector arrDaughter; + RecoDecay::getDaughters(particlesMC, particle, &arrDaughter, array{pdgCodeLc}, 1); + auto lcCandMC = particlesMC.iteratorAt(arrDaughter[0]); + if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdgCodeLc, array{+kProton, kKPlus, -kPiPlus}, true)) { + flag = 1 << hf_cand_lb::DecayType::LbToLcPi; + } + } + + // Check whether the particle is non-prompt (from a b quark). + if (flag != 0) { + origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); + } + + rowMCMatchGen(flag, origin, channel); + } // candidate loop + } // process +}; // struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc, TaskName{"hf-cand-creator-lb"}), + adaptAnalysisTask(cfgc, TaskName{"hf-cand-creator-lb-expressions"})}; + const bool doMC = cfgc.options().get("doMC"); + if (doMC) { + workflow.push_back(adaptAnalysisTask(cfgc, TaskName{"hf-cand-creator-lb-mc"})); + } + return workflow; +} diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx new file mode 100644 index 00000000000..164bbb1eda6 --- /dev/null +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -0,0 +1,158 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See http://alice-o2.web.cern.ch/license for full licensing information. +// +// 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 HFLbToLcPiCandidateSelector.cxx +/// \brief Λb0 → Λc+ π- candidate selector +/// +/// \author Panos Christakoglou , Nikhef + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "PWGHF/Core/HFSelectorCuts.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" +#include "PWGHF/Core/HFSelectorCuts.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::aod::hf_cand_lb; +using namespace o2::analysis; +using namespace o2::aod::hf_cand_prong2; +using namespace o2::analysis::hf_cuts_lb_tolcpi; + +struct HfLbToLcPiCandidateSelector { + Produces hfSelLbToLcPiCandidate; + + Configurable pTCandMin{"pTCandMin", 0., "Lower bound of candidate pT"}; + Configurable pTCandMax{"pTCandMax", 50., "Upper bound of candidate pT"}; + + //Track quality + Configurable TPCNClsFindablePIDCut{"TPCNClsFindablePIDCut", 70., "Lower bound of TPC findable clusters for good PID"}; + + //TPC PID + Configurable pidTPCMinpT{"pidTPCMinpT", 0.15, "Lower bound of track pT for TPC PID"}; + Configurable pidTPCMaxpT{"pidTPCMaxpT", 10., "Upper bound of track pT for TPC PID"}; + Configurable nSigmaTPC{"nSigmaTPC", 5., "Nsigma cut on TPC only"}; + Configurable nSigmaTPCCombined{"nSigmaTPCCombined", 5., "Nsigma cut on TPC combined with TOF"}; + + //TOF PID + Configurable pidTOFMinpT{"pidTOFMinpT", 0.15, "Lower bound of track pT for TOF PID"}; + Configurable pidTOFMaxpT{"pidTOFMaxpT", 10., "Upper bound of track pT for TOF PID"}; + Configurable nSigmaTOF{"nSigmaTOF", 5., "Nsigma cut on TOF only"}; + Configurable nSigmaTOFCombined{"nSigmaTOFCombined", 5., "Nsigma cut on TOF combined with TPC"}; + + Configurable> pTBins{"pTBins", std::vector{hf_cuts_lb_tolcpi::pTBins_v}, "pT bin limits"}; + Configurable> cuts{"Lb_to_lcpi_cuts", {hf_cuts_lb_tolcpi::cuts[0], npTBins, nCutVars, pTBinLabels, cutVarLabels}, "Lb0 candidate selection per pT bin"}; + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc+"}; + //Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + + // Apply topological cuts as defined in HFSelectorCuts.h; return true if candidate passes all cuts + template + bool selectionTopol(const T1& hfCandLb, const T2& hfCandLc, const T3& trackPi) + { + auto candpT = hfCandLb.pt(); + int pTBin = findBin(pTBins, candpT); + if (pTBin == -1) { + // Printf("Lb topol selection failed at getpTBin"); + return false; + } + + //pi pt + if (trackPi.pt() < cuts->get(pTBin, "pT Pi")) { + return false; + } + + //d0(Lc)xd0(pi) ==> removed temporarily + //if (hfCandLb.impactParameterProduct() > cuts->get(pTBin, "Imp. Par. Product")) { + //return false; + //} + + //Lc mass ==> removed temporarily + //if (trackPi.sign() < 0) { + //if (std::abs(InvMassLcpKpi(hfCandLc) - RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus)) > cuts->get(pTBin, "DeltaMLc")) { + // return false; + //} + //} + + //Lb Decay length + if (hfCandLb.decayLength() < cuts->get(pTBin, "Lb decLen")) { + return false; + } + + //Lb Decay length XY + if (hfCandLb.decayLengthXY() < cuts->get(pTBin, "Lb decLenXY")) { + return false; + } + + //Lb CPA cut + if (hfCandLb.cpa() < cuts->get(pTBin, "CPA")) { + return false; + } + + //if (candpT < pTCandMin || candpT >= pTCandMax) { + // Printf("B+ topol selection failed at cand pT check"); + // return false; + // } + + //B+ mass cut + //if (std::abs(InvMassBPlus(hfCandBPlus) - RecoDecay::getMassPDG(521)) > cuts->get(pTBin, "m")) { + // Printf("B+ topol selection failed at mass diff check"); + // return false; + // } + + //d0 of D0 and pi + //if ((std::abs(hfCandBPlus.impactParameter0()) > cuts->get(pTBin, "d0 D0")) || + // (std::abs(hfCandBPlus.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))){ + // return false; + //} + //D0 CPA + // if (std::abs(hfCandD0.cpa()) < cuts->get(pTBin, "CPA D0")){ + // return false; + //} + return true; + } + + void process(aod::HfCandLb const& hfCandLbs, soa::Join, aod::BigTracksPID const& tracks) + { + for (auto& hfCandLb : hfCandLbs) { //looping over Lb candidates + + int statusLb = 0; + + // check if flagged as Λb --> Λc+ π- + if (!(hfCandLb.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { + hfSelLbToLcPiCandidate(statusLb); + // Printf("Lb candidate selection failed at hfflag check"); + continue; + } + + // Lc is always index0 and pi is index1 by default + auto candLc = hfCandLb.index0_as>(); + auto trackPi = hfCandLb.index1_as(); + + //topological cuts + if (!selectionTopol(hfCandLb, candLc, trackPi)) { + hfSelLbToLcPiCandidate(statusLb); + // Printf("Lb candidate selection failed at selection topology"); + continue; + } + + hfSelLbToLcPiCandidate(1); + // Printf("Lb candidate selection successful, candidate should be selected"); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{}; + workflow.push_back(adaptAnalysisTask(cfgc)); + return workflow; +} From f67310cb0a944c9f94e5b1eace6094505d4297f2 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Thu, 14 Oct 2021 16:57:13 +0200 Subject: [PATCH 02/22] Adding the first incomplete version of the creator and the selector --- PWGHF/TableProducer/CMakeLists.txt | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 832f8d6f8d9..5f44a91dcb8 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -44,16 +44,21 @@ o2physics_add_dpl_workflow(candidate-creator-xicc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-x - SOURCES HFCandidateCreatorX.cxx +o2physics_add_dpl_workflow(candidate-creator-lb + SOURCES HFCandidateCreatorLb.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-chic - SOURCES HFCandidateCreatorChic.cxx +o2physics_add_dpl_workflow(candidate-creator-x + SOURCES HFCandidateCreatorX.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) +#o2physics_add_dpl_workflow(candidate-creator-chic +# SOURCES HFCandidateCreatorChic.cxx +# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG +# COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tree-creator-lc-topkpi SOURCES HFTreeCreatorLcToPKPi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG @@ -134,13 +139,18 @@ o2physics_add_dpl_workflow(bplus-tod0pi-candidate-selector PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(x-tojpsipipi-candidate-selector - SOURCES HFXToJpsiPiPiCandidateSelector.cxx +o2physics_add_dpl_workflow(lb-tolcpi-candidate-selector + SOURCES HFLbToLcPiCandidateSelector.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(chic-tojpsigamma-candidate-selector - SOURCES HFChicToJpsiGammaCandidateSelector.cxx +o2physics_add_dpl_workflow(x-tojpsipipi-candidate-selector + SOURCES HFXToJpsiPiPiCandidateSelector.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) +#o2physics_add_dpl_workflow(chic-tojpsigamma-candidate-selector +# SOURCES HFChicToJpsiGammaCandidateSelector.cxx +# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing +# COMPONENT_NAME Analysis) + From adf71bc7b8b2bc5124d28d81c247d6be11d0bb06 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Thu, 14 Oct 2021 17:45:41 +0200 Subject: [PATCH 03/22] Adding the Lb task --- PWGHF/Tasks/CMakeLists.txt | 5 + PWGHF/Tasks/taskLb.cxx | 265 +++++++++++++++++++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 PWGHF/Tasks/taskLb.cxx diff --git a/PWGHF/Tasks/CMakeLists.txt b/PWGHF/Tasks/CMakeLists.txt index a3ad6de0e7b..51fdd24d55a 100644 --- a/PWGHF/Tasks/CMakeLists.txt +++ b/PWGHF/Tasks/CMakeLists.txt @@ -70,6 +70,11 @@ o2physics_add_dpl_workflow(task-bplus PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-lb + SOURCES taskLb.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(task-xic SOURCES taskXic.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx new file mode 100644 index 00000000000..4e8974c5e6b --- /dev/null +++ b/PWGHF/Tasks/taskLb.cxx @@ -0,0 +1,265 @@ +// 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 taskLb.cxx +/// \brief Λb0 analysis task +/// +/// \author Panos Christakoglou , Nikhef + +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "PWGHF/Core/HFSelectorCuts.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::analysis; +using namespace o2::framework; +using namespace o2::aod::hf_cand_prong2; +using namespace o2::aod::hf_cand_lb; +using namespace o2::analysis::hf_cuts_lb_tolcpi; +using namespace o2::framework::expressions; + +void customize(std::vector& workflowOptions) +{ + ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, true, {"Fill MC histograms."}}; + workflowOptions.push_back(optionDoMC); +} + +#include "Framework/runDataProcessing.h" + +/// Λb0 analysis task +struct HfTaskLb { + HistogramRegistry registry{ + "registry", + {{"hPtProng0", "Lb candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}, + {"hPtProng1", "Lb candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 10.}}}}, + {"hPtCand", "Lb candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}}}; + + Configurable selectionFlagLb{"selectionFlagLb", 1, "Selection Flag for Lb"}; + Configurable cutYCandMax{"cutYCandMax", 0.8, "max. cand. rapidity"}; + Configurable> bins{"pTBins", std::vector{hf_cuts_lb_tolcpi::pTBins_v}, "pT bin limits"}; + + void init(o2::framework::InitContext&) + { + registry.add("hMass", "Lb candidates;inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLength", "Lb candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXY", "Lb candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0", "Lb candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1", "Lb candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPA", "Lb candidates;candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEta", "Lb candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidity", "Lb candidates;candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParErr", "Lb candidates;candidate impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLenErr", "Lb candidates;candidate decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLenXYErr", "Lb candidates;candidate decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hIPProd", "Lb candidates;candidate impact parameter product;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hInvMassLc", "Lb candidates;prong0, Lc inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0, 5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + } + + Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); + + void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + { + for (auto& candidate : candidates) { + if (!(candidate.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { + continue; + } + if (cutYCandMax >= 0. && std::abs(YLb(candidate)) > cutYCandMax) { + continue; + } + + auto candLc = candidate.index0_as>(); + auto candPi = candidate.index1_as(); + + registry.fill(HIST("hMass"), InvMassLbToLcPi(candidate), candidate.pt()); + registry.fill(HIST("hPtCand"), candidate.pt()); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + //registry.fill(HIST("hIPProd"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hDecLength"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("hCPA"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("hEta"), candidate.eta(), candidate.pt()); + registry.fill(HIST("hRapidity"), YLb(candidate), candidate.pt()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); + if (candPi.sign() < 0) { + registry.fill(HIST("hInvMassLc"), InvMassLcpKpi(candLc), candidate.pt()); + } /*else { + registry.fill(HIST("hInvMassD0"), InvMassD0(candD0), candidate.pt()); + }*/ + } // candidate loop + } // process +}; // struct + +/// Lb MC analysis and fill histograms +struct HfTaskLbMc { + HistogramRegistry registry{ + "registry", + {{"hPtRecSig", "Lb candidates (matched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}}, + {"hPtRecBg", "Lb candidates (unmatched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}}, + {"hPtGenSig", "Lb candidates (matched);candidate #it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 10.}}}}, + {"hPtGen", "MC particles (matched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}}}}; + + Configurable selectionFlagLb{"selectionFlagLb", 1, "Selection Flag for Lb"}; + Configurable cutYCandMax{"cutYCandMax", 0.8, "max. cand. rapidity"}; + Configurable> bins{"pTBins", std::vector{hf_cuts_lb_tolcpi::pTBins_v}, "pT bin limits"}; + + void init(o2::framework::InitContext&) + { + registry.add("hEtaGen", "MC particles (matched);candidate #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYGen", "MC particles (matched);candidate #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng0Gen", "MC particles (matched);prong 0 #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1Gen", "MC particles (matched);prong 1 #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYProng0Gen", "MC particles (matched);prong 0 #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYProng1Gen", "MC particles (matched);prong 1 #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaProng0Gen", "MC particles (matched);prong 0 #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaProng1Gen", "MC particles (matched);prong 1 #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecSig", "Lb candidates (matched);candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecBg", "Lb candidates (unmatched);candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPAxyRecSig", "Lb candidates (matched);candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPAxyRecBg", "Lb candidates (unmatched);candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecSigD0", "Lb candidates (matched);prong 0 cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecBgD0", "Lb candidates (unmatched);prong 0 cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaRecSig", "Lb candidates (matched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaRecBg", "Lb candidates (unmatched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidityRecSig", "Lb candidates (matched);candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidityRecBg", "Lb candidates (unmatched);candidate #it{#y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + + registry.add("hPtProng0RecSig", "Lb candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1RecSig", "Lb candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng0RecBg", "Lb candidates (unmatched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1RecBg", "Lb candidates (unmatched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassRecSig", "Lb candidates (matched);inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.00}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassRecBg", "Lb candidates (unmatched);inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.0}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0RecSig", "Lb candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1RecSig", "Lb candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0RecBg", "Lb candidates (unmatched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1RecBg", "Lb candidates (unmatched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthRecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXYRecSig", "Lb candidates (matched);candidate decay length xy (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthRecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXYRecBg", "Lb candidates (unmatched);candidate decay length xy(cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthD0RecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthD0RecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthNormRecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthNormRecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParProdLbRecSig", "Lb candidates (matched);candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParProdLbRecBg", "Lb candidates (unmatched);candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + } + + Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); + + void process(soa::Filtered> const& candidates, + soa::Join const& particlesMC, aod::BigTracksMC const& tracks, aod::HfCandProng2 const&) + { + //MC rec + for (auto& candidate : candidates) { + if (!(candidate.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { + continue; + } + if (cutYCandMax >= 0. && std::abs(YLb(candidate)) > cutYCandMax) { + continue; + } + auto candLc = candidate.index0_as(); + if (std::abs(candidate.flagMCMatchRec()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { + + auto indexMother = RecoDecay::getMother(particlesMC, candidate.index1_as().mcParticle_as>(), pdg::Code::kLambdaB0, true); + auto particleMother = particlesMC.iteratorAt(indexMother); + registry.fill(HIST("hPtGenSig"), particleMother.pt()); + registry.fill(HIST("hPtRecSig"), candidate.pt()); + registry.fill(HIST("hCPARecSig"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("hCPAxyRecSig"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("hEtaRecSig"), candidate.eta(), candidate.pt()); + registry.fill(HIST("hRapidityRecSig"), YLb(candidate), candidate.pt()); + registry.fill(HIST("hDecLengthRecSig"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("hDecLengthXYRecSig"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("hMassRecSig"), InvMassLbToLcPi(candidate), candidate.pt()); + registry.fill(HIST("hd0Prong0RecSig"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("hd0Prong1RecSig"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("hPtProng0RecSig"), candidate.ptProng0(), candidate.pt()); + registry.fill(HIST("hPtProng1RecSig"), candidate.ptProng1(), candidate.pt()); + //registry.fill(HIST("hImpParProdLbRecSig"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hDecLengthNormRecSig"), candidate.decayLengthXYNormalised(), candidate.pt()); + registry.fill(HIST("hCPARecSigD0"), candLc.cpa(), candidate.pt()); + registry.fill(HIST("hDecLengthD0RecSig"), candLc.decayLength(), candidate.pt()); + } else { + registry.fill(HIST("hPtRecBg"), candidate.pt()); + registry.fill(HIST("hCPARecBg"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("hCPAxyRecBg"), candidate.cpa(), candidate.pt()); + registry.fill(HIST("hEtaRecBg"), candidate.eta(), candidate.pt()); + registry.fill(HIST("hRapidityRecBg"), YLb(candidate), candidate.pt()); + registry.fill(HIST("hDecLengthRecBg"), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("hDecLengthXYRecBg"), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("hMassRecBg"), InvMassLbToLcPi(candidate), candidate.pt()); + registry.fill(HIST("hd0Prong0RecBg"), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("hd0Prong1RecBg"), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("hPtProng0RecBg"), candidate.ptProng0(), candidate.pt()); + registry.fill(HIST("hPtProng1RecBg"), candidate.ptProng1(), candidate.pt()); + //registry.fill(HIST("hImpParProdLbRecBg"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hDecLengthNormRecBg"), candidate.decayLengthXYNormalised(), candidate.pt()); + registry.fill(HIST("hCPARecBgD0"), candLc.cpa(), candidate.pt()); + registry.fill(HIST("hDecLengthD0RecBg"), candLc.decayLength(), candidate.pt()); + } + } // rec + + // MC gen. level + //Printf("MC Particles: %d", particlesMC.size()); + for (auto& particle : particlesMC) { + if (std::abs(particle.flagMCMatchGen()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { + + auto yParticle = RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(pdg::Code::kLambdaB0)); + if (cutYCandMax >= 0. && std::abs(yParticle) > cutYCandMax) { + continue; + } + + float ptProngs[2], yProngs[2], etaProngs[2]; + for (int iD = particle.daughter0Id(), counter = 0; iD <= particle.daughter1Id(); ++iD, counter++) { + auto daught = particlesMC.iteratorAt(iD); + ptProngs[counter] = daught.pt(); + etaProngs[counter] = daught.eta(); + yProngs[counter] = RecoDecay::Y(array{daught.px(), daught.py(), daught.pz()}, RecoDecay::getMassPDG(daught.pdgCode())); + } + + registry.fill(HIST("hPtProng0Gen"), ptProngs[0], particle.pt()); + registry.fill(HIST("hPtProng1Gen"), ptProngs[1], particle.pt()); + registry.fill(HIST("hYProng0Gen"), yProngs[0], particle.pt()); + registry.fill(HIST("hYProng1Gen"), yProngs[1], particle.pt()); + registry.fill(HIST("hEtaProng0Gen"), etaProngs[0], particle.pt()); + registry.fill(HIST("hEtaProng1Gen"), etaProngs[1], particle.pt()); + + // if (cutYCandMax >= 0. && (std::abs(yProngs[0]) > cutYCandMax || std::abs(yProngs[1]) > cutYCandMax)) + // continue; + + registry.fill(HIST("hPtGen"), particle.pt()); + registry.fill(HIST("hYGen"), yParticle, particle.pt()); + registry.fill(HIST("hEtaGen"), particle.eta(), particle.pt()); + } + } //gen + } // process +}; // struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{}; + const bool doMC = cfgc.options().get("doMC"); + workflow.push_back(adaptAnalysisTask(cfgc)); + if (doMC) { + workflow.push_back(adaptAnalysisTask(cfgc)); + } + return workflow; +} From 9d03d2b33d078e6d0541b5eb1842c66e74e18f91 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Thu, 14 Oct 2021 21:36:32 +0200 Subject: [PATCH 04/22] First complete version of the Lb task --- PWGHF/DataModel/HFSecondaryVertex.h | 1 + PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 100 ++++-------------- .../HFLbToLcPiCandidateSelector.cxx | 8 +- PWGHF/Tasks/taskLb.cxx | 6 +- 4 files changed, 26 insertions(+), 89 deletions(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index cb49959b597..a0a1c52aaf4 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1119,6 +1119,7 @@ DECLARE_SOA_TABLE(HfCandLbBase, "AOD", "HFCANDLBBASE", /* dynamic columns */ hf_cand_prong2::M, hf_cand_prong2::M2, + hf_cand_prong2::ImpactParameterProduct, /* dynamic columns that use candidate momentum components */ hf_cand::Pt, hf_cand::Pt2, diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index bc7f3609aa8..774b976c830 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -222,89 +222,20 @@ struct HFCandidateCreatorLbExpressions { void init(InitContext const&) {} }; -/// Performs MC matching. -/*struct HfCandidateCreatorLbMc { - Produces rowMCMatchRec; - Produces rowMCMatchGen; - - void process(aod::HfCandLb const& candidates, - aod::HfCandProng2, - aod::BigTracksMC const& tracks, - aod::McParticles const& particlesMC) - { - int indexRec = -1, indexRecLc = -1; - int8_t signLb = 0, signLc = 0; - int8_t flag = 0; - int kLcpdg = pdg::Code::kLambdaCPlus; - - // Match reconstructed candidates. - for (auto& candidate : candidates) { - //Printf("New rec. candidate"); - - flag = 0; - auto candDaughterLc = candidate.index0_as(); - auto arrayDaughtersLc = array{candDaughterLc.index0_as(), candDaughterLc.index1_as(), candDaughterLc.index2_as()}; - auto arrayDaughters = array{candidate.index1_as(), candDaughterLc.index0_as(), candDaughterLc.index1_as(), candDaughterLc.index2_as()}; - - // Λb → Λc+ π- → (p K± π∓) π± - //Printf("Checking Λb → Λc+ π- → (p K± π∓) π±"); - indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{+kProton, kKPlus, -kPiPlus}, true); - if (indexRecLc > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{+kProton, kKPlus, -kPiPlus, -kPiPlus}, true, &signLb, 2); - if (indexRec > -1) { - flag = 1 << hf_cand_x::DecayType::LbToLcPi; - } - } - - if (indexRecLc > -1 && indexRec > -1) { - flag = signLb * (1 << hf_cand_lb::DecayType::LbToLcPi); - } - rowMCMatchRec(flag); - } - - // Match generated particles. - for (auto& particle : particlesMC) { - //Printf("New gen. candidate"); - flag = 0; - signLb = 0; - signLc = 0; - int indexGenLc = -1; - - // Λb → Λc+ π- → (p K± π∓) π± - //Printf("Checking Λb → Λc+ π- → (p K± π∓) π±"); - std::vector arrayDaughterLb; - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, array{pdg::Code::kLambdaCPlus, -kPiPlus}, true, &signLb, 1, &arrayDaughterLb)) { - // Λc+ → p K± π∓ - //Printf("Checking Λc+ → p K± π∓"); - for (auto iD : arrayDaughterLb) { - auto candDaughterMC = particlesMC.iteratorAt(iD); - if (std::abs(candDaughterMC.pdgCode()) == pdg::Code::kLambdaCPlus) { - indexGenLc = RecoDecay::isMatchedMCGen(particlesMC, candDaughterMC, pdg::Code::kLambdaCPlus, array{kProton, kKPlus, -kPiPlus}, true, &signLc, 1); - } - } - if (indexGenLc > -1) { - flag = signLb * (1 << hf_cand_lb::DecayType::LbToLcPi); - } - } - rowMCMatchGen(flag); - } //Lb candidate - } // process -}; */ // struct - /// Performs MC matching. struct HFCandidateCreatorLbMC { Produces rowMCMatchRec; Produces rowMCMatchGen; void process(aod::HfCandLb const& candidates, - aod::HfCandProng2, + aod::HfCandProng3, aod::BigTracksMC const& tracks, aod::McParticles const& particlesMC) { int indexRec = -1; int indexRecLc = -1; - int pdgCodeLb = 4122;//pdg::Code::kLb; - int pdgCodeLc = 5122;//pdg::Code::kLc; + int pdgCodeLb = 4122; + int pdgCodeLc = 5122; int8_t sign = 0; int8_t flag = 0; int8_t origin = 0; @@ -316,24 +247,29 @@ struct HFCandidateCreatorLbMC { flag = 0; origin = 0; channel = 0; - auto lcTrack = candidate.index0(); + //auto lcTrack = candidate.index0(); + auto lcTrack = candidate.index0_as>(); auto daughter0Lc = lcTrack.index0_as(); auto daughter1Lc = lcTrack.index1_as(); auto daughter2Lc = lcTrack.index2_as(); auto arrayLcDaughters = array{daughter0Lc, daughter1Lc, daughter2Lc}; - auto arrayDaughters = array{candidate.index0_as(), + auto arrayDaughters = array{candidate.index1_as(), + daughter0Lc, + daughter1Lc, + daughter2Lc}; + /*auto arrayDaughters = array{candidate.index0_as(), candidate.index1_as(), daughter0Lc, daughter1Lc, - daughter2Lc}; - + daughter2Lc};*/ + Printf("%d",kProton); //Fix this part // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); - indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdgCodeLc, array{+kProton, kKPlus, -kPiPlus}, true); + indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{2212, 321, -211}, true); if (indexRecLc > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeLb, array{+kProton, kKPlus, -kPiPlus, -kPiPlus}, true, &sign, 2); - if (indexRec > -1) { + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, 321, -211}, true, &sign, 2); + if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } } @@ -356,12 +292,12 @@ struct HFCandidateCreatorLbMC { // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodeLb, array{pdgCodeLc, -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, array{4122, -211}, true)) { // Match Λc+ --> pKπ- std::vector arrDaughter; - RecoDecay::getDaughters(particlesMC, particle, &arrDaughter, array{pdgCodeLc}, 1); + RecoDecay::getDaughters(particlesMC, particle, &arrDaughter, array{4122}, 1); auto lcCandMC = particlesMC.iteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdgCodeLc, array{+kProton, kKPlus, -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdg::Code::kLambdaCPlus, array{2212, 321, -211}, true)) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } } diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 164bbb1eda6..029072279a9 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -71,9 +71,9 @@ struct HfLbToLcPiCandidateSelector { } //d0(Lc)xd0(pi) ==> removed temporarily - //if (hfCandLb.impactParameterProduct() > cuts->get(pTBin, "Imp. Par. Product")) { - //return false; - //} + if (hfCandLb.impactParameterProduct() > cuts->get(pTBin, "Imp. Par. Product")) { + return false; + } //Lc mass ==> removed temporarily //if (trackPi.sign() < 0) { @@ -134,7 +134,7 @@ struct HfLbToLcPiCandidateSelector { } // Lc is always index0 and pi is index1 by default - auto candLc = hfCandLb.index0_as>(); + auto candLc = hfCandLb.index0_as>(); auto trackPi = hfCandLb.index1_as(); //topological cuts diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index 4e8974c5e6b..a148cc1b8fd 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -85,7 +85,7 @@ struct HfTaskLb { registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); - //registry.fill(HIST("hIPProd"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hIPProd"), candidate.impactParameterProduct(), candidate.pt()); registry.fill(HIST("hDecLength"), candidate.decayLength(), candidate.pt()); registry.fill(HIST("hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), candidate.pt()); @@ -193,7 +193,7 @@ struct HfTaskLbMc { registry.fill(HIST("hd0Prong1RecSig"), candidate.impactParameter1(), candidate.pt()); registry.fill(HIST("hPtProng0RecSig"), candidate.ptProng0(), candidate.pt()); registry.fill(HIST("hPtProng1RecSig"), candidate.ptProng1(), candidate.pt()); - //registry.fill(HIST("hImpParProdLbRecSig"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hImpParProdLbRecSig"), candidate.impactParameterProduct(), candidate.pt()); registry.fill(HIST("hDecLengthNormRecSig"), candidate.decayLengthXYNormalised(), candidate.pt()); registry.fill(HIST("hCPARecSigD0"), candLc.cpa(), candidate.pt()); registry.fill(HIST("hDecLengthD0RecSig"), candLc.decayLength(), candidate.pt()); @@ -210,7 +210,7 @@ struct HfTaskLbMc { registry.fill(HIST("hd0Prong1RecBg"), candidate.impactParameter1(), candidate.pt()); registry.fill(HIST("hPtProng0RecBg"), candidate.ptProng0(), candidate.pt()); registry.fill(HIST("hPtProng1RecBg"), candidate.ptProng1(), candidate.pt()); - //registry.fill(HIST("hImpParProdLbRecBg"), candidate.impactParameterProduct(), candidate.pt()); + registry.fill(HIST("hImpParProdLbRecBg"), candidate.impactParameterProduct(), candidate.pt()); registry.fill(HIST("hDecLengthNormRecBg"), candidate.decayLengthXYNormalised(), candidate.pt()); registry.fill(HIST("hCPARecBgD0"), candLc.cpa(), candidate.pt()); registry.fill(HIST("hDecLengthD0RecBg"), candLc.decayLength(), candidate.pt()); From b7cadc409caf4e9180dd6869ae9d3645638e797f Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Sat, 16 Oct 2021 21:46:05 +0200 Subject: [PATCH 05/22] First functioning version --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 49 ++++---- .../HFLbToLcPiCandidateSelector.cxx | 9 +- PWGHF/Tasks/taskLb.cxx | 108 +++++++++--------- 3 files changed, 85 insertions(+), 81 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 774b976c830..be54393a56e 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -50,19 +50,19 @@ struct HFCandidateCreatorLb { Configurable d_maxdzini{"d_maxdzini", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; Configurable d_minparamchange{"d_minparamchange", 1.e-3, "stop iterations if largest change of any Lb is smaller than this"}; Configurable d_minrelchi2change{"d_minrelchi2change", 0.9, "stop iterations is chi2/chi2old > this"}; - Configurable ptPionMin{"ptPionMin", 0.15, "minimum pion pT threshold (GeV/c)"}; + Configurable ptPionMin{"ptPionMin", 0.2, "minimum pion pT threshold (GeV/c)"}; Configurable b_dovalplots{"b_dovalplots", true, "do validation plots"}; - OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "Lc+ candidates;inv. mass (#mu^{#plus} #mu^{#minus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; - OutputObj hPtLc{TH1F("hPtLc", "J/#psi candidates;candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; - OutputObj hPtPion{TH1F("hPtPion", "#pi candidates;candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; - OutputObj hCPALc{TH1F("hCPALc", "J/#psi candidates;cosine of pointing angle;entries", 110, -1.1, 1.1)}; - OutputObj hMassLbToLcPi{TH1F("hMassLbToLcPi", "3-prong candidates;inv. mass (Lc+ (#rightarrow pKpi) #pi-) (GeV/#it{c}^{2});entries", 500, 3., 8.)}; - OutputObj hCovPVXX{TH1F("hCovPVXX", "3-prong candidates;XX element of cov. matrix of prim. vtx position (cm^{2});entries", 100, 0., 1.e-4)}; - OutputObj hCovSVXX{TH1F("hCovSVXX", "3-prong candidates;XX element of cov. matrix of sec. vtx position (cm^{2});entries", 100, 0., 0.2)}; + OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "Lc+ candidates;inv. mass (pK^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; + OutputObj hPtLc{TH1F("hPtLc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; + OutputObj hPtPion{TH1F("hPtPion", "#pi^{#minus} candidates;#pi^{#minus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; + OutputObj hCPALc{TH1F("hCPALc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} cosine of pointing angle;entries", 110, -1.1, 1.1)}; + OutputObj hMassLbToLcPi{TH1F("hMassLbToLcPi", "2-prong candidates;inv. mass (#Lambda_{b}^{0} #rightarrow #Lambda_{c}^{#plus}#pi^{#minus} #rightarrow pK^{#minus}#pi^{#plus}#pi^{#minus}) (GeV/#it{c}^{2});entries", 500, 3., 8.)}; + OutputObj hCovPVXX{TH1F("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx position (cm^{2});entries", 100, 0., 1.e-4)}; + OutputObj hCovSVXX{TH1F("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx position (cm^{2});entries", 100, 0., 0.2)}; double massPi = RecoDecay::getMassPDG(kPiMinus); - double massLc = RecoDecay::getMassPDG(4122); + double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); double massLcPi; Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; @@ -75,7 +75,7 @@ struct HFCandidateCreatorLb { aod::HFSelLcCandidate>> const& lcCands, aod::BigTracks const& tracks) { - // 3-prong vertex fitter (to rebuild Lc vertex) + // 2-prong vertex fitter o2::vertexing::DCAFitterN<2> df2; df2.setBz(magneticField); df2.setPropagateToPCA(b_propdca); @@ -85,7 +85,7 @@ struct HFCandidateCreatorLb { df2.setMinRelChi2Change(d_minrelchi2change); df2.setUseAbsDCA(true); - // 3-prong vertex fitter + // 3-prong vertex fitter (to rebuild Lc vertex) o2::vertexing::DCAFitterN<3> df3; df3.setBz(magneticField); df3.setPropagateToPCA(b_propdca); @@ -111,6 +111,9 @@ struct HFCandidateCreatorLb { //} hPtLc->Fill(lcCand.pt()); hCPALc->Fill(lcCand.cpa()); + + //Printf("(Panos) Inside the Lc candidate loop (y = %lf)",YLc(lcCand)); + // create Lc track to pass to DCA fitter; use cand table + rebuild vertex const std::array vertexLc = {lcCand.xSecondaryVertex(), lcCand.ySecondaryVertex(), lcCand.zSecondaryVertex()}; array pvecLc = {lcCand.px(), lcCand.py(), lcCand.pz()}; @@ -159,6 +162,8 @@ struct HFCandidateCreatorLb { continue; } + //Printf("(Panos) Inside the pi- candidate loop (y = %lf)",trackNeg.pt()); + // calculate relevant properties const auto& LbsecondaryVertex = df2.getPCACandidate(); auto chi2PCA = df2.getChi2AtPCACandidate(); @@ -234,8 +239,8 @@ struct HFCandidateCreatorLbMC { { int indexRec = -1; int indexRecLc = -1; - int pdgCodeLb = 4122; - int pdgCodeLc = 5122; + int pdgCodeLb = pdg::Code::kLambdaCPlus; + int pdgCodeLc = pdg::Code::kLambdaB0; int8_t sign = 0; int8_t flag = 0; int8_t origin = 0; @@ -247,8 +252,8 @@ struct HFCandidateCreatorLbMC { flag = 0; origin = 0; channel = 0; - //auto lcTrack = candidate.index0(); - auto lcTrack = candidate.index0_as>(); + auto lcTrack = candidate.index0(); + //auto lcTrack = candidate.index0_as>(); auto daughter0Lc = lcTrack.index0_as(); auto daughter1Lc = lcTrack.index1_as(); auto daughter2Lc = lcTrack.index2_as(); @@ -257,18 +262,13 @@ struct HFCandidateCreatorLbMC { daughter0Lc, daughter1Lc, daughter2Lc}; - /*auto arrayDaughters = array{candidate.index0_as(), - candidate.index1_as(), - daughter0Lc, - daughter1Lc, - daughter2Lc};*/ - Printf("%d",kProton); + //Fix this part // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); - indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{2212, 321, -211}, true); + indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{2212, -321, +211}, true); if (indexRecLc > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, 321, -211}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, -321, +211}, true, &sign, 2); if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } @@ -297,8 +297,9 @@ struct HFCandidateCreatorLbMC { std::vector arrDaughter; RecoDecay::getDaughters(particlesMC, particle, &arrDaughter, array{4122}, 1); auto lcCandMC = particlesMC.iteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdg::Code::kLambdaCPlus, array{2212, 321, -211}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdg::Code::kLambdaCPlus, array{2212, -321, 211}, true)) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; + //Printf("(Panos) Reco matched with Gen"); } } diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 029072279a9..0419333e2fa 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -120,7 +120,7 @@ struct HfLbToLcPiCandidateSelector { return true; } - void process(aod::HfCandLb const& hfCandLbs, soa::Join, aod::BigTracksPID const& tracks) + void process(aod::HfCandLb const& hfCandLbs, soa::Join, aod::BigTracksPID const& tracks) { for (auto& hfCandLb : hfCandLbs) { //looping over Lb candidates @@ -129,12 +129,13 @@ struct HfLbToLcPiCandidateSelector { // check if flagged as Λb --> Λc+ π- if (!(hfCandLb.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { hfSelLbToLcPiCandidate(statusLb); - // Printf("Lb candidate selection failed at hfflag check"); + //Printf("Lb candidate selection failed at hfflag check"); continue; } // Lc is always index0 and pi is index1 by default - auto candLc = hfCandLb.index0_as>(); + auto candLc = hfCandLb.index0(); + //auto candLc = hfCandLb.index0_as>(); auto trackPi = hfCandLb.index1_as(); //topological cuts @@ -145,7 +146,7 @@ struct HfLbToLcPiCandidateSelector { } hfSelLbToLcPiCandidate(1); - // Printf("Lb candidate selection successful, candidate should be selected"); + //Printf("Lb candidate selection successful, candidate should be selected"); } } }; diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index a148cc1b8fd..3d6c83d52a7 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -25,6 +25,7 @@ using namespace o2::aod; using namespace o2::analysis; using namespace o2::framework; using namespace o2::aod::hf_cand_prong2; +using namespace o2::aod::hf_cand_prong3; using namespace o2::aod::hf_cand_lb; using namespace o2::analysis::hf_cuts_lb_tolcpi; using namespace o2::framework::expressions; @@ -51,24 +52,24 @@ struct HfTaskLb { void init(o2::framework::InitContext&) { - registry.add("hMass", "Lb candidates;inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLength", "Lb candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthXY", "Lb candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong0", "Lb candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong1", "Lb candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPA", "Lb candidates;candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hEta", "Lb candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hRapidity", "Lb candidates;candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hImpParErr", "Lb candidates;candidate impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLenErr", "Lb candidates;candidate decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLenXYErr", "Lb candidates;candidate decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hIPProd", "Lb candidates;candidate impact parameter product;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hInvMassLc", "Lb candidates;prong0, Lc inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0, 5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass", "Lb candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLength", "#Lambda_{b}^{0} candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXY", "#Lambda_{b}^{0} candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0", "#Lambda_{b}^{0} candidates;prong 0 (#Lambda_{c}^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1", "#Lambda_{b}^{0} candidates;prong 1 (#pi^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPA", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEta", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidity", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParErr", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLenErr", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLenXYErr", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate decay length xy error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hIPProd", "#Lambda_{b}^{0} candidates;#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hInvMassLc", "#Lambda_{b}^{0} candidates;prong0, #Lambda_{c}^{+} inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0, 5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); - void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { for (auto& candidate : candidates) { if (!(candidate.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { @@ -121,54 +122,55 @@ struct HfTaskLbMc { void init(o2::framework::InitContext&) { - registry.add("hEtaGen", "MC particles (matched);candidate #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hYGen", "MC particles (matched);candidate #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng0Gen", "MC particles (matched);prong 0 #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng1Gen", "MC particles (matched);prong 1 #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hYProng0Gen", "MC particles (matched);prong 0 #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hYProng1Gen", "MC particles (matched);prong 1 #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hEtaProng0Gen", "MC particles (matched);prong 0 #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hEtaProng1Gen", "MC particles (matched);prong 1 #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPARecSig", "Lb candidates (matched);candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPARecBg", "Lb candidates (unmatched);candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPAxyRecSig", "Lb candidates (matched);candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPAxyRecBg", "Lb candidates (unmatched);candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPARecSigD0", "Lb candidates (matched);prong 0 cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCPARecBgD0", "Lb candidates (unmatched);prong 0 cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hEtaRecSig", "Lb candidates (matched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hEtaRecBg", "Lb candidates (unmatched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hRapidityRecSig", "Lb candidates (matched);candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hRapidityRecBg", "Lb candidates (unmatched);candidate #it{#y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaGen", "MC particles (matched);#Lambda_{b}^{0} candidate #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYGen", "MC particles (matched);#Lambda_{b}^{0} candidate #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng0Gen", "MC particles (matched);prong 0 (#Lambda_{c}^{+}) #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1Gen", "MC particles (matched);prong 1 (#pi^{-}) #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYProng0Gen", "MC particles (matched);prong 0 (#Lambda_{c}^{+}) #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hYProng1Gen", "MC particles (matched);prong 1 (#pi^{-}) #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaProng0Gen", "MC particles (matched);prong 0 (#Lambda_{b}^{0}) #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaProng1Gen", "MC particles (matched);prong 1 (#pi^{-}) #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2, 2}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPAxyRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPAxyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate CPAxy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecSigD0", "#Lambda_{b}^{0} candidates (matched);prong 0 (#Lambda_{c}^{+}) cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCPARecBgD0", "#Lambda_{b}^{0} candidates (unmatched);prong 0 (#Lambda_{c}^{+}) cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hEtaRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidityRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hRapidityRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate #it{#y};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng0RecSig", "Lb candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng1RecSig", "Lb candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng0RecBg", "Lb candidates (unmatched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtProng1RecBg", "Lb candidates (unmatched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassRecSig", "Lb candidates (matched);inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.00}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassRecBg", "Lb candidates (unmatched);inv. mass #bar{D^{0}}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.0}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong0RecSig", "Lb candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong1RecSig", "Lb candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong0RecBg", "Lb candidates (unmatched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hd0Prong1RecBg", "Lb candidates (unmatched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthRecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthXYRecSig", "Lb candidates (matched);candidate decay length xy (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthRecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthXYRecBg", "Lb candidates (unmatched);candidate decay length xy(cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthD0RecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthD0RecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthNormRecSig", "Lb candidates (matched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hDecLengthNormRecBg", "Lb candidates (unmatched);candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hImpParProdLbRecSig", "Lb candidates (matched);candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hImpParProdLbRecBg", "Lb candidates (unmatched);candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng0RecSig", "#Lambda_{b}^{0} candidates (matched);prong 0 (#Lambda_{c}^{+}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1RecSig", "#Lambda_{b}^{0} candidates (matched);prong 1 (#pi^{#minus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);prong 0 (#Lambda_{c}^{+}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtProng1RecBg", "#Lambda_{b}^{0} candidates (unmatched);prong 1 (#pi^{#minus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{100, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassRecSig", "#Lambda_{b}^{0} candidates (matched);inv. mass #Lambda_{c}^{+}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.00}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassRecBg", "#Lambda_{b}^{0} candidates (unmatched);inv. mass #Lambda_{c}^{+}#pi^{+} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 4.0, 7.0}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0RecSig", "#Lambda_{b}^{0} candidates (matched);prong 0 (#Lambda_{c}^{+}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1RecSig", "#Lambda_{b}^{0} candidates (matched);prong 1 (#pi^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong0RecBg", "#Lambda_{b}^{0} candidates (unmatched);prong 0 (#Lambda_{c}^{+}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hd0Prong1RecBg", "#Lambda_{b}^{0} candidates (unmatched);prong 1 (#pi^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{200, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXYRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate decay length xy (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthXYRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate decay length xy(cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthD0RecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthD0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthNormRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hDecLengthNormRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParProdLbRecSig", "#Lambda_{b}^{0} candidates (matched);#Lambda_{b}^{0} candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hImpParProdLbRecBg", "#Lambda_{b}^{0} candidates (unmatched);#Lambda_{b}^{0} candidate impact parameter product ;entries", {HistType::kTH2F, {{100, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, aod::BigTracksMC const& tracks, aod::HfCandProng2 const&) + soa::Join const& particlesMC, aod::BigTracksMC const& tracks, aod::HfCandProng3 const&) { //MC rec for (auto& candidate : candidates) { + //Printf("(Panos) MC candidate: pT: %lf",candidate.pt()); if (!(candidate.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { continue; } From ed3a8fc22a2021cb2a42f455a02877919e69bb4e Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Sat, 16 Oct 2021 22:53:29 +0200 Subject: [PATCH 06/22] First functioning version --- PWGHF/Tasks/taskLb.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index 3d6c83d52a7..f9e56ebbdc6 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -47,7 +47,7 @@ struct HfTaskLb { {"hPtCand", "Lb candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}}}; Configurable selectionFlagLb{"selectionFlagLb", 1, "Selection Flag for Lb"}; - Configurable cutYCandMax{"cutYCandMax", 0.8, "max. cand. rapidity"}; + Configurable cutYCandMax{"cutYCandMax", 1.44, "max. cand. rapidity"}; Configurable> bins{"pTBins", std::vector{hf_cuts_lb_tolcpi::pTBins_v}, "pT bin limits"}; void init(o2::framework::InitContext&) From efc7395a7320bbd8461288c4af38a3e9c82442cb Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Sun, 17 Oct 2021 12:39:44 +0200 Subject: [PATCH 07/22] Adding centrality --- PWGHF/Tasks/taskLb.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index f9e56ebbdc6..c126e320162 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -44,7 +44,8 @@ struct HfTaskLb { "registry", {{"hPtProng0", "Lb candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}, {"hPtProng1", "Lb candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 10.}}}}, - {"hPtCand", "Lb candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}}}; + {"hPtCand", "Lb candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}, + {"hCentrality", "centrality;centrality percentile;entries", {HistType::kTH1F, {{100, 0., 100.}}}}}}; Configurable selectionFlagLb{"selectionFlagLb", 1, "Selection Flag for Lb"}; Configurable cutYCandMax{"cutYCandMax", 1.44, "max. cand. rapidity"}; @@ -52,7 +53,7 @@ struct HfTaskLb { void init(o2::framework::InitContext&) { - registry.add("hMass", "Lb candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass", "#Lambda_{b}^{0} candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c}); centrality", {HistType::kTH3F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"},{100, 0., 100.}}}); registry.add("hDecLength", "#Lambda_{b}^{0} candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDecLengthXY", "#Lambda_{b}^{0} candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hd0Prong0", "#Lambda_{b}^{0} candidates;prong 0 (#Lambda_{c}^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -69,8 +70,12 @@ struct HfTaskLb { Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); + //void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { + float centrality = 0;//collision.centV0M(); + registry.fill(HIST("hCentrality"), centrality); + for (auto& candidate : candidates) { if (!(candidate.hfflag() & 1 << hf_cand_lb::DecayType::LbToLcPi)) { continue; @@ -82,7 +87,7 @@ struct HfTaskLb { auto candLc = candidate.index0_as>(); auto candPi = candidate.index1_as(); - registry.fill(HIST("hMass"), InvMassLbToLcPi(candidate), candidate.pt()); + registry.fill(HIST("hMass"), InvMassLbToLcPi(candidate), candidate.pt(),centrality); registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); From ac110cc559b6e0c800cfbbc7ba3d05368a46852e Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Sun, 17 Oct 2021 13:49:30 +0200 Subject: [PATCH 08/22] Adding centrality in the lb task --- PWGHF/TableProducer/CMakeLists.txt | 8 ++++---- PWGHF/Tasks/taskLb.cxx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 5f44a91dcb8..9189690af7d 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -54,10 +54,10 @@ o2physics_add_dpl_workflow(candidate-creator-x PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) -#o2physics_add_dpl_workflow(candidate-creator-chic -# SOURCES HFCandidateCreatorChic.cxx -# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG -# COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(candidate-creator-chic + SOURCES HFCandidateCreatorChic.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(tree-creator-lc-topkpi SOURCES HFTreeCreatorLcToPKPi.cxx diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index c126e320162..be005ba3e2d 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -19,6 +19,7 @@ #include "PWGHF/DataModel/HFSecondaryVertex.h" #include "PWGHF/Core/HFSelectorCuts.h" #include "PWGHF/DataModel/HFCandidateSelectionTables.h" +#include "Common/DataModel/Centrality.h" using namespace o2; using namespace o2::aod; @@ -70,10 +71,9 @@ struct HfTaskLb { Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); - //void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) - void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { - float centrality = 0;//collision.centV0M(); + float centrality = collision.centV0M(); registry.fill(HIST("hCentrality"), centrality); for (auto& candidate : candidates) { From a15b416b5c0046921393f01b06a343928feccadf Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Mon, 18 Oct 2021 13:30:08 +0200 Subject: [PATCH 09/22] Changes for coding conventions and minor fixes --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 24 ++++++------------- .../HFLbToLcPiCandidateSelector.cxx | 4 ++-- PWGHF/Tasks/taskLb.cxx | 6 ++--- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index be54393a56e..808d10ef594 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -193,9 +193,6 @@ struct HFCandidateCreatorLb { if (TESTBIT(lcCand.hfflag(), hf_cand_prong3::DecayType::LcToPKPi)) { SETBIT(hfFlag, hf_cand_lb::DecayType::LbToLcPi); } - /* if (TESTBIT(jpsiCand.hfflag(), hf_cand_prong2::DecayType::LcToEE)) { - SETBIT(hfFlag, hf_cand_x::DecayType::XToLcToEEPiPi); // dielectron channel - }*/ // fill the candidate table for the Lb here: rowCandidateBase(collision.globalIndex(), @@ -253,37 +250,31 @@ struct HFCandidateCreatorLbMC { origin = 0; channel = 0; auto lcTrack = candidate.index0(); - //auto lcTrack = candidate.index0_as>(); auto daughter0Lc = lcTrack.index0_as(); auto daughter1Lc = lcTrack.index1_as(); auto daughter2Lc = lcTrack.index2_as(); auto arrayLcDaughters = array{daughter0Lc, daughter1Lc, daughter2Lc}; - auto arrayDaughters = array{candidate.index1_as(), - daughter0Lc, - daughter1Lc, - daughter2Lc}; - - //Fix this part + auto arrayDaughters = array{candidate.index1_as(),daughter0Lc,daughter1Lc,daughter2Lc}; + // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{2212, -321, +211}, true); if (indexRecLc > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, -321, +211}, true, &sign, 2); - if (indexRec > -1) { + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, -321, +211}, true, &sign, 2); + if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } } - // Check whether the particle is non-prompt (from a b quark). + //Check whether the particle is non-prompt (from a b quark). if (flag != 0) { auto particle = particlesMC.iteratorAt(indexRec); origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); } - rowMCMatchRec(flag, origin, channel); } - // Match generated particles. + //Match generated particles. for (auto& particle : particlesMC) { //Printf("New gen. candidate"); flag = 0; @@ -299,7 +290,6 @@ struct HFCandidateCreatorLbMC { auto lcCandMC = particlesMC.iteratorAt(arrDaughter[0]); if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdg::Code::kLambdaCPlus, array{2212, -321, 211}, true)) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; - //Printf("(Panos) Reco matched with Gen"); } } @@ -307,7 +297,7 @@ struct HFCandidateCreatorLbMC { if (flag != 0) { origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); } - + rowMCMatchGen(flag, origin, channel); } // candidate loop } // process diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 0419333e2fa..cc75cf1c052 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -52,7 +52,6 @@ struct HfLbToLcPiCandidateSelector { Configurable> pTBins{"pTBins", std::vector{hf_cuts_lb_tolcpi::pTBins_v}, "pT bin limits"}; Configurable> cuts{"Lb_to_lcpi_cuts", {hf_cuts_lb_tolcpi::cuts[0], npTBins, nCutVars, pTBinLabels, cutVarLabels}, "Lb0 candidate selection per pT bin"}; Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc+"}; - //Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; // Apply topological cuts as defined in HFSelectorCuts.h; return true if candidate passes all cuts template @@ -81,7 +80,7 @@ struct HfLbToLcPiCandidateSelector { // return false; //} //} - + //Lb Decay length if (hfCandLb.decayLength() < cuts->get(pTBin, "Lb decLen")) { return false; @@ -113,6 +112,7 @@ struct HfLbToLcPiCandidateSelector { // (std::abs(hfCandBPlus.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))){ // return false; //} + //D0 CPA // if (std::abs(hfCandD0.cpa()) < cuts->get(pTBin, "CPA D0")){ // return false; diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index be005ba3e2d..41bda49a6ba 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -105,9 +105,7 @@ struct HfTaskLb { registry.fill(HIST("hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); if (candPi.sign() < 0) { registry.fill(HIST("hInvMassLc"), InvMassLcpKpi(candLc), candidate.pt()); - } /*else { - registry.fill(HIST("hInvMassD0"), InvMassD0(candD0), candidate.pt()); - }*/ + } } // candidate loop } // process }; // struct @@ -180,7 +178,7 @@ struct HfTaskLbMc { continue; } if (cutYCandMax >= 0. && std::abs(YLb(candidate)) > cutYCandMax) { - continue; + continue; } auto candLc = candidate.index0_as(); if (std::abs(candidate.flagMCMatchRec()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { From 08323bd05d5f45e60b9cd986c1c61a9ed2c80847 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Mon, 18 Oct 2021 17:45:30 +0200 Subject: [PATCH 10/22] fixes after the formatting checks --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 166 +++++++++---------- PWGHF/Tasks/taskLb.cxx | 6 +- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 808d10ef594..f55d7b1bac1 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -52,7 +52,7 @@ struct HFCandidateCreatorLb { Configurable d_minrelchi2change{"d_minrelchi2change", 0.9, "stop iterations is chi2/chi2old > this"}; Configurable ptPionMin{"ptPionMin", 0.2, "minimum pion pT threshold (GeV/c)"}; Configurable b_dovalplots{"b_dovalplots", true, "do validation plots"}; - + OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "Lc+ candidates;inv. mass (pK^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; OutputObj hPtLc{TH1F("hPtLc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; OutputObj hPtPion{TH1F("hPtPion", "#pi^{#minus} candidates;#pi^{#minus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; @@ -60,22 +60,22 @@ struct HFCandidateCreatorLb { OutputObj hMassLbToLcPi{TH1F("hMassLbToLcPi", "2-prong candidates;inv. mass (#Lambda_{b}^{0} #rightarrow #Lambda_{c}^{#plus}#pi^{#minus} #rightarrow pK^{#minus}#pi^{#plus}#pi^{#minus}) (GeV/#it{c}^{2});entries", 500, 3., 8.)}; OutputObj hCovPVXX{TH1F("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx position (cm^{2});entries", 100, 0., 1.e-4)}; OutputObj hCovSVXX{TH1F("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx position (cm^{2});entries", 100, 0., 0.2)}; - + double massPi = RecoDecay::getMassPDG(kPiMinus); double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); double massLcPi; - + Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; Filter filterSelectCandidates = (aod::hf_selcandidate_lc::isSelLcpKpi >= d_selectionFlagLc || aod::hf_selcandidate_lc::isSelLcpiKp >= d_selectionFlagLc); void process(aod::Collision const& collision, soa::Filtered> const& lcCands, + aod::HfCandProng3, + aod::HFSelLcCandidate>> const& lcCands, aod::BigTracks const& tracks) { - // 2-prong vertex fitter + // 2-prong vertex fitter o2::vertexing::DCAFitterN<2> df2; df2.setBz(magneticField); df2.setPropagateToPCA(b_propdca); @@ -107,13 +107,13 @@ struct HFCandidateCreatorLb { hMassLcToPKPi->Fill(InvMassLcpKpi(lcCand)); } //if (jpsiCand.isSelLcToPiKP() > 0) { - //hMassLcToPKPi->Fill(InvMassLcToMuMu(jpsiCand)); + //hMassLcToPKPi->Fill(InvMassLcToMuMu(jpsiCand)); //} hPtLc->Fill(lcCand.pt()); hCPALc->Fill(lcCand.cpa()); //Printf("(Panos) Inside the Lc candidate loop (y = %lf)",YLc(lcCand)); - + // create Lc track to pass to DCA fitter; use cand table + rebuild vertex const std::array vertexLc = {lcCand.xSecondaryVertex(), lcCand.ySecondaryVertex(), lcCand.zSecondaryVertex()}; array pvecLc = {lcCand.px(), lcCand.py(), lcCand.pz()}; @@ -143,80 +143,80 @@ struct HFCandidateCreatorLb { // loop over pi- candidates for (auto& trackNeg : tracks) { - if (trackNeg.sign() > 0) { // select only negative tracks - use partitions? - continue; - } - if (trackNeg.globalIndex() == index2Lc) { - continue; - } - if (trackNeg.pt() < ptPionMin) { - continue; - } - hPtPion->Fill(trackNeg.pt()); - - auto trackParVarNeg = getTrackParCov(trackNeg); - array pvecNeg; - - // reconstruct the 3-prong X vertex - if (df2.process(trackLc, trackParVarNeg) == 0) { - continue; - } - - //Printf("(Panos) Inside the pi- candidate loop (y = %lf)",trackNeg.pt()); - - // calculate relevant properties - const auto& LbsecondaryVertex = df2.getPCACandidate(); - auto chi2PCA = df2.getChi2AtPCACandidate(); - auto covMatrixPCA = df2.calcPCACovMatrix().Array(); - hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line. - - df2.propagateTracksToVertex(); // propagate the pions and Lc to the X vertex - df2.getTrack(0).getPxPyPzGlo(pvecLc); // update momentum of Lc at the Lb vertex - df2.getTrack(1).getPxPyPzGlo(pvecNeg); // momentum of pi- at the Lb vertex - - // get track impact parameters - // This modifies track momenta! - auto primaryVertex = getPrimaryVertex(collision); - auto covMatrixPV = primaryVertex.getCov(); - hCovPVXX->Fill(covMatrixPV[0]); - o2::dataformats::DCA impactParameter0; - o2::dataformats::DCA impactParameter1; - trackParVarNeg.propagateToDCA(primaryVertex, magneticField, &impactParameter1); - - // get uncertainty of the decay length - double phi, theta; - getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, LbsecondaryVertex, phi, theta); - auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); - auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); - - int hfFlag = 0; - if (TESTBIT(lcCand.hfflag(), hf_cand_prong3::DecayType::LcToPKPi)) { - SETBIT(hfFlag, hf_cand_lb::DecayType::LbToLcPi); - } - - // fill the candidate table for the Lb here: - rowCandidateBase(collision.globalIndex(), - collision.posX(), collision.posY(), collision.posZ(), - LbsecondaryVertex[0], LbsecondaryVertex[1], LbsecondaryVertex[2], - errorDecayLength, errorDecayLengthXY, - chi2PCA, - pvecLc[0], pvecLc[1], pvecLc[2], - pvecNeg[0], pvecNeg[1], pvecNeg[2], - impactParameter0.getY(), impactParameter1.getY(), - std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), - lcCand.globalIndex(), trackNeg.globalIndex(), - hfFlag); - - // calculate invariant mass - auto arrayMomenta = array{pvecLc, pvecNeg}; - massLcPi = RecoDecay::M(std::move(arrayMomenta), array{massLc, massPi}); - if (lcCand.isSelLcpKpi() > 0) { - hMassLbToLcPi->Fill(massLcPi); - } + if (trackNeg.sign() > 0) { // select only negative tracks - use partitions? + continue; + } + if (trackNeg.globalIndex() == index2Lc) { + continue; + } + if (trackNeg.pt() < ptPionMin) { + continue; + } + hPtPion->Fill(trackNeg.pt()); + + auto trackParVarNeg = getTrackParCov(trackNeg); + array pvecNeg; + + // reconstruct the 3-prong X vertex + if (df2.process(trackLc, trackParVarNeg) == 0) { + continue; + } + + //Printf("(Panos) Inside the pi- candidate loop (y = %lf)",trackNeg.pt()); + + // calculate relevant properties + const auto& LbsecondaryVertex = df2.getPCACandidate(); + auto chi2PCA = df2.getChi2AtPCACandidate(); + auto covMatrixPCA = df2.calcPCACovMatrix().Array(); + hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line. + + df2.propagateTracksToVertex(); // propagate the pions and Lc to the X vertex + df2.getTrack(0).getPxPyPzGlo(pvecLc); // update momentum of Lc at the Lb vertex + df2.getTrack(1).getPxPyPzGlo(pvecNeg); // momentum of pi- at the Lb vertex + + // get track impact parameters + // This modifies track momenta! + auto primaryVertex = getPrimaryVertex(collision); + auto covMatrixPV = primaryVertex.getCov(); + hCovPVXX->Fill(covMatrixPV[0]); + o2::dataformats::DCA impactParameter0; + o2::dataformats::DCA impactParameter1; + trackParVarNeg.propagateToDCA(primaryVertex, magneticField, &impactParameter1); + + // get uncertainty of the decay length + double phi, theta; + getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, LbsecondaryVertex, phi, theta); + auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); + auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); + + int hfFlag = 0; + if (TESTBIT(lcCand.hfflag(), hf_cand_prong3::DecayType::LcToPKPi)) { + SETBIT(hfFlag, hf_cand_lb::DecayType::LbToLcPi); + } + + // fill the candidate table for the Lb here: + rowCandidateBase(collision.globalIndex(), + collision.posX(), collision.posY(), collision.posZ(), + LbsecondaryVertex[0], LbsecondaryVertex[1], LbsecondaryVertex[2], + errorDecayLength, errorDecayLengthXY, + chi2PCA, + pvecLc[0], pvecLc[1], pvecLc[2], + pvecNeg[0], pvecNeg[1], pvecNeg[2], + impactParameter0.getY(), impactParameter1.getY(), + std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), + lcCand.globalIndex(), trackNeg.globalIndex(), + hfFlag); + + // calculate invariant mass + auto arrayMomenta = array{pvecLc, pvecNeg}; + massLcPi = RecoDecay::M(std::move(arrayMomenta), array{massLc, massPi}); + if (lcCand.isSelLcpKpi() > 0) { + hMassLbToLcPi->Fill(massLcPi); + } } // pi- loop - } // Lc loop - } // process -}; // struct + } // Lc loop + } // process +}; // struct /// Extends the base table with expression columns. struct HFCandidateCreatorLbExpressions { @@ -254,7 +254,7 @@ struct HFCandidateCreatorLbMC { auto daughter1Lc = lcTrack.index1_as(); auto daughter2Lc = lcTrack.index2_as(); auto arrayLcDaughters = array{daughter0Lc, daughter1Lc, daughter2Lc}; - auto arrayDaughters = array{candidate.index1_as(),daughter0Lc,daughter1Lc,daughter2Lc}; + auto arrayDaughters = array{candidate.index1_as(), daughter0Lc, daughter1Lc, daughter2Lc}; // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); @@ -297,7 +297,7 @@ struct HFCandidateCreatorLbMC { if (flag != 0) { origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); } - + rowMCMatchGen(flag, origin, channel); } // candidate loop } // process diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index 41bda49a6ba..0ec364e765f 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -54,7 +54,7 @@ struct HfTaskLb { void init(o2::framework::InitContext&) { - registry.add("hMass", "#Lambda_{b}^{0} candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c}); centrality", {HistType::kTH3F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"},{100, 0., 100.}}}); + registry.add("hMass", "#Lambda_{b}^{0} candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c}); centrality", {HistType::kTH3F, {{500, 0., 10.}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}, {100, 0., 100.}}}); registry.add("hDecLength", "#Lambda_{b}^{0} candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDecLengthXY", "#Lambda_{b}^{0} candidates;decay length xy (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hd0Prong0", "#Lambda_{b}^{0} candidates;prong 0 (#Lambda_{c}^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -0.05, 0.05}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -87,7 +87,7 @@ struct HfTaskLb { auto candLc = candidate.index0_as>(); auto candPi = candidate.index1_as(); - registry.fill(HIST("hMass"), InvMassLbToLcPi(candidate), candidate.pt(),centrality); + registry.fill(HIST("hMass"), InvMassLbToLcPi(candidate), candidate.pt(), centrality); registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); @@ -178,7 +178,7 @@ struct HfTaskLbMc { continue; } if (cutYCandMax >= 0. && std::abs(YLb(candidate)) > cutYCandMax) { - continue; + continue; } auto candLc = candidate.index0_as(); if (std::abs(candidate.flagMCMatchRec()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { From 5e2ce86a819af84d9d646c7d632f8cf09ef31424 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Mon, 18 Oct 2021 18:40:58 +0200 Subject: [PATCH 11/22] Reformatting --- PWGHF/DataModel/HFCandidateSelectionTables.h | 2 +- PWGHF/DataModel/HFSecondaryVertex.h | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/PWGHF/DataModel/HFCandidateSelectionTables.h b/PWGHF/DataModel/HFCandidateSelectionTables.h index 50d790f4c7a..dcb9cc372e5 100644 --- a/PWGHF/DataModel/HFCandidateSelectionTables.h +++ b/PWGHF/DataModel/HFCandidateSelectionTables.h @@ -178,7 +178,7 @@ DECLARE_SOA_TABLE(HFSelBPlusToD0PiCandidate, "AOD", "HFSELBPLUSCAND", //! namespace hf_selcandidate_lb { -DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //! +DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //! } // namespace hf_selcandidate_lb DECLARE_SOA_TABLE(HFSelLbToLcPiCandidate, "AOD", "HFSELLBCAND", //! hf_selcandidate_lb::IsSelLbToLcPi); diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index a0a1c52aaf4..6ceb4742056 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1063,8 +1063,6 @@ DECLARE_SOA_TABLE(HfCandChicMCGen, "AOD", "HFCANDCHICMCGEN", //! hf_cand_chic::OriginMCGen, hf_cand_chic::FlagMCDecayChanGen); - - // specific Lb candidate properties namespace hf_cand_lb { @@ -1080,7 +1078,7 @@ DECLARE_SOA_COLUMN(FlagMCDecayChanGen, flagMCDecayChanGen, int8_t); // resonant enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? } // namespace hf_cand_lb -// Λb → Λc+ π- → p K- π+ π- +// Λb → Λc+ π- → p K- π+ π- float massLb = RecoDecay::getMassPDG(5122); // replace this with: "RecoDecay::getMassPDG(9920443)" when pdg is added template auto CtLb(const T& candidate) @@ -1112,14 +1110,14 @@ DECLARE_SOA_TABLE(HfCandLbBase, "AOD", "HFCANDLBBASE", // 3-prong specific columns hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, - hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, - hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, - hf_cand_lb::Index0Id, hf_track_index::Index1Id, + hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, + hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, + hf_cand_lb::Index0Id, hf_track_index::Index1Id, hf_track_index::HFflag, /* dynamic columns */ - hf_cand_prong2::M, + hf_cand_prong2::M, hf_cand_prong2::M2, - hf_cand_prong2::ImpactParameterProduct, + hf_cand_prong2::ImpactParameterProduct, /* dynamic columns that use candidate momentum components */ hf_cand::Pt, hf_cand::Pt2, @@ -1157,6 +1155,4 @@ DECLARE_SOA_TABLE(HfCandLbMCGen, "AOD", "HFCANDLBMCGEN", //! } // namespace o2::aod - - #endif // O2_ANALYSIS_HFSECONDARYVERTEX_H_ From 436e6de0fb350bfd701d879b255be6a4e1ddd17c Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Mon, 18 Oct 2021 19:13:44 +0200 Subject: [PATCH 12/22] Removing unused objects --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 3 +-- PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index f55d7b1bac1..6bc21f96b87 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -231,8 +231,7 @@ struct HFCandidateCreatorLbMC { void process(aod::HfCandLb const& candidates, aod::HfCandProng3, - aod::BigTracksMC const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& particlesMC) { int indexRec = -1; int indexRecLc = -1; diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index cc75cf1c052..4c342150668 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -120,7 +120,7 @@ struct HfLbToLcPiCandidateSelector { return true; } - void process(aod::HfCandLb const& hfCandLbs, soa::Join, aod::BigTracksPID const& tracks) + void process(aod::HfCandLb const& hfCandLbs, soa::Join) { for (auto& hfCandLb : hfCandLbs) { //looping over Lb candidates From 2526bb8dded2109391e05a2b31bc9f8981438f0b Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Mon, 18 Oct 2021 19:15:37 +0200 Subject: [PATCH 13/22] Removing unused objects+formatting --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 6bc21f96b87..8a0ca82c116 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -231,7 +231,7 @@ struct HFCandidateCreatorLbMC { void process(aod::HfCandLb const& candidates, aod::HfCandProng3, - aod::McParticles const& particlesMC) + aod::McParticles const& particlesMC) { int indexRec = -1; int indexRecLc = -1; From 84281f888b891cf625563bfe29900d4a60e614a3 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 12:12:20 +0200 Subject: [PATCH 14/22] Changes for conventions + removal of centrality --- PWGHF/DataModel/HFSecondaryVertex.h | 12 ++++++------ PWGHF/TableProducer/CMakeLists.txt | 8 ++++---- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 7 ++++--- PWGHF/Tasks/taskLb.cxx | 5 +++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 6ceb4742056..4de6afadb55 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1076,32 +1076,32 @@ DECLARE_SOA_COLUMN(FlagMCDecayChanRec, flagMCDecayChanRec, int8_t); // resonant DECLARE_SOA_COLUMN(FlagMCDecayChanGen, flagMCDecayChanGen, int8_t); // resonant decay channel flag, generator level // mapping of decay types enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? -} // namespace hf_cand_lb // Λb → Λc+ π- → p K- π+ π- -float massLb = RecoDecay::getMassPDG(5122); // replace this with: "RecoDecay::getMassPDG(9920443)" when pdg is added +//float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); template auto CtLb(const T& candidate) { - return candidate.ct(massLb); + return candidate.ct(RecoDecay::getMassPDG(pdg::Code::kLambdaB0)); } template auto YLb(const T& candidate) { - return candidate.y(massLb); + return candidate.y(RecoDecay::getMassPDG(pdg::Code::kLambdaB0)); } template auto ELb(const T& candidate) { - return candidate.e(massLb); + return candidate.e(RecoDecay::getMassPDG(pdg::Code::kLambdaB0)); } template auto InvMassLbToLcPi(const T& candidate) { - return candidate.m(array{RecoDecay::getMassPDG(4122), RecoDecay::getMassPDG(kPiPlus)}); + return candidate.m(array{RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus), RecoDecay::getMassPDG(kPiPlus)}); } +} // namespace hf_cand_lb // declare dedicated Lb candidate table DECLARE_SOA_TABLE(HfCandLbBase, "AOD", "HFCANDLBBASE", diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 9189690af7d..410541a0977 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -149,8 +149,8 @@ o2physics_add_dpl_workflow(x-tojpsipipi-candidate-selector PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) -#o2physics_add_dpl_workflow(chic-tojpsigamma-candidate-selector -# SOURCES HFChicToJpsiGammaCandidateSelector.cxx -# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing -# COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(chic-tojpsigamma-candidate-selector + SOURCES HFChicToJpsiGammaCandidateSelector.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing + COMPONENT_NAME Analysis) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 8a0ca82c116..34d6e5bffab 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -63,7 +63,7 @@ struct HFCandidateCreatorLb { double massPi = RecoDecay::getMassPDG(kPiMinus); double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); - double massLcPi; + double massLcPi = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);; Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; @@ -231,6 +231,7 @@ struct HFCandidateCreatorLbMC { void process(aod::HfCandLb const& candidates, aod::HfCandProng3, + aod::BigTracksMC const& tracks, aod::McParticles const& particlesMC) { int indexRec = -1; @@ -268,7 +269,7 @@ struct HFCandidateCreatorLbMC { //Check whether the particle is non-prompt (from a b quark). if (flag != 0) { auto particle = particlesMC.iteratorAt(indexRec); - origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); + origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt); } rowMCMatchRec(flag, origin, channel); } @@ -294,7 +295,7 @@ struct HFCandidateCreatorLbMC { // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - origin = (RecoDecay::getMother(particlesMC, particle, 5, true) > -1 ? NonPrompt : Prompt); + origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt); } rowMCMatchGen(flag, origin, channel); diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index 0ec364e765f..e9ff6252b04 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -71,9 +71,10 @@ struct HfTaskLb { Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); - void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) +//void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { - float centrality = collision.centV0M(); + float centrality = 10.;//collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) registry.fill(HIST("hCentrality"), centrality); for (auto& candidate : candidates) { From ac0048c2e5bc40e14b9f3fb9549d25693656d969 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 12:14:40 +0200 Subject: [PATCH 15/22] clang format --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 34d6e5bffab..8ff16206d3f 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -63,7 +63,8 @@ struct HFCandidateCreatorLb { double massPi = RecoDecay::getMassPDG(kPiMinus); double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); - double massLcPi = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);; + double massLcPi = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); + ; Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; @@ -231,7 +232,7 @@ struct HFCandidateCreatorLbMC { void process(aod::HfCandLb const& candidates, aod::HfCandProng3, - aod::BigTracksMC const& tracks, + aod::BigTracksMC const& tracks, aod::McParticles const& particlesMC) { int indexRec = -1; From 8ace4d9e8b17f88f45ae09ee80975f773bf579b4 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 12:16:42 +0200 Subject: [PATCH 16/22] clang format --- PWGHF/Tasks/taskLb.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index e9ff6252b04..d51eb72a0c4 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -71,10 +71,10 @@ struct HfTaskLb { Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); -//void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + //void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { - float centrality = 10.;//collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) + float centrality = 10.; //collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) registry.fill(HIST("hCentrality"), centrality); for (auto& candidate : candidates) { From 1c6a021053c388982f9ccabfa7a7efb711941542 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 17:23:06 +0200 Subject: [PATCH 17/22] Changes to the creator to match the reconstruction of the 3-prong ofn the Xic case --- PWGHF/DataModel/HFSecondaryVertex.h | 11 +- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 215 ++++++++----------- 2 files changed, 98 insertions(+), 128 deletions(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 4de6afadb55..4db9bf0d527 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1072,8 +1072,7 @@ DECLARE_SOA_COLUMN(FlagMCMatchRec, flagMCMatchRec, int8_t); // reconstru DECLARE_SOA_COLUMN(FlagMCMatchGen, flagMCMatchGen, int8_t); // generator level DECLARE_SOA_COLUMN(OriginMCRec, originMCRec, int8_t); // particle origin, reconstruction level DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); // particle origin, generator level -DECLARE_SOA_COLUMN(FlagMCDecayChanRec, flagMCDecayChanRec, int8_t); // resonant decay channel flag, reconstruction level -DECLARE_SOA_COLUMN(FlagMCDecayChanGen, flagMCDecayChanGen, int8_t); // resonant decay channel flag, generator level +DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mis-association reconstruction level // mapping of decay types enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? @@ -1142,17 +1141,15 @@ DECLARE_SOA_EXTENDED_TABLE_USER(HfCandLbExt, HfCandLbBase, "HFCANDLBEXT", using HfCandLb = HfCandLbExt; // table with results of reconstruction level MC matching -DECLARE_SOA_TABLE(HfCandLbMCRec, "AOD", "HFCANDLbMCREC", //! +DECLARE_SOA_TABLE(HfCandLbMCRec, "AOD", "HFCANDLBMCREC", //! hf_cand_lb::FlagMCMatchRec, hf_cand_lb::OriginMCRec, - hf_cand_lb::FlagMCDecayChanRec); + hf_cand_lb::DebugMCRec); // table with results of generator level MC matching DECLARE_SOA_TABLE(HfCandLbMCGen, "AOD", "HFCANDLBMCGEN", //! hf_cand_lb::FlagMCMatchGen, - hf_cand_lb::OriginMCGen, - hf_cand_lb::FlagMCDecayChanGen); - + hf_cand_lb::OriginMCGen); } // namespace o2::aod #endif // O2_ANALYSIS_HFSECONDARYVERTEX_H_ diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 8ff16206d3f..74b19730b2d 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -9,9 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HFCandidateCreatorX.cxx -/// \brief Reconstruction of X(3872) candidates -/// \note Adapted from HFCandidateCreator3Prong +/// \file HFCandidateCreatorLb.cxx +/// \brief Reconstruction of Lb candidates +/// \note Adapted from HFCandidateCreatorXicc /// /// \author Panos Christakoglou , Nikhef @@ -44,16 +44,16 @@ void customize(std::vector& workflowOptions) struct HFCandidateCreatorLb { Produces rowCandidateBase; - Configurable magneticField{"magneticField", 5., "magnetic field"}; + Configurable magneticField{"magneticField", 20., "magnetic field"}; Configurable b_propdca{"b_propdca", true, "create tracks version propagated to PCA"}; Configurable d_maxr{"d_maxr", 200., "reject PCA's above this radius"}; Configurable d_maxdzini{"d_maxdzini", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; Configurable d_minparamchange{"d_minparamchange", 1.e-3, "stop iterations if largest change of any Lb is smaller than this"}; Configurable d_minrelchi2change{"d_minrelchi2change", 0.9, "stop iterations is chi2/chi2old > this"}; - Configurable ptPionMin{"ptPionMin", 0.2, "minimum pion pT threshold (GeV/c)"}; - Configurable b_dovalplots{"b_dovalplots", true, "do validation plots"}; + Configurable ptPionMin{"ptPionMin", 0.5, "minimum pion pT threshold (GeV/c)"}; + Configurable b_dovalplots{"b_dovalplots", false, "do validation plots"}; - OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "Lc+ candidates;inv. mass (pK^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; + OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "#Lambda_{c}^{#plus} candidates;inv. mass (pK^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; OutputObj hPtLc{TH1F("hPtLc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; OutputObj hPtPion{TH1F("hPtPion", "#pi^{#minus} candidates;#pi^{#minus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; OutputObj hCPALc{TH1F("hCPALc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} cosine of pointing angle;entries", 110, -1.1, 1.1)}; @@ -72,8 +72,8 @@ struct HFCandidateCreatorLb { void process(aod::Collision const& collision, soa::Filtered> const& lcCands, + aod::HfCandProng3, + aod::HFSelLcCandidate>> const& lcCands, aod::BigTracks const& tracks) { // 2-prong vertex fitter @@ -98,122 +98,108 @@ struct HFCandidateCreatorLb { // loop over Lc candidates for (auto& lcCand : lcCands) { - if (!(lcCand.hfflag() & 1 << hf_cand_prong3::DecayType::LcToPKPi) && !(lcCand.hfflag() & 1 << hf_cand_prong3::DecayType::LcToPKPi)) { + if (!(lcCand.hfflag() & 1 << o2::aod::hf_cand_prong3::LcToPKPi)) { continue; } - if (cutYCandMax >= 0. && std::abs(YLc(lcCand)) > cutYCandMax) { - continue; + if (lcCand.isSelLcpKpi() >= d_selectionFlagLc) { + hMassLcToPKPi->Fill(InvMassLcpKpi(lcCand), lcCand.pt()); } - if (lcCand.isSelLcpKpi() > 0) { - hMassLcToPKPi->Fill(InvMassLcpKpi(lcCand)); + if (lcCand.isSelLcpiKp() >= d_selectionFlagLc) { + hMassLcToPKPi->Fill(InvMassLcpiKp(lcCand), lcCand.pt()); } - //if (jpsiCand.isSelLcToPiKP() > 0) { - //hMassLcToPKPi->Fill(InvMassLcToMuMu(jpsiCand)); - //} - hPtLc->Fill(lcCand.pt()); - hCPALc->Fill(lcCand.cpa()); - - //Printf("(Panos) Inside the Lc candidate loop (y = %lf)",YLc(lcCand)); - - // create Lc track to pass to DCA fitter; use cand table + rebuild vertex - const std::array vertexLc = {lcCand.xSecondaryVertex(), lcCand.ySecondaryVertex(), lcCand.zSecondaryVertex()}; - array pvecLc = {lcCand.px(), lcCand.py(), lcCand.pz()}; - auto prong0 = lcCand.index0_as(); - auto prong1 = lcCand.index1_as(); - auto prong2 = lcCand.index2_as(); - auto prong0TrackParCov = getTrackParCov(prong0); - auto prong1TrackParCov = getTrackParCov(prong1); - auto prong2TrackParCov = getTrackParCov(prong1); - - if (df3.process(prong0TrackParCov, prong1TrackParCov, prong2TrackParCov) == 0) { + auto track0 = lcCand.index0_as(); + auto track1 = lcCand.index1_as(); + auto track2 = lcCand.index2_as(); + auto trackParVar0 = getTrackParCov(track0); + auto trackParVar1 = getTrackParCov(track1); + auto trackParVar2 = getTrackParCov(track2); + auto collision = track0.collision(); + + // reconstruct the 3-prong secondary vertex + if (df3.process(trackParVar0, trackParVar1, trackParVar2) == 0) { continue; } - - // propogate prong tracks to Lc vertex - prong0TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); - prong1TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); - prong2TrackParCov.propagateTo(lcCand.xSecondaryVertex(), magneticField); - const std::array covLc = df3.calcPCACovMatrixFlat(); - // define the Lc track - auto trackLc = o2::dataformats::V0(vertexLc, pvecLc, covLc, prong0TrackParCov, prong1TrackParCov, {0, 0}, {0, 0}); //FIXME: also needs covxyz??? - - // used to check that prongs used for Lc and X reco are not the same prongs - int index0Lc = lcCand.index0Id(); - int index1Lc = lcCand.index1Id(); - int index2Lc = lcCand.index2Id(); - - // loop over pi- candidates - for (auto& trackNeg : tracks) { - if (trackNeg.sign() > 0) { // select only negative tracks - use partitions? + const auto& secondaryVertex = df3.getPCACandidate(); + trackParVar0.propagateTo(secondaryVertex[0], magneticField); + trackParVar1.propagateTo(secondaryVertex[0], magneticField); + trackParVar2.propagateTo(secondaryVertex[0], magneticField); + + array pvecpK = {track0.px() + track1.px(), track0.py() + track1.py(), track0.pz() + track1.pz()}; + array pvecLc = {pvecpK[0] + track2.px(), pvecpK[1] + track2.py(), pvecpK[2] + track2.pz()}; + auto trackpK = o2::dataformats::V0(df3.getPCACandidatePos(), pvecpK, df3.calcPCACovMatrixFlat(), + trackParVar0, trackParVar1, {0, 0}, {0, 0}); + auto trackLc = o2::dataformats::V0(df3.getPCACandidatePos(), pvecLc, df3.calcPCACovMatrixFlat(), + trackpK, trackParVar2, {0, 0}, {0, 0}); + + int index0Lc = track0.globalIndex(); + int index1Lc = track1.globalIndex(); + int index2Lc = track2.globalIndex(); + int charge = track0.sign() + track1.sign() + track2.sign(); + + for (auto& trackPion : tracks) { + if (trackPion.pt() < ptPionMin) { continue; } - if (trackNeg.globalIndex() == index2Lc) { + if (trackPion.sign() * charge < 0) { continue; } - if (trackNeg.pt() < ptPionMin) { + if (trackPion.globalIndex() == index0Lc || trackPion.globalIndex() == index1Lc || trackPion.globalIndex() == index2Lc) { continue; } - hPtPion->Fill(trackNeg.pt()); - - auto trackParVarNeg = getTrackParCov(trackNeg); - array pvecNeg; + array pvecPion; + auto trackParVarPi = getTrackParCov(trackPion); - // reconstruct the 3-prong X vertex - if (df2.process(trackLc, trackParVarNeg) == 0) { + // reconstruct the 3-prong Lc vertex + if (df2.process(trackLc, trackParVarPi) == 0) { continue; } - //Printf("(Panos) Inside the pi- candidate loop (y = %lf)",trackNeg.pt()); - // calculate relevant properties - const auto& LbsecondaryVertex = df2.getPCACandidate(); + const auto& secondaryVertexLb = df2.getPCACandidate(); auto chi2PCA = df2.getChi2AtPCACandidate(); auto covMatrixPCA = df2.calcPCACovMatrix().Array(); - hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line. - df2.propagateTracksToVertex(); // propagate the pions and Lc to the X vertex - df2.getTrack(0).getPxPyPzGlo(pvecLc); // update momentum of Lc at the Lb vertex - df2.getTrack(1).getPxPyPzGlo(pvecNeg); // momentum of pi- at the Lb vertex + df2.propagateTracksToVertex(); + df2.getTrack(0).getPxPyPzGlo(pvecLc); + df2.getTrack(1).getPxPyPzGlo(pvecPion); - // get track impact parameters - // This modifies track momenta! auto primaryVertex = getPrimaryVertex(collision); auto covMatrixPV = primaryVertex.getCov(); - hCovPVXX->Fill(covMatrixPV[0]); o2::dataformats::DCA impactParameter0; o2::dataformats::DCA impactParameter1; - trackParVarNeg.propagateToDCA(primaryVertex, magneticField, &impactParameter1); + trackLc.propagateToDCA(primaryVertex, magneticField, &impactParameter0); + trackParVarPi.propagateToDCA(primaryVertex, magneticField, &impactParameter1); // get uncertainty of the decay length double phi, theta; - getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, LbsecondaryVertex, phi, theta); + getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexLb, phi, theta); auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); - int hfFlag = 0; - if (TESTBIT(lcCand.hfflag(), hf_cand_prong3::DecayType::LcToPKPi)) { - SETBIT(hfFlag, hf_cand_lb::DecayType::LbToLcPi); - } + int hfFlag = 1 << hf_cand_lb::DecayType::LbToLcPi; // fill the candidate table for the Lb here: rowCandidateBase(collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ(), - LbsecondaryVertex[0], LbsecondaryVertex[1], LbsecondaryVertex[2], + secondaryVertexLb[0], secondaryVertexLb[1], secondaryVertexLb[2], errorDecayLength, errorDecayLengthXY, chi2PCA, pvecLc[0], pvecLc[1], pvecLc[2], - pvecNeg[0], pvecNeg[1], pvecNeg[2], + pvecPion[0], pvecPion[1], pvecPion[2], impactParameter0.getY(), impactParameter1.getY(), std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), - lcCand.globalIndex(), trackNeg.globalIndex(), + lcCand.globalIndex(), trackPion.globalIndex(), hfFlag); // calculate invariant mass - auto arrayMomenta = array{pvecLc, pvecNeg}; + auto arrayMomenta = array{pvecLc, pvecPion}; massLcPi = RecoDecay::M(std::move(arrayMomenta), array{massLc, massPi}); if (lcCand.isSelLcpKpi() > 0) { hMassLbToLcPi->Fill(massLcPi); } + if (lcCand.isSelLcpiKp() > 0) { + hMassLbToLcPi->Fill(massLcPi); + } } // pi- loop } // Lc loop } // process @@ -236,73 +222,60 @@ struct HFCandidateCreatorLbMC { aod::McParticles const& particlesMC) { int indexRec = -1; - int indexRecLc = -1; - int pdgCodeLb = pdg::Code::kLambdaCPlus; - int pdgCodeLc = pdg::Code::kLambdaB0; int8_t sign = 0; int8_t flag = 0; int8_t origin = 0; - int8_t channel = 0; + int8_t debug = 0; // Match reconstructed candidates. for (auto& candidate : candidates) { //Printf("New rec. candidate"); flag = 0; origin = 0; - channel = 0; - auto lcTrack = candidate.index0(); - auto daughter0Lc = lcTrack.index0_as(); - auto daughter1Lc = lcTrack.index1_as(); - auto daughter2Lc = lcTrack.index2_as(); - auto arrayLcDaughters = array{daughter0Lc, daughter1Lc, daughter2Lc}; - auto arrayDaughters = array{candidate.index1_as(), daughter0Lc, daughter1Lc, daughter2Lc}; - + debug = 0; + auto lcCand = candidate.index0(); + auto arrayDaughters = array{lcCand.index0_as(), + lcCand.index1_as(), + lcCand.index2_as(), + candidate.index1_as()}; + auto arrayDaughtersLc = array{lcCand.index0_as(), + lcCand.index1_as(), + lcCand.index2_as()}; // Λb → Λc+ π- //Printf("Checking Λb → Λc+ π-"); - indexRecLc = RecoDecay::getMatchedMCRec(particlesMC, arrayLcDaughters, pdg::Code::kLambdaCPlus, array{2212, -321, +211}, true); - if (indexRecLc > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{-211, 2212, -321, +211}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); + if (indexRec > -1) { + // Λb → Λc+ π- + //Printf("Checking Λb → Λc+ π-"); + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersLc, pdg::Code::kLambdaCPlus, array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; + } else { + debug = 1; + LOGF(info, "WARNING: Λb in decays in the expected final state but the condition on the intermediate state is not fulfilled"); } } - - //Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { - auto particle = particlesMC.iteratorAt(indexRec); - origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt); - } - rowMCMatchRec(flag, origin, channel); + rowMCMatchRec(flag, origin, debug); } - //Match generated particles. + // Match generated particles. for (auto& particle : particlesMC) { //Printf("New gen. candidate"); flag = 0; origin = 0; - channel = 0; - // Λb → Λc+ π- - //Printf("Checking Λb → Λc+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, array{4122, -211}, true)) { - // Match Λc+ --> pKπ- - std::vector arrDaughter; - RecoDecay::getDaughters(particlesMC, particle, &arrDaughter, array{4122}, 1); - auto lcCandMC = particlesMC.iteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(particlesMC, lcCandMC, pdg::Code::kLambdaCPlus, array{2212, -321, 211}, true)) { - flag = 1 << hf_cand_lb::DecayType::LbToLcPi; + if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, array{int(pdg::Code::kLambdaCPlus), -kPiPlus}, true)) { + // Match Λc+ -> pKπ + auto LcCandMC = particlesMC.iteratorAt(particle.daughter0Id()); + //Printf("Checking Λc+ → p K- π+"); + if (RecoDecay::isMatchedMCGen(particlesMC, LcCandMC, int(pdg::Code::kLambdaCPlus), array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { + flag = sign * (1 << hf_cand_lb::DecayType::LbToLcPi); } } - - // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { - origin = (RecoDecay::getMother(particlesMC, particle, kBottom, true) > -1 ? OriginType::NonPrompt : OriginType::Prompt); - } - - rowMCMatchGen(flag, origin, channel); - } // candidate loop - } // process -}; // struct + rowMCMatchGen(flag, origin); + } + } +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 074f6574b0edc24379fa095ce48687aadc8ec639 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 17:26:35 +0200 Subject: [PATCH 18/22] another set of format fixes --- PWGHF/DataModel/HFSecondaryVertex.h | 10 +++++----- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 4db9bf0d527..57fd8184338 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1068,11 +1068,11 @@ namespace hf_cand_lb { DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, HfCandProng3, "_0"); // Lb index // MC matching result: -DECLARE_SOA_COLUMN(FlagMCMatchRec, flagMCMatchRec, int8_t); // reconstruction level -DECLARE_SOA_COLUMN(FlagMCMatchGen, flagMCMatchGen, int8_t); // generator level -DECLARE_SOA_COLUMN(OriginMCRec, originMCRec, int8_t); // particle origin, reconstruction level -DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); // particle origin, generator level -DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mis-association reconstruction level +DECLARE_SOA_COLUMN(FlagMCMatchRec, flagMCMatchRec, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(FlagMCMatchGen, flagMCMatchGen, int8_t); // generator level +DECLARE_SOA_COLUMN(OriginMCRec, originMCRec, int8_t); // particle origin, reconstruction level +DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); // particle origin, generator level +DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mis-association reconstruction level // mapping of decay types enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 74b19730b2d..454816b34bd 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -72,8 +72,8 @@ struct HFCandidateCreatorLb { void process(aod::Collision const& collision, soa::Filtered> const& lcCands, + aod::HfCandProng3, + aod::HFSelLcCandidate>> const& lcCands, aod::BigTracks const& tracks) { // 2-prong vertex fitter @@ -129,7 +129,7 @@ struct HFCandidateCreatorLb { auto trackpK = o2::dataformats::V0(df3.getPCACandidatePos(), pvecpK, df3.calcPCACovMatrixFlat(), trackParVar0, trackParVar1, {0, 0}, {0, 0}); auto trackLc = o2::dataformats::V0(df3.getPCACandidatePos(), pvecLc, df3.calcPCACovMatrixFlat(), - trackpK, trackParVar2, {0, 0}, {0, 0}); + trackpK, trackParVar2, {0, 0}, {0, 0}); int index0Lc = track0.globalIndex(); int index1Lc = track1.globalIndex(); @@ -245,8 +245,8 @@ struct HFCandidateCreatorLbMC { //Printf("Checking Λb → Λc+ π-"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { - // Λb → Λc+ π- - //Printf("Checking Λb → Λc+ π-"); + // Λb → Λc+ π- + //Printf("Checking Λb → Λc+ π-"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersLc, pdg::Code::kLambdaCPlus, array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; From 9c36d8f1c7deb1ef75f3a497c35048a9f55c212d Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 21:22:43 +0200 Subject: [PATCH 19/22] Further debugging + fixing selector --- .../HFLbToLcPiCandidateSelector.cxx | 50 +++++++++---------- PWGHF/Tasks/taskLb.cxx | 6 +-- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 4c342150668..7807000e738 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -64,20 +64,31 @@ struct HfLbToLcPiCandidateSelector { return false; } - //pi pt + // check that the candidate pT is within the analysis range + if (candpT < pTCandMin || candpT >= pTCandMax) { + return false; + } + + //Λb0 mass cut + if (std::abs(InvMassLbToLcPi(hfCandLb) - RecoDecay::getMassPDG(pdg::Code::kLambdaB0)) > cuts->get(pTBin, "m")) { + //Printf("Lb topol selection failed at mass diff check"); + return false; + } + + //pion pt if (trackPi.pt() < cuts->get(pTBin, "pT Pi")) { return false; } - //d0(Lc)xd0(pi) ==> removed temporarily + //d0(Lc)xd0(pi) if (hfCandLb.impactParameterProduct() > cuts->get(pTBin, "Imp. Par. Product")) { return false; } - //Lc mass ==> removed temporarily + //Lc mass //if (trackPi.sign() < 0) { //if (std::abs(InvMassLcpKpi(hfCandLc) - RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus)) > cuts->get(pTBin, "DeltaMLc")) { - // return false; + //return false; //} //} @@ -92,35 +103,20 @@ struct HfLbToLcPiCandidateSelector { } //Lb CPA cut - if (hfCandLb.cpa() < cuts->get(pTBin, "CPA")) { + //if (hfCandLb.cpa() < cuts->get(pTBin, "CPA")) { + //return false; + //} + + //d0 of Lc and pi + if ((std::abs(hfCandLb.impactParameter0()) > cuts->get(pTBin, "d0 Lc+")) || + (std::abs(hfCandLb.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))){ return false; } - //if (candpT < pTCandMin || candpT >= pTCandMax) { - // Printf("B+ topol selection failed at cand pT check"); - // return false; - // } - - //B+ mass cut - //if (std::abs(InvMassBPlus(hfCandBPlus) - RecoDecay::getMassPDG(521)) > cuts->get(pTBin, "m")) { - // Printf("B+ topol selection failed at mass diff check"); - // return false; - // } - - //d0 of D0 and pi - //if ((std::abs(hfCandBPlus.impactParameter0()) > cuts->get(pTBin, "d0 D0")) || - // (std::abs(hfCandBPlus.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))){ - // return false; - //} - - //D0 CPA - // if (std::abs(hfCandD0.cpa()) < cuts->get(pTBin, "CPA D0")){ - // return false; - //} return true; } - void process(aod::HfCandLb const& hfCandLbs, soa::Join) + void process(aod::HfCandLb const& hfCandLbs, soa::Join, aod::BigTracksPID const&) { for (auto& hfCandLb : hfCandLbs) { //looping over Lb candidates diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index d51eb72a0c4..988360c75f3 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -71,10 +71,10 @@ struct HfTaskLb { Filter filterSelectCandidates = (aod::hf_selcandidate_lb::isSelLbToLcPi >= selectionFlagLb); - //void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) - void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) + //void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { - float centrality = 10.; //collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) + float centrality = collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) registry.fill(HIST("hCentrality"), centrality); for (auto& candidate : candidates) { From 0099cca445bca559445b878df8dbe8cd395df1c2 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 21:24:29 +0200 Subject: [PATCH 20/22] Format changes --- PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx | 6 +++--- PWGHF/Tasks/taskLb.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 7807000e738..6c34b9afe1e 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -80,12 +80,12 @@ struct HfLbToLcPiCandidateSelector { return false; } - //d0(Lc)xd0(pi) + //d0(Lc)xd0(pi) if (hfCandLb.impactParameterProduct() > cuts->get(pTBin, "Imp. Par. Product")) { return false; } - //Lc mass + //Lc mass //if (trackPi.sign() < 0) { //if (std::abs(InvMassLcpKpi(hfCandLc) - RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus)) > cuts->get(pTBin, "DeltaMLc")) { //return false; @@ -109,7 +109,7 @@ struct HfLbToLcPiCandidateSelector { //d0 of Lc and pi if ((std::abs(hfCandLb.impactParameter0()) > cuts->get(pTBin, "d0 Lc+")) || - (std::abs(hfCandLb.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))){ + (std::abs(hfCandLb.impactParameter1()) > cuts->get(pTBin, "d0 Pi"))) { return false; } diff --git a/PWGHF/Tasks/taskLb.cxx b/PWGHF/Tasks/taskLb.cxx index 988360c75f3..59bf8bc97cb 100644 --- a/PWGHF/Tasks/taskLb.cxx +++ b/PWGHF/Tasks/taskLb.cxx @@ -74,7 +74,7 @@ struct HfTaskLb { void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join, aod::BigTracks) //void process(soa::Filtered> const& candidates, soa::Join, aod::BigTracks) { - float centrality = collision.centV0M();//FIXME: Add centrality properly;removed for the time being (taking forever to run) + float centrality = collision.centV0M(); //FIXME: Add centrality properly;removed for the time being (taking forever to run) registry.fill(HIST("hCentrality"), centrality); for (auto& candidate : candidates) { From 406db922b396e9ba70442158802fe970312c45b5 Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Tue, 19 Oct 2021 21:53:34 +0200 Subject: [PATCH 21/22] Casting the Lc candidate to index0_as --- PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx index 6c34b9afe1e..ba89f210c96 100644 --- a/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx +++ b/PWGHF/TableProducer/HFLbToLcPiCandidateSelector.cxx @@ -130,8 +130,8 @@ struct HfLbToLcPiCandidateSelector { } // Lc is always index0 and pi is index1 by default - auto candLc = hfCandLb.index0(); - //auto candLc = hfCandLb.index0_as>(); + //auto candLc = hfCandLb.index0(); + auto candLc = hfCandLb.index0_as>(); auto trackPi = hfCandLb.index1_as(); //topological cuts From 17aeede436288af44e115574d5a70b3c66ac06d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Tue, 19 Oct 2021 23:36:52 +0200 Subject: [PATCH 22/22] Fix creator --- PWGHF/TableProducer/HFCandidateCreatorLb.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx index 454816b34bd..72d5b092899 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorLb.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorLb.cxx @@ -51,7 +51,6 @@ struct HFCandidateCreatorLb { Configurable d_minparamchange{"d_minparamchange", 1.e-3, "stop iterations if largest change of any Lb is smaller than this"}; Configurable d_minrelchi2change{"d_minrelchi2change", 0.9, "stop iterations is chi2/chi2old > this"}; Configurable ptPionMin{"ptPionMin", 0.5, "minimum pion pT threshold (GeV/c)"}; - Configurable b_dovalplots{"b_dovalplots", false, "do validation plots"}; OutputObj hMassLcToPKPi{TH1F("hMassLcToPKPi", "#Lambda_{c}^{#plus} candidates;inv. mass (pK^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; OutputObj hPtLc{TH1F("hPtLc", "#Lambda_{c}^{#plus} candidates;#Lambda_{c}^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", 100, 0., 10.)}; @@ -63,8 +62,7 @@ struct HFCandidateCreatorLb { double massPi = RecoDecay::getMassPDG(kPiMinus); double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); - double massLcPi = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); - ; + double massLcPi = 0.; Configurable d_selectionFlagLc{"d_selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; @@ -98,7 +96,7 @@ struct HFCandidateCreatorLb { // loop over Lc candidates for (auto& lcCand : lcCands) { - if (!(lcCand.hfflag() & 1 << o2::aod::hf_cand_prong3::LcToPKPi)) { + if (!(lcCand.hfflag() & 1 << o2::aod::hf_cand_prong3::DecayType::LcToPKPi)) { continue; } if (lcCand.isSelLcpKpi() >= d_selectionFlagLc) {