Skip to content

Commit 5bae3af

Browse files
committed
Fix initialisations
1 parent 405f508 commit 5bae3af

14 files changed

+25
-25
lines changed

PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct HfCandidateCreatorB0Reduced {
210210
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaBachPion);
211211

212212
// get uncertainty of the decay length
213-
float phi, theta;
213+
float phi{}, theta{};
214214
// getPointDirection modifies phi and theta
215215
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB0, phi, theta);
216216
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
@@ -314,7 +314,7 @@ struct HfCandidateCreatorB0Reduced {
314314
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);
315315

316316
// get uncertainty of the decay length
317-
float phi, theta;
317+
float phi{}, theta{};
318318
// getPointDirection modifies phi and theta
319319
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB0, phi, theta);
320320
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));

PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ struct HfCandidateCreatorBsReduced {
184184
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);
185185

186186
// get uncertainty of the decay length
187-
float phi, theta;
187+
float phi{}, theta{};
188188
// getPointDirection modifies phi and theta
189189
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexB, phi, theta);
190190
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));

PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ struct HfCandidateCreatorCharmResoReduced {
450450
registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt());
451451
}
452452
} else if constexpr (DType == DMesonType::Dstar) {
453-
float invMassD0;
453+
float invMassD0{};
454454
if (candD.sign() > 0) {
455455
invMassD = candD.invMassDstar();
456456
invMassD0 = candD.invMassD0();

PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ struct HfCandidateCreatorLbReduced {
204204
trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion);
205205

206206
// get uncertainty of the decay length
207-
float phi, theta;
207+
float phi{}, theta{};
208208
// getPointDirection modifies phi and theta
209209
getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexLb, phi, theta);
210210
auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));

PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct HfTaskCorrelationDplusHadrons {
148148
Configurable<int64_t> timestampCcdb{"timestampCcdb", -1, "timestamp of the efficiency files used to query in CCDB"};
149149
Configurable<int64_t> ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
150150

151-
Service<ccdb::BasicCCDBManager> ccdb;
151+
Service<ccdb::BasicCCDBManager> ccdb{};
152152
std::shared_ptr<TH1> mEfficiencyPrompt = nullptr;
153153
std::shared_ptr<TH1> mEfficiencyFD = nullptr;
154154
std::shared_ptr<TH1> mEfficiencyAssociated = nullptr;

PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct HfTaskCorrelationDsHadrons {
158158

159159
SliceCache cache;
160160

161-
Service<ccdb::BasicCCDBManager> ccdb;
161+
Service<ccdb::BasicCCDBManager> ccdb{};
162162

163163
using DsHadronPair = soa::Filtered<soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo>>;
164164
using DsHadronPairFull = soa::Filtered<soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronGenInfo>>;

PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct HfTaskCorrelationLcHadrons {
163163
std::shared_ptr<TH1> mEfficiencyFD = nullptr;
164164
std::shared_ptr<TH1> mEfficiencyAssociated = nullptr;
165165

166-
Service<ccdb::BasicCCDBManager> ccdb;
166+
Service<ccdb::BasicCCDBManager> ccdb{};
167167

168168
enum CandidateStep { kCandidateStepMcGenAll = 0,
169169
kCandidateStepMcGenLcToPKPi,

PWGHF/HFC/Tasks/taskFlow.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ struct HfTaskFlow {
758758
{
759759
int const cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43};
760760
bool const isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft);
761-
float offsetX, offsetY;
761+
float offsetX{}, offsetY{};
762762
if (isChnoInLeft) {
763763
offsetX = (*offsetFV0)[0].getX();
764764
offsetY = (*offsetFV0)[0].getY();
@@ -797,7 +797,7 @@ struct HfTaskFlow {
797797
{
798798
int const cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43};
799799
bool const isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft);
800-
float offsetX, offsetY, offsetZ;
800+
float offsetX{}, offsetY{}, offsetZ{};
801801
if (isChnoInLeft) {
802802
offsetX = (*offsetFV0)[0].getX();
803803
offsetY = (*offsetFV0)[0].getY();
@@ -1109,7 +1109,7 @@ struct HfTaskFlow {
11091109
bool bIsBelow = false;
11101110

11111111
if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) {
1112-
for (double rad(configCentral.minMergingRadius); rad < configCentral.maxMergingRadius; rad += 0.01) {
1112+
for (double rad(configCentral.minMergingRadius); rad < configCentral.maxMergingRadius; rad += 0.01) { // FIXME: Variable 'rad' with floating point type 'double' should not be used as a loop counter.
11131113
double dPhiStar = getDPhiStar(track1, track2, rad, magneticField);
11141114
if (std::abs(dPhiStar) < kLimit) {
11151115
bIsBelow = true;

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct HfTaskElectronWeakBoson {
166166
// pp
167167
// using TrackEle = o2::soa::Filtered<o2::soa::Join<o2::aod::Tracks, o2::aod::FullTracks, o2::aod::TracksDCA, o2::aod::TrackSelection, o2::aod::pidTPCEl, o2::aod::pidTOFEl>>;
168168

169-
Filter eventFilter = (applySel8 ? (o2::aod::evsel::sel8 == true) : (o2::aod::evsel::sel8 == o2::aod::evsel::sel8));
169+
Filter eventFilter = (applySel8 ? (o2::aod::evsel::sel8 == true) : (o2::aod::evsel::sel8 == o2::aod::evsel::sel8)); // FIXME: both sides of overloaded operator are equivalent
170170
Filter posZFilter = (nabs(o2::aod::collision::posZ) < vtxZ);
171171

172172
Filter etafilter = (aod::track::eta < etaTrMax) && (aod::track::eta > etaTrMin);
@@ -442,7 +442,7 @@ struct HfTaskElectronWeakBoson {
442442
if (chiSqNdf > chiSqNdfMax) {
443443
continue;
444444
}
445-
float massZee, massZeeErr;
445+
float massZee{}, massZeeErr{};
446446
zeeKF.GetMass(massZee, massZeeErr);
447447
registry.fill(HIST("hKfInvMassZee"), centrality, track.sign() * charge, kfpIsoEle.GetPt(), massZee);
448448
// LOG(info) << "Invarimass cal by KF particle mass = " << massZee;

PWGHF/HFL/Tasks/taskSingleElectron.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ struct HfTaskSingleElectron {
515515
histos.fill(HIST("tofNSigPt"), track.pt(), track.tofNSigmaEl());
516516
histos.fill(HIST("tpcNSigPt"), track.pt(), track.tpcNSigmaEl());
517517

518-
int mpdg; // electron source pdg code
519-
double mpt; // electron source pt
518+
int mpdg{}; // electron source pdg code
519+
double mpt{}; // electron source pt
520520
int const source = getElecSource(track, mpt, mpdg);
521521

522522
if (source == DirectBeauty || source == BeautyCharm) {

0 commit comments

Comments
 (0)