8 #ifndef AliJetFlowTools_H
9 #define AliJetFlowTools_H
22 class AliAnaChargedJetResponseMaker;
28 #include "TDirectoryFile.h"
31 #include "TVirtualPad.h"
32 #include "TPaveText.h"
99 printf(Form(
" > Warning, duplicate output list, renaming %s to %s_2 ! < \n", name.Data(), name.Data()));
120 if(!
fCentralityArray) printf(
" > Warning: centrality weights set, but bins are not defined! \n");
151 fPriorUser =
new TH1D(
"prior_user",
"prior_user", bins->GetSize()-1, bins->GetArray());
161 void SetSmoothenPrior(Bool_t b, Float_t min = 50., Float_t max = 100., Float_t start= 75., Bool_t counts = kTRUE) {
192 void Make(TH1* customIn = 0x0, TH1* customOut = 0x0);
203 Float_t rangeLow = 20,
204 Float_t rangeUp = 80,
205 TString in =
"UnfoldedSpectra.root",
206 TString out =
"ProcessedSpectra.root")
const;
209 TString in =
"UnfoldedSpectra.root",
210 TString out =
"BootstrapSpectra.root")
const;
216 TString inFile =
"UnfoldedSpectra.root",
217 TString outFile =
"Nominal.root")
const;
219 TGraphAsymmErrors*& corrRatio,
220 TGraphAsymmErrors*& corrV2,
221 TArrayI* variationsIn,
222 TArrayI* variationsOut,
224 TArrayI* variantions2ndIn,
225 TArrayI* variantions2ndOut,
230 Float_t rangeLow = 20,
231 Float_t rangeUp = 80,
233 TString in =
"UnfoldedSpectra.root",
234 TString out =
"CorrelatedUncertainty.root")
const;
236 TGraphAsymmErrors*& shapeRatio,
237 TGraphAsymmErrors*& shapeV2,
238 TArrayI* regularizationIn,
239 TArrayI* regularizationOut,
240 TArrayI* recBinIn = 0x0,
241 TArrayI* recBinOut = 0x0,
242 TArrayI* methodIn = 0x0,
243 TArrayI* methodOut = 0x0,
245 Float_t rangeLow = 20,
246 Float_t rangeUp = 80,
248 TString in =
"UnfoldedSpectra.root",
249 TString out =
"ShapeUncertainty.root",
250 Bool_t regularizationOnV2 = kTRUE
253 TH2D* detectorResponse,
258 Int_t eventCount = 0);
265 static TH2D*
NormalizeTH2D(TH2D* histo, Bool_t noError = kTRUE);
266 static TH1*
Bootstrap(TH1* hist, Bool_t kill = kTRUE);
267 static TH1D*
RebinTH1D(TH1D* histo, TArrayD* bins, TString
suffix =
"", Bool_t kill = kTRUE);
268 TH2D*
RebinTH2D(TH2D* histo, TArrayD* binsTrue, TArrayD* binsRec, TString
suffix =
"");
270 static TH1D*
NormalizeTH1D(TH1D* histo, Double_t scale = 1.);
272 static TGraphErrors*
GetRatio(TH1 *h1 = 0x0, TH1* h2 = 0x0, TString name =
"", Bool_t appendFit = kFALSE, Int_t xmax = -1);
273 static TGraphErrors*
GetV2(TH1* h1 = 0x0, TH1* h2 = 0x0, Double_t r = 0., TString name =
"");
274 static TH1D*
GetV2Histo(TH1* h1 = 0x0, TH1* h2 = 0x0, Double_t r = 0., TString name =
"");
277 static Double_t
GetRMSOfTH1(TH1* h, Double_t a, Double_t b);
279 Float_t pivot = 50., Bool_t subdueError = kFALSE,
280 TString str =
"", Bool_t setContent = kTRUE);
281 void ReplaceBins(TArrayI* array, TGraphAsymmErrors* graph);
282 void ReplaceBins(TArrayI* array, TGraphErrors* graph);
284 TH1* h1, TH1* h2, Double_t r, TString name,
285 TH1* relativeErrorInUp,
286 TH1* relativeErrorInLow,
287 TH1* relativeErrorOutUp,
288 TH1* relativeErrorOutLow,
289 Float_t rho = 0.)
const;
292 TGraphAsymmErrors* shape,
293 TGraphAsymmErrors* corr,
301 static void WriteObject(TObject*
object, TString
suffix =
"", Bool_t kill = kTRUE);
306 static TH1D*
SmoothenPrior(TH1D* spectrum, TF1*
function, Double_t min, Double_t max, Double_t start, Bool_t kill = kTRUE, Bool_t counts = kTRUE);
309 static void Style(Bool_t legacy = kFALSE);
310 static void Style(TCanvas* c, TString style =
"PEARSON");
311 static void Style(TVirtualPad* c, TString style =
"SPECTRUM", Bool_t legacy = kFALSE);
312 static void Style(TLegend* l);
315 static TLegend*
AddLegend(TVirtualPad* p, Bool_t style = kFALSE) {
316 if(!style)
return p->BuildLegend(.565, .663, .882, .883);
331 TPaveText* t(
new TPaveText(a, b, c, d,
"NDC"));
334 t->AddText(0.,0.,text.Data());
335 t->AddText(0., 0., Form(
"#it{R} = 0.%i anti-#it{k}_{T}, |#eta_{jet}|<%.1f", r, .9-r/10.));
336 t->SetTextColor(kBlack);
338 t->SetTextSize(gStyle->GetTextSize()*.8);
348 Double_t d = .6211) {
349 TPaveText* t(
new TPaveText(a, b, c, d,
"NDC"));
352 t->AddText(0.,0.,text.Data());
353 t->SetTextColor(col);
355 t->SetTextSize(gStyle->GetTextSize()*.8);
359 static TLatex*
AddLogo(Int_t logo, Double_t xmin = .59, Double_t
ymax = .81) {
361 else if (logo == 1)
return AddTLatex(xmin,
ymax,
"ALICE Preliminary");
362 else if (logo == 2)
return AddTLatex(xmin,
ymax,
"ALICE Simulation");
363 else if (logo == 3)
return AddTLatex(xmin,
ymax,
"work in progress");
367 return AddTLatex(0.55, 87,
"Pb-Pb #sqrt{#it{s}}}_{NN} = 2.76 TeV");
370 TLatex* tex =
new TLatex(xmin, ymax,
string.
Data());
372 tex->SetTextFont(42);
385 static void SetDebug(Int_t d) {AliUnfolding::SetDebug(d);}
389 TH1D*
GetPrior(
const TH1D* measuredJetSpectrum,
390 const TH2D* resizedResponse,
391 const TH1D* kinematicEfficiency,
392 const TH1D* measuredJetSpectrumTrueBins,
394 const TH1D* jetFindingEfficiency);
396 const TH2D* resizedResponse,
397 const TH1D* kinematicEfficiency,
398 const TH1D* measuredJetSpectrumTrueBins,
400 const TH1D* jetFindingEfficiency = 0x0);
402 const TH2D* resizedResponse,
403 const TH1D* kinematicEfficiency,
404 const TH1D* measuredJetSpectrumTrueBins,
406 const TH1D* jetFindingEfficiency = 0x0);
408 const TH2D* resizedResponse,
409 const TH1D* kinematicEfficiency,
410 const TH1D* measuredJetSpectrumTrueBins,
412 const TH1D* jetFindingEfficiency = 0x0);
414 const TH2D* resizedResponse,
415 const TH1D* kinematicEfficiency,
416 const TH1D* measuredJetSpectrumTrueBins,
418 const TH1D* jetFindingEfficiency = 0x0);
420 const TH2D* resizedResponse,
421 const TH1D* kinematicEfficiency,
422 const TH1D* measuredJetSpectrumTrueBins,
424 const TH1D* jetFindingEfficiency = 0x0);
426 const TH2D* resizedResponse,
427 const TH1D* kinematicEfficiency,
428 const TH1D* measuredJetSpectrumTrueBins,
430 const TH1D* jetFindingEfficiency = 0x0);
432 TArrayI* variationsIn,
433 TArrayI* variationsOut,
434 TH1D*& relativeErrorInUp,
435 TH1D*& relativeErrorInLow,
436 TH1D*& relativeErrorOutUp,
437 TH1D*& relativeErrorOutLow,
438 TH1D*& relativeSystematicIn,
439 TH1D*& relativeSystematicOut,
449 Bool_t onRatio = kTRUE)
const;
451 TArrayI* variationsIn,
452 TArrayI* variationsOut,
453 TH1D*& relativeErrorInUp,
454 TH1D*& relativeErrorInLow,
455 TH1D*& relativeErrorOutUp,
456 TH1D*& relativeErrorOutLow,
457 TH1D*& relativeSystematicIn,
458 TH1D*& relativeSystematicOut,
467 Bool_t RMS = kFALSE)
const;
469 TArrayI* variationsIn,
470 TArrayI* variationsOut,
471 TH1D*& relativeErrorInUp,
472 TH1D*& relativeErrorInLow,
473 TH1D*& relativeErrorOutUp,
474 TH1D*& relativeErrorOutLow,
475 TH1D*& relativeSystematicIn,
476 TH1D*& relativeSystematicOut,
485 Bool_t RMS = kFALSE)
const;
489 printf(
" >> I squelched a warning, jay, I'm contributing ! << \n");
495 TH1D*
ProtectHeap(TH1D* protect, Bool_t kill = kTRUE, TString
suffix =
"")
const;
496 TH2D*
ProtectHeap(TH2D* protect, Bool_t kill = kTRUE, TString
suffix =
"")
const;
497 TGraphErrors*
ProtectHeap(TGraphErrors* protect, Bool_t kill = kTRUE, TString
suffix =
"")
const;
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)