From c121fef7c78c71f531e6c288b5d00e9a15bf64f0 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Thu, 21 Oct 2021 17:07:13 +0200 Subject: [PATCH 1/8] Add chi_c tree creator --- PWGHF/TableProducer/CMakeLists.txt | 5 + .../HFTreeCreatorChicToJpsiGamma.cxx | 226 ++++++++++++++++++ 2 files changed, 231 insertions(+) create mode 100644 PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 410541a0977..08586928bcd 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -69,6 +69,11 @@ o2physics_add_dpl_workflow(tree-creator-x-tojpsipipi PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tree-creator-chic-tojpsigamma + SOURCES HFTreeCreatorChicToJpsiGamma.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tree-creator-xicc-topkpipi SOURCES HFTreeCreatorXiccToPKPiPi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx new file mode 100644 index 00000000000..a6e195683c2 --- /dev/null +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -0,0 +1,226 @@ +// 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 HFTreeCreator3Prong.cxx +/// \brief Writer of the 3 prong candidates in the form of flat tables to be stored in TTrees. +/// Intended for debug or for the local optimization of analysis on small samples. +/// In this file are defined and filled the output tables +/// +/// \author Luca Micheletti , INFN +/// \note based on O2Physics/Tasks/PWGHF/HFTreeCreatorLcToPKPi.cxx + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "DetectorsVertexing/DCAFitterN.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" +#include "Common/Core/trackUtilities.h" +#include "ReconstructionDataFormats/DCA.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::aod::hf_cand_chic; + +namespace o2::aod +{ +namespace full +{ +DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); +DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); +DECLARE_SOA_COLUMN(PProng0, pProng0, float); +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); +DECLARE_SOA_COLUMN(PProng1, pProng1, float); +DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(P, p, float); +DECLARE_SOA_COLUMN(Eta, eta, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Y, y, float); +//DECLARE_SOA_COLUMN(MJPsi, mjpsi, float); +DECLARE_SOA_COLUMN(E, e, float); +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); +DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); +DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); +DECLARE_SOA_COLUMN(CPA, cpa, float); +DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); +DECLARE_SOA_COLUMN(Ct, ct, float); +DECLARE_SOA_COLUMN(MCflag, mcflag, int8_t); +// Events +DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); +DECLARE_SOA_COLUMN(RunNumber, runNumber, int); +} // namespace full + +DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", + // collision::BCId, + // collision::NumContrib, + collision::PosX, + collision::PosY, + collision::PosZ, + full::ImpactParameterNormalised0, + full::RSecondaryVertex, + full::DecayLength, + full::DecayLengthXY, + full::PtProng0, + full::PProng0, + full::PtProng1, + full::PProng1, + hf_cand::Chi2PCA, + hf_cand::ImpactParameter0, + // hf_cand::ImpactParameter1, + full::CandidateSelFlag, + full::M, + full::Pt, + full::P, + full::CPA, + full::CPAXY, + full::Ct, + full::Eta, + full::Phi, + full::Y, + // full::MJPsi, + full::MCflag); + +DECLARE_SOA_TABLE(HfCandChicFullEvents, "AOD", "HFCANDChicFullE", + collision::BCId, + collision::NumContrib, + collision::PosX, + collision::PosY, + collision::PosZ, + full::IsEventReject, + full::RunNumber); + +DECLARE_SOA_TABLE(HfCandChicFullParticles, "AOD", "HFCANDChicFullP", + collision::BCId, + full::Pt, + full::Eta, + full::Phi, + full::Y, + full::MCflag); + +} // namespace o2::aod + +/// Writes the full information in an output TTree +struct HfTreeCreatorChicToJpsiGamma { + Produces rowCandidateFull; + Produces rowCandidateFullEvents; + Produces rowCandidateFullParticles; + + void init(InitContext const&) + { + } + + void process(aod::Collisions const& collisions, + aod::McCollisions const& mccollisions, + soa::Join const& candidates, + soa::Join const& particles, + aod::BigTracksPID const& tracks) + { + + // Filling event properties + rowCandidateFullEvents.reserve(collisions.size()); + for (auto& collision : collisions) { + rowCandidateFullEvents( + collision.bcId(), + collision.numContrib(), + collision.posX(), + collision.posY(), + collision.posZ(), + 0, + 1); + } + + // Filling candidate properties + int indexCand = 0; + rowCandidateFull.reserve(candidates.size()); + for (auto& candidate : candidates) { + indexCand++; + auto fillTable = [&](int CandFlag, + int FunctionSelection, + float FunctionInvMass, + float FunctionCt, + float FunctionY//, + // float FunctionInvMassJPsi + ) { + if (FunctionSelection >= 1) { + //auto jpsi = candidate.index0(); + rowCandidateFull( +// candidate.index1_as().collision().bcId(), +// candidate.index0_as().collision().numContrib(), + // candidate.index0().index1_as().collision().bcId(), + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.chi2PCA(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.ptProng1(), + RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.impactParameter0(), + // candidate.impactParameter1(), + // candidate.impactParameter2(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + // FunctionInvMassJPsi, + candidate.flagMCMatchRec()); + } + }; + fillTable(0, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); + fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); + // fillTable(0, candidate.isSelChicToJpsiToEEGamma(), + // InvMassChicToJpsiGamma(candidate), + // CtChic(candidate), YChic(candidate), + // InvMassJpsiToEE(candidate.index0())); + // fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), + // InvMassChicToJpsiGamma(candidate), + // CtChic(candidate), + // YChic(candidate), + // InvMassJpsiToMuMu(candidate.index0())); + } + + // Filling particle properties + float massChic = RecoDecay::getMassPDG(pdg::Code::kChic1); + rowCandidateFullParticles.reserve(particles.size()); + for (auto& particle : particles) { + if (std::abs(particle.flagMCMatchGen()) == 1 << DecayType::ChicToJpsiToEEGamma || std::abs(particle.flagMCMatchGen()) == 1 << DecayType::ChicToJpsiToMuMuGamma) { + rowCandidateFullParticles( + particle.mcCollision().bcId(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, massChic), + particle.flagMCMatchGen()); + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow; + workflow.push_back(adaptAnalysisTask(cfgc)); + return workflow; +} From 59662e5353f55b25f9ee024747b484604a9da5d7 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Thu, 21 Oct 2021 18:31:14 +0200 Subject: [PATCH 2/8] Add chi_c tree creator --- .../HFTreeCreatorChicToJpsiGamma.cxx | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index a6e195683c2..3be2cd7c13a 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -63,8 +63,8 @@ DECLARE_SOA_COLUMN(RunNumber, runNumber, int); } // namespace full DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", - // collision::BCId, - // collision::NumContrib, + collision::BCId, + collision::NumContrib, collision::PosX, collision::PosY, collision::PosZ, @@ -78,7 +78,6 @@ DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", full::PProng1, hf_cand::Chi2PCA, hf_cand::ImpactParameter0, - // hf_cand::ImpactParameter1, full::CandidateSelFlag, full::M, full::Pt, @@ -89,7 +88,7 @@ DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", full::Eta, full::Phi, full::Y, - // full::MJPsi, + hf_cand_chic::JpsiToMuMuMass, full::MCflag); DECLARE_SOA_TABLE(HfCandChicFullEvents, "AOD", "HFCANDChicFullE", @@ -107,6 +106,7 @@ DECLARE_SOA_TABLE(HfCandChicFullParticles, "AOD", "HFCANDChicFullP", full::Eta, full::Phi, full::Y, + hf_cand_chic::JpsiToMuMuMass, full::MCflag); } // namespace o2::aod @@ -150,49 +150,47 @@ struct HfTreeCreatorChicToJpsiGamma { int FunctionSelection, float FunctionInvMass, float FunctionCt, - float FunctionY//, - // float FunctionInvMassJPsi + float FunctionY //, float FunctionInvMassJPsi ) { if (FunctionSelection >= 1) { //auto jpsi = candidate.index0(); rowCandidateFull( -// candidate.index1_as().collision().bcId(), -// candidate.index0_as().collision().numContrib(), - // candidate.index0().index1_as().collision().bcId(), - candidate.posX(), - candidate.posY(), - candidate.posZ(), - candidate.chi2PCA(), - candidate.rSecondaryVertex(), - candidate.decayLength(), - candidate.decayLengthXY(), - candidate.impactParameterNormalised0(), - candidate.ptProng0(), - RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), - candidate.ptProng1(), - RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), - candidate.impactParameter0(), - // candidate.impactParameter1(), - // candidate.impactParameter2(), - 1 << CandFlag, - FunctionInvMass, - candidate.pt(), - candidate.p(), - candidate.cpa(), - candidate.cpaXY(), - FunctionCt, - candidate.eta(), - candidate.phi(), - FunctionY, - // FunctionInvMassJPsi, - candidate.flagMCMatchRec()); + 0, // candidate.index1_as().collision().bcId(), + 0, // candidate.index0_as().collision().numContrib(), + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.chi2PCA(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.ptProng1(), + RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.impactParameter0(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + 0., //FunctionInvMassJPsi, + candidate.flagMCMatchRec() + ); } }; fillTable(0, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); // fillTable(0, candidate.isSelChicToJpsiToEEGamma(), // InvMassChicToJpsiGamma(candidate), - // CtChic(candidate), YChic(candidate), + // CtChic(candidate), + // YChic(candidate), // InvMassJpsiToEE(candidate.index0())); // fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), // InvMassChicToJpsiGamma(candidate), @@ -212,6 +210,7 @@ struct HfTreeCreatorChicToJpsiGamma { particle.eta(), particle.phi(), RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, massChic), + 0., // put here the jpsi mass particle.flagMCMatchGen()); } } From bc473e26328504072476a3055d30842f899961a6 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Thu, 28 Oct 2021 10:55:24 +0200 Subject: [PATCH 3/8] Chic tree creator for ML with updates --- .../HFTreeCreatorChicToJpsiGamma.cxx | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index 3be2cd7c13a..2c6962bc075 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -47,7 +47,6 @@ DECLARE_SOA_COLUMN(P, p, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Y, y, float); -//DECLARE_SOA_COLUMN(MJPsi, mjpsi, float); DECLARE_SOA_COLUMN(E, e, float); DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); @@ -125,7 +124,9 @@ struct HfTreeCreatorChicToJpsiGamma { aod::McCollisions const& mccollisions, soa::Join const& candidates, soa::Join const& particles, - aod::BigTracksPID const& tracks) + aod::BigTracksPID const& tracks, + aod::HfCandProng2 const& jpsiCands + ) { // Filling event properties @@ -145,18 +146,32 @@ struct HfTreeCreatorChicToJpsiGamma { int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { + // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; + // std::cout << "daughter momenta: " << candidate.jpsiToMuMuMass() << std::endl; + // std::cout << "Prong 0: px, py, pz = " << candidate.pxProng0() << ", " << candidate.pyProng0() << ", " << candidate.pzProng0() << std::endl; + // std::cout << "Prong 1: px, py, pz = " << candidate.pxProng1() << ", " << candidate.pyProng1() << ", " << candidate.pzProng1() << std::endl; + // std::cout << "index 0, 1 = " << candidate.index0Id() << ", " << candidate.index1Id() << std::endl; + // auto jpsi = candidate.index0(); + // auto trackPos = jpsi.index0_as(); // positive daughter + // auto trackNeg = jpsi.index1_as(); // negative daughter + + // std::cout << "trackPos: px, py, pz = " << trackPos.px() << ", " << trackPos.py() << ", " << trackPos.pz() << std::endl; + // std::cout << "trackNeg: px, py, pz = " << trackNeg.px() << ", " << trackNeg.py() << ", " << trackNeg.pz() << std::endl; + // std::cout << "bcId, numContrib = " << candidate.index0().index0_as().collision().bcId() << ", " + // << candidate.index0().index0_as().collision().numContrib() << std::endl; indexCand++; auto fillTable = [&](int CandFlag, int FunctionSelection, float FunctionInvMass, float FunctionCt, - float FunctionY //, float FunctionInvMassJPsi + float FunctionY ) { if (FunctionSelection >= 1) { - //auto jpsi = candidate.index0(); rowCandidateFull( - 0, // candidate.index1_as().collision().bcId(), - 0, // candidate.index0_as().collision().numContrib(), + candidate.index0().index0_as().collision().bcId(), + candidate.index0().index0_as().collision().numContrib(), +// 0, // candidate.index0().index0_as().collision().bcId(), +// 0, // candidate.index0().index0_as().collision().numContrib(), candidate.posX(), candidate.posY(), candidate.posZ(), @@ -180,23 +195,13 @@ struct HfTreeCreatorChicToJpsiGamma { candidate.eta(), candidate.phi(), FunctionY, - 0., //FunctionInvMassJPsi, + candidate.jpsiToMuMuMass(), candidate.flagMCMatchRec() ); } }; fillTable(0, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); - // fillTable(0, candidate.isSelChicToJpsiToEEGamma(), - // InvMassChicToJpsiGamma(candidate), - // CtChic(candidate), - // YChic(candidate), - // InvMassJpsiToEE(candidate.index0())); - // fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), - // InvMassChicToJpsiGamma(candidate), - // CtChic(candidate), - // YChic(candidate), - // InvMassJpsiToMuMu(candidate.index0())); } // Filling particle properties From c03cb9eaeaf6b0efcd1b26bfc112097752b9ae6d Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Thu, 18 Nov 2021 11:46:48 +0100 Subject: [PATCH 4/8] Update chic tree creator --- .../HFTreeCreatorChicToJpsiGamma.cxx | 68 +++++++++++++------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index 2c6962bc075..e0d302779c7 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -14,8 +14,9 @@ /// Intended for debug or for the local optimization of analysis on small samples. /// In this file are defined and filled the output tables /// +/// \author Alessandro De Falco , Università/INFN Cagliari +/// \note based on O2Physics/Tasks/PWGHF/HFTreeCreatorXToJPsiPiPi.cxx /// \author Luca Micheletti , INFN -/// \note based on O2Physics/Tasks/PWGHF/HFTreeCreatorLcToPKPi.cxx #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -34,27 +35,33 @@ namespace o2::aod { namespace full { -DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); +DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); DECLARE_SOA_COLUMN(PProng0, pProng0, float); DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); DECLARE_SOA_COLUMN(PProng1, pProng1, float); +// DECLARE_SOA_COLUMN(PtJPsi, ptJpsi, float); +// DECLARE_SOA_COLUMN(PJPsi, pJpsi, float); +// DECLARE_SOA_COLUMN(PtGamma, ptGamma, float); +// DECLARE_SOA_COLUMN(PGamma, pGamma, float); +DECLARE_SOA_COLUMN(Alpha, alpha, float); +DECLARE_SOA_COLUMN(Qt, qt, float); DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(P, p, float); +DECLARE_SOA_COLUMN(CPA, cpa, float); +DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); +DECLARE_SOA_COLUMN(Ct, ct, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(E, e, float); -DECLARE_SOA_COLUMN(DecayLength, decayLength, float); -DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); -DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); -DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); -DECLARE_SOA_COLUMN(CPA, cpa, float); -DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); -DECLARE_SOA_COLUMN(Ct, ct, float); +//DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); +//DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); DECLARE_SOA_COLUMN(MCflag, mcflag, int8_t); // Events DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); @@ -75,6 +82,12 @@ DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", full::PProng0, full::PtProng1, full::PProng1, + // full::PtJPsi, + // full::PJPsi, + // full::PtGamma, + // full::PGamma, + full::Alpha, + full::Qt, hf_cand::Chi2PCA, hf_cand::ImpactParameter0, full::CandidateSelFlag, @@ -146,15 +159,32 @@ struct HfTreeCreatorChicToJpsiGamma { int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; - // std::cout << "daughter momenta: " << candidate.jpsiToMuMuMass() << std::endl; + // std::cout << "candidate: px, py, pz = " << candidate.px() << ", " << candidate.py() << ", " << candidate.pz() << std::endl; // std::cout << "Prong 0: px, py, pz = " << candidate.pxProng0() << ", " << candidate.pyProng0() << ", " << candidate.pzProng0() << std::endl; // std::cout << "Prong 1: px, py, pz = " << candidate.pxProng1() << ", " << candidate.pyProng1() << ", " << candidate.pzProng1() << std::endl; + // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; // std::cout << "index 0, 1 = " << candidate.index0Id() << ", " << candidate.index1Id() << std::endl; - // auto jpsi = candidate.index0(); + auto pxchic = candidate.px(); + auto pychic = candidate.py(); + auto pzchic = candidate.pz(); + auto pchic = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); + auto pxjpsi = candidate.pxProng0(); + auto pyjpsi = candidate.pyProng0(); + auto pzjpsi = candidate.pzProng0(); + auto pjpsi = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); + auto pxgamma = candidate.pxProng1(); + auto pygamma = candidate.pyProng1(); + auto pzgamma = candidate.pzProng1(); + auto pgamma = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); + auto pl1 = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchic; + auto pl2 = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchic; + auto alpha = (pl1-pl2)/(pl1+pl2); + auto qt = sqrt ( pjpsi*pjpsi - pl1*pl1); + + auto jpsi = candidate.index0(); + // auto trackPos = jpsi.index0_as(); // positive daughter // auto trackNeg = jpsi.index1_as(); // negative daughter - // std::cout << "trackPos: px, py, pz = " << trackPos.px() << ", " << trackPos.py() << ", " << trackPos.pz() << std::endl; // std::cout << "trackNeg: px, py, pz = " << trackNeg.px() << ", " << trackNeg.py() << ", " << trackNeg.pz() << std::endl; // std::cout << "bcId, numContrib = " << candidate.index0().index0_as().collision().bcId() << ", " @@ -170,20 +200,20 @@ struct HfTreeCreatorChicToJpsiGamma { rowCandidateFull( candidate.index0().index0_as().collision().bcId(), candidate.index0().index0_as().collision().numContrib(), -// 0, // candidate.index0().index0_as().collision().bcId(), -// 0, // candidate.index0().index0_as().collision().numContrib(), candidate.posX(), candidate.posY(), candidate.posZ(), - candidate.chi2PCA(), + candidate.impactParameterNormalised0(), candidate.rSecondaryVertex(), candidate.decayLength(), candidate.decayLengthXY(), - candidate.impactParameterNormalised0(), candidate.ptProng0(), RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), candidate.ptProng1(), RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + alpha, + qt, + candidate.chi2PCA(), candidate.impactParameter0(), 1 << CandFlag, FunctionInvMass, @@ -200,8 +230,8 @@ struct HfTreeCreatorChicToJpsiGamma { ); } }; - fillTable(0, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); - fillTable(1, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); + fillTable(0, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); +// fillTable(1, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); } // Filling particle properties From ee37b86ef1f44f749f78794ff61a0d2ccdb89953 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Thu, 18 Nov 2021 11:58:15 +0100 Subject: [PATCH 5/8] Add chi tree creator with clang fixes --- .../HFTreeCreatorChicToJpsiGamma.cxx | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index e0d302779c7..d295be50baa 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -137,15 +137,14 @@ struct HfTreeCreatorChicToJpsiGamma { aod::McCollisions const& mccollisions, soa::Join const& candidates, soa::Join const& particles, - aod::BigTracksPID const& tracks, - aod::HfCandProng2 const& jpsiCands - ) + aod::BigTracksPID const& tracks, + aod::HfCandProng2 const& jpsiCands) { // Filling event properties rowCandidateFullEvents.reserve(collisions.size()); for (auto& collision : collisions) { - rowCandidateFullEvents( + rowCandidateFullEvents( collision.bcId(), collision.numContrib(), collision.posX(), @@ -159,34 +158,34 @@ struct HfTreeCreatorChicToJpsiGamma { int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - // std::cout << "candidate: px, py, pz = " << candidate.px() << ", " << candidate.py() << ", " << candidate.pz() << std::endl; - // std::cout << "Prong 0: px, py, pz = " << candidate.pxProng0() << ", " << candidate.pyProng0() << ", " << candidate.pzProng0() << std::endl; - // std::cout << "Prong 1: px, py, pz = " << candidate.pxProng1() << ", " << candidate.pyProng1() << ", " << candidate.pzProng1() << std::endl; - // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; + // std::cout << "candidate: px, py, pz = " << candidate.px() << ", " << candidate.py() << ", " << candidate.pz() << std::endl; + // std::cout << "Prong 0: px, py, pz = " << candidate.pxProng0() << ", " << candidate.pyProng0() << ", " << candidate.pzProng0() << std::endl; + // std::cout << "Prong 1: px, py, pz = " << candidate.pxProng1() << ", " << candidate.pyProng1() << ", " << candidate.pzProng1() << std::endl; + // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; // std::cout << "index 0, 1 = " << candidate.index0Id() << ", " << candidate.index1Id() << std::endl; auto pxchic = candidate.px(); auto pychic = candidate.py(); auto pzchic = candidate.pz(); - auto pchic = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); + auto pchic = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); auto pxjpsi = candidate.pxProng0(); auto pyjpsi = candidate.pyProng0(); auto pzjpsi = candidate.pzProng0(); - auto pjpsi = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); + auto pjpsi = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); auto pxgamma = candidate.pxProng1(); auto pygamma = candidate.pyProng1(); auto pzgamma = candidate.pzProng1(); - auto pgamma = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); - auto pl1 = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchic; - auto pl2 = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchic; - auto alpha = (pl1-pl2)/(pl1+pl2); - auto qt = sqrt ( pjpsi*pjpsi - pl1*pl1); + auto pgamma = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); + auto pl1 = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchic; + auto pl2 = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchic; + auto alpha = (pl1 - pl2) / (pl1 + pl2); + auto qt = sqrt(pjpsi * pjpsi - pl1 * pl1); auto jpsi = candidate.index0(); // auto trackPos = jpsi.index0_as(); // positive daughter // auto trackNeg = jpsi.index1_as(); // negative daughter - // std::cout << "trackPos: px, py, pz = " << trackPos.px() << ", " << trackPos.py() << ", " << trackPos.pz() << std::endl; - // std::cout << "trackNeg: px, py, pz = " << trackNeg.px() << ", " << trackNeg.py() << ", " << trackNeg.pz() << std::endl; + // std::cout << "trackPos: px, py, pz = " << trackPos.px() << ", " << trackPos.py() << ", " << trackPos.pz() << std::endl; + // std::cout << "trackNeg: px, py, pz = " << trackNeg.px() << ", " << trackNeg.py() << ", " << trackNeg.pz() << std::endl; // std::cout << "bcId, numContrib = " << candidate.index0().index0_as().collision().bcId() << ", " // << candidate.index0().index0_as().collision().numContrib() << std::endl; indexCand++; @@ -194,8 +193,7 @@ struct HfTreeCreatorChicToJpsiGamma { int FunctionSelection, float FunctionInvMass, float FunctionCt, - float FunctionY - ) { + float FunctionY) { if (FunctionSelection >= 1) { rowCandidateFull( candidate.index0().index0_as().collision().bcId(), @@ -210,7 +208,7 @@ struct HfTreeCreatorChicToJpsiGamma { candidate.ptProng0(), RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), candidate.ptProng1(), - RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), alpha, qt, candidate.chi2PCA(), @@ -218,7 +216,7 @@ struct HfTreeCreatorChicToJpsiGamma { 1 << CandFlag, FunctionInvMass, candidate.pt(), - candidate.p(), + candidate.p(), candidate.cpa(), candidate.cpaXY(), FunctionCt, @@ -226,12 +224,11 @@ struct HfTreeCreatorChicToJpsiGamma { candidate.phi(), FunctionY, candidate.jpsiToMuMuMass(), - candidate.flagMCMatchRec() - ); + candidate.flagMCMatchRec()); } }; - fillTable(0, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); -// fillTable(1, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); + fillTable(0, candidate.isSelChicToJpsiToMuMuGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); + // fillTable(1, candidate.isSelChicToJpsiToEEGamma(), InvMassChicToJpsiGamma(candidate), CtChic(candidate), YChic(candidate)); } // Filling particle properties From 7cffa9c726e93b66f7f0d8f04099429daa459ca2 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Fri, 17 Dec 2021 10:50:55 +0100 Subject: [PATCH 6/8] updated chi_c tree creator --- PWGHF/TableProducer/CMakeLists.txt | 22 ++++----- .../HFTreeCreatorChicToJpsiGamma.cxx | 47 +++++++------------ 2 files changed, 29 insertions(+), 40 deletions(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index f0f16df73f7..39cd9004ca2 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(track-index-skims-creator SOURCES HFTrackIndexSkimsCreator.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(candidate-creator-2prong @@ -44,6 +44,11 @@ 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-chic + SOURCES HFCandidateCreatorChic.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(candidate-creator-lb SOURCES HFCandidateCreatorLb.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG @@ -54,11 +59,6 @@ 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(tree-creator-lc-topkpi SOURCES HFTreeCreatorLcToPKPi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG @@ -69,16 +69,16 @@ o2physics_add_dpl_workflow(tree-creator-x-tojpsipipi PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(tree-creator-chic-tojpsigamma - SOURCES HFTreeCreatorChicToJpsiGamma.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(tree-creator-xicc-topkpipi SOURCES HFTreeCreatorXiccToPKPiPi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tree-creator-chic-tojpsigamma + SOURCES HFTreeCreatorChicToJpsiGamma.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(d0-candidate-selector SOURCES HFD0CandidateSelector.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index d295be50baa..1d44c650e17 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -43,10 +43,6 @@ DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); DECLARE_SOA_COLUMN(PProng0, pProng0, float); DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); DECLARE_SOA_COLUMN(PProng1, pProng1, float); -// DECLARE_SOA_COLUMN(PtJPsi, ptJpsi, float); -// DECLARE_SOA_COLUMN(PJPsi, pJpsi, float); -// DECLARE_SOA_COLUMN(PtGamma, ptGamma, float); -// DECLARE_SOA_COLUMN(PGamma, pGamma, float); DECLARE_SOA_COLUMN(Alpha, alpha, float); DECLARE_SOA_COLUMN(Qt, qt, float); DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); @@ -60,8 +56,6 @@ DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(E, e, float); -//DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); -//DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); DECLARE_SOA_COLUMN(MCflag, mcflag, int8_t); // Events DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); @@ -82,10 +76,6 @@ DECLARE_SOA_TABLE(HfCandChicFull, "AOD", "HFCANDChicFull", full::PProng0, full::PtProng1, full::PProng1, - // full::PtJPsi, - // full::PJPsi, - // full::PtGamma, - // full::PGamma, full::Alpha, full::Qt, hf_cand::Chi2PCA, @@ -158,36 +148,35 @@ struct HfTreeCreatorChicToJpsiGamma { int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - // std::cout << "candidate: px, py, pz = " << candidate.px() << ", " << candidate.py() << ", " << candidate.pz() << std::endl; - // std::cout << "Prong 0: px, py, pz = " << candidate.pxProng0() << ", " << candidate.pyProng0() << ", " << candidate.pzProng0() << std::endl; - // std::cout << "Prong 1: px, py, pz = " << candidate.pxProng1() << ", " << candidate.pyProng1() << ", " << candidate.pzProng1() << std::endl; - // std::cout << "J/psi invariant mass: " << candidate.jpsiToMuMuMass() << std::endl; - // std::cout << "index 0, 1 = " << candidate.index0Id() << ", " << candidate.index1Id() << std::endl; auto pxchic = candidate.px(); auto pychic = candidate.py(); auto pzchic = candidate.pz(); - auto pchic = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); + auto pchicold = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); auto pxjpsi = candidate.pxProng0(); auto pyjpsi = candidate.pyProng0(); auto pzjpsi = candidate.pzProng0(); - auto pjpsi = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); + auto pjpsiold = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); auto pxgamma = candidate.pxProng1(); auto pygamma = candidate.pyProng1(); auto pzgamma = candidate.pzProng1(); - auto pgamma = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); - auto pl1 = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchic; - auto pl2 = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchic; - auto alpha = (pl1 - pl2) / (pl1 + pl2); - auto qt = sqrt(pjpsi * pjpsi - pl1 * pl1); + auto pgammaold = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); + auto pl1old = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchicold; + auto pl2old = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchicold; + auto alphaold = (pl1old - pl2old) / (pl1old + pl2old); + auto qtold = sqrt(pjpsiold * pjpsiold - pl1old * pl1old); + + array pvecChic = {candidate.px(), candidate.py(), candidate.pz()}; + array pvecJpsi = {candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()}; + array pvecGamma = {candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()}; + auto pchic = RecoDecay::P(pvecChic); + auto pjpsi = RecoDecay::P(pvecJpsi); + auto pgamma = RecoDecay::P(pvecGamma); + auto pl1 = std::abs(RecoDecay::dotProd(pvecChic,pvecJpsi)) / pchic; + auto pl2 = std::abs(RecoDecay::dotProd(pvecChic,pvecGamma)) / pchic; + auto alpha = ( pl1 - pl2 ) / ( pl1 + pl2 ); + auto qt = std::sqrt(pjpsi * pjpsi - pl1 * pl1); auto jpsi = candidate.index0(); - - // auto trackPos = jpsi.index0_as(); // positive daughter - // auto trackNeg = jpsi.index1_as(); // negative daughter - // std::cout << "trackPos: px, py, pz = " << trackPos.px() << ", " << trackPos.py() << ", " << trackPos.pz() << std::endl; - // std::cout << "trackNeg: px, py, pz = " << trackNeg.px() << ", " << trackNeg.py() << ", " << trackNeg.pz() << std::endl; - // std::cout << "bcId, numContrib = " << candidate.index0().index0_as().collision().bcId() << ", " - // << candidate.index0().index0_as().collision().numContrib() << std::endl; indexCand++; auto fillTable = [&](int CandFlag, int FunctionSelection, From a6f63dc35318e15bc923774a4c5784d9b15f538c Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Fri, 17 Dec 2021 12:23:46 +0100 Subject: [PATCH 7/8] updated chi_c tree creator (with clang fixes) --- .../HFTreeCreatorChicToJpsiGamma.cxx | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index 1d44c650e17..5b962c194b7 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -148,33 +148,16 @@ struct HfTreeCreatorChicToJpsiGamma { int indexCand = 0; rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - auto pxchic = candidate.px(); - auto pychic = candidate.py(); - auto pzchic = candidate.pz(); - auto pchicold = RecoDecay::P(candidate.px(), candidate.py(), candidate.pz()); - auto pxjpsi = candidate.pxProng0(); - auto pyjpsi = candidate.pyProng0(); - auto pzjpsi = candidate.pzProng0(); - auto pjpsiold = RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); - auto pxgamma = candidate.pxProng1(); - auto pygamma = candidate.pyProng1(); - auto pzgamma = candidate.pzProng1(); - auto pgammaold = RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); - auto pl1old = abs(pxchic * pxjpsi + pychic * pyjpsi + pzchic * pzjpsi) / pchicold; - auto pl2old = abs(pxchic * pxgamma + pychic * pygamma + pzchic * pzgamma) / pchicold; - auto alphaold = (pl1old - pl2old) / (pl1old + pl2old); - auto qtold = sqrt(pjpsiold * pjpsiold - pl1old * pl1old); - array pvecChic = {candidate.px(), candidate.py(), candidate.pz()}; array pvecJpsi = {candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()}; array pvecGamma = {candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()}; auto pchic = RecoDecay::P(pvecChic); auto pjpsi = RecoDecay::P(pvecJpsi); auto pgamma = RecoDecay::P(pvecGamma); - auto pl1 = std::abs(RecoDecay::dotProd(pvecChic,pvecJpsi)) / pchic; - auto pl2 = std::abs(RecoDecay::dotProd(pvecChic,pvecGamma)) / pchic; - auto alpha = ( pl1 - pl2 ) / ( pl1 + pl2 ); - auto qt = std::sqrt(pjpsi * pjpsi - pl1 * pl1); + auto pl1 = std::abs(RecoDecay::dotProd(pvecChic, pvecJpsi)) / pchic; + auto pl2 = std::abs(RecoDecay::dotProd(pvecChic, pvecGamma)) / pchic; + auto alpha = (pl1 - pl2) / (pl1 + pl2); + auto qt = std::sqrt(pjpsi * pjpsi - pl1 * pl1); auto jpsi = candidate.index0(); indexCand++; From 7474c35d5b0b4f2d7ee12768df61c6ab606c1cb7 Mon Sep 17 00:00:00 2001 From: Alessandro De Falco Date: Wed, 26 Jan 2022 17:12:43 +0100 Subject: [PATCH 8/8] PWGHF: add variables to chi_c trees. --- PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx index 5b962c194b7..905afcbe0e7 100644 --- a/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorChicToJpsiGamma.cxx @@ -153,13 +153,11 @@ struct HfTreeCreatorChicToJpsiGamma { array pvecGamma = {candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()}; auto pchic = RecoDecay::P(pvecChic); auto pjpsi = RecoDecay::P(pvecJpsi); - auto pgamma = RecoDecay::P(pvecGamma); auto pl1 = std::abs(RecoDecay::dotProd(pvecChic, pvecJpsi)) / pchic; auto pl2 = std::abs(RecoDecay::dotProd(pvecChic, pvecGamma)) / pchic; auto alpha = (pl1 - pl2) / (pl1 + pl2); auto qt = std::sqrt(pjpsi * pjpsi - pl1 * pl1); - auto jpsi = candidate.index0(); indexCand++; auto fillTable = [&](int CandFlag, int FunctionSelection,