]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/qaRec/AliTRDcheckDetector.cxx
update for non null magnetic field
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDcheckDetector.cxx
CommitLineData
2cdfacc5 1#include <TAxis.h>
2#include <TCanvas.h>
95cda7cf 3#include <TFile.h>
23abf4db 4#include <TH1F.h>
2cdfacc5 5#include <TGaxis.h>
abc70aaf 6#include <TGraph.h>
fc8b1a37 7#include <TLegend.h>
23abf4db 8#include <TMath.h>
2a4a428a 9#include <TMap.h>
23abf4db 10#include <TObjArray.h>
2a4a428a 11#include <TObject.h>
12#include <TObjString.h>
fc8b1a37 13
2cdfacc5 14#include <TPad.h>
23abf4db 15#include <TProfile.h>
9e548ae7 16#include <TProfile2D.h>
95cda7cf 17#include <TROOT.h>
23abf4db 18
107fde80 19#include "AliLog.h"
23abf4db 20#include "AliTRDcluster.h"
a24151d1 21#include "AliESDHeader.h"
22#include "AliESDRun.h"
3cfaffa4 23#include "AliESDtrack.h"
2374fb85 24#include "AliTRDgeometry.h"
3cfaffa4 25#include "AliTRDpadPlane.h"
2cdfacc5 26#include "AliTRDSimParam.h"
23abf4db 27#include "AliTRDseedV1.h"
28#include "AliTRDtrackV1.h"
3cfaffa4 29#include "AliTRDtrackerV1.h"
30#include "AliTRDReconstructor.h"
4e488f26 31#include "AliTrackReference.h"
3cfaffa4 32#include "AliTrackPointArray.h"
33#include "AliTracker.h"
23abf4db 34#include "TTreeStream.h"
35
36#include "AliTRDtrackInfo/AliTRDtrackInfo.h"
a24151d1 37#include "AliTRDtrackInfo/AliTRDeventInfo.h"
23abf4db 38#include "AliTRDcheckDetector.h"
39
95cda7cf 40#include <cstdio>
56f8e2b1 41#include <iostream>
95cda7cf 42
23abf4db 43////////////////////////////////////////////////////////////////////////////
44// //
45// Reconstruction QA //
46// //
47// Task doing basic checks for tracking and detector performance //
48// //
49// Authors: //
50// Anton Andronic <A.Andronic@gsi.de> //
fc8b1a37 51// Alexandru Bercuci <A.Bercuci@gsi.de> //
23abf4db 52// Markus Fasel <M.Fasel@gsi.de> //
53// //
54////////////////////////////////////////////////////////////////////////////
55
56//_______________________________________________________
57AliTRDcheckDetector::AliTRDcheckDetector():
93e41bce 58 AliTRDrecoTask("DetChecker", "Basic Detector Checker")
a24151d1 59 ,fEventInfo(0x0)
2a4a428a 60 ,fTriggerNames(0x0)
3cfaffa4 61 ,fReconstructor(0x0)
7dc3c50c 62 ,fGeo(0x0)
23abf4db 63{
2b468513 64 //
65 // Default constructor
66 //
a24151d1 67 DefineInput(1,AliTRDeventInfo::Class());
3cfaffa4 68 fReconstructor = new AliTRDReconstructor;
69 fReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
7dc3c50c 70 fGeo = new AliTRDgeometry;
107fde80 71 InitFunctorList();
23abf4db 72}
73
74//_______________________________________________________
75AliTRDcheckDetector::~AliTRDcheckDetector(){
2b468513 76 //
77 // Destructor
78 //
2a4a428a 79 if(fTriggerNames) delete fTriggerNames;
3cfaffa4 80 delete fReconstructor;
7dc3c50c 81 delete fGeo;
23abf4db 82}
83
a24151d1 84//_______________________________________________________
85void AliTRDcheckDetector::ConnectInputData(Option_t *opt){
a391a274 86 //
87 // Connect the Input data with the task
88 //
89 AliTRDrecoTask::ConnectInputData(opt);
90 fEventInfo = dynamic_cast<AliTRDeventInfo *>(GetInputData(1));
a24151d1 91}
92
23abf4db 93//_______________________________________________________
94void AliTRDcheckDetector::CreateOutputObjects(){
2b468513 95 //
96 // Create Output Objects
97 //
2374fb85 98 OpenFile(0,"RECREATE");
107fde80 99 fContainer = Histos();
2374fb85 100 if(!fTriggerNames) fTriggerNames = new TMap();
23abf4db 101}
102
103//_______________________________________________________
107fde80 104void AliTRDcheckDetector::Exec(Option_t *opt){
2b468513 105 //
106 // Execution function
107 // Filling TRD quality histos
108 //
9e548ae7 109 if(!HasMCdata() && fEventInfo->GetEventHeader()->GetEventType() != 7) return; // For real data we select only physical events
107fde80 110 AliTRDrecoTask::Exec(opt);
2b468513 111 Int_t nTracks = 0; // Count the number of tracks per event
a24151d1 112 Int_t triggermask = fEventInfo->GetEventHeader()->GetTriggerMask();
afefec95 113 TString triggername = fEventInfo->GetRunInfo()->GetFiredTriggerClasses(triggermask);
9e548ae7 114 if(fDebugLevel > 6)printf("Trigger cluster: %d, Trigger class: %s\n", triggermask, triggername.Data());
b1957d3c 115 dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger))->Fill(triggermask);
2b468513 116 for(Int_t iti = 0; iti < fTracks->GetEntriesFast(); iti++){
107fde80 117 if(!fTracks->UncheckedAt(iti)) continue;
118 AliTRDtrackInfo *fTrackInfo = dynamic_cast<AliTRDtrackInfo *>(fTracks->UncheckedAt(iti));
119 if(!fTrackInfo->GetTrack()) continue;
2b468513 120 nTracks++;
121 }
959f550d 122 if(nTracks){
b1957d3c 123 dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks))->Fill(triggermask);
124 dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNtracksEvent))->Fill(nTracks);
959f550d 125 }
9e548ae7 126 if(triggermask <= 20 && !fTriggerNames->FindObject(Form("%d", triggermask))){
2a4a428a 127 fTriggerNames->Add(new TObjString(Form("%d", triggermask)), new TObjString(triggername));
9e548ae7 128 // also set the label for both histograms
b1957d3c 129 TH1 *histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTriggerTracks));
9e548ae7 130 histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
b1957d3c 131 histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger));
9e548ae7 132 histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
133 }
2b468513 134 PostData(0, fContainer);
23abf4db 135}
136
137//_______________________________________________________
138void AliTRDcheckDetector::Terminate(Option_t *){
2b468513 139 //
140 // Terminate function
141 //
23abf4db 142}
143
95cda7cf 144//_______________________________________________________
145Bool_t AliTRDcheckDetector::PostProcess(){
a391a274 146 //
147 // Do Postprocessing (for the moment set the number of Reference histograms)
148 //
149
b1957d3c 150 TH1 * h = 0x0;
a391a274 151
b1957d3c 152 // Calculate of the trigger clusters purity
fc8b1a37 153 h = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTrigger"));
154 TH1F *h1 = dynamic_cast<TH1F *>(fContainer->FindObject("hEventsTriggerTracks"));
b1957d3c 155 h1->Divide(h);
a391a274 156 Float_t purities[20], val = 0;
157 TString triggernames[20];
158 Int_t nTriggerClasses = 0;
b1957d3c 159 for(Int_t ibin = 1; ibin <= h->GetNbinsX(); ibin++){
160 if((val = h1->GetBinContent(ibin))){
a391a274 161 purities[nTriggerClasses] = val;
b1957d3c 162 triggernames[nTriggerClasses] = h1->GetXaxis()->GetBinLabel(ibin);
a391a274 163 nTriggerClasses++;
164 }
165 }
b1957d3c 166 h = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kTriggerPurity));
167 TAxis *ax = h->GetXaxis();
168 for(Int_t itrg = 0; itrg < nTriggerClasses; itrg++){
169 h->Fill(itrg, purities[itrg]);
170 ax->SetBinLabel(itrg+1, triggernames[itrg].Data());
171 }
172 ax->SetRangeUser(-0.5, nTriggerClasses+.5);
173 h->GetYaxis()->SetRangeUser(0,1);
174
fc8b1a37 175 fNRefFigures = 14;
b1957d3c 176
a391a274 177 return kTRUE;
95cda7cf 178}
179
180//_______________________________________________________
e15179be 181Bool_t AliTRDcheckDetector::GetRefFigure(Int_t ifig){
a391a274 182 //
183 // Setting Reference Figures
184 //
a391a274 185 switch(ifig){
b1957d3c 186 case kNclustersTrack:
fc8b1a37 187 ((TH1F*)fContainer->FindObject("hNcls"))->Draw("pl");
b1957d3c 188 return kTRUE;
189 case kNclustersTracklet:
fc8b1a37 190 ((TH1F*)fContainer->FindObject("hNclTls"))->Draw("pc");
b1957d3c 191 return kTRUE;
192 case kNtrackletsTrack:
fc8b1a37 193 MakePlotNTracklets();
b1957d3c 194 return kTRUE;
195 case kNtrackletsCross:
fc8b1a37 196 if(!MakeBarPlot((TH1F*)fContainer->FindObject("hNtlsCross"), kRed)) break;
b1957d3c 197 return kTRUE;
198 case kNtrackletsFindable:
2a12b21f 199 if(!MakeBarPlot((TH1F*)fContainer->FindObject("hNtlsFindable"), kGreen)) break;
b1957d3c 200 return kTRUE;
201 case kNtracksEvent:
fc8b1a37 202 ((TH1F*)fContainer->FindObject("hNtrks"))->Draw("pl");
b1957d3c 203 return kTRUE;
204 case kNtracksSector:
fc8b1a37 205 if(!MakeBarPlot((TH1F*)fContainer->FindObject("hNtrksSector"), kGreen)) break;
b1957d3c 206 return kTRUE;
207 case kChi2:
fc8b1a37 208 ((TH1F*)((TObjArray*)fContainer->FindObject("Chi2"))->At(0))->Draw("");
b1957d3c 209 return kTRUE;
210 case kPH:
fc8b1a37 211 MakePlotPulseHeight();
b1957d3c 212 return kTRUE;
213 case kChargeCluster:
fc8b1a37 214 ((TH1F*)fContainer->FindObject("hQcl"))->Draw("c");
b1957d3c 215 return kTRUE;
216 case kChargeTracklet:
fc8b1a37 217 ((TH1F*)fContainer->FindObject("hQtrklt"))->Draw("c");
b1957d3c 218 return kTRUE;
219 case kNeventsTrigger:
fc8b1a37 220 ((TH1F*)fContainer->FindObject("hEventsTrigger"))->Draw("");
b1957d3c 221 return kTRUE;
222 case kNeventsTriggerTracks:
fc8b1a37 223 ((TH1F*)fContainer->FindObject("hEventsTriggerTracks"))->Draw("");
b1957d3c 224 return kTRUE;
225 case kTriggerPurity:
fc8b1a37 226 if(!MakeBarPlot((TH1F*)fContainer->FindObject("hTriggerPurity"), kGreen)) break;
a391a274 227 break;
228 default:
a391a274 229 break;
230 }
b1957d3c 231 AliInfo(Form("Reference plot [%d] missing result", ifig));
232 return kFALSE;
95cda7cf 233}
234
107fde80 235//_______________________________________________________
236TObjArray *AliTRDcheckDetector::Histos(){
237 //
238 // Create QA histograms
239 //
240 if(fContainer) return fContainer;
241
fc8b1a37 242 fContainer = new TObjArray(20);
94f34623 243 //fContainer->SetOwner(kTRUE);
244
107fde80 245 // Register Histograms
b1957d3c 246 TH1 * h = 0x0;
247 if(!(h = (TH1F *)gROOT->FindObject("hNcls"))){
248 h = new TH1F("hNcls", "N_{clusters} / track", 181, -0.5, 180.5);
249 h->GetXaxis()->SetTitle("N_{clusters}");
250 h->GetYaxis()->SetTitle("Entries");
251 } else h->Reset();
252 fContainer->AddAt(h, kNclustersTrack);
253
254 if(!(h = (TH1F *)gROOT->FindObject("hNclTls"))){
255 h = new TH1F("hNclTls","N_{clusters} / tracklet", 51, -0.5, 50.5);
256 h->GetXaxis()->SetTitle("N_{clusters}");
257 h->GetYaxis()->SetTitle("Entries");
258 } else h->Reset();
259 fContainer->AddAt(h, kNclustersTracklet);
260
261 if(!(h = (TH1F *)gROOT->FindObject("hNtls"))){
262 h = new TH1F("hNtls", "N_{tracklets} / track", AliTRDgeometry::kNlayer, 0.5, 6.5);
263 h->GetXaxis()->SetTitle("N^{tracklet}");
264 h->GetYaxis()->SetTitle("freq. [%]");
265 } else h->Reset();
266 fContainer->AddAt(h, kNtrackletsTrack);
267
fc8b1a37 268 if(!(h = (TH1F *)gROOT->FindObject("htlsSTA"))){
269 h = new TH1F("hNtlsSTA", "N_{tracklets} / track (Stand Alone)", AliTRDgeometry::kNlayer, 0.5, 6.5);
270 h->GetXaxis()->SetTitle("N^{tracklet}");
271 h->GetYaxis()->SetTitle("freq. [%]");
272 }
273 fContainer->AddAt(h, kNtrackletsSTA);
274
275 if(!(h = (TH1F *)gROOT->FindObject("htlsBAR"))){
276 h = new TH1F("hNtlsBAR", "N_{tracklets} / track (Barrel)", AliTRDgeometry::kNlayer, 0.5, 6.5);
277 h->GetXaxis()->SetTitle("N^{tracklet}");
278 h->GetYaxis()->SetTitle("freq. [%]");
279 }
280 fContainer->AddAt(h, kNtrackletsBAR);
281
b1957d3c 282 //
283 if(!(h = (TH1F *)gROOT->FindObject("hNtlsCross"))){
284 h = new TH1F("hNtlsCross", "N_{tracklets}^{cross} / track", 7, -0.5, 6.5);
285 h->GetXaxis()->SetTitle("n_{row cross}");
286 h->GetYaxis()->SetTitle("freq. [%]");
287 } else h->Reset();
288 fContainer->AddAt(h, kNtrackletsCross);
289
290 if(!(h = (TH1F *)gROOT->FindObject("hNtlsFindable"))){
291 h = new TH1F("hNtlsFindable", "Found/Findable Tracklets" , 101, -0.005, 1.005);
292 h->GetXaxis()->SetTitle("r [a.u]");
293 h->GetYaxis()->SetTitle("Entries");
294 } else h->Reset();
295 fContainer->AddAt(h, kNtrackletsFindable);
296
297 if(!(h = (TH1F *)gROOT->FindObject("hNtrks"))){
298 h = new TH1F("hNtrks", "N_{tracks} / event", 100, 0, 100);
299 h->GetXaxis()->SetTitle("N_{tracks}");
300 h->GetYaxis()->SetTitle("Entries");
301 } else h->Reset();
302 fContainer->AddAt(h, kNtracksEvent);
303
304 if(!(h = (TH1F *)gROOT->FindObject("hNtrksSector"))){
305 h = new TH1F("hNtrksSector", "N_{tracks} / sector", AliTRDgeometry::kNsector, -0.5, 17.5);
306 h->GetXaxis()->SetTitle("sector");
307 h->GetYaxis()->SetTitle("freq. [%]");
308 } else h->Reset();
309 fContainer->AddAt(h, kNtracksSector);
310
311 // <PH> histos
312 TObjArray *arr = new TObjArray(2);
313 arr->SetOwner(kTRUE); arr->SetName("<PH>");
314 fContainer->AddAt(arr, kPH);
315 if(!(h = (TH1F *)gROOT->FindObject("hPHt"))){
316 h = new TProfile("hPHt", "<PH>", 31, -0.5, 30.5);
317 h->GetXaxis()->SetTitle("Time / 100ns");
318 h->GetYaxis()->SetTitle("<PH> [a.u]");
319 } else h->Reset();
320 arr->AddAt(h, 0);
321 if(!(h = (TH1F *)gROOT->FindObject("hPHx")))
322 h = new TProfile("hPHx", "<PH>", 31, -0.08, 4.88);
323 else h->Reset();
324 arr->AddAt(h, 1);
325
326 // Chi2 histos
327 arr = new TObjArray(2);
328 arr->SetOwner(kTRUE); arr->SetName("Chi2");
329 fContainer->AddAt(arr, kChi2);
330 if(!(h = (TH1F *)gROOT->FindObject("hChi2")))
331 h = new TH1F("hChi2", "#Chi2", 200, 0, 20);
332 else h->Reset();
333 arr->AddAt(h, 0);
334 if(!(h = (TH1F *)gROOT->FindObject("hChi2n")))
335 h = new TH1F("hChi2n", "Norm. Chi2 (tracklets)", 50, 0, 5);
336 else h->Reset();
337 arr->AddAt(h, 1);
338
339
340 if(!(h = (TH1F *)gROOT->FindObject("hQcl"))){
341 h = new TH1F("hQcl", "Q_{cluster}", 200, 0, 1200);
342 h->GetXaxis()->SetTitle("Q_{cluster} [a.u.]");
343 h->GetYaxis()->SetTitle("Entries");
344 }else h->Reset();
345 fContainer->AddAt(h, kChargeCluster);
346
347 if(!(h = (TH1F *)gROOT->FindObject("hQtrklt"))){
348 h = new TH1F("hQtrklt", "Q_{tracklet}", 6000, 0, 6000);
349 h->GetXaxis()->SetTitle("Q_{tracklet} [a.u.]");
350 h->GetYaxis()->SetTitle("Entries");
351 }else h->Reset();
352 fContainer->AddAt(h, kChargeTracklet);
353
354
355 if(!(h = (TH1F *)gROOT->FindObject("hEventsTrigger")))
356 h = new TH1F("hEventsTrigger", "Trigger Class", 100, 0, 100);
357 else h->Reset();
358 fContainer->AddAt(h, kNeventsTrigger);
359
360 if(!(h = (TH1F *)gROOT->FindObject("hEventsTriggerTracks")))
361 h = new TH1F("hEventsTriggerTracks", "Trigger Class (Tracks)", 100, 0, 100);
362 else h->Reset();
363 fContainer->AddAt(h, kNeventsTriggerTracks);
364
365 if(!(h = (TH1F *)gROOT->FindObject("hTriggerPurity"))){
366 h = new TH1F("hTriggerPurity", "Trigger Purity", 10, -0.5, 9.5);
367 h->GetXaxis()->SetTitle("Trigger Cluster");
368 h->GetYaxis()->SetTitle("freq.");
369 } else h->Reset();
370 fContainer->AddAt(h, kTriggerPurity);
107fde80 371
372 return fContainer;
373}
374
375/*
376* Plotting Functions
377*/
378
379//_______________________________________________________
52e4836c 380TH1 *AliTRDcheckDetector::PlotNClustersTracklet(const AliTRDtrackV1 *track){
107fde80 381 //
382 // Plot the mean number of clusters per tracklet
383 //
74b2e03d 384 if(track) fTrack = track;
107fde80 385 if(!fTrack){
74b2e03d 386 AliWarning("No Track defined.");
387 return 0x0;
107fde80 388 }
389 TH1 *h = 0x0;
b1957d3c 390 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNclustersTracklet)))){
107fde80 391 AliWarning("No Histogram defined.");
392 return 0x0;
393 }
394 AliTRDseedV1 *tracklet = 0x0;
2374fb85 395 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
107fde80 396 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
52e4836c 397 h->Fill(tracklet->GetN2());
107fde80 398 }
399 return h;
400}
401
402//_______________________________________________________
52e4836c 403TH1 *AliTRDcheckDetector::PlotNClustersTrack(const AliTRDtrackV1 *track){
107fde80 404 //
405 // Plot the number of clusters in one track
406 //
74b2e03d 407 if(track) fTrack = track;
107fde80 408 if(!fTrack){
74b2e03d 409 AliWarning("No Track defined.");
410 return 0x0;
107fde80 411 }
412 TH1 *h = 0x0;
b1957d3c 413 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNclustersTrack)))){
107fde80 414 AliWarning("No Histogram defined.");
415 return 0x0;
416 }
2374fb85 417
107fde80 418 Int_t nclusters = 0;
419 AliTRDseedV1 *tracklet = 0x0;
2374fb85 420 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
107fde80 421 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
422 nclusters += tracklet->GetN();
423 if(fDebugLevel > 2){
52e4836c 424 Int_t crossing = Int_t(tracklet->IsRowCross());
425 Int_t detector = tracklet->GetDetector();
426 Float_t theta = TMath::ATan(tracklet->GetZref(1));
427 Float_t phi = TMath::ATan(tracklet->GetYref(1));
107fde80 428 Float_t momentum = 0.;
429 Int_t pdg = 0;
52a79f8d 430 Int_t kinkIndex = fESD ? fESD->GetKinkIndex() : 0;
431 UShort_t TPCncls = fESD ? fESD->GetTPCncls() : 0;
107fde80 432 if(fMC){
52a79f8d 433 if(fMC->GetTrackRef()) momentum = fMC->GetTrackRef()->P();
75d00a6d 434 pdg = fMC->GetPDG();
107fde80 435 }
b1957d3c 436 (*fDebugStream) << "NClustersTrack"
107fde80 437 << "Detector=" << detector
107fde80 438 << "crossing=" << crossing
439 << "momentum=" << momentum
440 << "pdg=" << pdg
441 << "theta=" << theta
442 << "phi=" << phi
52a79f8d 443 << "kinkIndex=" << kinkIndex
444 << "TPCncls=" << TPCncls
107fde80 445 << "nclusters=" << nclusters
446 << "\n";
447 }
448 }
449 h->Fill(nclusters);
450 return h;
451}
452
107fde80 453
454//_______________________________________________________
b1957d3c 455TH1 *AliTRDcheckDetector::PlotNTrackletsTrack(const AliTRDtrackV1 *track){
107fde80 456 //
b1957d3c 457 // Plot the number of tracklets
107fde80 458 //
74b2e03d 459 if(track) fTrack = track;
460 if(!fTrack){
461 AliWarning("No Track defined.");
462 return 0x0;
107fde80 463 }
fc8b1a37 464 TH1 *h = 0x0, *hMethod = 0x0;
b1957d3c 465 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNtrackletsTrack)))){
107fde80 466 AliWarning("No Histogram defined.");
467 return 0x0;
468 }
fc8b1a37 469 Int_t status = fESD->GetStatus();
470/* printf("in/out/refit/pid: TRD[%d|%d|%d|%d]\n", status &AliESDtrack::kTRDin ? 1 : 0, status &AliESDtrack::kTRDout ? 1 : 0, status &AliESDtrack::kTRDrefit ? 1 : 0, status &AliESDtrack::kTRDpid ? 1 : 0);*/
471 if((status & AliESDtrack::kTRDin) != 0){
472 // Full BarrelTrack
473 if(!(hMethod = dynamic_cast<TH1F *>(fContainer->At(kNtrackletsBAR))))
474 AliWarning("Method: Barrel. Histogram not processed!");
475 } else {
476 // Stand alone Track
477 if(!(hMethod = dynamic_cast<TH1F *>(fContainer->At(kNtrackletsSTA))))
478 AliWarning("Method: StandAlone. Histogram not processed!");
479 }
b1957d3c 480 Int_t nTracklets = fTrack->GetNumberOfTracklets();
481 h->Fill(nTracklets);
fc8b1a37 482 hMethod->Fill(nTracklets);
b1957d3c 483 if(fDebugLevel > 3){
484 if(nTracklets == 1){
485 // If we have one Tracklet, check in which layer this happens
486 Int_t layer = -1;
487 AliTRDseedV1 *tracklet = 0x0;
488 for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
489 if((tracklet = fTrack->GetTracklet(il)) && tracklet->IsOK()){layer = il; break;}
490 }
491 (*fDebugStream) << "NTrackletsTrack"
492 << "Layer=" << layer
493 << "\n";
494 }
2374fb85 495 }
107fde80 496 return h;
497}
498
499
500//_______________________________________________________
b1957d3c 501TH1 *AliTRDcheckDetector::PlotNTrackletsRowCross(const AliTRDtrackV1 *track){
107fde80 502 //
503 // Plot the number of tracklets
504 //
74b2e03d 505 if(track) fTrack = track;
107fde80 506 if(!fTrack){
74b2e03d 507 AliWarning("No Track defined.");
508 return 0x0;
107fde80 509 }
510 TH1 *h = 0x0;
b1957d3c 511 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNtrackletsCross)))){
107fde80 512 AliWarning("No Histogram defined.");
513 return 0x0;
514 }
b1957d3c 515
516 Int_t ncross = 0;
517 AliTRDseedV1 *tracklet = 0x0;
518 for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
519 if(!(tracklet = fTrack->GetTracklet(il)) || !tracklet->IsOK()) continue;
520
521 if(tracklet->IsRowCross()) ncross++;
3cfaffa4 522 }
b1957d3c 523 h->Fill(ncross);
3cfaffa4 524 return h;
525}
526
527//_______________________________________________________
b1957d3c 528TH1 *AliTRDcheckDetector::PlotFindableTracklets(const AliTRDtrackV1 *track){
3cfaffa4 529 //
530 // Plots the ratio of number of tracklets vs.
531 // number of findable tracklets
532 //
533 // Findable tracklets are defined as track prolongation
534 // to layer i does not hit the dead area +- epsilon
535 //
7dc3c50c 536 // In order to check whether tracklet hist active area in Layer i,
537 // the track is refitted and the fitted position + an uncertainty
538 // range is compared to the chamber border (also with a different
539 // uncertainty)
540 //
541 // For the track fit two cases are distinguished:
542 // If the track is a stand alone track (defined by the status bit
543 // encoding, then the track is fitted with the tilted Rieman model
544 // Otherwise the track is fitted with the Kalman fitter in two steps:
545 // Since the track parameters are give at the outer point, we first
546 // fit in direction inwards. Afterwards we fit again in direction outwards
547 // to extrapolate the track to layers which are not reached by the track
548 // For the Kalman model, the radial track points have to be shifted by
549 // a distance epsilon in the direction that we want to fit
550 //
3cfaffa4 551 const Float_t epsilon = 0.01; // dead area tolerance
7dc3c50c 552 const Float_t epsilon_R = 1; // shift in radial direction of the anode wire position (Kalman filter only)
553 const Float_t delta_y = 0.7; // Tolerance in the track position in y-direction
554 const Float_t delta_z = 7.0; // Tolerance in the track position in z-direction (Padlength)
3cfaffa4 555 Double_t x_anode[AliTRDgeometry::kNlayer] = {300.2, 312.8, 325.4, 338.0, 350.6, 363.2}; // Take the default X0
556
557 if(track) fTrack = track;
558 if(!fTrack){
559 AliWarning("No Track defined.");
560 return 0x0;
561 }
562 TH1 *h = 0x0;
b1957d3c 563 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNtrackletsFindable)))){
3cfaffa4 564 AliWarning("No Histogram defined.");
565 return 0x0;
566 }
567 Int_t nFound = 0, nFindable = 0;
568 Int_t stack = -1;
569 Double_t ymin = 0., ymax = 0., zmin = 0., zmax = 0.;
570 Double_t y = 0., z = 0.;
107fde80 571 AliTRDseedV1 *tracklet = 0x0;
3cfaffa4 572 AliTRDpadPlane *pp;
3cfaffa4 573 for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
574 if((tracklet = fTrack->GetTracklet(il)) && tracklet->IsOK()){
575 tracklet->SetReconstructor(fReconstructor);
576 nFound++;
3cfaffa4 577 }
107fde80 578 }
3cfaffa4 579 // 2 Different cases:
580 // 1st stand alone: here we cannot propagate, but be can do a Tilted Rieman Fit
581 // 2nd barrel track: here we propagate the track to the layers
582 AliTrackPoint points[6];
583 Float_t xyz[3];
584 memset(xyz, 0, sizeof(Float_t) * 3);
585 if(((fESD->GetStatus() & AliESDtrack::kTRDout) > 0) && !((fESD->GetStatus() & AliESDtrack::kTRDin) > 0)){
586 // stand alone track
587 for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
588 xyz[0] = x_anode[il];
589 points[il].SetXYZ(xyz);
590 }
591 AliTRDtrackerV1::FitRiemanTilt(const_cast<AliTRDtrackV1 *>(fTrack), 0x0, kTRUE, 6, points);
592 } else {
593 // barrel track
7dc3c50c 594 //
595 // 2 Steps:
596 // -> Kalman inwards
597 // -> Kalman outwards
598 AliTRDtrackV1 copy_track(*fTrack); // Do Kalman on a (non-constant) copy of the track
599 AliTrackPoint points_inward[6], points_outward[6];
3cfaffa4 600 for(Int_t il = AliTRDgeometry::kNlayer; il--;){
7dc3c50c 601 // In order to avoid complications in the Kalman filter if the track points have the same radial
602 // position like the tracklets, we have to shift the radial postion of the anode wire by epsilon
603 // in the direction we want to go
604 // The track points have to be in reverse order for the Kalman Filter inwards
3cfaffa4 605 xyz[0] = x_anode[AliTRDgeometry::kNlayer - il - 1] - epsilon_R;
7dc3c50c 606 points_inward[il].SetXYZ(xyz);
607 xyz[0] = x_anode[il] + epsilon_R;
608 points_outward[il].SetXYZ(xyz);
3cfaffa4 609 }
7dc3c50c 610 /*for(Int_t ipt = 0; ipt < AliTRDgeometry::kNlayer; ipt++)
611 printf("%d. X = %f\n", ipt, points[ipt].GetX());*/
612 // Kalman inwards
613 AliTRDtrackerV1::FitKalman(&copy_track, 0x0, kFALSE, 6, points_inward);
614 memcpy(points, points_inward, sizeof(AliTrackPoint) * 6); // Preliminary store the inward results in the Array points
615 // Kalman outwards
616 AliTRDtrackerV1::FitKalman(&copy_track, 0x0, kTRUE, 6, points_inward);
617 memcpy(points, points_outward, sizeof(AliTrackPoint) * AliTRDgeometry::kNlayer);
3cfaffa4 618 }
619 for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
620 y = points[il].GetY();
621 z = points[il].GetZ();
622 if((stack = fGeo->GetStack(z, il)) < 0) continue; // Not findable
623 pp = fGeo->GetPadPlane(il, stack);
624 ymin = pp->GetCol0() + epsilon;
625 ymax = pp->GetColEnd() - epsilon;
626 zmin = pp->GetRowEnd() + epsilon;
627 zmax = pp->GetRow0() - epsilon;
628 // ignore y-crossing (material)
7dc3c50c 629 if((z + delta_z > zmin && z - delta_z < zmax) && (y + delta_y > ymin && y - delta_y < ymax)) nFindable++;
3cfaffa4 630 if(fDebugLevel > 3){
e3cf3d02 631 Double_t pos_tracklet[2] = {tracklet ? tracklet->GetYfit(0) : 0, tracklet ? tracklet->GetZfit(0) : 0};
3cfaffa4 632 Int_t hasTracklet = tracklet ? 1 : 0;
b1957d3c 633 (*fDebugStream) << "FindableTracklets"
3cfaffa4 634 << "layer=" << il
635 << "ytracklet=" << pos_tracklet[0]
636 << "ytrack=" << y
637 << "ztracklet=" << pos_tracklet[1]
638 << "ztrack=" << z
639 << "tracklet=" << hasTracklet
640 << "\n";
641 }
3cfaffa4 642 }
643
3cfaffa4 644 h->Fill(nFindable > 0 ? TMath::Min(nFound/static_cast<Double_t>(nFindable), 1.) : 1);
645 if(fDebugLevel > 2) AliInfo(Form("Findable[Found]: %d[%d|%f]", nFindable, nFound, nFound/static_cast<Float_t>(nFindable > 0 ? nFindable : 1)));
107fde80 646 return h;
647}
648
b1957d3c 649
650//_______________________________________________________
651TH1 *AliTRDcheckDetector::PlotChi2(const AliTRDtrackV1 *track){
652 //
653 // Plot the chi2 of the track
654 //
655 if(track) fTrack = track;
656 if(!fTrack){
657 AliWarning("No Track defined.");
658 return 0x0;
659 }
660 TH1 *h = 0x0;
661 if(!(h = dynamic_cast<TH1F *>(((TObjArray*)(fContainer->At(kChi2)))->At(0)))){
662 AliWarning("No Histogram defined.");
663 return 0x0;
664 }
665 h->Fill(fTrack->GetChi2());
666 return h;
667}
668
669//_______________________________________________________
670TH1 *AliTRDcheckDetector::PlotChi2Norm(const AliTRDtrackV1 *track){
671 //
672 // Plot the chi2 of the track
673 //
674 if(track) fTrack = track;
675 if(!fTrack){
676 AliWarning("No Track defined.");
677 return 0x0;
678 }
679 TH1 *h = 0x0;
680 if(!(h = dynamic_cast<TH1F *>(((TObjArray*)(fContainer->At(kChi2)))->At(1)))){
681 AliWarning("No Histogram defined.");
682 return 0x0;
683 }
684 Int_t nTracklets = 0;
685 AliTRDseedV1 *tracklet = 0x0;
686 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
687 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
688 nTracklets++;
689 }
fc8b1a37 690 if(!nTracklets) return 0x0;
b1957d3c 691 h->Fill(fTrack->GetChi2()/nTracklets);
692 return h;
693}
694
695
107fde80 696//_______________________________________________________
b1957d3c 697TH1 *AliTRDcheckDetector::PlotPHt(const AliTRDtrackV1 *track){
107fde80 698 //
699 // Plot the average pulse height
700 //
74b2e03d 701 if(track) fTrack = track;
107fde80 702 if(!fTrack){
74b2e03d 703 AliWarning("No Track defined.");
704 return 0x0;
107fde80 705 }
706 TProfile *h = 0x0;
b1957d3c 707 if(!(h = dynamic_cast<TProfile *>(((TObjArray*)(fContainer->At(kPH)))->At(0)))){
107fde80 708 AliWarning("No Histogram defined.");
709 return 0x0;
710 }
107fde80 711 AliTRDseedV1 *tracklet = 0x0;
712 AliTRDcluster *c = 0x0;
2374fb85 713 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
107fde80 714 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK())continue;
52e4836c 715 Int_t crossing = Int_t(tracklet->IsRowCross());
716 Int_t detector = tracklet->GetDetector();
96bc8661 717 tracklet->ResetClusterIter();
718 while((c = tracklet->NextCluster())){
719 if(!c->IsInChamber()) continue;
107fde80 720 Int_t localtime = c->GetLocalTimeBin();
721 Double_t absolute_charge = TMath::Abs(c->GetQ());
722 h->Fill(localtime, absolute_charge);
723 if(fDebugLevel > 3){
2cdfacc5 724 Double_t distance[2];
725 GetDistanceToTracklet(distance, tracklet, c);
52e4836c 726 Float_t theta = TMath::ATan(tracklet->GetZref(1));
727 Float_t phi = TMath::ATan(tracklet->GetYref(1));
107fde80 728 Float_t momentum = 0.;
729 Int_t pdg = 0;
52a79f8d 730 Int_t kinkIndex = fESD ? fESD->GetKinkIndex() : 0;
731 UShort_t TPCncls = fESD ? fESD->GetTPCncls() : 0;
107fde80 732 if(fMC){
75d00a6d 733 if(fMC->GetTrackRef()) momentum = fMC->GetTrackRef()->P();
734 pdg = fMC->GetPDG();
107fde80 735 }
b1957d3c 736 (*fDebugStream) << "PHt"
107fde80 737 << "Detector=" << detector
2374fb85 738 << "crossing=" << crossing
107fde80 739 << "Timebin=" << localtime
740 << "Charge=" << absolute_charge
741 << "momentum=" << momentum
742 << "pdg=" << pdg
743 << "theta=" << theta
744 << "phi=" << phi
52a79f8d 745 << "kinkIndex=" << kinkIndex
746 << "TPCncls=" << TPCncls
2cdfacc5 747 << "dy=" << distance[0]
748 << "dz=" << distance[1]
749 << "c.=" << c
107fde80 750 << "\n";
751 }
752 }
753 }
754 return h;
755}
756
2cdfacc5 757//_______________________________________________________
b1957d3c 758TH1 *AliTRDcheckDetector::PlotPHx(const AliTRDtrackV1 *track){
2cdfacc5 759 //
760 // Plots the average pulse height vs the distance from the anode wire
761 // (plus const anode wire offset)
762 //
763 if(track) fTrack = track;
764 if(!fTrack){
765 AliWarning("No Track defined.");
766 return 0x0;
767 }
768 TProfile *h = 0x0;
b1957d3c 769 if(!(h = dynamic_cast<TProfile *>(((TObjArray*)(fContainer->At(kPH)))->At(1)))){
2cdfacc5 770 AliWarning("No Histogram defined.");
771 return 0x0;
772 }
a589a812 773 Float_t offset = .5*AliTRDgeometry::CamHght();
2cdfacc5 774 AliTRDseedV1 *tracklet = 0x0;
775 AliTRDcluster *c = 0x0;
776 Double_t distance = 0;
96bc8661 777 Double_t x, y;
2cdfacc5 778 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
779 if(!(tracklet = fTrack->GetTracklet(itl)) || !(tracklet->IsOK())) continue;
780 tracklet->ResetClusterIter();
781 while((c = tracklet->NextCluster())){
96bc8661 782 if(!c->IsInChamber()) continue;
538f6383 783 x = c->GetX()-AliTRDcluster::GetXcorr(c->GetLocalTimeBin());
784 y = c->GetY()-AliTRDcluster::GetYcorr(AliTRDgeometry::GetLayer(c->GetDetector()), c->GetCenter());
785
96bc8661 786 distance = tracklet->GetX0() - (c->GetX() + 0.3) + offset;
2cdfacc5 787 h->Fill(distance, TMath::Abs(c->GetQ()));
788 }
789 }
790 return h;
791}
792
107fde80 793//_______________________________________________________
b1957d3c 794TH1 *AliTRDcheckDetector::PlotChargeCluster(const AliTRDtrackV1 *track){
107fde80 795 //
796 // Plot the cluster charge
797 //
74b2e03d 798 if(track) fTrack = track;
107fde80 799 if(!fTrack){
74b2e03d 800 AliWarning("No Track defined.");
801 return 0x0;
107fde80 802 }
803 TH1 *h = 0x0;
b1957d3c 804 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kChargeCluster)))){
107fde80 805 AliWarning("No Histogram defined.");
806 return 0x0;
807 }
107fde80 808 AliTRDseedV1 *tracklet = 0x0;
809 AliTRDcluster *c = 0x0;
2374fb85 810 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
107fde80 811 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK())continue;
3cfaffa4 812 for(Int_t itime = 0; itime < AliTRDtrackerV1::GetNTimeBins(); itime++){
107fde80 813 if(!(c = tracklet->GetClusters(itime))) continue;
814 h->Fill(c->GetQ());
815 }
816 }
817 return h;
818}
819
820//_______________________________________________________
b1957d3c 821TH1 *AliTRDcheckDetector::PlotChargeTracklet(const AliTRDtrackV1 *track){
107fde80 822 //
823 // Plot the charge deposit per chamber
824 //
74b2e03d 825 if(track) fTrack = track;
107fde80 826 if(!fTrack){
74b2e03d 827 AliWarning("No Track defined.");
828 return 0x0;
107fde80 829 }
830 TH1 *h = 0x0;
b1957d3c 831 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kChargeTracklet)))){
107fde80 832 AliWarning("No Histogram defined.");
833 return 0x0;
834 }
107fde80 835 AliTRDseedV1 *tracklet = 0x0;
52e4836c 836 AliTRDcluster *c = 0x0;
107fde80 837 Double_t Qtot = 0;
b1957d3c 838 Int_t nTracklets =fTrack->GetNumberOfTracklets();
2374fb85 839 for(Int_t itl = 0x0; itl < AliTRDgeometry::kNlayer; itl++){
107fde80 840 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
52e4836c 841 Qtot = 0.;
8d2bec9e 842 for(Int_t ic = AliTRDseedV1::kNclusters; ic--;){
52e4836c 843 if(!(c = tracklet->GetClusters(ic))) continue;
107fde80 844 Qtot += TMath::Abs(c->GetQ());
845 }
846 h->Fill(Qtot);
847 if(fDebugLevel > 3){
52e4836c 848 Int_t crossing = (Int_t)tracklet->IsRowCross();
849 Int_t detector = tracklet->GetDetector();
107fde80 850 Float_t theta = TMath::ATan(tracklet->GetZfit(1));
851 Float_t phi = TMath::ATan(tracklet->GetYfit(1));
852 Float_t momentum = 0.;
853 Int_t pdg = 0;
52a79f8d 854 Int_t kinkIndex = fESD ? fESD->GetKinkIndex() : 0;
855 UShort_t TPCncls = fESD ? fESD->GetTPCncls() : 0;
107fde80 856 if(fMC){
75d00a6d 857 if(fMC->GetTrackRef()) momentum = fMC->GetTrackRef()->P();
858 pdg = fMC->GetPDG();
107fde80 859 }
b1957d3c 860 (*fDebugStream) << "ChargeTracklet"
107fde80 861 << "Detector=" << detector
107fde80 862 << "crossing=" << crossing
863 << "momentum=" << momentum
3cfaffa4 864 << "nTracklets="<< nTracklets
107fde80 865 << "pdg=" << pdg
866 << "theta=" << theta
867 << "phi=" << phi
52a79f8d 868 << "kinkIndex=" << kinkIndex
869 << "TPCncls=" << TPCncls
107fde80 870 << "QT=" << Qtot
871 << "\n";
872 }
873 }
874 return h;
875}
876
877//_______________________________________________________
b1957d3c 878TH1 *AliTRDcheckDetector::PlotNTracksSector(const AliTRDtrackV1 *track){
107fde80 879 //
880 // Plot the number of tracks per Sector
881 //
74b2e03d 882 if(track) fTrack = track;
107fde80 883 if(!fTrack){
74b2e03d 884 AliWarning("No Track defined.");
885 return 0x0;
107fde80 886 }
887 TH1 *h = 0x0;
b1957d3c 888 if(!(h = dynamic_cast<TH1F *>(fContainer->At(kNtracksSector)))){
107fde80 889 AliWarning("No Histogram defined.");
890 return 0x0;
891 }
52e4836c 892
893 // TODO we should compare with
894 // sector = Int_t(track->GetAlpha() / AliTRDgeometry::GetAlpha());
895
107fde80 896 AliTRDseedV1 *tracklet = 0x0;
107fde80 897 Int_t sector = -1;
2374fb85 898 for(Int_t itl = 0; itl < AliTRDgeometry::kNlayer; itl++){
899 if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
52e4836c 900 sector = static_cast<Int_t>(tracklet->GetDetector()/AliTRDgeometry::kNdets);
107fde80 901 break;
902 }
903 h->Fill(sector);
904 return h;
905}
906
3cfaffa4 907
908//________________________________________________________
909void AliTRDcheckDetector::SetRecoParam(AliTRDrecoParam *r)
910{
911
912 fReconstructor->SetRecoParam(r);
913}
2cdfacc5 914
915//________________________________________________________
b1957d3c 916void AliTRDcheckDetector::GetDistanceToTracklet(Double_t *dist, AliTRDseedV1 *tracklet, AliTRDcluster *c)
917{
918 Float_t x = c->GetX();
919 dist[0] = c->GetY() - tracklet->GetYat(x);
920 dist[1] = c->GetZ() - tracklet->GetZat(x);
2cdfacc5 921}
fc8b1a37 922
923//________________________________________________________
924void AliTRDcheckDetector::MakePlotNTracklets(){
925 //
926 // Make nice bar plot of the number of tracklets in each method
927 //
928 TH1F *hBAR = (TH1F *)fContainer->FindObject("hNtlsBAR");
929 TH1F *hSTA = (TH1F *)fContainer->FindObject("hNtlsSTA");
930 TH1F *hCON = (TH1F *)fContainer->FindObject("hNtls");
931
932 hBAR->Scale(100./hCON->Integral());
933 hBAR->SetFillColor(kRed);
934 hBAR->SetBarWidth(0.2);
935 hBAR->SetBarOffset(0.2);
936 hBAR->SetTitle("");
937 hBAR->SetStats(kFALSE);
938 hBAR->GetYaxis()->SetRangeUser(0.,40.);
939 hBAR->GetYaxis()->SetTitleOffset(1.2);
940 hBAR->Draw("bar1");
941
942 hSTA->Scale(100./hCON->Integral());
943 hSTA->SetFillColor(kBlue);
944 hSTA->SetBarWidth(0.2);
945 hSTA->SetBarOffset(0.4);
946 hSTA->SetTitle("");
947 hSTA->SetStats(kFALSE);
948 hSTA->GetYaxis()->SetRangeUser(0.,40.);
949 hSTA->GetYaxis()->SetTitleOffset(1.2);
950 hSTA->Draw("bar1same");
951
952 hCON->Scale(100./hCON->Integral());
953 hCON->SetFillColor(kGreen);
954 hCON->SetBarWidth(0.2);
955 hCON->SetBarOffset(0.6);
956 hCON->SetStats(kFALSE);
957 hCON->GetYaxis()->SetRangeUser(0.,40.);
958 hCON->GetYaxis()->SetTitleOffset(1.2);
959 hCON->Draw("bar1same");
960
961 TLegend *leg = new TLegend(0.6, 0.75, 0.89, 0.89);
962 leg->AddEntry(hBAR, "Barrel", "f");
963 leg->AddEntry(hSTA, "Stand Alone", "f");
964 leg->AddEntry(hCON, "Convoluted", "f");
965
966 leg->Draw();
967 gPad->Update();
968}
969
970//________________________________________________________
971void AliTRDcheckDetector::MakePlotPulseHeight(){
972 //
973 // Create Plot of the Pluse Height Spectrum
974 //
975 TH1 *h, *h1, *h2;
976 TObjArray *arr = (TObjArray*)fContainer->FindObject("<PH>");
977 h = (TH1F*)arr->At(0);
978 h->SetMarkerStyle(24);
979 h->SetMarkerColor(kBlack);
980 h->SetLineColor(kBlack);
981 h->Draw("e1");
982// copy the second histogram in a new one with the same x-dimension as the phs with respect to time
983 h1 = (TH1F *)arr->At(1);
984 h2 = new TH1F("hphs1","Average PH", 31, -0.5, 30.5);
985 for(Int_t ibin = h1->GetXaxis()->GetFirst(); ibin < h1->GetNbinsX(); ibin++)
986 h2->SetBinContent(ibin, h1->GetBinContent(ibin));
987 h2->SetMarkerStyle(22);
988 h2->SetMarkerColor(kBlue);
989 h2->SetLineColor(kBlue);
990 h2->Draw("e1same");
991 gPad->Update();
992// create axis according to the histogram dimensions of the original second histogram
993 TGaxis *axis = new TGaxis(gPad->GetUxmin(),
994 gPad->GetUymax(),
995 gPad->GetUxmax(),
996 gPad->GetUymax(),
997 -0.08, 4.88, 510,"-L");
998 axis->SetLineColor(kBlue);
999 axis->SetLabelColor(kBlue);
1000 axis->SetTextColor(kBlue);
1001 axis->SetTitle("x_{0}-x_{c} [cm]");
1002 axis->Draw();
1003}
1004
1005//________________________________________________________
1006Bool_t AliTRDcheckDetector::MakeBarPlot(TH1 *histo, Int_t color){
1007 //
1008 // Draw nice bar plots
1009 //
1010 if(!histo->GetEntries()) return kFALSE;
1011 histo->Scale(100./histo->Integral());
1012 histo->SetFillColor(color);
1013 histo->SetBarOffset(.2);
1014 histo->SetBarWidth(.6);
1015 histo->Draw("bar1");
1016 return kTRUE;
1017}