]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TRD/AliTRDcheckESD.cxx
- bug fixes (increase classdef)
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDcheckESD.cxx
CommitLineData
fb65de21 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/////////////////////////////////////////////////////
17//
18// Check basic detector results at ESD level
19// - Geometrical efficiency
20// - Tracking efficiency
21// - PID efficiency
22// - Refit efficiency
23//
24// Author
25// Alex Bercuci <A.Bercuci@gsi.de>
26//
27//////////////////////////////////////////////////////
28
29#include <TClonesArray.h>
30#include <TCanvas.h>
31#include <TObjArray.h>
32#include <TPad.h>
33#include <TLegend.h>
34#include <TLatex.h>
35#include <TLine.h>
36#include <TF1.h>
37#include <TH2I.h>
38#include <TH2F.h>
39#include <TH3S.h>
40#include <TH3F.h>
41#include <TProfile2D.h>
42#include <TProfile.h>
43#include <TGraphErrors.h>
44#include <TGraphAsymmErrors.h>
45#include <TFile.h>
46#include <TTree.h>
47#include <TROOT.h>
48#include <TChain.h>
49#include <TParticle.h>
50#include <TTimeStamp.h>
51
52#include "AliLog.h"
53#include "AliAnalysisManager.h"
54#include "AliESDEvent.h"
55#include "AliESDkink.h"
56#include "AliMCEvent.h"
57#include "AliESDInputHandler.h"
58#include "AliMCEventHandler.h"
59#include "AliESDpid.h"
60
61#include "AliESDtrack.h"
62#include "AliMCParticle.h"
63#include "AliPID.h"
64#include "AliStack.h"
65#include "AliTrackReference.h"
2bf6d80c 66//#include "AliESDCentrality.h"
67#include "AliMultiplicity.h"
fb65de21 68
69#include "AliTRDcheckESD.h"
2bf6d80c 70#include <iostream>
71using namespace std;
fb65de21 72
73ClassImp(AliTRDcheckESD)
74
75const Float_t AliTRDcheckESD::fgkxTPC = 290.;
76const Float_t AliTRDcheckESD::fgkxTOF = 365.;
77const UChar_t AliTRDcheckESD::fgkNgraph[AliTRDcheckESD::kNrefs] ={
788, 4, 2, 20};
79FILE* AliTRDcheckESD::fgFile = NULL;
80
81const Float_t AliTRDcheckESD::fgkEvVertexZ = 15.;
82const Int_t AliTRDcheckESD::fgkEvVertexN = 1;
83const Float_t AliTRDcheckESD::fgkTrkDCAxy = 40.;
84const Float_t AliTRDcheckESD::fgkTrkDCAz = 15.;
85const Int_t AliTRDcheckESD::fgkNclTPC = 100;
86const Float_t AliTRDcheckESD::fgkPt = 0.2;
87const Float_t AliTRDcheckESD::fgkEta = 0.9;
88const Float_t AliTRDcheckESD::fgkQs = 0.002;
89
90//____________________________________________________________________
91AliTRDcheckESD::AliTRDcheckESD():
92 AliAnalysisTaskSE()
93 ,fStatus(0)
94 ,fNRefFigures(0)
95 ,fESD(NULL)
96 ,fMC(NULL)
97 ,fESDpid(new AliESDpid)
98 ,fHistos(NULL)
99 ,fResults(NULL)
100{
101 //
102 // Default constructor
103 //
104 SetNameTitle("TRDcheckESD", "Check TRD @ ESD level");
105 SetMC(kTRUE);
106}
107
108//____________________________________________________________________
109AliTRDcheckESD::AliTRDcheckESD(char* name):
110 AliAnalysisTaskSE(name)
111 ,fStatus(0)
112 ,fNRefFigures(0)
113 ,fESD(NULL)
114 ,fMC(NULL)
115 ,fESDpid(new AliESDpid)
116 ,fHistos(NULL)
117 ,fResults(NULL)
118{
119 //
120 // Default constructor
121 //
122 SetMC(kTRUE);
123 SetTitle("Check TRD @ ESD level");
124 DefineOutput(1, TObjArray::Class());
125}
126
127//____________________________________________________________________
128AliTRDcheckESD::~AliTRDcheckESD()
129{
130// Destructor
131 if(fHistos){
2bf6d80c 132 //fHistos->Delete();
fb65de21 133 delete fHistos;
134 }
135 if(fResults){
136 fResults->Delete();
137 delete fResults;
138 }
139}
140
141//____________________________________________________________________
142void AliTRDcheckESD::UserCreateOutputObjects()
143{
144 //
145 // Create Output Containers (TObjectArray containing 1D histograms)
146 //
147 Histos();
148 PostData(1, fHistos);
149}
150
151//____________________________________________________________________
152void AliTRDcheckESD::MakeSummary(){
153 //
154 // Draw summary plots for the ESDcheck task
155 //
2bf6d80c 156
157
158 TCanvas *cOut=0x0;
159 cOut = new TCanvas("trackingSummary", "Tracking summary for the ESD task", 1600, 1200);
fb65de21 160 cOut->cd();
2bf6d80c 161 GetRefFigure(5);
fb65de21 162 cOut->SaveAs("trackingSummary.gif");
2bf6d80c 163
fb65de21 164 cOut = new TCanvas("pidSummary", "PID summary for the ESD task", 1600, 1200);
165 cOut->cd();
2bf6d80c 166 GetRefFigure(6);
fb65de21 167 cOut->SaveAs("pidSummary.gif");
2bf6d80c 168
169 cOut = new TCanvas("centSummary", "Centrality summary for the ESD task", 1600, 1200);
170 cOut->cd();
171 GetRefFigure(7);
172 cOut->SaveAs("centSummary.gif");
173
fb65de21 174}
175
176//____________________________________________________________________
177Bool_t AliTRDcheckESD::GetRefFigure(Int_t ifig)
178{
179 //
180 // Produce reference Plots during PostProcessing
181 //
182 if(ifig>=fNRefFigures){
183 AliWarning(Form("Ref plot %d not available. Valid only up to %d", ifig, fNRefFigures));
184 return kFALSE;
185 }
186 if(!gPad){
187 AliWarning("Please provide a canvas to draw results.");
188 return kFALSE;
189 } else {
190 gPad->SetLogx(0);gPad->SetLogy(0);
191 gPad->SetMargin(0.125, 0.015, 0.1, 0.015);
192 }
193
194 const Char_t *title[20];
2bf6d80c 195 // Float_t nada(0.0);
fb65de21 196 TH1 *hF(NULL);
2bf6d80c 197 // TH1 *hFeffP(NULL); TH1 *hFeffN(NULL);
198 // TH2 *h2F(NULL); TH2 *h2Feff(NULL);
199 // TH2 *h2FtpcP(NULL); TH2 *h2FtpcN(NULL);
200 // TH2 *h2FtrdP(NULL); TH2 *h2FtrdN(NULL);
201 // TH3 *h3F(NULL);
fb65de21 202 if((hF=(TH1S*)gROOT->FindObject("hFcheckESD"))) delete hF;
203 TLegend *leg(NULL);
204 TList *l(NULL); TVirtualPad *pad(NULL);
205 TGraphErrors *g(NULL);TGraphAsymmErrors *ga(NULL);
206 TObjArray *arr(NULL);
2bf6d80c 207 // TProfile2D *hProf2D(NULL);
208 // TProfile *hProf(NULL);
fb65de21 209 TLatex *lat=new TLatex();
210 lat->SetTextSize(0.07);
211 lat->SetTextColor(2);
212 TLine line;
213 TTimeStamp now;
2bf6d80c 214 // TF1* fitFunc(NULL);
fb65de21 215 switch(ifig){
216 case kNCl: // number of clusters/track
217 if(!(arr = (TObjArray*)fResults->At(kNCl))) return kFALSE;
218
219 leg = new TLegend(.83, .7, .99, .96);
220 leg->SetHeader("Species");
221 leg->SetBorderSize(0); leg->SetFillStyle(0);
2bf6d80c 222 for(Int_t ig(0); ig<fgkNgraph[kNCl-1]; ig++){
fb65de21 223 if(!(g = (TGraphErrors*)arr->At(ig))) return kFALSE;
224 if(!g->GetN()) continue;
225 g->Draw(ig?"pc":"apc"); leg->AddEntry(g, g->GetTitle(), "pl");
226 if(ig) continue;
227 hF=g->GetHistogram();
228 hF->SetXTitle("no of clusters");
229 hF->SetYTitle("entries");
230 hF->GetYaxis()->CenterTitle(1);
231 hF->GetYaxis()->SetTitleOffset(1.2);
232 hF->SetMinimum(5);
233 }
234 leg->Draw(); gPad->SetLogy();
235 break;
236 case kTRDstat: // Efficiency
237 if(!(arr = (TObjArray*)fResults->At(kTRDstat))) return kFALSE;
238 leg = new TLegend(.62, .77, .98, .98);
239 leg->SetHeader("TRD Efficiency");
240 leg->SetBorderSize(0); leg->SetFillStyle(0);
241 title[0] = "Geometrical (TRDin/TPCout)";
242 title[1] = "Tracking (TRDout/TRDin)";
243 title[2] = "PID (TRDpid/TRDin)";
244 title[3] = "Refit (TRDrefit/TRDin)";
245 hF = new TH1S("hFcheckESD", ";p [GeV/c];Efficiency", 10, 0.1, 10.);
246 hF->SetMaximum(1.4);
247 hF->GetXaxis()->SetMoreLogLabels();
248 hF->GetYaxis()->CenterTitle(1);
249 hF->Draw("p");
2bf6d80c 250 for(Int_t ig(0); ig<fgkNgraph[kTRDstat-1]; ig++){
fb65de21 251 if(!(g = (TGraphErrors*)arr->At(ig))) return kFALSE;
252 g->Draw("pl"); leg->AddEntry(g, title[ig], "pl");
253 //PutTrendValue(name[id], g->GetMean(2));
254 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));
255 }
256 leg->Draw(); gPad->SetLogx();
257 break;
258 case kTRDmom: // Energy loss
259 if(!(arr = (TObjArray*)fResults->At(kTRDmom))) return kFALSE;
260 leg = new TLegend(.65, .7, .95, .99);
261 leg->SetHeader("Energy Loss");
262 leg->SetBorderSize(1); leg->SetFillColor(0);
263 title[0] = "Max & 90% quantile";
264 title[1] = "Mean & 60% quantile";
265 hF = new TH1S("hFcheckESD", ";layer;#Delta E", 6, -0.5, 5.5);
266 hF->SetMaximum(1.3);hF->SetMinimum(-.3);
267 hF->Draw("p");
2bf6d80c 268 for(Int_t ig(0); ig<fgkNgraph[kTRDmom-1]; ig++){
fb65de21 269 if(!(ga = (TGraphAsymmErrors*)arr->At(ig))) return kFALSE;
270 ga->Draw("pl"); leg->AddEntry(ga, title[ig], "pl");
271 //PutTrendValue(name[id], g->GetMean(2));
272 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));
273 }
274 leg->Draw();gPad->SetLogx(kFALSE);
275 break;
276 case kPtRes: // Pt resolution @ vertex
277 if(!(arr = (TObjArray*)fResults->At(kPtRes))) return kFALSE;
278 gPad->Divide(2, 1, 1.e-5, 1.e-5); l=gPad->GetListOfPrimitives();
279 pad = ((TVirtualPad*)l->At(0)); pad->cd(); pad->SetLogx();
280 pad->SetMargin(0.1, 0.022, 0.1, 0.023);
281 hF = new TH1S("hFcheckESD", "ITS+TPC+TRD;p_{t} [GeV/c];#Delta p_{t} / p_{t} [%]", 10, 0.2, 10.);
282 hF->SetMaximum(10.);hF->SetMinimum(-3.);
283 hF->GetXaxis()->SetMoreLogLabels();
284 hF->GetXaxis()->SetTitleOffset(1.2);
285 hF->GetYaxis()->CenterTitle();
286 hF->Draw("p");
2bf6d80c 287 //for(Int_t ig(0); ig<fgkNgraph[kPtRes-1]/2; ig++){
fb65de21 288 for(Int_t ig(2); ig<6; ig++){
289 if(!(g = (TGraphErrors*)arr->At(ig))) continue;
290 if(!g->GetN()) continue;
291 g->Draw("pl");
292 //PutTrendValue(name[id], g->GetMean(2));
293 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));
294 }
295 pad = ((TVirtualPad*)l->At(1)); pad->cd(); pad->SetLogx();
296 pad->SetMargin(0.1, 0.22, 0.1, 0.023);
297 hF = (TH1*)hF->Clone("hFcheckESD1");
298 hF->SetTitle("ITS+TPC");
299 hF->SetMaximum(10.);hF->SetMinimum(-3.);
300 hF->Draw("p");
301 leg = new TLegend(.78, .1, .99, .98);
302 leg->SetHeader("P_{t} @ DCA");
303 leg->SetBorderSize(1); leg->SetFillColor(0);
304 leg->SetTextAlign(22);
305 leg->SetTextFont(12);
306 leg->SetTextSize(0.03813559);
307 {
308 Int_t nPlots(0);
2bf6d80c 309 //for(Int_t ig(fgkNgraph[kPtRes-1]/2); ig<fgkNgraph[kPtRes-1]; ig++){
fb65de21 310 for(Int_t ig(12); ig<16; ig++){
311 if(!(g = (TGraphErrors*)arr->At(ig))) continue;
312 if(!g->GetN()) continue;
313 nPlots++;
314 g->Draw("pl"); leg->AddEntry(g, g->GetTitle(), "pl");
315 //PutTrendValue(name[id], g->GetMean(2));
316 //PutTrendValue(Form("%sRMS", name[id]), g->GetRMS(2));
317 }
318 if(nPlots) leg->Draw();
319 }
320 break;
2bf6d80c 321 case 5: // plot a 3x3 canvas with tracking related histograms
322 PlotTrackingSummary(0);
323 break;
fb65de21 324
2bf6d80c 325 case 6: // plot a 3x3 canvas with PID related histograms
326 PlotPidSummary(0);
fb65de21 327 break;
2bf6d80c 328
329 case 7: // plot a 3x3 canvas with centrality dependence histograms
330 PlotCentSummary();
331 break;
332
fb65de21 333 }
334 return kTRUE;
335}
336
337//____________________________________________________________________
338void AliTRDcheckESD::UserExec(Option_t *){
339 //
340 // Run the Analysis
341 //
342 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
343 fMC = MCEvent();
344
345 if(!fESD){
346 AliError("ESD event missing.");
347 return;
348 }
349
350 // Get MC information if available
351 AliStack * fStack = NULL;
352 if(HasMC()){
353 if(!fMC){
354 AliWarning("MC event missing");
355 SetMC(kFALSE);
356 } else {
357 if(!(fStack = fMC->Stack())){
358 AliWarning("MC stack missing");
359 SetMC(kFALSE);
360 }
361 }
362 }
363 TH1 *h(NULL);
364
365 // fill event vertex histos
366 h = (TH1F*)fHistos->At(kTPCVertex);
367 if(fESD->GetPrimaryVertexTPC()) h->Fill(fESD->GetPrimaryVertexTPC()->GetZv());
368 h = (TH1F*)fHistos->At(kEventVertex);
369 if(fESD->GetPrimaryVertex()) h->Fill(fESD->GetPrimaryVertex()->GetZv());
370 // fill the uncutted number of tracks
371 h = (TH1I*)fHistos->At(kNTracksAll);
372 h->Fill(fESD->GetNumberOfTracks());
2bf6d80c 373
374
375 const AliMultiplicity* mult=fESD->GetMultiplicity();
376 Double_t itsNTracklets = mult->GetNumberOfTracklets();
377
378 if(itsNTracklets<1) return;
379
380 Double_t multLimits[6] = {0.0, 700., 1400., 2100., 2800., 3500.};
381 Int_t centralityClass = 0;
382 for(Int_t iCent=1; iCent<=5; ++iCent) {
383 if(itsNTracklets>multLimits[iCent-1] && itsNTracklets<multLimits[iCent])
384 centralityClass=iCent;
385 }
fb65de21 386
2bf6d80c 387 if(centralityClass == 0) return;
388 h = (TH1F*)fHistos->At(kSPDMult); h->Fill(itsNTracklets);
389
fb65de21 390 // counters for number of tracks in acceptance&DCA and for those with a minimum of TPC clusters
391 Int_t nTracksAcc=0;
392 Int_t nTracksTPC=0;
393
394 AliESDtrack *esdTrack(NULL);
395 for(Int_t itrk = 0; itrk < fESD->GetNumberOfTracks(); itrk++){
396 esdTrack = fESD->GetTrack(itrk);
397
398 // track status
399 ULong_t status = esdTrack->GetStatus(); //PrintStatus(status);
400
401 // track selection
402 Bool_t selected(kTRUE);
403 if(esdTrack->Pt() < fgkPt){
404 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] Pt[%5.2f]", fESD->GetEventNumberInFile(), itrk, esdTrack->Pt()));
405 selected = kFALSE;
406 }
407 if(TMath::Abs(esdTrack->Eta()) > fgkEta){
408 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] Eta[%5.2f]", fESD->GetEventNumberInFile(), itrk, TMath::Abs(esdTrack->Eta())));
409 selected = kFALSE;
410 }
411 if(!Bool_t(status & AliESDtrack::kTPCout)){
412 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] !TPCout", fESD->GetEventNumberInFile(), itrk));
413 selected = kFALSE;
414 }
415 if(esdTrack->GetKinkIndex(0) > 0){
416 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] Kink", fESD->GetEventNumberInFile(), itrk));
417 selected = kFALSE;
418 }
419
420 Float_t par[2], cov[3];
421 esdTrack->GetImpactParameters(par, cov);
422 if(selected && esdTrack->GetTPCNcls()>=10) {
423 // fill DCA histograms
424 h = (TH1F*)fHistos->At(kDCAxy); h->Fill(par[0]);
425 h = (TH1F*)fHistos->At(kDCAz); h->Fill(par[1]);
426 // fill pt distribution at this stage
427 h = (TH1F*)fHistos->At(kPt1); h->Fill(esdTrack->Pt());
428 }
429 if(IsCollision()){ // cuts on DCA
430 if(TMath::Abs(par[0]) > fgkTrkDCAxy){
431 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] DCAxy[%f]", fESD->GetEventNumberInFile(), itrk, TMath::Abs(par[0])));
432 selected = kFALSE;
433 }
434 if(TMath::Abs(par[1]) > fgkTrkDCAz){
435 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] DCAz[%f]", fESD->GetEventNumberInFile(), itrk, TMath::Abs(par[1])));
436 selected = kFALSE;
437 }
438 }
439 Float_t theta=esdTrack->Theta();
440 Float_t phi=esdTrack->Phi();
441 Int_t nClustersTPC = esdTrack->GetTPCNcls();
442 Float_t eta=esdTrack->Eta();
443 if(selected) {
444 nTracksAcc++; // number of tracks in acceptance and DCA cut
445 // fill pt distribution at this stage
446 h = (TH1F*)fHistos->At(kPt2); h->Fill(esdTrack->Pt());
447 // TPC nclusters distribution
448 h = (TH1I*)fHistos->At(kNTPCCl); h->Fill(nClustersTPC);
449 if(esdTrack->Pt()>1.0) {
450 h = (TH1I*)fHistos->At(kNTPCCl2); h->Fill(nClustersTPC);
451 }
452 // (eta,nclustersTPC) distrib of TPC ref. tracks
453 h = (TH2F*)fHistos->At(kEtaNclsTPC); h->Fill(eta, nClustersTPC);
454 // (phi,nclustersTPC) distrib of TPC ref. tracks
455 h = (TH2F*)fHistos->At(kPhiNclsTPC); h->Fill(phi, nClustersTPC);
456
457 }
458
459 if(nClustersTPC < fgkNclTPC){
460 AliDebug(2, Form("Reject Ev[%4d] Trk[%3d] NclTPC[%d]", fESD->GetEventNumberInFile(), itrk, nClustersTPC));
461 selected = kFALSE;
462 }
463 if(!selected) continue;
464
465 // number of TPC reference tracks
466 nTracksTPC++;
467
468 Int_t nTRD(esdTrack->GetNcls(2));
469 Double_t pt(esdTrack->Pt());
470 Double_t p[AliPID::kSPECIES]; esdTrack->GetTRDpid(p);
471 // pid quality
472 Bool_t kBarrel = Bool_t(status & AliESDtrack::kTRDin);
473
474 TH3F *hhh(NULL);
475 // find position and momentum of the track at entrance in TRD
476 Double_t localCoord[3] = {0., 0., 0.};
477 Bool_t localCoordGood = esdTrack->GetXYZAt(298., fESD->GetMagneticField(), localCoord);
478 if(localCoordGood) {
479 hhh = (TH3F*)fHistos->At(kPropagXYvsP); hhh->Fill(localCoord[0], localCoord[1], esdTrack->GetP());
480 hhh = (TH3F*)fHistos->At(kPropagRZvsP); hhh->Fill(localCoord[2], TMath::Sqrt(localCoord[0]*localCoord[0]+localCoord[1]*localCoord[1]), esdTrack->GetP());
481 }
482 Double_t localMom[3] = {0., 0., 0.};
483 Bool_t localMomGood = esdTrack->GetPxPyPzAt(298., fESD->GetMagneticField(), localMom);
484 Double_t localPhi = (localMomGood ? TMath::ATan2(localMom[1], localMom[0]) : 0.0);
485 Double_t localSagitaPhi = (localCoordGood ? TMath::ATan2(localCoord[1], localCoord[0]) : 0.0);
486
487 // fill pt distribution at this stage
488 if(esdTrack->Charge()>0) {
489 h = (TH1F*)fHistos->At(kPt3pos); h->Fill(pt);
490 // fill eta-phi map of TPC positive ref. tracks
491 if(localCoordGood && localMomGood && esdTrack->GetP()>0.5) {
2bf6d80c 492 hhh = (TH3F*)fHistos->At(kTPCRefTracksPos); hhh->Fill(eta, localSagitaPhi, pt);
493 hhh = (TH3F*)fHistos->At(kTPCRefTracksPos+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
fb65de21 494 }
495 }
496 if(esdTrack->Charge()<0) {
497 h = (TH1F*)fHistos->At(kPt3neg); h->Fill(pt);
498 // fill eta-phi map of TPC negative ref. tracks
499 if(localCoordGood && localMomGood && esdTrack->GetP()>0.5) {
2bf6d80c 500 hhh = (TH3F*)fHistos->At(kTPCRefTracksNeg); hhh->Fill(eta, localSagitaPhi, pt);
501 hhh = (TH3F*)fHistos->At(kTPCRefTracksNeg+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
fb65de21 502 }
503 }
504 // TPC dE/dx vs P
505 h = (TH2F*)fHistos->At(kTPCDedx); h->Fill(esdTrack->GetP(), esdTrack->GetTPCsignal());
506 // (eta,phi) distrib of TPC ref. tracks
507 h = (TH2F*)fHistos->At(kEtaPhi); h->Fill(eta, phi);
508
509 Int_t nTRDtrkl = esdTrack->GetTRDntracklets();
510 // TRD reference tracks
511 if(nTRDtrkl>=1) {
512 // fill pt distribution at this stage
513 if(esdTrack->Charge()>0) {
514 h = (TH1F*)fHistos->At(kPt4pos); h->Fill(pt);
515 // fill eta-phi map of TRD positive ref. tracks
2bf6d80c 516 if(localCoordGood && localMomGood && pt>0.3) {
517 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos); hhh->Fill(eta, localSagitaPhi, pt);
518 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
519 if(nTRDtrkl==4) {
520 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos4); hhh->Fill(eta, localSagitaPhi, pt);
521 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos4+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
522 }
523 if(nTRDtrkl==5) {
524 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos5); hhh->Fill(eta, localSagitaPhi, pt);
525 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos5+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
526 }
527 if(nTRDtrkl==6) {
528 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos6); hhh->Fill(eta, localSagitaPhi, pt);
529 hhh = (TH3F*)fHistos->At(kTRDRefTracksPos6+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
530 }
fb65de21 531 }
532 }
533 if(esdTrack->Charge()<0) {
534 h = (TH1F*)fHistos->At(kPt4neg); h->Fill(pt);
535 // fill eta-phi map of TRD negative ref. tracks
2bf6d80c 536 if(localCoordGood && localMomGood && pt>0.3) {
537 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg); hhh->Fill(eta, localSagitaPhi, pt);
538 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
539 if(nTRDtrkl==4) {
540 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg4); hhh->Fill(eta, localSagitaPhi, pt);
541 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg4+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
542 }
543 if(nTRDtrkl==5) {
544 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg5); hhh->Fill(eta, localSagitaPhi, pt);
545 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg5+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
546 }
547 if(nTRDtrkl==6) {
548 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg6); hhh->Fill(eta, localSagitaPhi, pt);
549 hhh = (TH3F*)fHistos->At(kTRDRefTracksNeg6+centralityClass); hhh->Fill(eta, localSagitaPhi, pt);
550 }
fb65de21 551 }
552 }
553 TProfile2D *h2d;
554 // fill eta-phi map of TRD negative ref. tracks
2bf6d80c 555 if(localCoordGood && localMomGood && pt>0.3) {
556 h2d = (TProfile2D*)fHistos->At(kTRDEtaPhiAvNtrkl); h2d->Fill(eta, localSagitaPhi, (Float_t)nTRDtrkl);
557 h2d = (TProfile2D*)fHistos->At(kTRDEtaPhiAvNtrkl+centralityClass); h2d->Fill(eta, localSagitaPhi, (Float_t)nTRDtrkl);
fb65de21 558 h2d = (TProfile2D*)fHistos->At(kTRDEtaDeltaPhiAvNtrkl); h2d->Fill(eta, localPhi-localSagitaPhi, (Float_t)nTRDtrkl);
2bf6d80c 559 h2d = (TProfile2D*)fHistos->At(kTRDEtaDeltaPhiAvNtrkl+centralityClass); h2d->Fill(eta, localPhi-localSagitaPhi, (Float_t)nTRDtrkl);
fb65de21 560 }
561 // ntracklets/track vs P
562 h = (TH2F*)fHistos->At(kNTrackletsTRD); h->Fill(esdTrack->GetP(), nTRDtrkl);
2bf6d80c 563 h = (TH2F*)fHistos->At(kNTrackletsTRD+centralityClass); h->Fill(esdTrack->GetP(), nTRDtrkl);
fb65de21 564 // ntracklets/track vs P
565 h = (TH2F*)fHistos->At(kNClsTrackTRD); h->Fill(esdTrack->GetP(), esdTrack->GetTRDncls());
2bf6d80c 566 h = (TH2F*)fHistos->At(kNClsTrackTRD+centralityClass); h->Fill(esdTrack->GetP(), esdTrack->GetTRDncls());
fb65de21 567 // TPC pid ------------------------------------------------
568 Double_t pionSigmas = fESDpid->NumberOfSigmasTPC(esdTrack,AliPID::kPion);
569 Double_t protonSigmas = fESDpid->NumberOfSigmasTPC(esdTrack,AliPID::kProton);
570 Double_t kaonSigmas = fESDpid->NumberOfSigmasTPC(esdTrack,AliPID::kKaon);
571 Double_t electronSigmas = fESDpid->NumberOfSigmasTPC(esdTrack,AliPID::kElectron);
572 Bool_t isTPCElectron = (TMath::Abs(electronSigmas)<2.0 &&
573 TMath::Abs(pionSigmas)>3.0 &&
574 TMath::Abs(kaonSigmas)>3.0 &&
575 TMath::Abs(protonSigmas)>3.0 &&
576 nClustersTPC>120 &&
577 esdTrack->GetP()>2.0 ? kTRUE : kFALSE);
578 Bool_t isTPCPion = (TMath::Abs(pionSigmas)<2.0 &&
579 TMath::Abs(kaonSigmas)>3.0 &&
580 TMath::Abs(protonSigmas)>3.0 &&
581 esdTrack->GetP() > 2.0 ? kTRUE : kFALSE);
582 // --------------------------------------------------------
583 // (slicePH,sliceNo) distribution and Qtot from slices
584 for(Int_t iPlane=0; iPlane<6; iPlane++) {
2bf6d80c 585 Float_t qtot=esdTrack->GetTRDslice(iPlane, 0);
586 for(Int_t iSlice=1; iSlice<8; iSlice++) {
fb65de21 587 if(esdTrack->GetTRDslice(iPlane, iSlice)>20.) {
588 h = (TH2F*)fHistos->At(kPHSlice); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
2bf6d80c 589 h = (TH2F*)fHistos->At(kPHSlice+centralityClass); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
fb65de21 590 if(isTPCElectron) {
591 h = (TH2F*)fHistos->At(kPHSliceTPCelectrons); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
2bf6d80c 592 h = (TH2F*)fHistos->At(kPHSliceTPCelectrons+centralityClass); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
fb65de21 593 h = (TH2F*)fHistos->At(kTPCdedxElectrons); h->Fill(esdTrack->GetP(), esdTrack->GetTPCsignal());
2bf6d80c 594 h = (TH2F*)fHistos->At(kTPCdedxElectrons+centralityClass); h->Fill(esdTrack->GetP(), esdTrack->GetTPCsignal());
fb65de21 595 }
596 if(isTPCPion) {
597 h = (TH2F*)fHistos->At(kPHSliceTPCpions); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
2bf6d80c 598 h = (TH2F*)fHistos->At(kPHSliceTPCpions+centralityClass); h->Fill(iSlice, esdTrack->GetTRDslice(iPlane, iSlice));
fb65de21 599 h = (TH2F*)fHistos->At(kTPCdedxPions); h->Fill(esdTrack->GetP(), esdTrack->GetTPCsignal());
2bf6d80c 600 h = (TH2F*)fHistos->At(kTPCdedxPions+centralityClass); h->Fill(esdTrack->GetP(), esdTrack->GetTPCsignal());
fb65de21 601 }
2bf6d80c 602 //qtot += esdTrack->GetTRDslice(iPlane, iSlice);
fb65de21 603 }
604 }
605 // Qtot>100 to avoid noise
606 if(qtot>100.) {
2bf6d80c 607 h = (TH2F*)fHistos->At(kQtotP); h->Fill(esdTrack->GetTRDmomentum(iPlane), fgkQs*qtot);
608 h = (TH2F*)fHistos->At(kQtotP+centralityClass); h->Fill(esdTrack->GetTRDmomentum(iPlane), fgkQs*qtot);
fb65de21 609 }
610 // Qtot>100 to avoid noise
611 // fgkQs*Qtot<40. so that the average will give a value close to the peak
612 if(localCoordGood && localMomGood && qtot>100. && fgkQs*qtot<40.) {
613 h2d = (TProfile2D*)fHistos->At(kTRDEtaPhiAvQtot+iPlane);
614 h2d->Fill(eta, localSagitaPhi, fgkQs*qtot);
2bf6d80c 615 h2d = (TProfile2D*)fHistos->At(kTRDEtaPhiAvQtot+6*centralityClass+iPlane);
616 h2d->Fill(eta, localSagitaPhi, fgkQs*qtot);
fb65de21 617 }
618 }
619 // theta distribution
620 h = (TH1F*)fHistos->At(kTheta); h->Fill(theta);
621 h = (TH1F*)fHistos->At(kPhi); h->Fill(phi);
622 } // end if nTRDtrkl>=1
623
624 // look at external track param
625 const AliExternalTrackParam *op = esdTrack->GetOuterParam();
626 const AliExternalTrackParam *ip = esdTrack->GetInnerParam();
627
628 Double_t pt0(0.), eta0(0.), phi0(0.), ptTRD(0.);
629 // read MC info if available
630 Bool_t kFOUND(kFALSE), kPhysPrim(kFALSE);
631 AliMCParticle *mcParticle(NULL);
632 if(HasMC()){
633 AliTrackReference *ref(NULL);
634 Int_t fLabel(esdTrack->GetLabel());
635 Int_t fIdx(TMath::Abs(fLabel));
7fe4e88b 636 if(!fStack || fIdx > fStack->GetNtrack()) continue;
fb65de21 637
638 // read MC particle
639 if(!(mcParticle = (AliMCParticle*) fMC->GetTrack(fIdx))) {
640 AliWarning(Form("MC particle missing. Label[ %d].", fLabel));
641 continue;
642 }
643 pt0 = mcParticle->Pt();
644 eta0 = mcParticle->Eta();
645 phi0 = mcParticle->Phi();
646 kPhysPrim = fMC->IsPhysicalPrimary(fIdx);
647
648 // read track references
649 Int_t nRefs = mcParticle->GetNumberOfTrackReferences();
650 if(!nRefs){
651 AliWarning(Form("No TR found for track @ Label[%d].", fLabel));
652 continue;
653 }
654 Int_t iref = 0;
655 while(iref<nRefs){
656 ref = mcParticle->GetTrackReference(iref);
657 if(ref->LocalX() > fgkxTPC) break;
658 ref=NULL; iref++;
659 }
660 if(ref){
661 if(ref->LocalX() > fgkxTOF){ // track skipping TRD fiducial volume
662 ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));
663 }
664 } else { // track stopped in TPC
665 ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));
666 }
667 ptTRD = ref->Pt();kFOUND=kTRUE;
668 } else { // use reconstructed values
669 if(op){
670 Double_t x(op->GetX());
671 if(x<fgkxTOF && x>fgkxTPC){
672 ptTRD=op->Pt();
673 kFOUND=kTRUE;
674 }
675 }
676
677 if(!kFOUND && ip){
678 ptTRD=ip->Pt();
679 kFOUND=kTRUE;
680 }
681 } // end if(HasMC())
682
683 if(kFOUND){
684 h = (TH2I*)fHistos->At(kTRDstat);
685 if(status & AliESDtrack::kTPCout) h->Fill(ptTRD, kTPCout);
686 if(status & AliESDtrack::kTRDin) h->Fill(ptTRD, kTRDin);
687 if(kBarrel && (status & AliESDtrack::kTRDout)) h->Fill(ptTRD, kTRDout);
688 if(kBarrel && (status & AliESDtrack::kTRDpid)) h->Fill(ptTRD, kTRDpid);
689 if(kBarrel && (status & AliESDtrack::kTRDrefit)) h->Fill(ptTRD, kTRDref);
690 }
691 Int_t idx(HasMC() ? Pdg2Idx(TMath::Abs(mcParticle->PdgCode())): 0)
692 ,sgn(esdTrack->Charge()<0?0:1);
693 if(kBarrel && kPhysPrim) {
694 TH3 *h3 = (TH3S*)fHistos->At(kPtRes);
695 Int_t offset = (status & AliESDtrack::kTRDrefit) ? 0 : 10;
696 h3->Fill(pt0, 1.e2*(pt/pt0-1.),
697 offset + 2*idx + sgn);
698 }
699 ((TH1*)fHistos->At(kNCl))->Fill(nTRD, 2*idx + sgn);
700 if(ip){
701 h = (TH2I*)fHistos->At(kTRDmom);
702 Float_t pTRD(0.);
703 for(Int_t ily=6; ily--;){
704 if((pTRD=esdTrack->GetTRDmomentum(ily))<0.) continue;
705 h->Fill(ip->GetP()-pTRD, ily);
706 }
707 }
708 } // end loop over tracks
709
710 // fill the number of tracks histograms
711 h = (TH1I*)fHistos->At(kNTracksAcc);
712 h->Fill(nTracksAcc);
713 h = (TH1I*)fHistos->At(kNTracksTPC);
714 h->Fill(nTracksTPC);
715}
716
717//____________________________________________________________________
718TObjArray* AliTRDcheckESD::Histos()
719{
720// Retrieve histograms array if already build or build it
721
722 if(fHistos) return fHistos;
723
724 fHistos = new TObjArray(kNhistos);
246fe7f7 725 fHistos->SetOwner(kTRUE);
fb65de21 726
727 TH1 *h = NULL;
728
729 // clusters per track
730 const Int_t kNpt(30);
731 Float_t pt(0.2);
732 Float_t binsPt[kNpt+1];
733 for(Int_t i=0;i<kNpt+1; i++,pt+=(TMath::Exp(i*i*.001)-1.)) binsPt[i]=pt;
734 if(!(h = (TH2S*)gROOT->FindObject("hNCl"))){
735 h = new TH2S("hNCl", "Clusters per TRD track;N_{cl}^{TRD};SPECIES;entries", 60, 0., 180., 10, -0.5, 9.5);
736 TAxis *ay(h->GetYaxis());
737 ay->SetLabelOffset(0.015);
738 for(Int_t i(0); i<AliPID::kSPECIES; i++){
739 ay->SetBinLabel(2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));
740 ay->SetBinLabel(2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));
741 }
742 } else h->Reset();
743 fHistos->AddAt(h, kNCl); fNRefFigures++;
744
745 // status bits histogram
746 const Int_t kNbits(5);
747 Float_t bits(.5);
748 Float_t binsBits[kNbits+1];
749 for(Int_t i=0; i<kNbits+1; i++,bits+=1.) binsBits[i]=bits;
750 if(!(h = (TH2I*)gROOT->FindObject("hTRDstat"))){
751 h = new TH2I("hTRDstat", "TRD status bits;p_{t} @ TRD [GeV/c];status;entries", kNpt, binsPt, kNbits, binsBits);
752 TAxis *ay(h->GetYaxis());
753 ay->SetBinLabel(1, "kTPCout");
754 ay->SetBinLabel(2, "kTRDin");
755 ay->SetBinLabel(3, "kTRDout");
756 ay->SetBinLabel(4, "kTRDpid");
757 ay->SetBinLabel(5, "kTRDrefit");
758 } else h->Reset();
759 fHistos->AddAt(h, kTRDstat);
760
761 // energy loss
762 if(!(h = (TH2I*)gROOT->FindObject("hTRDmom"))){
763 h = new TH2I("hTRDmom", "TRD energy loss;p_{inner} - p_{ly} [GeV/c];ly;entries", 100, -1., 2., 6, -0.5, 5.5);
764 } else h->Reset();
765 fHistos->AddAt(h, kTRDmom);
766 //if(!HasMC()) return fHistos;
767
768 // pt resolution
769 const Int_t kNdpt(100), kNspec(4*AliPID::kSPECIES);
770 Float_t dpt(-3.), spec(-0.5);
771 Float_t binsDPt[kNdpt+1], binsSpec[kNspec+1];
772 for(Int_t i=0; i<kNdpt+1; i++,dpt+=6.e-2) binsDPt[i]=dpt;
773 for(Int_t i=0; i<kNspec+1; i++,spec+=1.) binsSpec[i]=spec;
774 if(!(h = (TH3S*)gROOT->FindObject("hPtRes"))){
775 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);
776 TAxis *az(h->GetZaxis());
777 az->SetLabelOffset(0.015);
778 for(Int_t i(0); i<AliPID::kSPECIES; i++){
779 az->SetBinLabel(2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));
780 az->SetBinLabel(2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));
781 az->SetBinLabel(10+2*i+1, Form("%s^{-}", AliPID::ParticleLatexName(i)));
782 az->SetBinLabel(10+2*i+2, Form("%s^{+}", AliPID::ParticleLatexName(i)));
783 }
784 } else h->Reset();
785 fHistos->AddAt(h, kPtRes);
786
787 // TPC event vertex distribution
788 if(!(h = (TH1F*)gROOT->FindObject("hTPCVertex"))){
789 h = new TH1F("hTPCVertex", "Event vertex Z coord. from TPC tracks", 100, -25., 25.);
790 } else h->Reset();
791 fHistos->AddAt(h, kTPCVertex);
792
793 // Event vertex
794 if(!(h = (TH1F*)gROOT->FindObject("hEventVertex"))){
795 h = new TH1F("hEventVertex", "Event vertex Z coord.", 100, -25., 25.);
796 } else h->Reset();
797 fHistos->AddAt(h, kEventVertex);
798
799 // Number of all tracks
800 if(!(h = (TH1I*)gROOT->FindObject("hNTracksAll"))){
801 h = new TH1I("hNTracksAll", "Number of tracks per event, event vertex cuts", 5000, 0, 5000);
802 } else h->Reset();
803 fHistos->AddAt(h, kNTracksAll);
804
805 // Number of tracks in acceptance and DCA cut
806 if(!(h = (TH1I*)gROOT->FindObject("hNTracksAcc"))){
807 h = new TH1I("hNTracksAcc", Form("Number of tracks per event, |#eta|<%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",
808 fgkEta, fgkTrkDCAxy, fgkTrkDCAz), 5000, 0, 5000);
809 } else h->Reset();
810 fHistos->AddAt(h, kNTracksAcc);
811
812 // Number of tracks in TPC (Ncls>10)
813 if(!(h = (TH1I*)gROOT->FindObject("hNTracksTPC"))){
814 h = new TH1I("hNTracksTPC", Form("Number of tracks per event, |#eta|<%.1f, pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",
815 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 5000, 0, 5000);
816 } else h->Reset();
817 fHistos->AddAt(h, kNTracksTPC);
818
819 // Distribution of DCA-xy
820 if(!(h = (TH1F*)gROOT->FindObject("hDCAxy"))){
821 h = new TH1F("hDCAxy", "Distribution of transverse DCA", 100, -100., 100.);
822 } else h->Reset();
823 fHistos->AddAt(h, kDCAxy);
824
825 // Distribution of DCA-z
826 if(!(h = (TH1F*)gROOT->FindObject("hDCAz"))){
827 h = new TH1F("hDCAz", "Distribution of longitudinal DCA", 100, -100., 100.);
828 } else h->Reset();
829 fHistos->AddAt(h, kDCAz);
830
831 Float_t binPtLimits[33] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
832 1.0, 1.1, 1.2, 1.3, 1.4,
833 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0,
834 3.4, 3.8, 4.2, 4.6, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
835 // Pt distributions
836 if(!(h = (TH1F*)gROOT->FindObject("hPt1"))){
837 h = new TH1F("hPt1", Form("dN/dpt, |#eta|<%.1f and pt>%.1f", fgkEta, fgkPt), 32, binPtLimits);
838 } else h->Reset();
839 fHistos->AddAt(h, kPt1);
840
841 if(!(h = (TH1F*)gROOT->FindObject("hPt2"))){
842 h = new TH1F("hPt2", Form("dN/dpt, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",
843 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 32, binPtLimits);
844 } else h->Reset();
845 fHistos->AddAt(h, kPt2);
846
847 if(!(h = (TH1F*)gROOT->FindObject("hPt3pos"))){
848 h = new TH1F("hPt3pos", Form("dN/dpt (positives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",
849 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);
850 } else h->Reset();
851 fHistos->AddAt(h, kPt3pos);
852
853 if(!(h = (TH1F*)gROOT->FindObject("hPt3neg"))){
854 h = new TH1F("hPt3neg", Form("dN/dpt (negatives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",
855 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);
856 } else h->Reset();
857 fHistos->AddAt(h, kPt3neg);
858
859 if(!(h = (TH1F*)gROOT->FindObject("hPt4pos"))){
860 h = new TH1F("hPt4pos", Form("dN/dpt (positives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",
861 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);
862 } else h->Reset();
863 fHistos->AddAt(h, kPt4pos);
864
865 if(!(h = (TH1F*)gROOT->FindObject("hPt4neg"))){
866 h = new TH1F("hPt4pos", Form("dN/dpt (negatives), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",
867 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 32, binPtLimits);
868 } else h->Reset();
869 fHistos->AddAt(h, kPt4neg);
870
871 // theta distribution of TRD tracks
872 if(!(h = (TH1F*)gROOT->FindObject("hTheta"))){
873 h = new TH1F("hTheta", Form("dN/d#theta, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",
874 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 220,.5,2.7);
875 } else h->Reset();
876 fHistos->AddAt(h, kTheta);
877
878 // phi distribution of TRD tracks
879 if(!(h = (TH1F*)gROOT->FindObject("hPhi"))){
880 h = new TH1F("hPhi", Form("dN/d#varphi, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d, nTRDtracklets#geq 1",
881 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 157,0,6.28);
882 } else h->Reset();
883 fHistos->AddAt(h, kPhi);
884
885 // TPC cluster distribution
886 if(!(h = (TH1F*)gROOT->FindObject("hNTPCCl"))){
887 h = new TH1I("hNTPCCl", Form("Number of TPC clusters/track, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",
888 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 160, 0, 160);
889 } else h->Reset();
890 fHistos->AddAt(h, kNTPCCl);
891
892 if(!(h = (TH1I*)gROOT->FindObject("hNTPCCl2"))){
893 h = new TH1F("hNTPCCl2", Form("Number of TPC clusters/track, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, pt>1.0 GeV/c",
894 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 160, 0, 160);
895 } else h->Reset();
896 fHistos->AddAt(h, kNTPCCl2);
897
898 // dE/dx vs P for TPC reference tracks
899 if(!(h = (TH2F*)gROOT->FindObject("hTPCDedx"))){
900 h = new TH2F("hTPCDedx", Form("TPC dE/dx vs P, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",
2bf6d80c 901 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 150, 0, 150.);
fb65de21 902 } else h->Reset();
903 fHistos->AddAt(h, kTPCDedx);
904
905 // eta,phi distribution of TPC reference tracks
906 if(!(h = (TH2F*)gROOT->FindObject("hEtaPhi"))){
907 h = new TH2F("hEtaPhi", Form("TPC (#eta,#varphi), |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f, TPC nclusters>%d",
908 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 50, -1, 1, 157, 0, 6.28);
909 } else h->Reset();
910 fHistos->AddAt(h, kEtaPhi);
911
912 // Nclusters vs eta distribution for TPC tracks
913 if(!(h = (TH2F*)gROOT->FindObject("hEtaNclsTPC"))){
914 h = new TH2F("hEtaNclsTPC", Form("TPC Nclusters vs. #eta, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",
915 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 50, -1, 1, 160, 0, 160.);
916 } else h->Reset();
917 fHistos->AddAt(h, kEtaNclsTPC);
918
919 // Nclusters vs phi distribution for TPC reference tracks
920 if(!(h = (TH2F*)gROOT->FindObject("hPhiNclsTPC"))){
921 h = new TH2F("hPhiNclsTPC", Form("TPC Nclusters vs. #varphi, |#eta|<%.1f and pt>%.1f, |DCAxy|<%.1f, |DCAz|<%.1f",
922 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz), 157, 0, 6.28, 160, 0, 160.);
923 } else h->Reset();
924 fHistos->AddAt(h, kPhiNclsTPC);
2bf6d80c 925
926 // SPD multiplicity distribution
927 if(!(h = (TH1F*)gROOT->FindObject("hSPDMult"))){
928 h = new TH1F("hSPDMult", "SPD multiplicity", 10000, -0.5, 9999.5);
929 } else h->Reset();
930 fHistos->AddAt(h, kSPDMult);
931
fb65de21 932 // Ntracklets/track vs P for TRD reference tracks
933 Double_t binsP[19] = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.7, 2.0,
934 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 7.0, 9.0, 12.0};
2bf6d80c 935 for(Int_t iCent=0; iCent<=5; ++iCent) {
936 if(!(h = (TH2F*)gROOT->FindObject(Form("hNTrackletsTRD_cent%d",iCent+1)))){
937 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",
938 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 7, -0.5, 6.5);
939 } else h->Reset();
940 fHistos->AddAt(h, kNTrackletsTRD+iCent);
941 }
fb65de21 942
943 // Nclusters/track vs P for TRD reference tracks
2bf6d80c 944 for(Int_t iCent=0; iCent<=5; ++iCent) {
945 if(!(h = (TH2F*)gROOT->FindObject(Form("hNClsTrackTRD_cent%d",iCent+1)))){
946 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",
947 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 300, 0., 300.);
948 } else h->Reset();
949 fHistos->AddAt(h, kNClsTrackTRD+iCent);
950 }
951
fb65de21 952 // <PH> vs slice number for TRD reference tracklets
2bf6d80c 953 for(Int_t iCent=0; iCent<=5; ++iCent) {
954 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSlice_cent%d",iCent+1)))){
955 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",
956 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 200, 0., 2000.);
957 } else h->Reset();
958 fHistos->AddAt(h, kPHSlice+iCent);
959 }
fb65de21 960
961 // <PH> vs slice number for TRD reference tracklets, from TPC pions
2bf6d80c 962 for(Int_t iCent=0; iCent<=5; ++iCent) {
963 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSliceTPCpions_cent%d",iCent+1)))){
964 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",
965 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 100, 0., 2000.);
966 } else h->Reset();
967 fHistos->AddAt(h, kPHSliceTPCpions+iCent);
968 }
fb65de21 969
970 // TPC dE/dx vs P for TRD reference tracks, pions
2bf6d80c 971 for(Int_t iCent=0; iCent<=5; ++iCent) {
972 if(!(h = (TH2F*)gROOT->FindObject(Form("hTPCdedxPions_cent%d",iCent+1)))){
973 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",
974 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 100, 0,100.);
975 } else h->Reset();
976 fHistos->AddAt(h, kTPCdedxPions+iCent);
977 }
fb65de21 978
979 // <PH> vs slice number for TRD reference tracklets, from TPC electrons
2bf6d80c 980 for(Int_t iCent=0; iCent<=5; ++iCent) {
981 if(!(h = (TH2F*)gROOT->FindObject(Form("hPHSliceTPCelectrons_cent%d",iCent+1)))){
982 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",
983 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 8, -0.5, 7.5, 100, 0., 2000.);
984 } else h->Reset();
985 fHistos->AddAt(h, kPHSliceTPCelectrons+iCent);
986 }
fb65de21 987
988 // TPC dE/dx vs P for TRD reference tracks, electrons
2bf6d80c 989 for(Int_t iCent=0; iCent<=5; ++iCent) {
990 if(!(h = (TH2F*)gROOT->FindObject(Form("hTPCdedxElectrons_cent%d",iCent+1)))){
991 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",
992 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, 0.1,10.1, 100, 0,100.);
993 } else h->Reset();
994 fHistos->AddAt(h, kTPCdedxElectrons+iCent);
995 }
996
fb65de21 997 // Qtot vs P for TRD reference tracklets
2bf6d80c 998 for(Int_t iCent=0; iCent<=5; ++iCent) {
999 if(!(h = (TH2F*)gROOT->FindObject(Form("hQtotP_cent%d",iCent+1)))){
1000 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",
1001 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 18, binsP, 400, 0., 20);
1002 } else h->Reset();
1003 fHistos->AddAt(h, kQtotP+iCent);
1004 }
fb65de21 1005
1006 // (X,Y,momentum) distribution after AliESDtrack::PropagateTo(r=300.)
1007 if(!(h = (TH3F*)gROOT->FindObject("hPropagXYvsP"))){
1008 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",
1009 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100,-500,500, 100,-500,500, 10, 0.,10.);
1010 } else h->Reset();
1011 fHistos->AddAt(h, kPropagXYvsP);
1012
1013 // (R,Z,momentum) distribution after AliESDtrack::PropagateTo(r=300.)
1014 if(!(h = (TH3F*)gROOT->FindObject("hPropagRZvsP"))){
1015 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",
1016 fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100,-350., 350., 100,0.,500., 10, 0.,10.);
1017 } else h->Reset();
1018 fHistos->AddAt(h, kPropagRZvsP);
1019
1020 Float_t etaBinLimits[101];
1021 for(Int_t i=0; i<101; i++) etaBinLimits[i] = -1.0 + i*2.0/100.;
1022 Float_t phiBinLimits[151];
1023 for(Int_t i=0; i<151; i++) phiBinLimits[i] = -1.1*TMath::Pi() + i*2.2*TMath::Pi()/150.;
1024 // (eta,detector phi,P) distribution of reference TPC positive tracks
2bf6d80c 1025 for(Int_t iCent=0; iCent<=5; ++iCent) {
1026 if(!(h = (TH3F*)gROOT->FindObject(Form("hTPCRefTracksPos_cent%d",iCent+1)))){
1027 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",
1028 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1029 } else h->Reset();
1030 fHistos->AddAt(h, kTPCRefTracksPos+iCent);
1031 }
fb65de21 1032
1033 // (eta,detector phi,P) distribution of reference TPC negative tracks
2bf6d80c 1034 for(Int_t iCent=0; iCent<=5; ++iCent) {
1035 if(!(h = (TH3F*)gROOT->FindObject(Form("hTPCRefTracksNeg_cent%d",iCent+1)))){
1036 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",
1037 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1038 } else h->Reset();
1039 fHistos->AddAt(h, kTPCRefTracksNeg+iCent);
1040 }
fb65de21 1041
1042 // (eta,detector phi,P) distribution of reference TRD positive tracks
2bf6d80c 1043 for(Int_t iCent=0; iCent<=5; ++iCent) {
1044 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos_cent%d",iCent+1)))){
1045 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",
1046 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1047 } else h->Reset();
1048 fHistos->AddAt(h, kTRDRefTracksPos+iCent);
1049 }
fb65de21 1050
1051 // (eta,detector phi,P) distribution of reference TRD negative tracks
2bf6d80c 1052 for(Int_t iCent=0; iCent<=5; ++iCent) {
1053 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg_cent%d",iCent+1)))){
1054 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",
1055 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1056 } else h->Reset();
1057 fHistos->AddAt(h, kTRDRefTracksNeg+iCent);
1058 }
1059
1060 // (eta,detector phi,P) distribution of reference TRD positive tracks with 4 tracklets
1061 for(Int_t iCent=0; iCent<=5; ++iCent) {
1062 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos4_cent%d",iCent+1)))){
1063 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",
1064 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1065 } else h->Reset();
1066 fHistos->AddAt(h, kTRDRefTracksPos4+iCent);
1067 }
1068
1069 // (eta,detector phi,P) distribution of reference TRD positive tracks with 5 tracklets
1070 for(Int_t iCent=0; iCent<=5; ++iCent) {
1071 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos5_cent%d",iCent+1)))){
1072 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",
1073 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1074 } else h->Reset();
1075 fHistos->AddAt(h, kTRDRefTracksPos5+iCent);
1076 }
1077
1078 // (eta,detector phi,P) distribution of reference TRD positive tracks with 6 tracklets
1079 for(Int_t iCent=0; iCent<=5; ++iCent) {
1080 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksPos6_cent%d",iCent+1)))){
1081 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",
1082 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1083 } else h->Reset();
1084 fHistos->AddAt(h, kTRDRefTracksPos6+iCent);
1085 }
fb65de21 1086
2bf6d80c 1087 // (eta,detector phi,P) distribution of reference TRD negative tracks with 4 tracklets
1088 for(Int_t iCent=0; iCent<=5; ++iCent) {
1089 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg4_cent%d",iCent+1)))){
1090 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",
1091 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1092 } else h->Reset();
1093 fHistos->AddAt(h, kTRDRefTracksNeg4+iCent);
1094 }
1095
1096 // (eta,detector phi,P) distribution of reference TRD negative tracks with 5 tracklets
1097 for(Int_t iCent=0; iCent<=5; ++iCent) {
1098 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg5_cent%d",iCent+1)))){
1099 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",
1100 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1101 } else h->Reset();
1102 fHistos->AddAt(h, kTRDRefTracksNeg5+iCent);
1103 }
1104
1105 // (eta,detector phi,P) distribution of reference TRD negative tracks with 6 tracklets
1106 for(Int_t iCent=0; iCent<=5; ++iCent) {
1107 if(!(h = (TH3F*)gROOT->FindObject(Form("hTRDRefTracksNeg6_cent%d",iCent+1)))){
1108 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",
1109 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, etaBinLimits, 150, phiBinLimits, 32, binPtLimits);
1110 } else h->Reset();
1111 fHistos->AddAt(h, kTRDRefTracksNeg6+iCent);
1112 }
1113
1114
fb65de21 1115 // (eta,detector phi) profile of average number of TRD tracklets/track
2bf6d80c 1116 for(Int_t iCent=0; iCent<=5; ++iCent) {
1117 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaPhiAvNtrkl_cent%d",iCent+1)))){
1118 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",
1119 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 150, -1.1*TMath::Pi(), 1.1*TMath::Pi());
1120 } else h->Reset();
1121 fHistos->AddAt(h, kTRDEtaPhiAvNtrkl+iCent);
1122 }
fb65de21 1123
1124 // (eta,delta phi) profile of average number of TRD tracklets/track
2bf6d80c 1125 for(Int_t iCent=0; iCent<=5; ++iCent) {
1126 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaDeltaPhiAvNtrkl_cent%d",iCent+1)))){
1127 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",
1128 iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 50, -0.4*TMath::Pi(), 0.4*TMath::Pi());
fb65de21 1129 } else h->Reset();
2bf6d80c 1130 fHistos->AddAt(h, kTRDEtaDeltaPhiAvNtrkl+iCent);
1131 }
1132
1133 // (eta, detector phi) profile of average tracklet Qtot from slices
1134 for(Int_t iCent=0; iCent<=5; ++iCent) {
1135 for(Int_t iLayer=0;iLayer<6;iLayer++) {
1136 if(!(h = (TProfile2D*)gROOT->FindObject(Form("hTRDEtaPhiAvQtot_Layer%d_cent%d",iLayer,iCent+1)))) {
1137 h = new TProfile2D(Form("hTRDEtaPhiAvQtot_Layer%d_cent%d",iLayer,iCent+1),
1138 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",
1139 iLayer, iCent+1, fgkEta, fgkPt, fgkTrkDCAxy, fgkTrkDCAz, fgkNclTPC), 100, -1.0, 1.0, 150, -1.1*TMath::Pi(), 1.1*TMath::Pi());
1140 } else h->Reset();
1141 fHistos->AddAt(h, kTRDEtaPhiAvQtot+iCent*6+iLayer);
1142 }
fb65de21 1143 }
1144
1145 return fHistos;
1146}
1147
1148//____________________________________________________________________
1149Bool_t AliTRDcheckESD::Load(const Char_t *file, const Char_t *dir, const Char_t *name)
1150{
1151// Load data from performance file
1152
1153 if(!TFile::Open(file)){
1154 AliWarning(Form("Couldn't open file %s.", file));
1155 return kFALSE;
1156 }
1157 if(dir){
1158 if(!gFile->cd(dir)){
1159 AliWarning(Form("Couldn't cd to %s in %s.", dir, file));
1160 return kFALSE;
1161 }
1162 }
1163 TObjArray *o(NULL);
1164 const Char_t *tn=(name ? name : GetName());
1165 if(!(o = (TObjArray*)gDirectory->Get(tn))){
1166 AliWarning(Form("Missing histogram container %s.", tn));
1167 return kFALSE;
1168 }
1169 fHistos = (TObjArray*)o->Clone(GetName());
1170 gFile->Close();
1171 return kTRUE;
1172}
1173
1174//_______________________________________________________
1175Bool_t AliTRDcheckESD::PutTrendValue(const Char_t *name, Double_t val)
1176{
1177// Dump trending value to default file
1178
1179 if(!fgFile){
1180 fgFile = fopen("TRD.Performance.txt", "at");
1181 }
1182 fprintf(fgFile, "%s_%s %f\n", GetName(), name, val);
1183 return kTRUE;
1184}
1185
1186//____________________________________________________________________
1187void AliTRDcheckESD::Terminate(Option_t *)
1188{
2bf6d80c 1189 // Steer post-processing
fb65de21 1190 if(!fHistos){
1191 fHistos = dynamic_cast<TObjArray *>(GetOutputData(1));
1192 if(!fHistos){
1193 AliError("Histogram container not found in output");
1194 return;
1195 }
1196 }
1197
2bf6d80c 1198 // fNRefFigures = 15;
1199 // return;
1200
fb65de21 1201 const Char_t *name[kNrefs] = {
1202 "Ncl", "Eff", "Eloss", "PtResDCA"
1203 };
2bf6d80c 1204
fb65de21 1205 TObjArray *arr(NULL); TGraph *g(NULL);
1206 if(!fResults){
1207 fResults = new TObjArray(kNrefs);
1208 fResults->SetOwner();
1209 fResults->SetName("results");
1210 for(Int_t iref(0); iref<kNrefs; iref++){
1211 fResults->AddAt(arr = new TObjArray(fgkNgraph[iref]), iref);
1212 arr->SetName(name[iref]); arr->SetOwner();
2bf6d80c 1213 switch(iref+1){
fb65de21 1214 case kNCl:
2bf6d80c 1215 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){
fb65de21 1216 arr->AddAt(g = new TGraphErrors(), ig);
1217 g->SetLineColor(ig+1);
1218 g->SetMarkerColor(ig+1);
1219 g->SetMarkerStyle(ig+20);
1220 g->SetName(Form("s%d", ig));
1221 switch(ig){
1222 case 0: g->SetTitle("ALL"); break;
1223 case 1: g->SetTitle("NEG"); break;
1224 case 2: g->SetTitle("POS"); break;
1225 default: g->SetTitle(AliPID::ParticleLatexName(ig-3)); break;
1226 };
1227 }
1228 break;
1229 case kTRDmom:
2bf6d80c 1230 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){
fb65de21 1231 arr->AddAt(g = new TGraphAsymmErrors(), ig);
1232 g->SetLineColor(ig+1);
1233 g->SetMarkerColor(ig+1);
1234 g->SetMarkerStyle(ig+20);
1235 }
1236 break;
1237 case kPtRes:
2bf6d80c 1238 for(Int_t idx(0); idx<AliPID::kSPECIES; idx++){
fb65de21 1239 Int_t ig(2*idx);
1240 arr->AddAt(g = new TGraphErrors(), ig);
1241 g->SetLineColor(kRed-idx);
1242 g->SetMarkerColor(kRed-idx);
1243 g->SetMarkerStyle(20+idx);
1244 g->SetNameTitle(Form("s%d", ig), Form("res %s", AliPID::ParticleLatexName(idx)));
1245 arr->AddAt(g = new TGraphErrors(), ig+1);
1246 g->SetLineColor(kBlue-idx);
1247 g->SetMarkerColor(kBlue-idx);
1248 g->SetMarkerStyle(20+idx);
1249 g->SetNameTitle(Form("m%d", ig+1), Form("sys %s", AliPID::ParticleLatexName(idx)));
1250
1251 ig+=10;
1252 arr->AddAt(g = new TGraphErrors(), ig);
1253 g->SetLineColor(kRed-idx);
1254 g->SetMarkerColor(kRed-idx);
1255 g->SetMarkerStyle(20+idx);
1256 g->SetNameTitle(Form("s%d", ig), Form("sigma %s", AliPID::ParticleLatexName(idx)));
1257 arr->AddAt(g = new TGraphErrors(), ig+1);
1258 g->SetLineColor(kBlue-idx);
1259 g->SetMarkerColor(kBlue-idx);
1260 g->SetMarkerStyle(20+idx);
1261 g->SetNameTitle(Form("m%d", ig+1), Form("mean %s", AliPID::ParticleLatexName(idx)));
1262 }
1263 break;
1264 default:
2bf6d80c 1265 for(Int_t ig(0); ig<fgkNgraph[iref]; ig++){
fb65de21 1266 arr->AddAt(g = new TGraphErrors(), ig);
1267 g->SetLineColor(ig+1);
1268 g->SetMarkerColor(ig+1);
1269 g->SetMarkerStyle(ig+20);
1270 }
1271 break;
1272 }
1273 }
1274 }
1275 TH1 *h1[2] = {NULL, NULL};
1276 TH2I *h2(NULL);
1277 TAxis *ax(NULL);
1278
1279 // No of clusters
1280 if(!(h2 = (TH2I*)fHistos->At(kNCl))) return;
1281 ax = h2->GetXaxis();
1282 arr = (TObjArray*)fResults->At(kNCl);
2bf6d80c 1283
fb65de21 1284 // All tracks
1285 h1[0] = h2->ProjectionX("Ncl_px");
1286 TGraphErrors *ge=(TGraphErrors*)arr->At(0);
1287 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){
1288 ge->SetPoint(ib-2, ax->GetBinCenter(ib), h1[0]->GetBinContent(ib));
1289 }
2bf6d80c 1290
fb65de21 1291 // All charged tracks
1292 TH1 *hNclCh[2] = {(TH1D*)h1[0]->Clone("NEG"), (TH1D*)h1[0]->Clone("POS")};
1293 hNclCh[0]->Reset();hNclCh[1]->Reset();
1294 for(Int_t is(1); is<=AliPID::kSPECIES; is++){
1295 hNclCh[0]->Add(h2->ProjectionX("Ncl_px", 2*is-1, 2*is-1)); // neg
1296 hNclCh[1]->Add(h2->ProjectionX("Ncl_px", 2*is, 2*is)); // pos
1297 }
1298 if(Int_t(hNclCh[0]->GetEntries())){
1299 ge=(TGraphErrors*)arr->At(1);
1300 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){
1301 ge->SetPoint(ib-2, ax->GetBinCenter(ib), hNclCh[0]->GetBinContent(ib));
1302 }
1303 }
2bf6d80c 1304
fb65de21 1305 if(Int_t(hNclCh[1]->GetEntries())){
1306 ge=(TGraphErrors*)arr->At(2);
1307 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){
1308 ge->SetPoint(ib-2, ax->GetBinCenter(ib), hNclCh[1]->GetBinContent(ib));
1309 }
1310 }
1311 // Species wise
1312 for(Int_t is(1); is<=AliPID::kSPECIES; is++){
1313 h1[0] = h2->ProjectionX("Ncl_px", 2*is-1, 2*is);
1314 if(!Int_t(h1[0]->GetEntries())) continue;
1315 ge=(TGraphErrors*)arr->At(2+is);
1316 for(Int_t ib=2; ib<=ax->GetNbins(); ib++){
1317 ge->SetPoint(ib-2, ax->GetBinCenter(ib), h1[0]->GetBinContent(ib));
1318 }
1319 }
2bf6d80c 1320
fb65de21 1321 fNRefFigures = 1;
1322
1323 // EFFICIENCY
1324 // geometrical efficiency
1325 if(!(h2 = (TH2I*)fHistos->At(kTRDstat))) return;
2bf6d80c 1326 arr = (TObjArray*)fResults->At(kTRDstat-1);
fb65de21 1327 h1[0] = h2->ProjectionX("checkESDx0", kTPCout, kTPCout);
1328 h1[1] = h2->ProjectionX("checkESDx1", kTRDin, kTRDin);
1329 Process(h1, (TGraphErrors*)arr->At(0));
1330 delete h1[0];delete h1[1];
1331 // tracking efficiency
1332 h1[0] = h2->ProjectionX("checkESDx0", kTRDin, kTRDin);
1333 h1[1] = h2->ProjectionX("checkESDx1", kTRDout, kTRDout);
1334 Process(h1, (TGraphErrors*)arr->At(1));
1335 delete h1[1];
1336 // PID efficiency
1337 h1[1] = h2->ProjectionX("checkESDx1", kTRDpid, kTRDpid);
1338 Process(h1, (TGraphErrors*)arr->At(2));
1339 delete h1[1];
1340 // Refit efficiency
1341 h1[1] = h2->ProjectionX("checkESDx1", kTRDref, kTRDref);
1342 Process(h1, (TGraphErrors*)arr->At(3));
1343 delete h1[1];
1344 fNRefFigures++;
1345
1346 // ENERGY LOSS
1347 if(!(h2 = dynamic_cast<TH2I*>(fHistos->At(kTRDmom)))) return;
2bf6d80c 1348 arr = (TObjArray*)fResults->At(kTRDmom-1);
fb65de21 1349 TGraphAsymmErrors *g06 = (TGraphAsymmErrors*)arr->At(0), *g09 = (TGraphAsymmErrors*)arr->At(1);
1350 ax=h2->GetXaxis();
1351 const Int_t nq(4);
1352 const Double_t xq[nq] = {0.05, 0.2, 0.8, 0.95};
1353 Double_t yq[nq];
1354 for(Int_t ily=6; ily--;){
1355 h1[0] = h2->ProjectionX("checkESDp0", ily+1, ily+1);
1356 h1[0]->GetQuantiles(nq,yq,xq);
1357 g06->SetPoint(ily, Float_t(ily), ax->GetBinCenter(h1[0]->GetMaximumBin()));
1358 g06->SetPointError(ily, 0., 0., TMath::Abs(yq[0]), yq[3]);
1359 g09->SetPoint(ily, Float_t(ily), h1[0]->GetMean());
1360 g09->SetPointError(ily, 0., 0., TMath::Abs(yq[1]), yq[2]);
1361
1362 //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]);
1363 delete h1[0];
1364 }
1365 fNRefFigures++;
1366// if(!HasMC()) return;
1367
1368 // Pt RESOLUTION @ DCA
1369 TH3S* h3(NULL); TGraphErrors *gg[2] = {NULL,NULL};
1370 if(!(h3 = dynamic_cast<TH3S*>(fHistos->At(kPtRes)))) return;
2bf6d80c 1371 arr = (TObjArray*)fResults->At(kPtRes-1);
fb65de21 1372 TAxis *az(h3->GetZaxis());
1373 for(Int_t i(0); i<AliPID::kSPECIES; i++){
1374 Int_t idx(2*i);
1375 az->SetRange(idx+1, idx+2);
1376 gg[1] = (TGraphErrors*)arr->At(idx);
1377 gg[0] = (TGraphErrors*)arr->At(idx+1);
1378 Process2D((TH2*)h3->Project3D("yx"), gg);
1379
1380 idx+=10;
1381 az->SetRange(idx+1, idx+2);
1382 gg[1] = (TGraphErrors*)arr->At(idx);
1383 gg[0] = (TGraphErrors*)arr->At(idx+1);
1384 Process2D((TH2*)h3->Project3D("yx"), gg);
1385 }
1386 fNRefFigures++;
1387
fb65de21 1388 fNRefFigures++;
2bf6d80c 1389 // 3x3 tracking summary canvases for every centrality class
1390 fNRefFigures++;
1391 // 3x3 PID summary canvases for every centrality class
fb65de21 1392 fNRefFigures++;
2bf6d80c 1393 // 3x3 for centrality dependent pictures
fb65de21 1394 fNRefFigures++;
1395}
1396
1397//____________________________________________________________________
1398Int_t AliTRDcheckESD::Pdg2Idx(Int_t pdg) const
1399{
1400 //
1401 // Helper function converting PDG code into AliPID index
1402 //
1403 switch(pdg){
1404 case kElectron:
1405 case kPositron: return AliPID::kElectron;
1406 case kMuonPlus:
1407 case kMuonMinus: return AliPID::kMuon;
1408 case kPiPlus:
1409 case kPiMinus: return AliPID::kPion;
1410 case kKPlus:
1411 case kKMinus: return AliPID::kKaon;
1412 case kProton:
1413 case kProtonBar: return AliPID::kProton;
1414 }
1415 return -1;
1416}
1417
1418//____________________________________________________________________
1419void AliTRDcheckESD::Process(TH1 **h1, TGraphErrors *g)
1420{
1421// Generic function to process one reference plot
1422
1423 Int_t n1 = 0, n2 = 0, ip=0;
1424 Double_t eff = 0.;
1425
1426 TAxis *ax = h1[0]->GetXaxis();
1427 for(Int_t ib=1; ib<=ax->GetNbins(); ib++){
1428 if(!(n1 = (Int_t)h1[0]->GetBinContent(ib))) continue;
1429 n2 = (Int_t)h1[1]->GetBinContent(ib);
1430 eff = n2/Float_t(n1);
1431
1432 ip=g->GetN();
1433 g->SetPoint(ip, ax->GetBinCenter(ib), eff);
1434 g->SetPointError(ip, 0., n2 ? eff*TMath::Sqrt(1./n1+1./n2) : 0.);
1435 }
1436}
1437//________________________________________________________
1438void AliTRDcheckESD::Process2D(TH2 * const h2, TGraphErrors **g)
1439{
1440 //
1441 // Do the processing
1442 //
1443
1444 Int_t n = 0;
1445 if((n=g[0]->GetN())) for(;n--;) g[0]->RemovePoint(n);
1446 if((n=g[1]->GetN())) for(;n--;) g[1]->RemovePoint(n);
1447 TF1 f("fg", "gaus", -3.,3.);
1448 for(Int_t ibin = 1; ibin <= h2->GetNbinsX(); ibin++){
1449 Double_t x = h2->GetXaxis()->GetBinCenter(ibin);
1450 TH1D *h = h2->ProjectionY("py", ibin, ibin);
1451 if(h->GetEntries()<100) continue;
1452 //AdjustF1(h, f);
1453
1454 h->Fit(&f, "QN");
1455 Int_t ip = g[0]->GetN();
1456 g[0]->SetPoint(ip, x, f.GetParameter(1));
1457 g[0]->SetPointError(ip, 0., f.GetParError(1));
1458 g[1]->SetPoint(ip, x, f.GetParameter(2));
1459 g[1]->SetPointError(ip, 0., f.GetParError(2));
1460 }
1461 return;
1462}
1463//____________________________________________________________________
1464void AliTRDcheckESD::PrintStatus(ULong_t status)
1465{
1466// Dump track status to stdout
1467
1468 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"
1469 ,Bool_t(status & AliESDtrack::kITSin)
1470 ,Bool_t(status & AliESDtrack::kITSout)
1471 ,Bool_t(status & AliESDtrack::kITSrefit)
1472 ,Bool_t(status & AliESDtrack::kTPCin)
1473 ,Bool_t(status & AliESDtrack::kTPCout)
1474 ,Bool_t(status & AliESDtrack::kTPCrefit)
1475 ,Bool_t(status & AliESDtrack::kTPCpid)
1476 ,Bool_t(status & AliESDtrack::kTRDin)
1477 ,Bool_t(status & AliESDtrack::kTRDout)
1478 ,Bool_t(status & AliESDtrack::kTRDrefit)
1479 ,Bool_t(status & AliESDtrack::kTRDpid)
1480 ,Bool_t(status & AliESDtrack::kTRDStop)
1481 ,Bool_t(status & AliESDtrack::kHMPIDout)
1482 ,Bool_t(status & AliESDtrack::kHMPIDpid)
1483 );
1484}
1485
1486//____________________________________________________________________
1487TH1F* AliTRDcheckESD::Proj2D(TH2F* hist) {
1488 //
1489 // project the PH vs Slice 2D-histo into a 1D histo
1490 //
1491 TH1F* hProjection = new TH1F("hProjection","", hist->GetXaxis()->GetNbins(),
1492 hist->GetXaxis()->GetXmin(), hist->GetXaxis()->GetXmax());
1493 TF1* fitLandau = new TF1("landauFunc","landau",0.,2000.);
1494 TH1D *hD;
1495 for(Int_t iBin=1;iBin<=hist->GetXaxis()->GetNbins();iBin++) {
1496 if(gROOT->FindObject("projection"))
1497 delete gROOT->FindObject("projection");
1498 hD = (TH1D*)hist->ProjectionY("projection",iBin,iBin);
2bf6d80c 1499 hD->Rebin(4);
1500 if(hD->Integral()>10) {
fb65de21 1501 fitLandau->SetParameter(1, hD->GetBinCenter(hD->GetMaximumBin()));
2bf6d80c 1502 fitLandau->SetParLimits(1, 10., 1000.);
1503 fitLandau->SetParameter(0, 1000.);
1504 fitLandau->SetParLimits(0, 1., 1000000.);
1505 fitLandau->SetParameter(2, 200.);
1506 fitLandau->SetParLimits(2, 10., 1000.);
1507 hD->Fit(fitLandau, "Q0", "", 0., 2.0*hD->GetBinCenter(hD->GetMaximumBin()));
fb65de21 1508 hProjection->SetBinContent(iBin, fitLandau->GetParameter(1));
1509 hProjection->SetBinError(iBin, fitLandau->GetParError(1));
1510 }
1511 else{
1512 hProjection->SetBinContent(iBin, 0);
1513 hProjection->SetBinError(iBin, 0);
1514 }
1515 }
1516 return hProjection;
1517}
1518
1519//____________________________________________________________________
1520TH2F* AliTRDcheckESD::Proj3D(TH3F* hist, TH2F* accMap, Int_t zbinLow, Int_t zbinHigh, Float_t &entries) {
1521 //
1522 // Project a 3D histogram to a 2D histogram in the Z axis interval [zbinLow,zbinHigh]
1523 // Return the 2D histogram and also the number of entries into this projection (entries)
1524
1525 Int_t nBinsX = hist->GetXaxis()->GetNbins(); // X and Y axis bins are assumed to be all equal
1526 Float_t minX = hist->GetXaxis()->GetXmin();
1527 Float_t maxX = hist->GetXaxis()->GetXmax();
1528 Int_t nBinsY = hist->GetYaxis()->GetNbins();
1529 Float_t minY = hist->GetYaxis()->GetXmin();
1530 Float_t maxY = hist->GetYaxis()->GetXmax();
1531 Int_t nBinsZ = hist->GetZaxis()->GetNbins(); // Z axis bins (pt) might have different widths
1532 //Float_t minZ = hist->GetZaxis()->GetXmin();
1533 //Float_t maxZ = hist->GetZaxis()->GetXmax();
1534
1535 TH2F* projHisto = (TH2F*)gROOT->FindObject("projHisto");
1536 if(projHisto)
1537 projHisto->Reset();
1538 else
1539 projHisto = new TH2F("projHisto", "projection", nBinsX, minX, maxX, nBinsY, minY, maxY);
1540
1541 const Double_t kMinAccFraction = 0.1;
1542 entries = 0.0;
1543 Double_t maxAcc = (accMap ? accMap->GetMaximum() : -1);
1544
1545 for(Int_t iZ=1; iZ<=nBinsZ; iZ++) {
1546 if(iZ<zbinLow) continue;
1547 if(iZ>zbinHigh) continue;
1548 for(Int_t iX=1; iX<=nBinsX; iX++) {
1549 for(Int_t iY=1; iY<=nBinsY; iY++) {
1550 if(accMap && maxAcc>0) {
1551 if(accMap->GetBinContent(iX,iY)/maxAcc>kMinAccFraction)
1552 projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ));
1553 }
1554 else // no acc. cut
1555 projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ));
1556 // count only the entries which are inside the acceptance map
1557 if(accMap && maxAcc>0) {
2bf6d80c 1558 if(accMap->GetBinContent(iX,iY)>0.0)
1559 entries+=hist->GetBinContent(iX,iY,iZ);
fb65de21 1560 }
1561 else // no acc. cut
1562 entries+=hist->GetBinContent(iX,iY,iZ);
1563 }
1564 }
1565 }
1566 return projHisto;
1567}
1568//____________________________________________________________________
2bf6d80c 1569TH1F* AliTRDcheckESD::EfficiencyTRD(TH3F* tpc3D, TH3F* trd3D, Bool_t useAcceptance) {
fb65de21 1570 //
1571 // Calculate the TRD-TPC matching efficiency as function of pt
1572 //
2bf6d80c 1573
3fb80f44 1574 if(!tpc3D || !trd3D) return NULL;
1575
fb65de21 1576 Int_t nBinsZ = trd3D->GetZaxis()->GetNbins();
1577 // project everything on the eta-phi map to obtain an acceptance map (make sure there is enough statistics)
1578 Float_t nada = 0.;
2bf6d80c 1579 TH2F *trdAcc = (useAcceptance ? (TH2F*)Proj3D(trd3D, 0x0, 1, nBinsZ, nada)->Clone(): 0x0);
fb65de21 1580 // get the bin limits from the Z axis of 3D histos
1581 Float_t *ptBinLimits = new Float_t[nBinsZ+1];
1582 for(Int_t i=1; i<=nBinsZ; i++) {
1583 ptBinLimits[i-1] = trd3D->GetZaxis()->GetBinLowEdge(i);
1584 }
1585 ptBinLimits[nBinsZ] = trd3D->GetZaxis()->GetBinUpEdge(nBinsZ);
1586 TH1F *efficiency = new TH1F("eff", "TRD-TPC matching efficiency", nBinsZ, ptBinLimits);
1587 // loop over Z bins
1588 for(Int_t i=1; i<=nBinsZ; i++) {
1589 Float_t tpcEntries = 0.0; Float_t trdEntries = 0.0;
1590 Proj3D(tpc3D, trdAcc, i, i, tpcEntries);
1591 Proj3D(trd3D, trdAcc, i, i, trdEntries);
1592 Float_t ratio = 0;
1593 if(tpcEntries>0) ratio = trdEntries/tpcEntries;
1594 Float_t error = 0;
2bf6d80c 1595 if(tpcEntries>0 && trdEntries>0 && (tpcEntries-trdEntries)>=0.0)
1596 error = TMath::Sqrt(trdEntries*(tpcEntries-trdEntries)/tpcEntries/tpcEntries/tpcEntries);
fb65de21 1597 if(ratio>0.0) {
1598 efficiency->SetBinContent(i,ratio);
1599 efficiency->SetBinError(i,error);
1600 }
1601 } // end loop over Z bins
1602
fb65de21 1603 return efficiency;
1604}
2bf6d80c 1605
1606
1607//_________________________________________________________________
1608void AliTRDcheckESD::PlotCentSummary() {
1609
1610 TLatex* lat=new TLatex();
1611 lat->SetTextSize(0.06);
1612 lat->SetTextColor(2);
1613
1614 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);
1615 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);
1616 gPad->Divide(3,3,0.,0.);
1617 TList* l=gPad->GetListOfPrimitives();
1618 TVirtualPad* pad=0x0;
1619
6475ec36 1620 TH3F *h3(NULL), *h3p(NULL), *h3n(NULL);
2bf6d80c 1621 Int_t padsForEffs[5] = {0,3,6,1,4};
1622 for(Int_t iCent=1; iCent<6; ++iCent) {
1623 // TPC-TRD matching efficiencies
1624 pad = ((TVirtualPad*)l->At(padsForEffs[iCent-1])); pad->cd();
1625 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);
1626 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
1627 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
6475ec36 1628 //
1629 if(!(h3p = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+iCent)))) continue;
1630 if(!(h3n = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+iCent)))) continue;
1631 // =============================================
1632 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+iCent)))) continue;
1633 TH1F* hFeffP = EfficiencyTRD(h3p, h3, kTRUE);
1634 //
1635 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+iCent)))) continue;
1636 TH1F* hFeffN = EfficiencyTRD(h3n, h3, kTRUE);
1637 // =============================================
1638 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos4+iCent)))) continue;
1639 TH1F* hFeffP4 = EfficiencyTRD(h3p, h3, kTRUE);
1640 //
1641 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg4+iCent)))) continue;
1642 TH1F* hFeffN4 = EfficiencyTRD(h3n, h3, kTRUE);
1643 // =============================================
1644 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos5+iCent)))) continue;
1645 TH1F* hFeffP5 = EfficiencyTRD(h3p, h3, kTRUE);
1646 //
1647 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg5+iCent)))) continue;
1648 TH1F* hFeffN5 = EfficiencyTRD(h3n, h3, kTRUE);
1649 // =============================================
1650 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos6+iCent)))) continue;
1651 TH1F* hFeffP6 = EfficiencyTRD(h3p, h3, kTRUE);
1652 //
1653 if(!(h3 = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg6+iCent)))) continue;
1654 TH1F* hFeffN6 = EfficiencyTRD(h3n, h3, kTRUE);
2bf6d80c 1655
1656 TH2F* h2F=new TH2F("rangeEffPt", "",10,0.,10.,10,0.,1.3);
1657 h2F->SetStats(kFALSE);
1658 h2F->GetXaxis()->SetTitle("p_{T} [GeV/c]");
1659 h2F->GetXaxis()->SetTitleOffset(0.8);
1660 h2F->GetXaxis()->SetTitleSize(0.07);
1661 h2F->GetXaxis()->CenterTitle();
1662 h2F->GetXaxis()->SetLabelSize(0.05);
1663 h2F->GetYaxis()->SetTitle("TRD-TPC matching efficiency");
1664 h2F->GetYaxis()->SetTitleOffset(0.8);
1665 h2F->GetYaxis()->SetTitleSize(0.07);
1666 h2F->GetYaxis()->SetLabelSize(0.05);
1667 h2F->GetYaxis()->CenterTitle();
1668 h2F->Draw();
1669 TLine line;
1670 line.SetLineStyle(2);
1671 line.SetLineWidth(2);
1672 line.DrawLine(h2F->GetXaxis()->GetXmin(), 0.7, h2F->GetXaxis()->GetXmax(), 0.7);
1673 line.DrawLine(h2F->GetXaxis()->GetXmin(), 0.9, h2F->GetXaxis()->GetXmax(), 0.9);
1674 line.SetLineStyle(1);
1675 line.SetLineWidth(1);
1676 line.DrawLine(h2F->GetXaxis()->GetXmin(), 1.0, h2F->GetXaxis()->GetXmax(), 1.0);
1677 hFeffP->SetMarkerStyle(24);
1678 hFeffP->SetMarkerColor(2);
1679 hFeffP->SetLineColor(2);
1680 hFeffP4->SetMarkerStyle(25);
1681 hFeffP4->SetMarkerColor(2);
1682 hFeffP4->SetLineColor(2);
1683 hFeffP5->SetMarkerStyle(26);
1684 hFeffP5->SetMarkerColor(2);
1685 hFeffP5->SetLineColor(2);
1686 hFeffP6->SetMarkerStyle(27);
1687 hFeffP6->SetMarkerColor(2);
1688 hFeffP6->SetLineColor(2);
1689 hFeffN->SetMarkerStyle(24);
1690 hFeffN->SetMarkerColor(4);
1691 hFeffN->SetLineColor(4);
1692 hFeffN4->SetMarkerStyle(25);
1693 hFeffN4->SetMarkerColor(4);
1694 hFeffN4->SetLineColor(4);
1695 hFeffN5->SetMarkerStyle(26);
1696 hFeffN5->SetMarkerColor(4);
1697 hFeffN5->SetLineColor(4);
1698 hFeffN6->SetMarkerStyle(27);
1699 hFeffN6->SetMarkerColor(4);
1700 hFeffN6->SetLineColor(4);
1701 hFeffP->Draw("same");
1702 hFeffN->Draw("same");
1703 hFeffP4->Draw("same");
1704 hFeffN4->Draw("same");
1705 hFeffP5->Draw("same");
1706 hFeffN5->Draw("same");
1707 hFeffP6->Draw("same");
1708 hFeffN6->Draw("same");
1709
1710 TLegend* leg=new TLegend(0.65, 0.18, 0.95, 0.5);
1711 leg->SetFillColor(0);
1712 leg->AddEntry(hFeffP, "positives (#geq 1 tracklet)", "p");
1713 leg->AddEntry(hFeffN, "negatives (#geq 1 tracklet)", "p");
1714 leg->AddEntry(hFeffP4, "positives (4 tracklets)", "p");
1715 leg->AddEntry(hFeffN4, "negatives (4 tracklets)", "p");
1716 leg->AddEntry(hFeffP5, "positives (5 tracklets)", "p");
1717 leg->AddEntry(hFeffN5, "negatives (5 tracklets)", "p");
1718 leg->AddEntry(hFeffP6, "positives (6 tracklets)", "p");
1719 leg->AddEntry(hFeffN6, "negatives (6 tracklets)", "p");
1720
1721 leg->Draw();
1722 lat->DrawLatex(0.25, 1.2, Form("Centrality class %d", iCent));
1723 }
1724
1725 // TPC-TRD matching efficiencies
1726 pad = ((TVirtualPad*)l->At(2)); pad->cd();
1727 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);
1728 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
1729 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1730
1731 TH2F* h2F[6]; TH1D* proj[6];
1732 TLegend* leg=new TLegend(0.2, 0.7, 0.5, 0.95);
1733 leg->SetFillColor(0);
1734 for(Int_t iCent=0; iCent<6; ++iCent) {
1735 h2F[iCent] = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD+iCent));
1736 proj[iCent] = h2F[iCent]->ProjectionY(Form("projCent%d",iCent));
1737 proj[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);
1738 Double_t maximum = proj[iCent]->GetMaximum();
1739 if(maximum>1.0)
1740 proj[iCent]->Scale(1.0/maximum);
1741 proj[iCent]->GetYaxis()->SetRangeUser(0.0,1.199);
1742 proj[iCent]->SetStats(kFALSE);
1743 proj[iCent]->Draw(iCent==0 ? "" : "same");
1744 leg->AddEntry(proj[iCent], (iCent==0 ? "all centralities" : Form("centrality class %d", iCent)), "l");
1745 }
1746 leg->Draw();
1747
1748 // Qtot vs P
1749 pad = ((TVirtualPad*)l->At(5)); pad->cd();
1750 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);
1751 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
1752 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1753
1754 TH1D* projQ[6];
1755 TLegend* leg2=new TLegend(0.6, 0.7, 0.9, 0.95);
1756 leg2->SetFillColor(0);
1757 for(Int_t iCent=0; iCent<6; ++iCent) {
1758 h2F[iCent] = dynamic_cast<TH2F*>(fHistos->At(kQtotP+iCent));
1759 projQ[iCent] = h2F[iCent]->ProjectionY(Form("projQCent%d",iCent), h2F[iCent]->GetXaxis()->FindBin(1.01), h2F[iCent]->GetXaxis()->FindBin(1.5));
1760 projQ[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2);
1761 Double_t maximum = projQ[iCent]->GetMaximum();
1762 if(maximum>1.0)
1763 projQ[iCent]->Scale(1.0/maximum);
1764 projQ[iCent]->GetYaxis()->SetRangeUser(0.0,1.199);
1765 projQ[iCent]->GetXaxis()->SetRangeUser(0.0,9.999);
1766 projQ[iCent]->SetStats(kFALSE);
1767 projQ[iCent]->Draw(iCent==0 ? "" : "same");
1768 leg2->AddEntry(projQ[iCent], (iCent==0 ? "all centralities" : Form("centrality class %d", iCent)), "l");
1769 }
1770 leg2->Draw();
1771
1772}
1773
1774
1775//_________________________________________________________________
1776void AliTRDcheckESD::PlotTrackingSummary(Int_t centralityClass) {
1777
1778 TLatex *lat=new TLatex();
1779 lat->SetTextSize(0.07);
1780 lat->SetTextColor(2);
1781 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);
1782 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);
1783 gPad->Divide(3,3,0.,0.);
1784 TList* l=gPad->GetListOfPrimitives();
1785 // eta-phi distr. for positive TPC tracks
1786 TVirtualPad* pad = ((TVirtualPad*)l->At(0)); pad->cd();
1787 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1788 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1789 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1790 TH3F* h3F = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass));
1791 Float_t nada=0.0;
1792 TH2F* h2FtpcP = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();
1793 h2FtpcP->SetStats(kFALSE);
1794 h2FtpcP->GetXaxis()->SetTitle("#eta");
1795 h2FtpcP->GetXaxis()->CenterTitle();
1796 h2FtpcP->GetXaxis()->SetTitleSize(0.07);
1797 h2FtpcP->GetXaxis()->SetTitleOffset(0.8);
1798 h2FtpcP->GetXaxis()->SetLabelSize(0.05);
1799 h2FtpcP->GetYaxis()->SetTitle("detector #varphi");
1800 h2FtpcP->GetYaxis()->CenterTitle();
1801 h2FtpcP->GetYaxis()->SetTitleSize(0.07);
1802 h2FtpcP->GetYaxis()->SetTitleOffset(0.8);
1803 h2FtpcP->GetYaxis()->SetLabelSize(0.05);
1804 h2FtpcP->SetTitle("");
1805 h2FtpcP->Draw("colz");
1806 lat->DrawLatex(-0.9, 3.6, "TPC positive ref. tracks");
1807 //-----------------
1808 // eta-phi distr. for negative TPC tracks
1809 pad = ((TVirtualPad*)l->At(1)); pad->cd();
1810 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1811 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1812 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1813 h3F = dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass));
1814 TH2F* h2FtpcN = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();
1815 h2FtpcN->SetStats(kFALSE);
1816 h2FtpcN->GetXaxis()->SetTitle("#eta");
1817 h2FtpcN->GetXaxis()->CenterTitle();
1818 h2FtpcN->GetXaxis()->SetTitleSize(0.07);
1819 h2FtpcN->GetXaxis()->SetTitleOffset(0.8);
1820 h2FtpcN->GetXaxis()->SetLabelSize(0.05);
1821 h2FtpcN->GetYaxis()->SetTitle("detector #varphi");
1822 h2FtpcN->GetYaxis()->CenterTitle();
1823 h2FtpcN->GetYaxis()->SetTitleSize(0.07);
1824 h2FtpcN->GetYaxis()->SetTitleOffset(0.8);
1825 h2FtpcN->GetYaxis()->SetLabelSize(0.05);
1826 h2FtpcN->SetTitle("");
1827 h2FtpcN->Draw("colz");
1828 lat->DrawLatex(-0.9, 3.6, "TPC negative ref. tracks");
1829 //----------------------------------------------
1830 // eta-phi distr. for positive TRD tracks
1831 pad = ((TVirtualPad*)l->At(3)); pad->cd();
1832 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1833 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1834 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1835 h3F = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+centralityClass));
1836 TH2F* h2FtrdP = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();
1837 h2FtrdP->SetStats(kFALSE);
1838 h2FtrdP->GetXaxis()->SetTitle("#eta");
1839 h2FtrdP->GetXaxis()->CenterTitle();
1840 h2FtrdP->GetXaxis()->SetTitleSize(0.07);
1841 h2FtrdP->GetXaxis()->SetTitleOffset(0.8);
1842 h2FtrdP->GetXaxis()->SetLabelSize(0.05);
1843 h2FtrdP->GetYaxis()->SetTitle("detector #varphi");
1844 h2FtrdP->GetYaxis()->CenterTitle();
1845 h2FtrdP->GetYaxis()->SetTitleSize(0.07);
1846 h2FtrdP->GetYaxis()->SetTitleOffset(0.8);
1847 h2FtrdP->GetYaxis()->SetLabelSize(0.05);
1848 h2FtrdP->SetMaximum(h2FtpcP->GetMaximum());
1849 h2FtrdP->SetTitle("");
1850 h2FtrdP->Draw("colz");
1851 lat->DrawLatex(-0.9, 3.6, "TRD positive ref. tracks");
1852 //--------------------------------------------
1853 // eta-phi distr. for negative TRD tracks
1854 pad = ((TVirtualPad*)l->At(4)); pad->cd();
1855 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1856 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1857 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1858 h3F = dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+centralityClass));
1859 TH2F* h2FtrdN = (TH2F*)Proj3D((TH3F*)h3F, 0x0, 1, h3F->GetZaxis()->GetNbins(), nada)->Clone();
1860 h2FtrdN->SetStats(kFALSE);
1861 h2FtrdN->GetXaxis()->SetTitle("#eta");
1862 h2FtrdN->GetXaxis()->CenterTitle();
1863 h2FtrdN->GetXaxis()->SetTitleSize(0.07);
1864 h2FtrdN->GetXaxis()->SetTitleOffset(0.8);
1865 h2FtrdN->GetXaxis()->SetLabelSize(0.05);
1866 h2FtrdN->GetYaxis()->SetTitle("detector #varphi");
1867 h2FtrdN->GetYaxis()->CenterTitle();
1868 h2FtrdN->GetYaxis()->SetTitleSize(0.07);
1869 h2FtrdN->GetYaxis()->SetTitleOffset(0.8);
1870 h2FtrdN->GetYaxis()->SetLabelSize(0.05);
1871 h2FtrdN->SetMaximum(h2FtpcN->GetMaximum());
1872 h2FtrdN->SetTitle("");
1873 h2FtrdN->Draw("colz");
1874 lat->DrawLatex(-0.9, 3.6, "TRD negative ref. tracks");
1875 //----------------------------------------------
1876 // eta-phi efficiency for positive TRD tracks
1877 pad = ((TVirtualPad*)l->At(6)); pad->cd();
1878 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1879 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1880 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1881 TH2F* h2Feff = (TH2F*)h2FtrdP->Clone();
1882 h2Feff->Reset();
1883 h2Feff->SetStats(kFALSE);
1884 h2Feff->Divide(h2FtrdP, h2FtpcP);
1885 h2Feff->GetXaxis()->SetTitle("#eta");
1886 h2Feff->GetXaxis()->CenterTitle();
1887 h2Feff->GetXaxis()->SetTitleSize(0.07);
1888 h2Feff->GetXaxis()->SetTitleOffset(0.8);
1889 h2Feff->GetXaxis()->SetLabelSize(0.05);
1890 h2Feff->GetYaxis()->SetTitle("detector #varphi");
1891 h2Feff->GetYaxis()->CenterTitle();
1892 h2Feff->GetYaxis()->SetTitleSize(0.07);
1893 h2Feff->GetYaxis()->SetTitleOffset(0.8);
1894 h2Feff->GetYaxis()->SetLabelSize(0.05);
1895 h2Feff->SetMaximum(1.0);
1896 h2Feff->SetTitle("");
1897 h2Feff->Draw("colz");
1898 lat->DrawLatex(-0.9, 3.6, "Efficiency positive tracks");
1899 //-------------------------------------------------
1900 // eta-phi efficiency for negative TRD tracks
1901 pad = ((TVirtualPad*)l->At(7)); pad->cd();
1902 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1903 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1904 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1905 h2Feff = (TH2F*)h2FtrdN->Clone();
1906 h2Feff->Reset();
1907 h2Feff->SetStats(kFALSE);
1908 h2Feff->Divide(h2FtrdN, h2FtpcN);
1909 h2Feff->GetXaxis()->SetTitle("#eta");
1910 h2Feff->GetXaxis()->CenterTitle();
1911 h2Feff->GetXaxis()->SetTitleSize(0.07);
1912 h2Feff->GetXaxis()->SetTitleOffset(0.8);
1913 h2Feff->GetXaxis()->SetLabelSize(0.05);
1914 h2Feff->GetYaxis()->SetTitle("detector #varphi");
1915 h2Feff->GetYaxis()->CenterTitle();
1916 h2Feff->GetYaxis()->SetTitleSize(0.07);
1917 h2Feff->GetYaxis()->SetTitleOffset(0.8);
1918 h2Feff->GetYaxis()->SetLabelSize(0.05);
1919 h2Feff->SetMaximum(1.0);
1920 h2Feff->SetTitle("");
1921 h2Feff->Draw("colz");
1922 lat->DrawLatex(-0.9, 3.6, "Efficiency negative tracks");
1923 //-----------------------------------------------------
1924 // <ntracklets> vs (phi,eta)
1925 pad = ((TVirtualPad*)l->At(2)); pad->cd();
1926 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
1927 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
1928 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1929 TProfile2D* hProf2D;
1930 if((hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvNtrkl+centralityClass)))) {
1931 hProf2D->SetStats(kFALSE);
1932 hProf2D->SetTitle("");
1933 hProf2D->GetXaxis()->SetTitle("#eta");
1934 hProf2D->GetXaxis()->SetTitleOffset(0.8);
1935 hProf2D->GetXaxis()->SetTitleSize(0.07);
1936 hProf2D->GetXaxis()->CenterTitle();
1937 hProf2D->GetXaxis()->SetLabelSize(0.05);
1938 hProf2D->GetYaxis()->SetTitle("detector #varphi");
1939 hProf2D->GetYaxis()->SetTitleOffset(0.8);
1940 hProf2D->GetYaxis()->SetTitleSize(0.07);
1941 hProf2D->GetYaxis()->SetLabelSize(0.05);
1942 hProf2D->GetYaxis()->CenterTitle();
1943 hProf2D->SetMinimum(0.);
1944 hProf2D->SetMaximum(6.);
1945 hProf2D->Draw("colz");
1946 lat->DrawLatex(-0.9, 3.6, "TRD <N_{tracklets}>");
1947 }
1948 //---------------------------------------------------------
1949 // TPC-TRD matching efficiency vs pt
1950 pad = ((TVirtualPad*)l->At(5)); pad->cd();
1951 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02);
1952 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
1953 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
1954 TH1F* hFeffP = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),
3fb80f44 1955 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos+centralityClass)), kTRUE);
2bf6d80c 1956 TH1F* hFeffN = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),
3fb80f44 1957 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg+centralityClass)), kTRUE);
2bf6d80c 1958 TH1F* hFeffP4 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),
3fb80f44 1959 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos4+centralityClass)), kTRUE);
2bf6d80c 1960 TH1F* hFeffN4 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),
3fb80f44 1961 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg4+centralityClass)), kTRUE);
2bf6d80c 1962 TH1F* hFeffP5 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),
3fb80f44 1963 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos5+centralityClass)), kTRUE);
2bf6d80c 1964 TH1F* hFeffN5 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),
3fb80f44 1965 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg5+centralityClass)), kTRUE);
2bf6d80c 1966 TH1F* hFeffP6 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksPos+centralityClass)),
3fb80f44 1967 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksPos6+centralityClass)), kTRUE);
2bf6d80c 1968 TH1F* hFeffN6 = EfficiencyTRD(dynamic_cast<TH3F*>(fHistos->At(kTPCRefTracksNeg+centralityClass)),
3fb80f44 1969 dynamic_cast<TH3F*>(fHistos->At(kTRDRefTracksNeg6+centralityClass)), kTRUE);
2bf6d80c 1970
1971 TH2F* h2F=new TH2F("rangeEffPt", "",10,0.,10.,10,0.,1.3);
1972 h2F->SetStats(kFALSE);
1973 h2F->GetXaxis()->SetTitle("p_{T} [GeV/c]");
1974 h2F->GetXaxis()->SetTitleOffset(0.8);
1975 h2F->GetXaxis()->SetTitleSize(0.07);
1976 h2F->GetXaxis()->CenterTitle();
1977 h2F->GetXaxis()->SetLabelSize(0.05);
1978 h2F->GetYaxis()->SetTitle("TRD-TPC matching efficiency");
1979 h2F->GetYaxis()->SetTitleOffset(0.8);
1980 h2F->GetYaxis()->SetTitleSize(0.07);
1981 h2F->GetYaxis()->SetLabelSize(0.05);
1982 h2F->GetYaxis()->CenterTitle();
1983 h2F->Draw();
3fb80f44 1984 //++++++++++++++++++
2bf6d80c 1985 TLine line;
1986 line.SetLineStyle(2);
1987 line.SetLineWidth(2);
1988 line.DrawLine(h2F->GetXaxis()->GetXmin(), 0.7, h2F->GetXaxis()->GetXmax(), 0.7);
1989 line.DrawLine(h2F->GetXaxis()->GetXmin(), 0.9, h2F->GetXaxis()->GetXmax(), 0.9);
1990 line.SetLineStyle(1);
1991 line.SetLineWidth(1);
1992 line.DrawLine(h2F->GetXaxis()->GetXmin(), 1.0, h2F->GetXaxis()->GetXmax(), 1.0);
2bf6d80c 1993 TLegend* leg=new TLegend(0.65, 0.18, 0.95, 0.5);
1994 leg->SetFillColor(0);
3fb80f44 1995 if(hFeffP){
1996 hFeffP->SetMarkerStyle(24);
1997 hFeffP->SetMarkerColor(2);
1998 hFeffP->SetLineColor(2);
1999 hFeffP->Draw("same"); leg->AddEntry(hFeffP, "positives (#geq 1 tracklet)", "p");
2000 }
2001 if(hFeffP4){
2002 hFeffP4->SetMarkerStyle(25);
2003 hFeffP4->SetMarkerColor(2);
2004 hFeffP4->SetLineColor(2);
2005 hFeffP4->Draw("same"); leg->AddEntry(hFeffP4, "positives (4 tracklets)", "p");
2006 }
2007 if(hFeffP5){
2008 hFeffP5->SetMarkerStyle(26);
2009 hFeffP5->SetMarkerColor(2);
2010 hFeffP5->SetLineColor(2);
2011 hFeffP5->Draw("same"); leg->AddEntry(hFeffP5, "positives (5 tracklets)", "p");
2012 }
2013 if(hFeffP6){
2014 hFeffP6->SetMarkerStyle(27);
2015 hFeffP6->SetMarkerColor(2);
2016 hFeffP6->SetLineColor(2);
2017 hFeffP6->Draw("same"); leg->AddEntry(hFeffP6, "positives (6 tracklets)", "p");
2018 }
2019 if(hFeffN){
2020 hFeffN->SetMarkerStyle(24);
2021 hFeffN->SetMarkerColor(4);
2022 hFeffN->SetLineColor(4);
2023 hFeffN->Draw("same"); leg->AddEntry(hFeffN, "negatives (#geq 1 tracklet)", "p");
2024 }
2025 if(hFeffN4){
2026 hFeffN4->SetMarkerStyle(25);
2027 hFeffN4->SetMarkerColor(4);
2028 hFeffN4->SetLineColor(4);
2029 hFeffN4->Draw("same"); leg->AddEntry(hFeffN4, "negatives (4 tracklets)", "p");
2030 }
2031 if(hFeffN5){
2032 hFeffN5->SetMarkerStyle(26);
2033 hFeffN5->SetMarkerColor(4);
2034 hFeffN5->SetLineColor(4);
2035 hFeffN5->Draw("same"); leg->AddEntry(hFeffN5, "negatives (5 tracklets)", "p");
2036 }
2037 if(hFeffN6){
2038 hFeffN6->SetMarkerStyle(27);
2039 hFeffN6->SetMarkerColor(4);
2040 hFeffN6->SetLineColor(4);
2041 hFeffN6->Draw("same"); leg->AddEntry(hFeffN6, "negatives (6 tracklets)", "p");
2042 }
2bf6d80c 2043 leg->Draw();
2044
2045 //--------------------------------------------------------------
2046 // Nclusters per TRD track
2047 pad = ((TVirtualPad*)l->At(8)); pad->cd();
2048 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.12);
2049 pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15);
2050 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
2051 pad->SetLogz();
2052 if((h2F = dynamic_cast<TH2F*>(fHistos->At(kNClsTrackTRD+centralityClass)))) {
2053 h2F->SetStats(kFALSE);
2054 h2F->SetTitle("");
2055 h2F->GetYaxis()->SetRangeUser(0.0, 199.);
2056 h2F->GetXaxis()->SetTitle("p [GeV/c]");
2057 h2F->GetXaxis()->SetTitleOffset(0.8);
2058 h2F->GetXaxis()->SetTitleSize(0.07);
2059 h2F->GetXaxis()->CenterTitle();
2060 h2F->GetXaxis()->SetLabelSize(0.05);
2061 h2F->GetYaxis()->SetTitle("#clusters per TRD track");
2062 h2F->GetYaxis()->SetTitleOffset(0.8);
2063 h2F->GetYaxis()->SetTitleSize(0.07);
2064 h2F->GetYaxis()->CenterTitle();
2065 h2F->GetYaxis()->SetLabelSize(0.05);
2066 h2F->Draw("colz");
2067 }
2068}
2069
2070
2071//_________________________________________________________________
2072void AliTRDcheckESD::PlotPidSummary(Int_t centralityClass) {
2073
2074 TLatex *lat=new TLatex();
2075 lat->SetTextSize(0.07);
2076 lat->SetTextColor(2);
2077 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001);
2078 gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001);
2079 gPad->Divide(3,3,0.,0.);
2080 TList* l=gPad->GetListOfPrimitives();
2081 // eta-phi distr. for <Qtot> in layer 0
2082 TVirtualPad* pad;
2083 TProfile2D* hProf2D;
2084 for(Int_t iLayer=0; iLayer<6; ++iLayer) {
2085 pad = ((TVirtualPad*)l->At((iLayer<3 ? iLayer*3 : (iLayer-3)*3+1))); pad->cd();
2086 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
2087 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
2088 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
2089 if(!(hProf2D = dynamic_cast<TProfile2D*>(fHistos->At(kTRDEtaPhiAvQtot+6*centralityClass+iLayer)))) break;
2090 hProf2D->SetStats(kFALSE);
2091 hProf2D->SetTitle("");
2092 hProf2D->GetXaxis()->SetTitle("#eta");
2093 hProf2D->GetXaxis()->SetTitleOffset(0.8);
2094 hProf2D->GetXaxis()->SetTitleSize(0.07);
2095 hProf2D->GetXaxis()->CenterTitle();
2096 hProf2D->GetXaxis()->SetLabelSize(0.05);
2097 hProf2D->GetYaxis()->SetTitle("detector #varphi");
2098 hProf2D->GetYaxis()->SetTitleOffset(0.8);
2099 hProf2D->GetYaxis()->SetTitleSize(0.07);
2100 hProf2D->GetYaxis()->SetLabelSize(0.05);
2101 hProf2D->GetYaxis()->CenterTitle();
2102 hProf2D->SetMinimum(0.);
2103 hProf2D->SetMaximum(10.);
2104 hProf2D->Draw("colz");
2105 lat->DrawLatex(-0.9, 3.6, Form("TRD <Q_{tot}> Layer %d", iLayer));
2106 }
2107
2108 // PH versus slice number
2109 pad = ((TVirtualPad*)l->At(2)); pad->cd();
2110 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
2111 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
2112 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
2113 TH2F* h2F;
2114 TH1F* hF;
2115 if((h2F = dynamic_cast<TH2F*>(fHistos->At(kPHSlice+centralityClass)))) {
2116 hF = Proj2D((TH2F*)h2F);
2117 h2F->SetStats(kFALSE);
2118 h2F->SetTitle("");
2119 h2F->GetXaxis()->SetTitle("slice");
2120 h2F->GetXaxis()->SetTitleOffset(0.8);
2121 h2F->GetXaxis()->SetTitleSize(0.07);
2122 h2F->GetXaxis()->CenterTitle();
2123 h2F->GetXaxis()->SetLabelSize(0.05);
2124 h2F->GetYaxis()->SetTitle("PH");
2125 h2F->GetYaxis()->SetTitleOffset(0.8);
2126 h2F->GetYaxis()->SetTitleSize(0.07);
2127 h2F->GetYaxis()->SetLabelSize(0.05);
2128 h2F->GetYaxis()->CenterTitle();
2129 h2F->Draw("colz");
2130 hF->SetLineWidth(2);
2131 hF->Draw("same");
2132 }
2133
2134 // Qtot vs P
2135 pad = ((TVirtualPad*)l->At(5)); pad->cd();
2136 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
2137 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
2138 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
2139 pad->SetLogz();
2140 if((h2F = dynamic_cast<TH2F*>(fHistos->At(kQtotP+centralityClass)))) {
2141 h2F->SetStats(kFALSE);
2142 h2F->SetTitle("");
2143 h2F->GetXaxis()->SetTitle("P [GeV/c]");
2144 h2F->GetXaxis()->SetTitleOffset(0.8);
2145 h2F->GetXaxis()->SetTitleSize(0.07);
2146 h2F->GetXaxis()->CenterTitle();
2147 h2F->GetXaxis()->SetLabelSize(0.05);
2148 h2F->GetYaxis()->SetRangeUser(0.0,100.0);
2149 h2F->GetYaxis()->SetTitle("Q_{tot}");
2150 h2F->GetYaxis()->SetTitleOffset(0.8);
2151 h2F->GetYaxis()->SetTitleSize(0.07);
2152 h2F->GetYaxis()->SetLabelSize(0.05);
2153 h2F->GetYaxis()->CenterTitle();
2154 h2F->GetYaxis()->SetRangeUser(0.0,20.0);
2155 h2F->Draw("colz");
2156 }
2157
2158 // PH versus slice number for TPC pions and electrons
2159 /*
2160 pad = ((TVirtualPad*)l->At(8)); pad->cd();
2161 pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1);
2162 pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15);
2163 pad->SetGridx(kFALSE); pad->SetGridy(kFALSE);
2164 TH2F* h2FtrdP;
2165 TH2F* h2FtrdN;
2166 TH1F* hFeffP;
2167 TH1F* hFeffN;
2168 if((h2FtrdP = dynamic_cast<TH2F*>(fHistos->At(kPHSliceTPCpions+centralityClass-1))) &&
2169 (h2FtrdN = dynamic_cast<TH2F*>(fHistos->At(kPHSliceTPCelectrons+centralityClass-1)))) {
2170 hFeffP = Proj2D((TH2F*)h2FtrdP);
2171 hFeffN = Proj2D((TH2F*)h2FtrdN);
2172 h2F = new TH2F("PHvsSlice","",10,h2FtrdN->GetXaxis()->GetXmin(),h2FtrdN->GetXaxis()->GetXmax(),
2173 10,h2FtrdN->GetYaxis()->GetXmin(),h2FtrdN->GetYaxis()->GetXmax());
2174 h2F->SetStats(kFALSE);
2175 h2F->SetTitle("");
2176 h2F->GetXaxis()->SetTitle("slice");
2177 h2F->GetXaxis()->SetTitleOffset(0.8);
2178 h2F->GetXaxis()->SetTitleSize(0.07);
2179 h2F->GetXaxis()->CenterTitle();
2180 h2F->GetXaxis()->SetLabelSize(0.05);
2181 h2F->GetYaxis()->SetTitle("PH");
2182 h2F->GetYaxis()->SetTitleOffset(0.8);
2183 h2F->GetYaxis()->SetTitleSize(0.07);
2184 h2F->GetYaxis()->SetLabelSize(0.05);
2185 h2F->GetYaxis()->CenterTitle();
2186 h2F->Draw();
2187 hFeffN->SetLineWidth(2);
2188 hFeffN->SetLineColor(2);
2189 hFeffP->SetLineWidth(2);
2190 hFeffP->SetLineColor(4);
2191 hFeffN->Draw("same");
2192 hFeffP->Draw("same");
2193 TLegend* leg=new TLegend(0.65, 0.8, 0.95, 0.95);
2194 leg->SetFillColor(0);
2195 leg->AddEntry(hFeffP, "TPC pions", "l");
2196 leg->AddEntry(hFeffN, "TPC electrons", "l");
2197 leg->Draw();
2198 }
2199 */
2200}