@@ -155,7 +155,7 @@ CorrelationContainer::CorrelationContainer(const CorrelationContainer& c) : TNam
155155 // CorrelationContainer copy constructor
156156 //
157157
158- ((CorrelationContainer&)c) .Copy (*this );
158+ c .Copy (*this );
159159}
160160
161161// ____________________________________________________________________
@@ -195,7 +195,7 @@ CorrelationContainer& CorrelationContainer::operator=(const CorrelationContainer
195195 // assigment operator
196196
197197 if (this != &c) {
198- ((CorrelationContainer&)c) .Copy (*this );
198+ c .Copy (*this );
199199 }
200200
201201 return *this ;
@@ -206,7 +206,7 @@ void CorrelationContainer::Copy(TObject& c) const
206206{
207207 // copy function
208208
209- CorrelationContainer& target = ( CorrelationContainer&)c ;
209+ CorrelationContainer& target = dynamic_cast < CorrelationContainer&>(c) ;
210210
211211 if (mPairHist ) {
212212 target.mPairHist = dynamic_cast <StepTHn*>(mPairHist ->Clone ());
@@ -423,7 +423,7 @@ void CorrelationContainer::getHistsZVtxMult(CorrelationContainer::CFStep step, F
423423
424424 Int_t dimensions[] = {4 , 0 , 5 , 3 };
425425 THnBase* tmpTrackHist = sparse->ProjectionND (4 , dimensions, " E" );
426- *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)
426+ *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)
427427 // convert to THn
428428 *trackHist = changeToThn (tmpTrackHist);
429429 delete tmpTrackHist;
@@ -523,7 +523,7 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
523523 Int_t nCorrelationFunctions = 0 ;
524524
525525 getHistsZVtxMult (step, ptTriggerMin, ptTriggerMax, &trackSameAll, &eventSameAll);
526- mixed->getHistsZVtxMult ((stepForMixed == -1 ) ? step : ( CFStep) stepForMixed, ptTriggerMin, ptTriggerMax, &trackMixedAll, &eventMixedAll);
526+ mixed->getHistsZVtxMult ((stepForMixed == -1 ) ? step : static_cast < CFStep>( stepForMixed) , ptTriggerMin, ptTriggerMax, &trackMixedAll, &eventMixedAll);
527527
528528 // If we ask for histograms from step8 (TTR cut applied) there is a hole at 0,0; so this cannot be used for the
529529 // mixed-event normalization. If step6 is available, the normalization factor is read out from that one.
@@ -728,7 +728,7 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
728728 */
729729
730730 if (!totalTracks) {
731- totalTracks = ( TH2 *) tracksSame->Clone (" totalTracks" );
731+ totalTracks = dynamic_cast < TH2 *>( tracksSame->Clone (" totalTracks" ) );
732732 } else {
733733 totalTracks->Add (tracksSame);
734734 }
@@ -766,7 +766,7 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
766766 }
767767 }
768768 if (trigger != nullptr ) {
769- *trigger = ( Int_t) totalEvents;
769+ *trigger = static_cast < Int_t>( totalEvents) ;
770770 }
771771
772772 // normalizate to dphi width
@@ -836,7 +836,7 @@ THnBase* CorrelationContainer::getTrackEfficiencyND(EfficiencyStep step1, Effici
836836 resetBinLimits (sourceContainer->getTHn (step1));
837837 resetBinLimits (sourceContainer->getTHn (step2));
838838
839- THnBase* clone = ( THnBase*) measured->Clone ();
839+ THnBase* clone = dynamic_cast < THnBase*>( measured->Clone () );
840840
841841 clone->Divide (measured, generated, 1 , 1 , " B" );
842842
@@ -936,7 +936,7 @@ TH1* CorrelationContainer::getTrackEfficiency(EfficiencyStep step1, EfficiencySt
936936
937937 if (mPtMax > mPtMin ) {
938938 // TODO this is just checking up to 15 for now
939- Float_t ptMax = TMath::Min (( Float_t) 15 ., mPtMax );
939+ Float_t ptMax = TMath::Min (static_cast < Float_t>( 15 .) , mPtMax );
940940 if (axis1 == 1 ) {
941941 binBegin[0 ] = generated->GetXaxis ()->FindBin (mPtMin );
942942 binEnd[0 ] = generated->GetXaxis ()->FindBin (ptMax);
@@ -1010,7 +1010,7 @@ TH1* CorrelationContainer::getTrackEfficiency(EfficiencyStep step1, EfficiencySt
10101010 measured = new TH2D (Form (" %s_rebinned" , tmp->GetName ()), tmp->GetTitle (), axis->GetNbins (), axis->GetXbins ()->GetArray (), tmp->GetNbinsY (), tmp->GetYaxis ()->GetXbins ()->GetArray ());
10111011 for (Int_t x = 1 ; x <= tmp->GetNbinsX (); x++) {
10121012 for (Int_t y = 1 ; y <= tmp->GetNbinsY (); y++) {
1013- (( TH2 *) measured)->Fill (tmp->GetXaxis ()->GetBinCenter (x), tmp->GetYaxis ()->GetBinCenter (y), tmp->GetBinContent (x, y));
1013+ (dynamic_cast < TH2 *>( measured) )->Fill (tmp->GetXaxis ()->GetBinCenter (x), tmp->GetYaxis ()->GetBinCenter (y), tmp->GetBinContent (x, y));
10141014 measured->SetBinError (x, y, 0 ); // cannot trust bin error, set to 0
10151015 }
10161016 }
@@ -1020,7 +1020,7 @@ TH1* CorrelationContainer::getTrackEfficiency(EfficiencyStep step1, EfficiencySt
10201020 generated = new TH2D (Form (" %s_rebinned" , tmp->GetName ()), tmp->GetTitle (), axis->GetNbins (), axis->GetXbins ()->GetArray (), tmp->GetNbinsY (), tmp->GetYaxis ()->GetXbins ()->GetArray ());
10211021 for (Int_t x = 1 ; x <= tmp->GetNbinsX (); x++) {
10221022 for (Int_t y = 1 ; y <= tmp->GetNbinsY (); y++) {
1023- (( TH2 *) generated)->Fill (tmp->GetXaxis ()->GetBinCenter (x), tmp->GetYaxis ()->GetBinCenter (y), tmp->GetBinContent (x, y));
1023+ (dynamic_cast < TH2 *>( generated) )->Fill (tmp->GetXaxis ()->GetBinCenter (x), tmp->GetYaxis ()->GetBinCenter (y), tmp->GetBinContent (x, y));
10241024 generated->SetBinError (x, y, 0 ); // cannot trust bin error, set to 0
10251025 }
10261026 }
@@ -1170,14 +1170,14 @@ TH1* CorrelationContainer::getBias(EfficiencyStep step1, EfficiencyStep step2, c
11701170 resetBinLimits (mTriggerHist ->getTHn (step2), 3 );
11711171 setBinLimits (tmp->getTHn (step2));
11721172
1173- TH1D * events1 = ( TH1D *) mTriggerHist ->getTHn (step1)->Projection (0 );
1174- TH3D * hist1 = ( TH3D *) tmp->getTHn (step1)->Projection (0 , tmp->getNVar () - 1 , 2 );
1173+ TH1D * events1 = mTriggerHist ->getTHn (step1)->Projection (0 );
1174+ TH3D * hist1 = tmp->getTHn (step1)->Projection (0 , tmp->getNVar () - 1 , 2 );
11751175 if (weighting == 0 ) {
11761176 weightHistogram (hist1, events1);
11771177 }
11781178
1179- TH1D * events2 = ( TH1D *) mTriggerHist ->getTHn (step2)->Projection (0 );
1180- TH3D * hist2 = ( TH3D *) tmp->getTHn (step2)->Projection (0 , tmp->getNVar () - 1 , 2 );
1179+ TH1D * events2 = mTriggerHist ->getTHn (step2)->Projection (0 );
1180+ TH3D * hist2 = tmp->getTHn (step2)->Projection (0 , tmp->getNVar () - 1 , 2 );
11811181 if (weighting == 0 ) {
11821182 weightHistogram (hist2, events2);
11831183 }
@@ -1430,7 +1430,7 @@ void CorrelationContainer::symmetrizepTBins()
14301430 }
14311431
14321432 // for symmetric bins
1433- THnBase* source = ( THnBase*) target->Clone ();
1433+ THnBase* source = dynamic_cast < THnBase*>( target->Clone () );
14341434
14351435 // axes: 0 delta eta; 1 pT,a; 2 pT,t; 3 centrality; 4 delta phi; 5 vtx-z
14361436 for (Int_t i3 = 1 ; i3 <= target->GetAxis (3 )->GetNbins (); i3++) {
@@ -1573,7 +1573,7 @@ void CorrelationContainer::extendTrackingEfficiency(Bool_t verbose)
15731573 new TCanvas;
15741574 proj->DrawCopy ();
15751575 }
1576- if (( Int_t) proj->Fit (" pol0" , (verbose) ? " +" : " Q0+" , " SAME" , fitRangeBegin, fitRangeEnd) == 0 ) {
1576+ if (static_cast < Int_t>( proj->Fit (" pol0" , (verbose) ? " +" : " Q0+" , " SAME" , fitRangeBegin, fitRangeEnd) ) == 0 ) {
15771577 target[i] = proj->GetFunction (" pol0" )->GetParameter (0 );
15781578 } else {
15791579 target[i] = 0 ;
0 commit comments