1+ // Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+ // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+ // All rights not expressly granted are reserved.
4+ //
5+ // This software is distributed under the terms of the GNU General Public
6+ // License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+ //
8+ // In applying this license CERN does not waive the privileges and immunities
9+ // granted to it by virtue of its status as an Intergovernmental Organization
10+ // or submit itself to any jurisdiction.
11+
112///////////////////////////////////////////////////////////////////////////
213// Macro to perform a template fit on 1D histograms of projected correlations on delta phi
314//
@@ -65,8 +76,8 @@ void doTemplate(
6576 // get the histograms projected to delta phi,
6677 // we need to distinguish histogram with desired (high) multiplicity
6778 // from a histogram with low multiplicity used as the peripheral baseline
68- hminuit = ( TH1D * ) inFile -> Get (Form ("proj_dphi_ref_%d" , iMult ))-> Clone ("hminuit" );
69- hminuit_periph = ( TH1D * ) inFile -> Get ("proj_dphi_ref_0" )-> Clone ("hminuit_periph" );
79+ hminuit = reinterpret_cast < TH1D * > ( inFile -> Get (Form ("proj_dphi_ref_%d" , iMult ))-> Clone ("hminuit" ) );
80+ hminuit_periph = reinterpret_cast < TH1D * > ( inFile -> Get ("proj_dphi_ref_0" )-> Clone ("hminuit_periph" ) );
7081
7182 // do the template fit
7283 double par [4 ], parerr [4 ];
@@ -82,10 +93,10 @@ void doTemplate(
8293 // F*Y_peripheral(deltaphi) + Y_ridge = template fit
8394 TF1 * fTemplate = new TF1 ("fTemplate" , templateFitFunction , -0.5 * TMath ::Pi () + 1e-6 , 1.5 * TMath ::Pi () - 1e-6 , 4 );
8495 fTemplate -> SetParameters (par ); // set the parameters obtained from template fit above using tempMinuit()
85- //fTemplate->SetLineStyle(kSolid);
86- //fTemplate->SetLineColor(kBlue+1);
96+ // fTemplate->SetLineStyle(kSolid);
97+ // fTemplate->SetLineColor(kBlue+1);
8798
88- TH1F * hTemplate = ( TH1F * ) hminuit -> Clone ();
99+ TH1F * hTemplate = reinterpret_cast < TH1F * > ( hminuit -> Clone () );
89100 hTemplate -> Reset ();
90101 for (int iBin = 1 ; iBin < hTemplate -> GetNbinsX () + 1 ; iBin ++ ) {
91102 hTemplate -> SetBinContent (iBin , fTemplate -> Eval (hTemplate -> GetBinCenter (iBin )));
@@ -131,7 +142,7 @@ void doTemplate(
131142 fPeripheral -> SetLineWidth (3 );
132143 fPeripheral -> SetLineColor (kGreen + 2 );
133144
134- TH1F * hPeripheral = ( TH1F * ) hminuit -> Clone ();
145+ TH1F * hPeripheral = reinterpret_cast < TH1F * > ( hminuit -> Clone () );
135146 hPeripheral -> Reset ();
136147 for (int iBin = 1 ; iBin < hPeripheral -> GetNbinsX () + 1 ; iBin ++ ) {
137148 hPeripheral -> SetBinContent (iBin , fPeripheral -> Eval (hPeripheral -> GetBinCenter (iBin )));
@@ -184,7 +195,7 @@ void doTemplate(
184195 latex -> DrawLatex (0.3 , 0.93 , "pp #sqrt{s} = 13 TeV" );
185196 latex -> DrawLatex (0.3 , 0.86 , Form ("%.1f < p_{T, trig, assoc} < %.1f" , binspTref [0 ], binspTref [1 ]));
186197 latex -> DrawLatex (0.3 , 0.79 , Form ("%.1f < N_{ch} < %.1f" , binsMult [iMult ], binsMult [iMult + 1 ]));
187- //latex->DrawLatex(0.3,0.72,Form("%.1f < #Delta#eta < %.1f",etaMin,etaMax));
198+ // latex->DrawLatex(0.3,0.72,Form("%.1f < #Delta#eta < %.1f",etaMin,etaMax));
188199
189200 if (savePlots )
190201 cTemplate -> SaveAs (Form ("%s/template_ref_%d.png" , outputPlotsName , iMult ));
@@ -199,8 +210,8 @@ void doTemplate(
199210 // get the histograms projected to delta phi,
200211 // we need to distinguish histogram with desired (high) multiplicity
201212 // from a histogram with low multiplicity used as the peripheral baseline
202- hminuit = ( TH1D * ) inFile -> Get (Form ("proj_dphi_%d_0_%d" , ipTtrig , iMult ))-> Clone ("hminuit" );
203- hminuit_periph = ( TH1D * ) inFile -> Get (Form ("proj_dphi_%d_0_0" , ipTtrig ))-> Clone ("hminuit_periph" );
213+ hminuit = reinterpret_cast < TH1D * > ( inFile -> Get (Form ("proj_dphi_%d_0_%d" , ipTtrig , iMult ))-> Clone ("hminuit" ) );
214+ hminuit_periph = reinterpret_cast < TH1D * > ( inFile -> Get (Form ("proj_dphi_%d_0_0" , ipTtrig ))-> Clone ("hminuit_periph" ) );
204215
205216 // do the template fit
206217 double par [4 ], parerr [4 ];
@@ -219,7 +230,7 @@ void doTemplate(
219230 fTemplate -> SetLineStyle (kSolid );
220231 fTemplate -> SetLineColor (kRed );
221232
222- TH1F * hTemplate = ( TH1F * ) hminuit -> Clone ();
233+ TH1F * hTemplate = reinterpret_cast < TH1F * > ( hminuit -> Clone () );
223234 hTemplate -> Reset ();
224235 for (int iBin = 1 ; iBin < hTemplate -> GetNbinsX () + 1 ; iBin ++ ) {
225236 hTemplate -> SetBinContent (iBin , fTemplate -> Eval (hTemplate -> GetBinCenter (iBin )));
@@ -247,7 +258,7 @@ void doTemplate(
247258 fPeripheral -> SetLineStyle (kSolid );
248259 fPeripheral -> SetLineColor (kMagenta );
249260
250- TH1F * hPeripheral = ( TH1F * ) hminuit -> Clone ();
261+ TH1F * hPeripheral = reinterpret_cast < TH1F * > ( hminuit -> Clone () );
251262 hPeripheral -> Reset ();
252263 for (int iBin = 1 ; iBin < hPeripheral -> GetNbinsX () + 1 ; iBin ++ ) {
253264 hPeripheral -> SetBinContent (iBin , fPeripheral -> Eval (hPeripheral -> GetBinCenter (iBin )));
@@ -297,7 +308,7 @@ void doTemplate(
297308 latex -> DrawLatex (0.3 , 0.93 , "pp #sqrt{s} = 13 TeV" );
298309 latex -> DrawLatex (0.3 , 0.86 , Form ("%.1f < p_{T, trig} < %.1f" , binspTtrig [ipTtrig ], binspTtrig [ipTtrig + 1 ]));
299310 latex -> DrawLatex (0.3 , 0.79 , Form ("%.1f < N_{ch} < %.1f" , binsMult [iMult ], binsMult [iMult + 1 ]));
300- //latex->DrawLatex(0.3,0.72,Form("%.1f < #Delta#eta < %.1f",etaMin,etaMax));
311+ // latex->DrawLatex(0.3,0.72,Form("%.1f < #Delta#eta < %.1f",etaMin,etaMax));
301312
302313 if (savePlots )
303314 cTemplate -> SaveAs (Form ("%s/template_%d_%d.png" , outputPlotsName , ipTtrig , iMult ));
@@ -340,8 +351,8 @@ double templateFitFunction(double* x, double* par)
340351///////////////////////////////////////////////////////////////////////////
341352void minuitFunction (int & npar , double * gin , double & ff , double * par , int iflag )
342353{
343- TH1D * h = ( TH1D * ) hminuit -> Clone ("h" );
344- TH1D * hperi = ( TH1D * ) hminuit_periph -> Clone ("hperi" );
354+ TH1D * h = reinterpret_cast < TH1D * > ( hminuit -> Clone ("h" ) );
355+ TH1D * hperi = reinterpret_cast < TH1D * > ( hminuit_periph -> Clone ("hperi" ) );
345356
346357 double f = par [0 ];
347358 double gv = par [1 ];
0 commit comments