From c6af77e291c05c0b317539572e8917e9d4d9c315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 18:14:27 +0100 Subject: [PATCH 01/16] Fix candidateCreator2Prong --- .../TableProducer/candidateCreator2Prong.cxx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index d81c5b74329..30f46a5b331 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -71,6 +71,8 @@ struct HfCandidateCreator2Prong { Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + // 2-prong vertex fitter + o2::vertexing::DCAFitterN<2> df; int runNumber{0}; float toMicrometers = 10000.; // from cm to µm @@ -102,6 +104,15 @@ struct HfCandidateCreator2Prong { } if (std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) == 1) { hVertexerType->Fill(aod::hf_cand::VertexerType::DCAFitter); + // Configure DCAFitterN + // df.setBz(bz); + df.setPropagateToPCA(propagateToPCA); + df.setMaxR(maxR); + df.setMaxDZIni(maxDZIni); + df.setMinParamChange(minParamChange); + df.setMinRelChi2Change(minRelChi2Change); + df.setUseAbsDCA(useAbsDCA); + df.setWeightedFinalPCA(useWeightedFinalPCA); } if (std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0) == 1) { hVertexerType->Fill(aod::hf_cand::VertexerType::KfParticle); @@ -122,17 +133,6 @@ struct HfCandidateCreator2Prong { TTracks const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - // 2-prong vertex fitter - o2::vertexing::DCAFitterN<2> df; - // df.setBz(bz); - df.setPropagateToPCA(propagateToPCA); - df.setMaxR(maxR); - df.setMaxDZIni(maxDZIni); - df.setMinParamChange(minParamChange); - df.setMinRelChi2Change(minRelChi2Change); - df.setUseAbsDCA(useAbsDCA); - df.setWeightedFinalPCA(useWeightedFinalPCA); - // loop over pairs of track indices for (const auto& rowTrackIndexProng2 : rowsTrackIndexProng2) { auto track0 = rowTrackIndexProng2.template prong0_as(); From 73b6274c413863e9675bfb3298675e9c1cd57b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:02:47 +0100 Subject: [PATCH 02/16] Fix candidateCreator3Prong --- .../TableProducer/candidateCreator3Prong.cxx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 9d9f0947abc..4828d201228 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -57,6 +57,8 @@ struct HfCandidateCreator3Prong { Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + // 3-prong vertex fitter + o2::vertexing::DCAFitterN<3> df; int runNumber{0}; float toMicrometers = 10000.; // from cm to µm @@ -82,6 +84,15 @@ struct HfCandidateCreator3Prong { if (doprocessPvRefit && doprocessNoPvRefit) { LOGP(fatal, "Only one process function between processPvRefit and processNoPvRefit can be enabled at a time."); } + // Configure DCAFitterN + // df.setBz(bz); + df.setPropagateToPCA(propagateToPCA); + df.setMaxR(maxR); + df.setMaxDZIni(maxDZIni); + df.setMinParamChange(minParamChange); + df.setMinRelChi2Change(minRelChi2Change); + df.setUseAbsDCA(useAbsDCA); + df.setWeightedFinalPCA(useWeightedFinalPCA); massPi = MassPiPlus; massK = MassKPlus; @@ -98,17 +109,6 @@ struct HfCandidateCreator3Prong { aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - // 3-prong vertex fitter - o2::vertexing::DCAFitterN<3> df; - // df.setBz(bz); - df.setPropagateToPCA(propagateToPCA); - df.setMaxR(maxR); - df.setMaxDZIni(maxDZIni); - df.setMinParamChange(minParamChange); - df.setMinRelChi2Change(minRelChi2Change); - df.setUseAbsDCA(useAbsDCA); - df.setWeightedFinalPCA(useWeightedFinalPCA); - // loop over triplets of track indices for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { auto track0 = rowTrackIndexProng3.template prong0_as(); @@ -242,7 +242,6 @@ struct HfCandidateCreator3Prong { { runCreator3Prong(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefit, "Run candidate creator with PV refit", false); void processNoPvRefit(aod::Collisions const& collisions, @@ -252,7 +251,6 @@ struct HfCandidateCreator3Prong { { runCreator3Prong(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefit, "Run candidate creator without PV refit", true); }; From 979bf2384b974acb0c23cb98d66a1d7c811ecd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:09:47 +0100 Subject: [PATCH 03/16] Fix candidateCreatorBs --- PWGHF/TableProducer/candidateCreatorBs.cxx | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 3f6255730a4..107f46e1b06 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -64,6 +64,8 @@ struct HfCandidateCreatorBs { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter HfHelper hfHelper; Service ccdb; o2::base::MatLayerCylSet* lut; @@ -97,6 +99,25 @@ struct HfCandidateCreatorBs { massPi = MassPiPlus; massDs = MassDSBar; massBs = MassBS; + + // Initialise fitter for Bs vertex (2-prong vertex fitter) + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCABs); + df2.setWeightedFinalPCA(useWeightedFinalPCA); + + // Initialise fitter to redo Ds-vertex to get extrapolated daughter tracks (3-prong vertex fitter) + df3.setPropagateToPCA(propagateToPCA); + df3.setMaxR(maxR); + df3.setMaxDZIni(maxDZIni); + df3.setMinParamChange(minParamChange); + df3.setMinRelChi2Change(minRelChi2Change); + df3.setUseAbsDCA(useAbsDCADs); + df3.setWeightedFinalPCA(useWeightedFinalPCA); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -130,26 +151,6 @@ struct HfCandidateCreatorBs { TracksWithSel const&, aod::BCsWithTimestamps const&) { - // Initialise fitter for Bs vertex (2-prong vertex filter) - o2::vertexing::DCAFitterN<2> df2; - df2.setPropagateToPCA(propagateToPCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCABs); - df2.setWeightedFinalPCA(useWeightedFinalPCA); - - // Initialise fitter to redo Ds-vertex to get extrapolated daughter tracks (3-prong vertex filter) - o2::vertexing::DCAFitterN<3> df3; - df3.setPropagateToPCA(propagateToPCA); - df3.setMaxR(maxR); - df3.setMaxDZIni(maxDZIni); - df3.setMinParamChange(minParamChange); - df3.setMinRelChi2Change(minRelChi2Change); - df3.setUseAbsDCA(useAbsDCADs); - df3.setWeightedFinalPCA(useWeightedFinalPCA); - for (const auto& collision : collisions) { auto primaryVertex = getPrimaryVertex(collision); auto covMatrixPV = primaryVertex.getCov(); From 6cfa7c42d1505c6520939367e38bbc68d9f7500f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:10:26 +0100 Subject: [PATCH 04/16] Organise members --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 3 +-- PWGHF/TableProducer/candidateCreator3Prong.cxx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 30f46a5b331..d2d5c57447a 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -68,11 +68,10 @@ struct HfCandidateCreator2Prong { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - // 2-prong vertex fitter - o2::vertexing::DCAFitterN<2> df; int runNumber{0}; float toMicrometers = 10000.; // from cm to µm diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 4828d201228..09a2f651324 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -54,11 +54,10 @@ struct HfCandidateCreator3Prong { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - // 3-prong vertex fitter - o2::vertexing::DCAFitterN<3> df; int runNumber{0}; float toMicrometers = 10000.; // from cm to µm From 9aab7fbb2fad6fc67de43ae1404a4484af715112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:38:00 +0100 Subject: [PATCH 05/16] Fix candidateCreatorCascade --- .../TableProducer/candidateCreatorCascade.cxx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 04d99fb4d2d..26b2a00f525 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -56,6 +56,7 @@ struct HfCandidateCreatorCascade { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; @@ -78,6 +79,16 @@ struct HfCandidateCreatorCascade { massK0s = MassK0Short; massPi = MassPiPlus; massLc = MassLambdaCPlus; + + // df.setBz(bz); + df.setPropagateToPCA(propagateToPCA); + df.setMaxR(maxR); + df.setMaxDZIni(maxDZIni); + df.setMinParamChange(minParamChange); + df.setMinRelChi2Change(minRelChi2Change); + df.setUseAbsDCA(useAbsDCA); + df.setWeightedFinalPCA(useWeightedFinalPCA); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -93,17 +104,6 @@ struct HfCandidateCreatorCascade { aod::TracksWCov const&, aod::BCsWithTimestamps const&) { - // 2-prong vertex fitter - o2::vertexing::DCAFitterN<2> df; - // df.setBz(bz); - df.setPropagateToPCA(propagateToPCA); - df.setMaxR(maxR); - df.setMaxDZIni(maxDZIni); - df.setMinParamChange(minParamChange); - df.setMinRelChi2Change(minRelChi2Change); - df.setUseAbsDCA(useAbsDCA); - df.setWeightedFinalPCA(useWeightedFinalPCA); - // loop over pairs of track indices for (const auto& casc : rowsTrackIndexCasc) { const auto& bach = casc.prong0_as(); From d03bc2091dc4ef194f28337ea7c263519b9ac20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:38:16 +0100 Subject: [PATCH 06/16] Fix candidateCreatorLb --- PWGHF/TableProducer/candidateCreatorLb.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index 39c12099fcc..5c4b50d493a 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -60,6 +60,8 @@ struct HfCandidateCreatorLb { Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter (to rebuild Lc vertex) HfHelper hfHelper; double massPi{0.}; @@ -80,16 +82,7 @@ struct HfCandidateCreatorLb { { massPi = MassPiMinus; massLc = MassLambdaCPlus; - } - void process(aod::Collision const& collision, - soa::Filtered> const& lcCands, - aod::TracksWCov const& tracks) - { - // 2-prong vertex fitter - o2::vertexing::DCAFitterN<2> df2; df2.setBz(bz); df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -99,8 +92,6 @@ struct HfCandidateCreatorLb { df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); - // 3-prong vertex fitter (to rebuild Lc vertex) - o2::vertexing::DCAFitterN<3> df3; df3.setBz(bz); df3.setPropagateToPCA(propagateToPCA); df3.setMaxR(maxR); @@ -109,7 +100,14 @@ struct HfCandidateCreatorLb { df3.setMinRelChi2Change(minRelChi2Change); df3.setUseAbsDCA(useAbsDCA); df3.setWeightedFinalPCA(useWeightedFinalPCA); + } + void process(aod::Collision const& collision, + soa::Filtered> const& lcCands, + aod::TracksWCov const& tracks) + { // loop over Lc candidates for (const auto& lcCand : lcCands) { if (!(lcCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi)) { From ef4add2b0e52bd30874da1b7567883e5355968da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:38:33 +0100 Subject: [PATCH 07/16] Fix candidateCreatorToXiPi --- .../TableProducer/candidateCreatorToXiPi.cxx | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx index 39ad12f1c24..56f4bdfd20a 100644 --- a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx @@ -73,10 +73,10 @@ struct HfCandidateCreatorToXiPi { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter to build the omegac/xic vertex Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - int runNumber; using MyCascTable = soa::Join; // to use strangeness tracking, use aod::TraCascDatas instead of aod::CascDatas @@ -93,6 +93,17 @@ struct HfCandidateCreatorToXiPi { void init(InitContext const&) { + df.setPropagateToPCA(propagateToPCA); + df.setMaxR(maxR); + df.setMaxDZIni(maxDZIni); + df.setMaxDXYIni(maxDXYIni); + df.setMinParamChange(minParamChange); + df.setMinRelChi2Change(minRelChi2Change); + df.setMaxChi2(maxChi2); + df.setUseAbsDCA(useAbsDCA); + df.setWeightedFinalPCA(useWeightedFinalPCA); + df.setRefitWithMatCorr(refitWithMatCorr); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -106,25 +117,12 @@ struct HfCandidateCreatorToXiPi { MyCascTable const&, CascadesLinked const&, MySkimIdx const& candidates) { - double massPionFromPDG = MassPiPlus; // pdg code 211 double massLambdaFromPDG = MassLambda0; // pdg code 3122 double massXiFromPDG = MassXiMinus; // pdg code 3312 double massOmegacFromPDG = MassOmegaC0; // pdg code 4332 double massXicFromPDG = MassXiC0; // pdg code 4132 - // 2-prong vertex fitter to build the omegac/xic vertex - o2::vertexing::DCAFitterN<2> df; - df.setPropagateToPCA(propagateToPCA); - df.setMaxR(maxR); - df.setMaxDZIni(maxDZIni); - df.setMaxDXYIni(maxDXYIni); - df.setMinParamChange(minParamChange); - df.setMinRelChi2Change(minRelChi2Change); - df.setMaxChi2(maxChi2); - df.setUseAbsDCA(useAbsDCA); - df.setWeightedFinalPCA(useWeightedFinalPCA); - for (const auto& cand : candidates) { hCandidateCounter->Fill(0); @@ -141,9 +139,7 @@ struct HfCandidateCreatorToXiPi { auto bc = collision.bc_as(); initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); auto magneticField = o2::base::Propagator::Instance()->getNominalBz(); // z component - df.setBz(magneticField); - df.setRefitWithMatCorr(refitWithMatCorr); auto trackPion = cand.prong0_as(); auto cascAodElement = cand.cascade_as(); From db6ddf1c6ea8d53387bdf3a59e077a26fae14678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:38:49 +0100 Subject: [PATCH 08/16] Fix candidateCreatorXicc --- PWGHF/TableProducer/candidateCreatorXicc.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index 1a80868b211..c6db0dde298 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -60,6 +60,8 @@ struct HfCandidateCreatorXicc { Configurable selectionFlagXic{"selectionFlagXic", 1, "Selection Flag for Xic"}; Configurable cutPtPionMin{"cutPtPionMin", 1., "min. pt pion track"}; + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter to rebuild the Xic vertex + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter to build the Xicc vertex HfHelper hfHelper; double massPi{0.}; @@ -78,14 +80,7 @@ struct HfCandidateCreatorXicc { massPi = MassPiPlus; massK = MassKPlus; massXic = MassXiCPlus; - } - void process(aod::Collision const& collision, - soa::Filtered> const& xicCands, - aod::TracksWCov const& tracks) - { - // 3-prong vertex fitter to rebuild the Xic vertex - o2::vertexing::DCAFitterN<3> df3; df3.setBz(bz); df3.setPropagateToPCA(propagateToPCA); df3.setMaxR(maxR); @@ -95,8 +90,6 @@ struct HfCandidateCreatorXicc { df3.setUseAbsDCA(useAbsDCA); df3.setWeightedFinalPCA(useWeightedFinalPCA); - // 2-prong vertex fitter to build the Xicc vertex - o2::vertexing::DCAFitterN<2> df2; df2.setBz(bz); df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -105,7 +98,12 @@ struct HfCandidateCreatorXicc { df2.setMinRelChi2Change(minRelChi2Change); df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); + } + void process(aod::Collision const& collision, + soa::Filtered> const& xicCands, + aod::TracksWCov const& tracks) + { for (const auto& xicCand : xicCands) { if (!(xicCand.hfflag() & 1 << o2::aod::hf_cand_3prong::XicToPKPi)) { continue; From 5e8b844b920a83f222fa71dcda130d6a3f4127fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:39:03 +0100 Subject: [PATCH 09/16] Fix trackIndexSkimCreator --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 101 ++++++++---------- 1 file changed, 46 insertions(+), 55 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 14a2bea6c36..60d0fa64660 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1346,6 +1346,8 @@ struct HfTrackIndexSkimCreator { Configurable applyProtonPidForXicToPKPi{"applyProtonPidForXicToPKPi", false, "Apply proton PID for Xic->pKpi"}; Configurable applyKaonPidIn3Prongs{"applyKaonPidIn3Prongs", false, "Apply kaon PID for opposite-sign track in 3-prong and D* decays"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter // Needed for PV refitting Service ccdb; o2::base::MatLayerCylSet* lut; @@ -1416,6 +1418,22 @@ struct HfTrackIndexSkimCreator { massDzero = o2::constants::physics::MassD0; massPhi = o2::constants::physics::MassPhi; + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCA); + df2.setWeightedFinalPCA(useWeightedFinalPCA); + + df3.setPropagateToPCA(propagateToPCA); + df3.setMaxR(maxR); + df3.setMaxDZIni(maxDZIni); + df3.setMinParamChange(minParamChange); + df3.setMinRelChi2Change(minRelChi2Change); + df3.setUseAbsDCA(useAbsDCA); + df3.setWeightedFinalPCA(useWeightedFinalPCA); + arrMass2Prong[hf_cand_2prong::DecayType::D0ToPiK] = std::array{std::array{massPi, massK}, std::array{massK, massPi}}; @@ -2073,28 +2091,8 @@ struct HfTrackIndexSkimCreator { // set the magnetic field from CCDB auto bc = collision.bc_as(); initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); - - // 2-prong vertex fitter - o2::vertexing::DCAFitterN<2> df2; df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); - df2.setPropagateToPCA(propagateToPCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); - df2.setWeightedFinalPCA(useWeightedFinalPCA); - - // 3-prong vertex fitter - o2::vertexing::DCAFitterN<3> df3; df3.setBz(o2::base::Propagator::Instance()->getNominalBz()); - df3.setPropagateToPCA(propagateToPCA); - df3.setMaxR(maxR); - df3.setMaxDZIni(maxDZIni); - df3.setMinParamChange(minParamChange); - df3.setMinRelChi2Change(minRelChi2Change); - df3.setUseAbsDCA(useAbsDCA); - df3.setWeightedFinalPCA(useWeightedFinalPCA); // used to calculate number of candidiates per event auto nCand2 = rowTrackIndexProng2.lastIndex(); @@ -2909,7 +2907,6 @@ struct HfTrackIndexSkimCreator { { run2And3Prongs(collisions, bcWithTimeStamps, trackIndices, tracks); } - PROCESS_SWITCH(HfTrackIndexSkimCreator, process2And3ProngsWithPvRefit, "Process 2-prong and 3-prong skim with PV refit", false); void process2And3ProngsNoPvRefit( // soa::Join::iterator const& collision, //FIXME add centrality when option for variations to the process function appears @@ -2920,7 +2917,6 @@ struct HfTrackIndexSkimCreator { { run2And3Prongs(collisions, bcWithTimeStamps, trackIndices, tracks); } - PROCESS_SWITCH(HfTrackIndexSkimCreator, process2And3ProngsNoPvRefit, "Process 2-prong and 3-prong skim without PV refit", true); }; @@ -2981,6 +2977,7 @@ struct HfTrackIndexSkimCreatorCascades { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> fitter; // 2-prong vertex fitter // Needed for PV refitting Service ccdb; o2::base::MatLayerCylSet* lut; @@ -3019,6 +3016,15 @@ struct HfTrackIndexSkimCreatorCascades { massPi = o2::constants::physics::MassPiPlus; massLc = o2::constants::physics::MassLambdaCPlus; + fitter.setPropagateToPCA(propagateToPCA); + fitter.setMaxR(maxR); + fitter.setMinParamChange(minParamChange); + fitter.setMinRelChi2Change(minRelChi2Change); + // fitter.setMaxDZIni(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs + // fitter.setMaxChi2(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs + fitter.setUseAbsDCA(useAbsDCA); + fitter.setWeightedFinalPCA(useWeightedFinalPCA); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -3049,18 +3055,7 @@ struct HfTrackIndexSkimCreatorCascades { for (const auto& collision : collisions) { auto bc = collision.bc_as(); initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); - - // Define o2 fitter, 2-prong - o2::vertexing::DCAFitterN<2> fitter; fitter.setBz(o2::base::Propagator::Instance()->getNominalBz()); - fitter.setPropagateToPCA(propagateToPCA); - fitter.setMaxR(maxR); - fitter.setMinParamChange(minParamChange); - fitter.setMinRelChi2Change(minRelChi2Change); - // fitter.setMaxDZIni(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - // fitter.setMaxChi2(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - fitter.setUseAbsDCA(useAbsDCA); - fitter.setWeightedFinalPCA(useWeightedFinalPCA); // fist we loop over the bachelor candidate @@ -3256,10 +3251,11 @@ struct HfTrackIndexSkimCreatorLfCascades { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - int runNumber; // array of PDG masses of possible charm baryon daughters @@ -3294,6 +3290,22 @@ struct HfTrackIndexSkimCreatorLfCascades { arrMass2Prong[hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi] = std::array{massOmega, massPi}; arrMass3Prong[hf_cand_casc_lf::DecayType3Prong::XicplusToXiPiPi] = std::array{massXi, massPi, massPi}; + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCA); + df2.setWeightedFinalPCA(useWeightedFinalPCA); + + df3.setPropagateToPCA(propagateToPCA); + df3.setMaxR(maxR); + df3.setMaxDZIni(maxDZIni); + df3.setMinParamChange(minParamChange); + df3.setMinRelChi2Change(minRelChi2Change); + df3.setUseAbsDCA(useAbsDCA); + df3.setWeightedFinalPCA(useWeightedFinalPCA); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -3409,27 +3421,6 @@ struct HfTrackIndexSkimCreatorLfCascades { aod::BCsWithTimestamps const&, V0Full const&) { - - // Define o2 fitter for charm baryon decay vertex, 2prong - o2::vertexing::DCAFitterN<2> df2; - df2.setPropagateToPCA(propagateToPCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); - df2.setWeightedFinalPCA(useWeightedFinalPCA); - - // Define o2 fitter for charm baryon decay vertex, 3prong - o2::vertexing::DCAFitterN<3> df3; - df3.setPropagateToPCA(propagateToPCA); - df3.setMaxR(maxR); - df3.setMaxDZIni(maxDZIni); - df3.setMinParamChange(minParamChange); - df3.setMinRelChi2Change(minRelChi2Change); - df3.setUseAbsDCA(useAbsDCA); - df3.setWeightedFinalPCA(useWeightedFinalPCA); - uint8_t hfFlag = 0; for (const auto& collision : collisions) { From 01094ea0b3f235b01fc5a1b14b4238c1e039e529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:41:39 +0100 Subject: [PATCH 10/16] Rename fitter --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 60d0fa64660..9d7e6efa9ce 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -2977,7 +2977,7 @@ struct HfTrackIndexSkimCreatorCascades { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; - o2::vertexing::DCAFitterN<2> fitter; // 2-prong vertex fitter + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter // Needed for PV refitting Service ccdb; o2::base::MatLayerCylSet* lut; @@ -3016,14 +3016,14 @@ struct HfTrackIndexSkimCreatorCascades { massPi = o2::constants::physics::MassPiPlus; massLc = o2::constants::physics::MassLambdaCPlus; - fitter.setPropagateToPCA(propagateToPCA); - fitter.setMaxR(maxR); - fitter.setMinParamChange(minParamChange); - fitter.setMinRelChi2Change(minRelChi2Change); - // fitter.setMaxDZIni(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - // fitter.setMaxChi2(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - fitter.setUseAbsDCA(useAbsDCA); - fitter.setWeightedFinalPCA(useWeightedFinalPCA); + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + // df2.setMaxDZIni(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs + // df2.setMaxChi2(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs + df2.setUseAbsDCA(useAbsDCA); + df2.setWeightedFinalPCA(useWeightedFinalPCA); ccdb->setURL(ccdbUrl); ccdb->setCaching(true); @@ -3055,7 +3055,7 @@ struct HfTrackIndexSkimCreatorCascades { for (const auto& collision : collisions) { auto bc = collision.bc_as(); initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); - fitter.setBz(o2::base::Propagator::Instance()->getNominalBz()); + df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); // fist we loop over the bachelor candidate @@ -3152,7 +3152,7 @@ struct HfTrackIndexSkimCreatorCascades { // now we find the DCA between the V0 and the bachelor, for the cascade int nCand2 = 0; try { - nCand2 = fitter.process(trackV0, trackBach); + nCand2 = df2.process(trackV0, trackBach); } catch (...) { continue; } @@ -3160,9 +3160,9 @@ struct HfTrackIndexSkimCreatorCascades { if (nCand2 == 0) { continue; } - fitter.propagateTracksToVertex(); // propagate the bach and V0 to the Lc vertex - fitter.getTrack(0).getPxPyPzGlo(pVecV0); // take the momentum at the Lc vertex - fitter.getTrack(1).getPxPyPzGlo(pVecBach); + df2.propagateTracksToVertex(); // propagate the bach and V0 to the Lc vertex + df2.getTrack(0).getPxPyPzGlo(pVecV0); // take the momentum at the Lc vertex + df2.getTrack(1).getPxPyPzGlo(pVecBach); // cascade candidate pT cut auto ptCascCand = RecoDecay::pt(pVecBach, pVecV0); @@ -3175,7 +3175,7 @@ struct HfTrackIndexSkimCreatorCascades { mass2K0sP = RecoDecay::m(std::array{pVecBach, pVecV0}, std::array{massP, massK0s}); std::array posCasc = {0., 0., 0.}; - const auto& cascVtx = fitter.getPCACandidate(); + const auto& cascVtx = df2.getPCACandidate(); for (int i = 0; i < 3; i++) { posCasc[i] = cascVtx[i]; } From 0ef48e9ede91b62afda743fe6c63cbef3fd69dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 20:55:19 +0100 Subject: [PATCH 11/16] Fix order of members --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 9d7e6efa9ce..d8ffdc62601 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -410,6 +410,13 @@ struct HfTrackIndexSkimCreatorTagSelTracks { std::array selectorProton; TrackSelectorKa selectorKaon; + Preslice trackIndicesPerCollision = aod::track_association::collisionId; + + Partition pvContributors = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); + Partition pvContributorsWithPidTpc = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); + Partition pvContributorsWithPidTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); + Partition pvContributorsWithPidTpcTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); + // QA of PV refit ConfigurableAxis axisPvRefitDeltaX{"axisPvRefitDeltaX", {1000, -0.5f, 0.5f}, "DeltaX binning PV refit"}; ConfigurableAxis axisPvRefitDeltaY{"axisPvRefitDeltaY", {1000, -0.5f, 0.5f}, "DeltaY binning PV refit"}; @@ -1104,12 +1111,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { } } - Preslice trackIndicesPerCollision = aod::track_association::collisionId; - Partition pvContributors = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTpc = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTpcTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - void processNoPid(aod::Collisions const& collisions, TrackAssoc const& trackIndices, TracksWithSelAndDca const& tracks, @@ -1139,7 +1140,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processNoPid, "Process without PID selections", true); void processProtonPidTpc(aod::Collisions const& collisions, @@ -1171,7 +1171,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTpc, "Process with proton TPC PID selection", false); void processProtonPidTof(aod::Collisions const& collisions, @@ -1203,7 +1202,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTof, "Process with proton TOF PID selection", false); void processProtonPidTpcOrTof(aod::Collisions const& collisions, @@ -1235,7 +1233,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTpcOrTof, "Process with proton PID selection (TPC or TOF logic)", false); void processProtonPidTpcAndTof(aod::Collisions const& collisions, @@ -1267,7 +1264,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTpcAndTof, "Process with proton PID selection (TPC and TOF logic)", false); }; @@ -2989,12 +2985,12 @@ struct HfTrackIndexSkimCreatorCascades { double massPi{0.}; double massLc{0.}; - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); - Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandV0bachelor))) != 0u && (applyProtonPid == false || (aod::hf_sel_track::isIdentifiedPid & static_cast(BIT(ChannelsProtonPid::LcToPK0S))) != 0u); - using SelectedCollisions = soa::Filtered>; using FilteredTrackAssocSel = soa::Filtered>; + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); + Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandV0bachelor))) != 0u && (applyProtonPid == false || (aod::hf_sel_track::isIdentifiedPid & static_cast(BIT(ChannelsProtonPid::LcToPK0S))) != 0u); + Preslice trackIndicesPerCollision = aod::track_association::collisionId; Preslice v0sPerCollision = aod::v0data::collisionId; @@ -3193,7 +3189,6 @@ struct HfTrackIndexSkimCreatorCascades { } // loop over tracks } // loop over collisions } // processCascades - PROCESS_SWITCH(HfTrackIndexSkimCreatorCascades, processCascades, "Skim HF -> V0 cascades", false); }; @@ -3271,6 +3266,18 @@ struct HfTrackIndexSkimCreatorLfCascades { double massOmega{0.}; double massLambda{0.}; + using SelectedCollisions = soa::Filtered>; + using SelectedHfTrackAssoc = soa::Filtered>; + using CascFull = soa::Join; + using V0Full = soa::Join; + + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); + Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandCascadeBachelor))) != 0u; + + Preslice tracksPerCollision = aod::track::collisionId; // needed for PV refit + Preslice trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId + Preslice cascadesPerCollision = aod::cascdata::collisionId; + // histograms HistogramRegistry registry{"registry"}; @@ -3350,18 +3357,6 @@ struct HfTrackIndexSkimCreatorLfCascades { } } - using SelectedCollisions = soa::Filtered>; - using SelectedHfTrackAssoc = soa::Filtered>; - using CascFull = soa::Join; - using V0Full = soa::Join; - - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); - Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandCascadeBachelor))) != 0u; - - Preslice tracksPerCollision = aod::track::collisionId; // needed for PV refit - Preslice trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId - Preslice cascadesPerCollision = aod::cascdata::collisionId; - /// Single-cascade cuts template bool isPreselectedCascade(const TCascade& casc, const float& pvx, const float& pvy, const float& pvz) From bd4e9f40ce493f93e97b20c71a51b470824c803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 12 Feb 2024 21:02:06 +0100 Subject: [PATCH 12/16] Move type declarations inside workflow --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index d8ffdc62601..b645677b0ac 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -109,11 +109,6 @@ enum ChannelsProtonPid { // kaon PID (opposite-sign track in 3-prong decays) constexpr int channelKaonPid = ChannelsProtonPid::NChannelsProtonPid; -using TracksWithSelAndDca = soa::Join; -using TracksWithSelAndDcaAndPidTpc = soa::Join; -using TracksWithSelAndDcaAndPidTof = soa::Join; -using TracksWithSelAndDcaAndPidTpcTof = soa::Join; - /// Event selection struct HfTrackIndexSkimCreatorTagSelCollisions { Produces rowSelectedCollision; @@ -410,6 +405,11 @@ struct HfTrackIndexSkimCreatorTagSelTracks { std::array selectorProton; TrackSelectorKa selectorKaon; + using TracksWithSelAndDca = soa::Join; + using TracksWithSelAndDcaAndPidTpc = soa::Join; + using TracksWithSelAndDcaAndPidTof = soa::Join; + using TracksWithSelAndDcaAndPidTpcTof = soa::Join; + Preslice trackIndicesPerCollision = aod::track_association::collisionId; Partition pvContributors = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); From 2852c81b9f1a569deff87445cc1ccdf51e815fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 22 Feb 2024 02:18:22 +0100 Subject: [PATCH 13/16] Fix candidateCreatorChic --- .../TableProducer/candidateCreatorChic.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index d50bd22ef08..c0f569728bc 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx @@ -63,6 +63,7 @@ struct HfCandidateCreatorChic { Configurable selectionFlagJpsi{"selectionFlagJpsi", 1, "Selection Flag for Jpsi"}; Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter (to rebuild Jpsi vertex) HfHelper hfHelper; double massJpsi{0.}; @@ -82,17 +83,7 @@ struct HfCandidateCreatorChic { void init(InitContext const&) { massJpsi = MassJPsi; - } - void process(aod::Collision const& collision, - soa::Filtered> const& jpsiCands, - aod::TracksWCov const& tracks, - aod::ECALs const& ecals) - { - // 2-prong vertex fitter (to rebuild Jpsi vertex) - o2::vertexing::DCAFitterN<2> df2; df2.setBz(bz); df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -101,7 +92,15 @@ struct HfCandidateCreatorChic { df2.setMinRelChi2Change(minRelChi2Change); df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); + } + void process(aod::Collision const& collision, + soa::Filtered> const& jpsiCands, + aod::TracksWCov const& tracks, + aod::ECALs const& ecals) + { // loop over Jpsi candidates for (const auto& jpsiCand : jpsiCands) { if (!(jpsiCand.hfflag() & 1 << hf_cand_2prong::DecayType::JpsiToEE) && !(jpsiCand.hfflag() & 1 << hf_cand_2prong::DecayType::JpsiToMuMu)) { From 06d5de2e8e470494fd840b9805b2b5f9b84d056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 22 Feb 2024 02:18:38 +0100 Subject: [PATCH 14/16] Fix candidateCreatorX --- .../TableProducer/candidateCreatorX.cxx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index 7c0dad18ca3..76c34037e93 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -62,6 +62,8 @@ struct HfCandidateCreatorX { Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; Configurable diffMassJpsiMax{"diffMassJpsiMax", 0.07, "max. diff. between Jpsi rec. and PDG mass"}; + o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter (to rebuild Jpsi vertex) + o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter HfHelper hfHelper; double massPi{0.}; @@ -83,16 +85,7 @@ struct HfCandidateCreatorX { { massPi = MassPiPlus; massJpsi = MassJPsi; - } - void process(aod::Collision const& collision, - soa::Filtered> const& jpsiCands, - aod::TracksWCov const& tracks) - { - // 2-prong vertex fitter (to rebuild Jpsi vertex) - o2::vertexing::DCAFitterN<2> df2; df2.setBz(bz); df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -102,8 +95,6 @@ struct HfCandidateCreatorX { df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); - // 3-prong vertex fitter - o2::vertexing::DCAFitterN<3> df3; df3.setBz(bz); df3.setPropagateToPCA(propagateToPCA); df3.setMaxR(maxR); @@ -112,7 +103,14 @@ struct HfCandidateCreatorX { df3.setMinRelChi2Change(minRelChi2Change); df3.setUseAbsDCA(useAbsDCA); df3.setWeightedFinalPCA(useWeightedFinalPCA); + } + void process(aod::Collision const& collision, + soa::Filtered> const& jpsiCands, + aod::TracksWCov const& tracks) + { // loop over Jpsi candidates for (const auto& jpsiCand : jpsiCands) { if (!(jpsiCand.hfflag() & 1 << hf_cand_2prong::DecayType::JpsiToEE) && !(jpsiCand.hfflag() & 1 << hf_cand_2prong::DecayType::JpsiToMuMu)) { From 1a4d4344f55e8a5e4b05f28196f4457c0a552482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 22 Feb 2024 02:18:47 +0100 Subject: [PATCH 15/16] Organise members --- .../candidateCreatorB0Reduced.cxx | 18 ++++--- .../candidateCreatorBplusReduced.cxx | 25 +++++----- .../TableProducer/dataCreatorD0PiReduced.cxx | 44 ++++++++--------- .../dataCreatorDplusPiReduced.cxx | 44 ++++++++--------- .../TableProducer/candidateCreator2Prong.cxx | 6 ++- .../TableProducer/candidateCreator3Prong.cxx | 5 +- PWGHF/TableProducer/candidateCreatorB0.cxx | 14 +++--- PWGHF/TableProducer/candidateCreatorBplus.cxx | 14 +++--- PWGHF/TableProducer/candidateCreatorDstar.cxx | 25 +++++----- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 47 +++++++++---------- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 25 +++++----- 11 files changed, 133 insertions(+), 134 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx index 9b6089c6310..fca3ee11082 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx @@ -49,16 +49,14 @@ struct HfCandidateCreatorB0Reduced { Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; // selection Configurable invMassWindowDPiTolerance{"invMassWindowDPiTolerance", 0.01, "invariant-mass window tolerance for DPi pair preselections (GeV/c2)"}; - // variable that will store the value of invMassWindowDPi (defined in dataCreatorDplusPiReduced.cxx) - float myInvMassWindowDPi{1.}; + float myInvMassWindowDPi{1.}; // variable that will store the value of invMassWindowDPi (defined in dataCreatorDplusPiReduced.cxx) float massPi{0.}; float massD{0.}; float massB0{0.}; float bz{0.}; - // Fitter for B vertex (2-prong vertex filter) - o2::vertexing::DCAFitterN<2> df2; + o2::vertexing::DCAFitterN<2> df2; // fitter for B vertex (2-prong vertex fitter) Preslice> candsDPerCollision = hf_track_index_reduced::hfRedCollisionId; Preslice> candsDWithMlPerCollision = hf_track_index_reduced::hfRedCollisionId; @@ -73,12 +71,6 @@ struct HfCandidateCreatorB0Reduced { LOGP(fatal, "Only one process function for data should be enabled at a time."); } - // histograms - registry.add("hMassB0ToDPi", "2-prong candidates;inv. mass (B^{0} #rightarrow D^{#minus}#pi^{#plus} #rightarrow #pi^{#minus}K^{#plus}#pi^{#minus}#pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 3., 8.}}}); - registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); - registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); - // invariant-mass window cut massPi = o2::constants::physics::MassPiPlus; massD = o2::constants::physics::MassDMinus; @@ -92,6 +84,12 @@ struct HfCandidateCreatorB0Reduced { df2.setMinRelChi2Change(minRelChi2Change); df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); + + // histograms + registry.add("hMassB0ToDPi", "2-prong candidates;inv. mass (B^{0} #rightarrow D^{#minus}#pi^{#plus} #rightarrow #pi^{#minus}K^{#plus}#pi^{#minus}#pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 3., 8.}}}); + registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); + registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); } /// Main function to perform B0 candidate creation diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx index 359230b352f..d7ab973c2ec 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx @@ -48,16 +48,13 @@ struct HfCandidateCreatorBplusReduced { Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; // selection Configurable invMassWindowD0PiTolerance{"invMassWindowD0PiTolerance", 0.01, "invariant-mass window tolerance for D0Pi pair preselections (GeV/c2)"}; - // variable that will store the value of invMassWindowD0Pi (defined in dataCreatorD0PiReduced.cxx) - float myInvMassWindowD0Pi{1.}; + float myInvMassWindowD0Pi{1.}; // variable that will store the value of invMassWindowD0Pi (defined in dataCreatorD0PiReduced.cxx) double massPi{0.}; double massD0{0.}; double massBplus{0.}; double bz{0.}; - - // Fitter for B vertex (2-prong vertex filter) - o2::vertexing::DCAFitterN<2> df2; + o2::vertexing::DCAFitterN<2> df2; // fitter for B vertex (2-prong vertex fitter) Preslice> candsDPerCollision = hf_track_index_reduced::hfRedCollisionId; Preslice> tracksPionPerCollision = hf_track_index_reduced::hfRedCollisionId; @@ -66,11 +63,10 @@ struct HfCandidateCreatorBplusReduced { void init(InitContext const&) { - // histograms - registry.add("hMassBplusToD0Pi", "2-prong candidates;inv. mass (B^{+} #rightarrow #overline{D^{0}}#pi^{#plus} #rightarrow #pi^{#minus}K^{#plus}#pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 3., 8.}}}); - registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); - registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); + // invariant-mass window cut + massPi = o2::constants::physics::MassPiPlus; + massD0 = o2::constants::physics::MassD0; + massBplus = o2::constants::physics::MassBPlus; // Initialize fitter df2.setPropagateToPCA(propagateToPCA); @@ -81,10 +77,11 @@ struct HfCandidateCreatorBplusReduced { df2.setUseAbsDCA(useAbsDCA); df2.setWeightedFinalPCA(useWeightedFinalPCA); - // invariant-mass window cut - massPi = o2::constants::physics::MassPiPlus; - massD0 = o2::constants::physics::MassD0; - massBplus = o2::constants::physics::MassBPlus; + // histograms + registry.add("hMassBplusToD0Pi", "2-prong candidates;inv. mass (B^{+} #rightarrow #overline{D^{0}}#pi^{#plus} #rightarrow #pi^{#minus}K^{#plus}#pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 3., 8.}}}); + registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); + registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); } void process(aod::HfRedCollisions const& collisions, diff --git a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx index 279a5df243f..9f501603cd3 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx @@ -123,22 +123,12 @@ struct HfDataCreatorD0PiReduced { void init(InitContext const&) { - // histograms - constexpr int kNBinsEvents = kNEvent; - std::string labels[kNBinsEvents]; - labels[Event::Processed] = "processed"; - labels[Event::NoD0PiSelected] = "without D0Pi pairs"; - labels[Event::D0PiSelected] = "with D0Pi pairs"; - static const AxisSpec axisEvents = {kNBinsEvents, 0.5, kNBinsEvents + 0.5, ""}; - registry.add("hEvents", "Events;;entries", HistType::kTH1F, {axisEvents}); - for (int iBin = 0; iBin < kNBinsEvents; iBin++) { - registry.get(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); - } - - registry.add("hMassD0ToKPi", "D^{0}} candidates;inv. mass (K^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); - registry.add("hPtD0", "D^{0} candidates;D^{0} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("hCPAD0", "D^{0} candidates;D^{0} cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // invariant-mass window cut + massPi = MassPiPlus; + massD0 = MassD0; + massBplus = MassBPlus; + invMass2D0PiMin = (massBplus - invMassWindowD0Pi) * (massBplus - invMassWindowD0Pi); + invMass2D0PiMax = (massBplus + invMassWindowD0Pi) * (massBplus + invMassWindowD0Pi); // Initialize fitter df2.setPropagateToPCA(propagateToPCA); @@ -156,12 +146,22 @@ struct HfDataCreatorD0PiReduced { ccdb->setLocalObjectValidityChecking(); runNumber = 0; - // invariant-mass window cut - massPi = MassPiPlus; - massD0 = MassD0; - massBplus = MassBPlus; - invMass2D0PiMin = (massBplus - invMassWindowD0Pi) * (massBplus - invMassWindowD0Pi); - invMass2D0PiMax = (massBplus + invMassWindowD0Pi) * (massBplus + invMassWindowD0Pi); + // histograms + constexpr int kNBinsEvents = kNEvent; + std::string labels[kNBinsEvents]; + labels[Event::Processed] = "processed"; + labels[Event::NoD0PiSelected] = "without D0Pi pairs"; + labels[Event::D0PiSelected] = "with D0Pi pairs"; + static const AxisSpec axisEvents = {kNBinsEvents, 0.5, kNBinsEvents + 0.5, ""}; + registry.add("hEvents", "Events;;entries", HistType::kTH1F, {axisEvents}); + for (int iBin = 0; iBin < kNBinsEvents; iBin++) { + registry.get(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } + + registry.add("hMassD0ToKPi", "D^{0}} candidates;inv. mass (K^{#minus} #pi^{#plus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hPtD0", "D^{0} candidates;D^{0} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("hCPAD0", "D^{0} candidates;D^{0} cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); } /// Pion selection (D0 Pi <-- B+) diff --git a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx index f56a8a6105c..eb80811d610 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx @@ -127,22 +127,12 @@ struct HfDataCreatorDplusPiReduced { void init(InitContext const&) { - // histograms - constexpr int kNBinsEvents = kNEvent; - std::string labels[kNBinsEvents]; - labels[Event::Processed] = "processed"; - labels[Event::NoDPiSelected] = "without DPi pairs"; - labels[Event::DPiSelected] = "with DPi pairs"; - static const AxisSpec axisEvents = {kNBinsEvents, 0.5, kNBinsEvents + 0.5, ""}; - registry.add("hEvents", "Events;;entries", HistType::kTH1F, {axisEvents}); - for (int iBin = 0; iBin < kNBinsEvents; iBin++) { - registry.get(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); - } - - registry.add("hMassDToPiKPi", "D^{#minus} candidates;inv. mass (p^{#minus} K^{#plus} #pi^{#minus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); - registry.add("hPtD", "D^{#minus} candidates;D^{#minus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("hCPAD", "D^{#minus} candidates;D^{#minus} cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // invariant-mass window cut + massPi = MassPiPlus; + massD = MassDMinus; + massB0 = MassB0; + invMass2DPiMin = (massB0 - invMassWindowDPi) * (massB0 - invMassWindowDPi); + invMass2DPiMax = (massB0 + invMassWindowDPi) * (massB0 + invMassWindowDPi); // Initialize fitter df3.setPropagateToPCA(propagateToPCA); @@ -160,12 +150,22 @@ struct HfDataCreatorDplusPiReduced { ccdb->setLocalObjectValidityChecking(); runNumber = 0; - // invariant-mass window cut - massPi = MassPiPlus; - massD = MassDMinus; - massB0 = MassB0; - invMass2DPiMin = (massB0 - invMassWindowDPi) * (massB0 - invMassWindowDPi); - invMass2DPiMax = (massB0 + invMassWindowDPi) * (massB0 + invMassWindowDPi); + // histograms + constexpr int kNBinsEvents = kNEvent; + std::string labels[kNBinsEvents]; + labels[Event::Processed] = "processed"; + labels[Event::NoDPiSelected] = "without DPi pairs"; + labels[Event::DPiSelected] = "with DPi pairs"; + static const AxisSpec axisEvents = {kNBinsEvents, 0.5, kNBinsEvents + 0.5, ""}; + registry.add("hEvents", "Events;;entries", HistType::kTH1F, {axisEvents}); + for (int iBin = 0; iBin < kNBinsEvents; iBin++) { + registry.get(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } + + registry.add("hMassDToPiKPi", "D^{#minus} candidates;inv. mass (p^{#minus} K^{#plus} #pi^{#minus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hPtD", "D^{#minus} candidates;D^{#minus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("hCPAD", "D^{#minus} candidates;D^{#minus} cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); } /// Pion selection (D Pi <-- B0) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index d2d5c57447a..ff73b21eae8 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -101,6 +101,10 @@ struct HfCandidateCreator2Prong { if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } + + massPi = MassPiPlus; + massK = MassKPlus; + if (std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) == 1) { hVertexerType->Fill(aod::hf_cand::VertexerType::DCAFitter); // Configure DCAFitterN @@ -117,8 +121,6 @@ struct HfCandidateCreator2Prong { hVertexerType->Fill(aod::hf_cand::VertexerType::KfParticle); } - massPi = MassPiPlus; - massK = MassKPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 09a2f651324..762f5e4f620 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -83,6 +83,9 @@ struct HfCandidateCreator3Prong { if (doprocessPvRefit && doprocessNoPvRefit) { LOGP(fatal, "Only one process function between processPvRefit and processNoPvRefit can be enabled at a time."); } + massPi = MassPiPlus; + massK = MassKPlus; + // Configure DCAFitterN // df.setBz(bz); df.setPropagateToPCA(propagateToPCA); @@ -93,8 +96,6 @@ struct HfCandidateCreator3Prong { df.setUseAbsDCA(useAbsDCA); df.setWeightedFinalPCA(useWeightedFinalPCA); - massPi = MassPiPlus; - massK = MassKPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 3e08a21c21f..47209a50eb9 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -101,6 +101,13 @@ struct HfCandidateCreatorB0 { void init(InitContext const&) { + // invariant-mass window cut + massPi = MassPiPlus; + massD = MassDMinus; + massB0 = MassB0; + invMass2DPiMin = (massB0 - invMassWindowB0) * (massB0 - invMassWindowB0); + invMass2DPiMax = (massB0 + invMassWindowB0) * (massB0 + invMassWindowB0); + // Initialise fitter for B vertex (2-prong vertex filter) df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -125,13 +132,6 @@ struct HfCandidateCreatorB0 { ccdb->setLocalObjectValidityChecking(); lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut)); runNumber = 0; - - // invariant-mass window cut - massPi = MassPiPlus; - massD = MassDMinus; - massB0 = MassB0; - invMass2DPiMin = (massB0 - invMassWindowB0) * (massB0 - invMassWindowB0); - invMass2DPiMax = (massB0 + invMassWindowB0) * (massB0 + invMassWindowB0); } /// Single-track cuts for pions on dcaXY diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index a8e0632319e..cdecaddf9a2 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -104,6 +104,13 @@ struct HfCandidateCreatorBplus { void init(InitContext const&) { + // invariant-mass window cut + massPi = MassPiPlus; + massD0 = MassD0; + massBplus = MassBPlus; + invMass2D0PiMin = (massBplus - invMassWindowBplus) * (massBplus - invMassWindowBplus); + invMass2D0PiMax = (massBplus + invMassWindowBplus) * (massBplus + invMassWindowBplus); + // Initialise fitter for B vertex dfB.setPropagateToPCA(propagateToPCA); dfB.setMaxR(maxR); @@ -126,13 +133,6 @@ struct HfCandidateCreatorBplus { ccdb->setLocalObjectValidityChecking(); lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut)); runNumber = 0; - - // invariant-mass window cut - massPi = MassPiPlus; - massD0 = MassD0; - massBplus = MassBPlus; - invMass2D0PiMin = (massBplus - invMassWindowBplus) * (massBplus - invMassWindowBplus); - invMass2D0PiMax = (massBplus + invMassWindowBplus) * (massBplus + invMassWindowBplus); } /// Single-track cuts for pions on dcaXY diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index b7c88135221..41f9a3eb414 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -104,15 +104,10 @@ struct HfCandidateCreatorDstar { LOGP(fatal, "Only one process function between processPvRefit and processNoPvRefit can be enabled at a time."); } // LOG(info) << "Init Function Invoked"; - ccdb->setURL(ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); // set the flag to check object validity before CCDB query - // LOG(info) << "Retriving ccdb object"; - auto rectification = ccdb->get(ccdbPathLut); // retrieve an object of type T from CCDB as stored under path; will use the timestamp member - lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(rectification); - // LOG(info) << "Successfully Retrived"; - runNumber = 0; - bz = 0; + + massPi = MassPiPlus; + massK = MassKPlus; + massD0 = MassD0; df.setPropagateToPCA(propagateToPCA); df.setMaxR(maxR); @@ -122,9 +117,15 @@ struct HfCandidateCreatorDstar { df.setUseAbsDCA(useAbsDCA); df.setWeightedFinalPCA(useWeightedFinalPCA); - massPi = MassPiPlus; - massK = MassKPlus; - massD0 = MassD0; + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); // set the flag to check object validity before CCDB query + // LOG(info) << "Retriving ccdb object"; + auto rectification = ccdb->get(ccdbPathLut); // retrieve an object of type T from CCDB as stored under path; will use the timestamp member + lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(rectification); + // LOG(info) << "Successfully Retrived"; + runNumber = 0; + bz = 0; } /// @brief function for secondary vertex reconstruction and candidate creator diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index b645677b0ac..2b3ef300d51 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1271,8 +1271,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { /// Pre-selection of 2-prong and 3-prong secondary vertices struct HfTrackIndexSkimCreator { - SliceCache cache; - Produces rowTrackIndexProng2; Produces rowProng2CutStatus; Produces rowProng2PVrefit; @@ -1342,6 +1340,7 @@ struct HfTrackIndexSkimCreator { Configurable applyProtonPidForXicToPKPi{"applyProtonPidForXicToPKPi", false, "Apply proton PID for Xic->pKpi"}; Configurable applyKaonPidIn3Prongs{"applyKaonPidIn3Prongs", false, "Apply kaon PID for opposite-sign track in 3-prong and D* decays"}; + SliceCache cache; o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter // Needed for PV refitting @@ -1414,22 +1413,6 @@ struct HfTrackIndexSkimCreator { massDzero = o2::constants::physics::MassD0; massPhi = o2::constants::physics::MassPhi; - df2.setPropagateToPCA(propagateToPCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); - df2.setWeightedFinalPCA(useWeightedFinalPCA); - - df3.setPropagateToPCA(propagateToPCA); - df3.setMaxR(maxR); - df3.setMaxDZIni(maxDZIni); - df3.setMinParamChange(minParamChange); - df3.setMinRelChi2Change(minRelChi2Change); - df3.setUseAbsDCA(useAbsDCA); - df3.setWeightedFinalPCA(useWeightedFinalPCA); - arrMass2Prong[hf_cand_2prong::DecayType::D0ToPiK] = std::array{std::array{massPi, massK}, std::array{massK, massPi}}; @@ -1458,6 +1441,28 @@ struct HfTrackIndexSkimCreator { cut3Prong = {cutsDplusToPiKPi, cutsLcToPKPi, cutsDsToKKPi, cutsXicToPKPi}; pTBins3Prong = {binsPtDplusToPiKPi, binsPtLcToPKPi, binsPtDsToKKPi, binsPtXicToPKPi}; + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCA); + df2.setWeightedFinalPCA(useWeightedFinalPCA); + + df3.setPropagateToPCA(propagateToPCA); + df3.setMaxR(maxR); + df3.setMaxDZIni(maxDZIni); + df3.setMinParamChange(minParamChange); + df3.setMinRelChi2Change(minRelChi2Change); + df3.setUseAbsDCA(useAbsDCA); + df3.setWeightedFinalPCA(useWeightedFinalPCA); + + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut)); + runNumber = 0; + if (fillHistograms) { registry.add("hNTracks", "Number of selected tracks;# of selected tracks;entries", {HistType::kTH1F, {axisNumTracks}}); // 2-prong histograms @@ -1511,12 +1516,6 @@ struct HfTrackIndexSkimCreator { registry.add("PvRefit/hNContribPvRefitChi2Minus1", "N. contributors original PV for PV refit #it{#chi}^{2}==#minus1", kTH1F, {axisCollisionNContrib}); } } - - ccdb->setURL(ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut)); - runNumber = 0; } /// Method to perform selections for 2-prong candidates before vertex reconstruction diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 46ef2b333fe..ab26e82b0d4 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -163,6 +163,9 @@ DECLARE_SOA_TABLE(HfOmegaStGen, "AOD", "HFOMEGACSTGEN", } // namespace o2::aod struct HfTreeCreatorOmegacSt { + Produces outputTable; + Produces outputTableGen; + Configurable materialCorrectionType{"materialCorrectionType", static_cast(o2::base::Propagator::MatCorrType::USEMatCorrLUT), "Type of material correction"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpMagPath{"grpMagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; @@ -191,14 +194,9 @@ struct HfTreeCreatorOmegacSt { Configurable maxNSigmaPion{"maxNSigmaPion", 5., "Max Nsigma for pion to be paired with Omega"}; Configurable bzOnly{"bzOnly", true, "Use B_z instead of full field map"}; - Produces outputTable; - Produces outputTableGen; Service ccdb; o2::vertexing::DCAFitterN<2> df2; - Filter collisionFilter = (filterCollisions.node() == 0) || - (filterCollisions.node() == 8 && o2::aod::evsel::sel8 == true); - float bz = 0.; int runNumber{0}; @@ -206,6 +204,9 @@ struct HfTreeCreatorOmegacSt { using TracksExt = soa::Join; using TracksExtMc = soa::Join; + Filter collisionFilter = (filterCollisions.node() == 0) || + (filterCollisions.node() == 8 && o2::aod::evsel::sel8 == true); + HistogramRegistry registry{ "registry", { @@ -234,6 +235,13 @@ struct HfTreeCreatorOmegacSt { void init(InitContext const&) { + df2.setPropagateToPCA(propToDCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCA); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -243,13 +251,6 @@ struct HfTreeCreatorOmegacSt { auto* lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get("GLO/Param/MatLUT")); o2::base::Propagator::Instance(true)->setMatLUT(lut); } - - df2.setPropagateToPCA(propToDCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); } // processMC: loop over MC objects From cbb543e61ec04927e89e7a1ce69b0e56dd12d341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 22 Feb 2024 13:41:05 +0100 Subject: [PATCH 16/16] Remove empty lines --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 1 - PWGHF/TableProducer/candidateCreatorCascade.cxx | 1 - 2 files changed, 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 0af39469cbc..679beb78017 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -116,7 +116,6 @@ struct HfCandidateCreator3Prong { aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - // loop over triplets of track indices for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 076f970f4ee..96735fa9838 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -114,7 +114,6 @@ struct HfCandidateCreatorCascade { aod::TracksWCov const&, aod::BCsWithTimestamps const&) { - // loop over pairs of track indices for (const auto& casc : rowsTrackIndexCasc) {