1 #ifndef THNSPARSEDEFINITIONS_H
2 #define THNSPARSEDEFINITIONS_H
9 #include "TGraphAsymmErrors.h"
16 enum axesTHnSparseEta {
25 enum axesTHnSparseEta {
31 kMultiplicity,//kDelta,
37 enum axesTHnSparsePID {
49 /*OLD with TOF, p_TPC_Inner and p_vertex
50 enum axesTHnSparsePID {
61 enum axesTHnSparsePIDgen {
73 enum axesTHnSparsePIDgenYield {
74 kPidGenYieldMCpid = 0,
76 kPidGenYieldCentrality = 2,
77 kPidGenYieldJetPt = 3,
80 kPidGenYieldNumAxes = 6
97 kV0idPlusTOFaccepted = 4,
98 kV0idPlusTOFrejected = 5
101 enum efficiencyAxes {
111 enum ptResolutionAxes {
116 kPtResCentrality = 4,
124 kDeDxCheckEtaAbs = 3,
126 kDeDxCheckNumAxes = 5
130 kStepGenWithGenCuts = 0,
131 kStepRecWithGenCuts = 1,
132 kStepRecWithGenCutsMeasuredObs = 2,
133 kStepRecWithRecCutsMeasuredObs = 3,
134 kStepRecWithRecCutsMeasuredObsPrimaries = 4,
135 kStepRecWithRecCutsMeasuredObsStrangenessScaled = 5,
136 kStepRecWithRecCutsPrimaries = 6,
153 kNumTOFpidInfoBins = 5
156 const TString partShortName[9] = { "El", "Ka", "Mu", "Pi", "Pr", "V0plusTOFel", "V0el", "V0pi", "V0pr" };
159 //coarser binning at high pT and in general coarser binning to get reasonable weighting for regularisation
160 const Int_t nPtBins = 53;
161 const Double_t binsPt[nPtBins+1] = {0., 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
162 0.5, 0.55, 0.6, 0.65, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4,
163 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4,
164 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0,
165 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0,
166 24.0, 30.0, 40.0, 50.0 };
170 //coarser binning at high pT and, in addition, coarser binning around crossings for PbPb 2.76 ATeV FINAL version
171 const Int_t nPtBins = 50;
172 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
173 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.95, 1.1,
174 1.3, 1.4, 1.8, 2.2, 2.6, 3.0, 3.2, 3.4, 3.6, 3.8,
175 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0,
176 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0,
183 //coarser binning at high pT and, in addition, coarser binning around crossings for pPb 5.023 ATeV FINAL version
184 const Int_t nPtBins = 52;
185 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
186 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
187 1.0, 1.1, 1.2, 1.3, 1.4, 1.8, 2.2, 2.6, 3.0, 3.2,
188 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0,
189 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0,
194 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 7 TeV FINAL version
195 const Int_t nPtBins = 47;
196 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
197 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 1.2, 1.4, 1.6,
198 1.8, 2.0, 2.6, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5,
199 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0,
200 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 50.0 };
203 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 7 TeV VERY NEW version
204 const Int_t nPtBins = 46;
205 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
206 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 1.2, 1.6,
207 2.0, 2.5, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0,
208 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
209 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0, 50.0 };
212 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 7 TeV NEW version
213 const Int_t nPtBins = 47;
214 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
215 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.9, 1.2, 1.4, 1.6,
216 2.0, 2.5, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0,
217 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
218 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0, 50.0 };
220 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 7 TeV
222 const Int_t nPtBins = 50;
223 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
224 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.9, 1.1, 1.2, 1.3,
225 1.4, 1.6, 1.8, 2.0, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8,
226 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0,
227 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0,
231 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 2.76 TeV FINAL version
232 const Int_t nPtBins = 45;
233 const Double_t binsPt[nPtBins+1] = {0., 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
234 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 1.05,
235 1.2, 1.3, 1.4, 1.8, 2.9, 3.4, 3.6, 3.8, 4.0, 4.5,
236 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0,
237 13.0, 14.0, 15.0, 16.0, 20.0, 50.0 };
240 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 2.76 TeV NEW version
241 const Int_t nPtBins = 49;
242 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
243 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
244 1.05, 1.2, 1.3 , 1.4, 1.7, 2.4, 3.2 , 3.4 , 3.6, 3.8 ,
245 4.0, 4.5 , 5.0, 5.5 , 6.0, 6.5 , 7.0, 8.0 , 9.0, 10.0,
246 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0,
250 // Coarser binning at high pT and, in addition, coarser binning around crossings for pp 2.76 TeV
251 const Int_t nPtBins = 50;
252 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
253 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
254 1.0, 1.1 , 1.2, 1.3 , 1.4, 1.8, 2.4, 3.2, 3.6, 3.8 ,
255 4.0, 4.5 , 5.0, 5.5 , 6.0, 6.5 , 7.0, 8.0 , 9.0, 10.0,
256 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0,
261 //coarser binning at high pT
262 const Int_t nPtBins = 60;
263 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
264 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
265 1.0, 1.1 , 1.2, 1.3 , 1.4, 1.5 , 1.6, 1.7 , 1.8, 1.9 ,
266 2.0, 2.2 , 2.4, 2.6 , 2.8, 3.0 , 3.2, 3.4 , 3.6, 3.8 ,
267 4.0, 4.5 , 5.0, 5.5 , 6.0, 6.5 , 7.0, 8.0 , 9.0, 10.0,
268 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 22.0, 26.0, 35.0,
272 /* OLD default as used in PID-Task to create THnSparses
273 const Int_t nPtBins = 68;
274 const Double_t binsPt[nPtBins+1] = {0. , 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
275 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
276 1.0, 1.1 , 1.2, 1.3 , 1.4, 1.5 , 1.6, 1.7 , 1.8, 1.9 ,
277 2.0, 2.2 , 2.4, 2.6 , 2.8, 3.0 , 3.2, 3.4 , 3.6, 3.8 ,
278 4.0, 4.5 , 5.0, 5.5 , 6.0, 6.5 , 7.0, 8.0 , 9.0, 10.0,
279 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0, 22.0, 24.0,
280 26.0, 28.0, 30.0, 32.0, 34.0, 36.0, 40.0, 45.0, 50.0 };
283 const Int_t nDeDxBins = 19;
284 const Double_t binsDeDx[nDeDxBins+1] = {50., 52., 54., 56., 58., 60., 65., 70., 75., 80.,
285 85., 90., 100., 120., 160., 200., 250., 300., 400., 600. };
287 const Int_t nDeDxBins = 35;
288 const Double_t binsDeDx[nDeDxBins+1] = {50., 51., 52., 53., 54., 55., 56., 57., 58., 59.,
289 60., 62., 64., 66., 68., 70., 72., 74., 76., 78.,
290 80., 85., 90., 95., 100., 120., 140., 160., 180., 200.,
291 250., 300., 350., 400., 500, 650.};*/
293 //____________________________________________________________________________________________________________________
294 Int_t getLineColor(Int_t ID) {
322 //____________________________________________________________________________________________________________________
323 Int_t getLineColorAliPID(Int_t ID) {
325 case AliPID::kElectron:
337 case AliPID::kProton:
348 //____________________________________________________________________________________________________________________
349 void ClearTitleFromHistoInCanvas(TCanvas* c, Int_t padNum = -1)
351 // Remove the title from a histogram plotted in the canvase without
352 // removing the title from the histogram itself.
353 // If padNum is >= 0, this method will be applied to the corresponding
356 c->Update(); // Update in order to have access to the title in the following
358 TPaveText* paveTextTitle = (padNum >= 0) ? (TPaveText*)c->GetPad(padNum)->FindObject("title") : (TPaveText*)c->FindObject("title");
360 paveTextTitle->Clear();
364 //____________________________________________________________________________________________________________________
365 Int_t GetAxisByTitle(const THnSparse* h, TString title)
370 for (Int_t iDim = 0; iDim < h->GetNdimensions(); iDim++) {
371 if (!title.CompareTo(h->GetAxis(iDim)->GetTitle()))
379 //____________________________________________________________________________________________________________________
380 TGraphAsymmErrors* HistToGraph(const TString grname, const TH1 *hh, const Double_t thres=0, const TH1 *herr=0x0, const Double_t xmin=-1e10, const Double_t xmax=1e10)
385 const Int_t nbin = hh->GetNbinsX();
386 Double_t xxs[nbin], yys[nbin], exs[nbin], eys[nbin];
388 for(Int_t ii=1; ii<=nbin; ii++){
389 const Double_t iyy = hh->GetBinContent(ii);
393 const Double_t iey = hh->GetBinError(ii);
396 printf("HistToGraph warning! should be fine if this is ratio %d %e %e\n", ii, iyy, iey); //exit(1);
401 const Double_t ixx = hh->GetBinCenter(ii);
402 if(ixx<xmin || ixx>xmax){
403 //printf("test HistToGraph rejecting ixx %e xmin %e xmax %e\n", ixx, xmin, xmax);
409 iex = herr->GetBinContent(herr->GetXaxis()->FindBin(ixx));
412 iex = hh->GetBinWidth(ii)/2.;
421 TGraphAsymmErrors * gr = new TGraphAsymmErrors(np, xxs, yys, exs, exs, eys, eys);
423 gr->SetMaximum(hh->GetMaximum());
424 gr->SetMinimum(hh->GetMinimum());
425 gr->GetXaxis()->SetLimits(hh->GetXaxis()->GetXmin(), hh->GetXaxis()->GetXmax());
427 gr->SetLineColor(hh->GetLineColor());
428 gr->SetMarkerColor(hh->GetMarkerColor());
429 gr->SetFillStyle(hh->GetFillStyle());
430 gr->GetXaxis()->SetTitle(hh->GetXaxis()->GetTitle());
431 gr->GetYaxis()->SetTitle(hh->GetYaxis()->GetTitle());