]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ESDCheck/AliTOFQATask.cxx
New version provided by Arcelli
[u/mrichter/AliRoot.git] / ESDCheck / AliTOFQATask.cxx
CommitLineData
1dfe075f 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//_________________________________________________________________________
1137ac22 16// An analysis task to check the TOF in simulated data
1dfe075f 17//
18//*-- Silvia Arcelli
1137ac22 19//-Distributions of the matching performance
20//-TOF Time info and (TOF - expected time) plots
21//-Summary Plots on TOF Pid
1dfe075f 22//////////////////////////////////////////////////////////////////////////////
1dfe075f 23#include <TChain.h>
1dfe075f 24#include <TFile.h>
1137ac22 25#include <TObject.h>
26#include <TCanvas.h>
27#include <TStyle.h>
28#include <TGaxis.h>
29#include <TLatex.h>
30#include <TPad.h>
1dfe075f 31
32#include "AliTOFQATask.h"
33#include "AliESD.h"
1137ac22 34#include "AliESDtrack.h"
1dfe075f 35#include "AliLog.h"
1137ac22 36#include "Riostream.h"
1dfe075f 37
38//______________________________________________________________________________
39AliTOFQATask::AliTOFQATask(const char *name) :
40 AliAnalysisTask(name,""),
41 fChain(0),
42 fESD(0),
1137ac22 43 fOutputContainer(0),
44 fhTOFMatch(0),
45 fhESDeffPhi(0),
46 fhESDeffTheta(0),
47 fhESDeffMom(0),
48 fhTOFeffPhi(0),
49 fhTOFeffTheta(0),
50 fhTOFeffMom(0),
51 fhTOFeffPhiMT(0),
52 fhTOFeffThetaMT(0),
53 fhTOFeffMomMT(0),
54 fhTOFsector(0),
55 fhTOFsectorMT(0),
56 fhTOFTime(0),
57 fhTOFDeltaTime(0),
58 fhTOFDeltaTimeMT(0),
59 fhTOFIDSpecies(0),
60 fhTOFMassVsMom(0),
61 fhTOFMass(0)
1dfe075f 62{
63 // Constructor.
64 // Input slot #0 works with an Ntuple
65 DefineInput(0, TChain::Class());
66 // Output slot #0 writes into a TH1 container
67 DefineOutput(0, TObjArray::Class()) ;
68}
69
1137ac22 70//______________________________________________________________________________
71AliTOFQATask::AliTOFQATask(const AliTOFQATask &qatask) :
72 AliAnalysisTask("AliTOFQATask",""),
73 fChain(0),
74 fESD(0),
75 fOutputContainer(0),
76 fhTOFMatch(0),
77 fhESDeffPhi(0),
78 fhESDeffTheta(0),
79 fhESDeffMom(0),
80 fhTOFeffPhi(0),
81 fhTOFeffTheta(0),
82 fhTOFeffMom(0),
83 fhTOFeffPhiMT(0),
84 fhTOFeffThetaMT(0),
85 fhTOFeffMomMT(0),
86 fhTOFsector(0),
87 fhTOFsectorMT(0),
88 fhTOFTime(0),
89 fhTOFDeltaTime(0),
90 fhTOFDeltaTimeMT(0),
91 fhTOFIDSpecies(0),
92 fhTOFMassVsMom(0),
93 fhTOFMass(0)
94{
95 // Copy Constructor.
96 fChain=qatask.fChain;
97 fESD=qatask.fESD;
98 fOutputContainer=qatask.fOutputContainer;
99 fhTOFMatch=qatask.fhTOFMatch;
100 fhESDeffPhi=qatask.fhESDeffPhi;
101 fhESDeffTheta=qatask.fhESDeffTheta;
102 fhESDeffMom=qatask.fhESDeffMom;
103 fhTOFeffPhi=qatask.fhTOFeffPhi;
104 fhTOFeffTheta=qatask.fhTOFeffTheta;
105 fhTOFeffMom=qatask.fhTOFeffMom;
106 fhTOFeffPhiMT=qatask.fhTOFeffPhiMT;
107 fhTOFeffThetaMT=qatask.fhTOFeffThetaMT;
108 fhTOFeffMomMT=qatask.fhTOFeffMomMT;
109 fhTOFsector=qatask.fhTOFsector;
110 fhTOFsectorMT=qatask.fhTOFsectorMT;
111 fhTOFTime=qatask.fhTOFTime;
112 fhTOFDeltaTime=qatask.fhTOFDeltaTime;
113 fhTOFDeltaTimeMT=qatask.fhTOFDeltaTimeMT;
114 fhTOFIDSpecies=qatask.fhTOFIDSpecies;
115 fhTOFMassVsMom=qatask.fhTOFMassVsMom;
116 fhTOFMass=qatask.fhTOFMass;
117}
118//______________________________________________________________________________
119AliTOFQATask:: ~AliTOFQATask()
120{
121 delete fOutputContainer;
122 delete fhTOFMatch;
123 delete fhESDeffPhi;
124 delete fhESDeffTheta;
125 delete fhESDeffMom;
126 delete fhTOFeffPhi;
127 delete fhTOFeffTheta;
128 delete fhTOFeffMom;
129 delete fhTOFeffPhiMT;
130 delete fhTOFeffThetaMT;
131 delete fhTOFeffMomMT;
132 delete fhTOFsector;
133 delete fhTOFsectorMT;
134 delete fhTOFTime;
135 delete fhTOFDeltaTime;
136 delete fhTOFDeltaTimeMT;
137 delete fhTOFIDSpecies;
138 delete fhTOFMassVsMom;
139 delete fhTOFMass;
140 }
141//______________________________________________________________________________
142AliTOFQATask& AliTOFQATask::operator=(const AliTOFQATask &qatask)
143{
144 //assignment operator
145 this->fChain=qatask.fChain;
146 this->fESD=qatask.fESD;
147 this->fOutputContainer=qatask.fOutputContainer;
148 this->fhTOFMatch=qatask.fhTOFMatch;
149 this->fhESDeffPhi=qatask.fhESDeffPhi;
150 this->fhESDeffTheta=qatask.fhESDeffTheta;
151 this->fhESDeffMom=qatask.fhESDeffMom;
152 this->fhTOFeffPhi=qatask.fhTOFeffPhi;
153 this->fhTOFeffTheta=qatask.fhTOFeffTheta;
154 this->fhTOFeffMom=qatask.fhTOFeffMom;
155 this->fhTOFeffPhiMT=qatask.fhTOFeffPhiMT;
156 this->fhTOFeffThetaMT=qatask.fhTOFeffThetaMT;
157 this->fhTOFeffMomMT=qatask.fhTOFeffMomMT;
158 this->fhTOFsector=qatask.fhTOFsector;
159 this->fhTOFsectorMT=qatask.fhTOFsectorMT;
160 this->fhTOFTime=qatask.fhTOFTime;
161 this->fhTOFDeltaTime=qatask.fhTOFDeltaTime;
162 this->fhTOFDeltaTimeMT=qatask.fhTOFDeltaTimeMT;
163 this->fhTOFIDSpecies=qatask.fhTOFIDSpecies;
164 this->fhTOFMassVsMom=qatask.fhTOFMassVsMom;
165 this->fhTOFMass=qatask.fhTOFMass;
166 return *this;
167}
1dfe075f 168//______________________________________________________________________________
169void AliTOFQATask::Init(const Option_t*)
170{
171 // Initialisation of branch container and histograms
172
173 AliInfo(Form("*** Initialization of %s", GetName())) ;
174
175 // Get input data
176 fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
177 if (!fChain) {
178 AliError(Form("Input 0 for %s not found\n", GetName()));
179 return ;
180 }
181
182 if (!fESD) {
183 // One should first check if the branch address was taken by some other task
184 char ** address = (char **)GetBranchAddress(0, "ESD") ;
185 if (address)
186 fESD = (AliESD *)(*address) ;
187 if (!fESD)
188 fChain->SetBranchAddress("ESD", &fESD) ;
189 }
1137ac22 190 BookHistos();
1dfe075f 191}
1dfe075f 192//______________________________________________________________________________
193void AliTOFQATask::Exec(Option_t *)
194{
1137ac22 195
196//******* The loop over events --------------------------------------------------
197
198 Int_t nselESD=0;
199 Int_t nmatchTOF=0;
200 Int_t npidok=0;
201 Int_t pisel=0,kasel=0,prsel=0,elsel=0,musel=0;
202 //Set equal a-priori weights (just charged hadrions)
203 Int_t nCalinSec=8736;
204 Double_t c[5]={0, 0, 1, 1, 1};
1dfe075f 205 // Processing of one event
1137ac22 206 Long64_t entry = fChain->GetReadEntry() ;
1dfe075f 207 if (!fESD) {
208 AliError("fESD is not connected to the input!") ;
209 return ;
210 }
211
212 if ( !((entry-1)%100) )
213 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
214
215 // ************************ TOF *************************************
1137ac22 216
217
1dfe075f 218 Int_t ntrk = fESD->GetNumberOfTracks() ;
1137ac22 219
1dfe075f 220 while ( ntrk-- ) {
1137ac22 221
1dfe075f 222 AliESDtrack * t = fESD->GetTrack(ntrk) ;
1137ac22 223 if ( (t->GetStatus() & AliESDtrack::kTIME)==0 )continue;
224
225 nselESD++;
226
227 Double_t mom = t->GetP() ;
228 Double_t phi = TMath::ATan2(t->GetX(),t->GetY()) ;
229 Double_t theta = TMath::ACos(t->GetZ()/
230 TMath::Sqrt(t->GetX()*t->GetX()+t->GetY()*t->GetY()+t->GetZ()*t->GetZ()));
231 phi*=180/TMath::Pi();
232 theta*=180/TMath::Pi();
233
234 fhESDeffPhi->Fill(phi);
235 fhESDeffTheta->Fill(theta);
236 fhESDeffMom->Fill(mom);
237
238
239 if(t->GetTOFsignal()<0)continue;
240
241 nmatchTOF++;
242
243 Double_t time=t->GetTOFsignal();//TOF time in ps
244 Int_t detid=t->GetTOFCalChannel();//which pad was hit
245 Int_t sector = detid/nCalinSec;
246 fhTOFTime->Fill(time*1.E-3);
247 fhTOFeffPhi->Fill(phi);
248 fhTOFeffTheta->Fill(theta);
249 fhTOFeffMom->Fill(mom);
250 fhTOFsector->Fill(sector);
251 //Well matched
252
253 Int_t label=TMath::Abs(t->GetLabel());
254 Int_t clab[3]; t->GetTOFLabel(clab);
255 if(label==clab[0] || label==clab[1] || label==clab[2]) {
256 fhTOFeffPhiMT->Fill(phi);
257 fhTOFeffThetaMT->Fill(theta);
258 fhTOFeffMomMT->Fill(mom);
259 fhTOFsectorMT->Fill(sector);
260 }
261
262 //Look at TOF PID
263
264 UInt_t status=AliESDtrack::kESDpid;status|=AliESDtrack::kTOFpid;
265 if (!((t->GetStatus()&status) == status))continue;
266 npidok++;
267 Double_t times[10];
268 t->GetIntegratedTimes(times);//ps
269 Double_t l =t->GetIntegratedLength()/100.; // (m)
270 Double_t mass= -1.;
271 Double_t invBetaGamma= (0.299*time*1.E-3/l)*(0.299*time*1.E-3/l) -1.;
272 if(invBetaGamma<0){mass = -mom*TMath::Sqrt(-invBetaGamma);}
273 else{mass = mom*TMath::Sqrt(invBetaGamma);}
274
275 //The Mass/ vs Momentum Plot:
276 fhTOFMassVsMom->Fill(mass,mom);
277 fhTOFMass->Fill(mass);
1dfe075f 278
1137ac22 279 //PID weights
280 Double_t r[10]; t->GetTOFpid(r);
281 Double_t rcc=0.;
282 Int_t i;
283 for (i=0; i<AliPID::kSPECIES; i++) rcc+=(c[i]*r[i]);
284 if (rcc==0.) continue;
285 Double_t w[10];
286 for (i=0; i<AliPID::kSPECIES; i++) w[i]=c[i]*r[i]/rcc;
1dfe075f 287
1137ac22 288 fhTOFDeltaTime->Fill((time-times[2])*1.E-3);
289
290 if(label==clab[0] || label==clab[1] || label==clab[2]) {
291 fhTOFDeltaTimeMT->Fill((time-times[2])*1.E-3);
292 }
293
294 if (w[4]>w[0] && w[4]>w[1] && w[4]>w[2] && w[4]>w[3]){
295 prsel++;
296 fhTOFIDSpecies->Fill(4);
297 }
298 if (w[3]>w[0] && w[3]>w[1] && w[3]>w[2] && w[3]>w[4]){
299 kasel++;
300 fhTOFIDSpecies->Fill(3);
301 }
302 if (w[2]>w[0] && w[2]>w[1] && w[2]>w[3] && w[2]>w[4]){
303 pisel++;
304 fhTOFIDSpecies->Fill(2);
305 }
306 if (w[1]>w[0] && w[1]>w[2] && w[1]>w[3] && w[1]>w[4]){
307 musel++;
308 fhTOFIDSpecies->Fill(1);
309 }
310 if (w[0]>w[1] && w[0]>w[2] && w[0]>w[3] && w[0]>w[4]){
311 elsel++;
312 fhTOFIDSpecies->Fill(0);
1dfe075f 313 }
314 }
1137ac22 315
316 Float_t fracM= -1;
317 if(nselESD>10)fracM=((Float_t) nmatchTOF)/((Float_t) nselESD);
318 fhTOFMatch->Fill(fracM);
319
320 PostData(0, fOutputContainer);
321 AliInfo("Finishing event processing...") ;
322
323}
324//______________________________________________________________________________
325void AliTOFQATask::BookHistos()
326{
327
328 // The output objects will be written to:
329 TDirectory * cdir = gDirectory ;
330 // Open a file for output #0
331 char outputName[1024] ;
332 sprintf(outputName, "%s.root", GetName() ) ;
333 OpenFile(0, outputName , "RECREATE") ;
334 if (cdir) cdir->cd() ;
335
336 // Construct histograms:
337
338 fhTOFMatch=
339 new TH1F("hTOFMatch","Fraction of Matched TOF tracks",101,-0.005,1.005);
340 fhESDeffPhi=
341 new TH1F("hESDeffPhi","ESD tracks Phi(vtx)", 180, -180., 180.) ;
342 fhESDeffTheta=
343 new TH1F("hESDeffTheta","ESD tracks Theta (vtx)",90, 45., 135.) ;
344 fhESDeffMom=
345 new TH1F("hESDeffMom","ESD tracks Momentum (vtx)",40, 0., 6.) ;
346 fhTOFeffPhi =
347 new TH1F("hTOFeffPhi","TOF, Matched vs Phi(vtx)", 180,-180, 180.);
348 fhTOFeffPhiMT=
349 new TH1F("hTOFeffPhiMT","TOF, Well Matched vs Phi(vtx)",180,-180,180.);
350 fhTOFeffTheta=
351 new TH1F("hTOFeffTheta","TOF, Matched vs Theta(vtx)",90,45.,135.);
352 fhTOFeffThetaMT=
353 new TH1F("hTOFeffThetaMT","TOF, Well Matched vs Theta(vtx)",90,45.,135.);
354 fhTOFeffMom =
355 new TH1F("hTOFeffMom","TOF, Matched vs Momentum ", 40, 0.,6.);
356 fhTOFeffMomMT =
357 new TH1F("hTOFeffMomMT","TOF, Well Matched vs Momentum ", 40, 0.,6.);
358 fhTOFsector =
359 new TH1F("hTOFsector","TOF, Matched vs Sector ", 18,0.,18.);
360 fhTOFsectorMT =
361 new TH1F("hTOFsectorMT","TOF, Well Matched vs Sector", 18, 0.,18.);
362
363 fhESDeffMom->Sumw2(); fhTOFeffMom->Sumw2(); fhTOFeffMomMT->Sumw2();
364 fhESDeffTheta->Sumw2(); fhTOFeffTheta->Sumw2(); fhTOFeffThetaMT->Sumw2();
365 fhESDeffPhi->Sumw2(); fhTOFeffPhi->Sumw2(); fhTOFeffPhiMT->Sumw2();
366 fhTOFsector->Sumw2(); fhTOFsectorMT->Sumw2();
367
368 fhTOFTime =
369 new TH1F("hTOFTime","TOF, t(TOF)in ns ",1000,0,100.);
370 fhTOFDeltaTime =
371 new TH1F("hTOFDeltaTime","TOF,t(TOF)-t(exp,pion), ns ",1000,-4.4,20.);
372 fhTOFDeltaTimeMT =
373 new TH1F("hTOFDeltaTimeMT","TOF, t(TOF)-t(exp,pion) for Well Matched, ns ",1000,-4.4,20.);
374 fhTOFIDSpecies =
375 new TH1F("hTOFIDSpecies","TOF, ID Sample Composition ",5,-0.5,4.5);
376 fhTOFMassVsMom =
377 new TH2F("hTOFMassVsMom","TOF, Mass Vs Momentum ",280,-0.2,1.2,600,0.,6.);
378 fhTOFMass =
379 new TH1F("hTOFMass","TOF, reconstructed mass ",280,-0.2,1.2);
380
381
382 // create the output container
383
384 fOutputContainer = new TObjArray(18) ;
385 fOutputContainer->SetName(GetName()) ;
386
387 fOutputContainer->AddAt(fhTOFMatch, 0) ;
388 fOutputContainer->AddAt(fhESDeffPhi, 1) ;
389 fOutputContainer->AddAt(fhESDeffTheta, 2) ;
390 fOutputContainer->AddAt(fhESDeffMom, 3) ;
391 fOutputContainer->AddAt(fhTOFeffPhi, 4) ;
392 fOutputContainer->AddAt(fhTOFeffPhiMT, 5) ;
393 fOutputContainer->AddAt(fhTOFeffTheta, 6) ;
394 fOutputContainer->AddAt(fhTOFeffThetaMT, 7) ;
395 fOutputContainer->AddAt(fhTOFeffMom, 8) ;
396 fOutputContainer->AddAt(fhTOFeffMomMT, 9) ;
397 fOutputContainer->AddAt(fhTOFsector, 10) ;
398 fOutputContainer->AddAt(fhTOFsectorMT, 11) ;
399 fOutputContainer->AddAt(fhTOFTime, 12) ;
400 fOutputContainer->AddAt(fhTOFDeltaTime , 13) ;
401 fOutputContainer->AddAt(fhTOFDeltaTimeMT, 14) ;
402 fOutputContainer->AddAt(fhTOFIDSpecies, 15) ;
403 fOutputContainer->AddAt(fhTOFMassVsMom, 16) ;
404 fOutputContainer->AddAt(fhTOFMass, 17) ;
405
406}
407//______________________________________________________________________________
408void AliTOFQATask::GetEfficiency()
409{
410 // calculates the efficiency
411
412
413 fhTOFeffPhiMT->Divide(fhTOFeffPhiMT,fhTOFeffPhi,1,1,"B");
414 fhTOFeffThetaMT->Divide(fhTOFeffThetaMT,fhTOFeffTheta,1,1,"B");
415 fhTOFeffMomMT->Divide(fhTOFeffMomMT,fhTOFeffMom,1,1,"B");
416
417 fhTOFeffPhi->Divide(fhTOFeffPhi,fhESDeffPhi,1,1,"B");
418 fhTOFeffTheta->Divide(fhTOFeffTheta,fhESDeffTheta,1,1,"B");
419 fhTOFeffMom->Divide(fhTOFeffMom,fhESDeffMom,1,1,"B");
420
421}
422
423//______________________________________________________________________________
424void AliTOFQATask::DrawHistos()
425{
426 // Makes a few plots
427
428 AliInfo("Plotting....") ;
429
430 gROOT->SetStyle("Plain");
431 gStyle->SetPalette(1);
432 gStyle->SetOptStat(110010);
433 gStyle->SetPalette(1);
434 gStyle->SetCanvasColor(0);
435 gStyle->SetFrameFillColor(0);
436 //
437 TGaxis::SetMaxDigits(3);
438 gStyle->SetLabelFont(52, "XYZ");
439 gStyle->SetTitleFont(62, "XYZ");
440 gStyle->SetPadRightMargin(0.02);
441
442
443 TCanvas * cTOFeff = new TCanvas("cTOFeff", "TOF ESD General", 400, 30, 550, 630) ;
444
445 cTOFeff->Divide(1,2) ;
446 cTOFeff->cd(1);
447 fhTOFMatch->GetXaxis()->SetTitle("Fraction of matched ESD tracks/event");
448 fhTOFMatch->GetYaxis()->SetTitle("Events");
449 fhTOFMatch->SetFillColor(4);
450 fhTOFMatch->Draw();
451 cTOFeff->cd(2);
452 TPad *b = (TPad*)gPad;
453 b->Divide(2,1);
454 b->cd(1) ;
455 fhTOFsector->GetXaxis()->SetTitle("Sector index of matched TOF Cluster");
456 fhTOFsector->GetYaxis()->SetTitle("Entries");
457 fhTOFsector->SetFillColor(4);
458 fhTOFsector->SetMinimum(0.);
459 fhTOFsector->GetYaxis()->SetNdivisions(205);
460 fhTOFsector->GetYaxis()->SetTitleOffset(1.2);
461 fhTOFsector->Draw("histo");
462 b->cd(2) ;
463 fhTOFeffMom->SetMaximum(1.2);
464 fhTOFeffMom->GetXaxis()->SetTitle("Track momentum (GeV/c)");
465 fhTOFeffMom->GetYaxis()->SetNdivisions(205);
466 fhTOFeffMom->GetYaxis()->SetTitleOffset(1.2);
467 fhTOFeffMom->GetYaxis()->SetTitle("Fraction of matched ESD tracks");
468 fhTOFeffMom->SetFillColor(4);
469 fhTOFeffMom->Draw();
470 fhTOFeffMom->Draw("histo,same");
471
472 cTOFeff->Print("TOF_eff.gif");
473 cTOFeff->Print("TOF_eff.eps");
474
475
476
477 TCanvas * cTOFtime = new TCanvas("cTOFtime", "TOF measured Times ", 400, 30, 550, 630) ;
478 cTOFtime->Divide(1,2) ;
479 cTOFtime->cd(1);
480 cTOFtime->GetPad(1)->SetLogy(1);
481 fhTOFTime->GetXaxis()->SetTitle("TOF time (ns)");
482 fhTOFTime->GetYaxis()->SetTitle("Entries");
483 fhTOFTime->SetFillColor(4);
484 fhTOFTime->Draw();
485 cTOFtime->cd(2);
486 cTOFtime->GetPad(2)->SetLogy(1);
487 fhTOFDeltaTime->GetXaxis()->SetTitle("t^{TOF}-t^{exp}_{#pi} (ns)");
488 fhTOFDeltaTime->GetYaxis()->SetTitle("Entries");
489 fhTOFDeltaTime->SetFillColor(4);
490 fhTOFDeltaTime->Draw();
491
492 cTOFtime->Print("TOF_time.gif");
493 cTOFtime->Print("TOF_time.eps");
494
495
496 TCanvas * cTOFpid = new TCanvas("cTOFpid", "TOF PID ", 400, 30, 550, 630) ;
497 cTOFpid->Divide(1,3) ;
498 cTOFpid->cd(1);
499 cTOFpid->SetLogy(1);
500 fhTOFMass->GetXaxis()->SetTitle("Reconstructed Mass (GeV/c^{2})");
501 fhTOFMass->GetYaxis()->SetTitle("Entries");
502 fhTOFMass->SetFillColor(4);
503 fhTOFMass->Draw();
504 cTOFpid->SetLogy(0);
505 cTOFpid->cd(2);
506 fhTOFMassVsMom->GetYaxis()->SetRange(0,400);
507 fhTOFMassVsMom->GetXaxis()->SetTitle("Reconstructed Mass (GeV/c^{2})");
508 fhTOFMassVsMom->GetYaxis()->SetTitle("Track Momentum (GeV/c)");
509 fhTOFMassVsMom->GetXaxis()->SetTitleSize(0.05);
510 fhTOFMassVsMom->GetYaxis()->SetTitleSize(0.05);
511 fhTOFMassVsMom->SetMarkerStyle(20);
512 fhTOFMassVsMom->SetMarkerSize(0.05);
513 fhTOFMassVsMom->SetMarkerColor(2);
514 fhTOFMassVsMom->Draw();
515 cTOFpid->cd(3);
516
517 TLatex * tex = new TLatex(1., 1.25, "Bayesian PID: a-priori concentrations: [0,0,1,1,1]");
518 tex->SetTextColor(1);
519 tex->SetTextSize(0.045);
520 tex->SetLineWidth(2);
521
522 Float_t norm=1./fhTOFIDSpecies->GetEntries();
523 fhTOFIDSpecies->Scale(norm);
524 fhTOFIDSpecies->SetMaximum(1.2);
525 fhTOFIDSpecies->GetXaxis()->SetTitle("Particle Type");
526 fhTOFIDSpecies->GetYaxis()->SetTitle("ID Fractions");
527 fhTOFIDSpecies->GetXaxis()->SetTitleSize(0.05);
528 fhTOFIDSpecies->GetYaxis()->SetTitleSize(0.05);
529 fhTOFIDSpecies->SetFillColor(4);
530 fhTOFIDSpecies->Draw();
531 tex->Draw();
1dfe075f 532
1137ac22 533 char ch[10];
534
535 Float_t pifrac=fhTOFIDSpecies->GetBinContent(3);
536 Float_t kafrac=fhTOFIDSpecies->GetBinContent(4);
537 Float_t prfrac=fhTOFIDSpecies->GetBinContent(5);
538
539 sprintf(ch,"pion fraction = %5.3f",pifrac);
540 TLatex * texpi = new TLatex(-0.3, 0.9, ch);
541 texpi->SetTextColor(1);
542 texpi->SetTextSize(0.05);
543 texpi->SetLineWidth(2);
544 texpi->Draw();
545 sprintf(ch,"kaon fraction = %5.3f",kafrac);
546 TLatex * texka = new TLatex(-0.3, 0.8, ch);
547 texka->SetTextColor(1);
548 texka->SetTextSize(0.05);
549 texka->SetLineWidth(2);
550 texka->Draw();
551 sprintf(ch,"proton fraction = %5.3f",prfrac);
552 TLatex * texpr = new TLatex(-0.3, 0.7, ch);
553 texpr->SetTextColor(1);
554 texpr->SetTextSize(0.05);
555 texpr->SetLineWidth(2);
556 texpr->Draw();
1dfe075f 557
1137ac22 558
559 cTOFpid->Print("TOF_pid.gif");
560 cTOFpid->Print("TOF_pid.eps");
561
562 // draw all
563 //The General
1dfe075f 564
1137ac22 565
566 //The efficiency
1dfe075f 567}
568
569//______________________________________________________________________________
570void AliTOFQATask::Terminate(Option_t *)
571{
572 // Processing when the event loop is ended
573
574 // some plots
575
1137ac22 576 AliInfo("TOF QA Task: End of events loop");
577 GetEfficiency();
578 PostData(0, fOutputContainer);
579 DrawHistos() ;
580
1dfe075f 581}