Skip to content

Commit 81e6647

Browse files
committed
Fix initialisations. Remove alias masses.
1 parent 2748ad4 commit 81e6647

20 files changed

+42
-51
lines changed

PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct HfDataCreatorCharmHadPiReduced {
214214
int runNumber{};
215215

216216
// O2DatabasePDG service
217-
Service<o2::framework::O2DatabasePDG> pdg;
217+
Service<o2::framework::O2DatabasePDG> pdg{};
218218

219219
double massC{0.};
220220
double massB{0.};

PWGHF/D2H/TableProducer/dataCreatorCharmResoToD0Reduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct HfDataCreatorCharmResoToD0Reduced {
111111
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
112112

113113
// O2DatabasePDG service
114-
Service<o2::framework::O2DatabasePDG> pdg;
114+
Service<o2::framework::O2DatabasePDG> pdg{};
115115

116116
// vertex fitter
117117
o2::vertexing::DCAFitterN<2> fitter;

PWGHF/D2H/TableProducer/dataCreatorCharmResoToDplusReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct HfDataCreatorCharmResoToDplusReduced {
111111
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
112112

113113
// O2DatabasePDG service
114-
Service<o2::framework::O2DatabasePDG> pdg;
114+
Service<o2::framework::O2DatabasePDG> pdg{};
115115

116116
// vertex fitter
117117
o2::vertexing::DCAFitterN<2> fitter;

PWGHF/D2H/TableProducer/dataCreatorCharmResoToDstarReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct HfDataCreatorCharmResoToDstarReduced {
110110
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
111111

112112
// O2DatabasePDG service
113-
Service<o2::framework::O2DatabasePDG> pdg;
113+
Service<o2::framework::O2DatabasePDG> pdg{};
114114

115115
// vertex fitter
116116
o2::vertexing::DCAFitterN<2> fitter;

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct HfDataCreatorJpsiHadReduced {
194194
// CCDB service
195195
Service<o2::ccdb::BasicCCDBManager> ccdb{};
196196
// O2DatabasePDG service
197-
Service<o2::framework::O2DatabasePDG> pdg;
197+
Service<o2::framework::O2DatabasePDG> pdg{};
198198

199199
using TracksPid = soa::Join<aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullEl, aod::pidTOFFullEl>;
200200
using TracksPidWithSel = soa::Join<aod::TracksWCovDcaExtra, TracksPid, aod::TrackSelection>;

PWGHF/D2H/Tasks/taskB0.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct HfTaskB0 {
6464
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};
6565

6666
// O2DatabasePDG service
67-
Service<o2::framework::O2DatabasePDG> pdg;
67+
Service<o2::framework::O2DatabasePDG> pdg{};
6868

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

PWGHF/D2H/Tasks/taskBplus.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct HfTaskBplus {
7070
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_bplus_to_d0_pi::vecBinsPt}, "pT bin limits"};
7171

7272
// O2DatabasePDG service
73-
Service<o2::framework::O2DatabasePDG> pdg;
73+
Service<o2::framework::O2DatabasePDG> pdg{};
7474

7575
Partition<soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi>> selectedBPlusCandidates = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= selectionFlagBplus;
7676
Partition<soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi, aod::HfCandBplusMcRec>> selectedBPlusCandidatesMC = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= selectionFlagBplus;

PWGHF/D2H/Tasks/taskBs.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct HfTaskBs {
6464
// MC checks
6565
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};
6666

67-
Service<o2::framework::O2DatabasePDG> pdg;
67+
Service<o2::framework::O2DatabasePDG> pdg{};
6868

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

PWGHF/D2H/Tasks/taskCharmPolarisation.cxx

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ using namespace o2;
6565
using namespace o2::aod;
6666
using namespace o2::framework;
6767
using namespace o2::framework::expressions;
68+
using namespace o2::constants::physics;
6869
using namespace o2::hf_centrality;
6970
using namespace o2::hf_evsel;
7071
using namespace o2::analysis::hf_flow_utils;
@@ -99,7 +100,7 @@ enum QvecEstimator : uint8_t {
99100
};
100101

101102
/// columns for table to study the Lc->PKPi background
102-
DECLARE_SOA_COLUMN(MassLc, massLc, float);
103+
DECLARE_SOA_COLUMN(MassLc, MassLambdaCPlus, float);
103104
DECLARE_SOA_COLUMN(PtLc, ptLc, float);
104105
DECLARE_SOA_COLUMN(RapidityLc, rapidityLc, float);
105106
DECLARE_SOA_COLUMN(CosThetaStar, cosThetaStar, float);
@@ -144,11 +145,6 @@ DECLARE_SOA_TABLE(HfLcPolBkg, "AOD", "HFLCPOLBKG",
144145
struct HfTaskCharmPolarisation {
145146
Produces<o2::aod::HfLcPolBkg> rowCandLcBkg;
146147

147-
float massPi{0.f};
148-
float massProton{0.f};
149-
float massKaon{0.f};
150-
float massDstar{0.f};
151-
float massLc{0.f};
152148
float bkgRotationAngleStep{0.f};
153149

154150
uint8_t nMassHypos{0u};
@@ -328,11 +324,6 @@ struct HfTaskCharmPolarisation {
328324
LOGP(fatal, "No background rotation supported for MC.");
329325
}
330326

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

338329
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
@@ -1438,8 +1429,8 @@ struct HfTaskCharmPolarisation {
14381429
template <charm_polarisation::DecayChannel Channel>
14391430
bool isInSignalRegion(float invMass)
14401431
{
1441-
float invMassMin;
1442-
float invMassMax;
1432+
float invMassMin{0.f};
1433+
float invMassMax{0.f};
14431434
if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+
14441435
invMassMin = 0.142f;
14451436
invMassMax = 0.15f;
@@ -1600,7 +1591,7 @@ struct HfTaskCharmPolarisation {
16001591
// Dstar analysis
16011592
// polarization measured from the soft-pion daughter (*)
16021593

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

16061597
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
@@ -1615,13 +1606,13 @@ struct HfTaskCharmPolarisation {
16151606
pyCharmHad = threeVecSoftPi[1] + threeVecD0Prong0[1] + threeVecD0Prong1[1];
16161607
pzCharmHad = threeVecSoftPi[2] + threeVecD0Prong0[2] + threeVecD0Prong1[2];
16171608
if (candidate.signSoftPi() > 0) {
1618-
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{massPi, massKaon, massPi});
1619-
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{massPi, massKaon});
1609+
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{MassPiPlus, MassKaonCharged, MassPiPlus});
1610+
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{MassPiPlus, MassKaonCharged});
16201611
} else {
1621-
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{massKaon, massPi, massPi});
1622-
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{massKaon, massPi});
1612+
invMassCharmHad = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1, threeVecSoftPi}, std::array{MassKaonCharged, MassPiPlus, MassPiPlus});
1613+
invMassD0 = RecoDecay::m(std::array{threeVecD0Prong0, threeVecD0Prong1}, std::array{MassKaonCharged, MassPiPlus});
16231614
}
1624-
rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, massDstar);
1615+
rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, MassDStar);
16251616
} else {
16261617
isRotatedCandidate = 0;
16271618
pxDau = candidate.pxSoftPi();
@@ -1637,7 +1628,7 @@ struct HfTaskCharmPolarisation {
16371628
invMassCharmHad = candidate.invMassAntiDstar();
16381629
invMassD0 = candidate.invMassD0Bar();
16391630
}
1640-
rapidity = candidate.y(massDstar);
1631+
rapidity = candidate.y(MassDStar);
16411632
}
16421633
invMassCharmHadForSparse = invMassCharmHad - invMassD0;
16431634

