Skip to content

Commit bd8dd6b

Browse files
committed
Fix Megalinter cpplint C-style casts in CorrelationContainer
1 parent f76c37d commit bd8dd6b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎PWGCF/Core/CorrelationContainer.cxx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ void CorrelationContainer::getHistsZVtxMult(CorrelationContainer::CFStep step, F
427427

428428
Int_t dimensions[] = {4, 0, 5, 3};
429429
THnBase* tmpTrackHist = sparse->ProjectionND(4, dimensions, "E");
430-
*eventHist = (TH2*)mTriggerHist->getTHn(step)->Projection(1, 2); // NOTE the syntax is Projection(Y, X) --> produces a histogram where x = axis 2 (vertex) and y = axis 1 (multiplicity)
430+
*eventHist = static_cast<TH2*>(mTriggerHist->getTHn(step)->Projection(1, 2)); // NOTE the syntax is Projection(Y, X) --> produces a histogram where x = axis 2 (vertex) and y = axis 1 (multiplicity)
431431
// convert to THn
432432
*trackHist = changeToThn(tmpTrackHist);
433433
delete tmpTrackHist;
@@ -732,7 +732,7 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
732732
*/
733733

734734
if (!totalTracks) {
735-
totalTracks = (TH2*)tracksSame->Clone("totalTracks");
735+
totalTracks = static_cast<TH2*>(tracksSame->Clone("totalTracks"));
736736
} else {
737737
totalTracks->Add(tracksSame);
738738
}
@@ -840,7 +840,7 @@ THnBase* CorrelationContainer::getTrackEfficiencyND(EfficiencyStep step1, Effici
840840
resetBinLimits(sourceContainer->getTHn(step1));
841841
resetBinLimits(sourceContainer->getTHn(step2));
842842

843-
THnBase* clone = (THnBase*)measured->Clone();
843+
THnBase* clone = static_cast<THnBase*>(measured->Clone());
844844

845845
clone->Divide(measured, generated, 1, 1, "B");
846846

@@ -1014,7 +1014,7 @@ TH1* CorrelationContainer::getTrackEfficiency(EfficiencyStep step1, EfficiencySt
10141014
measured = new TH2D(Form("%s_rebinned", tmp->GetName()), tmp->GetTitle(), axis->GetNbins(), axis->GetXbins()->GetArray(), tmp->GetNbinsY(), tmp->GetYaxis()->GetXbins()->GetArray());
10151015
for (Int_t x = 1; x <= tmp->GetNbinsX(); x++) {
10161016
for (Int_t y = 1; y <= tmp->GetNbinsY(); y++) {
1017-
((TH2*)measured)->Fill(tmp->GetXaxis()->GetBinCenter(x), tmp->GetYaxis()->GetBinCenter(y), tmp->GetBinContent(x, y));
1017+
static_cast<TH2*>(measured)->Fill(tmp->GetXaxis()->GetBinCenter(x), tmp->GetYaxis()->GetBinCenter(y), tmp->GetBinContent(x, y));
10181018
measured->SetBinError(x, y, 0); // cannot trust bin error, set to 0
10191019
}
10201020
}
@@ -1024,7 +1024,7 @@ TH1* CorrelationContainer::getTrackEfficiency(EfficiencyStep step1, EfficiencySt
10241024
generated = new TH2D(Form("%s_rebinned", tmp->GetName()), tmp->GetTitle(), axis->GetNbins(), axis->GetXbins()->GetArray(), tmp->GetNbinsY(), tmp->GetYaxis()->GetXbins()->GetArray());
10251025
for (Int_t x = 1; x <= tmp->GetNbinsX(); x++) {
10261026
for (Int_t y = 1; y <= tmp->GetNbinsY(); y++) {
1027-
((TH2*)generated)->Fill(tmp->GetXaxis()->GetBinCenter(x), tmp->GetYaxis()->GetBinCenter(y), tmp->GetBinContent(x, y));
1027+
static_cast<TH2*>(generated)->Fill(tmp->GetXaxis()->GetBinCenter(x), tmp->GetYaxis()->GetBinCenter(y), tmp->GetBinContent(x, y));
10281028
generated->SetBinError(x, y, 0); // cannot trust bin error, set to 0
10291029
}
10301030
}
@@ -1174,14 +1174,14 @@ TH1* CorrelationContainer::getBias(EfficiencyStep step1, EfficiencyStep step2, c
11741174
resetBinLimits(mTriggerHist->getTHn(step2), 3);
11751175
setBinLimits(tmp->getTHn(step2));
11761176

1177-
TH1D* events1 = (TH1D*)mTriggerHist->getTHn(step1)->Projection(0);
1178-
TH3D* hist1 = (TH3D*)tmp->getTHn(step1)->Projection(0, tmp->getNVar() - 1, 2);
1177+
TH1D* events1 = static_cast<TH1D*>(mTriggerHist->getTHn(step1)->Projection(0));
1178+
TH3D* hist1 = static_cast<TH3D*>(tmp->getTHn(step1)->Projection(0, tmp->getNVar() - 1, 2));
11791179
if (weighting == 0) {
11801180
weightHistogram(hist1, events1);
11811181
}
11821182

1183-
TH1D* events2 = (TH1D*)mTriggerHist->getTHn(step2)->Projection(0);
1184-
TH3D* hist2 = (TH3D*)tmp->getTHn(step2)->Projection(0, tmp->getNVar() - 1, 2);
1183+
TH1D* events2 = static_cast<TH1D*>(mTriggerHist->getTHn(step2)->Projection(0));
1184+
TH3D* hist2 = static_cast<TH3D*>(tmp->getTHn(step2)->Projection(0, tmp->getNVar() - 1, 2));
11851185
if (weighting == 0) {
11861186
weightHistogram(hist2, events2);
11871187
}
@@ -1434,7 +1434,7 @@ void CorrelationContainer::symmetrizepTBins()
14341434
}
14351435

14361436
// for symmetric bins
1437-
THnBase* source = (THnBase*)target->Clone();
1437+
THnBase* source = static_cast<THnBase*>(target->Clone());
14381438

14391439
// axes: 0 delta eta; 1 pT,a; 2 pT,t; 3 centrality; 4 delta phi; 5 vtx-z
14401440
for (Int_t i3 = 1; i3 <= target->GetAxis(3)->GetNbins(); i3++) {

0 commit comments

Comments
 (0)