Possibility to remove the contribution of D meson daughters to the number of tracklet...
[u/mrichter/AliRoot.git] / PWGPP / TRD / AliTRDcheckESD.cxx
CommitLineData
7b67bbf9 1/**************************************************************************\r
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3* *\r
4* Author: The ALICE Off-line Project. *\r
5* Contributors are mentioned in the code where appropriate. *\r
6* *\r
7* Permission to use, copy, modify and distribute this software and its *\r
8* documentation strictly for non-commercial purposes is hereby granted *\r
9* without fee, provided that the above copyright notice appears in all *\r
10* copies and that both the copyright notice and this permission notice *\r
11* appear in the supporting documentation. The authors make no claims *\r
12* about the suitability of this software for any purpose. It is *\r
13* provided "as is" without express or implied warranty. *\r
14**************************************************************************/\r
15\r
16/////////////////////////////////////////////////////\r
17//\r
18// Check basic detector results at ESD level\r
19// - Geometrical efficiency \r
20// - Tracking efficiency \r
21// - PID efficiency \r
22// - Refit efficiency \r
23//\r
24// Author\r
25// Alex Bercuci <A.Bercuci@gsi.de>\r
26// Ionut Arsene <i.c.arsene@gsi.de>\r
27//\r
28//////////////////////////////////////////////////////\r
29\r
30#include <TClonesArray.h>\r
31#include <TCanvas.h>\r
32#include <TObjArray.h>\r
33#include <TPad.h>\r
34#include <TLegend.h>\r
35#include <TLatex.h>\r
36#include <TLine.h>\r
37#include <TF1.h>\r
38#include <TH1D.h>\r
39#include <TH2D.h>\r
40#include <TH3D.h>\r
41#include <TH2I.h>\r
42#include <TH2F.h>\r
43#include <TH3S.h>\r
44#include <TH3F.h>\r
45#include <TProfile2D.h>\r
46#include <TProfile.h>\r
47#include <TGraphErrors.h>\r
48#include <TGraphAsymmErrors.h>\r
49#include <TFile.h>\r
50#include <TTree.h>\r
51#include <TROOT.h>\r
52#include <TChain.h>\r
53#include <TParticle.h>\r
54#include <TTimeStamp.h>\r
55#include <TRandom.h>\r
56#include <TString.h>\r
57\r
58#include "AliLog.h"\r
59#include "AliAnalysisManager.h"\r
60#include "AliAnalysisCuts.h"\r
61#include "AliPhysicsSelection.h"\r
62#include "AliESDEvent.h"\r
63#include "AliESDkink.h"\r
64#include "AliMCEvent.h"\r
65#include "AliESDInputHandler.h"\r
66#include "AliMCEventHandler.h"\r
67#include "AliESDpid.h"\r
68\r
69#include "AliESDtrack.h"\r
70#include "AliMCParticle.h"\r
71#include "AliPID.h"\r
72#include "AliStack.h"\r
73#include "AliTrackReference.h"\r
74//#include "AliESDCentrality.h"\r
75#include "AliMultiplicity.h"\r
76#include "AliCFContainer.h"\r
77\r
78#include "AliTRDcheckESD.h"\r
79#include <iostream>\r
80using namespace std;\r
81\r
82ClassImp(AliTRDcheckESD)\r
83\r
84const Float_t AliTRDcheckESD::fgkxTPC = 290.;\r
85const Float_t AliTRDcheckESD::fgkxTOF = 365.;\r
86const UChar_t AliTRDcheckESD::fgkNgraph[AliTRDcheckESD::kNrefs] ={\r
878, 4, 2, 20};\r
88FILE* AliTRDcheckESD::fgFile = NULL;\r
89\r
90const Float_t AliTRDcheckESD::fgkEvVertexZ = 15.;\r
91const Int_t AliTRDcheckESD::fgkEvVertexN = 1;\r
92const Float_t AliTRDcheckESD::fgkTrkDCAxy = 40.;\r
93const Float_t AliTRDcheckESD::fgkTrkDCAz = 15.;\r
94const Int_t AliTRDcheckESD::fgkNclTPC = 100;\r
95const Float_t AliTRDcheckESD::fgkPt = 0.2;\r
96const Float_t AliTRDcheckESD::fgkEta = 0.9;\r
97const Float_t AliTRDcheckESD::fgkQs = 0.002;\r
98\r
99//____________________________________________________________________\r
100AliTRDcheckESD::AliTRDcheckESD():\r
101 AliAnalysisTaskSE()\r
102 ,fStatus(0)\r
103 ,fNRefFigures(0)\r
104 ,fESD(NULL)\r
105 ,fMC(NULL)\r
106 ,fESDpid(new AliESDpid)\r
107 ,fHistos(NULL)\r
108 ,fResults(NULL)\r
109 ,fExpertCF(NULL)\r
110 ,fMatchingPhiEtaCF(NULL)\r
111 ,fMatchingPtCF(NULL)\r
112 ,fBunchCrossingsCF(NULL)\r
113 ,fCentralityCF(NULL)\r
114 ,fQtotCF(NULL)\r
115 ,fPulseHeightCF(NULL)\r
116 ,fReferenceTrackFilter(NULL)\r
117 ,fPhysSelTriggersEnabled(kFALSE)\r
118 ,fUserEnabledTriggers("")\r
119 ,fNAssignedTriggers(0)\r
120{\r
121 //\r
122 // Default constructor\r
123 //\r
124 for(Int_t i=0; i<kNTrdCfVariables; ++i) {\r
125 fExpertCFVars[i] = -1;\r
126 fMatchingPhiEtaCFVars[i] = -1;\r
127 fMatchingPtCFVars[i] = -1;\r
128 fBunchCrossingsCFVars[i] = -1;\r
129 fCentralityCFVars[i] = -1;\r
130 fQtotCFVars[i] = -1;\r
131 fPulseHeightCFVars[i] = -1;\r
132 fExpertCFVarsEnabled[i] = kFALSE;\r
133 fExpertCFVarNBins[i] = 0;\r
134 fExpertCFVarRanges[i][0] = -999.; fExpertCFVarRanges[i][1] = -999.;\r
135 fExpertCFVarBins[i] = "";\r
136 }\r
137 fExpertCFEnabledSteps[0] = kFALSE; fExpertCFEnabledSteps[1] = kFALSE; fExpertCFEnabledSteps[2] = kFALSE;\r
138 SetNameTitle("TRDcheckESD", "Check TRD @ ESD level");\r
139 SetMC(kTRUE);\r
140}\r
141\r
142//____________________________________________________________________\r
143AliTRDcheckESD::AliTRDcheckESD(char* name):\r
144 AliAnalysisTaskSE(name)\r
145 ,fStatus(0)\r
146 ,fNRefFigures(0)\r
147 ,fESD(NULL)\r
148 ,fMC(NULL)\r
149 ,fESDpid(new AliESDpid)\r
150 ,fHistos(NULL)\r
151 ,fResults(NULL)\r
152 ,fExpertCF(NULL)\r
153 ,fMatchingPhiEtaCF(NULL)\r
154 ,fMatchingPtCF(NULL)\r
155 ,fBunchCrossingsCF(NULL)\r
156 ,fCentralityCF(NULL)\r
157 ,fQtotCF(NULL)\r
158 ,fPulseHeightCF(NULL)\r
159 ,fReferenceTrackFilter(NULL)\r
160 ,fPhysSelTriggersEnabled(kFALSE)\r
161 ,fUserEnabledTriggers("")\r
162 ,fNAssignedTriggers(0)\r
163{\r
164 //\r
165 // Default constructor\r
166 //\r
167 for(Int_t i=0; i<kNTrdCfVariables; ++i) {\r
168 fExpertCFVars[i] = -1;\r
169 fMatchingPhiEtaCFVars[i] = -1;\r
170 fMatchingPtCFVars[i] = -1;\r
171 fBunchCrossingsCFVars[i] = -1;\r
172 fCentralityCFVars[i] = -1;\r
173 fQtotCFVars[i] = -1;\r
174 fPulseHeightCFVars[i] = -1;\r
175 fExpertCFVarsEnabled[i] = kFALSE;\r
176 fExpertCFVarNBins[i] = 0;\r
177 fExpertCFVarRanges[i][0] = -999.; fExpertCFVarRanges[i][1] = -999.;\r
178 fExpertCFVarBins[i] = "";\r
179 }\r
180 fExpertCFEnabledSteps[0] = kFALSE; fExpertCFEnabledSteps[1] = kFALSE; fExpertCFEnabledSteps[2] = kFALSE;\r
181 SetMC(kTRUE);\r
182 SetTitle("Check TRD @ ESD level");\r
183 DefineOutput(1, TObjArray::Class());\r
184}\r
185\r
186//____________________________________________________________________\r
187AliTRDcheckESD::~AliTRDcheckESD()\r
188{\r
189 // Destructor\r
190 if(fHistos && !(AliAnalysisManager::GetAnalysisManager() && AliAnalysisManager::GetAnalysisManager()->IsProofMode())){\r
191 if(fHistos->IsOwner()) fHistos->Delete();\r
192 delete fHistos;\r
193 fHistos = NULL;\r
194 }\r
195 \r
196 if(fResults){\r
197 fResults->Delete();\r
198 delete fResults;\r
199 }\r
200}\r
201\r
202\r
203//____________________________________________________________________\r
204void AliTRDcheckESD::AddExpertCFVar(AliTRDcheckESD::ETrdCfVariables var, \r
205 Int_t nbins, Double_t lowLim, Double_t highLim) {\r
206 //\r
207 // Configure variables for the expert CF container\r
208 //\r
209 fExpertCFVarsEnabled[var] = kTRUE;\r
210 fExpertCFVarNBins[var] = nbins;\r
211 fExpertCFVarRanges[var][0] = lowLim;\r
212 fExpertCFVarRanges[var][1] = highLim;\r
213}\r
214\r
215\r
216//____________________________________________________________________\r
217void AliTRDcheckESD::AddExpertCFVar(AliTRDcheckESD::ETrdCfVariables var, \r
218 const Char_t* bins) {\r
219 //\r
220 // Configure variables for the expert CF container\r
221 //\r
222 fExpertCFVarsEnabled[var] = kTRUE;\r
223 fExpertCFVarBins[var] = bins;\r
224}\r
225\r
226\r
227//____________________________________________________________________\r
228void AliTRDcheckESD::UserCreateOutputObjects()\r
229{ \r
230 //\r
231 // Create Output Containers (TObjectArray containing 1D histograms)\r
232 //\r
233 Histos();\r
234 PostData(1, fHistos);\r
235}\r
236\r
237//____________________________________________________________________\r
238void AliTRDcheckESD::MakeSummaryFromCF(Double_t* trendValues, const Char_t* triggerName, Bool_t useIsolatedBC, Bool_t cutTOFbc){\r
239 //\r
240 // Draw summary plots for the ESDcheck task using the CF container\r
241 //\r
242\r
243 cout << "Make summary from CF" << endl;\r
244 TCanvas *cOut=0x0;\r
245 if(gROOT->FindObject("trackingSummary")) delete gROOT->FindObject("trackingSummary");\r
246 cOut = new TCanvas("trackingSummary", "Tracking summary for the ESD task", 1600, 1200);\r
247 cOut->cd();\r
248 PlotTrackingSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc);\r
249 cOut->SaveAs("trackingSummary.gif");\r
250 \r
251 if(gROOT->FindObject("pidSummary")) delete gROOT->FindObject("pidSummary");\r
252 cOut = new TCanvas("pidSummary", "PID summary for the ESD task", 1600, 1200);\r
253 cOut->cd();\r
254 //GetRefFigure(6);\r
255 PlotPidSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc);\r
256 cOut->SaveAs("pidSummary.gif");\r
257\r
258 if(gROOT->FindObject("centSummary")) delete gROOT->FindObject("centSummary");\r
259 cOut = new TCanvas("centSummary", "Centrality summary for the ESD task", 1600, 1200);\r
260 cOut->cd();\r
261 //GetRefFigure(7);\r
262 PlotCentSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc);\r
263 cOut->SaveAs("centSummary.gif");\r
264\r
265}\r
266\r
267\r
268//____________________________________________________________________\r
269void AliTRDcheckESD::MakeSummary(Double_t* trendValues){\r
270 //\r
271 // Draw summary plots for the ESDcheck task\r
272 //\r
273 // Old method to draw summary pictures from histograms. Use the MakeSummaryFromCF() when CF container is present\r
274 \r
275 cout << "Make summary" << endl;\r
276 TCanvas *cTracking=0x0;\r
277 if(gROOT->FindObject("trackingSummary")) delete gROOT->FindObject("trackingSummary");\r
278 cTracking = new TCanvas("trackingSummary", "Tracking summary for the ESD task", 1600, 1200);\r
279 cTracking->cd();\r
280 //GetRefFigure(5);\r
281 if(PlotTrackingSummary(0, trendValues))\r
282 cTracking->SaveAs("trackingSummary.gif");\r
283 \r
284 TCanvas* cPid = 0x0;\r
285 if(gROOT->FindObject("pidSummary")) delete gROOT->FindObject("pidSummary");\r
286 cPid = new TCanvas("pidSummary", "PID summary for the ESD task", 1600, 1200);\r
287 cPid->cd();\r
288 //GetRefFigure(6);\r
289 if(PlotPidSummary(0, trendValues))\r
290 cPid->SaveAs("pidSummary.gif");\r
291\r
292 TCanvas* cCent=0x0;\r
293 if(gROOT->FindObject("centSummary")) delete gROOT->FindObject("centSummary");\r
294 cCent = new TCanvas("centSummary", "Centrality summary for the ESD task", 1600, 1200);\r
295 cCent->cd();\r
296 //GetRefFigure(7);\r
297 if(PlotCentSummary(trendValues))\r
298 cCent->SaveAs("centSummary.gif");\r
299}\r
300\r
301//____________________________________________________________________\r
302Bool_t AliTRDcheckESD::GetRefFigure(Int_t ifig)\r
303{\r
304 //\r
305 // Produce reference Plots during PostProcessing\r
306 //\r
307 if(ifig>=fNRefFigures){\r
308 AliWarning(Form("Ref plot %d not available. Valid only up to %d", ifig, fNRefFigures));\r
309 return kFALSE;\r
310 }\r
311 if(!gPad){\r
312 AliWarning("Please provide a canvas to draw results.");\r
313 return kFALSE;\r
314 } else {\r
315 gPad->SetLogx(0);gPad->SetLogy(0);\r
316 gPad->SetMargin(0.125, 0.015, 0.1, 0.015);\r
317 }\r
318\r
319 const Char_t *title[20];\r
320 TH1 *hF(NULL);\r
321 if((hF=(TH1S*)gROOT->FindObject("hFcheckESD"))) delete hF;\r
322 TLegend *leg(NULL);\r
323 TList *l(NULL); TVirtualPad *pad(NULL);\r
324 TGraphErrors *g(NULL);TGraphAsymmErrors *ga(NULL);\r
325 TObjArray *arr(NULL);\r
326 TLatex *lat=new TLatex();\r
327 lat->SetTextSize(0.07);\r
328 lat->SetTextColor(2);\r
329 TLine line;\r
330 TTimeStamp now;\r
331 switch(ifig){\r
332 case kNCl: // number of clusters/track\r
333 if(!(arr = (TObjArray*)fResults->At(kNCl))) return kFALSE;\r
334\r
335 leg = new TLegend(.83, .7, .99, .96);\r
336 leg->SetHeader("Species");\r
337 leg->SetBorderSize(0); leg->SetFillStyle(0);\r
338 for(Int_t ig(0); ig<fgkNgraph[kNCl-1]; ig++){\r
339 if(!(g = (TGraphErrors*)arr->At(ig))) return kFALSE;\r
340 if(!g->GetN()) continue;\r
341 g->Draw(ig?"pc":"apc"); leg->AddEntry(g, g->GetTitle(), "pl");\r
342 if(ig) continue;\r
343 hF=g->GetHistogram();\r
344 hF->SetXTitle("no of clusters");\r
345 hF->SetYTitle("entries"); \r
346 hF->GetYaxis()->CenterTitle(1);\r
347 hF->GetYaxis()->SetTitleOffset(1.2);\r
348 hF->SetMinimum(5);\r
349 }\r
350 leg->Draw(); gPad->SetLogy();\r
351 break;\r
352 case kTRDstat: // Efficiency\r
353 if(!(arr = (TObjArray*)fResults->At(kTRDstat))) return kFALSE;\r
354 leg = new TLegend(.62, .77, .98, .98);\r
355 leg->SetHeader("TRD Efficiency");\r
356 leg->SetBorderSize(0); leg->SetFillStyle(0);\r
357 title[0] = "Geometrical (TRDin/TPCout)";\r
358 title[1] = "Tracking (TRDout/TRDin)";\r
359 title[2] = "PID (TRDpid/TRDin)";\r
360 title[3] = "Refit (TRDrefit/TRDin)";\r
361 hF = new TH1S("hFcheckESD", ";p [GeV/c];Efficiency", 10, 0.1, 10.);\r
362 hF->SetMaximum(1.4);\r
363 hF->GetXaxis()->SetMoreLogLabels();\r
364 hF->GetYaxis()->CenterTitle(1);\r
365 hF->Draw("p");\r
366 for(Int_t ig(0); ig<fgkNgraph[kTRDstat-1]; ig++){\r
367 if(!(g = (TGraphErrors*)arr->At(ig))) return kFALSE;\r
368 g->Draw("pl"); leg->AddEntry(g, title[ig], "pl");\r
369 //PutTrendValue(name[id], g->GetMean(2));\r
370 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));\r
371 }\r
372 leg->Draw(); gPad->SetLogx();\r
373 break;\r
374 case kTRDmom: // Energy loss\r
375 if(!(arr = (TObjArray*)fResults->At(kTRDmom))) return kFALSE;\r
376 leg = new TLegend(.65, .7, .95, .99);\r
377 leg->SetHeader("Energy Loss");\r
378 leg->SetBorderSize(1); leg->SetFillColor(0);\r
379 title[0] = "Max & 90% quantile";\r
380 title[1] = "Mean & 60% quantile";\r
381 hF = new TH1S("hFcheckESD", ";layer;#Delta E", 6, -0.5, 5.5);\r
382 hF->SetMaximum(1.3);hF->SetMinimum(-.3);\r
383 hF->Draw("p");\r
384 for(Int_t ig(0); ig<fgkNgraph[kTRDmom-1]; ig++){\r
385 if(!(ga = (TGraphAsymmErrors*)arr->At(ig))) return kFALSE;\r
386 ga->Draw("pl"); leg->AddEntry(ga, title[ig], "pl");\r
387 //PutTrendValue(name[id], g->GetMean(2));\r
388 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));\r
389 }\r
390 leg->Draw();gPad->SetLogx(kFALSE);\r
391 break;\r
392 case kPtRes: // Pt resolution @ vertex\r
393 if(!(arr = (TObjArray*)fResults->At(kPtRes))) return kFALSE;\r
394 gPad->Divide(2, 1, 1.e-5, 1.e-5); l=gPad->GetListOfPrimitives(); \r
395 pad = ((TVirtualPad*)l->At(0)); pad->cd(); pad->SetLogx();\r
396 pad->SetMargin(0.1, 0.022, 0.1, 0.023);\r
397 hF = new TH1S("hFcheckESD", "ITS+TPC+TRD;p_{t} [GeV/c];#Delta p_{t} / p_{t} [%]", 10, 0.2, 10.);\r
398 hF->SetMaximum(10.);hF->SetMinimum(-3.);\r
399 hF->GetXaxis()->SetMoreLogLabels();\r
400 hF->GetXaxis()->SetTitleOffset(1.2);\r
401 hF->GetYaxis()->CenterTitle();\r
402 hF->Draw("p");\r
403 //for(Int_t ig(0); ig<fgkNgraph[kPtRes-1]/2; ig++){\r
404 for(Int_t ig(2); ig<6; ig++){\r
405 if(!(g = (TGraphErrors*)arr->At(ig))) continue;\r
406 if(!g->GetN()) continue;\r
407 g->Draw("pl");\r
408 //PutTrendValue(name[id], g->GetMean(2));\r
409 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));\r
410 }\r
411 pad = ((TVirtualPad*)l->At(1)); pad->cd(); pad->SetLogx();\r
412 pad->SetMargin(0.1, 0.22, 0.1, 0.023);\r
413 hF = (TH1*)hF->Clone("hFcheckESD1");\r
414 hF->SetTitle("ITS+TPC");\r
415 hF->SetMaximum(10.);hF->SetMinimum(-3.);\r
416 hF->Draw("p");\r
417 leg = new TLegend(.78, .1, .99, .98);\r
418 leg->SetHeader("P_{t} @ DCA");\r
419 leg->SetBorderSize(1); leg->SetFillColor(0);\r
420 leg->SetTextAlign(22);\r
421 leg->SetTextFont(12);\r
422 leg->SetTextSize(0.03813559);\r
423 {\r
424 Int_t nPlots(0);\r
425 //for(Int_t ig(fgkNgraph[kPtRes-1]/2); ig<fgkNgraph[kPtRes-1]; ig++){\r
426 for(Int_t ig(12); ig<16; ig++){\r
427 if(!(g = (TGraphErrors*)arr->At(ig))) continue;\r
428 if(!g->GetN()) continue;\r
429 nPlots++;\r
430 g->Draw("pl"); leg->AddEntry(g, g->GetTitle(), "pl");\r
431 //PutTrendValue(name[id], g->GetMean(2));\r
432 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));\r
433 }\r
434 if(nPlots) leg->Draw();\r
435 }\r
436 break;\r
437 case 5: // plot a 3x3 canvas with tracking related histograms\r
438 PlotTrackingSummary(0);\r
439 break;\r
440 \r
441 case 6: // plot a 3x3 canvas with PID related histograms\r
442 PlotPidSummary(0);\r
443 break;\r
444\r
445 case 7: // plot a 3x3 canvas with centrality dependence histograms\r
446 PlotCentSummary();\r
447 break;\r
448\r
449 }\r
450 return kTRUE;\r
451}\r
452\r
453//____________________________________________________________________\r
454void AliTRDcheckESD::UserExec(Option_t *){\r
455 //\r
456 // Run the Analysis\r
457 //\r
458 fESD = dynamic_cast<AliESDEvent*>(InputEvent());\r
459 fMC = MCEvent();\r
460\r
461 if(!fESD){\r
462 AliError("ESD event missing.");\r
463 return;\r
464 }\r
465 \r
466 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
467 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
468 if(!inputHandler) return;\r
469 \r
470 if(!fPhysSelTriggersEnabled) {\r
471 InitializeCFContainers();\r
472 fPhysSelTriggersEnabled = kTRUE;\r
473 }\r
474 \r
475 UInt_t isSelected = AliVEvent::kAny;\r
476 if(inputHandler){\r
477 if(inputHandler->GetEventSelection()) {\r
478 isSelected = inputHandler->IsEventSelected();\r
479 }\r
480 }\r
481 if(!isSelected) return;\r
482 \r
483 TString triggerClasses = fESD->GetFiredTriggerClasses();\r
484 //cout << "triggers fired: " << triggerClasses.Data() << endl;\r
485 TObjArray* triggers = triggerClasses.Tokenize(" ");\r
486 if(triggers->GetEntries()<1) return;\r
487 Int_t triggerIndices[kNMaxAssignedTriggers] = {0};\r
488 for(Int_t i=0; i<triggers->GetEntries(); ++i) {\r
489 //cout << "check trigger " << triggers->At(i)->GetName() << endl;\r
490 if(i>=kNMaxAssignedTriggers) continue;\r
491 triggerIndices[i] = GetTriggerIndex(triggers->At(i)->GetName(), kFALSE);\r
492 } \r
493 if(!fNAssignedTriggers) {\r
494 triggerIndices[0] = 1;\r
495 ((TH1F*)fHistos->At(kTriggerDefs))->Fill(triggerIndices[0]);\r
496 }\r
497 else {\r
498 for(Int_t i=0; i<triggers->GetEntries(); ++i) \r
499 ((TH1F*)fHistos->At(kTriggerDefs))->Fill(triggerIndices[i]);\r
500 }\r
501 \r
502 // Get MC information if available\r
503 AliStack * fStack = NULL;\r
504 if(HasMC()){\r
505 if(!fMC){ \r
506 AliWarning("MC event missing");\r
507 SetMC(kFALSE);\r
508 } else {\r
509 if(!(fStack = fMC->Stack())){\r
510 AliWarning("MC stack missing");\r
511 SetMC(kFALSE);\r
512 }\r
513 }\r
514 }\r
515 TH1 *h(NULL);\r
516 \r
517 Double_t values[kNTrdCfVariables]; // array where the CF container variables are stored\r
518 values[kEventVtxZ] = fESD->GetPrimaryVertex()->GetZv();\r
519 values[kEventBC] = fESD->GetBunchCrossNumber();\r
520 \r
521 const AliMultiplicity* mult=fESD->GetMultiplicity();\r
522 Double_t itsNTracklets = mult->GetNumberOfTracklets();\r
523 if(itsNTracklets<1) return;\r
524 Int_t multLimits[6] = {0, 700, 1400, 2100, 2800, 3500};\r
525 Int_t centralityClass = 0;\r
526 for(Int_t iCent=0; iCent<5; ++iCent) {\r
527 if(itsNTracklets>=multLimits[iCent] && itsNTracklets<multLimits[iCent+1])\r
528 centralityClass=iCent+1;\r
529 }\r
530 values[kEventMult] = itsNTracklets;\r
531 if(centralityClass == 0) return;\r
532 \r
533 Double_t* valuesMatchingPhiEtaCF = new Double_t[fMatchingPhiEtaCF->GetNVar()];\r
534 Double_t* valuesMatchingPtCF = new Double_t[fMatchingPtCF->GetNVar()];\r
535 Double_t* valuesBCCF = new Double_t[fBunchCrossingsCF->GetNVar()];\r
536 Double_t* valuesCentCF = new Double_t[fCentralityCF->GetNVar()];\r
537 Double_t* valuesQtotCF = new Double_t[fQtotCF->GetNVar()];\r
538 Double_t* valuesPHCF = new Double_t[fPulseHeightCF->GetNVar()];\r
539 Double_t* valuesExpertCF = (fExpertCF ? new Double_t[fExpertCF->GetNVar()] : 0x0);\r
540 \r
541 AliESDtrack *esdTrack(NULL);\r
542 for(Int_t itrk = 0; itrk < fESD->GetNumberOfTracks(); itrk++){\r
543 esdTrack = fESD->GetTrack(itrk);\r
544 if(!fReferenceTrackFilter->IsSelected(esdTrack)) continue;\r
545 \r
546 ULong_t status = esdTrack->GetStatus(); //PrintStatus(status);\r
547 \r
548 // pid quality\r
549 Bool_t kBarrel = Bool_t(status & AliESDtrack::kTRDin);\r
550\r
551 // find position and momentum of the track at entrance in TRD\r
552 Double_t rTRD[6] = {298.0, 311.0, 324.0, 337.0, 350.0, 363.0};\r
553 Double_t localCoord[6][3] = {{0.0}};\r
554 Bool_t localCoordGood[6];\r
555 for(Int_t il=0;il<6;++il) localCoordGood[il] = esdTrack->GetXYZAt(rTRD[il], fESD->GetMagneticField(), localCoord[il]);\r
556 Double_t localMom[6][3] = {{0.0}};\r
557 Bool_t localMomGood[6];\r
558 for(Int_t il=0; il<6; ++il) localMomGood[il] = esdTrack->GetPxPyPzAt(rTRD[il], fESD->GetMagneticField(), localMom[il]);\r
559 //Double_t localPhi = (localMomGood ? TMath::ATan2(localMom[1], localMom[0]) : 0.0);\r
560 Double_t localSagitaPhi[6] = {-999.};\r
561 for(Int_t il=0; il<6; ++il) localSagitaPhi[il] = (localCoordGood[il] ? TMath::ATan2(localCoord[il][1], localCoord[il][0]) : -999.);\r
562\r
563 values[kTrackTOFBC] = esdTrack->GetTOFBunchCrossing(fESD->GetMagneticField());\r
564 Float_t dcaXY=0.0; Float_t dcaZ=0.0;\r
565 esdTrack->GetImpactParameters(dcaXY, dcaZ);\r
566 values[kTrackDCAxy] = dcaXY;\r
567 values[kTrackDCAz] = dcaZ;\r
568 values[kTrackCharge] = esdTrack->Charge();\r
569 values[kTrackPhi] = localSagitaPhi[0];\r
570 values[kTrackEta] = esdTrack->Eta();\r
571 values[kTrackPt] = esdTrack->Pt();\r
572 values[kTrackP] = esdTrack->P();\r
573 values[kTrackTrdTracklets] = esdTrack->GetTRDntracklets();\r
574 values[kTrackTrdClusters] = esdTrack->GetTRDncls();\r
575 for(Int_t i=0; i<6; ++i) values[kTrackQtot+i] = 0.0;\r
576 \r
577 if(localCoordGood[0] && localMomGood[0]) {\r
578 for(Int_t itrig=0; itrig<triggers->GetEntries(); ++itrig) {\r
579 values[kEventTrigger] = triggerIndices[itrig];\r
580 if((fMatchingPhiEtaCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPhiEtaCF->GetVar("trigger")>=0)) {\r
581 for(Int_t iv=0; iv<fMatchingPhiEtaCF->GetNVar(); ++iv) valuesMatchingPhiEtaCF[iv] = values[fMatchingPhiEtaCFVars[iv]];\r
582 fMatchingPhiEtaCF->Fill(valuesMatchingPhiEtaCF, 0);\r
583 }\r
584 if((fMatchingPtCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPtCF->GetVar("trigger")>=0)) {\r
585 for(Int_t iv=0; iv<fMatchingPtCF->GetNVar(); ++iv) valuesMatchingPtCF[iv] = values[fMatchingPtCFVars[iv]];\r
586 fMatchingPtCF->Fill(valuesMatchingPtCF, 0);\r
587 }\r
588 if(values[kTrackPt]>1.0 && values[kTrackPt]<3.0)\r
589 if((fBunchCrossingsCF->GetVar("trigger")<0 && itrig==0) || (fBunchCrossingsCF->GetVar("trigger")>=0)) {\r
590 for(Int_t iv=0; iv<fBunchCrossingsCF->GetNVar(); ++iv) valuesBCCF[iv] = values[fBunchCrossingsCFVars[iv]];\r
591 fBunchCrossingsCF->Fill(valuesBCCF, 0);\r
592 }\r
593 if(fExpertCF) {\r
594 if((fExpertCF->GetVar("trigger")<0 && itrig==0) || (fExpertCF->GetVar("trigger")>=0))\r
595 if(fExpertCF->GetStep("TPC")>=0 && fExpertCF->GetStep("TPC")<3) {\r
596 for(Int_t iv=0; iv<fExpertCF->GetNVar(); ++iv) valuesExpertCF[iv] = values[fExpertCFVars[iv]];\r
597 fExpertCF->Fill(valuesExpertCF, fExpertCF->GetStep("TPC"));\r
598 }\r
599 }\r
600 }\r
601 }\r
602 \r
603 // TRD reference tracks\r
604 if(values[kTrackTrdTracklets]>=1) {\r
605 // (slicePH,sliceNo) distribution and Qtot from slices\r
606 for(Int_t iPlane=0; iPlane<6; iPlane++) {\r
607 values[kTrackQtot+iPlane] = fgkQs*esdTrack->GetTRDslice(iPlane, 0);\r
608 values[kTrackPhi] = localSagitaPhi[iPlane];\r
609 for(Int_t itrig=0; itrig<triggers->GetEntries(); ++itrig) {\r
610 values[kEventTrigger] = triggerIndices[itrig];\r
611 if((fCentralityCF->GetVar("trigger")<0 && itrig==0) || (fCentralityCF->GetVar("trigger")>=0)) {\r
612 for(Int_t iv=0; iv<fCentralityCF->GetNVar(); ++iv) valuesCentCF[iv] = values[fCentralityCFVars[iv]];\r
613 valuesCentCF[fCentralityCF->GetNVar()-1] = values[kTrackQtot+iPlane];\r
614 fCentralityCF->Fill(valuesCentCF, 0);\r
615 }\r
616 if(values[kTrackTrdTracklets]>=4)\r
617 if((fQtotCF->GetVar("trigger")<0 && itrig==0) || (fQtotCF->GetVar("trigger")>=0)) {\r
618 for(Int_t iv=0; iv<fQtotCF->GetNVar()-2; ++iv) valuesQtotCF[iv] = values[fQtotCFVars[iv]];\r
619 valuesQtotCF[fQtotCF->GetNVar()-2] = values[kTrackQtot+iPlane];\r
620 valuesQtotCF[fQtotCF->GetNVar()-1] = iPlane;\r
621 fQtotCF->Fill(valuesQtotCF, 0);\r
622 }\r
623 }\r
624 for(Int_t iSlice=0; iSlice<8; iSlice++) {\r
625 if(esdTrack->GetTRDslice(iPlane, iSlice)>20.) {\r
626 values[kTrackPHslice+iSlice] = fgkQs*esdTrack->GetTRDslice(iPlane, iSlice);\r
627 h = (TH2F*)fHistos->At(kPHSlice); h->Fill(iSlice, values[kTrackPHslice+iSlice]);\r
628 h = (TH2F*)fHistos->At(kPHSlice+centralityClass); h->Fill(iSlice, values[kTrackPHslice+iSlice]);\r
629 for(Int_t itrig=0; itrig<triggers->GetEntries(); ++itrig) {\r
630 values[kEventTrigger] = triggerIndices[itrig];\r
631 if((fPulseHeightCF->GetVar("trigger")<0 && itrig==0) || (fPulseHeightCF->GetVar("trigger")>=0)) {\r
632 for(Int_t iv=0; iv<fPulseHeightCF->GetNVar()-2; ++iv) valuesPHCF[iv] = values[fPulseHeightCFVars[iv]];\r
633 valuesPHCF[fPulseHeightCF->GetNVar()-2] = values[kTrackPHslice+iSlice];\r
634 valuesPHCF[fPulseHeightCF->GetNVar()-1] = iSlice;\r
635 fPulseHeightCF->Fill(valuesPHCF, 0);\r
636 }\r
637 }\r
638 }\r
639 }\r
640 }\r
641 values[kTrackPhi] = localSagitaPhi[0];\r
642 \r
643 if(localCoordGood[0] && localMomGood[0]) {\r
644 for(Int_t itrig=0; itrig<triggers->GetEntries(); ++itrig) {\r
645 values[kEventTrigger] = triggerIndices[itrig];\r
646 if((fMatchingPhiEtaCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPhiEtaCF->GetVar("trigger")>=0)) {\r
647 for(Int_t iv=0; iv<fMatchingPhiEtaCF->GetNVar(); ++iv) valuesMatchingPhiEtaCF[iv] = values[fMatchingPhiEtaCFVars[iv]];\r
648 fMatchingPhiEtaCF->Fill(valuesMatchingPhiEtaCF, 1);\r
649 }\r
650 if((fMatchingPtCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPtCF->GetVar("trigger")>=0)) {\r
651 for(Int_t iv=0; iv<fMatchingPtCF->GetNVar(); ++iv) valuesMatchingPtCF[iv] = values[fMatchingPtCFVars[iv]];\r
652 fMatchingPtCF->Fill(valuesMatchingPtCF, 1);\r
653 }\r
654 if(values[kTrackPt]>1.0 && values[kTrackPt]<3.0)\r
655 if((fBunchCrossingsCF->GetVar("trigger")<0 && itrig==0) || (fBunchCrossingsCF->GetVar("trigger")>=0)) {\r
656 for(Int_t iv=0; iv<fBunchCrossingsCF->GetNVar(); ++iv) valuesBCCF[iv] = values[fBunchCrossingsCFVars[iv]];\r
657 fBunchCrossingsCF->Fill(valuesBCCF, 1);\r
658 }\r
659 if(fExpertCF) {\r
660 if((fExpertCF->GetVar("trigger")<0 && itrig==0) || (fExpertCF->GetVar("trigger")>=0)) {\r
661 if(fExpertCF->GetStep("TRD")>=0 && fExpertCF->GetStep("TRD")<3) {\r
662 for(Int_t iv=0; iv<fExpertCF->GetNVar(); ++iv) valuesExpertCF[iv] = values[fExpertCFVars[iv]];\r
663 fExpertCF->Fill(valuesExpertCF, fExpertCF->GetStep("TRD"));\r
664 }\r
665 }\r
666 } \r
667 }\r
668 if(Bool_t(status & AliESDtrack::kTOFpid)) {\r
669 for(Int_t itrig=0; itrig<triggers->GetEntries(); ++itrig) {\r
670 values[kEventTrigger] = triggerIndices[itrig];\r
671 if((fMatchingPhiEtaCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPhiEtaCF->GetVar("trigger")>=0)) {\r
672 for(Int_t iv=0; iv<fMatchingPhiEtaCF->GetNVar(); ++iv) valuesMatchingPhiEtaCF[iv] = values[fMatchingPhiEtaCFVars[iv]];\r
673 fMatchingPhiEtaCF->Fill(valuesMatchingPhiEtaCF, 2);\r
674 }\r
675 if((fMatchingPtCF->GetVar("trigger")<0 && itrig==0) || (fMatchingPtCF->GetVar("trigger")>=0)) {\r
676 for(Int_t iv=0; iv<fMatchingPtCF->GetNVar(); ++iv) valuesMatchingPtCF[iv] = values[fMatchingPtCFVars[iv]];\r
677 fMatchingPtCF->Fill(valuesMatchingPtCF, 2);\r
678 }\r
679 if(values[kTrackPt]>1.0 && values[kTrackPt]<3.0)\r
680 if((fBunchCrossingsCF->GetVar("trigger")<0 && itrig==0) || (fBunchCrossingsCF->GetVar("trigger")>=0)) {\r
681 for(Int_t iv=0; iv<fBunchCrossingsCF->GetNVar(); ++iv) valuesBCCF[iv] = values[fBunchCrossingsCFVars[iv]];\r
682 fBunchCrossingsCF->Fill(valuesBCCF, 2);\r
683 }\r
684 if(fExpertCF) {\r
685 if((fExpertCF->GetVar("trigger")<0 && itrig==0) || (fExpertCF->GetVar("trigger")>=0)) {\r
686 if(fExpertCF->GetStep("TOF")>=0 && fExpertCF->GetStep("TOF")<3) {\r
687 for(Int_t iv=0; iv<fExpertCF->GetNVar(); ++iv) valuesExpertCF[iv] = values[fExpertCFVars[iv]];\r
688 fExpertCF->Fill(valuesExpertCF, fExpertCF->GetStep("TOF"));\r
689 }\r
690 }\r
691 }\r
692 }\r
693 }\r
694 }\r
695 } // end if nTRDtrkl>=1\r
696 \r
697 // look at external track param\r
698 const AliExternalTrackParam *op = esdTrack->GetOuterParam();\r
699 const AliExternalTrackParam *ip = esdTrack->GetInnerParam();\r
700\r
701 Double_t pt(0.), pt0(0.), ptTRD(0.); \r
702 // read MC info if available\r
703 Bool_t kFOUND(kFALSE), kPhysPrim(kFALSE);\r
704 AliMCParticle *mcParticle(NULL);\r
705 if(HasMC()){\r
706 AliTrackReference *ref(NULL); \r
707 Int_t fLabel(esdTrack->GetLabel());\r
708 Int_t fIdx(TMath::Abs(fLabel));\r
709 if(!fStack || fIdx > fStack->GetNtrack()) continue; \r
710 \r
711 // read MC particle \r
712 if(!(mcParticle = (AliMCParticle*) fMC->GetTrack(fIdx))) {\r
713 AliWarning(Form("MC particle missing. Label[ %d].", fLabel));\r
714 continue;\r
715 }\r
716 \r
717 pt = esdTrack->Pt();\r
718 pt0 = mcParticle->Pt();\r
719 //Double_t eta0 = mcParticle->Eta();\r
720 //Double_t phi0 = mcParticle->Phi();\r
721 kPhysPrim = fMC->IsPhysicalPrimary(fIdx);\r
722\r
723 // read track references\r
724 Int_t nRefs = mcParticle->GetNumberOfTrackReferences();\r
725 if(!nRefs){\r
726 AliWarning(Form("No TR found for track @ Label[%d].", fLabel));\r
727 continue;\r
728 }\r
729 Int_t iref = 0;\r
730 while(iref<nRefs){\r
731 ref = mcParticle->GetTrackReference(iref);\r
732 if(ref->LocalX() > fgkxTPC) break;\r
733 ref=NULL; iref++;\r
734 }\r
735 if(ref){ \r
736 if(ref->LocalX() > fgkxTOF){ // track skipping TRD fiducial volume\r
737 ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));\r
738 }\r
739 } else { // track stopped in TPC \r
740 ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));\r
741 }\r
742 ptTRD = ref->Pt();kFOUND=kTRUE;\r
743 } else { // use reconstructed values\r
744 if(op){\r
745 Double_t x(op->GetX());\r
746 if(x<fgkxTOF && x>fgkxTPC){\r
747 ptTRD=op->Pt();\r
748 kFOUND=kTRUE;\r
749 }\r
750 }\r
751\r
752 if(!kFOUND && ip){\r
753 ptTRD=ip->Pt();\r
754 kFOUND=kTRUE;\r
755 }\r
756 } // end if(HasMC())\r
757\r
758 if(kFOUND){\r
759 h = (TH2I*)fHistos->At(kTRDstat);\r
760 if(status & AliESDtrack::kTPCout) h->Fill(ptTRD, kTPCout);\r
761 if(status & AliESDtrack::kTRDin) h->Fill(ptTRD, kTRDin);\r
762 if(kBarrel && (status & AliESDtrack::kTRDout)) h->Fill(ptTRD, kTRDout);\r
763 if(kBarrel && (status & AliESDtrack::kTRDpid)) h->Fill(ptTRD, kTRDpid);\r
764 if(kBarrel && (status & AliESDtrack::kTRDrefit)) h->Fill(ptTRD, kTRDref);\r
765 }\r
766 Int_t idx(HasMC() ? Pdg2Idx(TMath::Abs(mcParticle->PdgCode())): 0)\r
767 ,sgn(esdTrack->Charge()<0?0:1);\r
768 if(kBarrel && kPhysPrim) {\r
769 TH3 *h3 = (TH3S*)fHistos->At(kPtRes);\r
770 Int_t offset = (status & AliESDtrack::kTRDrefit) ? 0 : 10; \r
771 h3->Fill(pt0, 1.e2*(pt/pt0-1.), \r
772 offset + 2*idx + sgn);\r
773 }\r
774 ((TH1*)fHistos->At(kNCl))->Fill(esdTrack->GetTRDncls(), 2*idx + sgn);\r
775 if(ip){\r
776 h = (TH2I*)fHistos->At(kTRDmom);\r
777 Float_t pTRD(0.);\r
778 for(Int_t ily=6; ily--;){\r
779 if((pTRD=esdTrack->GetTRDmomentum(ily))<0.) continue;\r
780 h->Fill(ip->GetP()-pTRD, ily);\r
781 }\r
782 }\r
783 } // end loop over tracks\r
784 \r
785 \r
dffc3357 786 triggers->Delete(); delete triggers;\r
7b67bbf9 787 delete [] valuesMatchingPhiEtaCF;\r
788 delete [] valuesMatchingPtCF;\r
789 delete [] valuesBCCF;\r
790 delete [] valuesCentCF;\r
791 delete [] valuesQtotCF;\r
792 delete [] valuesPHCF;\r
793 if(valuesExpertCF) delete [] valuesExpertCF;\r
794 \r
795 PostData(1, fHistos);\r
796}\r
797\r
798//____________________________________________________________________\r
799TObjArray* AliTRDcheckESD::Histos()\r
800{\r
801// Retrieve histograms array if already build or build it\r
802\r
803 if(fHistos) return fHistos;\r
804\r
805 fHistos = new TObjArray(kNhistos+1);\r
806 fHistos->SetOwner(kTRUE);\r
807\r
808 TH1 *h = NULL;\r
809\r
810 // clusters per track\r
811 const Int_t kNpt(30);\r
812 Float_t pt(0.2);\r
813 Float_t binsPt[kNpt+1];\r
814 for(Int_t i=0;i<kNpt+1; i++,pt+=(TMath::Exp(i*i*.001)-1.)) binsPt[i]=pt;\r
815 if(!(h = (TH2I*)gROOT->FindObject("hNCl"))){\r
816 h = new TH2I("hNCl", "Clusters per TRD track;N_{cl}^{TRD};SPECIES;entries", 60, 0., 180., 10, -0.5, 9.5);\r
817 TAxis *ay(h->GetYaxis());\r
818 ay->SetLabelOffset(0.015);\r
819 for(Int_t i(0); i<AliPID::kSPECIES; i++){\r
820 ay->SetBinLabel(2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));\r
821 ay->SetBinLabel(2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));\r
822 }\r
823 } else h->Reset();\r
824 fHistos->AddAt(h, kNCl); fNRefFigures++;\r
825\r
826 // status bits histogram\r
827 const Int_t kNbits(5);\r
828 Float_t bits(.5);\r
829 Float_t binsBits[kNbits+1];\r
830 for(Int_t i=0; i<kNbits+1; i++,bits+=1.) binsBits[i]=bits;\r
831 if(!(h = (TH2I*)gROOT->FindObject("hTRDstat"))){\r
832 h = new TH2I("hTRDstat", "TRD status bits;p_{t} @ TRD [GeV/c];status;entries", kNpt, binsPt, kNbits, binsBits);\r
833 TAxis *ay(h->GetYaxis());\r
834 ay->SetBinLabel(1, "kTPCout");\r
835 ay->SetBinLabel(2, "kTRDin");\r
836 ay->SetBinLabel(3, "kTRDout");\r
837 ay->SetBinLabel(4, "kTRDpid");\r
838 ay->SetBinLabel(5, "kTRDrefit");\r
839 } else h->Reset();\r
840 fHistos->AddAt(h, kTRDstat);\r
841\r
842 // energy loss\r
843 if(!(h = (TH2I*)gROOT->FindObject("hTRDmom"))){\r
844 h = new TH2I("hTRDmom", "TRD energy loss;p_{inner} - p_{ly} [GeV/c];ly;entries", 100, -1., 2., 6, -0.5, 5.5);\r
845 } else h->Reset();\r
846 fHistos->AddAt(h, kTRDmom);\r
847 //if(!HasMC()) return fHistos;\r
848\r
849 // pt resolution\r
850 const Int_t kNdpt(100), kNspec(4*AliPID::kSPECIES);\r
851 Float_t dpt(-3.), spec(-0.5);\r
852 Float_t binsDPt[kNdpt+1], binsSpec[kNspec+1];\r
853 for(Int_t i=0; i<kNdpt+1; i++,dpt+=6.e-2) binsDPt[i]=dpt;\r
854 for(Int_t i=0; i<kNspec+1; i++,spec+=1.) binsSpec[i]=spec;\r
855 if(!(h = (TH3S*)gROOT->FindObject("hPtRes"))){\r
856 h = new TH3S("hPtRes", "P_{t} resolution @ DCA;p_{t}^{MC} [GeV/c];#Delta p_{t}/p_{t}^{MC} [%];SPECIES", kNpt, binsPt, kNdpt, binsDPt, kNspec, binsSpec);\r
857 TAxis *az(h->GetZaxis());\r
858 az->SetLabelOffset(0.015);\r
859 for(Int_t i(0); i<AliPID::kSPECIES; i++){\r
860 az->SetBinLabel(2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));\r
861 az->SetBinLabel(2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));\r
862 az->SetBinLabel(10+2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));\r
863 az->SetBinLabel(10+2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));\r
864 }\r
865 } else h->Reset();\r
866 fHistos->AddAt(h, kPtRes);\r
867\r
868 // TPC event vertex distribution\r
869 if(!(h = (TH1F*)gROOT->FindObject("hTPCVertex"))){\r
870 h = new TH1F("hTPCVertex", "Event vertex Z coord. from TPC tracks", 100, -25., 25.);\r
871 } else h->Reset();\r
872 fHistos->AddAt(h, kTPCVertex);\r
873 \r
874 // Event vertex\r
875 if(!(h = (TH1F*)gROOT->FindObject("hEventVertex"))){\r
876 h = new TH1F("hEventVertex", "Event vertex Z coord.", 100, -25., 25.);\r
877 } else h->Reset();\r
878 fHistos->AddAt(h, kEventVertex);\r
879 \r
880 // Number of all tracks\r
881 if(!(h = (TH1I*)gROOT->FindObject("hNTracksAll"))){\r
882 h = new TH1I("hNTracksAll", "Number of tracks per event, event vertex cuts", 5000, 0, 5000);\r
883 } else h->Reset();\r
884 fHistos->AddAt(h, kNTracksAll);\r
885 \r
886 // Number of tracks in acceptance and DCA cut\r
887 if(!(h = (TH1I*)gROOT->FindObject("hNTracksAcc"))){\r
888 h = new TH1I("hNTracksAcc", Form("Number of tracks per event, |#eta|<%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",\r
889 fgkEta, fgkTrkDCAxy, fgkTrkDCAz), 5000, 0, 5000);\r
890 } else h->Reset();\r
891 fHistos->AddAt(h, kNTracksAcc);\r
892 \r
893 // Number of tracks in TPC (Ncls>10)\r
894 if(!(h = (TH1I*)gROOT->FindObject("hNTracksTPC"))){\r
895 h = new TH1I("hNTracksTPC", Form("Number of tracks per event, |#eta|<%.1f, pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
896 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 5000, 0, 5000);\r
897 } else h->Reset();\r
898 fHistos->AddAt(h, kNTracksTPC);\r
899 \r
900 // Distribution of DCA-xy\r
901 if(!(h = (TH1F*)gROOT->FindObject("hDCAxy"))){\r
902 h = new TH1F("hDCAxy", "Distribution of transverse DCA", 100, -100., 100.);\r
903 } else h->Reset();\r
904 fHistos->AddAt(h, kDCAxy);\r
905 \r
906 // Distribution of DCA-z\r
907 if(!(h = (TH1F*)gROOT->FindObject("hDCAz"))){\r
908 h = new TH1F("hDCAz", "Distribution of longitudinal DCA", 100, -100., 100.);\r
909 } else h->Reset();\r
910 fHistos->AddAt(h, kDCAz);\r
911 \r
912 Double_t binPtLimits[33] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,\r
913 1.0, 1.1, 1.2, 1.3, 1.4, \r
914 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0,\r
915 3.4, 3.8, 4.2, 4.6, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};\r
916 // Pt distributions\r
917 if(!(h = (TH1F*)gROOT->FindObject("hPt1"))){\r
918 h = new TH1F("hPt1", Form("dN/dpt, |#eta|<%.1f and pt>%.1f", fgkEta, fgkPt), 32, binPtLimits);\r
919 } else h->Reset();\r
920 fHistos->AddAt(h, kPt1);\r
921 \r
922 if(!(h = (TH1F*)gROOT->FindObject("hPt2"))){\r
923 h = new TH1F("hPt2", Form("dN/dpt, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",\r
924 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 32, binPtLimits);\r
925 } else h->Reset();\r
926 fHistos->AddAt(h, kPt2);\r
927 \r
928 if(!(h = (TH1F*)gROOT->FindObject("hPt3pos"))){\r
929 h = new TH1F("hPt3pos", Form("dN/dpt (positives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
930 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);\r
931 } else h->Reset();\r
932 fHistos->AddAt(h, kPt3pos);\r
933 \r
934 if(!(h = (TH1F*)gROOT->FindObject("hPt3neg"))){\r
935 h = new TH1F("hPt3neg", Form("dN/dpt (negatives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
936 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);\r
937 } else h->Reset();\r
938 fHistos->AddAt(h, kPt3neg);\r
939 \r
940 if(!(h = (TH1F*)gROOT->FindObject("hPt4pos"))){\r
941 h = new TH1F("hPt4pos", Form("dN/dpt (positives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",\r
942 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);\r
943 } else h->Reset();\r
944 fHistos->AddAt(h, kPt4pos);\r
945 \r
946 if(!(h = (TH1F*)gROOT->FindObject("hPt4neg"))){\r
947 h = new TH1F("hPt4pos", Form("dN/dpt (negatives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",\r
948 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);\r
949 } else h->Reset();\r
950 fHistos->AddAt(h, kPt4neg);\r
951 \r
952 // theta distribution of TRD tracks\r
953 if(!(h = (TH1F*)gROOT->FindObject("hTheta"))){\r
954 h = new TH1F("hTheta", Form("dN/d#theta, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",\r
955 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 220,.5,2.7);\r
956 } else h->Reset();\r
957 fHistos->AddAt(h, kTheta);\r
958 \r
959 // phi distribution of TRD tracks\r
960 if(!(h = (TH1F*)gROOT->FindObject("hPhi"))){\r
961 h = new TH1F("hPhi", Form("dN/d#varphi, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",\r
962 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 157,0,6.28);\r
963 } else h->Reset();\r
964 fHistos->AddAt(h, kPhi);\r
965 \r
966 // TPC cluster distribution\r
967 if(!(h = (TH1F*)gROOT->FindObject("hNTPCCl"))){\r
968 h = new TH1I("hNTPCCl", Form("Number of TPC clusters/track, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",\r
969 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 160, 0, 160);\r
970 } else h->Reset();\r
971 fHistos->AddAt(h, kNTPCCl);\r
972 \r
973 if(!(h = (TH1I*)gROOT->FindObject("hNTPCCl2"))){\r
974 h = new TH1F("hNTPCCl2", Form("Number of TPC clusters/track, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, pt>1.0 GeV/c",\r
975 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 160, 0, 160);\r
976 } else h->Reset();\r
977 fHistos->AddAt(h, kNTPCCl2);\r
978 \r
979 // dE/dx vs P for TPC reference tracks\r
980 if(!(h = (TH2F*)gROOT->FindObject("hTPCDedx"))){\r
981 h = new TH2F("hTPCDedx", Form("TPC dE/dx vs P, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
982 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 150, 0, 150.);\r
983 } else h->Reset();\r
984 fHistos->AddAt(h, kTPCDedx);\r
985 \r
986 // eta,phi distribution of TPC reference tracks\r
987 if(!(h = (TH2F*)gROOT->FindObject("hEtaPhi"))){\r
988 h = new TH2F("hEtaPhi", Form("TPC (#eta,#varphi), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
989 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 50, -1, 1, 157, 0, 6.28);\r
990 } else h->Reset();\r
991 fHistos->AddAt(h, kEtaPhi);\r
992 \r
993 // Nclusters vs eta distribution for TPC tracks\r
994 if(!(h = (TH2F*)gROOT->FindObject("hEtaNclsTPC"))){\r
995 h = new TH2F("hEtaNclsTPC", Form("TPC Nclusters vs. #eta, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",\r
996 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 50, -1, 1, 160, 0, 160.);\r
997 } else h->Reset();\r
998 fHistos->AddAt(h, kEtaNclsTPC);\r
999 \r
1000 // Nclusters vs phi distribution for TPC reference tracks\r
1001 if(!(h = (TH2F*)gROOT->FindObject("hPhiNclsTPC"))){\r
1002 h = new TH2F("hPhiNclsTPC", Form("TPC Nclusters vs. #varphi, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",\r
1003 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 157, 0, 6.28, 160, 0, 160.);\r
1004 } else h->Reset();\r
1005 fHistos->AddAt(h, kPhiNclsTPC);\r
1006\r
1007 // SPD multiplicity distribution\r
1008 if(!(h = (TH1F*)gROOT->FindObject("hSPDMult"))){\r
1009 h = new TH1F("hSPDMult", "SPD multiplicity", 10000, -0.5, 9999.5);\r
1010 } else h->Reset();\r
1011 fHistos->AddAt(h, kSPDMult);\r
1012\r
1013 // Ntracklets/track vs P for TRD reference tracks\r
1014 Double_t binsP[19] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.7, 2.0,\r
1015 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 7.0, 9.0, 12.0};\r
1016 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1017 if(!(h = (TH2F*)gROOT->FindObject(Form("hNTrackletsTRD_cent%d",iCent+1)))){\r
1018 h = new TH2F(Form("hNTrackletsTRD_cent%d",iCent+1), Form("TRD Ntracklets/track vs. P, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1019 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 7, -0.5, 6.5);\r
1020 } else h->Reset();\r
1021 fHistos->AddAt(h, kNTrackletsTRD+iCent);\r
1022 }\r
1023 \r
1024 // Nclusters/track vs P for TRD reference tracks\r
1025 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1026 if(!(h = (TH2F*)gROOT->FindObject(Form("hNClsTrackTRD_cent%d",iCent+1)))){\r
1027 h = new TH2F(Form("hNClsTrackTRD_cent%d",iCent+1), Form("TRD Nclusters/track vs. P, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1028 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 300, 0., 300.);\r
1029 } else h->Reset();\r
1030 fHistos->AddAt(h, kNClsTrackTRD+iCent);\r
1031 } \r
1032\r
1033 // <PH> vs slice number for TRD reference tracklets\r
1034 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1035 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSlice_cent%d",iCent+1)))){\r
1036 h = new TH2F(Form("hPHSlice_cent%d",iCent+1), Form("<PH> vs sliceNo, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1037 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 200, 0., 2000.);\r
1038 } else h->Reset();\r
1039 fHistos->AddAt(h, kPHSlice+iCent);\r
1040 }\r
1041\r
1042 // <PH> vs slice number for TRD reference tracklets, from TPC pions\r
1043 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1044 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSliceTPCpions_cent%d",iCent+1)))){\r
1045 h = new TH2F(Form("hPHSliceTPCpions_cent%d",iCent+1), Form("<PH> vs sliceNo, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, TPC pions",\r
1046 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 100, 0., 2000.);\r
1047 } else h->Reset();\r
1048 fHistos->AddAt(h, kPHSliceTPCpions+iCent);\r
1049 }\r
1050\r
1051 // TPC dE/dx vs P for TRD reference tracks, pions\r
1052 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1053 if(!(h = (TH2F*)gROOT->FindObject(Form("hTPCdedxPions_cent%d",iCent+1)))){\r
1054 h = new TH2F(Form("hTPCdedxPions_cent%d",iCent+1), Form("TPC dE/dx vs P, TPC pions, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1055 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 100, 0,100.);\r
1056 } else h->Reset();\r
1057 fHistos->AddAt(h, kTPCdedxPions+iCent);\r
1058 }\r
1059\r
1060 // <PH> vs slice number for TRD reference tracklets, from TPC electrons\r
1061 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1062 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSliceTPCelectrons_cent%d",iCent+1)))){\r
1063 h = new TH2F(Form("hPHSliceTPCelectrons_cent%d",iCent+1), Form("<PH> vs sliceNo, centrality %d,|#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, TPC electrons",\r
1064 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 100, 0., 2000.);\r
1065 } else h->Reset();\r
1066 fHistos->AddAt(h, kPHSliceTPCelectrons+iCent);\r
1067 }\r
1068\r
1069 // TPC dE/dx vs P for TRD reference tracks, electrons\r
1070 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1071 if(!(h = (TH2F*)gROOT->FindObject(Form("hTPCdedxElectrons_cent%d",iCent+1)))){\r
1072 h = new TH2F(Form("hTPCdedxElectrons_cent%d",iCent+1), Form("TPC dE/dx vs P, TPC electrons, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1073 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 100, 0,100.);\r
1074 } else h->Reset();\r
1075 fHistos->AddAt(h, kTPCdedxElectrons+iCent);\r
1076 }\r
1077\r
1078 // Qtot vs P for TRD reference tracklets\r
1079 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1080 if(!(h = (TH2F*)gROOT->FindObject(Form("hQtotP_cent%d",iCent+1)))){\r
1081 h = new TH2F(Form("hQtotP_cent%d",iCent+1), Form("Qtot(from slices) vs P, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1082 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 400, 0., 20);\r
1083 } else h->Reset();\r
1084 fHistos->AddAt(h, kQtotP+iCent);\r
1085 }\r
1086 \r
1087 // (X,Y,momentum) distribution after AliESDtrack::PropagateTo(r=300.)\r
1088 if(!(h = (TH3F*)gROOT->FindObject("hPropagXYvsP"))){\r
1089 h = new TH3F("hPropagXYvsP", Form("(x,y) vs P after AliESDtrack::PropagateTo(r=300.), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1090 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100,-500,500, 100,-500,500, 10, 0.,10.);\r
1091 } else h->Reset();\r
1092 fHistos->AddAt(h, kPropagXYvsP);\r
1093 \r
1094 // (R,Z,momentum) distribution after AliESDtrack::PropagateTo(r=300.)\r
1095 if(!(h = (TH3F*)gROOT->FindObject("hPropagRZvsP"))){\r
1096 h = new TH3F("hPropagRZvsP", Form("(r,z) vs P after AliESDtrack::PropagateTo(r=300.), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1097 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100,-350., 350., 100,0.,500., 10, 0.,10.);\r
1098 } else h->Reset();\r
1099 fHistos->AddAt(h, kPropagRZvsP);\r
1100 \r
1101 Double_t etaBinLimits[101]; \r
1102 for(Int_t i=0; i<101; i++) etaBinLimits[i] = -1.0 + i*2.0/100.;\r
1103 Double_t phiBinLimits[151];\r
1104 for(Int_t i=0; i<151; i++) phiBinLimits[i] = -1.1*TMath::Pi() + i*2.2*TMath::Pi()/150.;\r
1105 // (eta,detector phi,P) distribution of reference TPC positive tracks\r
1106 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1107 if(!(h = (TH3F*)gROOT->FindObject(Form("hTPCRefTracksPos_cent%d",iCent+1)))){\r
1108 h = new TH3F(Form("hTPCRefTracksPos_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TPC positive reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1109 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1110 } else h->Reset();\r
1111 fHistos->AddAt(h, kTPCRefTracksPos+iCent);\r
1112 }\r
1113 \r
1114 // (eta,detector phi,P) distribution of reference TPC negative tracks\r
1115 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1116 if(!(h = (TH3F*)gROOT->FindObject(Form("hTPCRefTracksNeg_cent%d",iCent+1)))){\r
1117 h = new TH3F(Form("hTPCRefTracksNeg_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TPC negative reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",\r
1118 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1119 } else h->Reset();\r
1120 fHistos->AddAt(h, kTPCRefTracksNeg+iCent);\r
1121 }\r
1122 \r
1123 // (eta,detector phi,P) distribution of reference TRD positive tracks\r
1124 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1125 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos_cent%d",iCent+1)))){\r
1126 h = new TH3F(Form("hTRDRefTracksPos_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD positive reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1127 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1128 } else h->Reset();\r
1129 fHistos->AddAt(h, kTRDRefTracksPos+iCent);\r
1130 }\r
1131 \r
1132 // (eta,detector phi,P) distribution of reference TRD negative tracks\r
1133 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1134 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg_cent%d",iCent+1)))){\r
1135 h = new TH3F(Form("hTRDRefTracksNeg_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD negative reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1136 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1137 } else h->Reset();\r
1138 fHistos->AddAt(h, kTRDRefTracksNeg+iCent);\r
1139 }\r
1140\r
1141 // (eta,detector phi,P) distribution of reference TRD positive tracks with 4 tracklets\r
1142 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1143 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos4_cent%d",iCent+1)))){\r
1144 h = new TH3F(Form("hTRDRefTracksPos4_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD positive reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1145 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1146 } else h->Reset();\r
1147 fHistos->AddAt(h, kTRDRefTracksPos4+iCent);\r
1148 }\r
1149\r
1150 // (eta,detector phi,P) distribution of reference TRD positive tracks with 5 tracklets\r
1151 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1152 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos5_cent%d",iCent+1)))){\r
1153 h = new TH3F(Form("hTRDRefTracksPos5_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD positive reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1154 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1155 } else h->Reset();\r
1156 fHistos->AddAt(h, kTRDRefTracksPos5+iCent);\r
1157 }\r
1158\r
1159 // (eta,detector phi,P) distribution of reference TRD positive tracks with 6 tracklets\r
1160 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1161 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos6_cent%d",iCent+1)))){\r
1162 h = new TH3F(Form("hTRDRefTracksPos6_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD positive reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1163 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1164 } else h->Reset();\r
1165 fHistos->AddAt(h, kTRDRefTracksPos6+iCent);\r
1166 }\r
1167 \r
1168 // (eta,detector phi,P) distribution of reference TRD negative tracks with 4 tracklets\r
1169 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1170 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg4_cent%d",iCent+1)))){\r
1171 h = new TH3F(Form("hTRDRefTracksNeg4_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD negative reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1172 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1173 } else h->Reset();\r
1174 fHistos->AddAt(h, kTRDRefTracksNeg4+iCent);\r
1175 }\r
1176\r
1177 // (eta,detector phi,P) distribution of reference TRD negative tracks with 5 tracklets\r
1178 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1179 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg5_cent%d",iCent+1)))){\r
1180 h = new TH3F(Form("hTRDRefTracksNeg5_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD negative reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1181 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1182 } else h->Reset();\r
1183 fHistos->AddAt(h, kTRDRefTracksNeg5+iCent);\r
1184 }\r
1185\r
1186 // (eta,detector phi,P) distribution of reference TRD negative tracks with 6 tracklets\r
1187 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1188 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg6_cent%d",iCent+1)))){\r
1189 h = new TH3F(Form("hTRDRefTracksNeg6_cent%d",iCent+1), Form("(#eta,detector #varphi,p) for TRD negative reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1190 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);\r
1191 } else h->Reset();\r
1192 fHistos->AddAt(h, kTRDRefTracksNeg6+iCent);\r
1193 }\r
1194\r
1195\r
1196 // (eta,detector phi) profile of average number of TRD tracklets/track\r
1197 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1198 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaPhiAvNtrkl_cent%d",iCent+1)))){\r
1199 h = new TProfile2D(Form("hTRDEtaPhiAvNtrkl_cent%d",iCent+1), Form("<Ntracklets/track> vs (#eta,detector #varphi) for TRD reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1200 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 150, -1.1*TMath::Pi(), 1.1*TMath::Pi());\r
1201 } else h->Reset();\r
1202 fHistos->AddAt(h, kTRDEtaPhiAvNtrkl+iCent);\r
1203 }\r
1204\r
1205 // (eta,delta phi) profile of average number of TRD tracklets/track\r
1206 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1207 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaDeltaPhiAvNtrkl_cent%d",iCent+1)))){\r
1208 h = new TProfile2D(Form("hTRDEtaDeltaPhiAvNtrkl_cent%d",iCent+1), Form("<Ntracklets/track> vs (#eta, #Delta#varphi) for TRD reference tracks, centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1209 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 50, -0.4*TMath::Pi(), 0.4*TMath::Pi());\r
1210 } else h->Reset();\r
1211 fHistos->AddAt(h, kTRDEtaDeltaPhiAvNtrkl+iCent);\r
1212 } \r
1213\r
1214 // (eta, detector phi) profile of average tracklet Qtot from slices\r
1215 for(Int_t iCent=0; iCent<=5; ++iCent) {\r
1216 for(Int_t iLayer=0;iLayer<6;iLayer++) {\r
1217 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaPhiAvQtot_Layer%d_cent%d",iLayer,iCent+1)))) {\r
1218 h = new TProfile2D(Form("hTRDEtaPhiAvQtot_Layer%d_cent%d",iLayer,iCent+1),\r
1219 Form("<Q_{tot}> vs (#eta, detector #varphi) for TRD reference tracks (layer %d), centrality %d, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq1",\r
1220 iLayer, iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 150, -1.1*TMath::Pi(), 1.1*TMath::Pi());\r
1221 } else h->Reset();\r
1222 fHistos->AddAt(h, kTRDEtaPhiAvQtot+iCent*6+iLayer);\r
1223 }\r
1224 }\r
1225 \r
1226 // Trigger definitions\r
1227 if(!(h=(TH1F*)gROOT->FindObject("hTriggerDefs"))) {\r
1228 h = new TH1F("hTriggerDefs", "Trigger definitions", kNMaxAssignedTriggers, 0.5, 0.5+Float_t(kNMaxAssignedTriggers));\r
1229 }\r
1230 else h->Reset();\r
1231 fHistos->AddAt(h, kTriggerDefs);\r
1232\r
1233 // dummy histo\r
1234 if(!(h=(TH1F*)gROOT->FindObject("hDummy"))) {\r
1235 h = new TH1F("hDummy", "Dummy hist", 10, 0., 1.);\r
1236 }\r
1237 else h->Reset();\r
1238 fHistos->AddAt(h, 0);\r
1239 \r
1240 fMatchingPhiEtaCF = CreateCFContainer("MatchingPhiEta", "CF container with TRD-TPC matching data");\r
1241 fHistos->AddAt(fMatchingPhiEtaCF, kMatchingPhiEtaCF);\r
1242 fMatchingPtCF = CreateCFContainer("MatchingPt", "CF container with TRD-TPC matching data");\r
1243 fHistos->AddAt(fMatchingPtCF, kMatchingPtCF);\r
1244 fBunchCrossingsCF = CreateCFContainer("BunchCrossingsCF", "CF container with bunch crossings dependent data");\r
1245 fHistos->AddAt(fBunchCrossingsCF, kBunchCrossingsCF);\r
1246 fCentralityCF = CreateCFContainer("CentralityCF", "CF container with TRD-TPC matching data");\r
1247 fHistos->AddAt(fCentralityCF, kCentralityCF);\r
1248 fQtotCF = CreateCFContainer("QtotCF", "CF container with TRD tracklet charge data");\r
1249 fHistos->AddAt(fQtotCF, kQtotCF);\r
1250 fPulseHeightCF = CreateCFContainer("PulseHeightCF", "CF container with TRD tracklet PH data");\r
1251 fHistos->AddAt(fPulseHeightCF, kPulseHeightCF);\r
1252 fExpertCF = CreateCFContainer("ExpertCF", "CF container with customized information");\r
1253 if(fExpertCF) fHistos->AddAt(fExpertCF, kExpertCF);\r
1254 \r
1255 return fHistos;\r
1256}\r
1257\r
1258\r
1259//__________________________________________________________________________________________________________\r
1260void AliTRDcheckESD::InitializeCFContainers() {\r
1261 //\r
1262 // Initialize the CF container\r
1263 //\r
1264 AliAnalysisManager* man=AliAnalysisManager::GetAnalysisManager();\r
1265 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
1266 if(!inputHandler) return;\r
1267 \r
1268 AliPhysicsSelection* physSel = (AliPhysicsSelection*)inputHandler->GetEventSelection();\r
1269 const TList* trigList = (physSel ? physSel->GetCollisionTriggerClasses() : 0x0);\r
1270 const TList* bgTrigList = (physSel ? physSel->GetBGTriggerClasses() : 0x0);\r
1271 \r
1272 // Add collision triggers from PhysicsSelection\r
1273 if(trigList) {\r
1274 for(Int_t it=0; it<trigList->GetEntries(); ++it) {\r
1275 TString trigName = trigList->At(it)->GetName();\r
1276 TObjArray* arr = trigName.Tokenize(" ");\r
1277 trigName = arr->At(0)->GetName();\r
1278 trigName.Remove(0,1);\r
1279 TObjArray* arr2 = trigName.Tokenize(",");\r
1280 for(Int_t jt=0; jt<arr2->GetEntries(); ++jt) {\r
1281 // Assign an index into the trigger histogram and the CF container for this trigger\r
1282 GetTriggerIndex(arr2->At(jt)->GetName(), kTRUE);\r
1283 }\r
dffc3357 1284 arr2->Delete(); delete arr2;\r
1285 arr->Delete(); delete arr;\r
7b67bbf9 1286 }\r
1287 }\r
1288 // Add background triggers from PhysicsSelection\r
1289 if(bgTrigList) {\r
1290 for(Int_t it=0; it<bgTrigList->GetEntries(); ++it) {\r
1291 TString trigName = bgTrigList->At(it)->GetName();\r
1292 TObjArray* arr = trigName.Tokenize(" ");\r
1293 trigName = arr->At(0)->GetName();\r
1294 trigName.Remove(0,1);\r
1295 TObjArray* arr2 = trigName.Tokenize(",");\r
1296 for(Int_t jt=0; jt<arr2->GetEntries(); ++jt) {\r
1297 // Assign an index into the trigger histogram and the CF container for this trigger\r
1298 GetTriggerIndex(arr2->At(jt)->GetName(), kTRUE);\r
1299 }\r
dffc3357 1300 arr2->Delete(); delete arr2;\r
1301 arr->Delete(); delete arr;\r
7b67bbf9 1302 }\r
1303 }\r
1304 if(!fNAssignedTriggers) {GetTriggerIndex("All triggers", kTRUE);}\r
1305 \r
1306 // Add user enabled triggers\r
1307 TObjArray* arr = fUserEnabledTriggers.Tokenize(";");\r
1308 for(Int_t it=0; it<arr->GetEntries(); ++it) {\r
1309 GetTriggerIndex(arr->At(it)->GetName(), kTRUE);\r
1310 }\r
dffc3357 1311 arr->Delete(); delete arr;\r
7b67bbf9 1312}\r
1313\r
1314\r
1315//__________________________________________________________________________________________________________\r
1316AliCFContainer* AliTRDcheckESD::CreateCFContainer(const Char_t* name, const Char_t* title) {\r
1317 //\r
1318 // make a CF container\r
1319 //\r
1320 // create a CF container and add it to the list of histograms\r
1321 Int_t nbinsCf[kNTrdCfVariables];\r
1322 for(Int_t i=0;i<kNTrdCfVariables;++i) nbinsCf[i]=0;\r
1323 nbinsCf[kEventVtxZ] = 5;\r
1324 nbinsCf[kEventMult] = 5;\r
1325 nbinsCf[kEventTrigger] = kNMaxAssignedTriggers;\r
1326 nbinsCf[kEventBC] = 3500;\r
1327 nbinsCf[kTrackTOFBC] = 2;\r
1328 nbinsCf[kTrackDCAxy] = 9;\r
1329 nbinsCf[kTrackDCAz] = 5;\r
1330 nbinsCf[kTrackCharge] = 2;\r
1331 nbinsCf[kTrackPhi] = 180;\r
1332 nbinsCf[kTrackEta] = 90;\r
1333 nbinsCf[kTrackPt] = 18;\r
1334 nbinsCf[kTrackP] = 17;\r
1335 nbinsCf[kTrackTrdTracklets] = 7;\r
1336 nbinsCf[kTrackTrdClusters] = 200;\r
1337 for(Int_t i=0;i<6;++i) nbinsCf[kTrackQtot+i] = 100;\r
1338 for(Int_t i=0;i<8;++i) nbinsCf[kTrackPHslice+i] = 400;\r
1339 //Double_t evVtxLims[2] = {-10.,+10.};\r
1340 Double_t evMultLims[6] = {0.0, 700., 1400., 2100., 2800., 3500.};\r
1341 //Double_t evTriggerLims[2] = {0.5, 0.5+Float_t(kNMaxAssignedTriggers)};\r
1342 Double_t evBCLims[2] = {-0.5, +3499.5};\r
1343 //Double_t trkTOFBClims[3] = {-0.5, 0.5, 5.5};\r
1344 //Double_t trkDCAxyLims[10] = {-10.0, -6.0, -3.0, -2.0, -1.0, \r
1345 // +1.0, +2.0, +3.0, +6.0, +10.0}; \r
1346 //Double_t trkDCAzLims[2] = {-15.0, +15.0}; \r
1347 Double_t trkChargeLims[2] = {-1.5, +1.5};\r
1348 Double_t trkPhiLims[2] = {-1.001*TMath::Pi(), +1.001*TMath::Pi()};\r
1349 Double_t trkEtaLims[2] = {-0.9, +0.9};\r
1350 Double_t trkPtLims[19] = {0.0, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, \r
1351 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};\r
1352 Double_t trkPLims[18] = {0.0, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.7, 2.0, 2.5, \r
1353 3.0, 3.5, 4.0, 5.0, 6.0, 7.0, 9.0, 12.0};\r
1354 Double_t trkTrdNLims[2] = {-0.5, 6.5};\r
1355 Double_t trkTrdNclsLims[2] = {-0.5, 199.5};\r
1356 Double_t trkQtotLims[2] = {0.0, 20.};\r
1357 /*Double_t trkQtotLims[20] = {0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0,\r
1358 5.5, 6.0, 6.5, 7.0, 8.0, 9.0,10.0,12.0,15.0,20.0};*/\r
1359 const Char_t* varNames[kNTrdCfVariables] = {"vtxZ", "multiplicity", "trigger", "BC", "TOFBC", "DCAxy", "DCAz",\r
1360 "charge", "phi", "eta", "pt", "P", "tracklets", "clusters", \r
1361 "PH0", "PH1", "PH2", "PH3", "PH4", "PH5", "PH6", "PH7",\r
1362 "Qtot0", "Qtot1", "Qtot2", "Qtot3", "Qtot4", "Qtot5"};\r
1363 \r
1364 AliCFContainer* cf;\r
1365 TString nameStr=name;\r
1366 if(nameStr.Contains("MatchingPhiEta")) {\r
1367 fMatchingPhiEtaCFVars[0] = kTrackCharge; fMatchingPhiEtaCFVars[1] = kTrackPhi; fMatchingPhiEtaCFVars[2] = kTrackEta;\r
1368 fMatchingPhiEtaCFVars[3] = kTrackTrdTracklets;\r
1369 const Int_t nVars = 4;\r
1370 Int_t nBins[nVars]; for(Int_t i=0; i<nVars; ++i) nBins[i] = nbinsCf[fMatchingPhiEtaCFVars[i]];\r
1371 cf = new AliCFContainer(name, title, 3, nVars, nBins);\r
1372 cf->SetBinLimits(0, trkChargeLims[0], trkChargeLims[1]);\r
1373 cf->SetBinLimits(1, trkPhiLims[0], trkPhiLims[1]);\r
1374 cf->SetBinLimits(2, trkEtaLims[0], trkEtaLims[1]);\r
1375 cf->SetBinLimits(3, trkTrdNLims[0], trkTrdNLims[1]);\r
1376 for(Int_t i=0; i<nVars; ++i) cf->SetVarTitle(i, varNames[fMatchingPhiEtaCFVars[i]]);\r
1377 cf->SetStepTitle(0, "TPC");\r
1378 cf->SetStepTitle(1, "TRD");\r
1379 cf->SetStepTitle(2, "TOF");\r
1380 return cf;\r
1381 }\r
1382 if(nameStr.Contains("MatchingPt")) {\r
1383 fMatchingPtCFVars[0] = kEventMult; fMatchingPtCFVars[1] = kTrackCharge; fMatchingPtCFVars[2] = kTrackPhi; \r
1384 fMatchingPtCFVars[3] = kTrackPt; fMatchingPtCFVars[4] = kTrackTrdTracklets;\r
1385 const Int_t nVars = 5;\r
1386 Int_t nBins[nVars]; for(Int_t i=0; i<nVars; ++i) nBins[i] = nbinsCf[fMatchingPtCFVars[i]];\r
1387 cf = new AliCFContainer(name, title, 3, nVars, nBins);\r
1388 cf->SetBinLimits(0, evMultLims);\r
1389 cf->SetBinLimits(1, trkChargeLims[0], trkChargeLims[1]);\r
1390 cf->SetBinLimits(2, trkPhiLims[0], trkPhiLims[1]);\r
1391 cf->SetBinLimits(3, trkPtLims);\r
1392 cf->SetBinLimits(4, trkTrdNLims[0], trkTrdNLims[1]);\r
1393 for(Int_t i=0; i<nVars; ++i) cf->SetVarTitle(i, varNames[fMatchingPtCFVars[i]]);\r
1394 cf->SetStepTitle(0, "TPC");\r
1395 cf->SetStepTitle(1, "TRD");\r
1396 cf->SetStepTitle(2, "TOF");\r
1397 return cf;\r
1398 }\r
1399 if(nameStr.Contains("BunchCrossings")) {\r
1400 fBunchCrossingsCFVars[0] = kEventBC; fBunchCrossingsCFVars[1] = kTrackPhi;\r
1401 const Int_t nVars = 2;\r
1402 Int_t nBins[nVars]; for(Int_t i=0; i<nVars; ++i) nBins[i] = nbinsCf[fBunchCrossingsCFVars[i]];\r
1403 cf = new AliCFContainer(name, title, 3, nVars, nBins);\r
1404 cf->SetBinLimits(0, evBCLims[0], evBCLims[1]);\r
1405 cf->SetBinLimits(1, trkPhiLims[0], trkPhiLims[1]);\r
1406 for(Int_t i=0; i<nVars; ++i) cf->SetVarTitle(i, varNames[fBunchCrossingsCFVars[i]]);\r
1407 cf->SetStepTitle(0, "TPC");\r
1408 cf->SetStepTitle(1, "TRD");\r
1409 cf->SetStepTitle(2, "TOF");\r
1410 return cf;\r
1411 }\r
1412 if(nameStr.Contains("Centrality")) {\r
1413 fCentralityCFVars[0] = kEventMult; fCentralityCFVars[1] = kTrackP; fCentralityCFVars[2] = kTrackTrdClusters; \r
1414 fCentralityCFVars[3] = kTrackQtot;\r
1415 const Int_t nVars = 4;\r
1416 Int_t nBins[nVars]; for(Int_t i=0; i<nVars; ++i) nBins[i] = nbinsCf[fCentralityCFVars[i]];\r
1417 cf = new AliCFContainer(name, title, 1, nVars, nBins);\r
1418 cf->SetBinLimits(0, evMultLims);\r
1419 cf->SetBinLimits(1, trkPLims);\r
1420 cf->SetBinLimits(2, trkTrdNclsLims[0], trkTrdNclsLims[1]);\r
1421 cf->SetBinLimits(3, trkQtotLims[0], trkQtotLims[1]);\r
1422 for(Int_t i=0; i<nVars; ++i) cf->SetVarTitle(i, varNames[fCentralityCFVars[i]]);\r
1423 cf->SetStepTitle(0, "TRD");\r
1424 return cf;\r
1425 }\r
1426 if(nameStr.Contains("Qtot")) {\r
1427 fQtotCFVars[0] = kTrackPhi; fQtotCFVars[1] = kTrackEta; fQtotCFVars[2] = kTrackQtot; \r
1428 const Int_t nVars = 4;\r
1429 Int_t nBins[nVars]; for(Int_t i=0; i<nVars-1; ++i) nBins[i] = nbinsCf[fQtotCFVars[i]];\r
1430 nBins[2] = 50;\r
1431 nBins[nVars-1] = 6;\r
1432 cf = new AliCFContainer(name, title, 1, nVars, nBins);\r
1433 cf->SetBinLimits(0, trkPhiLims[0], trkPhiLims[1]);\r
1434 cf->SetBinLimits(1, trkEtaLims[0], trkEtaLims[1]);\r
1435 cf->SetBinLimits(2, trkQtotLims[0], trkQtotLims[1]);\r
1436 cf->SetBinLimits(3, -0.5, 5.5);\r
1437 for(Int_t i=0; i<nVars-1; ++i) cf->SetVarTitle(i, varNames[fQtotCFVars[i]]);\r
1438 cf->SetVarTitle(nVars-1, "layer");\r
1439 cf->SetStepTitle(0, "TRD");\r
1440 return cf;\r
1441 }\r
1442 if(nameStr.Contains("PulseHeight")) {\r
1443 fPulseHeightCFVars[0] = kTrackP; fPulseHeightCFVars[1] = kTrackPHslice; \r
1444 const Int_t nVars = 3;\r
1445 Int_t nBins[nVars]; for(Int_t i=0; i<nVars-1; ++i) nBins[i] = nbinsCf[fPulseHeightCFVars[i]];\r
1446 nBins[nVars-1] = 8;\r
1447 cf = new AliCFContainer(name, title, 1, nVars, nBins);\r
1448 //cf->SetBinLimits(0, evTriggerLims[0], evTriggerLims[1]);\r
1449 cf->SetBinLimits(0, trkPLims);\r
1450 cf->SetBinLimits(1, trkQtotLims[0], trkQtotLims[1]);\r
1451 cf->SetBinLimits(2, -0.5, 7.5);\r
1452 for(Int_t i=0; i<nVars-1; ++i) cf->SetVarTitle(i, varNames[fPulseHeightCFVars[i]]);\r
1453 cf->SetVarTitle(nVars-1, "slice");\r
1454 cf->SetStepTitle(0, "TRD");\r
1455 return cf;\r
1456 }\r
1457 if(nameStr.Contains("Expert")) {\r
1458 Int_t nVars = 0;\r
1459 Int_t nBins[kNTrdCfVariables];\r
1460 for(Int_t ivar=0; ivar<kNTrdCfVariables; ++ivar) {\r
1461 if(!fExpertCFVarsEnabled[ivar]) continue;\r
1462 if(fExpertCFVarBins[ivar][0]=='\0') {\r
1463 nBins[nVars] = fExpertCFVarNBins[ivar];\r
1464 nVars++;\r
1465 }\r
1466 else {\r
dffc3357 1467 TObjArray* arr = fExpertCFVarBins[ivar].Tokenize(";");\r
1468 nBins[nVars] = arr->GetEntries()-1;\r
1469 if(nBins[nVars]>0) nVars++;\r
1470 arr->Delete(); delete arr;\r
7b67bbf9 1471 }\r
1472 }\r
1473 if(nVars<1) return 0x0;\r
1474 Int_t nSteps = 0; for(Int_t i=0; i<3; ++i) if(fExpertCFEnabledSteps[i]) nSteps++;\r
1475 if(nSteps<1) return 0x0;\r
1476 cf = new AliCFContainer(name, title, nSteps, nVars, nBins);\r
1477 Int_t iUsedVar = 0;\r
1478 for(Int_t ivar=0; ivar<kNTrdCfVariables; ++ivar) {\r
1479 if(!fExpertCFVarsEnabled[ivar]) continue;\r
dffc3357 1480 if(fExpertCFVarBins[ivar][0]=='\0'){\r
1481 cf->SetBinLimits(iUsedVar, fExpertCFVarRanges[ivar][0], fExpertCFVarRanges[ivar][1]);\r
1482 } else {\r
1483 TObjArray* arr = fExpertCFVarBins[ivar].Tokenize(";");\r
1484 if(arr->GetEntries()-1>0) {\r
1485 Double_t* binLims = new Double_t[arr->GetEntries()];\r
1486 for(Int_t ib=0;ib<arr->GetEntries();++ib) {\r
1487 TString binStr = arr->At(ib)->GetName();\r
1488 binLims[ib] = binStr.Atof();\r
1489 }\r
1490 cf->SetBinLimits(iUsedVar++, binLims);\r
1491 }\r
1492 arr->Delete(); delete arr;\r
7b67bbf9 1493 }\r
1494 cf->SetVarTitle(iUsedVar, varNames[ivar]);\r
1495 }\r
1496 const Char_t* stepNames[3] = {"TPC","TRD","TOF"};\r
1497 Int_t iUsedStep = 0;\r
1498 for(Int_t istep=0; istep<3; ++istep) {\r
1499 if(fExpertCFEnabledSteps[istep]) cf->SetStepTitle(iUsedStep++, stepNames[istep]);\r
1500 }\r
1501 return cf;\r
1502 } \r
1503 return 0x0;\r
1504}\r
1505\r
1506\r
1507//____________________________________________________________________\r
1508Bool_t AliTRDcheckESD::Load(const Char_t *file, const Char_t *dir, const Char_t *name)\r
1509{\r
1510// Load data from performance file\r
1511\r
1512 if(!TFile::Open(file)){\r
1513 AliWarning(Form("Couldn't open file %s.", file));\r
1514 return kFALSE;\r
1515 }\r
1516 if(dir){\r
1517 if(!gFile->cd(dir)){\r
1518 AliWarning(Form("Couldn't cd to %s in %s.", dir, file));\r
1519 return kFALSE;\r
1520 }\r
1521 }\r
1522 TObjArray *o(NULL);\r
1523 const Char_t *tn=(name ? name : GetName());\r
1524 if(!(o = (TObjArray*)gDirectory->Get(tn))){\r
1525 AliWarning(Form("Missing histogram container %s.", tn));\r
1526 return kFALSE;\r
1527 }\r
1528 fHistos = (TObjArray*)o->Clone(GetName());\r
1529 fMatchingPhiEtaCF = (AliCFContainer*)fHistos->At(kMatchingPhiEtaCF);\r
1530 fMatchingPtCF = (AliCFContainer*)fHistos->At(kMatchingPtCF);\r
1531 fBunchCrossingsCF = (AliCFContainer*)fHistos->At(kBunchCrossingsCF);\r
1532 fCentralityCF = (AliCFContainer*)fHistos->At(kCentralityCF);\r
1533 fQtotCF = (AliCFContainer*)fHistos->At(kQtotCF);\r
1534 fPulseHeightCF = (AliCFContainer*)fHistos->At(kPulseHeightCF);\r
1535 fExpertCF = (AliCFContainer*)fHistos->At(kExpertCF);\r
1536 \r
1537 /*\r
1538 TObjArray *cfs(NULL);\r
1539 if(!(cfs = (TObjArray*)gDirectory->Get(Form("%s_CF", tn)))){\r
1540 AliWarning(Form("Missing CFs container %s_CF.", tn));\r
1541 fCfList = NULL;\r
1542 //return kFALSE;\r
1543 } \r
1544 else\r
1545 fCfList = (TObjArray*)cfs->Clone(Form("%s_CF_clone", GetName()));\r
1546 */\r
1547 \r
1548 gFile->Close();\r
1549 return kTRUE;\r
1550}\r
1551\r
1552//_______________________________________________________\r
1553Bool_t AliTRDcheckESD::PutTrendValue(const Char_t *name, Double_t val)\r
1554{\r
1555// Dump trending value to default file\r
1556\r
1557 if(!fgFile){\r
1558 fgFile = fopen("TRD.Performance.txt", "at");\r
1559 }\r
1560 fprintf(fgFile, "%s_%s %f\n", GetName(), name, val);\r
1561 return kTRUE;\r
1562}\r
1563\r
1564//____________________________________________________________________\r
1565void AliTRDcheckESD::Terminate(Option_t *)\r
1566{\r
1567 // Steer post-processing \r
1568 if(!fHistos){\r
1569 fHistos = dynamic_cast<TObjArray *>(GetOutputData(1));\r
1570 if(!fHistos){\r
1571 AliError("Histogram container not found in output");\r
1572 return;\r
1573 }\r
1574 }\r
1575\r
1576 // fNRefFigures = 15;\r
1577 // return;\r
1578\r
1579 const Char_t *name[kNrefs] = {\r
1580 "Ncl", "Eff", "Eloss", "PtResDCA"\r
1581 };\r
1582\r
1583 TObjArray *arr(NULL); TGraph *g(NULL);\r
1584 if(!fResults){\r
1585 fResults = new TObjArray(kNrefs);\r
1586 fResults->SetOwner();\r
1587 fResults->SetName("results");\r
1588 for(Int_t iref(0); iref<kNrefs; iref++){\r
1589 fResults->AddAt(arr = new TObjArray(fgkNgraph[iref]), iref);\r
1590 arr->SetName(name[iref]); arr->SetOwner();\r
1591 switch(iref+1){\r
1592 case kNCl:\r
1593 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){\r
1594 arr->AddAt(g = new TGraphErrors(), ig);\r
1595 g->SetLineColor(ig+1); \r
1596 g->SetMarkerColor(ig+1); \r
1597 g->SetMarkerStyle(ig+20); \r
1598 g->SetName(Form("s%d", ig));\r
1599 switch(ig){\r
1600 case 0: g->SetTitle("ALL"); break;\r
1601 case 1: g->SetTitle("NEG"); break;\r
1602 case 2: g->SetTitle("POS"); break;\r
1603 default: g->SetTitle(AliPID::ParticleLatexName(ig-3)); break;\r
1604 };\r
1605 }\r
1606 break;\r
1607 case kTRDmom:\r
1608 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){\r
1609 arr->AddAt(g = new TGraphAsymmErrors(), ig);\r
1610 g->SetLineColor(ig+1); \r
1611 g->SetMarkerColor(ig+1); \r
1612 g->SetMarkerStyle(ig+20); \r
1613 }\r
1614 break;\r
1615 case kPtRes:\r
1616 for(Int_t idx(0); idx<AliPID::kSPECIES; idx++){\r
1617 Int_t ig(2*idx);\r
1618 arr->AddAt(g = new TGraphErrors(), ig);\r
1619 g->SetLineColor(kRed-idx); \r
1620 g->SetMarkerColor(kRed-idx); \r
1621 g->SetMarkerStyle(20+idx); \r
1622 g->SetNameTitle(Form("s%d", ig), Form("res %s", AliPID::ParticleLatexName(idx)));\r
1623 arr->AddAt(g = new TGraphErrors(), ig+1);\r
1624 g->SetLineColor(kBlue-idx); \r
1625 g->SetMarkerColor(kBlue-idx); \r
1626 g->SetMarkerStyle(20+idx); \r
1627 g->SetNameTitle(Form("m%d", ig+1), Form("sys %s", AliPID::ParticleLatexName(idx)));\r
1628\r
1629 ig+=10;\r
1630 arr->AddAt(g = new TGraphErrors(), ig);\r
1631 g->SetLineColor(kRed-idx); \r
1632 g->SetMarkerColor(kRed-idx); \r
1633 g->SetMarkerStyle(20+idx); \r
1634 g->SetNameTitle(Form("s%d", ig), Form("sigma %s", AliPID::ParticleLatexName(idx)));\r
1635 arr->AddAt(g = new TGraphErrors(), ig+1);\r
1636 g->SetLineColor(kBlue-idx); \r
1637 g->SetMarkerColor(kBlue-idx); \r
1638 g->SetMarkerStyle(20+idx); \r
1639 g->SetNameTitle(Form("m%d", ig+1), Form("mean %s", AliPID::ParticleLatexName(idx)));\r
1640 }\r
1641 break;\r
1642 default:\r
1643 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){\r
1644 arr->AddAt(g = new TGraphErrors(), ig);\r
1645 g->SetLineColor(ig+1); \r
1646 g->SetMarkerColor(ig+1); \r
1647 g->SetMarkerStyle(ig+20); \r
1648 }\r
1649 break;\r
1650 }\r
1651 }\r
1652 }\r
1653 TH1 *h1[2] = {NULL, NULL};\r
1654 TH2I *h2(NULL);\r
1655 TAxis *ax(NULL);\r
1656\r
1657 // No of clusters\r
1658 if(!(h2 = (TH2I*)fHistos->At(kNCl))) return;\r
1659 ax = h2->GetXaxis();\r
1660 arr = (TObjArray*)fResults->At(kNCl);\r
1661 \r
1662 // All tracks\r
1663 h1[0] = h2->ProjectionX("Ncl_px");\r
97954d24 1664 TGraphErrors *ge(NULL);\r
1665 if((ge=(TGraphErrors*)arr->At(0))){\r
1666 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){\r
1667 ge->SetPoint(ib-2, ax->GetBinCenter(ib), h1[0]->GetBinContent(ib));\r
1668 }\r
7b67bbf9 1669 }\r
97954d24 1670\r
7b67bbf9 1671 // All charged tracks\r
1672 TH1 *hNclCh[2] = {(TH1D*)h1[0]->Clone("NEG"), (TH1D*)h1[0]->Clone("POS")};\r
1673 hNclCh[0]->Reset();hNclCh[1]->Reset();\r
1674 for(Int_t is(1); is<=AliPID::kSPECIES; is++){\r
1675 hNclCh[0]->Add(h2->ProjectionX("Ncl_px", 2*is-1, 2*is-1)); // neg\r
1676 hNclCh[1]->Add(h2->ProjectionX("Ncl_px", 2*is, 2*is)); // pos\r
1677 }\r
97954d24 1678 if(Int_t(hNclCh[0]->GetEntries()) && (ge=(TGraphErrors*)arr->At(1))){\r
7b67bbf9 1679 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){\r
1680 ge->SetPoint(ib-2, ax->GetBinCenter(ib), hNclCh[0]->GetBinContent(ib));\r
1681 }\r
1682 }\r
1683 \r
97954d24 1684 if(Int_t(hNclCh[1]->GetEntries()) && (ge=(TGraphErrors*)arr->At(2))){\r
7b67bbf9 1685 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){\r
1686 ge->SetPoint(ib-2, ax->GetBinCenter(ib), hNclCh[1]->GetBinContent(ib));\r
1687 }\r
1688 }\r
1689 // Species wise\r
1690 for(Int_t is(1); is<=AliPID::kSPECIES; is++){\r
1691 h1[0] = h2->ProjectionX("Ncl_px", 2*is-1, 2*is);\r
1692 if(!Int_t(h1[0]->GetEntries())) continue;\r
97954d24 1693 if(!(ge=(TGraphErrors*)arr->At(2+is))) continue;\r
7b67bbf9 1694 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){\r
1695 ge->SetPoint(ib-2, ax->GetBinCenter(ib), h1[0]->GetBinContent(ib));\r
1696 }\r
1697 }\r
1698 \r
1699 fNRefFigures = 1;\r
1700\r
1701 // EFFICIENCY\r
1702 // geometrical efficiency\r
1703 if(!(h2 = (TH2I*)fHistos->At(kTRDstat))) return;\r
1704 arr = (TObjArray*)fResults->At(kTRDstat-1);\r
1705 h1[0] = h2->ProjectionX("checkESDx0", kTPCout, kTPCout);\r
1706 h1[1] = h2->ProjectionX("checkESDx1", kTRDin, kTRDin);\r
1707 Process(h1, (TGraphErrors*)arr->At(0));\r
1708 delete h1[0];delete h1[1];\r
1709 // tracking efficiency\r
1710 h1[0] = h2->ProjectionX("checkESDx0", kTRDin, kTRDin);\r
1711 h1[1] = h2->ProjectionX("checkESDx1", kTRDout, kTRDout);\r
1712 Process(h1, (TGraphErrors*)arr->At(1));\r
1713 delete h1[1];\r
1714 // PID efficiency\r
1715 h1[1] = h2->ProjectionX("checkESDx1", kTRDpid, kTRDpid);\r
1716 Process(h1, (TGraphErrors*)arr->At(2));\r
1717 delete h1[1];\r
1718 // Refit efficiency\r
1719 h1[1] = h2->ProjectionX("checkESDx1", kTRDref, kTRDref);\r
1720 Process(h1, (TGraphErrors*)arr->At(3));\r
1721 delete h1[1];\r
1722 fNRefFigures++;\r
1723\r
1724 // ENERGY LOSS\r
1725 if(!(h2 = dynamic_cast<TH2I*>(fHistos->At(kTRDmom)))) return;\r
97954d24 1726 if((arr = (TObjArray*)fResults->At(kTRDmom-1))){\r
1727 TGraphAsymmErrors *g06 = (TGraphAsymmErrors*)arr->At(0), *g09 = (TGraphAsymmErrors*)arr->At(1);\r
1728 if(g06 && g09){\r
1729 ax=h2->GetXaxis();\r
1730 const Int_t nq(4);\r
1731 const Double_t xq[nq] = {0.05, 0.2, 0.8, 0.95};\r
1732 Double_t yq[nq];\r
1733 for(Int_t ily=6; ily--;){\r
1734 h1[0] = h2->ProjectionX("checkESDp0", ily+1, ily+1);\r
1735 h1[0]->GetQuantiles(nq,yq,xq);\r
1736 g06->SetPoint(ily, Float_t(ily), ax->GetBinCenter(h1[0]->GetMaximumBin()));\r
1737 g06->SetPointError(ily, 0., 0., TMath::Abs(yq[0]), yq[3]);\r
1738 g09->SetPoint(ily, Float_t(ily), h1[0]->GetMean());\r
1739 g09->SetPointError(ily, 0., 0., TMath::Abs(yq[1]), yq[2]);\r
1740\r
1741 //printf(" max[%f] mean[%f] q[%f %f %f %f]\n", ax->GetBinCenter(h1[0]->GetMaximumBin()), h1[0]->GetMean(), yq[0], yq[1], yq[2], yq[3]);\r
1742 delete h1[0];\r
1743 }\r
1744 fNRefFigures++;\r
1745 }\r
7b67bbf9 1746 }\r
7b67bbf9 1747// if(!HasMC()) return;\r
1748\r
1749 // Pt RESOLUTION @ DCA\r
1750 TH3S* h3(NULL); TGraphErrors *gg[2] = {NULL,NULL};\r
1751 if(!(h3 = dynamic_cast<TH3S*>(fHistos->At(kPtRes)))) return;\r
97954d24 1752 if((arr = (TObjArray*)fResults->At(kPtRes-1))){\r
1753 TAxis *az(h3->GetZaxis());\r
1754 for(Int_t i(0); i<AliPID::kSPECIES; i++){\r
1755 Int_t idx(2*i);\r
1756 az->SetRange(idx+1, idx+2);\r
1757 gg[1] = (TGraphErrors*)arr->At(idx);\r
1758 gg[0] = (TGraphErrors*)arr->At(idx+1);\r
1759 Process2D((TH2*)h3->Project3D("yx"), gg);\r
1760\r
1761 idx+=10;\r
1762 az->SetRange(idx+1, idx+2);\r
1763 gg[1] = (TGraphErrors*)arr->At(idx);\r
1764 gg[0] = (TGraphErrors*)arr->At(idx+1);\r
1765 Process2D((TH2*)h3->Project3D("yx"), gg);\r
1766 }\r
1767 fNRefFigures++;\r
7b67bbf9 1768 }\r
7b67bbf9 1769 fNRefFigures++;\r
1770 // 3x3 tracking summary canvases for every centrality class\r
1771 fNRefFigures++;\r
1772 // 3x3 PID summary canvases for every centrality class\r
1773 fNRefFigures++;\r
1774 // 3x3 for centrality dependent pictures\r
1775 fNRefFigures++;\r
1776 \r
1777 //DoTrending(); \r
1778}\r
1779\r
1780//____________________________________________________________________\r
1781Int_t AliTRDcheckESD::Pdg2Idx(Int_t pdg) const\r
1782{\r
1783 //\r
1784 // Helper function converting PDG code into AliPID index\r
1785 //\r
1786 switch(pdg){\r
1787 case kElectron: \r
1788 case kPositron: return AliPID::kElectron; \r
1789 case kMuonPlus:\r
1790 case kMuonMinus: return AliPID::kMuon; \r
1791 case kPiPlus: \r
1792 case kPiMinus: return AliPID::kPion; \r
1793 case kKPlus: \r
1794 case kKMinus: return AliPID::kKaon;\r
1795 case kProton: \r
1796 case kProtonBar: return AliPID::kProton;\r
1797 } \r
1798 return -1;\r
1799}\r
1800\r
1801//____________________________________________________________________\r
1802void AliTRDcheckESD::Process(TH1 **h1, TGraphErrors *g)\r
1803{\r
1804// Generic function to process one reference plot\r
1805\r
97954d24 1806 if(!g) return;\r
7b67bbf9 1807 Int_t n1 = 0, n2 = 0, ip=0;\r
1808 Double_t eff = 0.;\r
1809\r
1810 TAxis *ax = h1[0]->GetXaxis();\r
1811 for(Int_t ib=1; ib<=ax->GetNbins(); ib++){\r
1812 if(!(n1 = (Int_t)h1[0]->GetBinContent(ib))) continue;\r
1813 n2 = (Int_t)h1[1]->GetBinContent(ib);\r
1814 eff = n2/Float_t(n1);\r
1815\r
1816 ip=g->GetN();\r
1817 g->SetPoint(ip, ax->GetBinCenter(ib), eff);\r
1818 g->SetPointError(ip, 0., n2 ? eff*TMath::Sqrt(1./n1+1./n2) : 0.);\r
1819 }\r
1820} \r
1821//________________________________________________________\r
1822void AliTRDcheckESD::Process2D(TH2 * const h2, TGraphErrors **g)\r
1823{\r
1824 //\r
1825 // Do the processing\r
1826 //\r
1827\r
97954d24 1828 if(!g[0] || !g[1]) return;\r
7b67bbf9 1829 Int_t n = 0;\r
1830 if((n=g[0]->GetN())) for(;n--;) g[0]->RemovePoint(n);\r
1831 if((n=g[1]->GetN())) for(;n--;) g[1]->RemovePoint(n);\r
1832 TF1 f("fg", "gaus", -3.,3.);\r
1833 for(Int_t ibin = 1; ibin <= h2->GetNbinsX(); ibin++){\r
1834 Double_t x = h2->GetXaxis()->GetBinCenter(ibin);\r
1835 TH1D *h = h2->ProjectionY("py", ibin, ibin);\r
1836 if(h->GetEntries()<100) continue;\r
1837 //AdjustF1(h, f);\r
1838\r
1839 h->Fit(&f, "QN");\r
1840 Int_t ip = g[0]->GetN();\r
1841 g[0]->SetPoint(ip, x, f.GetParameter(1));\r
1842 g[0]->SetPointError(ip, 0., f.GetParError(1));\r
1843 g[1]->SetPoint(ip, x, f.GetParameter(2));\r
1844 g[1]->SetPointError(ip, 0., f.GetParError(2));\r
1845 }\r
1846 return;\r
1847}\r
1848//____________________________________________________________________\r
1849void AliTRDcheckESD::PrintStatus(ULong_t status)\r
1850{\r
1851// Dump track status to stdout\r
1852\r
1853 printf("ITS[i(%d) o(%d) r(%d)] TPC[i(%d) o(%d) r(%d) p(%d)] TRD[i(%d) o(%d) r(%d) p(%d) s(%d)] HMPID[o(%d) p(%d)]\n"\r
1854 ,Bool_t(status & AliESDtrack::kITSin)\r
1855 ,Bool_t(status & AliESDtrack::kITSout)\r
1856 ,Bool_t(status & AliESDtrack::kITSrefit)\r
1857 ,Bool_t(status & AliESDtrack::kTPCin)\r
1858 ,Bool_t(status & AliESDtrack::kTPCout)\r
1859 ,Bool_t(status & AliESDtrack::kTPCrefit)\r
1860 ,Bool_t(status & AliESDtrack::kTPCpid)\r
1861 ,Bool_t(status & AliESDtrack::kTRDin)\r
1862 ,Bool_t(status & AliESDtrack::kTRDout)\r
1863 ,Bool_t(status & AliESDtrack::kTRDrefit)\r
1864 ,Bool_t(status & AliESDtrack::kTRDpid)\r
1865 ,Bool_t(status & AliESDtrack::kTRDStop)\r
1866 ,Bool_t(status & AliESDtrack::kHMPIDout)\r
1867 ,Bool_t(status & AliESDtrack::kHMPIDpid)\r
1868 );\r
1869}\r
1870\r
1871//____________________________________________________________________\r
1872TH1D* AliTRDcheckESD::Proj2D(TH2* hist, TH1* fitErr) {\r
1873 //\r
1874 // project the PH vs Slice 2D-histo into a 1D histo\r
1875 //\r
1876 \r
1877 TH1D* hProjection = (TH1D*)hist->ProjectionX(Form("hProjection_%f", gRandom->Rndm()));\r
1878 hProjection->Reset();\r
1879 \r
1880 TF1* fitLandau = new TF1("landauFunc","landau",0.,2000.);\r
1881 TH1D *hD;\r
1882 for(Int_t iBin=1;iBin<=hist->GetXaxis()->GetNbins();iBin++) {\r
1883 if(gROOT->FindObject("projection"))\r
1884 delete gROOT->FindObject("projection");\r
1885 hD = (TH1D*)hist->ProjectionY("projection",iBin,iBin);\r
1886 hD->Rebin(4);\r
1887 if(hD->Integral()>10) {\r
1888 fitLandau->SetParameter(1, hD->GetBinCenter(hD->GetMaximumBin()));\r
1889 fitLandau->SetParLimits(1, 0.2*hD->GetBinCenter(hD->GetMaximumBin()), 3.0*hD->GetBinCenter(hD->GetMaximumBin()));\r
1890 fitLandau->SetParameter(0, 1000.);\r
1891 fitLandau->SetParLimits(0, 1., 10000000.);\r
1892 fitLandau->SetParameter(2, 0.5*hD->GetBinCenter(hD->GetMaximumBin()));\r
1893 fitLandau->SetParLimits(2, 0.01*hD->GetBinCenter(hD->GetMaximumBin()), 1.0*hD->GetBinCenter(hD->GetMaximumBin()));\r
1894 hD->Fit(fitLandau, "Q0", "", hD->GetXaxis()->GetXmin(), hD->GetXaxis()->GetXmax());\r
1895 hD->Fit(fitLandau, "Q0", "", hD->GetXaxis()->GetXmin(), hD->GetXaxis()->GetXmax());\r
1896 hProjection->SetBinContent(iBin, fitLandau->GetParameter(1));\r
1897 hProjection->SetBinError(iBin, fitLandau->GetParameter(2));\r
1898 if(fitErr) {\r
1899 fitErr->SetBinContent(iBin, fitLandau->GetParameter(1));\r
1900 fitErr->SetBinError(iBin, fitLandau->GetParError(1));\r
1901 }\r
1902 }\r
1903 else{\r
1904 hProjection->SetBinContent(iBin, 0);\r
1905 hProjection->SetBinError(iBin, 0);\r
1906 }\r
1907 }\r
1908 return hProjection;\r
1909}\r
1910\r
1911//____________________________________________________________________\r
1912TH2F* AliTRDcheckESD::Proj3D(TH3* hist, TH2* accMap, Int_t zbinLow, Int_t zbinHigh, Float_t &entries) {\r
1913 //\r
1914 // Project a 3D histogram to a 2D histogram in the Z axis interval [zbinLow,zbinHigh] \r
1915 // Return the 2D histogram and also the number of entries into this projection (entries)\r
1916\r
1917 Int_t nBinsX = hist->GetXaxis()->GetNbins(); // X and Y axis bins are assumed to be all equal\r
1918 Float_t minX = hist->GetXaxis()->GetXmin();\r
1919 Float_t maxX = hist->GetXaxis()->GetXmax();\r
1920 Int_t nBinsY = hist->GetYaxis()->GetNbins();\r
1921 Float_t minY = hist->GetYaxis()->GetXmin();\r
1922 Float_t maxY = hist->GetYaxis()->GetXmax();\r
1923 Int_t nBinsZ = hist->GetZaxis()->GetNbins(); // Z axis bins (pt) might have different widths\r
1924\r
1925 TH2F* projHisto = (TH2F*)gROOT->FindObject("projHisto");\r
1926 if(projHisto) \r
1927 projHisto->Reset();\r
1928 else\r
1929 projHisto = new TH2F("projHisto", "projection", nBinsX, minX, maxX, nBinsY, minY, maxY);\r
1930\r
1931 for(Int_t iZ=1; iZ<=nBinsZ; iZ++) {\r
1932 if(iZ<zbinLow) continue;\r
1933 if(iZ>zbinHigh) continue;\r
1934 for(Int_t iX=1; iX<=nBinsX; iX++) {\r
1935 for(Int_t iY=1; iY<=nBinsY; iY++) {\r
1936 if(accMap) {\r
1937 if(accMap->GetBinContent(iX,iY)>0.1)\r
1938 projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ));\r
1939 }\r
1940 else // no acc. cut \r
1941 projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ));\r
1942 // count only the entries which are inside the acceptance map\r
1943 if(accMap) {\r
1944 if(accMap->GetBinContent(iX,iY)>0.1)\r
1945 entries+=hist->GetBinContent(iX,iY,iZ);\r
1946 }\r
1947 else // no acc. cut\r
1948 entries+=hist->GetBinContent(iX,iY,iZ);\r
1949 }\r
1950 }\r
1951 }\r
1952 return projHisto;\r
1953}\r
1954\r
1955//____________________________________________________________________\r
1956void AliTRDcheckESD::CheckActiveSM(TH1D* phiProj, Bool_t activeSM[18]) {\r
1957 //\r
1958 // Check the active super-modules\r
1959 //\r
1960 Double_t entries[18] = {0.0};\r
1961 Double_t smPhiLimits[19];\r
1962 for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism;\r
1963 for(Int_t phiBin=1; phiBin<=phiProj->GetXaxis()->GetNbins(); ++phiBin) {\r
1964 Double_t phi = phiProj->GetBinCenter(phiBin);\r
1965 Int_t sm = -1;\r
1966 for(Int_t ism=0; ism<18; ++ism) \r
1967 if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1]) sm = ism;\r
1968 if(sm==-1) continue;\r
1969 entries[sm] += phiProj->GetBinContent(phiBin);\r
1970 }\r
1971 Double_t avEntries = Double_t(phiProj->Integral())/18.0;\r
1972 for(Int_t ism=0; ism<18; ++ism) \r
1973 if(entries[ism]>0.5*avEntries) activeSM[ism] = kTRUE;\r
1974}\r
1975\r
1976\r
1977//__________________________________________________________________________________________________\r
1978TH1F* AliTRDcheckESD::EfficiencyFromPhiPt(AliCFContainer* cf, Int_t minNtrkl, Int_t maxNtrkl, \r
1979 Int_t stepNom, Int_t stepDenom, const Char_t* varStr/*="pt"*/, const Char_t* type/*="TPCTRD"*/) {\r
1980 //\r
1981 // Use the CF container to extract the efficiency vs pt\r
1982 //\r
1983 Int_t varTrackPhi = cf->GetVar("phi");\r
1984 Int_t var = cf->GetVar(varStr);\r
1985 \r
1986 TH1D* phiProj = (TH1D*)cf->Project(1, varTrackPhi);\r
1987 Bool_t activeSM[18] = {kFALSE};\r
1988 CheckActiveSM(phiProj, activeSM); delete phiProj;\r
1989 Double_t smPhiLimits[19];\r
1990 for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism;\r
1991 \r
1992 TString effTypeStr = type;\r
1993 if(effTypeStr.Contains("TRDTOF")) {\r
1994 if(minNtrkl>-1 && minNtrkl<7 && maxNtrkl>-1 && maxNtrkl<7)\r
1995 cf->SetRangeUser(cf->GetVar("tracklets"), Double_t(minNtrkl), Double_t(maxNtrkl));\r
1996 }\r
1997 TH2D* hDenomPhiVar = (TH2D*)cf->Project(stepDenom, var, varTrackPhi);\r
1998 if(effTypeStr.Contains("TPCTRD")) {\r
1999 if(minNtrkl>-1 && minNtrkl<7 && maxNtrkl>-1 && maxNtrkl<7)\r
2000 cf->SetRangeUser(cf->GetVar("tracklets"), Double_t(minNtrkl), Double_t(maxNtrkl));\r
2001 }\r
2002 TH2D* hNomPhiVar = (TH2D*)cf->Project(stepNom, var, varTrackPhi);\r
2003 cf->SetRangeUser(cf->GetVar("tracklets"), 0.0, 6.0);\r
2004 \r
2005 TH1F* hEff = new TH1F(Form("hEff%s_%d_%d_%f", varStr, stepNom, stepDenom, gRandom->Rndm()), "", \r
2006 hNomPhiVar->GetXaxis()->GetNbins(), hNomPhiVar->GetXaxis()->GetXbins()->GetArray());\r
2007 for(Int_t ivar=1; ivar<=hEff->GetXaxis()->GetNbins(); ++ivar) {\r
2008 Double_t nom = 0.0; Double_t denom = 0.0;\r
2009 Double_t eff = 0.0; Double_t err = 0.0;\r
2010 for(Int_t iphi=1; iphi<=hNomPhiVar->GetYaxis()->GetNbins(); ++iphi) {\r
2011 Double_t phi = hNomPhiVar->GetYaxis()->GetBinCenter(iphi);\r
2012 Bool_t isActive = kFALSE;\r
2013 for(Int_t ism=0; ism<18; ++ism) \r
2014 if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1] && activeSM[ism]) \r
2015 isActive = kTRUE;\r
2016 if(!isActive) continue;\r
2017 nom += hNomPhiVar->GetBinContent(ivar, iphi);\r
2018 denom += hDenomPhiVar->GetBinContent(ivar, iphi);\r
2019 }\r
2020 eff = (denom>0.001 ? nom/denom : 0.0);\r
2021 err = (denom>0.001 && (denom-nom)>0.001 && nom>0.001 ? (TMath::Sqrt(nom*(denom-nom)/denom/denom/denom)) : 0.0);\r
2022 hEff->SetBinContent(ivar, eff);\r
2023 hEff->SetBinError(ivar, err);\r
2024 } // end loop over pt bins\r
2025 delete hNomPhiVar; delete hDenomPhiVar;\r
2026 return hEff;\r
2027}\r
2028\r
2029\r
2030//____________________________________________________________________\r
2031TH1F* AliTRDcheckESD::EfficiencyTRD(TH3* tpc3D, TH3* trd3D, Bool_t useAcceptance) {\r
2032 //\r
2033 // Calculate the TRD-TPC matching efficiency as function of pt\r
2034 //\r
2035 \r
2036 if(!tpc3D || !trd3D) return NULL;\r
2037 Int_t nBinsZ = trd3D->GetZaxis()->GetNbins();\r
2038 // project everything on the eta-phi map to obtain an acceptance map\r
2039 Float_t nada = 0.;\r
2040 TH2F *trdAcc = (useAcceptance ? (TH2F*)Proj3D(trd3D, 0x0, 1, nBinsZ, nada)->Clone(Form("trdAcc%f", gRandom->Rndm())) : 0x0);\r
2041 TH1D *phiProj = (trdAcc ? trdAcc->ProjectionY(Form("phiProj%f", gRandom->Rndm())) : 0x0);\r
2042 \r
2043 // prepare the acceptance map\r
2044 Bool_t activeSM[18] = {kFALSE};\r
2045 Double_t smPhiLimits[19];\r
2046 for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism;\r
2047 if(phiProj) {\r
2048 CheckActiveSM(phiProj, activeSM); // get the active SMs\r
2049 trdAcc->Reset();\r
2050 // Put 1 entry in every bin which belongs to an active SM\r
2051 for(Int_t iY=1; iY<=trdAcc->GetYaxis()->GetNbins(); ++iY) {\r
2052 Double_t phi = trdAcc->GetYaxis()->GetBinCenter(iY);\r
2053 Bool_t isActive = kFALSE;\r
2054 for(Int_t ism=0; ism<18; ++ism) {\r
2055 if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1] && activeSM[ism]) {\r
2056 isActive = kTRUE;\r
2057 }\r
2058 }\r
2059 if(!isActive) continue;\r
2060 for(Int_t iX=1; iX<=trdAcc->GetXaxis()->GetNbins(); ++iX) \r
2061 if(trdAcc->GetXaxis()->GetBinCenter(iX)>=-0.85 && trdAcc->GetXaxis()->GetBinCenter(iX)<=0.85) trdAcc->SetBinContent(iX, iY, 1.0);\r
2062 } // end for over Y(phi) bins\r
2063 } // end if phiProj\r
2064 \r
2065 // get the bin limits from the Z axis of 3D histos\r
2066 Float_t *ptBinLimits = new Float_t[nBinsZ+1];\r
2067 for(Int_t i=1; i<=nBinsZ; i++) {\r
2068 ptBinLimits[i-1] = trd3D->GetZaxis()->GetBinLowEdge(i);\r
2069 }\r
2070 ptBinLimits[nBinsZ] = trd3D->GetZaxis()->GetBinUpEdge(nBinsZ);\r
2071 \r
2072 TH1F *efficiency = new TH1F(Form("eff%d", Int_t(1000000.0*gRandom->Rndm())), "TRD-TPC matching efficiency", nBinsZ, ptBinLimits);\r
2073 \r
2074 // loop over Z bins\r
2075 Bool_t effGood = kFALSE;\r
2076 for(Int_t i=1; i<=nBinsZ; i++) {\r
2077 Float_t tpcEntries = 0.0; Float_t trdEntries = 0.0;\r
2078 Proj3D(tpc3D, trdAcc, i, i, tpcEntries);\r
2079 Proj3D(trd3D, trdAcc, i, i, trdEntries);\r
2080 Float_t ratio = 0;\r
2081 if(tpcEntries>0) ratio = trdEntries/tpcEntries;\r
2082 Float_t error = 0;\r
2083 if(tpcEntries>0 && trdEntries>0 && (tpcEntries-trdEntries)>=0.0) \r
2084 error = TMath::Sqrt(trdEntries*(tpcEntries-trdEntries)/tpcEntries/tpcEntries/tpcEntries);\r
2085 if(ratio>0.001) {\r
2086 efficiency->SetBinContent(i,ratio);\r
2087 efficiency->SetBinError(i,error);\r
2088 effGood = kTRUE;\r
2089 }\r
2090 } // end loop over Z bins\r
2091 if(!effGood) return 0x0;\r
2092 \r
2093 return efficiency;\r
2094}\r
2095\r
2096//__________________________________________________________________________________________________\r
2097void AliTRDcheckESD::PlotCentSummaryFromCF(Double_t* /*trendValues*/, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) {\r
2098 //\r
2099 // Make the centrality summary figure from the CF container \r
2100 // \r
2101 if(!fMatchingPtCF) return;\r
2102 AliCFContainer* cf = 0x0; \r
2103 \r
2104 TLatex* lat=new TLatex();\r
2105 lat->SetTextSize(0.06);\r
2106 lat->SetTextColor(2);\r
2107\r
2108 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
2109 gPad->Divide(3,3,0.,0.);\r
2110 TList* l=gPad->GetListOfPrimitives();\r
2111 TVirtualPad* pad=0x0;\r
2112 \r
2113 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, 0.0, 0.0);\r
2114 \r
2115 if(gROOT->FindObject("rangeEffPt")) delete gROOT->FindObject("rangeEffPt");\r
2116 TH2F* rangeEffPt=new TH2F("rangeEffPt", "",10,0.,10.,10,0.,1.3);\r
2117 rangeEffPt->SetStats(kFALSE);\r
2118 SetStyle(rangeEffPt->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
2119 SetStyle(rangeEffPt->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05);\r
2120 \r
2121 Int_t padsForEffs[5] = {0,3,6,1,4};\r
2122 for(Int_t iCent=1; iCent<6; ++iCent) {\r
2123 pad = ((TVirtualPad*)l->At(padsForEffs[iCent-1])); pad->cd();\r
2124 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2125 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2126 rangeEffPt->Draw();\r
2127 TLine line;\r
2128 line.SetLineStyle(2);\r
2129 line.SetLineWidth(2);\r
2130 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.7, rangeEffPt->GetXaxis()->GetXmax(), 0.7);\r
2131 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.9, rangeEffPt->GetXaxis()->GetXmax(), 0.9);\r
2132 \r
2133 cf = fMatchingPtCF;\r
2134 cf->SetRangeUser(cf->GetVar("multiplicity"), Double_t(iCent), Double_t(iCent), kTRUE);\r
2135 \r
2136 cf->SetRangeUser(cf->GetVar("charge"), +1.0, +1.0); \r
2137 TH1F* hEffPosAll = EfficiencyFromPhiPt(cf, 0, 6, 1, 0);\r
2138 TH1F* hEffPosTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 1, 0); \r
2139 TH1F* hEffPosTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 1, 0);\r
2140 TH1F* hEffPosTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 1, 0);\r
2141 \r
2142 cf->SetRangeUser(cf->GetVar("charge"), -1.0, -1.0); \r
2143 TH1F* hEffNegAll = EfficiencyFromPhiPt(cf, 0, 6, 1, 0); \r
2144 TH1F* hEffNegTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 1, 0); \r
2145 TH1F* hEffNegTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 1, 0); \r
2146 TH1F* hEffNegTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 1, 0);\r
2147 cf->SetRangeUser(cf->GetVar("tracklets"), 0.0, 6.0); \r
2148 cf->SetRangeUser(cf->GetVar("charge"), -1.0, +1.0); \r
2149 \r
2150 SetStyle(hEffPosAll, 1, kRed, 1, 24, kRed, 1);\r
2151 SetStyle(hEffPosTrk4, 1, kRed, 1, 25, kRed, 1);\r
2152 SetStyle(hEffPosTrk5, 1, kRed, 1, 26, kRed, 1);\r
2153 SetStyle(hEffPosTrk6, 1, kRed, 1, 27, kRed, 1);\r
2154 SetStyle(hEffNegAll, 1, kBlue, 1, 24, kBlue, 1);\r
2155 SetStyle(hEffNegTrk4, 1, kBlue, 1, 25, kBlue, 1);\r
2156 SetStyle(hEffNegTrk5, 1, kBlue, 1, 26, kBlue, 1);\r
2157 SetStyle(hEffNegTrk6, 1, kBlue, 1, 27, kBlue, 1);\r
2158 hEffPosAll->Draw("same");\r
2159 hEffNegAll->Draw("same");\r
2160 hEffPosTrk4->Draw("same");\r
2161 hEffNegTrk4->Draw("same");\r
2162 hEffPosTrk5->Draw("same");\r
2163 hEffNegTrk5->Draw("same");\r
2164 hEffPosTrk6->Draw("same");\r
2165 hEffNegTrk6->Draw("same"); \r
2166 \r
2167 TLegend* leg=new TLegend(0.18, 0.7, 0.77, 0.89);\r
2168 if(iCent==1) {\r
2169 leg->SetFillColor(0);\r
2170 leg->SetNColumns(2);\r
2171 leg->SetMargin(0.1);\r
2172 leg->SetBorderSize(0);\r
2173 leg->AddEntry(hEffPosAll, "pos. (#geq 1 tracklet)", "p");\r
2174 leg->AddEntry(hEffNegAll, "neg. (#geq 1 tracklet)", "p");\r
2175 leg->AddEntry(hEffPosTrk4, "pos. (4 tracklets)", "p");\r
2176 leg->AddEntry(hEffNegTrk4, "neg. (4 tracklets)", "p");\r
2177 leg->AddEntry(hEffPosTrk5, "pos. (5 tracklets)", "p");\r
2178 leg->AddEntry(hEffNegTrk5, "neg. (5 tracklets)", "p");\r
2179 leg->AddEntry(hEffPosTrk6, "pos. (6 tracklets)", "p"); \r
2180 leg->AddEntry(hEffNegTrk6, "neg. (6 tracklets)", "p");\r
2181 leg->Draw();\r
2182 }\r
2183 lat->DrawLatex(0.2, 1.32, Form("%.0f < SPD tracklets < %.0f", cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinLowEdge(iCent), cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinUpEdge(iCent)));\r
2184 } // end for loop over multiplicity classes\r
2185 \r
2186 // Reset the modified user ranges of the CF container\r
2187 cf->SetRangeUser(cf->GetVar("multiplicity"), 0., 3500.);\r
2188 \r
2189 // Cluster distributions in all multiplicity classes\r
2190 pad = ((TVirtualPad*)l->At(2)); pad->cd();\r
2191 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2192 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);\r
2193 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2194 if(gROOT->FindObject("rangeNcls")) delete gROOT->FindObject("rangeNcls");\r
2195 TH2F* rangeNcls = new TH2F("rangeNcls", "", 10, 0.0, 199.9, 10, 0.0, 1.199);\r
2196 SetStyle(rangeNcls->GetXaxis(), "# TRD clusters", 0.07, 0.8, kTRUE, 0.05);\r
2197 SetStyle(rangeNcls->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2198 rangeNcls->SetStats(kFALSE);\r
2199 rangeNcls->Draw();\r
2200 \r
2201 TH1D* hNcls[6]={0x0};\r
2202 TLegend* legCls=new TLegend(0.7, 0.75, 0.97, 0.97);\r
2203 legCls->SetBorderSize(0);\r
2204 legCls->SetFillColor(0);\r
2205 legCls->SetMargin(0.15);\r
2206 cf = fCentralityCF;\r
2207 for(Int_t iCent=0; iCent<6; ++iCent) {\r
2208 if(iCent>0)\r
2209 cf->SetRangeUser(cf->GetVar("multiplicity"), Double_t(iCent), Double_t(iCent), kTRUE);\r
2210 hNcls[iCent] = (TH1D*)cf->Project(0, cf->GetVar("clusters"));\r
2211 if(!hNcls[iCent]) continue;\r
2212 \r
2213 hNcls[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);\r
2214 Double_t maximum = hNcls[iCent]->GetMaximum();\r
2215 if(maximum>1.0)\r
2216 hNcls[iCent]->Scale(1.0/maximum);\r
2217 hNcls[iCent]->SetStats(kFALSE);\r
2218 hNcls[iCent]->SetTitle("");\r
2219 hNcls[iCent]->SetLineWidth(2);\r
2220 \r
2221 if(hNcls[iCent]->Integral()>0.01) {\r
2222 hNcls[iCent]->Draw("same");\r
2223 legCls->AddEntry(hNcls[iCent], (iCent==0 ? "all centralities" : Form("%.0f < SPD tracklets < %.0f", cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinLowEdge(iCent), \r
2224 cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinUpEdge(iCent))), "l");\r
2225 }\r
2226 }\r
2227 legCls->Draw();\r
2228 cf->SetRangeUser(cf->GetVar("multiplicity"), 0.0, 6.0, kTRUE);\r
2229 \r
2230 // Qtot vs P\r
2231 pad = ((TVirtualPad*)l->At(5)); pad->cd();\r
2232 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2233 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);\r
2234 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2235 if(gROOT->FindObject("rangeQtot")) delete gROOT->FindObject("rangeQtot");\r
2236 TH2F* rangeQtot = new TH2F("rangeQtot", "", 10, 0.0, 9.999, 10, 0.0, 1.199);\r
2237 SetStyle(rangeQtot->GetXaxis(), "Q_{tot} (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2238 SetStyle(rangeQtot->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2239 rangeQtot->SetStats(kFALSE);\r
2240 rangeQtot->Draw();\r
2241 \r
2242 TH1D* hQtot[6]={0x0};\r
2243 TLegend* leg2=new TLegend(0.6, 0.7, 0.9, 0.97);\r
2244 leg2->SetFillColor(0);\r
2245 leg2->SetBorderSize(0);\r
2246 \r
2247 for(Int_t iCent=0; iCent<6; ++iCent) {\r
2248 if(iCent>0)\r
2249 cf->SetRangeUser(cf->GetVar("multiplicity"), Double_t(iCent), Double_t(iCent), kTRUE);\r
2250 \r
2251 hQtot[iCent] = (TH1D*)cf->Project(0, cf->GetVar("Qtot0"));\r
2252 if(!hQtot[iCent]) continue;\r
2253 hQtot[iCent]->SetBinContent(1, 0);\r
2254 \r
2255 Double_t maximum = hQtot[iCent]->GetMaximum();\r
2256 if(maximum>1.0)\r
2257 hQtot[iCent]->Scale(1.0/maximum);\r
2258 hQtot[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);\r
2259 hQtot[iCent]->SetStats(kFALSE);\r
2260 hQtot[iCent]->SetTitle("");\r
2261 hQtot[iCent]->SetLineWidth(2);\r
2262 if(hQtot[iCent]->Integral()>0.01) {\r
2263 hQtot[iCent]->Draw(iCent==0 ? "" : "same");\r
2264 leg2->AddEntry(hQtot[iCent], (iCent==0 ? "all centralities" : Form("%.0f < SPD tracklets < %.0f", cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinLowEdge(iCent), \r
2265 cf->GetAxis(cf->GetVar("multiplicity"),0)->GetBinUpEdge(iCent))), "l");\r
2266 }\r
2267 }\r
2268 leg2->Draw();\r
2269 cf->SetRangeUser(cf->GetVar("multiplicity"), 0.0, 5.0, kTRUE);\r
2270 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, -1000.0, +1000.0); // reset the cut on TOFbc\r
2271}\r
2272\r
2273\r
2274//_________________________________________________________________\r
2275void AliTRDcheckESD::PlotTrackingSummaryFromCF(Double_t* trendValues, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) {\r
2276 //\r
2277 // Plot tracking summary\r
2278 //\r
2279 if(!fMatchingPhiEtaCF || !fMatchingPtCF || !fCentralityCF || !fBunchCrossingsCF) return;\r
2280 AliCFContainer* cf = 0x0; \r
2281 \r
2282 TLatex *lat=new TLatex();\r
2283 lat->SetTextSize(0.06);\r
2284 lat->SetTextColor(2);\r
2285 \r
2286 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);\r
2287 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
2288 gPad->Divide(3,3,0.,0.);\r
2289 TList* l=gPad->GetListOfPrimitives();\r
2290 \r
2291 // eta-phi distr. for positive TPC tracks\r
2292 TVirtualPad* pad = ((TVirtualPad*)l->At(0)); pad->cd();\r
2293 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2294 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2295 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2296 \r
2297 //cf->SetRangeUser(stepDCAxy, -0.999, +0.999);\r
2298 //cf->SetRangeUser(stepDCAz, -3.0, +3.0);\r
2299 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, 0.0, 0.0);\r
2300 \r
2301 // find all the isolated bunch crossings with entries\r
2302 TH2D* hTPCrefPos = 0x0; TH2D* hTRDrefPos = 0x0; TH2D* hTOFrefPos = 0x0;\r
2303 TH2D* hTPCrefNeg = 0x0; TH2D* hTRDrefNeg = 0x0; TH2D* hTOFrefNeg = 0x0;\r
2304 cf = fMatchingPhiEtaCF;\r
2305 cf->SetRangeUser(cf->GetVar("tracklets"), 0.0, 6.0);\r
2306 cf->SetRangeUser(cf->GetVar("charge"), +1.0, +1.0); // positive charges\r
2307 hTPCrefPos = (TH2D*)cf->Project(0, cf->GetVar("eta"), cf->GetVar("phi"));\r
2308 hTRDrefPos = (TH2D*)cf->Project(1, cf->GetVar("eta"), cf->GetVar("phi"));\r
2309 hTOFrefPos = (TH2D*)cf->Project(2, cf->GetVar("eta"), cf->GetVar("phi"));\r
2310 cf->SetRangeUser(cf->GetVar("charge"), -1.0, -1.0); // negative charges\r
2311 hTPCrefNeg = (TH2D*)cf->Project(0, cf->GetVar("eta"), cf->GetVar("phi"));\r
2312 hTRDrefNeg = (TH2D*)cf->Project(1, cf->GetVar("eta"), cf->GetVar("phi"));\r
2313 hTOFrefNeg = (TH2D*)cf->Project(2, cf->GetVar("eta"), cf->GetVar("phi"));\r
2314 cf->SetRangeUser(cf->GetVar("charge"), -1.0, +1.0); // reset charge cut\r
2315 \r
2316 if(gROOT->FindObject("rangeEtaPhi")) delete gROOT->FindObject("rangeEtaPhi");\r
2317 TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi", "", 10, -0.99, +0.99, 10, -3.4, +3.4);\r
2318 SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05);\r
2319 SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05);\r
2320 rangeEtaPhi->SetStats(kFALSE); \r
2321 \r
2322 //----------------------------------------------\r
2323 // eta-phi efficiency for positive TRD tracks\r
2324 pad = ((TVirtualPad*)l->At(0)); pad->cd();\r
2325 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2326 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2327 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2328 rangeEtaPhi->Draw();\r
2329 \r
2330 TH2D* hTRDeffPos = (hTRDrefPos ? (TH2D*)hTRDrefPos->Clone("hTRDeffPos") : 0x0);\r
2331 if(hTRDeffPos) {\r
2332 hTRDeffPos->Reset();\r
2333 hTRDeffPos->SetStats(kFALSE);\r
2334 hTRDeffPos->Divide(hTRDrefPos, hTPCrefPos);\r
2335 hTRDeffPos->SetMaximum(1.0);\r
2336 hTRDeffPos->Draw("samecolz");\r
2337 lat->DrawLatex(-0.9, 3.6, "TPC-TRD matching for positive tracks");\r
2338 DrawTRDGrid();\r
2339 }\r
2340 \r
2341 //----------------------------------------------\r
2342 // eta-phi efficiency for negative TRD tracks\r
2343 pad = ((TVirtualPad*)l->At(3)); pad->cd();\r
2344 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2345 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2346 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2347 rangeEtaPhi->Draw();\r
2348 \r
2349 TH2D* hTRDeffNeg = (hTRDrefNeg ? (TH2D*)hTRDrefNeg->Clone("hTRDeffNeg") : 0x0);\r
2350 if(hTRDeffNeg) {\r
2351 hTRDeffNeg->Reset();\r
2352 hTRDeffNeg->SetStats(kFALSE);\r
2353 hTRDeffNeg->Divide(hTRDrefNeg, hTPCrefNeg);\r
2354 hTRDeffNeg->SetMaximum(1.0);\r
2355 hTRDeffNeg->Draw("samecolz");\r
2356 lat->DrawLatex(-0.9, 3.6, "TPC-TRD matching for negative tracks");\r
2357 DrawTRDGrid(); \r
2358 }\r
2359 \r
2360 //----------------------------------------------\r
2361 // eta-phi TRD-TOF matching efficiency for positive tracks\r
2362 pad = ((TVirtualPad*)l->At(1)); pad->cd();\r
2363 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2364 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2365 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2366 rangeEtaPhi->Draw();\r
2367 \r
2368 TH2D* hTOFeffPos = (hTOFrefPos ? (TH2D*)hTOFrefPos->Clone("hTOFeffPos") : 0x0);\r
2369 if(hTOFeffPos) {\r
2370 hTOFeffPos->Reset();\r
2371 hTOFeffPos->SetStats(kFALSE);\r
2372 hTOFeffPos->Divide(hTOFrefPos, hTRDrefPos);\r
2373 hTOFeffPos->SetMaximum(1.0);\r
2374 hTOFeffPos->Draw("samecolz");\r
2375 lat->DrawLatex(-0.9, 3.6, "TRD-TOF matching for positive tracks");\r
2376 DrawTRDGrid();\r
2377 }\r
2378 \r
2379 //----------------------------------------------\r
2380 // eta-phi TRD-TOF matching efficiency for negative tracks\r
2381 pad = ((TVirtualPad*)l->At(4)); pad->cd();\r
2382 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2383 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2384 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2385 rangeEtaPhi->Draw();\r
2386 \r
2387 TH2D* hTOFeffNeg = (hTOFrefNeg ? (TH2D*)hTOFrefNeg->Clone("hTOFeffNeg") : 0x0);\r
2388 if(hTOFeffNeg) {\r
2389 hTOFeffNeg->Reset();\r
2390 hTOFeffNeg->SetStats(kFALSE);\r
2391 hTOFeffNeg->Divide(hTOFrefNeg, hTRDrefNeg);\r
2392 hTOFeffNeg->SetMaximum(1.0);\r
2393 hTOFeffNeg->Draw("samecolz");\r
2394 lat->DrawLatex(-0.9, 3.6, "TRD-TOF matching for negative tracks");\r
2395 DrawTRDGrid();\r
2396 }\r
2397 \r
2398 if(hTRDrefPos) delete hTRDrefPos; if(hTPCrefPos) delete hTPCrefPos; if(hTOFrefPos) delete hTOFrefPos;\r
2399 if(hTRDrefNeg) delete hTRDrefNeg; if(hTPCrefNeg) delete hTPCrefNeg; if(hTOFrefNeg) delete hTOFrefNeg;\r
2400 \r
2401 // switch to the Pt cf container\r
2402 cf = fMatchingPtCF;\r
2403 cf->SetRangeUser(cf->GetVar("charge"), +1.0, +1.0); \r
2404 TH1F* hTRDEffPtPosAll = EfficiencyFromPhiPt(cf, 0, 6, 1, 0);\r
2405 TH1F* hTOFEffPtPosAll = EfficiencyFromPhiPt(cf, 0, 6, 2, 1, "pt", "TRDTOF");\r
2406 TH1F* hTRDEffPtPosTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 1, 0);\r
2407 TH1F* hTOFEffPtPosTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 2, 1, "pt", "TRDTOF");\r
2408 TH1F* hTRDEffPtPosTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 1, 0);\r
2409 TH1F* hTOFEffPtPosTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 2, 1, "pt", "TRDTOF");\r
2410 TH1F* hTRDEffPtPosTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 1, 0);\r
2411 TH1F* hTOFEffPtPosTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 2, 1, "pt", "TRDTOF");\r
2412 \r
2413 cf->SetRangeUser(cf->GetVar("charge"), -1.0, -1.0); \r
2414 TH1F* hTRDEffPtNegAll = EfficiencyFromPhiPt(cf, 0, 6, 1, 0);\r
2415 TH1F* hTOFEffPtNegAll = EfficiencyFromPhiPt(cf, 0, 6, 2, 1, "pt", "TRDTOF");\r
2416 TH1F* hTRDEffPtNegTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 1, 0);\r
2417 TH1F* hTOFEffPtNegTrk4 = EfficiencyFromPhiPt(cf, 4, 4, 2, 1, "pt", "TRDTOF");\r
2418 TH1F* hTRDEffPtNegTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 1, 0);\r
2419 TH1F* hTOFEffPtNegTrk5 = EfficiencyFromPhiPt(cf, 5, 5, 2, 1, "pt", "TRDTOF");\r
2420 TH1F* hTRDEffPtNegTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 1, 0);\r
2421 TH1F* hTOFEffPtNegTrk6 = EfficiencyFromPhiPt(cf, 6, 6, 2, 1, "pt", "TRDTOF");\r
2422 cf->SetRangeUser(cf->GetVar("charge"), -1.0, +1.0); \r
2423 \r
2424 TF1* funcConst = new TF1("constFunc", "[0]", 1.0, 3.0);\r
2425 if(trendValues) {\r
2426 if(hTRDEffPtPosAll && hTRDEffPtPosAll->Integral()>0.1) {\r
2427 hTRDEffPtPosAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0);\r
2428 trendValues[0] = funcConst->GetParameter(0);\r
2429 trendValues[1] = funcConst->GetParError(0);\r
2430 }\r
2431 }\r
2432 if(trendValues) { \r
2433 if(hTRDEffPtNegAll && hTRDEffPtNegAll->Integral()>0.1) {\r
2434 hTRDEffPtNegAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0);\r
2435 trendValues[2] = funcConst->GetParameter(0);\r
2436 trendValues[3] = funcConst->GetParError(0);\r
2437 }\r
2438 }\r
2439 if(trendValues) { \r
2440 if(hTOFEffPtPosAll && hTOFEffPtPosAll->Integral()>0.1) {\r
2441 hTOFEffPtPosAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0);\r
2442 trendValues[4] = funcConst->GetParameter(0);\r
2443 trendValues[5] = funcConst->GetParError(0);\r
2444 }\r
2445 }\r
2446 if(trendValues) { \r
2447 if(hTOFEffPtNegAll && hTOFEffPtNegAll->Integral()>0.1) {\r
2448 hTOFEffPtNegAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0);\r
2449 trendValues[6] = funcConst->GetParameter(0);\r
2450 trendValues[7] = funcConst->GetParError(0);\r
2451 }\r
2452 }\r
2453 \r
2454 //---------------------------------------------------------\r
2455 // TPC-TRD matching efficiency vs pt\r
2456 pad = ((TVirtualPad*)l->At(6)); pad->cd();\r
2457 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2458 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2459 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2460 \r
2461 if(gROOT->FindObject("rangeEffPt2")) delete gROOT->FindObject("rangeEffPt2");\r
2462 TH2F* rangeEffPt=new TH2F("rangeEffPt2", "",10,0.,10.,10,0.,1.4);\r
2463 rangeEffPt->SetStats(kFALSE);\r
2464 SetStyle(rangeEffPt->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
2465 SetStyle(rangeEffPt->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05);\r
2466 rangeEffPt->Draw();\r
2467 lat->DrawLatex(0.2, 1.42, "TPC-TRD matching efficiency");\r
2468 //++++++++++++++++++\r
2469 TLine line;\r
2470 line.SetLineStyle(2);\r
2471 line.SetLineWidth(2);\r
2472 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.7, rangeEffPt->GetXaxis()->GetXmax(), 0.7);\r
2473 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.9, rangeEffPt->GetXaxis()->GetXmax(), 0.9);\r
2474 TLegend* leg=new TLegend(0.2, 0.7, 0.7, 0.89);\r
2475 leg->SetNColumns(2);\r
2476 leg->SetMargin(0.15);\r
2477 leg->SetBorderSize(0);\r
2478 leg->SetFillColor(0);\r
2479\r
2480 SetStyle(hTRDEffPtPosAll, 1, kRed, 1, 24, kRed, 1);\r
2481 SetStyle(hTRDEffPtNegAll, 1, kBlue, 1, 24, kBlue, 1);\r
2482 SetStyle(hTRDEffPtPosTrk4, 1, kRed, 1, 25, kRed, 1);\r
2483 SetStyle(hTRDEffPtNegTrk4, 1, kBlue, 1, 25, kBlue, 1);\r
2484 SetStyle(hTRDEffPtPosTrk5, 1, kRed, 1, 26, kRed, 1);\r
2485 SetStyle(hTRDEffPtNegTrk5, 1, kBlue, 1, 26, kBlue, 1);\r
2486 SetStyle(hTRDEffPtPosTrk6, 1, kRed, 1, 27, kRed, 1);\r
2487 SetStyle(hTRDEffPtNegTrk6, 1, kBlue, 1, 27, kBlue, 1);\r
2488 if(hTRDEffPtPosAll) {hTRDEffPtPosAll->Draw("same"); leg->AddEntry(hTRDEffPtPosAll, "pos. (#geq 1 tracklet)", "p");}\r
2489 if(hTRDEffPtNegAll) {hTRDEffPtNegAll->Draw("same"); leg->AddEntry(hTRDEffPtNegAll, "neg. (#geq 1 tracklet)", "p");}\r
2490 hTRDEffPtPosTrk4->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk4, "pos. (4 tracklets)", "p");\r
2491 hTRDEffPtNegTrk4->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk4, "neg. (4 tracklets)", "p");\r
2492 hTRDEffPtPosTrk5->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk5, "pos. (5 tracklets)", "p");\r
2493 hTRDEffPtNegTrk5->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk5, "neg. (5 tracklets)", "p");\r
2494 hTRDEffPtPosTrk6->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk6, "pos. (6 tracklets)", "p");\r
2495 hTRDEffPtNegTrk6->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk6, "neg. (6 tracklets)", "p");\r
2496 \r
2497 leg->Draw();\r
2498 \r
2499 //---------------------------------------------------------\r
2500 // TRD-TOF matching efficiency vs pt\r
2501 pad = ((TVirtualPad*)l->At(7)); pad->cd();\r
2502 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2503 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2504 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2505 \r
2506 rangeEffPt->Draw();\r
2507 lat->DrawLatex(0.2, 1.42, "TRD-TOF matching efficiency");\r
2508 SetStyle(hTOFEffPtPosAll, 1, kRed, 1, 24, kRed, 1);\r
2509 SetStyle(hTOFEffPtPosTrk4, 1, kRed, 1, 25, kRed, 1);\r
2510 SetStyle(hTOFEffPtPosTrk5, 1, kRed, 1, 26, kRed, 1);\r
2511 SetStyle(hTOFEffPtPosTrk6, 1, kRed, 1, 27, kRed, 1);\r
2512 SetStyle(hTOFEffPtNegAll, 1, kBlue, 1, 24, kBlue, 1);\r
2513 SetStyle(hTOFEffPtNegTrk4, 1, kBlue, 1, 25, kBlue, 1);\r
2514 SetStyle(hTOFEffPtNegTrk5, 1, kBlue, 1, 26, kBlue, 1);\r
2515 SetStyle(hTOFEffPtNegTrk6, 1, kBlue, 1, 27, kBlue, 1);\r
2516 if(hTOFEffPtPosAll) hTOFEffPtPosAll->Draw("same"); \r
2517 hTOFEffPtPosTrk4->Draw("same"); \r
2518 hTOFEffPtPosTrk5->Draw("same"); \r
2519 hTOFEffPtPosTrk6->Draw("same"); \r
2520 if(hTOFEffPtNegAll) hTOFEffPtNegAll->Draw("same"); \r
2521 hTOFEffPtNegTrk4->Draw("same"); \r
2522 hTOFEffPtNegTrk5->Draw("same"); \r
2523 hTOFEffPtNegTrk6->Draw("same"); \r
2524 \r
2525 //-----------------------------------------------------\r
2526 // <ntracklets> vs (phi,eta)\r
2527 pad = ((TVirtualPad*)l->At(2)); pad->cd();\r
2528 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2529 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2530 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2531 \r
2532 rangeEtaPhi->Draw();\r
2533 lat->DrawLatex(-0.9, 3.6, "TRD <N_{tracklets}>");\r
2534 \r
2535 cf = fMatchingPhiEtaCF;\r
2536 TH3D* hNtracklets = (TH3D*)cf->Project(1, cf->GetVar("phi"), cf->GetVar("eta"), cf->GetVar("tracklets"));\r
2537 \r
2538 TProfile2D* hNtrackletsProf = hNtracklets->Project3DProfile();\r
2539 delete hNtracklets;\r
2540 if(hNtrackletsProf) {\r
2541 hNtrackletsProf->SetStats(kFALSE);\r
2542 hNtrackletsProf->SetMinimum(0.);\r
2543 hNtrackletsProf->SetMaximum(6.);\r
2544 hNtrackletsProf->Draw("samecolz");\r
2545 DrawTRDGrid();\r
2546 }\r
2547 \r
2548 // calculate the trend value for tracklets/track\r
2549 cf = fMatchingPtCF;\r
2550 TH2D* hNtrackletsVsP = (TH2D*)cf->Project(1, cf->GetVar("pt"), cf->GetVar("tracklets"));\r
2551 if(trendValues && hNtrackletsVsP && hNtrackletsVsP->GetEntries()>0.1) {\r
2552 TProfile* hNtrackletsVsPprof = hNtrackletsVsP->ProfileX("hNtrackletsVsPprof");\r
2553 hNtrackletsVsPprof->Fit(funcConst, "QME0", "goff", 1.0, 3.0);\r
2554 trendValues[8] = funcConst->GetParameter(0);\r
2555 trendValues[9] = funcConst->GetParError(0);\r
2556 delete hNtrackletsVsP;\r
2557 }\r
2558 \r
2559 //--------------------------------------------------------------\r
2560 // Nclusters per TRD track vs momentum\r
2561 pad = ((TVirtualPad*)l->At(5)); pad->cd();\r
2562 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.12);\r
2563 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2564 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2565 pad->SetLogz();\r
2566 \r
2567 if(gROOT->FindObject("rangeNclsP")) delete gROOT->FindObject("rangeNclsP");\r
2568 TH2F* rangeNclsP = new TH2F("rangeNclsP", "", 10, 0.0, 11.99, 10, 0.0, 199.0);\r
2569 SetStyle(rangeNclsP->GetXaxis(), "p [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
2570 SetStyle(rangeNclsP->GetYaxis(), "#clusters", 0.07, 0.8, kTRUE, 0.05);\r
2571 rangeNclsP->SetStats(kFALSE);\r
2572 rangeNclsP->Draw();\r
2573 lat->DrawLatex(1.0, 205., "TRD Clusters / track");\r
2574 \r
2575 cf = fCentralityCF;\r
2576 TH2D* hNclsVsP = (TH2D*)cf->Project(0, cf->GetVar("P"), cf->GetVar("clusters"));\r
2577 if(hNclsVsP) {\r
2578 hNclsVsP->SetStats(kFALSE);\r
2579 hNclsVsP->Draw("samecolz");\r
2580 } \r
2581 \r
2582 if(trendValues && hNclsVsP && hNclsVsP->GetEntries()>10) {\r
2583 TProfile* hNclsVsPprof = hNclsVsP->ProfileX("hNclsVsPprof");\r
2584 hNclsVsPprof->Fit(funcConst, "QME0", "goff", 1.0, 3.0);\r
2585 trendValues[10] = funcConst->GetParameter(0);\r
2586 trendValues[11] = funcConst->GetParError(0);\r
2587 }\r
2588 \r
2589 //--------------------------------------------------------------\r
2590 // TRD-TPC and TOF-TRD matching efficiency vs bunch crossing\r
2591 pad = ((TVirtualPad*)l->At(8)); pad->cd();\r
2592 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2593 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2594 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2595\r
2596 cf = fBunchCrossingsCF;\r
2597 TH1F* hTRDEffBC = EfficiencyFromPhiPt(cf, 0, 6, 1, 0, "BC", "TPCTRD");\r
2598 TH1F* hTOFEffBC = EfficiencyFromPhiPt(cf, 0, 6, 2, 1, "BC", "TRDTOF");\r
2599 \r
2600 if(gROOT->FindObject("rangeBC")) delete gROOT->FindObject("rangeBC");\r
2601 TH2F* rangeBC = new TH2F("rangeBC", "", 10, -0.5, 3499.5, 10, 0.0, 1.4);\r
2602 rangeBC->SetStats(kFALSE);\r
2603 SetStyle(rangeBC->GetXaxis(), "Bunch crossing", 0.07, 0.8, kTRUE, 0.05);\r
2604 SetStyle(rangeBC->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05);\r
2605 rangeBC->Draw();\r
2606 \r
2607 TLegend* legBC=new TLegend(0.8, 0.7, 0.95, 0.89);\r
2608 legBC->SetBorderSize(0);\r
2609 legBC->SetMargin(0.15);\r
2610 legBC->SetFillColor(0);\r
2611 if(hTRDEffBC) {\r
2612 hTRDEffBC->SetStats(kFALSE);\r
2613 SetStyle(hTRDEffBC, 1, kRed, 2, 24, kRed, 1); legBC->AddEntry(hTRDEffBC, "TPC-TRD", "p");\r
2614 SetStyle(hTOFEffBC, 1, kBlue, 2, 24, kBlue, 1); legBC->AddEntry(hTOFEffBC, "TRD-TOF", "p");\r
2615 hTRDEffBC->Draw("same");\r
2616 hTOFEffBC->Draw("same");\r
2617 legBC->Draw();\r
2618 lat->DrawLatex(200., 1.42, "Matching efficiency at 1<p_{T}<3 GeV/c");\r
2619 }\r
2620 \r
2621 // reset the user range on the event multiplicity\r
2622 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, -1000.0, +1000.0); // reset the cut on TOFbc\r
2623 \r
2624 delete funcConst;\r
2625}\r
2626\r
2627\r
2628//_________________________________________________________________\r
2629void AliTRDcheckESD::PlotPidSummaryFromCF(Double_t* trendValues, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) {\r
2630 //\r
2631 // Centrality summary\r
2632 //\r
2633 if(!fQtotCF || !fPulseHeightCF || !fCentralityCF) return;\r
2634 \r
2635 AliCFContainer* cf = 0x0;\r
2636 \r
2637 TLatex *lat=new TLatex();\r
2638 lat->SetTextSize(0.07);\r
2639 lat->SetTextColor(2);\r
2640 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);\r
2641 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
2642 gPad->Divide(3,3,0.,0.);\r
2643 TList* l=gPad->GetListOfPrimitives();\r
2644 \r
2645 //cf->SetRangeUser(stepDCAxy, -0.999, +0.999);\r
2646 //cf->SetRangeUser(stepDCAz, -3.0, +3.0);\r
2647 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, 0.0, 0.0);\r
2648 \r
2649 if(gROOT->FindObject("rangeEtaPhi2")) delete gROOT->FindObject("rangeEtaPhi2");\r
2650 TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi2", "", 10, -0.99, +0.99, 10, -3.4, +3.4);\r
2651 SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05);\r
2652 SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05);\r
2653 rangeEtaPhi->SetStats(kFALSE); \r
2654 \r
2655 // eta-phi distr. for <Qtot> in layer 0\r
2656 TVirtualPad* pad;\r
2657 TProfile2D* hProf2D;\r
2658 cf = fQtotCF;\r
2659 for(Int_t iLayer=0; iLayer<6; ++iLayer) {\r
2660 pad = ((TVirtualPad*)l->At((iLayer<3 ? iLayer*3 : (iLayer-3)*3+1))); pad->cd();\r
2661 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2662 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2663 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2664 rangeEtaPhi->Draw();\r
2665 \r
2666 cf->SetRangeUser(cf->GetVar("layer"), Double_t(iLayer), Double_t(iLayer));\r
2667 TH3D* hQtotEtaPhi = (TH3D*)cf->Project(0, cf->GetVar("phi"), cf->GetVar("eta"), cf->GetVar("Qtot0"));\r
2668 hProf2D = (hQtotEtaPhi ? hQtotEtaPhi->Project3DProfile() : 0x0);\r
2669 if(hQtotEtaPhi) delete hQtotEtaPhi;\r
2670 \r
2671 if(hProf2D) {\r
2672 hProf2D->SetName(Form("Qtot_layer%d",iLayer));\r
2673 hProf2D->SetStats(kFALSE);\r
2674 hProf2D->SetMinimum(0.);\r
2675 hProf2D->SetMaximum(4.);\r
2676 hProf2D->Draw("samecolz");\r
2677 }\r
2678 lat->DrawLatex(-0.9, 3.6, Form("TRD <Q_{tot}> Layer %d", iLayer));\r
2679 DrawTRDGrid();\r
2680 }\r
2681 cf->SetRangeUser(cf->GetVar("layer"), 0.0, 5.0);\r
2682 \r
2683 // PH versus slice number\r
2684 pad = ((TVirtualPad*)l->At(2)); pad->cd();\r
2685 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2686 pad->SetTopMargin(0.03); pad->SetBottomMargin(0.15);\r
2687 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2688 \r
2689 if(gROOT->FindObject("rangePHslice")) delete gROOT->FindObject("rangePHslice");\r
2690 TH2F* rangePHslice=new TH2F("rangePHslice", "", 8, -0.5, 7.5, 10, 0.0, 6.);\r
2691 rangePHslice->SetStats(kFALSE);\r
2692 SetStyle(rangePHslice->GetXaxis(), "slice", 0.07, 0.8, kTRUE, 0.05);\r
2693 SetStyle(rangePHslice->GetYaxis(), "PH", 0.07, 0.8, kTRUE, 0.05);\r
2694 rangePHslice->Draw();\r
2695 \r
2696 TF1* funcPol1 = new TF1("funcPol1", "[0]+[1]*x", 2.9, 6.4);\r
2697 \r
2698 cf = fPulseHeightCF;\r
2699 TH2D* hPH = (TH2D*)cf->Project(0, cf->GetVar("slice"), cf->GetVar("PH0"));\r
2700 TH1D* hSliceErr = new TH1D(Form("hSliceErr%f", gRandom->Rndm()), "", hPH->GetXaxis()->GetNbins(), hPH->GetXaxis()->GetXbins()->GetArray());\r
2701 TH1D* hLandauFit = Proj2D(hPH, hSliceErr);\r
2702 hPH->SetStats(kFALSE);\r
2703 hPH->Draw("samecolz");\r
2704 if(trendValues) {\r
2705 hSliceErr->Fit(funcPol1, "QME0", "goff", 2.9, 6.4);\r
2706 trendValues[12] = funcPol1->GetParameter(0); // PH plateau\r
2707 trendValues[13] = funcPol1->GetParError(0); // PH plateau\r
2708 trendValues[14] = funcPol1->GetParameter(1); // PH slope\r
2709 trendValues[15] = funcPol1->GetParError(1); // PH slope\r
2710 }\r
2711 hLandauFit->SetLineWidth(2);\r
2712 hLandauFit->SetLineStyle(2);\r
2713 hLandauFit->Draw("same");\r
2714 \r
2715 delete funcPol1; delete hSliceErr;\r
2716 \r
2717 // Qtot vs P\r
2718 pad = ((TVirtualPad*)l->At(5)); pad->cd();\r
2719 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2720 pad->SetTopMargin(0.03); pad->SetBottomMargin(0.15);\r
2721 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2722 pad->SetLogz();\r
2723 \r
2724 if(gROOT->FindObject("rangeQtotP")) delete gROOT->FindObject("rangeQtotP");\r
2725 TH2F* rangeQtotP = new TH2F("rangeQtotP", "", 10, 0.0, 11.99, 10, 0.0, 11.99);\r
2726 SetStyle(rangeQtotP->GetXaxis(), "P [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
2727 SetStyle(rangeQtotP->GetYaxis(), "Q_{tot}", 0.07, 0.8, kTRUE, 0.05);\r
2728 rangeQtotP->SetStats(kFALSE);\r
2729 rangeQtotP->Draw();\r
2730 \r
2731 cf = fCentralityCF;\r
2732 TH2D* hQtotP = (TH2D*)cf->Project(0, cf->GetVar("P"), cf->GetVar("Qtot0"));\r
2733 \r
2734 if(hQtotP)\r
2735 for(Int_t i=1; i<=hQtotP->GetXaxis()->GetNbins(); ++i) \r
2736 hQtotP->SetBinContent(i, 1, 0.0); \r
2737 TH1D* hQtotProj = (hQtotP ? Proj2D(hQtotP) : 0x0);\r
2738 if(hQtotProj) SetStyle(hQtotProj, 2, kBlue, 2, 1, kBlue, 1);\r
2739 if(trendValues && hQtotProj && hQtotProj->GetEntries()>2) {\r
2740 trendValues[16] = hQtotProj->GetBinContent(hQtotProj->FindBin(1.0)); // Landau MPV at 1GeV/c\r
2741 trendValues[17] = hQtotProj->GetBinError(hQtotProj->FindBin(1.0)); // Landau width at 1 GeV/c\r
2742 }\r
2743 if(hQtotP) {\r
2744 hQtotP->SetStats(kFALSE);\r
2745 hQtotP->Draw("samecolz");\r
2746 hQtotProj->Draw("same");\r
2747 }\r
2748 //if(cutTOFbc) cf->SetRangeUser(stepTOFBC, -1000.0, +1000.0); // reset the cut on TOFbc\r
2749}\r
2750\r
2751\r
2752//_________________________________________________________________\r
2753Bool_t AliTRDcheckESD::PlotCentSummary(Double_t* /*trendValues*/) {\r
2754\r
2755 Bool_t isGoodForSaving=kFALSE;\r
2756 \r
2757 TLatex* lat=new TLatex();\r
2758 lat->SetTextSize(0.06);\r
2759 lat->SetTextColor(2);\r
2760\r
2761 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);\r
2762 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
2763 gPad->Divide(3,3,0.,0.);\r
2764 TList* l=gPad->GetListOfPrimitives();\r
2765 \r
2766 TPad* pad=0x0; \r
2767\r
2768 if(gROOT->FindObject("rangeEffPt")) delete gROOT->FindObject("rangeEffPt");\r
2769 TH2F* rangeEffPt=new TH2F("rangeEffPt", "",10,0.,10.,10,0.,1.4);\r
2770 rangeEffPt->SetStats(kFALSE);\r
2771 SetStyle(rangeEffPt->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
2772 SetStyle(rangeEffPt->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05);\r
2773 \r
2774 TH3F *h3(NULL), *h3p(NULL), *h3n(NULL);\r
2775 Int_t padsForEffs[5] = {0,3,6,1,4};\r
2776 for(Int_t iCent=1; iCent<6; ++iCent) {\r
2777 // TPC-TRD matching efficiencies\r
2778 pad = ((TPad*)l->At(padsForEffs[iCent-1])); pad->cd();\r
2779 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2780 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2781 \r
2782 if(!(h3p = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+iCent)))) continue;\r
2783 if(!(h3n = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+iCent)))) continue;\r
2784 // =============================================\r
2785 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+iCent)))) continue;\r
2786 TH1F* hFeffP = EfficiencyTRD(h3p, h3, kTRUE);\r
2787 //\r
2788 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+iCent)))) continue;\r
2789 TH1F* hFeffN = EfficiencyTRD(h3n, h3, kTRUE);\r
2790 // =============================================\r
2791 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos4+iCent)))) continue;\r
2792 TH1F* hFeffP4 = EfficiencyTRD(h3p, h3, kTRUE);\r
2793 //\r
2794 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg4+iCent)))) continue;\r
2795 TH1F* hFeffN4 = EfficiencyTRD(h3n, h3, kTRUE);\r
2796 // =============================================\r
2797 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos5+iCent)))) continue;\r
2798 TH1F* hFeffP5 = EfficiencyTRD(h3p, h3, kTRUE);\r
2799 //\r
2800 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg5+iCent)))) continue;\r
2801 TH1F* hFeffN5 = EfficiencyTRD(h3n, h3, kTRUE);\r
2802 // =============================================\r
2803 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos6+iCent)))) continue;\r
2804 TH1F* hFeffP6 = EfficiencyTRD(h3p, h3, kTRUE);\r
2805 //\r
2806 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg6+iCent)))) continue;\r
2807 TH1F* hFeffN6 = EfficiencyTRD(h3n, h3, kTRUE);\r
2808 \r
2809 rangeEffPt->Draw();\r
2810 \r
2811 TLine line;\r
2812 line.SetLineStyle(2);\r
2813 line.SetLineWidth(2);\r
2814 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.7, rangeEffPt->GetXaxis()->GetXmax(), 0.7);\r
2815 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.9, rangeEffPt->GetXaxis()->GetXmax(), 0.9);\r
2816 line.SetLineStyle(1);\r
2817 line.SetLineWidth(1);\r
2818 line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 1.0, rangeEffPt->GetXaxis()->GetXmax(), 1.0);\r
2819 if(hFeffP) SetStyle(hFeffP, 1, kRed, 1, 24, kRed, 1);\r
2820 if(hFeffP4) SetStyle(hFeffP4, 1, kRed, 1, 25, kRed, 1);\r
2821 if(hFeffP5) SetStyle(hFeffP5, 1, kRed, 1, 26, kRed, 1);\r
2822 if(hFeffP6) SetStyle(hFeffP6, 1, kRed, 1, 27, kRed, 1);\r
2823 if(hFeffN) SetStyle(hFeffN, 1, kBlue, 1, 24, kBlue, 1);\r
2824 if(hFeffN4) SetStyle(hFeffN4, 1, kBlue, 1, 25, kBlue, 1);\r
2825 if(hFeffN5) SetStyle(hFeffN5, 1, kBlue, 1, 26, kBlue, 1);\r
2826 if(hFeffN6) SetStyle(hFeffN6, 1, kBlue, 1, 27, kBlue, 1);\r
2827 \r
2828 TLegend* leg=new TLegend(0.16, 0.7, 0.61, 0.89);\r
2829 leg->SetFillColor(0);\r
2830 leg->SetNColumns(2);\r
2831 leg->SetTextSize(0.039);\r
2832 leg->SetMargin(0.1);\r
2833 if(hFeffP && hFeffP->Integral()>0.001) {\r
2834 isGoodForSaving = kTRUE;\r
2835 hFeffP->Draw("same");\r
2836 leg->AddEntry(hFeffP, "pos. (#geq 1 trcklt)", "p");\r
2837 }\r
2838 if(hFeffN && hFeffN->Integral()>0.001) {\r
2839 isGoodForSaving = kTRUE;\r
2840 hFeffN->Draw("same");\r
2841 leg->AddEntry(hFeffN, "neg. (#geq 1 trcklt)", "p");\r
2842 }\r
2843 if(hFeffP4 && hFeffP4->Integral()>0.001) {\r
2844 isGoodForSaving = kTRUE;\r
2845 hFeffP4->Draw("same");\r
2846 leg->AddEntry(hFeffP4, "pos. (4 trcklts)", "p");\r
2847 }\r
2848 if(hFeffN4 && hFeffN4->Integral()>0.001) {\r
2849 isGoodForSaving = kTRUE;\r
2850 hFeffN4->Draw("same");\r
2851 leg->AddEntry(hFeffN4, "neg. (4 trcklts)", "p");\r
2852 }\r
2853 if(hFeffP5 && hFeffP5->Integral()>0.001) {\r
2854 isGoodForSaving = kTRUE;\r
2855 hFeffP5->Draw("same");\r
2856 leg->AddEntry(hFeffP5, "pos. (5 trcklts)", "p");\r
2857 }\r
2858 if(hFeffN5 && hFeffN5->Integral()>0.001) {\r
2859 isGoodForSaving = kTRUE;\r
2860 hFeffN5->Draw("same");\r
2861 leg->AddEntry(hFeffN5, "neg. (5 trcklts)", "p");\r
2862 }\r
2863 if(hFeffP6 && hFeffP6->Integral()>0.001) {\r
2864 isGoodForSaving = kTRUE;\r
2865 hFeffP6->Draw("same");\r
2866 leg->AddEntry(hFeffP6, "pos. (6 trcklts)", "p");\r
2867 }\r
2868 if(hFeffN6 && hFeffN6->Integral()>0.001) {\r
2869 isGoodForSaving = kTRUE;\r
2870 hFeffN6->Draw("same");\r
2871 leg->AddEntry(hFeffN6, "neg. (6 trklts)", "p");\r
2872 }\r
2873 \r
2874 if(isGoodForSaving) {\r
2875 if(iCent==1) leg->Draw();\r
2876 lat->DrawLatex(5.6, 1.3, Form("Centrality class %d", iCent));\r
2877 lat->DrawLatex(0.5, 1.42, "TPC-TRD matching efficiency");\r
2878 }\r
2879 } // end loop over multiplicity intervals\r
2880\r
2881 // Number of clusters per TRD track\r
2882 pad = ((TPad*)l->At(2)); pad->cd();\r
2883 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2884 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);\r
2885 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2886 if(gROOT->FindObject("rangeNcls")) delete gROOT->FindObject("rangeNcls");\r
2887 TH2F* rangeNcls = new TH2F("rangeNcls", "", 10, 0.0, 199.9, 10, 0.0, 1.199);\r
2888 SetStyle(rangeNcls->GetXaxis(), "# TRD clusters", 0.07, 0.8, kTRUE, 0.05);\r
2889 SetStyle(rangeNcls->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2890 rangeNcls->SetStats(kFALSE);\r
2891 rangeNcls->Draw();\r
2892 \r
2893 TH2F* h2F[6]; TH1D* proj[6];\r
2894 TLegend* leg=new TLegend(0.2, 0.7, 0.5, 0.95);\r
2895 leg->SetFillColor(0);\r
2896 Bool_t isGood=kFALSE;\r
2897 for(Int_t iCent=0; iCent<6; ++iCent) {\r
2898 h2F[iCent] = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD+iCent));\r
2899 proj[iCent] = (h2F[iCent] && h2F[iCent]->GetEntries()>10 ? h2F[iCent]->ProjectionY(Form("projCent%d",iCent)) : 0x0);\r
2900 if(proj[iCent]) {\r
2901 proj[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);\r
2902 Double_t maximum = proj[iCent]->GetMaximum();\r
2903 if(maximum>1.0)\r
2904 proj[iCent]->Scale(1.0/maximum);\r
2905 proj[iCent]->SetStats(kFALSE);\r
2906 proj[iCent]->Draw("same");\r
2907 leg->AddEntry(proj[iCent], (iCent==0 ? "all centralities" : Form("centrality class %d", iCent)), "l");\r
2908 isGood = kTRUE;\r
2909 }\r
2910 }\r
2911 if(isGood) leg->Draw();\r
2912 isGoodForSaving = isGoodForSaving || isGood;\r
2913 \r
2914 // Qtot vs P\r
2915 pad = ((TPad*)l->At(5)); pad->cd();\r
2916 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
2917 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);\r
2918 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2919 if(gROOT->FindObject("rangeQtot")) delete gROOT->FindObject("rangeQtot");\r
2920 TH2F* rangeQtot = new TH2F("rangeQtot", "", 10, 0.0, 9.999, 10, 0.0, 1.199);\r
2921 SetStyle(rangeQtot->GetXaxis(), "Q_{tot} (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2922 SetStyle(rangeQtot->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05);\r
2923 rangeQtot->SetStats(kFALSE);\r
2924 rangeQtot->Draw();\r
2925 \r
2926 TH1D* projQ[6];\r
2927 TLegend* leg2=new TLegend(0.6, 0.7, 0.9, 0.95);\r
2928 leg2->SetFillColor(0);\r
2929 isGood = kFALSE;\r
2930 for(Int_t iCent=0; iCent<6; ++iCent) { \r
2931 h2F[iCent] = dynamic_cast<TH2F*>(fHistos->At(kQtotP+iCent));\r
2932 projQ[iCent] = (h2F[iCent] && h2F[iCent]->GetEntries()>10 ? h2F[iCent]->ProjectionY(Form("projQCent%d",iCent)) : 0x0);\r
2933 if(projQ[iCent]) {\r
2934 projQ[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);\r
2935 Double_t maximum = projQ[iCent]->GetMaximum();\r
2936 if(maximum>1.0)\r
2937 projQ[iCent]->Scale(1.0/maximum);\r
2938 projQ[iCent]->SetStats(kFALSE);\r
2939 projQ[iCent]->Draw("same");\r
2940 leg2->AddEntry(projQ[iCent], (iCent==0 ? "all centralities" : Form("centrality class %d", iCent)), "l");\r
2941 isGood = kTRUE;\r
2942 }\r
2943 }\r
2944 if(isGood) leg2->Draw();\r
2945 isGoodForSaving = isGoodForSaving || isGood;\r
2946 return isGoodForSaving;\r
2947}\r
2948\r
2949\r
2950//_________________________________________________________________\r
2951Bool_t AliTRDcheckESD::PlotTrackingSummary(Int_t centralityClass, Double_t* trendValues) {\r
2952\r
2953 Bool_t isGoodForSaving=kFALSE;\r
2954 \r
2955 TLatex *lat=new TLatex();\r
2956 lat->SetTextSize(0.07);\r
2957 lat->SetTextColor(2);\r
2958 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);\r
2959 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
2960 gPad->Divide(3,3,0.,0.);\r
2961 TList* l=gPad->GetListOfPrimitives();\r
2962 // eta-phi distr. for positive TPC tracks\r
2963 TVirtualPad* pad = ((TVirtualPad*)l->At(0)); pad->cd();\r
2964 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2965 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2966 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2967 if(gROOT->FindObject("rangeEtaPhi")) delete gROOT->FindObject("rangeEtaPhi");\r
2968 TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi", "", 10, -0.99, +0.99, 10, -3.4, +3.4);\r
2969 SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05);\r
2970 SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05);\r
2971 rangeEtaPhi->SetStats(kFALSE);\r
2972 rangeEtaPhi->Draw();\r
2973 lat->DrawLatex(-0.9, 3.6, "TPC positive ref. tracks");\r
2974 \r
2975 TH3F* h3F = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass));\r
2976 TH2F* h2FtpcP = 0x0;\r
2977 Float_t nada=0.0;\r
2978 if(h3F && h3F->GetEntries()>10) {\r
2979 h2FtpcP = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();\r
2980 h2FtpcP->SetStats(kFALSE);\r
2981 h2FtpcP->Draw("samecolz"); isGoodForSaving = kTRUE;\r
2982 isGoodForSaving = kTRUE;\r
2983 }\r
2984 //-----------------\r
2985 // eta-phi distr. for negative TPC tracks\r
2986 pad = ((TVirtualPad*)l->At(1)); pad->cd();\r
2987 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
2988 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
2989 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
2990 rangeEtaPhi->Draw();\r
2991 lat->DrawLatex(-0.9, 3.6, "TPC negative ref. tracks");\r
2992 \r
2993 h3F = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass));\r
2994 TH2F* h2FtpcN = 0x0;\r
2995 if(h3F && h3F->GetEntries()>10) {\r
2996 h2FtpcN = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();\r
2997 h2FtpcN->SetStats(kFALSE);\r
2998 h2FtpcN->Draw("samecolz"); \r
2999 isGoodForSaving = kTRUE;\r
3000 }\r
3001 //----------------------------------------------\r
3002 // eta-phi distr. for positive TRD tracks\r
3003 pad = ((TVirtualPad*)l->At(3)); pad->cd();\r
3004 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3005 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3006 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3007 rangeEtaPhi->Draw();\r
3008 lat->DrawLatex(-0.9, 3.6, "TRD positive ref. tracks");\r
3009 \r
3010 h3F = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+centralityClass));\r
3011 TH2F* h2FtrdP = 0x0;\r
3012 if(h3F && h3F->GetEntries()>10) {\r
3013 h2FtrdP = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();\r
3014 h2FtrdP->SetStats(kFALSE);\r
3015 h2FtrdP->SetMaximum((h2FtpcP ? h2FtpcP->GetMaximum() : h2FtrdP->GetMaximum()));\r
3016 h2FtrdP->Draw("samecolz"); \r
3017 isGoodForSaving=kTRUE;\r
3018 }\r
3019 //--------------------------------------------\r
3020 // eta-phi distr. for negative TRD tracks\r
3021 pad = ((TVirtualPad*)l->At(4)); pad->cd();\r
3022 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3023 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3024 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3025 rangeEtaPhi->Draw();\r
3026 lat->DrawLatex(-0.9, 3.6, "TRD negative ref. tracks");\r
3027 \r
3028 h3F = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+centralityClass));\r
3029 TH2F* h2FtrdN = 0x0;\r
3030 if(h3F && h3F->GetEntries()>10) {\r
3031 h2FtrdN = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();\r
3032 h2FtrdN->SetStats(kFALSE);\r
3033 h2FtrdN->SetMaximum(h2FtpcN ? h2FtpcN->GetMaximum() : h2FtrdN->GetMaximum());\r
3034 h2FtrdN->Draw("samecolz"); \r
3035 isGoodForSaving=kTRUE;\r
3036 }\r
3037 //----------------------------------------------\r
3038 // eta-phi efficiency for positive TRD tracks\r
3039 pad = ((TVirtualPad*)l->At(6)); pad->cd();\r
3040 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3041 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3042 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3043 rangeEtaPhi->Draw();\r
3044 lat->DrawLatex(-0.9, 3.6, "Efficiency positive tracks");\r
3045 \r
3046 TH2F* h2Feff = (h2FtrdP ? (TH2F*)h2FtrdP->Clone("h2FeffPos") : 0x0);\r
3047 if(h2Feff) {\r
3048 h2Feff->Reset();\r
3049 h2Feff->SetStats(kFALSE);\r
3050 h2Feff->Divide(h2FtrdP, h2FtpcP);\r
3051 h2Feff->SetMaximum(1.0);\r
3052 if(h2Feff->GetEntries()>1) { h2Feff->Draw("samecolz"); isGoodForSaving=kTRUE; }\r
3053 }\r
3054 //-------------------------------------------------\r
3055 // eta-phi efficiency for negative TRD tracks\r
3056 pad = ((TVirtualPad*)l->At(7)); pad->cd();\r
3057 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3058 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3059 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3060 rangeEtaPhi->Draw();\r
3061 lat->DrawLatex(-0.9, 3.6, "Efficiency negative tracks");\r
3062 \r
3063 h2Feff = (h2FtrdN ? (TH2F*)h2FtrdN->Clone("h2FeffNeg") : 0x0);\r
3064 if(h2Feff) {\r
3065 h2Feff->Reset();\r
3066 h2Feff->SetStats(kFALSE);\r
3067 h2Feff->Divide(h2FtrdN, h2FtpcN);\r
3068 h2Feff->SetMaximum(1.0);\r
3069 if(h2Feff->GetEntries()>0.1) { h2Feff->Draw("samecolz"); isGoodForSaving=kTRUE; }\r
3070 }\r
3071 //-----------------------------------------------------\r
3072 // <ntracklets> vs (phi,eta)\r
3073 pad = ((TVirtualPad*)l->At(2)); pad->cd();\r
3074 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3075 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3076 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3077 rangeEtaPhi->Draw();\r
3078 lat->DrawLatex(-0.9, 3.6, "TRD <N_{tracklets}>");\r
3079 \r
3080 TProfile2D* hProf2D;\r
3081 if((hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvNtrkl+centralityClass)))) {\r
3082 if(hProf2D->GetEntries()>10) {\r
3083 hProf2D->SetStats(kFALSE);\r
3084 hProf2D->SetMinimum(0.);\r
3085 hProf2D->SetMaximum(6.);\r
3086 if(hProf2D->GetEntries()>1) { hProf2D->Draw("samecolz"); isGoodForSaving = kTRUE; }\r
3087 }\r
3088 }\r
3089 //---------------------------------------------------------\r
3090 // TPC-TRD matching efficiency vs pt\r
3091 pad = ((TVirtualPad*)l->At(5)); pad->cd();\r
3092 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);\r
3093 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3094 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3095 TH1F* hFeffP = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),\r
3096 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+centralityClass)), kTRUE);\r
3097 TH1F* hFeffN = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),\r
3098 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+centralityClass)), kTRUE);\r
3099 TH1F* hFeffP4 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),\r
3100 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos4+centralityClass)), kTRUE);\r
3101 TH1F* hFeffN4 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),\r
3102 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg4+centralityClass)), kTRUE);\r
3103 TH1F* hFeffP5 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),\r
3104 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos5+centralityClass)), kTRUE);\r
3105 TH1F* hFeffN5 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),\r
3106 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg5+centralityClass)), kTRUE);\r
3107 TH1F* hFeffP6 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),\r
3108 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos6+centralityClass)), kTRUE);\r
3109 TH1F* hFeffN6 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),\r
3110 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg6+centralityClass)), kTRUE);\r
3111 \r
3112 TF1* funcConst = new TF1("funcConst", "[0]", 1.0, 3.0);\r
3113 \r
3114 if(gROOT->FindObject("rangeEffPt2")) delete gROOT->FindObject("rangeEffPt2");\r
3115 TH2F* rangeEffPt2=new TH2F("rangeEffPt2", "",10,0.,10.,10,0.,1.4);\r
3116 rangeEffPt2->SetStats(kFALSE);\r
3117 SetStyle(rangeEffPt2->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
3118 SetStyle(rangeEffPt2->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05);\r
3119 rangeEffPt2->Draw();\r
3120 lat->DrawLatex(0.5, 1.42, "TRD-TPC matching efficiency");\r
3121 //++++++++++++++++++\r
3122 TLine line;\r
3123 line.SetLineStyle(2);\r
3124 line.SetLineWidth(2);\r
3125 line.DrawLine(rangeEffPt2->GetXaxis()->GetXmin(), 0.7, rangeEffPt2->GetXaxis()->GetXmax(), 0.7);\r
3126 line.DrawLine(rangeEffPt2->GetXaxis()->GetXmin(), 0.9, rangeEffPt2->GetXaxis()->GetXmax(), 0.9);\r
3127 line.SetLineStyle(1);\r
3128 line.SetLineWidth(1);\r
3129 line.DrawLine(rangeEffPt2->GetXaxis()->GetXmin(), 1.0, rangeEffPt2->GetXaxis()->GetXmax(), 1.0);\r
3130 TLegend* leg=new TLegend(0.2, 0.7, 0.6, 0.89);\r
3131 leg->SetNColumns(2);\r
3132 leg->SetFillColor(0);\r
3133 if(hFeffP){\r
3134 hFeffP->SetMarkerStyle(24);\r
3135 hFeffP->SetMarkerColor(2);\r
3136 hFeffP->SetLineColor(2);\r
3137 if(trendValues && hFeffP->GetEntries()>1) {\r
3138 hFeffP->Fit(funcConst, "QME0", "goff", 1.0, 3.0);\r
3139 trendValues[0] = funcConst->GetParameter(0);\r
3140 trendValues[1] = funcConst->GetParError(0);\r
3141 }\r
3142 if(hFeffP->Integral()>0.001) {\r
3143 hFeffP->Draw("same"); \r
3144 leg->AddEntry(hFeffP, "positives (#geq 1 tracklet)", "p");\r
3145 }\r
3146 }\r
3147 if(hFeffN){\r
3148 hFeffN->SetMarkerStyle(24);\r
3149 hFeffN->SetMarkerColor(4);\r
3150 hFeffN->SetLineColor(4);\r
3151 if(trendValues && hFeffN->GetEntries()>1) {\r
3152 hFeffN->Fit(funcConst, "QME0", "goff", 1.0, 3.0);\r
3153 trendValues[2] = funcConst->GetParameter(0);\r
3154 trendValues[3] = funcConst->GetParError(0);\r
3155 }\r
3156 if(hFeffN->Integral()>0.001) {\r
3157 hFeffN->Draw("same"); \r
3158 leg->AddEntry(hFeffN, "negatives (#geq 1 tracklet)", "p");\r
3159 }\r
3160 }\r
3161 if(hFeffP4){\r
3162 hFeffP4->SetMarkerStyle(25);\r
3163 hFeffP4->SetMarkerColor(2);\r
3164 hFeffP4->SetLineColor(2);\r
3165 if(hFeffP4->Integral()>0.001) {\r
3166 hFeffP4->Draw("same"); \r
3167 leg->AddEntry(hFeffP4, "positives (4 tracklets)", "p");\r
3168 }\r
3169 }\r
3170 if(hFeffN4){\r
3171 hFeffN4->SetMarkerStyle(25);\r
3172 hFeffN4->SetMarkerColor(4);\r
3173 hFeffN4->SetLineColor(4);\r
3174 if(hFeffN4->Integral()>0.001) {\r
3175 hFeffN4->Draw("same"); \r
3176 leg->AddEntry(hFeffN4, "negatives (4 tracklets)", "p");\r
3177 }\r
3178 }\r
3179 if(hFeffP5){\r
3180 hFeffP5->SetMarkerStyle(26);\r
3181 hFeffP5->SetMarkerColor(2);\r
3182 hFeffP5->SetLineColor(2);\r
3183 if(hFeffP5->Integral()>0.001) {\r
3184 hFeffP5->Draw("same"); \r
3185 leg->AddEntry(hFeffP5, "positives (5 tracklets)", "p");\r
3186 }\r
3187 }\r
3188 if(hFeffN5){\r
3189 hFeffN5->SetMarkerStyle(26);\r
3190 hFeffN5->SetMarkerColor(4);\r
3191 hFeffN5->SetLineColor(4);\r
3192 if(hFeffN5->Integral()>0.001) {\r
3193 hFeffN5->Draw("same"); \r
3194 leg->AddEntry(hFeffN5, "negatives (5 tracklets)", "p");\r
3195 }\r
3196 }\r
3197 if(hFeffP6){\r
3198 hFeffP6->SetMarkerStyle(27);\r
3199 hFeffP6->SetMarkerColor(2);\r
3200 hFeffP6->SetLineColor(2);\r
3201 if(hFeffP6->Integral()>0.001) {\r
3202 hFeffP6->Draw("same"); \r
3203 leg->AddEntry(hFeffP6, "positives (6 tracklets)", "p");\r
3204 }\r
3205 }\r
3206 if(hFeffN6){\r
3207 hFeffN6->SetMarkerStyle(27);\r
3208 hFeffN6->SetMarkerColor(4);\r
3209 hFeffN6->SetLineColor(4);\r
3210 if(hFeffN6->Integral()>0.001) {\r
3211 hFeffN6->Draw("same"); \r
3212 leg->AddEntry(hFeffN6, "negatives (6 tracklets)", "p");\r
3213 }\r
3214 }\r
3215 leg->Draw();\r
3216 \r
3217 //--------------------------------------------------------------\r
3218 // Nclusters per TRD track\r
3219 pad = ((TVirtualPad*)l->At(8)); pad->cd();\r
3220 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.12);\r
3221 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3222 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3223 pad->SetLogz();\r
3224 if(gROOT->FindObject("rangeNclsP")) delete gROOT->FindObject("rangeNclsP");\r
3225 TH2F* rangeNclsP = new TH2F("rangeNclsP", "", 10, 0.0, 11.99, 10, 0.0, 199.0);\r
3226 SetStyle(rangeNclsP->GetXaxis(), "p [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
3227 SetStyle(rangeNclsP->GetYaxis(), "#clusters", 0.07, 0.8, kTRUE, 0.05);\r
3228 rangeNclsP->SetStats(kFALSE);\r
3229 rangeNclsP->Draw();\r
3230 lat->DrawLatex(1.0, 205., "TRD Clusters / track");\r
3231 \r
3232 TH2F* hNclsVsP=0x0;\r
3233 if((hNclsVsP = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD+centralityClass)))) {\r
3234 hNclsVsP->SetStats(kFALSE);\r
3235 if(hNclsVsP->GetEntries()>10) {\r
3236 hNclsVsP->Draw("samecolz"); isGoodForSaving=kTRUE;\r
3237 if(trendValues) {\r
3238 TProfile* h2FProf = hNclsVsP->ProfileX("nclsVsPprof");\r
3239 h2FProf->Fit(funcConst, "QME0", "goff", 1.0, 3.0);\r
3240 trendValues[4] = funcConst->GetParameter(0);\r
3241 trendValues[5] = funcConst->GetParError(0);\r
3242 }\r
3243 }\r
3244 }\r
3245 \r
3246 delete funcConst;\r
3247 return isGoodForSaving;\r
3248}\r
3249\r
3250\r
3251//_________________________________________________________________\r
3252Bool_t AliTRDcheckESD::PlotPidSummary(Int_t centralityClass, Double_t* trendValues) {\r
3253\r
3254 Bool_t isGoodForSaving=kFALSE;\r
3255 \r
3256 TLatex *lat=new TLatex();\r
3257 lat->SetTextSize(0.07);\r
3258 lat->SetTextColor(2);\r
3259 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);\r
3260 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);\r
3261 gPad->Divide(3,3,0.,0.);\r
3262 TList* l=gPad->GetListOfPrimitives();\r
3263 // eta-phi distr. for <Qtot> in layer 0\r
3264 TVirtualPad* pad;\r
3265 TProfile2D* hProf2D;\r
3266 if(gROOT->FindObject("rangeEtaPhi2")) delete gROOT->FindObject("rangeEtaPhi2");\r
3267 TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi2", "", 10, -0.99, +0.99, 10, -3.4, +3.4);\r
3268 SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05);\r
3269 SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05);\r
3270 rangeEtaPhi->SetStats(kFALSE);\r
3271 \r
3272 for(Int_t iLayer=0; iLayer<6; ++iLayer) {\r
3273 pad = ((TVirtualPad*)l->At((iLayer<3 ? iLayer*3 : (iLayer-3)*3+1))); pad->cd();\r
3274 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3275 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3276 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3277 rangeEtaPhi->Draw();\r
3278 lat->DrawLatex(-0.9, 3.6, Form("TRD <Q_{tot}> Layer %d", iLayer));\r
3279 \r
3280 if(!(hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvQtot+6*centralityClass+iLayer)))) continue;\r
3281 if(hProf2D && hProf2D->GetEntries()>10) {\r
3282 hProf2D->SetStats(kFALSE);\r
3283 hProf2D->SetMinimum(0.);\r
3284 hProf2D->SetMaximum(4.);\r
3285 if(hProf2D->GetEntries()>10) { hProf2D->Draw("samecolz"); isGoodForSaving=kTRUE; }\r
3286 }\r
3287 }\r
3288 \r
3289 // PH versus slice number\r
3290 pad = ((TVirtualPad*)l->At(2)); pad->cd();\r
3291 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3292 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3293 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3294 if(gROOT->FindObject("rangePHslice")) delete gROOT->FindObject("rangePHslice");\r
3295 TH2F* rangePHslice = new TH2F("rangePHslice", "", 10, -0.5, 7.5, 10, 0.0, 2000.0);\r
3296 SetStyle(rangePHslice->GetXaxis(), "slice", 0.07, 0.8, kTRUE, 0.05);\r
3297 SetStyle(rangePHslice->GetYaxis(), "PH", 0.07, 0.8, kTRUE, 0.05);\r
3298 rangePHslice->SetStats(kFALSE);\r
3299 rangePHslice->Draw();\r
3300 \r
3301 TF1* funcPol1 = new TF1("funcPol1", "[0]+[1]*x", 2.9, 6.4);\r
3302 \r
3303 TH2F* h2F;\r
3304 TH1D* hF;\r
3305 if((h2F = dynamic_cast<TH2F*>(fHistos->At(kPHSlice+centralityClass)))) {\r
3306 if(h2F && h2F->GetEntries()>10) {\r
3307 hF = Proj2D(h2F);\r
3308 h2F->SetStats(kFALSE);\r
3309 h2F->Draw("samecolz");\r
3310 isGoodForSaving=kTRUE;\r
3311 if(trendValues) {\r
3312 hF->Fit(funcPol1, "QME0", "goff", 2.9, 6.4);\r
3313 trendValues[6] = funcPol1->GetParameter(0);\r
3314 trendValues[7] = funcPol1->GetParError(0);\r
3315 trendValues[8] = funcPol1->GetParameter(1);\r
3316 trendValues[9] = funcPol1->GetParError(1);\r
3317 }\r
3318 hF->SetLineWidth(2);\r
3319 hF->Draw("same");\r
3320 }\r
3321 }\r
3322 delete funcPol1;\r
3323\r
3324 // Qtot vs P\r
3325 pad = ((TVirtualPad*)l->At(5)); pad->cd();\r
3326 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);\r
3327 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);\r
3328 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);\r
3329 pad->SetLogz();\r
3330 if(gROOT->FindObject("rangeQtotP")) delete gROOT->FindObject("rangeQtotP");\r
3331 TH2F* rangeQtotP = new TH2F("rangeQtotP", "", 10, 0.0, 11.99, 10, 0.0, 11.99);\r
3332 SetStyle(rangeQtotP->GetXaxis(), "P [GeV/c]", 0.07, 0.8, kTRUE, 0.05);\r
3333 SetStyle(rangeQtotP->GetYaxis(), "Q_{tot}", 0.07, 0.8, kTRUE, 0.05);\r
3334 rangeQtotP->SetStats(kFALSE);\r
3335 rangeQtotP->Draw();\r
3336 \r
3337 if((h2F = dynamic_cast<TH2F*>(fHistos->At(kQtotP+centralityClass)))) {\r
3338 if(h2F && h2F->GetEntries()>10) {\r
3339 h2F->SetStats(kFALSE);\r
3340 h2F->Draw("samecolz");\r
3341 isGoodForSaving=kTRUE;\r
3342 hF = Proj2D(h2F);\r
3343 hF->SetLineWidth(2);\r
3344 hF->Draw("same");\r
3345 if(trendValues) {\r
3346 trendValues[10] = hF->GetBinContent(hF->FindBin(1.0));\r
3347 trendValues[11] = hF->GetBinError(hF->FindBin(1.0));\r
3348 }\r
3349 }\r
3350 }\r
3351 return isGoodForSaving;\r
3352}\r
3353\r
3354//__________________________________________________________________________________________________\r
3355void AliTRDcheckESD::DrawTRDGrid() {\r
3356 //\r
3357 // Draw a grid of lines showing the TRD supermodule and stack structure in (eta,phi) coordinates.\r
3358 // The canvas on which to draw must already exist.\r
3359 //\r
3360 TLine line;\r
3361 line.SetLineColor(2);\r
3362 line.SetLineWidth(1);\r
3363 line.SetLineStyle(2);\r
3364 for(Int_t i=0; i<=9; ++i) {\r
3365 line.DrawLine(-1.0, 2.0*TMath::Pi()/18.0*i, +1.0, 2.0*TMath::Pi()/18.0*i);\r
3366 line.DrawLine(-1.0, -2.0*TMath::Pi()/18.0*i, +1.0, -2.0*TMath::Pi()/18.0*i);\r
3367 }\r