@@ -1677,8 +1668,8 @@ struct HfTaskCharmPolarisation {
16771668
pyCharmHad = candidate.py();
16781669
pzCharmHad = candidate.pz();
16791670
}
1680-
massDau = massProton; // (*)
1681-
rapidity = RecoDecay::y(candidate.pVector(), massLc);
1671+
massDau = MassProton; // (*)
1672+
rapidity = RecoDecay::y(candidate.pVector(), MassLambdaCPlus);
16821673

16831674
/// mass-hypothesis-dependent variables
16841675
float invMassPiKPi = 0.f; // bkg. from D+ -> K+pi-pi-
@@ -1691,7 +1682,7 @@ struct HfTaskCharmPolarisation {
16911682
pzDau = candidate.pzProng0();
16921683
if (bkgRotationId) {
16931684
/// rotational background - pt of the kaon track rotated
1694-
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{massProton, massKaon, massPi});
1685+
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{MassProton, MassKaonCharged, MassPiPlus});
16951686
invMassCharmHadForSparse = invMassCharmHad;
16961687
} else {
16971688
/// original candidate (kaon track not rotated)
@@ -1725,7 +1716,7 @@ struct HfTaskCharmPolarisation {
17251716
pzDau = candidate.pzProng2();
17261717
if (bkgRotationId) {
17271718
/// rotational background - pt of the kaon track rotated
1728-
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{massPi, massKaon, massProton});
1719+
invMassCharmHad = RecoDecay::m(std::array{threeVecLcProng0, threeVecLcRotatedProng1, threeVecLcProng2}, std::array{MassPiPlus, MassKaonCharged, MassProton});
17291720
invMassCharmHadForSparse = invMassCharmHad;
17301721
} else {
17311722
/// original candidate (kaon track not rotated)
@@ -2107,8 +2098,8 @@ struct HfTaskCharmPolarisation {
21072098

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

21232114
/// electric charge from PDG code
21242115
int const pdgCode = mcParticle.pdgCode();

PWGHF/D2H/Tasks/taskD0.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ struct HfTaskD0 {
404404
continue;
405405
}
406406

407-
float massD0, massD0bar;
407+
float massD0{0.f}, massD0bar{0.f};
408408
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
409409
massD0 = candidate.kfGeoMassD0();
410410
massD0bar = candidate.kfGeoMassD0bar();
@@ -770,7 +770,7 @@ struct HfTaskD0 {
770770
auto bc = collision.template foundBC_as<BCsType>();
771771
ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true) * 1.e-3; // kHz
772772
}
773-
float massD0, massD0bar;
773+
float massD0{0.f}, massD0bar{0.f};
774774
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
775775
massD0 = candidate.kfGeoMassD0();
776776
massD0bar = candidate.kfGeoMassD0bar();

0 commit comments

Comments
 (0)