1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 // An analysis task to check the TOF in simulated data
19 //-Distributions of the matching performance
20 //-TOF Time info and (TOF - expected time) plots
21 //-Summary Plots on TOF Pid
22 //////////////////////////////////////////////////////////////////////////////
31 #include <TSpectrum.h>
35 #include "AliTOFQATask.h"
37 #include "AliESDtrack.h"
40 //______________________________________________________________________________
41 AliTOFQATask::AliTOFQATask(const char *name) :
42 AliAnalysisTask(name,""),
70 // Input slot #0 works with an Ntuple
71 DefineInput(0, TChain::Class());
72 // Output slot #0 writes into a TH1 container
73 DefineOutput(0, TObjArray::Class()) ;
76 //______________________________________________________________________________
77 AliTOFQATask::AliTOFQATask(const AliTOFQATask &qatask) :
78 AliAnalysisTask("AliTOFQATask",""),
106 fChain=qatask.fChain;
108 fOutputContainer=qatask.fOutputContainer;
109 fhTOFMatch=qatask.fhTOFMatch;
110 fhESDeffPhi=qatask.fhESDeffPhi;
111 fhESDeffTheta=qatask.fhESDeffTheta;
112 fhESDeffMom=qatask.fhESDeffMom;
113 fhTOFeffPhi=qatask.fhTOFeffPhi;
114 fhTOFeffTheta=qatask.fhTOFeffTheta;
115 fhTOFeffMom=qatask.fhTOFeffMom;
116 fhTOFeffPhiMT=qatask.fhTOFeffPhiMT;
117 fhTOFeffThetaMT=qatask.fhTOFeffThetaMT;
118 fhTOFeffMomMT=qatask.fhTOFeffMomMT;
119 fhTOFsector=qatask.fhTOFsector;
120 fhTOFsectorMT=qatask.fhTOFsectorMT;
121 fhTOFTime=qatask.fhTOFTime;
122 fhTOFDeltaTime=qatask.fhTOFDeltaTime;
123 fhTOFDeltaTimeMT=qatask.fhTOFDeltaTimeMT;
124 fhTOFIDSpecies=qatask.fhTOFIDSpecies;
125 fhTOFMassVsMom=qatask.fhTOFMassVsMom;
126 fhTOFMass=qatask.fhTOFMass;
127 fmatchFracMin=qatask.fmatchFracMin;
128 fmatchEffMin=qatask.fmatchEffMin;
129 ftimePeakMax=qatask.ftimePeakMax;
130 fmassPeakMax=qatask.fmassPeakMax;
132 //______________________________________________________________________________
133 AliTOFQATask:: ~AliTOFQATask()
135 delete fOutputContainer;
138 delete fhESDeffTheta;
141 delete fhTOFeffTheta;
143 delete fhTOFeffPhiMT;
144 delete fhTOFeffThetaMT;
145 delete fhTOFeffMomMT;
147 delete fhTOFsectorMT;
149 delete fhTOFDeltaTime;
150 delete fhTOFDeltaTimeMT;
151 delete fhTOFIDSpecies;
152 delete fhTOFMassVsMom;
155 //______________________________________________________________________________
156 AliTOFQATask& AliTOFQATask::operator=(const AliTOFQATask &qatask)
158 //assignment operator
159 this->fChain=qatask.fChain;
160 this->fESD=qatask.fESD;
161 this->fOutputContainer=qatask.fOutputContainer;
162 this->fhTOFMatch=qatask.fhTOFMatch;
163 this->fhESDeffPhi=qatask.fhESDeffPhi;
164 this->fhESDeffTheta=qatask.fhESDeffTheta;
165 this->fhESDeffMom=qatask.fhESDeffMom;
166 this->fhTOFeffPhi=qatask.fhTOFeffPhi;
167 this->fhTOFeffTheta=qatask.fhTOFeffTheta;
168 this->fhTOFeffMom=qatask.fhTOFeffMom;
169 this->fhTOFeffPhiMT=qatask.fhTOFeffPhiMT;
170 this->fhTOFeffThetaMT=qatask.fhTOFeffThetaMT;
171 this->fhTOFeffMomMT=qatask.fhTOFeffMomMT;
172 this->fhTOFsector=qatask.fhTOFsector;
173 this->fhTOFsectorMT=qatask.fhTOFsectorMT;
174 this->fhTOFTime=qatask.fhTOFTime;
175 this->fhTOFDeltaTime=qatask.fhTOFDeltaTime;
176 this->fhTOFDeltaTimeMT=qatask.fhTOFDeltaTimeMT;
177 this->fhTOFIDSpecies=qatask.fhTOFIDSpecies;
178 this->fhTOFMassVsMom=qatask.fhTOFMassVsMom;
179 this->fhTOFMass=qatask.fhTOFMass;
180 this->fmatchFracMin=qatask.fmatchFracMin;
181 this->fmatchEffMin=qatask.fmatchEffMin;
182 this->ftimePeakMax=qatask.ftimePeakMax;
183 this->fmassPeakMax=qatask.fmassPeakMax;
186 //______________________________________________________________________________
187 void AliTOFQATask::ConnectInputData(const Option_t*)
189 // Initialisation of branch container and histograms
191 AliInfo(Form("*** Initialization of %s", GetName())) ;
194 fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
196 AliError(Form("Input 0 for %s not found\n", GetName()));
200 // One should first check if the branch address was taken by some other task
201 char ** address = (char **)GetBranchAddress(0, "ESD") ;
203 fESD = (AliESD *)(*address) ;
205 fESD = new AliESD() ;
206 SetBranchAddress(0, "ESD", &fESD) ;
210 //______________________________________________________________________________
211 void AliTOFQATask::Exec(Option_t *)
214 //******* The loop over events --------------------------------------------------
219 Int_t pisel=0,kasel=0,prsel=0,elsel=0,musel=0;
220 //Set equal a-priori weights (just charged hadrions)
221 const Int_t nCalinSec=8736;
222 Double_t c[5]={0, 0, 1, 1, 1};
223 // Processing of one event
224 Long64_t entry = fChain->GetReadEntry() ;
226 AliError("fESD is not connected to the input!") ;
230 if ( !((entry-1)%100) )
231 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
233 // ************************ TOF *************************************
236 Int_t ntrk = fESD->GetNumberOfTracks() ;
240 AliESDtrack * t = fESD->GetTrack(ntrk) ;
241 if ( (t->GetStatus() & AliESDtrack::kTIME)==0 )continue;
245 Double_t mom = t->GetP() ;
246 Double_t phi = TMath::ATan2(t->GetX(),t->GetY()) ;
247 Double_t theta = TMath::ACos(t->GetZ()/
248 TMath::Sqrt(t->GetX()*t->GetX()+t->GetY()*t->GetY()+t->GetZ()*t->GetZ()));
249 phi*=180/TMath::Pi();
250 theta*=180/TMath::Pi();
252 fhESDeffPhi->Fill(phi);
253 fhESDeffTheta->Fill(theta);
254 fhESDeffMom->Fill(mom);
257 if(t->GetTOFsignal()<0)continue;
261 Double_t time=t->GetTOFsignal();//TOF time in ps
262 Int_t detid=t->GetTOFCalChannel();//which pad was hit
263 Int_t sector = detid/nCalinSec;
264 fhTOFTime->Fill(time*1.E-3);
265 fhTOFeffPhi->Fill(phi);
266 fhTOFeffTheta->Fill(theta);
267 fhTOFeffMom->Fill(mom);
268 fhTOFsector->Fill(sector);
271 Int_t label=TMath::Abs(t->GetLabel());
272 Int_t clab[3]; t->GetTOFLabel(clab);
273 if(label==clab[0] || label==clab[1] || label==clab[2]) {
274 fhTOFeffPhiMT->Fill(phi);
275 fhTOFeffThetaMT->Fill(theta);
276 fhTOFeffMomMT->Fill(mom);
277 fhTOFsectorMT->Fill(sector);
282 UInt_t status=AliESDtrack::kESDpid;status|=AliESDtrack::kTOFpid;
283 if (!((t->GetStatus()&status) == status))continue;
286 t->GetIntegratedTimes(times);//ps
287 Double_t l =t->GetIntegratedLength()/100.; // (m)
289 Double_t invBetaGamma= (0.299*time*1.E-3/l)*(0.299*time*1.E-3/l) -1.;
290 if(invBetaGamma<0){mass = -mom*TMath::Sqrt(-invBetaGamma);}
291 else{mass = mom*TMath::Sqrt(invBetaGamma);}
293 //The Mass/ vs Momentum Plot:
294 fhTOFMassVsMom->Fill(mass,mom);
295 fhTOFMass->Fill(mass);
298 Double_t r[10]; t->GetTOFpid(r);
301 for (i=0; i<AliPID::kSPECIES; i++) rcc+=(c[i]*r[i]);
302 if (rcc==0.) continue;
304 for (i=0; i<AliPID::kSPECIES; i++) w[i]=c[i]*r[i]/rcc;
306 fhTOFDeltaTime->Fill((time-times[2])*1.E-3);
308 if(label==clab[0] || label==clab[1] || label==clab[2]) {
309 fhTOFDeltaTimeMT->Fill((time-times[2])*1.E-3);
312 if (w[4]>w[0] && w[4]>w[1] && w[4]>w[2] && w[4]>w[3]){
314 fhTOFIDSpecies->Fill(4);
316 if (w[3]>w[0] && w[3]>w[1] && w[3]>w[2] && w[3]>w[4]){
318 fhTOFIDSpecies->Fill(3);
320 if (w[2]>w[0] && w[2]>w[1] && w[2]>w[3] && w[2]>w[4]){
322 fhTOFIDSpecies->Fill(2);
324 if (w[1]>w[0] && w[1]>w[2] && w[1]>w[3] && w[1]>w[4]){
326 fhTOFIDSpecies->Fill(1);
328 if (w[0]>w[1] && w[0]>w[2] && w[0]>w[3] && w[0]>w[4]){
330 fhTOFIDSpecies->Fill(0);
335 if(nselESD>10)fracM=((Float_t) nmatchTOF)/((Float_t) nselESD);
336 fhTOFMatch->Fill(fracM);
338 PostData(0, fOutputContainer);
341 //______________________________________________________________________________
342 void AliTOFQATask::CreateOutputObjects()
344 // Construct histograms:
347 new TH1F("hTOFMatch","Fraction of Matched TOF tracks",101,-0.005,1.005);
349 new TH1F("hESDeffPhi","ESD tracks Phi(vtx)", 180, -180., 180.) ;
351 new TH1F("hESDeffTheta","ESD tracks Theta (vtx)",90, 45., 135.) ;
353 new TH1F("hESDeffMom","ESD tracks Momentum (vtx)",40, 0., 6.) ;
355 new TH1F("hTOFeffPhi","TOF, Matched vs Phi(vtx)", 180,-180, 180.);
357 new TH1F("hTOFeffPhiMT","TOF, Well Matched vs Phi(vtx)",180,-180,180.);
359 new TH1F("hTOFeffTheta","TOF, Matched vs Theta(vtx)",90,45.,135.);
361 new TH1F("hTOFeffThetaMT","TOF, Well Matched vs Theta(vtx)",90,45.,135.);
363 new TH1F("hTOFeffMom","TOF, Matched vs Momentum ", 40, 0.,6.);
365 new TH1F("hTOFeffMomMT","TOF, Well Matched vs Momentum ", 40, 0.,6.);
367 new TH1F("hTOFsector","TOF, Matched vs Sector ", 18,0.,18.);
369 new TH1F("hTOFsectorMT","TOF, Well Matched vs Sector", 18, 0.,18.);
371 fhESDeffMom->Sumw2(); fhTOFeffMom->Sumw2(); fhTOFeffMomMT->Sumw2();
372 fhESDeffTheta->Sumw2(); fhTOFeffTheta->Sumw2(); fhTOFeffThetaMT->Sumw2();
373 fhESDeffPhi->Sumw2(); fhTOFeffPhi->Sumw2(); fhTOFeffPhiMT->Sumw2();
374 fhTOFsector->Sumw2(); fhTOFsectorMT->Sumw2();
377 new TH1F("hTOFTime","TOF, t(TOF)in ns ",1000,0,100.);
379 new TH1F("hTOFDeltaTime","TOF,t(TOF)-t(exp,pion), ns ",1000,-4.4,20.);
381 new TH1F("hTOFDeltaTimeMT","TOF, t(TOF)-t(exp,pion) for Well Matched, ns ",1000,-4.4,20.);
383 new TH1F("hTOFIDSpecies","TOF, ID Sample Composition ",5,-0.5,4.5);
385 new TH2F("hTOFMassVsMom","TOF, Mass Vs Momentum ",280,-0.2,1.2,600,0.,6.);
387 new TH1F("hTOFMass","TOF, reconstructed mass ",280,-0.2,1.2);
390 // create the output container
392 fOutputContainer = new TObjArray(18) ;
393 fOutputContainer->SetName(GetName()) ;
395 fOutputContainer->AddAt(fhTOFMatch, 0) ;
396 fOutputContainer->AddAt(fhESDeffPhi, 1) ;
397 fOutputContainer->AddAt(fhESDeffTheta, 2) ;
398 fOutputContainer->AddAt(fhESDeffMom, 3) ;
399 fOutputContainer->AddAt(fhTOFeffPhi, 4) ;
400 fOutputContainer->AddAt(fhTOFeffPhiMT, 5) ;
401 fOutputContainer->AddAt(fhTOFeffTheta, 6) ;
402 fOutputContainer->AddAt(fhTOFeffThetaMT, 7) ;
403 fOutputContainer->AddAt(fhTOFeffMom, 8) ;
404 fOutputContainer->AddAt(fhTOFeffMomMT, 9) ;
405 fOutputContainer->AddAt(fhTOFsector, 10) ;
406 fOutputContainer->AddAt(fhTOFsectorMT, 11) ;
407 fOutputContainer->AddAt(fhTOFTime, 12) ;
408 fOutputContainer->AddAt(fhTOFDeltaTime , 13) ;
409 fOutputContainer->AddAt(fhTOFDeltaTimeMT, 14) ;
410 fOutputContainer->AddAt(fhTOFIDSpecies, 15) ;
411 fOutputContainer->AddAt(fhTOFMassVsMom, 16) ;
412 fOutputContainer->AddAt(fhTOFMass, 17) ;
415 //______________________________________________________________________________
416 void AliTOFQATask::GetEfficiency()
418 // calculates the efficiency
421 fhTOFeffPhiMT->Divide(fhTOFeffPhiMT,fhTOFeffPhi,1,1,"B");
422 fhTOFeffThetaMT->Divide(fhTOFeffThetaMT,fhTOFeffTheta,1,1,"B");
423 fhTOFeffMomMT->Divide(fhTOFeffMomMT,fhTOFeffMom,1,1,"B");
425 fhTOFeffPhi->Divide(fhTOFeffPhi,fhESDeffPhi,1,1,"B");
426 fhTOFeffTheta->Divide(fhTOFeffTheta,fhESDeffTheta,1,1,"B");
427 fhTOFeffMom->Divide(fhTOFeffMom,fhESDeffMom,1,1,"B");
431 //______________________________________________________________________________
432 Bool_t AliTOFQATask::DrawHistos()
436 Int_t TOFsectors[18]={0,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1};//TOF sectors which are supposed to be present
437 const char* part[3]={"pions","kaons","protons"};// pi,ka,pr
438 const Float_t masses[3]={0.1396,0.494,0.938};// particle masses pi,ka,pr
441 gROOT->SetStyle("Plain");
442 gStyle->SetPalette(1);
443 gStyle->SetOptStat(111110);
444 gStyle->SetPalette(1);
445 gStyle->SetCanvasColor(0);
446 gStyle->SetFrameFillColor(0);
448 TGaxis::SetMaxDigits(3);
449 gStyle->SetLabelFont(52, "XYZ");
450 gStyle->SetTitleFont(62, "XYZ");
451 gStyle->SetPadRightMargin(0.02);
454 TCanvas * cTOFeff = new TCanvas("cTOFeff", "TOF ESD General", 400, 30, 550, 630) ;
456 cTOFeff->Divide(1,2) ;
458 fhTOFMatch->GetXaxis()->SetTitle("Fraction of matched ESD tracks/event");
459 fhTOFMatch->GetYaxis()->SetTitle("Events");
460 fhTOFMatch->SetFillColor(4);
463 TPad *b = (TPad*)gPad;
466 fhTOFsector->GetXaxis()->SetTitle("Sector index of matched TOF Cluster");
467 fhTOFsector->GetYaxis()->SetTitle("Entries");
468 fhTOFsector->SetFillColor(4);
469 fhTOFsector->SetMinimum(0.);
470 fhTOFsector->GetYaxis()->SetNdivisions(205);
471 fhTOFsector->GetYaxis()->SetTitleOffset(1.2);
472 fhTOFsector->Draw("histo");
474 fhTOFeffMom->SetMaximum(1.2);
475 fhTOFeffMom->GetXaxis()->SetTitle("Track momentum (GeV/c)");
476 fhTOFeffMom->GetYaxis()->SetNdivisions(205);
477 fhTOFeffMom->GetYaxis()->SetTitleOffset(1.2);
478 fhTOFeffMom->GetYaxis()->SetTitle("Fraction of matched ESD tracks");
479 fhTOFeffMom->SetFillColor(4);
481 fhTOFeffMom->Fit("pol0","Q","",0.5,3.);
482 TF1 *fitMom = fhTOFeffMom->GetFunction("pol0");
483 fhTOFeffMom->Draw("histo,same");
485 cTOFeff->Print("TOF_eff.eps");
489 TCanvas * cTOFtime = new TCanvas("cTOFtime", "TOF measured Times ", 400, 30, 550, 630) ;
490 cTOFtime->Divide(1,2) ;
492 if ( fhTOFTime->GetMaximum() > 0 )
493 cTOFtime->GetPad(1)->SetLogy(1);
494 fhTOFTime->GetXaxis()->SetTitle("TOF time (ns)");
495 fhTOFTime->GetYaxis()->SetTitle("Entries");
496 fhTOFTime->SetFillColor(4);
499 if ( fhTOFDeltaTime->GetMaximum() > 0 )
500 cTOFtime->GetPad(2)->SetLogy(1);
501 fhTOFDeltaTime->GetXaxis()->SetTitle("t^{TOF}-t^{exp}_{#pi} (ns)");
502 fhTOFDeltaTime->GetYaxis()->SetTitle("Entries");
503 fhTOFDeltaTime->SetFillColor(4);
505 TSpectrum *timeDiff = new TSpectrum(2*ntimepeak);
506 Int_t ntime = timeDiff->Search(fhTOFDeltaTime,ntimepeak," ",0.1);
507 fhTOFDeltaTime->Draw();
509 cTOFtime->Print("TOF_time.eps");
512 TCanvas * cTOFpid = new TCanvas("cTOFpid", "TOF PID ", 400, 30, 550, 630) ;
513 cTOFpid->Divide(1,3) ;
515 if ( fhTOFMass->GetMaximum() > 0 )
517 fhTOFMass->GetXaxis()->SetTitle("Reconstructed Mass (GeV/c^{2})");
518 fhTOFMass->GetYaxis()->SetTitle("Entries");
519 fhTOFMass->SetFillColor(4);
521 if(fhTOFMass->GetEntries()>1000)npmass=3;
522 TSpectrum *mass = new TSpectrum(2*npmass);
523 Int_t nmass = mass->Search(fhTOFMass,npmass," ",0.02);
525 if ( fhTOFMassVsMom->GetMaximum() > 0 )
528 fhTOFMassVsMom->GetYaxis()->SetRange(0,400);
529 fhTOFMassVsMom->GetXaxis()->SetTitle("Reconstructed Mass (GeV/c^{2})");
530 fhTOFMassVsMom->GetYaxis()->SetTitle("Track Momentum (GeV/c)");
531 fhTOFMassVsMom->GetXaxis()->SetTitleSize(0.05);
532 fhTOFMassVsMom->GetYaxis()->SetTitleSize(0.05);
533 fhTOFMassVsMom->SetMarkerStyle(20);
534 fhTOFMassVsMom->SetMarkerSize(0.05);
535 fhTOFMassVsMom->SetMarkerColor(2);
536 fhTOFMassVsMom->Draw();
539 TLatex * tex = new TLatex(1., 1.25, "Bayesian PID: a-priori concentrations: [0,0,1,1,1]");
540 tex->SetTextColor(1);
541 tex->SetTextSize(0.045);
542 tex->SetLineWidth(2);
544 Float_t norm=1./fhTOFIDSpecies->GetEntries();
545 fhTOFIDSpecies->Scale(norm);
546 fhTOFIDSpecies->SetMaximum(1.2);
547 fhTOFIDSpecies->GetXaxis()->SetTitle("Particle Type");
548 fhTOFIDSpecies->GetYaxis()->SetTitle("ID Fractions");
549 fhTOFIDSpecies->GetXaxis()->SetTitleSize(0.05);
550 fhTOFIDSpecies->GetYaxis()->SetTitleSize(0.05);
551 fhTOFIDSpecies->SetFillColor(4);
552 fhTOFIDSpecies->Draw();
557 Float_t pifrac=fhTOFIDSpecies->GetBinContent(3);
558 Float_t kafrac=fhTOFIDSpecies->GetBinContent(4);
559 Float_t prfrac=fhTOFIDSpecies->GetBinContent(5);
561 sprintf(ch,"[2]:pion fraction = %5.3f",pifrac);
562 TLatex * texpi = new TLatex(-0.3, 0.9, ch);
563 texpi->SetTextColor(1);
564 texpi->SetTextSize(0.05);
565 texpi->SetLineWidth(2);
567 sprintf(ch,"[3]:kaon fraction = %5.3f",kafrac);
568 TLatex * texka = new TLatex(-0.3, 0.8, ch);
569 texka->SetTextColor(1);
570 texka->SetTextSize(0.05);
571 texka->SetLineWidth(2);
573 sprintf(ch,"[4]:proton fraction = %5.3f",prfrac);
574 TLatex * texpr = new TLatex(-0.3, 0.7, ch);
575 texpr->SetTextColor(1);
576 texpr->SetTextSize(0.05);
577 texpr->SetLineWidth(2);
581 cTOFpid->Print("TOF_pid.eps");
584 sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
585 gROOT->ProcessLine(line);
586 sprintf(line, ".!rm -fR *.eps");
587 gROOT->ProcessLine(line);
588 AliInfo(Form("*** TOF QA plots saved in %s.tar.gz...", GetName())) ;
590 Bool_t problem=kFALSE;
591 //------------------------------Matching Efficiency
594 Float_t matchFrac= fhTOFMatch->GetMean();
595 if(matchFrac<fmatchFracMin){
596 AliWarning(Form("*** Overall Fraction of matched tracks too low! Fraction = %f", matchFrac)) ;
599 AliInfo(Form("*** Fraction of matched tracks = %f", matchFrac)) ;
602 if(fhTOFeffMom->GetEntries()<1.){
603 AliWarning(Form("*** No tracks matching with TOF! Fraction is = %f", matchFrac)) ;
608 //The efficiency as a function of momentum:
609 Float_t eff= fitMom->GetParameter(0);
610 Float_t deff= fitMom->GetParError(0);
611 if(eff+3*deff<fmatchEffMin){
612 AliWarning(Form("*** Fraction of matched tracks vs Momentum is too low! Fraction= %f", eff)) ;
615 AliInfo(Form("*** Fraction of matched tracks for p>0.5 GeV is = %f", eff)) ;
618 //Matched tracks vs TOF Sector:
619 for(Int_t isec=1;isec<=18;isec++){
620 if(fhTOFsector->GetBinContent(isec)<1 && TOFsectors[isec-1]>0){
621 AliWarning(Form("*** Missing Entries in sector %i", isec));
624 if(fhTOFsector->GetBinContent(isec)>0 && TOFsectors[isec-1]==0){
625 AliWarning(Form("*** Unexpected Entries in sector %i", isec));
630 //-----------------------------Pid Quality
632 // Look at the time - expected time:
633 if(ntime==0)AliWarning("*** No peak was found in time difference spectrum!");
634 Float_t *timePos = timeDiff->GetPositionX();
635 if(TMath::Abs(timePos[0])>ftimePeakMax){
636 AliWarning(Form("*** Main Peak position in tTOF-TEXP spectrum is sitting far from where expected! Tpeak = %f ps",timePos[0]*1.E3));
639 AliInfo(Form("*** Main Peak position in tTOF-TEXP found at = %f ps",timePos[0]*1.E3));
641 // Look at the Mass Spectrum:
642 if(nmass==0)AliWarning("*** No peak was found in Mass difference spectrum!");
643 Float_t *massPos = mass->GetPositionX();
644 for(Int_t imass=0;imass<nmass;imass++){
645 AliInfo(Form("*** the Mass peak for %s found at = %f GeV/c^2",part[imass],massPos[imass]));
646 if(TMath::Abs( massPos[imass]-masses[imass])> fmassPeakMax){
647 AliWarning(Form("*** the Mass peak position for %s is not in the right place, found at = %f GeV/c^2",part[imass],massPos[imass]));
652 // Look at the ID Species:
654 if(fhTOFIDSpecies->GetEntries()>1000){
655 if(pifrac<0.8 || (kafrac<0.01 || kafrac>0.2) || (prfrac<0.01 || prfrac>0.2)){
656 AliWarning(Form("*** Unexpected Id fractions: pions = %f, kaons = %f, protons %f", pifrac,kafrac,prfrac));
666 //______________________________________________________________________________
667 void AliTOFQATask::Terminate(Option_t *)
669 // Processing when the event loop is ended, some plots+checks
671 AliInfo(Form("*** %s Report:", GetName())) ;
673 Bool_t problem = DrawHistos() ;
677 report="Problems found, please check!!!";
681 AliInfo(Form("*** %s Summary Report: %s\n",GetName(), report)) ;