From ea234779f9e135b0da7156e0cc508ee678731b6d Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 22 Sep 2021 14:07:54 +0200 Subject: [PATCH 01/25] update gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 7e45d7b766b..69060ce9577 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ CMakeCache.txt CMakeFiles/ +/.vs/VSWorkspaceState.json +/.vs/slnx.sqlite +/.vs/ProjectSettings.json +/.vs/O2Physics/v16/Browse.VC.opendb +/.vs/O2Physics/v16/Browse.VC.db-wal +/.vs/O2Physics/v16/Browse.VC.db-shm +/.vs/O2Physics/v16/Browse.VC.db +/.vs/O2Physics/v16/.suo +/.vs/CMake Overview From 5d74c7a08efc6b1fbd57057c07d5e420307fd849 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 13 Oct 2021 10:29:16 +0200 Subject: [PATCH 02/25] local gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 69060ce9577..5a57d2ff9f3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,11 @@ CMakeFiles/ /.vs/O2Physics/v16/Browse.VC.db /.vs/O2Physics/v16/.suo /.vs/CMake Overview +/out/build/x64-Debug/VSInheritEnvironments.txt +/out/build/x64-Debug/.cmake/api/v1/query/client-MicrosoftVS/query.json +/out/build/x64-Debug/.cmake/api/v1/query/client-MicrosoftVS +/out/build/x64-Debug +/.vs/O2Physics/v17/Preview/Browse.VC.opendb +/.vs/O2Physics/v17/Preview/Browse.VC.db-wal +/.vs/O2Physics/v17/Preview/Browse.VC.db-shm +/.vs/O2Physics/v17/Preview/Browse.VC.db From f381c2ce9878d01d087c5ca07abfde7af0e9d3b2 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Fri, 29 Oct 2021 11:45:56 +0200 Subject: [PATCH 03/25] update local gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5a57d2ff9f3..03be36bc842 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ CMakeFiles/ /.vs/O2Physics/v17/Preview/Browse.VC.db-wal /.vs/O2Physics/v17/Preview/Browse.VC.db-shm /.vs/O2Physics/v17/Preview/Browse.VC.db +/.vs/cmake.db From fbc759f8b446db0f65e00682cd026e61ed7677d3 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Sun, 31 Oct 2021 19:37:21 +0100 Subject: [PATCH 04/25] Update branch --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 03be36bc842..d4b0ed19042 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ CMakeFiles/ /.vs/O2Physics/v17/Preview/Browse.VC.db-shm /.vs/O2Physics/v17/Preview/Browse.VC.db /.vs/cmake.db +/.vs/O2Physics/v17 +/.vs/O2Physics/project-colors.json From 68b8bd653db6f83e0ff461a27f82b97d2cb96efd Mon Sep 17 00:00:00 2001 From: mjongerh Date: Thu, 4 Nov 2021 15:22:43 +0100 Subject: [PATCH 05/25] Initial commit Lb tree creator --- PWGHF/TableProducer/CMakeLists.txt | 5 + PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 245 ++++++++++++++++++ 2 files changed, 250 insertions(+) create mode 100644 PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 410541a0977..abfc3ab2ea1 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -74,6 +74,11 @@ o2physics_add_dpl_workflow(tree-creator-xicc-topkpipi PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tree - creator - lb - tolcpi + SOURCES HFTreeCreatorLbToLcPi.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/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx new file mode 100644 index 00000000000..aae9dbdcb5d --- /dev/null +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -0,0 +1,245 @@ +// 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 HFTreeCreatorLbToLcPi.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 Maurice Jongerhuis , University Utrecht + +#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::framework; +using namespace o2::aod::hf_cand; +using namespace o2::aod::hf_cand_lb; +//using namespace o2::aod::hf_cand_prong2; +//using namespace o2::aod::hf_cand_prong3; + +namespace o2::aod +{ +namespace full +{ +DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); +DECLARE_SOA_COLUMN(PProng0, pProng0, float); +DECLARE_SOA_COLUMN(ImpactParameterNormalised0, impactParameterNormalised0, float); +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); +DECLARE_SOA_COLUMN(PProng1, pProng1, float); +DECLARE_SOA_COLUMN(ImpactParameterNormalised1, impactParameterNormalised1, 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(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); +//DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); +// Events +DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); +DECLARE_SOA_COLUMN(RunNumber, runNumber, int); +} // namespace full + +DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLBFull", + collision::BCId, + collision::NumContrib, + collision::PosX, + collision::PosY, + collision::PosZ, + hf_cand::XSecondaryVertex, + hf_cand::YSecondaryVertex, + hf_cand::ZSecondaryVertex, + hf_cand::ErrorDecayLength, + hf_cand::ErrorDecayLengthXY, + hf_cand::Chi2PCA, + full::RSecondaryVertex, + full::DecayLength, + full::DecayLengthXY, + full::DecayLengthNormalised, + full::DecayLengthXYNormalised, + full::ImpactParameterNormalised0, + full::PtProng0, + full::PProng0, + full::ImpactParameterNormalised1, + full::PtProng1, + full::PProng1, + 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, + full::CandidateSelFlag, + full::M, + full::Pt, + full::P, + full::CPA, + full::CPAXY, + full::Ct, + full::Eta, + full::Phi, + full::Y, + full::E, + full::MCflag); //, + //full::IsCandidateSwapped); + +DECLARE_SOA_TABLE(HfCandLbFullEvents, "AOD", "HFCANDLBFullE", + collision::BCId, + collision::NumContrib, + collision::PosX, + collision::PosY, + collision::PosZ, + full::IsEventReject, + full::RunNumber); + +DECLARE_SOA_TABLE(HfCandLbFullParticles, "AOD", "HFCANDLBFullP", + collision::BCId, + full::Pt, + full::Eta, + full::Phi, + full::Y, + full::MCflag); + +} // namespace o2::aod + +struct CandidateTreeWriter { + Produces rowCandidateFull; + Produces rowCandidateFullEvents; + Produces rowCandidateFullParticles; + + void init(InitContext const&) + { + } + + void process(aod::Collisions const& collisions, + aod::McCollisions const& mccollisions, + soa::Join const& candidates, // join tables relevant for the candidate aod::hf_selcandidate_lb + soa::Join const& particles, // join generated particle information + 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 + rowCandidateFull.reserve(candidates.size()); + for (auto& candidate : candidates) { + auto fillTable = [&](int CandFlag, + int FunctionSelection, + float FunctionInvMass, + float FunctionCt, + float FunctionY, + float FunctionE) { + if (FunctionSelection >= 1) { + rowCandidateFull( + candidate.index0_as().collision().bcId(), + candidate.index0_as().collision().numContrib(), + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.chi2PCA(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.impactParameterNormalised1(), + candidate.ptProng1(), + RecoDecay::P(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.pxProng0(), + candidate.pyProng0(), + candidate.pzProng0(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.errorImpactParameter0(), + candidate.errorImpactParameter1(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + FunctionE, + candidate.flagMCMatchRec()); //, + //candidate.isCandidateSwapped()); + } + }; + // TMP aod::hf_selcandidate_lb:: o2::aod::hf_cand_lb + fillTable(0, candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate), ELb(candidate)); + } + + // Filling particle properties + rowCandidateFullParticles.reserve(particles.size()); + for (auto& particle : particles) { + if (std::abs(particle.flagMCMatchGen()) == 1 << o2::aod::hf_cand_lb::DecayType::LbToLcPi) { + rowCandidateFullParticles( + particle.mcCollision().bcId(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())), + particle.flagMCMatchGen()); + } + } + } // process +}; //Struct CandidateTreeWriter + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow; + workflow.push_back(adaptAnalysisTask(cfgc, TaskName{"hf-tree-creator-lb-tolcpi"})); + return workflow; +} \ No newline at end of file From bf4c609f89c76a04f70f8939141e8191320d0401 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Thu, 4 Nov 2021 15:27:32 +0100 Subject: [PATCH 06/25] Fix typo --- PWGHF/TableProducer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index abfc3ab2ea1..259b127b658 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -74,7 +74,7 @@ o2physics_add_dpl_workflow(tree-creator-xicc-topkpipi PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(tree - creator - lb - tolcpi +o2physics_add_dpl_workflow(tree-creator-lb-tolcpi SOURCES HFTreeCreatorLbToLcPi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) From 1d6de0653e31b5ba6468f3e70e77eaf5ce0e8e8c Mon Sep 17 00:00:00 2001 From: mjongerh Date: Tue, 9 Nov 2021 18:23:44 +0100 Subject: [PATCH 07/25] Test Panos version --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 70 ++++++------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index aae9dbdcb5d..bdb13ed40eb 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -10,11 +10,12 @@ // or submit itself to any jurisdiction. /// \file HFTreeCreatorLbToLcPi.cxx -/// \brief Writer of the 3 prong candidates in the form of flat tables to be stored in TTrees. +/// \brief Writer of the 2 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 +/// \note Extended from HFTreeCreatorD0ToKPi, HFTreeCreatorLcToPKPi, HFTreeCreatorXToJpsiPiPi /// -/// \author Maurice Jongerhuis , University Utrecht +/// \author Panos Christakoglou , Nikhef #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -28,8 +29,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::aod::hf_cand; using namespace o2::aod::hf_cand_lb; -//using namespace o2::aod::hf_cand_prong2; -//using namespace o2::aod::hf_cand_prong3; namespace o2::aod { @@ -49,7 +48,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(E, e, float); DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); @@ -58,24 +56,13 @@ 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); -//DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); // Events DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); DECLARE_SOA_COLUMN(RunNumber, runNumber, int); } // namespace full -DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLBFull", - collision::BCId, - collision::NumContrib, - collision::PosX, - collision::PosY, - collision::PosZ, - hf_cand::XSecondaryVertex, - hf_cand::YSecondaryVertex, - hf_cand::ZSecondaryVertex, - hf_cand::ErrorDecayLength, - hf_cand::ErrorDecayLengthXY, - hf_cand::Chi2PCA, +// put the arguments into the table +DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLbFull", full::RSecondaryVertex, full::DecayLength, full::DecayLengthXY, @@ -107,11 +94,9 @@ DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLBFull", full::Eta, full::Phi, full::Y, - full::E, - full::MCflag); //, - //full::IsCandidateSwapped); + full::MCflag); -DECLARE_SOA_TABLE(HfCandLbFullEvents, "AOD", "HFCANDLBFullE", +DECLARE_SOA_TABLE(HfCandLbFullEvents, "AOD", "HFCANDLbFullE", collision::BCId, collision::NumContrib, collision::PosX, @@ -120,7 +105,7 @@ DECLARE_SOA_TABLE(HfCandLbFullEvents, "AOD", "HFCANDLBFullE", full::IsEventReject, full::RunNumber); -DECLARE_SOA_TABLE(HfCandLbFullParticles, "AOD", "HFCANDLBFullP", +DECLARE_SOA_TABLE(HfCandLbFullParticles, "AOD", "HFCANDLbFullP", collision::BCId, full::Pt, full::Eta, @@ -130,7 +115,8 @@ DECLARE_SOA_TABLE(HfCandLbFullParticles, "AOD", "HFCANDLBFullP", } // namespace o2::aod -struct CandidateTreeWriter { +/// Writes the full information in an output TTree +struct HfTreeCreatorLbToLcPi { Produces rowCandidateFull; Produces rowCandidateFullEvents; Produces rowCandidateFullParticles; @@ -141,8 +127,8 @@ struct CandidateTreeWriter { void process(aod::Collisions const& collisions, aod::McCollisions const& mccollisions, - soa::Join const& candidates, // join tables relevant for the candidate aod::hf_selcandidate_lb - soa::Join const& particles, // join generated particle information + soa::Join const& candidates, + soa::Join const& particles, aod::BigTracksPID const& tracks) { @@ -166,21 +152,9 @@ struct CandidateTreeWriter { int FunctionSelection, float FunctionInvMass, float FunctionCt, - float FunctionY, - float FunctionE) { + float FunctionY) { if (FunctionSelection >= 1) { rowCandidateFull( - candidate.index0_as().collision().bcId(), - candidate.index0_as().collision().numContrib(), - candidate.posX(), - candidate.posY(), - candidate.posZ(), - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), - candidate.errorDecayLength(), - candidate.errorDecayLengthXY(), - candidate.chi2PCA(), candidate.rSecondaryVertex(), candidate.decayLength(), candidate.decayLengthXY(), @@ -212,19 +186,17 @@ struct CandidateTreeWriter { candidate.eta(), candidate.phi(), FunctionY, - FunctionE, - candidate.flagMCMatchRec()); //, - //candidate.isCandidateSwapped()); + candidate.flagMCMatchRec()); } }; - // TMP aod::hf_selcandidate_lb:: o2::aod::hf_cand_lb - fillTable(0, candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate), ELb(candidate)); + + fillTable(0, candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate)); } // Filling particle properties rowCandidateFullParticles.reserve(particles.size()); for (auto& particle : particles) { - if (std::abs(particle.flagMCMatchGen()) == 1 << o2::aod::hf_cand_lb::DecayType::LbToLcPi) { + if (std::abs(particle.flagMCMatchGen()) == 1 << DecayType::LbToLcPi) { rowCandidateFullParticles( particle.mcCollision().bcId(), particle.pt(), @@ -234,12 +206,12 @@ struct CandidateTreeWriter { particle.flagMCMatchGen()); } } - } // process -}; //Struct CandidateTreeWriter + } +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow; - workflow.push_back(adaptAnalysisTask(cfgc, TaskName{"hf-tree-creator-lb-tolcpi"})); + workflow.push_back(adaptAnalysisTask(cfgc)); return workflow; -} \ No newline at end of file +} From 20e2d5e95db01311d7863c363a1448d2a4bc32aa Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 10 Nov 2021 10:20:03 +0100 Subject: [PATCH 08/25] local gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d4b0ed19042..973f32795d1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ CMakeFiles/ /.vs/cmake.db /.vs/O2Physics/v17 /.vs/O2Physics/project-colors.json +/.vs/slnx.sqlite-journal From 104addd945ab48aee1220e0ac1bb8e4b7bc0425e Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 10 Nov 2021 10:21:48 +0100 Subject: [PATCH 09/25] test flag --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index bdb13ed40eb..bd2ee63d96b 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -148,6 +148,8 @@ struct HfTreeCreatorLbToLcPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { + //Maurice Test + printf("Is cand Lb to Lcpi = %d\n", candidate.isSelLbToLcPi()); auto fillTable = [&](int CandFlag, int FunctionSelection, float FunctionInvMass, From 07246503a6d9b22c4a5731e0bd7609246b13995d Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 10 Nov 2021 10:45:44 +0100 Subject: [PATCH 10/25] test --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index bd2ee63d96b..90f69742bd1 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -148,15 +148,15 @@ struct HfTreeCreatorLbToLcPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - //Maurice Test - printf("Is cand Lb to Lcpi = %d\n", candidate.isSelLbToLcPi()); auto fillTable = [&](int CandFlag, int FunctionSelection, float FunctionInvMass, float FunctionCt, float FunctionY) { if (FunctionSelection >= 1) { - rowCandidateFull( + //Maurice Test + printf("Is cand Lb to Lcpi = %d\n", candidate.isSelLbToLcPi()); + rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), candidate.decayLengthXY(), From 7fd226e83d6e32113858577b0f56644493682900 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 10 Nov 2021 15:31:37 +0100 Subject: [PATCH 11/25] revert test --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 90f69742bd1..7f4d525686c 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -154,8 +154,6 @@ struct HfTreeCreatorLbToLcPi { float FunctionCt, float FunctionY) { if (FunctionSelection >= 1) { - //Maurice Test - printf("Is cand Lb to Lcpi = %d\n", candidate.isSelLbToLcPi()); rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), From 32e3dbd881d43947f85d7da4825c6ff319b9c2c5 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Thu, 11 Nov 2021 11:34:09 +0100 Subject: [PATCH 12/25] Update tree creator --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 7f4d525686c..f4d9e6af83c 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -68,6 +68,7 @@ DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLbFull", full::DecayLengthXY, full::DecayLengthNormalised, full::DecayLengthXYNormalised, + hf_cand::Chi2PCA, full::ImpactParameterNormalised0, full::PtProng0, full::PProng0, @@ -160,6 +161,7 @@ struct HfTreeCreatorLbToLcPi { candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), + candidate.chi2PCA(), candidate.impactParameterNormalised0(), candidate.ptProng0(), RecoDecay::P(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), From ebc4c5196c5fa0e29f2fcf38ae88e9f476098582 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Thu, 11 Nov 2021 14:12:47 +0100 Subject: [PATCH 13/25] Temp change for ML purposes --- PWGHF/Core/HFSelectorCuts.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGHF/Core/HFSelectorCuts.h b/PWGHF/Core/HFSelectorCuts.h index 5f18d65cfcc..f121eaf90f3 100644 --- a/PWGHF/Core/HFSelectorCuts.h +++ b/PWGHF/Core/HFSelectorCuts.h @@ -562,18 +562,18 @@ auto pTBins_v = std::vector{pTBins, pTBins + npTBins + 1}; // default values for the cuts // DeltaM CPA chi2PCA d0Lc d0Pi pTLc pTPi LbDecayLength LbDecayLengthXY IPProd DeltaMLc CthetaStr -constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 1 < pt < 2 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 2 < pt < 3 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 3 < pt < 4 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 4 < pt < 5 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 5 < pt < 7 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 7 < pt < 10 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 10 < pt < 13 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 13 < pt < 16 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 16 < pt < 20 */ - {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}}; /* 20 < pt < 24 */ +constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 1 < pt < 2 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 2 < pt < 3 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 3 < pt < 4 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 4 < pt < 5 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 5 < pt < 7 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 7 < pt < 10 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 10 < pt < 13 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 13 < pt < 16 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 16 < pt < 20 */ + {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}}; /* 20 < pt < 24 */ // row labels static const std::vector pTBinLabels = { "pT bin 0", From 3db2dd80b1079c3b2abb7c53332322cc4df121f1 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Sun, 14 Nov 2021 13:35:53 +0100 Subject: [PATCH 14/25] Revert "Temp change for ML purposes" This reverts commit ebc4c5196c5fa0e29f2fcf38ae88e9f476098582. --- PWGHF/Core/HFSelectorCuts.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGHF/Core/HFSelectorCuts.h b/PWGHF/Core/HFSelectorCuts.h index f121eaf90f3..5f18d65cfcc 100644 --- a/PWGHF/Core/HFSelectorCuts.h +++ b/PWGHF/Core/HFSelectorCuts.h @@ -562,18 +562,18 @@ auto pTBins_v = std::vector{pTBins, pTBins + npTBins + 1}; // default values for the cuts // DeltaM CPA chi2PCA d0Lc d0Pi pTLc pTPi LbDecayLength LbDecayLengthXY IPProd DeltaMLc CthetaStr -constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 1 < pt < 2 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 2 < pt < 3 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 3 < pt < 4 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 4 < pt < 5 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 5 < pt < 7 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 7 < pt < 10 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 10 < pt < 13 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 13 < pt < 16 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}, /* 16 < pt < 20 */ - {1., 0.8, 1., 0.005, 0.005, 1.0, 0.15, 0.1, 0.1, 0., 0.1, 0.8}}; /* 20 < pt < 24 */ +constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 1 < pt < 2 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 2 < pt < 3 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 3 < pt < 4 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 4 < pt < 5 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 5 < pt < 7 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 7 < pt < 10 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 10 < pt < 13 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 13 < pt < 16 */ + {1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 16 < pt < 20 */ + {1., 0.8, 1., 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", From 1211261e061e5d9e10c3f80ac9fe76a1473c3ac9 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Sun, 14 Nov 2021 13:36:52 +0100 Subject: [PATCH 15/25] TMP for ML --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index f4d9e6af83c..e8744f25779 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -154,7 +154,7 @@ struct HfTreeCreatorLbToLcPi { float FunctionInvMass, float FunctionCt, float FunctionY) { - if (FunctionSelection >= 1) { + if (true) { // FunctionSelection >= 1 rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), From 3a9741a06aedbb07793553eeb5550b1b13885094 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Tue, 16 Nov 2021 13:02:00 +0100 Subject: [PATCH 16/25] s --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index e8744f25779..69f184e33d1 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -154,7 +154,7 @@ struct HfTreeCreatorLbToLcPi { float FunctionInvMass, float FunctionCt, float FunctionY) { - if (true) { // FunctionSelection >= 1 + if (FunctionSelection >= 1) { // Set to true to keep unselected events as well rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), From 354b5854ca5c7c6763fcdab218a86a03f5168c0d Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 17 Nov 2021 10:43:42 +0100 Subject: [PATCH 17/25] Update .gitignore --- .gitignore | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index d4bbb038081..587afe554b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,5 @@ CMakeCache.txt CMakeFiles/ -/.vs/VSWorkspaceState.json -/.vs/slnx.sqlite -/.vs/ProjectSettings.json -/.vs/O2Physics/v16/Browse.VC.opendb -/.vs/O2Physics/v16/Browse.VC.db-wal -/.vs/O2Physics/v16/Browse.VC.db-shm -/.vs/O2Physics/v16/Browse.VC.db -/.vs/O2Physics/v16/.suo -/.vs/CMake Overview -/out/build/x64-Debug/VSInheritEnvironments.txt -/out/build/x64-Debug/.cmake/api/v1/query/client-MicrosoftVS/query.json -/out/build/x64-Debug/.cmake/api/v1/query/client-MicrosoftVS -/out/build/x64-Debug -/.vs/O2Physics/v17/Preview/Browse.VC.opendb -/.vs/O2Physics/v17/Preview/Browse.VC.db-wal -/.vs/O2Physics/v17/Preview/Browse.VC.db-shm -/.vs/O2Physics/v17/Preview/Browse.VC.db -/.vs/cmake.db -/.vs/O2Physics/v17 -/.vs/O2Physics/project-colors.json -/.vs/slnx.sqlite-journal .vscode build -compile_commands.json \ No newline at end of file +compile_commands.json From 12dd86611072ed778d71e24595b2ba29b305bcde Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 17 Nov 2021 11:29:39 +0100 Subject: [PATCH 18/25] fix format --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 69f184e33d1..8a9eace9b7c 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -155,7 +155,7 @@ struct HfTreeCreatorLbToLcPi { float FunctionCt, float FunctionY) { if (FunctionSelection >= 1) { // Set to true to keep unselected events as well - rowCandidateFull( + rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), candidate.decayLengthXY(), From 6accbaafbe7d27562df5ff0aa2db47b4228fb64d Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 17 Nov 2021 20:23:00 +0100 Subject: [PATCH 19/25] Update .gitignore Attempt to fix From 45431ed779f636de582ca284a1c7f2d031246f64 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Wed, 17 Nov 2021 20:30:10 +0100 Subject: [PATCH 20/25] Update .gitignore fix --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 587afe554b4..6d0e4c0feff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ CMakeCache.txt CMakeFiles/ .vscode build -compile_commands.json +compile_commands.json \ No newline at end of file From 7cdfe972877006f65a40f17ef24cdb3ae3996d20 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Thu, 18 Nov 2021 11:56:41 +0100 Subject: [PATCH 21/25] Update HFTreeCreatorLbToLcPi.cxx --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 8a9eace9b7c..07fab23fe92 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -16,6 +16,7 @@ /// \note Extended from HFTreeCreatorD0ToKPi, HFTreeCreatorLcToPKPi, HFTreeCreatorXToJpsiPiPi /// /// \author Panos Christakoglou , Nikhef +/// \author Maurice Jongerhuis , University Utrecht #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" From 6450e11b9d3e7816890088ce8f5f9e2c7a6f851f Mon Sep 17 00:00:00 2001 From: mjongerh Date: Mon, 17 Jan 2022 08:17:30 +0100 Subject: [PATCH 22/25] Update HFTreeCreatorLbToLcPi.cxx --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 07fab23fe92..175a2718312 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -150,8 +150,7 @@ struct HfTreeCreatorLbToLcPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { - auto fillTable = [&](int CandFlag, - int FunctionSelection, + auto fillTable = [&](int FunctionSelection, float FunctionInvMass, float FunctionCt, float FunctionY) { @@ -193,7 +192,7 @@ struct HfTreeCreatorLbToLcPi { } }; - fillTable(0, candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate)); + fillTable(candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate)); } // Filling particle properties From 2481aaeb4e0eb5609c4152441293be54b0e12ec9 Mon Sep 17 00:00:00 2001 From: mjongerh Date: Mon, 17 Jan 2022 15:17:50 +0100 Subject: [PATCH 23/25] Update HFTreeCreatorLbToLcPi.cxx Remove CandFlag --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index 175a2718312..f9a0528ac55 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -178,7 +178,7 @@ struct HfTreeCreatorLbToLcPi { candidate.impactParameter1(), candidate.errorImpactParameter0(), candidate.errorImpactParameter1(), - 1 << CandFlag, + FunctionSelection, FunctionInvMass, candidate.pt(), candidate.p(), From c46726848b50b9602232b6d6a6452604e7ddc34a Mon Sep 17 00:00:00 2001 From: Maurice Jongerhuis Date: Wed, 6 Apr 2022 10:21:04 +0200 Subject: [PATCH 24/25] fix CMakeLists --- PWGHF/TableProducer/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 5098146927c..561f1bb1dba 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -84,6 +84,11 @@ o2physics_add_dpl_workflow(tree-creator-chic-tojpsigamma PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tree-creator-lb-tolcpi + SOURCES HFTreeCreatorLbToLcPi.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 From f09eae90dc66ac8628315aab4c87fa34ade38965 Mon Sep 17 00:00:00 2001 From: Maurice Jongerhuis Date: Wed, 6 Apr 2022 10:25:37 +0200 Subject: [PATCH 25/25] Fix tree creator and add PID & granddaughter info --- PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx | 185 +++++++++++++----- 1 file changed, 134 insertions(+), 51 deletions(-) diff --git a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx index f9a0528ac55..43434833cd4 100644 --- a/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/HFTreeCreatorLbToLcPi.cxx @@ -25,6 +25,9 @@ #include "PWGHF/DataModel/HFCandidateSelectionTables.h" #include "Common/Core/trackUtilities.h" #include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/TrackSelectorPID.h" +#include "ALICE3/DataModel/RICH.h" +#include "ALICE3/DataModel/MID.h" using namespace o2; using namespace o2::framework; @@ -57,6 +60,31 @@ 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); +DECLARE_SOA_COLUMN(NSigRICHPi0, nsigRICHPi0, float); +DECLARE_SOA_COLUMN(NSigTOFPi0, nsigTOFPi0, float); +//Lc selection parameters +DECLARE_SOA_COLUMN(LcM, lcM, float); +DECLARE_SOA_COLUMN(LcCt, lcCt, float); +DECLARE_SOA_COLUMN(LcY, lcY, float); +DECLARE_SOA_COLUMN(LcE, lcE, float); +DECLARE_SOA_COLUMN(LcEta, lcEta, float); +DECLARE_SOA_COLUMN(LcCPA, lcCPA, float); +DECLARE_SOA_COLUMN(LcCPAXY, lcCPAXY, float); +DECLARE_SOA_COLUMN(LcChi2PCA, lcChi2PCA, float); +DECLARE_SOA_COLUMN(LcDecayLength, lcDecayLength, float); +DECLARE_SOA_COLUMN(LcDecayLengthXY, lcDecayLengthXY, float); +DECLARE_SOA_COLUMN(LcDecayLengthNormalised, lcDecayLengthNormalised, float); +DECLARE_SOA_COLUMN(NSigRICHTrk1Pi, nSigRICHTrk1Pi, float); +DECLARE_SOA_COLUMN(NSigRICHTrk1Pr, nSigRICHTrk1Pr, float); +DECLARE_SOA_COLUMN(NSigRICHTrk2Ka, nSigRICHTrk2Ka, float); +DECLARE_SOA_COLUMN(NSigRICHTrk3Pi, nSigRICHTrk3Pi, float); +DECLARE_SOA_COLUMN(NSigRICHTrk3Pr, nSigRICHTrk3Pr, float); +DECLARE_SOA_COLUMN(NSigTOFTrk1Pi, nSigTOFrk1Pi, float); +DECLARE_SOA_COLUMN(NSigTOFTrk1Pr, nSigTOFrk1Pr, float); +DECLARE_SOA_COLUMN(NSigTOFTrk2Ka, nSigTOFrk2Ka, float); +DECLARE_SOA_COLUMN(NSigTOFTrk3Pi, nSigTOFrk3Pi, float); +DECLARE_SOA_COLUMN(NSigTOFTrk3Pr, nSigTOFrk3Pr, float); + // Events DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); DECLARE_SOA_COLUMN(RunNumber, runNumber, int); @@ -86,6 +114,29 @@ DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLbFull", hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, + full::NSigTOFPi0, + full::NSigRICHPi0, + full::NSigRICHTrk1Pi, + full::NSigRICHTrk1Pr, + full::NSigRICHTrk2Ka, + full::NSigRICHTrk3Pi, + full::NSigRICHTrk3Pr, + full::NSigTOFTrk1Pi, + full::NSigTOFTrk1Pr, + full::NSigTOFTrk2Ka, + full::NSigTOFTrk3Pi, + full::NSigTOFTrk3Pr, + full::LcM, + full::LcCt, + full::LcY, + full::LcE, + full::LcEta, + full::LcCPA, + full::LcCPAXY, + full::LcChi2PCA, + full::LcDecayLength, + full::LcDecayLengthXY, + full::LcDecayLengthNormalised, full::CandidateSelFlag, full::M, full::Pt, @@ -97,56 +148,52 @@ DECLARE_SOA_TABLE(HfCandLbFull, "AOD", "HFCANDLbFull", full::Phi, full::Y, full::MCflag); +} // namespace o2::aod -DECLARE_SOA_TABLE(HfCandLbFullEvents, "AOD", "HFCANDLbFullE", - collision::BCId, - collision::NumContrib, - collision::PosX, - collision::PosY, - collision::PosZ, - full::IsEventReject, - full::RunNumber); - -DECLARE_SOA_TABLE(HfCandLbFullParticles, "AOD", "HFCANDLbFullP", - collision::BCId, - full::Pt, - full::Eta, - full::Phi, - full::Y, - full::MCflag); +namespace o2::aod //copied from Jpsi cand sel +{ +namespace hf_track_index_alice3_pid +{ +DECLARE_SOA_INDEX_COLUMN(Track, track); //! +DECLARE_SOA_INDEX_COLUMN(RICH, rich); //! +DECLARE_SOA_INDEX_COLUMN(MID, mid); //! +} // namespace hf_track_index_alice3_pid +DECLARE_SOA_INDEX_TABLE_USER(HfTrackIndexALICE3PID, Tracks, "HFTRKIDXA3PID", //! + hf_track_index_alice3_pid::TrackId, + hf_track_index_alice3_pid::RICHId, + hf_track_index_alice3_pid::MIDId); } // namespace o2::aod +struct Alice3PidIndexBuilder { + Builds index; + void init(o2::framework::InitContext&) {} +}; + +void customize(std::vector& workflowOptions) +{ + ConfigParamSpec isAlice3{"isAlice3", VariantType::Bool, true, {"Switch between ALICE 2 and ALICE 3 detector setup"}}; + workflowOptions.push_back(isAlice3); +} + /// Writes the full information in an output TTree struct HfTreeCreatorLbToLcPi { 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); - } + using TracksPID = soa::Join; + using ExtendedTracksPID = soa::Join; + void process( + soa::Join const& candidates, + soa::Join const& Lccandidates, + aod::BigTracksPID const& tracks, + aod::BigTracksMC const& bigtracksmc, + ExtendedTracksPID const&) + { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (auto& candidate : candidates) { @@ -155,6 +202,32 @@ struct HfTreeCreatorLbToLcPi { float FunctionCt, float FunctionY) { if (FunctionSelection >= 1) { // Set to true to keep unselected events as well + auto LcCand = candidate.index0_as>(); + auto track0 = candidate.index1_as(); //daughter pion track + auto track1 = LcCand.index0_as(); //granddaughter tracks (lc decay particles) + auto track2 = LcCand.index1_as(); + auto track3 = LcCand.index2_as(); + + auto RICHPi0 = -5000.0; + auto RICHTrk1Pi = -5000.0; + auto RICHTrk1p = -5000.0; + auto RICHTrk2K = -5000.0; + auto RICHTrk3Pi = -5000.0; + auto RICHTrk3p = -5000.0; + + if (track0.has_rich()) + RICHPi0 = track0.rich().richNsigmaPi(); + if (track1.has_rich()) + RICHTrk1Pi = track1.rich().richNsigmaPi(); + if (track1.has_rich()) + RICHTrk1p = track1.rich().richNsigmaPr(); + if (track2.has_rich()) + RICHTrk2K = track2.rich().richNsigmaKa(); + if (track3.has_rich()) + RICHTrk3Pi = track3.rich().richNsigmaPi(); + if (track3.has_rich()) + RICHTrk3p = track3.rich().richNsigmaPr(); + rowCandidateFull( candidate.rSecondaryVertex(), candidate.decayLength(), @@ -178,6 +251,29 @@ struct HfTreeCreatorLbToLcPi { candidate.impactParameter1(), candidate.errorImpactParameter0(), candidate.errorImpactParameter1(), + candidate.index1_as().tofNSigmaPi(), + RICHPi0, + RICHTrk1Pi, + RICHTrk1p, + RICHTrk2K, + RICHTrk3Pi, + RICHTrk3p, + track1.tofNSigmaPi(), // LcCand.index0_as().tofNSigmaPi(), + track1.tofNSigmaPr(), // LcCand.index0_as().tofNSigmaPr(), + track2.tofNSigmaKa(), // LcCand.index1_as().tofNSigmaKa(), + track3.tofNSigmaPi(), // LcCand.index2_as().tofNSigmaPi(), + track3.tofNSigmaPr(), // LcCand.index2_as().tofNSigmaPr(), + o2::aod::hf_cand_prong3::InvMassLcpKpi(LcCand), + o2::aod::hf_cand_prong3::CtLc(LcCand), + o2::aod::hf_cand_prong3::YLc(LcCand), + o2::aod::hf_cand_prong3::ELc(LcCand), + LcCand.eta(), + LcCand.cpa(), + LcCand.cpaXY(), + LcCand.chi2PCA(), + LcCand.decayLength(), + LcCand.decayLengthXY(), + LcCand.decayLengthXYNormalised(), FunctionSelection, FunctionInvMass, candidate.pt(), @@ -194,26 +290,13 @@ struct HfTreeCreatorLbToLcPi { fillTable(candidate.isSelLbToLcPi(), InvMassLbToLcPi(candidate), CtLb(candidate), YLb(candidate)); } - - // Filling particle properties - rowCandidateFullParticles.reserve(particles.size()); - for (auto& particle : particles) { - if (std::abs(particle.flagMCMatchGen()) == 1 << DecayType::LbToLcPi) { - rowCandidateFullParticles( - particle.mcCollision().bcId(), - particle.pt(), - particle.eta(), - particle.phi(), - RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())), - particle.flagMCMatchGen()); - } - } } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow; + workflow.push_back(adaptAnalysisTask(cfgc)); workflow.push_back(adaptAnalysisTask(cfgc)); return workflow; }