Skip to content

Commit f668ad6

Browse files
author
Preet Pati
committed
Fixing the clang-tidy errors
1 parent 94f97e2 commit f668ad6

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

PWGCF/TwoParticleCorrelations/Tasks/corrFit.cxx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct CorrFit {
210210
o2::ft0::Geometry ft0Det;
211211
static constexpr uint64_t Ft0IndexA = 96;
212212
std::vector<o2::detectors::AlignParam>* offsetFT0 = nullptr;
213-
std::vector<float> cstFT0RelGain{};
213+
std::vector<float> cstFT0RelGain;
214214

215215
// Corrections
216216
TH3D* mEfficiency = nullptr;
@@ -993,7 +993,7 @@ struct CorrFit {
993993
}
994994

995995
template <typename TTracks>
996-
void trackCounter(const TTracks& tracks, double& multiplicity) // function to count the number of tracks in the event and fill the histogram
996+
void trackCounter(const TTracks& tracks, int& multiplicity) // function to count the number of tracks in the event and fill the histogram
997997
{
998998
double nTracksCorrected = 0;
999999
float weightNch = 1.0f;
@@ -1155,7 +1155,7 @@ struct CorrFit {
11551155
void fillCorrelationsTPCFT0(const TTracks& tracks1, TFT0s const& ft0, float posZ, int system, int multiplicity, int corType, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
11561156
{
11571157

1158-
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
1158+
int fSampleIndex = static_cast<int>(gRandom->Uniform(0.0, cfgSampleSize));
11591159

11601160
float triggerWeight = 1.0f;
11611161
// loop over all tracks
@@ -1239,7 +1239,7 @@ struct CorrFit {
12391239
template <CorrelationContainer::CFStep step, typename TFT0s>
12401240
void fillCorrelationsFT0AFT0C(TFT0s const& ft0Col1, TFT0s const& ft0Col2, float posZ, int system, int multiplicity, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
12411241
{
1242-
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
1242+
int fSampleIndex = static_cast<int>(gRandom->Uniform(0.0, cfgSampleSize));
12431243

12441244
float triggerWeight = 1.0f;
12451245
std::size_t channelASize = ft0Col1.channelA().size();
@@ -1286,7 +1286,7 @@ struct CorrFit {
12861286
void fillCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, int multiplicity, int magneticField) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
12871287
{
12881288

1289-
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
1289+
int fSampleIndex = static_cast<int>(gRandom->Uniform(0.0, cfgSampleSize));
12901290

12911291
float triggerWeight = 1.0f;
12921292

@@ -1343,8 +1343,12 @@ struct CorrFit {
13431343

13441344
bool bIsBelow = false;
13451345

1346+
constexpr double loopIncrement = 0.01;
1347+
const int nLoops = static_cast<int>((cfgRadiusHigh - cfgRadiusLow) / loopIncrement);
1348+
13461349
if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) {
1347-
for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) {
1350+
for (int i = 0; i < nLoops; i++) {
1351+
double rad = cfgRadiusLow + i * loopIncrement;
13481352
double dPhiStar = getDPhiStar(track1, track2, rad, magneticField);
13491353
if (std::abs(dPhiStar) < kLimit) {
13501354
bIsBelow = true;
@@ -1423,7 +1427,7 @@ struct CorrFit {
14231427

14241428
fillYield(collision, tracks);
14251429

1426-
double multiplicity = tracks.size();
1430+
int multiplicity = tracks.size();
14271431

14281432
if (cfgQaCheck) {
14291433
registry.fill(HIST("Nch"), multiplicity);
@@ -1491,7 +1495,7 @@ struct CorrFit {
14911495
loadCorrection(bc.timestamp());
14921496
float eventWeight = 1.0f;
14931497

1494-
double multiplicity = tracks1.size();
1498+
int multiplicity = tracks1.size();
14951499

14961500
if (cfgStrictTrackCounter) {
14971501
trackCounter(tracks1, multiplicity);
@@ -1541,7 +1545,7 @@ struct CorrFit {
15411545

15421546
const auto& ft0 = collision.foundFT0();
15431547

1544-
double multiplicity = tracks.size();
1548+
int multiplicity = tracks.size();
15451549

15461550
if (cfgQaCheck) {
15471551
registry.fill(HIST("Nch"), multiplicity);
@@ -1607,7 +1611,7 @@ struct CorrFit {
16071611
float eventWeight = 1.0f;
16081612

16091613
const auto& ft0 = collision2.foundFT0();
1610-
double multiplicity = tracks1.size();
1614+
int multiplicity = tracks1.size();
16111615

16121616
if (cfgStrictTrackCounter) {
16131617
trackCounter(tracks1, multiplicity);
@@ -1659,7 +1663,7 @@ struct CorrFit {
16591663

16601664
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
16611665

1662-
double multiplicity = tracks.size();
1666+
int multiplicity = tracks.size();
16631667

16641668
if (cfgQaCheck) {
16651669
registry.fill(HIST("Nch"), multiplicity);
@@ -1727,7 +1731,7 @@ struct CorrFit {
17271731
const auto& ft0Col1 = collision1.foundFT0();
17281732
const auto& ft0Col2 = collision2.foundFT0();
17291733

1730-
double multiplicity = tracks1.size();
1734+
int multiplicity = tracks1.size();
17311735

17321736
if (cfgStrictTrackCounter) {
17331737
trackCounter(tracks1, multiplicity);
@@ -1771,7 +1775,7 @@ struct CorrFit {
17711775

17721776
fillYield(collision, tracks);
17731777

1774-
double multiplicity = tracks.size();
1778+
int multiplicity = tracks.size();
17751779

17761780
if (cfgQaCheck) {
17771781
registry.fill(HIST("Nch"), multiplicity);
@@ -1833,7 +1837,7 @@ struct CorrFit {
18331837

18341838
loadCorrection(bc.timestamp());
18351839

1836-
double multiplicity = tracks1.size();
1840+
int multiplicity = tracks1.size();
18371841

18381842
if (cfgStrictTrackCounter) {
18391843
trackCounter(tracks1, multiplicity);

PWGCF/TwoParticleCorrelations/Tasks/corrReso.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ struct CorrReso {
206206
o2::ft0::Geometry ft0Det;
207207
static constexpr uint64_t Ft0IndexA = 96;
208208
std::vector<o2::detectors::AlignParam>* offsetFT0 = nullptr;
209-
std::vector<float> cstFT0RelGain{};
209+
std::vector<float> cstFT0RelGain;
210210

211211
// Corrections
212212
TH3D* mEfficiency = nullptr;
@@ -1023,7 +1023,7 @@ struct CorrReso {
10231023
}
10241024

10251025
template <typename TTracks>
1026-
void trackCounter(const TTracks& tracks, double& multiplicity) // function to count the number of tracks in the event and fill the histogram
1026+
void trackCounter(const TTracks& tracks, int& multiplicity) // function to count the number of tracks in the event and fill the histogram
10271027
{
10281028
double nTracksCorrected = 0;
10291029
float weightNch = 1.0f;
@@ -1220,7 +1220,7 @@ struct CorrReso {
12201220
template <CorrelationContainer::CFStep step, typename TV0Tracks, typename TFT0s>
12211221
void fillCorrelationsTPCFT0(const TV0Tracks& tracks1, TFT0s const& ft0, float posZ, float posY, float posX, int system, int corType, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
12221222
{
1223-
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
1223+
int fSampleIndex = static_cast<int>(gRandom->Uniform(0.0, cfgSampleSize));
12241224

12251225
float triggerWeight = 1.0f;
12261226
// loop over all tracks
@@ -1358,7 +1358,7 @@ struct CorrReso {
13581358

13591359
fillYield(collision, tracks);
13601360

1361-
double multiplicity = tracks.size();
1361+
int multiplicity = tracks.size();
13621362

13631363
if (cfgQaCheck)
13641364
registry.fill(HIST("Nch"), multiplicity);
@@ -1427,7 +1427,7 @@ struct CorrReso {
14271427
loadCorrection(bc.timestamp());
14281428
float eventWeight = 1.0f;
14291429

1430-
double multiplicity = tracks1.size();
1430+
int multiplicity = tracks1.size();
14311431

14321432
if (cfgStrictTrackCounter) {
14331433
trackCounter(tracks1, multiplicity);
@@ -1480,7 +1480,7 @@ struct CorrReso {
14801480

14811481
const auto& ft0 = collision.foundFT0();
14821482

1483-
double multiplicity = tracks.size();
1483+
int multiplicity = tracks.size();
14841484

14851485
if (cfgQaCheck)
14861486
registry.fill(HIST("Nch"), multiplicity);
@@ -1547,7 +1547,7 @@ struct CorrReso {
15471547
float eventWeight = 1.0f;
15481548

15491549
const auto& ft0 = collision2.foundFT0();
1550-
double multiplicity = tracks1.size();
1550+
int multiplicity = tracks1.size();
15511551

15521552
if (cfgStrictTrackCounter) {
15531553
trackCounter(tracks1, multiplicity);

0 commit comments

Comments
 (0)