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)) { 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)) { 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 e5739190bd9..3387853b11a 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 1548321e49a..78eab6edfb5 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -72,6 +72,7 @@ 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; @@ -108,15 +109,26 @@ struct HfCandidateCreator2Prong { if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "One and only one process function must 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 + // 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); } - massPi = MassPiPlus; - massK = MassKPlus; ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -130,17 +142,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) { diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index f04bad9a5ec..99b75a01526 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -58,6 +58,7 @@ 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; @@ -89,9 +90,19 @@ struct HfCandidateCreator3Prong { if (std::accumulate(processes.begin(), processes.end(), 0) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - massPi = MassPiPlus; massK = MassKPlus; + + // 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); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -105,18 +116,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) { 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/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(); diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 32fdf419936..96735fa9838 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -60,6 +60,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; @@ -87,6 +88,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(); @@ -103,18 +114,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) { diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 0dbb66ff207..2c0c75b348b 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -111,11 +111,9 @@ struct HfCandidateCreatorDstar { LOGP(fatal, "One and only one process function must 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 - runNumber = 0; - bz = 0; + massPi = MassPiPlus; + massK = MassKPlus; + massD0 = MassD0; df.setPropagateToPCA(propagateToPCA); df.setMaxR(maxR); @@ -126,9 +124,11 @@ struct HfCandidateCreatorDstar { df.setWeightedFinalPCA(useWeightedFinalPCA); df.setMatCorrType(noMatCorr); - massPi = MassPiPlus; - massK = MassKPlus; - massD0 = MassD0; + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); // set the flag to check object validity before CCDB query + runNumber = 0; + bz = 0; } /// @brief function for secondary vertex reconstruction and candidate creator 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)) { diff --git a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx index 7132261d152..74e5013ef94 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(); 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; diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index ea2529fb996..e8b28149998 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -100,11 +100,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; @@ -401,6 +396,18 @@ 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); + 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"}; @@ -1095,12 +1102,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, @@ -1130,7 +1131,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processNoPid, "Process without PID selections", true); void processProtonPidTpc(aod::Collisions const& collisions, @@ -1162,7 +1162,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTpc, "Process with proton TPC PID selection", false); void processProtonPidTof(aod::Collisions const& collisions, @@ -1194,7 +1193,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTof, "Process with proton TOF PID selection", false); void processProtonPidTpcOrTof(aod::Collisions const& collisions, @@ -1226,7 +1224,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, @@ -1258,7 +1255,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { fillPvRefitTable(pvRefitDcaPerTrack, pvRefitPvCoordPerTrack, pvRefitPvCovMatrixPerTrack); } } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelTracks, processProtonPidTpcAndTof, "Process with proton PID selection (TPC and TOF logic)", false); }; @@ -1266,8 +1262,6 @@ struct HfTrackIndexSkimCreatorTagSelTracks { /// Pre-selection of 2-prong and 3-prong secondary vertices struct HfTrackIndexSkimCreator { - SliceCache cache; - Produces rowTrackIndexProng2; Produces rowProng2CutStatus; Produces rowProng2PVrefit; @@ -1337,6 +1331,9 @@ 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 Service ccdb; o2::base::MatLayerCylSet* lut; @@ -1435,6 +1432,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 @@ -1488,12 +1507,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 @@ -2064,28 +2077,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(); @@ -2900,7 +2893,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 @@ -2911,7 +2903,6 @@ struct HfTrackIndexSkimCreator { { run2And3Prongs(collisions, bcWithTimeStamps, trackIndices, tracks); } - PROCESS_SWITCH(HfTrackIndexSkimCreator, process2And3ProngsNoPvRefit, "Process 2-prong and 3-prong skim without PV refit", true); }; @@ -2972,6 +2963,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> df2; // 2-prong vertex fitter // Needed for PV refitting Service ccdb; o2::base::MatLayerCylSet* lut; @@ -2983,12 +2975,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; @@ -3010,6 +3002,15 @@ struct HfTrackIndexSkimCreatorCascades { massPi = o2::constants::physics::MassPiPlus; massLc = o2::constants::physics::MassLambdaCPlus; + 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); ccdb->setLocalObjectValidityChecking(); @@ -3040,18 +3041,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); + df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); // fist we loop over the bachelor candidate @@ -3148,7 +3138,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; } @@ -3156,9 +3146,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); @@ -3171,7 +3161,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]; } @@ -3189,7 +3179,6 @@ struct HfTrackIndexSkimCreatorCascades { } // loop over tracks } // loop over collisions } // processCascades - PROCESS_SWITCH(HfTrackIndexSkimCreatorCascades, processCascades, "Skim HF -> V0 cascades", false); }; @@ -3247,10 +3236,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 @@ -3266,6 +3256,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"}; @@ -3285,6 +3287,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(); @@ -3329,18 +3347,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) @@ -3400,27 +3406,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; bool isGoogForXi2Prong = true; bool isGoogForOmega2Prong = true; diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 9a11c312343..84c2674a6dc 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -164,10 +164,8 @@ DECLARE_SOA_TABLE(HfOmegaStGen, "AOD", "HFOMEGACSTGEN", } // namespace o2::aod struct HfTreeCreatorOmegacSt { - SliceCache cache; - // Preslice perCol = aod::track::collisionId; - Preslice trackIndicesPerCollision = aod::track_association::collisionId; - Preslice assignedTrackedCascadesPerCollision = aod::track::collisionId; + 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"}; @@ -197,14 +195,10 @@ 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; + SliceCache cache; 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}; @@ -212,6 +206,13 @@ struct HfTreeCreatorOmegacSt { using TracksExt = soa::Join; using TracksExtMc = soa::Join; + Filter collisionFilter = (filterCollisions.node() == 0) || + (filterCollisions.node() == 8 && o2::aod::evsel::sel8 == true); + + // Preslice perCol = aod::track::collisionId; + Preslice trackIndicesPerCollision = aod::track_association::collisionId; + Preslice assignedTrackedCascadesPerCollision = aod::track::collisionId; + HistogramRegistry registry{ "registry", { @@ -240,6 +241,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(); @@ -249,13 +257,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