Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaBachPion);

// get uncertainty of the decay length
float phi, theta;
float phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB0, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down Expand Up @@ -314,7 +314,7 @@
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);

// get uncertainty of the decay length
float phi, theta;
float phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB0, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down Expand Up @@ -365,7 +365,7 @@
auto candsDThisColl = candsD.sliceBy(candsDplusPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<false>(collision, candsDThisColl, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 368 in PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down Expand Up @@ -399,7 +399,7 @@
auto candsDThisColl = candsD.sliceBy(candsDplusPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<true>(collision, candsDThisColl, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 402 in PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down Expand Up @@ -434,7 +434,7 @@
auto candsDThisColl = candsD.sliceBy(candsDstarPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreationDStar<false>(collision, candsDThisColl, softPions, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 437 in PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down Expand Up @@ -469,7 +469,7 @@
auto candsDThisColl = candsD.sliceBy(candsDstarWithMlPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreationDStar<true>(collision, candsDThisColl, softPions, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 472 in PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct HfCandidateCreatorBToJpsiReduced {
trackParCovLf0.propagateToDCA(primaryVertex, bz, &dcaKaon);

// get uncertainty of the decay length
double phi, theta;
double phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexBplus, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down Expand Up @@ -332,7 +332,7 @@ struct HfCandidateCreatorBToJpsiReduced {
trackParCovLf1.propagateToDCA(primaryVertex, bz, &dcaTrackLf1);

// get uncertainty of the decay length
double phi, theta;
double phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexBs, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);

// get uncertainty of the decay length
double phi, theta;
double phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexBplus, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down Expand Up @@ -240,7 +240,7 @@
auto candsDThisColl = candsD.sliceBy(candsDPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<false>(collision, candsDThisColl, tracksPionThisCollision, invMass2D0PiMin, invMass2D0PiMax);
if (ncol % 10000 == 0) {

Check failure on line 243 in PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOG(debug) << ncol << " collisions parsed";
}
ncol++;
Expand Down Expand Up @@ -274,7 +274,7 @@
auto candsDThisColl = candsD.sliceBy(candsDPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<true>(collision, candsDThisColl, tracksPionThisCollision, invMass2D0PiMin, invMass2D0PiMax);
if (ncol % 10000 == 0) {

Check failure on line 277 in PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);

// get uncertainty of the decay length
float phi, theta;
float phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down Expand Up @@ -240,7 +240,7 @@
auto candsDThisColl = candsD.sliceBy(candsDPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<false>(collision, candsDThisColl, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 243 in PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down Expand Up @@ -274,7 +274,7 @@
auto candsDThisColl = candsD.sliceBy(candsDPerCollision, thisCollId);
auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId);
runCandidateCreation<true>(collision, candsDThisColl, tracksPionThisCollision, invMass2DPiMin, invMass2DPiMax);
if (ncol % 10000 == 0) {

Check failure on line 277 in PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(debug, "collisions parsed {}", ncol);
}
ncol++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ struct HfCandidateCreatorCharmResoReduced {
registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt());
}
} else if constexpr (DType == DMesonType::Dstar) {
float invMassD0;
float invMassD0{};
if (candD.sign() > 0) {
invMassD = candD.invMassDstar();
invMassD0 = candD.invMassD0();
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ struct HfCandidateCreatorLbReduced {
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);

// get uncertainty of the decay length
float phi, theta;
float phi{}, theta{};
// getPointDirection modifies phi and theta
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexLb, phi, theta);
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
Expand Down
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ struct HfDataCreatorCharmHadPiReduced {
o2::hf_evsel::HfEventSelectionMc hfEvSelMc;

// CCDB service
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};
o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
int runNumber{};

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

double massC{0.};
double massB{0.};
Expand Down
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/dataCreatorCharmResoToD0Reduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct HfDataCreatorCharmResoToD0Reduced {

// CCDB service
o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};
double bz{0.};
int runNumber{0}; // needed to detect if the run changed and trigger update of calibrations etc.

Expand All @@ -111,7 +111,7 @@ struct HfDataCreatorCharmResoToD0Reduced {
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

// vertex fitter
o2::vertexing::DCAFitterN<2> fitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct HfDataCreatorCharmResoToDplusReduced {

// CCDB service
o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};
double bz{0.};
int runNumber{0}; // needed to detect if the run changed and trigger update of calibrations etc.

Expand All @@ -111,7 +111,7 @@ struct HfDataCreatorCharmResoToDplusReduced {
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

// vertex fitter
o2::vertexing::DCAFitterN<2> fitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct HfDataCreatorCharmResoToDstarReduced {

// CCDB service
o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};
double bz{0.};
int runNumber{0}; // needed to detect if the run changed and trigger update of calibrations etc.

Expand All @@ -110,7 +110,7 @@ struct HfDataCreatorCharmResoToDstarReduced {
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

// vertex fitter
o2::vertexing::DCAFitterN<2> fitter;
Expand Down
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ struct HfDataCreatorJpsiHadReduced {
TrackSelectorEl selectorElectron;

// CCDB service
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};
// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

using TracksPid = soa::Join<aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullEl, aod::pidTOFFullEl>;
using TracksPidWithSel = soa::Join<aod::TracksWCovDcaExtra, TracksPid, aod::TrackSelection>;
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskB0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

using TracksWithSel = soa::Join<aod::Tracks, aod::TrackSelection>;

Expand Down Expand Up @@ -313,7 +313,7 @@
registry.fill(HIST("hEtaGen"), particle.eta(), ptParticle);

// generated B0 with |y|<0.5
if (std::abs(yParticle) < 0.5) {

Check failure on line 316 in PWGHF/D2H/Tasks/taskB0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hPtGenWithRapidityBelowHalf"), ptParticle);
}

Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskBplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_bplus_to_d0_pi::vecBinsPt}, "pT bin limits"};

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

Partition<soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi>> selectedBPlusCandidates = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= selectionFlagBplus;
Partition<soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi, aod::HfCandBplusMcRec>> selectedBPlusCandidatesMC = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= selectionFlagBplus;
Expand Down Expand Up @@ -300,7 +300,7 @@
registry.fill(HIST("hYGen"), yParticle, ptParticle);
registry.fill(HIST("hEtaGen"), particle.eta(), ptParticle);
// generated B0 with |y|<0.5
if (std::abs(yParticle) < 0.5) {

Check failure on line 303 in PWGHF/D2H/Tasks/taskBplus.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hPtGenWithRapidityBelowHalf"), ptParticle);
}

Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskBs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct HfTaskBs {
// MC checks
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};

Service<o2::framework::O2DatabasePDG> pdg;
Service<o2::framework::O2DatabasePDG> pdg{};

using TracksWithSel = soa::Join<aod::Tracks, aod::TrackSelection>;

Expand Down
5 changes: 5 additions & 0 deletions PWGHF/D2H/Tasks/taskCd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponseITS.h"
#include "Common/DataModel/PIDResponseTOF.h"
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/HistogramRegistry.h>
Expand All @@ -41,6 +45,7 @@

#include <array>
#include <cmath>
#include <cstdint>
#include <numeric>
#include <string>
#include <vector> // std::vector
Expand Down
47 changes: 19 additions & 28 deletions PWGHF/D2H/Tasks/taskCharmPolarisation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ using namespace o2;
using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::constants::physics;
using namespace o2::hf_centrality;
using namespace o2::hf_evsel;
using namespace o2::analysis::hf_flow_utils;
Expand Down Expand Up @@ -144,11 +145,6 @@ DECLARE_SOA_TABLE(HfLcPolBkg, "AOD", "HFLCPOLBKG",
struct HfTaskCharmPolarisation {
Produces<o2::aod::HfLcPolBkg> rowCandLcBkg;

float massPi{0.f};
float massProton{0.f};
float massKaon{0.f};
float massDstar{0.f};
float massLc{0.f};
float bkgRotationAngleStep{0.f};

uint8_t nMassHypos{0u};
Expand Down Expand Up @@ -222,7 +218,7 @@ struct HfTaskCharmPolarisation {
SliceCache cache;
EventPlaneHelper epHelper; // event plane helper
HfEventSelection hfEvSel; // event selection and monitoring
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb{};

using CollisionsWithMcLabels = soa::SmallGroups<soa::Join<aod::Collisions, aod::McCollisionLabels>>;
using CollisionsWithMcLabelsAndCent = soa::SmallGroups<soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFT0Ms, aod::CentFT0Cs>>;
Expand Down Expand Up @@ -328,11 +324,6 @@ struct HfTaskCharmPolarisation {
LOGP(fatal, "No background rotation supported for MC.");
}

massPi = o2::constants::physics::MassPiPlus;
massProton = o2::constants::physics::MassProton;
massKaon = o2::constants::physics::MassKaonCharged;
massDstar = o2::constants::physics::MassDStar;
massLc = o2::constants::physics::MassLambdaCPlus;
bkgRotationAngleStep = (nBkgRotations > 1) ? (maxRotAngleMultByPi - minRotAngleMultByPi) * constants::math::PI / (nBkgRotations - 1) : 0.;

const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
Expand Down Expand Up @@ -1438,8 +1429,8 @@ struct HfTaskCharmPolarisation {
template <charm_polarisation::DecayChannel Channel>
bool isInSignalRegion(float invMass)
{
float invMassMin;
float invMassMax;
float invMassMin{0.f};
float invMassMax{0.f};
if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+
invMassMin = 0.142f;
invMassMax = 0.15f;
Expand Down Expand Up @@ -1600,7 +1591,7 @@ struct HfTaskCharmPolarisation {
// Dstar analysis
// polarization measured from the soft-pion daughter (*)

massDau = massPi; // (*)
massDau = MassPiPlus; // (*)
const float bkgRotAngle = (bkgRotationId > 0) ? minRotAngleMultByPi * constants::math::PI + bkgRotationAngleStep * (bkgRotationId - 1) : 0;

std::array<float, 3> threeVecSoftPi{candidate.pxSoftPi() * std::cos(bkgRotAngle) - candidate.pySoftPi() * std::sin(bkgRotAngle), candidate.pxSoftPi() * std::sin(bkgRotAngle) + candidate.pySoftPi() * std::cos(bkgRotAngle), candidate.pzSoftPi()}; // we rotate the soft pion
Expand All @@ -1615,13 +1606,13 @@ struct HfTaskCharmPolarisation {
pyCharmHad = threeVecSoftPi[1] + threeVecD0Prong0[1] + threeVecD0Prong1[1];
pzCharmHad = threeVecSoftPi[2] + threeVecD0Prong0[2] + threeVecD0Prong1[2];
if (candidate.signSoftPi() > 0) {
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{massPi, massKaon, massPi});
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{massPi, massKaon});
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{MassPiPlus, MassKaonCharged, MassPiPlus});
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{MassPiPlus, MassKaonCharged});
} else {
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{massKaon, massPi, massPi});
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{massKaon, massPi});
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{MassKaonCharged, MassPiPlus, MassPiPlus});
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{MassKaonCharged, MassPiPlus});
}
rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, massDstar);
rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, MassDStar);
} else {
isRotatedCandidate = 0;
pxDau = candidate.pxSoftPi();
Expand All @@ -1637,7 +1628,7 @@ struct HfTaskCharmPolarisation {
invMassCharmHad = candidate.invMassAntiDstar();
invMassD0 = candidate.invMassD0Bar();
}
rapidity = candidate.y(massDstar);
rapidity = candidate.y(MassDStar);
}
invMassCharmHadForSparse = invMassCharmHad - invMassD0;

Expand Down Expand Up @@ -1677,8 +1668,8 @@ struct HfTaskCharmPolarisation {
pyCharmHad = candidate.py();
pzCharmHad = candidate.pz();
}
massDau = massProton; // (*)
rapidity = RecoDecay::y(candidate.pVector(), massLc);
massDau = MassProton; // (*)
rapidity = RecoDecay::y(candidate.pVector(), MassLambdaCPlus);

/// mass-hypothesis-dependent variables
float invMassPiKPi = 0.f; // bkg. from D+ -> K+pi-pi-
Expand All @@ -1691,7 +1682,7 @@ struct HfTaskCharmPolarisation {
pzDau = candidate.pzProng0();
if (bkgRotationId) {
/// rotational background - pt of the kaon track rotated
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{massProton, massKaon, massPi});
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{MassProton, MassKaonCharged, MassPiPlus});
invMassCharmHadForSparse = invMassCharmHad;
} else {
/// original candidate (kaon track not rotated)
Expand Down Expand Up @@ -1725,7 +1716,7 @@ struct HfTaskCharmPolarisation {
pzDau = candidate.pzProng2();
if (bkgRotationId) {
/// rotational background - pt of the kaon track rotated
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{massPi, massKaon, massProton});
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{MassPiPlus, MassKaonCharged, MassProton});
invMassCharmHadForSparse = invMassCharmHad;
} else {
/// original candidate (kaon track not rotated)
Expand Down Expand Up @@ -2107,8 +2098,8 @@ struct HfTaskCharmPolarisation {

std::array<int, 2> const dauPdgs = {kPiPlus, o2::constants::physics::Pdg::kD0};
RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 1);
massDau = massPi;
massCharmHad = massDstar;
massDau = MassPiPlus;
massCharmHad = MassDStar;
} else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) {
if (std::abs(mcParticle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this particle is not signal, skip
return;
Expand All @@ -2117,8 +2108,8 @@ struct HfTaskCharmPolarisation {
resoChannelLc = mcParticle.flagMcDecayChanGen();
std::array<int, 3> const dauPdgs = {kProton, -kKPlus, kPiPlus};
RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 2);
massDau = massProton;
massCharmHad = massLc;
massDau = MassProton;
massCharmHad = MassLambdaCPlus;

/// electric charge from PDG code
int const pdgCode = mcParticle.pdgCode();
Expand Down
6 changes: 3 additions & 3 deletions PWGHF/D2H/Tasks/taskD0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct HfTaskD0 {
ctpRateFetcher mRateFetcher;

SliceCache cache;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};

using D0Candidates = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0>>;
using D0CandidatesMc = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfCand2ProngMcRec>>;
Expand Down Expand Up @@ -404,7 +404,7 @@ struct HfTaskD0 {
continue;
}

float massD0, massD0bar;
float massD0{0.f}, massD0bar{0.f};
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
massD0 = candidate.kfGeoMassD0();
massD0bar = candidate.kfGeoMassD0bar();
Expand Down Expand Up @@ -770,7 +770,7 @@ struct HfTaskD0 {
auto bc = collision.template foundBC_as<BCsType>();
ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true) * 1.e-3; // kHz
}
float massD0, massD0bar;
float massD0{0.f}, massD0bar{0.f};
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
massD0 = candidate.kfGeoMassD0();
massD0bar = candidate.kfGeoMassD0bar();
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct HfTaskDirectedFlowCharmHadrons {
EventPlaneHelper epHelper;
SliceCache cache;
HfEventSelection hfEvSel; // event selection and monitoring
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb{};

using CandDplusDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi>>;
using CandDplusData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskDplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct HfTaskDplus {
HfUpcGapThresholds upcThresholds; // UPC gap determination thresholds
ctpRateFetcher mRateFetcher; // interaction rate fetcher

Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};

using CandDplusData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
using CandDplusDataWithMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi>>;
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskDs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct HfTaskDs {
} ccdbConfig;

SliceCache cache;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Service<o2::ccdb::BasicCCDBManager> ccdb{};

using TH1Ptr = std::shared_ptr<TH1>;
using TH2Ptr = std::shared_ptr<TH2>;
Expand Down
Loading
Loading