]>
Commit | Line | Data |
---|---|---|
dc1455ee | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | /* $Id$ */ | |
4 | ||
51e6bc5a | 5 | /* Author: Redmer Alexander Bertens, rbertens@cern.ch, rbertens@nikhef.nl, r.a.bertens@uu.nl |
6 | * see implementation for additional information */ | |
7 | ||
dc1455ee | 8 | #ifndef AliJetFlowTools_H |
9 | #define AliJetFlowTools_H | |
10 | ||
549b5f40 | 11 | // root forward declarations |
e20bfd76 | 12 | class TH1; |
e4b6d21a | 13 | class TF2; |
dc1455ee | 14 | class TH2D; |
d7ec324f | 15 | class TCanvas; |
dc1455ee | 16 | class TString; |
17 | class TArrayD; | |
53547ff2 | 18 | class TGraph; |
dc1455ee | 19 | class TGraphErrors; |
20 | class TObjArray; | |
4292ca60 | 21 | // aliroot forward declarations |
22 | class AliAnaChargedJetResponseMaker; | |
23 | class AliUnfolding; | |
24 | // root includes | |
8bc7d79b | 25 | #include "TRandom3.h" |
dc1455ee | 26 | #include "TMatrixD.h" |
27 | #include "TList.h" | |
ad04a83c | 28 | #include "TDirectoryFile.h" |
dc1455ee | 29 | #include "TFile.h" |
4292ca60 | 30 | #include "TProfile.h" |
d7ec324f | 31 | #include "TVirtualPad.h" |
a39e4b2b | 32 | #include "TPaveText.h" |
33 | #include "TLegend.h" | |
20bd6574 | 34 | #include "TLatex.h" |
d31812e1 | 35 | #include "TF1.h" |
36 | #include "TH1D.h" | |
dc1455ee | 37 | //_____________________________________________________________________________ |
38 | class AliJetFlowTools { | |
630b4faf | 39 | public: |
dc1455ee | 40 | AliJetFlowTools(); |
41 | protected: | |
53547ff2 RAB |
42 | ~AliJetFlowTools(); // not implemented (deliberately). object ownership is a bit messy in this class |
43 | // since most (or all) of the objects are owned by the input and output files | |
dc1455ee | 44 | public: |
51e6bc5a | 45 | // enumerators |
549b5f40 RAB |
46 | enum unfoldingAlgorithm { // type of unfolding alrogithm |
47 | kChi2, // chi^2 unfolding, implemented in AliUnfolding | |
48 | kBayesian, // Bayesian unfolding, implemented in RooUnfold | |
49 | kBayesianAli, // Bayesian unfolding, implemented in AliUnfolding | |
50 | kSVD, // SVD unfolding, implemented in RooUnfold | |
e20bfd76 | 51 | kFold, // instead of unfolding, fold the input with the response |
549b5f40 RAB |
52 | kNone }; // no unfolding |
53 | enum prior { // prior that is used for unfolding | |
54 | kPriorChi2, // prior from chi^2 method | |
18698978 | 55 | kPriorMeasured, // use measured spectrum as prior |
d31812e1 | 56 | kPriorPythia, // use pythia spectrum as prior |
57 | kPriorTF1 }; // use properly binned TF1 as prior | |
549b5f40 | 58 | enum histoType { // histogram identifier, only used internally |
18698978 | 59 | kInPlaneSpectrum, // default style for spectrum |
53547ff2 RAB |
60 | kOutPlaneSpectrum, |
61 | kUnfoldedSpectrum, | |
62 | kFoldedSpectrum, | |
63 | kMeasuredSpectrum, | |
18698978 | 64 | kBar, // default style for bar histogram |
a39e4b2b | 65 | kRatio, // default style for ratio |
66 | kV2, // default style for v2 | |
6c3fa11d | 67 | kDeltaPhi, // default for delta phi |
18698978 | 68 | kEmpty }; // default style |
ef12d5a5 | 69 | // setters, interface to the class |
d001c397 | 70 | void SetOffsetStart(Int_t g) {gOffsetStop = g;} |
71 | void SetOffsetStop(Int_t g) {gOffsetStart = g;} | |
72 | void SetReductionFactor(Float_t g) {gReductionFactor = g;} | |
4292ca60 | 73 | void SetSaveFull(Bool_t b) {fSaveFull = b;} |
74 | void SetInputList(TList* list) { | |
75 | fInputList = list; | |
76 | fRefreshInput = kTRUE; | |
77 | } | |
dc1455ee | 78 | void SetOutputFileName(TString name) {fOutputFileName = name;} |
79 | void CreateOutputList(TString name) { | |
80 | // create a new output list and add it to the full output | |
ad04a83c | 81 | if(!fOutputFile) fOutputFile = new TFile(fOutputFileName.Data(), "RECREATE"); |
82 | fOutputFile->cd(); // avoid nested dirs | |
ef12d5a5 | 83 | if(name.EqualTo(fActiveString)) { |
84 | printf(Form(" > Warning, duplicate output list, renaming %s to %s_2 ! < \n", name.Data(), name.Data())); | |
85 | name+="_2"; | |
86 | } | |
dc1455ee | 87 | fActiveString = name; |
ad04a83c | 88 | fActiveDir = new TDirectoryFile(fActiveString.Data(), fActiveString.Data()); |
89 | fActiveDir->cd(); | |
dc1455ee | 90 | } |
c03f7598 | 91 | void SetCentralityBin(Int_t bin) { |
92 | // in case of one centraltiy | |
93 | fCentralityArray = new TArrayI(1); | |
94 | fCentralityArray->AddAt(bin, 0); | |
95 | // for one centrality there's no need for weights | |
96 | fCentralityWeights = new TArrayD(1); | |
97 | fCentralityWeights->AddAt(1., 0); | |
98 | } | |
1e01bfd6 | 99 | void SetMergeSpectrumBins(TArrayI* a) {fMergeBinsArray = a;} |
67d11165 | 100 | void SetCentralityBin(TArrayI* bins) { |
101 | fCentralityArray = bins; | |
c03f7598 | 102 | } |
103 | void SetCentralityWeight(TArrayD* weights) { | |
104 | fCentralityWeights = weights; | |
105 | if(!fCentralityArray) printf(" > Warning: centrality weights set, but bins are not defined! \n"); | |
67d11165 | 106 | } |
549b5f40 RAB |
107 | void SetDetectorResponse(TH2D* dr) {fDetectorResponse = dr;} |
108 | void SetJetFindingEfficiency(TH1D* e) {fJetFindingEff = e;} | |
109 | void SetBinsTrue(TArrayD* bins) {fBinsTrue = bins;} | |
110 | void SetBinsRec(TArrayD* bins) {fBinsRec = bins;} | |
111 | void SetBinsTruePrior(TArrayD* bins) {fBinsTruePrior = bins;} | |
112 | void SetBinsRecPrior(TArrayD* bins) {fBinsRecPrior = bins;} | |
113 | void SetSVDReg(Int_t r) {fSVDRegIn = r; fSVDRegOut = r;} | |
114 | void SetSVDReg(Int_t in, Int_t out) {fSVDRegIn = in; fSVDRegOut = out;} | |
115 | void SetSVDToy(Bool_t b, Float_t r) {fSVDToy = b; fJetRadius = r;} | |
116 | void SetBeta(Double_t b) {fBetaIn = b; fBetaOut = b;} | |
117 | void SetBeta(Double_t i, Double_t o) {fBetaIn = i; fBetaOut = o;} | |
118 | void SetBayesianIter(Int_t i) {fBayesianIterIn = i; fBayesianIterOut = i;} | |
119 | void SetBayesianIter(Int_t i, Int_t o) {fBayesianIterIn = i; fBayesianIterOut = o;} | |
120 | void SetBayesianSmooth(Float_t s) {fBayesianSmoothIn = s; fBayesianSmoothOut = s;} | |
121 | void SetBayesianSmooth(Float_t i, Float_t o) {fBayesianSmoothIn = i; fBayesianSmoothOut = o;} | |
122 | void SetAvoidRoundingError(Bool_t r) {fAvoidRoundingError = r;} | |
123 | void SetUnfoldingAlgorithm(unfoldingAlgorithm ua) {fUnfoldingAlgorithm = ua;} | |
124 | void SetPrior(prior p) {fPrior = p;} | |
d31812e1 | 125 | void SetPrior(prior p, TF1* function, TArrayD* bins) { |
126 | fPrior = p; | |
127 | // set prior to value supplied in TF1 | |
128 | fPriorUser = new TH1D("prior_user", "prior_user", bins->GetSize()-1, bins->GetArray()); | |
129 | // loop over bins and fill the histo from the tf1 | |
130 | for(Int_t i(0); i < fPriorUser->GetNbinsX() + 1; i++) fPriorUser->SetBinContent(i, function->Integral(fPriorUser->GetXaxis()->GetBinLowEdge(i), fPriorUser->GetXaxis()->GetBinUpEdge(i))/fPriorUser->GetXaxis()->GetBinWidth(i)); | |
131 | } | |
18698978 | 132 | void SetPrior(prior p, TH1D* spectrum) {fPrior = p; fPriorUser = spectrum;} |
549b5f40 RAB |
133 | void SetNormalizeSpectra(Bool_t b) {fNormalizeSpectra = b;} |
134 | void SetNormalizeSpectra(Int_t e) { // use to normalize to this no of events | |
135 | fEventCount = e; | |
136 | fNormalizeSpectra = kFALSE; | |
4292ca60 | 137 | } |
549b5f40 RAB |
138 | void SetSmoothenPrior(Bool_t b, Float_t min = 50., Float_t max = 100., Float_t start= 75., Bool_t counts = kTRUE) { |
139 | fSmoothenPrior = b; | |
4292ca60 | 140 | fFitMin = min; |
141 | fFitMax = max; | |
142 | fFitStart = start; | |
549b5f40 | 143 | fSmoothenCounts = counts; |
4292ca60 | 144 | } |
549b5f40 | 145 | void SetTestMode(Bool_t t) {fTestMode = t;} |
ef12d5a5 | 146 | void SetEventPlaneResolution(Double_t r) {fEventPlaneRes = r;} |
147 | void SetUseDetectorResponse(Bool_t r) {fUseDetectorResponse = r;} | |
549b5f40 RAB |
148 | void SetUseDptResponse(Bool_t r) {fUseDptResponse = r;} |
149 | void SetTrainPowerFit(Bool_t t) {fTrainPower = t;} | |
486fb24e | 150 | void SetDphiUnfolding(Bool_t i) {fDphiUnfolding = i;} |
151 | void SetDphiDptUnfolding(Bool_t i) {fDphiDptUnfolding = i;} | |
152 | void SetExLJDpt(Bool_t i) {fExLJDpt = i;} | |
153 | void SetWeightFunction(TF1* w) {fResponseMaker->SetRMMergeWeightFunction(w);} | |
3e698d27 | 154 | void SetRMS(Bool_t r) {fRMS = r;} |
155 | void SetSymmRMS(Bool_t r) {fSymmRMS = r; fRMS = r;} | |
6c3fa11d | 156 | void SetRho0(Bool_t r) {fRho0 = r;} |
8bc7d79b | 157 | void SetBootstrap(Bool_t b, Bool_t r = kTRUE) { |
158 | // note that setting this option will not lead to true resampling | |
159 | // but rather to randomly drawing a new distribution from a pdf | |
160 | // of the measured distribution | |
630b4faf | 161 | fBootstrap = b; |
8bc7d79b | 162 | // by default fully randomize randomizer from system time |
163 | if(r) { | |
164 | delete gRandom; | |
165 | gRandom = new TRandom3(0); | |
166 | } | |
167 | } | |
630b4faf | 168 | // main function. buffers about 5mb per call! |
e20bfd76 | 169 | void Make(TH1* customIn = 0x0, TH1* customOut = 0x0); |
486fb24e | 170 | void MakeAU(); // test function, use with caution (09012014) |
4292ca60 | 171 | void Finish() { |
172 | fOutputFile->cd(); | |
5e11c41c | 173 | if(fRMSSpectrumIn) fRMSSpectrumIn->Write(); |
174 | if(fRMSSpectrumOut) fRMSSpectrumOut->Write(); | |
175 | if(fRMSRatio) fRMSRatio->Write(); | |
4292ca60 | 176 | fOutputFile->Close();} |
53547ff2 RAB |
177 | void PostProcess( |
178 | TString def, | |
486fb24e | 179 | Int_t columns = 4, |
87233f72 | 180 | Float_t rangeLow = 20, |
181 | Float_t rangeUp = 80, | |
53547ff2 | 182 | TString in = "UnfoldedSpectra.root", |
486fb24e | 183 | TString out = "ProcessedSpectra.root") const; |
8bc7d79b | 184 | void BootstrapSpectra( |
185 | TString def, | |
186 | TString in = "UnfoldedSpectra.root", | |
187 | TString out = "BootstrapSpectra.root") const; | |
a39e4b2b | 188 | void GetNominalValues( |
189 | TH1D*& ratio, | |
190 | TGraphErrors*& v2, | |
191 | TArrayI* in, | |
192 | TArrayI* out, | |
193 | TString inFile = "UnfoldedSpectra.root", | |
194 | TString outFile = "Nominal.root") const; | |
18698978 | 195 | void GetCorrelatedUncertainty( |
a39e4b2b | 196 | TGraphAsymmErrors*& corrRatio, |
197 | TGraphAsymmErrors*& corrV2, | |
f3ba6c8e | 198 | TArrayI* variationsIn, |
199 | TArrayI* variationsOut, | |
7b88bd32 | 200 | Bool_t sym, |
98d5b614 | 201 | TArrayI* variantions2ndIn, |
202 | TArrayI* variantions2ndOut, | |
7b88bd32 | 203 | Bool_t sym2nd, |
18698978 | 204 | TString type = "", |
24005d85 | 205 | TString type2 = "", |
f3ba6c8e | 206 | Int_t columns = 4, |
207 | Float_t rangeLow = 20, | |
208 | Float_t rangeUp = 80, | |
5159ed9e | 209 | Float_t corr = .5, |
f3ba6c8e | 210 | TString in = "UnfoldedSpectra.root", |
18698978 | 211 | TString out = "CorrelatedUncertainty.root") const; |
212 | void GetShapeUncertainty( | |
a39e4b2b | 213 | TGraphAsymmErrors*& shapeRatio, |
214 | TGraphAsymmErrors*& shapeV2, | |
18698978 | 215 | TArrayI* regularizationIn, |
216 | TArrayI* regularizationOut, | |
217 | TArrayI* trueBinIn = 0x0, | |
218 | TArrayI* trueBinOut = 0x0, | |
219 | TArrayI* recBinIn = 0x0, | |
220 | TArrayI* recBinOut = 0x0, | |
b2150106 | 221 | TArrayI* methodIn = 0x0, |
222 | TArrayI* methodOut = 0x0, | |
18698978 | 223 | Int_t columns = 4, |
224 | Float_t rangeLow = 20, | |
225 | Float_t rangeUp = 80, | |
b9bd4252 | 226 | Float_t corr = .0, |
18698978 | 227 | TString in = "UnfoldedSpectra.root", |
228 | TString out = "ShapeUncertainty.root") const; | |
4292ca60 | 229 | Bool_t SetRawInput ( |
230 | TH2D* detectorResponse, // detector response matrix | |
231 | TH1D* jetPtIn, // in plane jet spectrum | |
232 | TH1D* jetPtOut, // out of plane jet spectrum | |
233 | TH1D* dptIn, // in plane delta pt distribution | |
234 | TH1D* dptOut, // out of plane delta pt distribution | |
235 | Int_t eventCount = 0); // event count (optional) | |
dc1455ee | 236 | // static const helper functions, mainly histogram manipulation |
237 | static TH1D* ResizeXaxisTH1D(TH1D* histo, Int_t low, Int_t up, TString suffix = ""); | |
238 | static TH2D* ResizeYaxisTH2D(TH2D* histo, TArrayD* x, TArrayD* y, TString suffix = ""); | |
512ced40 | 239 | static TH2D* NormalizeTH2D(TH2D* histo, Bool_t noError = kTRUE); |
8bc7d79b | 240 | static TH1* Bootstrap(TH1* hist, Bool_t kill = kTRUE); |
53547ff2 | 241 | static TH1D* RebinTH1D(TH1D* histo, TArrayD* bins, TString suffix = "", Bool_t kill = kTRUE); |
4292ca60 | 242 | TH2D* RebinTH2D(TH2D* histo, TArrayD* binsTrue, TArrayD* binsRec, TString suffix = ""); |
d7ec324f | 243 | static TH2D* MatrixMultiplication(TH2D* a, TH2D* b, TString name = "CombinedResponse"); |
dc1455ee | 244 | static TH1D* NormalizeTH1D(TH1D* histo, Double_t scale = 1.); |
1e01bfd6 | 245 | static TH1D* MergeSpectrumBins(TArrayI* bins, TH1D* spectrum, TH2D* corr); |
4292ca60 | 246 | static TGraphErrors* GetRatio(TH1 *h1 = 0x0, TH1* h2 = 0x0, TString name = "", Bool_t appendFit = kFALSE, Int_t xmax = -1); |
35c03ef1 | 247 | static TGraphErrors* GetV2(TH1* h1 = 0x0, TH1* h2 = 0x0, Double_t r = 0., TString name = ""); |
1e01bfd6 | 248 | void ReplaceBins(TArrayI* array, TGraphAsymmErrors* graph); |
249 | void ReplaceBins(TArrayI* array, TGraphErrors* graph); | |
a39e4b2b | 250 | TGraphAsymmErrors* GetV2WithSystematicErrors( |
251 | TH1* h1, TH1* h2, Double_t r, TString name, | |
252 | TH1* relativeErrorInUp, | |
253 | TH1* relativeErrorInLow, | |
254 | TH1* relativeErrorOutUp, | |
24af86e7 | 255 | TH1* relativeErrorOutLow, |
256 | Float_t rho = 0.) const; | |
1e01bfd6 | 257 | static void GetSignificance( |
258 | TGraphErrors* n, // points with stat error | |
259 | TGraphAsymmErrors* shape, // points with shape error | |
7030c65a | 260 | TGraphAsymmErrors* corr, // corr with stat error |
1e01bfd6 | 261 | Int_t low, // pt lower level |
262 | Int_t up // pt upper level | |
263 | ); | |
a5ecaabe | 264 | static void MinimizeChi2nd(); |
265 | static Double_t PhenixChi2nd(const Double_t *xx ); | |
266 | static Double_t ConstructFunctionnd(Double_t *x, Double_t *par); | |
630b4faf | 267 | static TF2* ReturnFunctionnd(Double_t &p); |
549b5f40 | 268 | static void WriteObject(TObject* object, TString suffix = "", Bool_t kill = kTRUE); |
4292ca60 | 269 | static TH2D* ConstructDPtResponseFromTH1D(TH1D* dpt, Bool_t AvoidRoundingError); |
ef12d5a5 | 270 | static TH2D* GetUnityResponse(TArrayD* binsTrue, TArrayD* binsRec, TString suffix = ""); |
549b5f40 | 271 | void SaveConfiguration(Bool_t convergedIn, Bool_t convergedOut) const; |
d7ec324f | 272 | static TMatrixD* CalculatePearsonCoefficients(TMatrixD* covmat); |
549b5f40 | 273 | static TH1D* SmoothenPrior(TH1D* spectrum, TF1* function, Double_t min, Double_t max, Double_t start, Bool_t kill = kTRUE, Bool_t counts = kTRUE); |
18698978 | 274 | // set style |
275 | void SetTitleFontSize(Double_t s) {fTitleFontSize = s;} | |
20bd6574 | 276 | static void Style(Bool_t legacy = kFALSE); |
d7ec324f | 277 | static void Style(TCanvas* c, TString style = "PEARSON"); |
20bd6574 | 278 | static void Style(TVirtualPad* c, TString style = "SPECTRUM", Bool_t legacy = kFALSE); |
53547ff2 | 279 | static void Style(TLegend* l); |
20bd6574 | 280 | static void Style(TH1* h, EColor col = kBlue, histoType = kEmpty, Bool_t legacy = kFALSE); |
281 | static void Style(TGraph* h, EColor col = kBlue, histoType = kEmpty, Bool_t legacy = kFALSE); | |
a39e4b2b | 282 | static TLegend* AddLegend(TVirtualPad* p, Bool_t style = kFALSE) { |
283 | if(!style) return p->BuildLegend(.565, .663, .882, .883); | |
284 | else { | |
285 | TLegend* l = AddLegend(p, kFALSE); | |
286 | Style(l); | |
287 | return l; | |
288 | } | |
289 | } | |
e4b6d21a | 290 | static TPaveText* AddTPaveText( |
291 | // this text appears under the logo | |
292 | TString text, | |
293 | Int_t r = 2, | |
294 | Double_t a = .587, | |
295 | Double_t b = .695, | |
296 | Double_t c = .872, | |
297 | Double_t d = .801) { | |
298 | TPaveText* t(new TPaveText(a, b, c, d, "NDC")); | |
a39e4b2b | 299 | t->SetFillColor(0); |
300 | t->SetBorderSize(0); | |
301 | t->AddText(0.,0.,text.Data()); | |
e4b6d21a | 302 | t->AddText(0., 0., Form("#it{R} = 0.%i anti-#it{k}_{T}, |#eta_{jet}|<%.1f", r, .9-r/10.)); |
a39e4b2b | 303 | t->SetTextColor(kBlack); |
a39e4b2b | 304 | t->SetTextFont(42); |
e4b6d21a | 305 | t->SetTextSize(gStyle->GetTextSize()*.8); |
a39e4b2b | 306 | t->Draw("same"); |
307 | return t; | |
308 | } | |
e4b6d21a | 309 | static TPaveText* AddText( |
310 | TString text, | |
311 | EColor col, | |
312 | Double_t a = .2098, | |
313 | Double_t b = .5601, | |
314 | Double_t c = .613, | |
315 | Double_t d = .6211) { | |
316 | TPaveText* t(new TPaveText(a, b, c, d, "NDC")); | |
d06dbffe | 317 | t->SetFillColor(0); |
318 | t->SetBorderSize(0); | |
319 | t->AddText(0.,0.,text.Data()); | |
320 | t->SetTextColor(col); | |
d06dbffe | 321 | t->SetTextFont(42); |
e4b6d21a | 322 | t->SetTextSize(gStyle->GetTextSize()*.8); |
d06dbffe | 323 | t->Draw("same"); |
324 | return t; | |
325 | } | |
14ce5e08 | 326 | static TLatex* AddLogo(Int_t logo, Double_t xmin = .59, Double_t ymax = .81) { |
327 | if(logo == 0) return AddTLatex(xmin, ymax, "ALICE"); | |
328 | else if (logo == 1) return AddTLatex(xmin, ymax, "ALICE Preliminary"); | |
329 | else if (logo == 2) return AddTLatex(xmin, ymax, "ALICE Simulation"); | |
630b4faf | 330 | else if (logo == 3) return AddTLatex(xmin, ymax, "work in progress"); |
14ce5e08 | 331 | return 0x0; |
20bd6574 | 332 | } |
333 | static TLatex* AddSystem() { | |
334 | return AddTLatex(0.55, 87, "Pb-Pb #sqrt{#it{s}}}_{NN} = 2.76 TeV"); | |
335 | } | |
336 | static TLatex* AddTLatex(Double_t xmin, Double_t ymax, TString string) { | |
337 | TLatex* tex = new TLatex(xmin, ymax, string.Data()); | |
338 | tex->SetNDC(); | |
339 | tex->SetTextFont(42); | |
340 | tex->Draw("same"); | |
341 | return tex; | |
342 | } | |
d06dbffe | 343 | |
7030c65a | 344 | static void SavePadToPDF(TVirtualPad* pad) {return;/*pad->SaveAs(Form("%s.pdf", pad->GetName()));*/} |
4292ca60 | 345 | // interface to AliUnfolding, not necessary but nice to have all parameters in one place |
346 | static void SetMinuitStepSize(Float_t s) {AliUnfolding::SetMinuitStepSize(s);} | |
347 | static void SetMinuitPrecision(Float_t s) {AliUnfolding::SetMinuitPrecision(s);} | |
348 | static void SetMinuitPrecision(Int_t i) {AliUnfolding::SetMinuitMaxIterations(i);} | |
349 | static void SetMinuitStrategy(Double_t s) {AliUnfolding::SetMinuitStrategy(s);} | |
350 | static void SetDebug(Int_t d) {AliUnfolding::SetDebug(d);} | |
dc1455ee | 351 | private: |
e20bfd76 | 352 | Bool_t PrepareForUnfolding(TH1* customIn = 0x0, TH1* customOut = 0x0); |
486fb24e | 353 | Bool_t PrepareForUnfolding(Int_t low, Int_t up); |
549b5f40 RAB |
354 | TH1D* GetPrior( const TH1D* measuredJetSpectrum, |
355 | const TH2D* resizedResponse, | |
356 | const TH1D* kinematicEfficiency, | |
357 | const TH1D* measuredJetSpectrumTrueBins, | |
358 | const TString suffix, | |
359 | const TH1D* jetFindingEfficiency); | |
486fb24e | 360 | TH1D* UnfoldWrapper( const TH1D* measuredJetSpectrum, |
361 | const TH2D* resizedResponse, | |
362 | const TH1D* kinematicEfficiency, | |
363 | const TH1D* measuredJetSpectrumTrueBins, | |
364 | const TString suffix, | |
365 | const TH1D* jetFindingEfficiency = 0x0); | |
549b5f40 RAB |
366 | TH1D* UnfoldSpectrumChi2( const TH1D* measuredJetSpectrum, |
367 | const TH2D* resizedResponse, | |
368 | const TH1D* kinematicEfficiency, | |
369 | const TH1D* measuredJetSpectrumTrueBins, | |
370 | const TString suffix, | |
371 | const TH1D* jetFindingEfficiency = 0x0); | |
372 | TH1D* UnfoldSpectrumSVD( const TH1D* measuredJetSpectrum, | |
373 | const TH2D* resizedResponse, | |
374 | const TH1D* kinematicEfficiency, | |
375 | const TH1D* measuredJetSpectrumTrueBins, | |
376 | const TString suffix, | |
377 | const TH1D* jetFindingEfficiency = 0x0); | |
378 | TH1D* UnfoldSpectrumBayesianAli( const TH1D* measuredJetSpectrum, | |
379 | const TH2D* resizedResponse, | |
380 | const TH1D* kinematicEfficiency, | |
381 | const TH1D* measuredJetSpectrumTrueBins, | |
382 | const TString suffix, | |
383 | const TH1D* jetFindingEfficiency = 0x0); | |
384 | TH1D* UnfoldSpectrumBayesian( const TH1D* measuredJetSpectrum, | |
385 | const TH2D* resizedResponse, | |
386 | const TH1D* kinematicEfficiency, | |
387 | const TH1D* measuredJetSpectrumTrueBins, | |
388 | const TString suffix, | |
389 | const TH1D* jetFindingEfficiency = 0x0); | |
e20bfd76 | 390 | TH1D* FoldSpectrum( const TH1D* measuredJetSpectrum, |
391 | const TH2D* resizedResponse, | |
392 | const TH1D* kinematicEfficiency, | |
393 | const TH1D* measuredJetSpectrumTrueBins, | |
394 | const TString suffix, | |
395 | const TH1D* jetFindingEfficiency = 0x0); | |
18698978 | 396 | void DoIntermediateSystematics( |
397 | TArrayI* variationsIn, | |
398 | TArrayI* variationsOut, | |
399 | TH1D*& relativeErrorInUp, | |
400 | TH1D*& relativeErrorInLow, | |
401 | TH1D*& relativeErrorOutUp, | |
402 | TH1D*& relativeErrorOutLow, | |
403 | TH1D*& relativeSystematicIn, | |
404 | TH1D*& relativeSystematicOut, | |
a39e4b2b | 405 | TH1D*& nominal, |
406 | TH1D*& nominalIn, | |
407 | TH1D*& nominalOut, | |
18698978 | 408 | Int_t columns, |
409 | Float_t rangeLow, | |
410 | Float_t rangeUp, | |
411 | TFile* readMe, | |
d06dbffe | 412 | TString source = "", |
413 | Bool_t RMS = kFALSE) const; | |
4292ca60 | 414 | static void ResetAliUnfolding(); |
ef12d5a5 | 415 | // give object a unique name via the 'protect heap' functions. |
416 | // may seem redundant, but some internal functions of root (e.g. | |
417 | // ProjectionY()) check for existing objects by name and re-use them | |
f3ba6c8e | 418 | TH1D* ProtectHeap(TH1D* protect, Bool_t kill = kTRUE, TString suffix = "") const; |
419 | TH2D* ProtectHeap(TH2D* protect, Bool_t kill = kTRUE, TString suffix = "") const; | |
420 | TGraphErrors* ProtectHeap(TGraphErrors* protect, Bool_t kill = kTRUE, TString suffix = "") const; | |
dc1455ee | 421 | // members, accessible via setters |
4292ca60 | 422 | AliAnaChargedJetResponseMaker* fResponseMaker; // utility object |
3e698d27 | 423 | Bool_t fRMS; // systematic method |
424 | Bool_t fSymmRMS; // symmetric systematic method | |
6c3fa11d | 425 | Bool_t fRho0; // use the result obtained with the 'classic' fixed rho |
8bc7d79b | 426 | Bool_t fBootstrap; // use bootstrap resampling of input data |
4292ca60 | 427 | TF1* fPower; // smoothening fit |
428 | Bool_t fSaveFull; // save all generated histograms to file | |
51e6bc5a | 429 | TString fActiveString; // identifier of active output |
430 | TDirectoryFile* fActiveDir; // active directory | |
431 | TList* fInputList; // input list | |
4292ca60 | 432 | Bool_t fRefreshInput; // re-read the input (called automatically if input list changes) |
51e6bc5a | 433 | TString fOutputFileName; // output file name |
434 | TFile* fOutputFile; // output file | |
1e01bfd6 | 435 | TArrayI* fCentralityArray; // array of centrality bins that are merged |
436 | TArrayI* fMergeBinsArray; // array of pt bins that are merged | |
c03f7598 | 437 | TArrayD* fCentralityWeights; // array of centrality weights |
51e6bc5a | 438 | TH2D* fDetectorResponse; // detector response |
53547ff2 | 439 | TH1D* fJetFindingEff; // jet finding efficiency |
4292ca60 | 440 | Double_t fBetaIn; // regularization strength, in plane unfolding |
441 | Double_t fBetaOut; // regularization strength, out of plane unfoldign | |
549b5f40 RAB |
442 | Int_t fBayesianIterIn; // bayesian regularization parameter, in plane unfolding |
443 | Int_t fBayesianIterOut; // bayesian regularization parameter, out plane unfolding | |
444 | Float_t fBayesianSmoothIn; // bayesian smoothening parameter (AliUnfolding) | |
445 | Float_t fBayesianSmoothOut; // bayesian smoothening parameter (AliUnfolding) | |
51e6bc5a | 446 | Bool_t fAvoidRoundingError; // set dpt to zero for small values far from the diagonal |
447 | unfoldingAlgorithm fUnfoldingAlgorithm; // algorithm used for unfolding | |
448 | prior fPrior; // prior for unfolding | |
18698978 | 449 | TH1D* fPriorUser; // user supplied prior (e.g. pythia spectrum) |
51e6bc5a | 450 | TArrayD* fBinsTrue; // pt true bins |
451 | TArrayD* fBinsRec; // pt rec bins | |
ef12d5a5 | 452 | TArrayD* fBinsTruePrior; // holds true bins for the chi2 prior for SVD. setting this is optional |
453 | TArrayD* fBinsRecPrior; // holds rec bins for the chi2 prior for SVD. setting this is optional | |
4292ca60 | 454 | Int_t fSVDRegIn; // svd regularization (a good starting point is half of the number of bins) |
455 | Int_t fSVDRegOut; // svd regularization out of plane | |
51e6bc5a | 456 | Bool_t fSVDToy; // use toy to estimate coveriance matrix for SVD method |
457 | Float_t fJetRadius; // jet radius (for SVD toy) | |
20abfcc4 | 458 | Int_t fEventCount; // number of events |
459 | Bool_t fNormalizeSpectra; // normalize spectra to event count | |
549b5f40 | 460 | Bool_t fSmoothenPrior; // smoothen the tail of the measured spectrum using a powerlaw fit |
4292ca60 | 461 | Float_t fFitMin; // lower bound of smoothening fit |
462 | Float_t fFitMax; // upper bound of smoothening fit | |
463 | Float_t fFitStart; // from this value, use smoothening | |
549b5f40 | 464 | Bool_t fSmoothenCounts; // fill smoothened spectrum with counts |
ef12d5a5 | 465 | Bool_t fTestMode; // unfold with unity response for testing |
4292ca60 | 466 | Bool_t fRawInputProvided; // input histograms provided, not read from file |
ef12d5a5 | 467 | Double_t fEventPlaneRes; // event plane resolution for current centrality |
468 | Bool_t fUseDetectorResponse; // add detector response to unfolding | |
549b5f40 | 469 | Bool_t fUseDptResponse; // add dpt response to unfolding |
ef12d5a5 | 470 | Bool_t fTrainPower; // don't clear the params of fPower for call to Make |
486fb24e | 471 | // might give more stable results, but possibly introduces |
ef12d5a5 | 472 | // a bias / dependency on previous iterations |
486fb24e | 473 | Bool_t fDphiUnfolding; // do the unfolding in in and out of plane orientation |
474 | Bool_t fDphiDptUnfolding; // do the unfolding in dphi and dpt bins (to fit v2) | |
475 | Bool_t fExLJDpt; // exclude randon cones with leading jet | |
18698978 | 476 | Double_t fTitleFontSize; // title font size |
dc1455ee | 477 | // members, set internally |
4292ca60 | 478 | TProfile* fRMSSpectrumIn; // rms of in plane spectra of converged unfoldings |
479 | TProfile* fRMSSpectrumOut; // rms of out of plane spectra of converged unfoldings | |
480 | TProfile* fRMSRatio; // rms of ratio of converged unfolded spectra | |
ef12d5a5 | 481 | TProfile* fRMSV2; // rms of v2 of converged unfolded spectra |
4292ca60 | 482 | TH2D* fDeltaPtDeltaPhi; // delta pt delta phi distribution |
483 | TH2D* fJetPtDeltaPhi; // jet pt delta phi distribution | |
484 | TH1D* fSpectrumIn; // in plane jet pt spectrum | |
485 | TH1D* fSpectrumOut; // out of plane jet pt spectrum | |
486 | TH1D* fDptInDist; // in plane dpt distribution | |
487 | TH1D* fDptOutDist; // out of plane dpt distribution | |
488 | TH2D* fDptIn; // in plane dpt matrix | |
489 | TH2D* fDptOut; // out plane dpt matrix | |
490 | TH2D* fFullResponseIn; // full response matrix, in plane | |
491 | TH2D* fFullResponseOut; // full response matrix, out of plane | |
a5ecaabe | 492 | |
630b4faf | 493 | static TArrayD* gV2; // internal use only, do not touch these |
494 | static TArrayD* gStat; // internal use only, do not touch these | |
495 | static TArrayD* gShape; // internal use only, do not touch these | |
496 | static TArrayD* gCorr; // internal use only, do not touch these | |
497 | ||
498 | static Int_t gOffsetStart; // see initialization below | |
499 | static Int_t gOffsetStop; // see initialization below | |
d001c397 | 500 | static Float_t gReductionFactor; // multiply shape uncertainty by this factor |
630b4faf | 501 | |
dc1455ee | 502 | // copy and assignment |
503 | AliJetFlowTools(const AliJetFlowTools&); // not implemented | |
504 | AliJetFlowTools& operator=(const AliJetFlowTools&); // not implemented | |
630b4faf | 505 | |
dc1455ee | 506 | }; |
630b4faf | 507 | // initialize the static members |
508 | TArrayD* AliJetFlowTools::gV2 = new TArrayD(6); // DO NOT TOUCH - these arrays are filled by the | |
509 | TArrayD* AliJetFlowTools::gStat = new TArrayD(6); // 'GetSignificance' function and | |
510 | TArrayD* AliJetFlowTools::gShape = new TArrayD(6); // then used in the chi2 minimization routine | |
511 | TArrayD* AliJetFlowTools::gCorr = new TArrayD(6); // to calculate the significance of the results | |
512 | Int_t AliJetFlowTools::gOffsetStart = 1; // start chi2 fit from this bin w.r.t. the binning supplied in the 'GetCorr/GetShape' functions | |
513 | Int_t AliJetFlowTools::gOffsetStop = -1; // stop chi2 fit at this bin w.r.t. the binning supplied in the 'GetCorr/GetShape' functions | |
d001c397 | 514 | Float_t AliJetFlowTools::gReductionFactor = .5; // multiply shape uncertainty by this factor |
630b4faf | 515 | |
dc1455ee | 516 | #endif |
517 | //_____________________________________________________________________________ |