]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ESDCheck/AliPMDQATask.cxx
add TOF QA stuff
[u/mrichter/AliRoot.git] / ESDCheck / AliPMDQATask.cxx
1
2 /**************************************************************************
3  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  *                                                                        *
5  * Author: The ALICE Off-line Project.                                    *
6  * Contributors are mentioned in the code where appropriate.              *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /* $Id$ */
18
19 //_________________________________________________________________________
20 // An analysis task to check the PMD data in simulated data
21 //
22 //*-- Yves Schutz 
23 //////////////////////////////////////////////////////////////////////////////
24
25 #include <TCanvas.h>
26 #include <TChain.h>
27 #include <TFile.h> 
28 #include <TH2F.h>
29 #include <TLine.h> 
30 #include <TROOT.h>
31 #include <TStyle.h> 
32 #include <TString.h> 
33
34 #include "AliPMDQATask.h" 
35 #include "AliPMDUtility.h" 
36 #include "AliESD.h" 
37 #include "AliLog.h"
38
39 //______________________________________________________________________________
40 AliPMDQATask::AliPMDQATask(const char *name) : 
41   AliAnalysisTask(name,""),  
42   fChain(0),
43   fESD(0), 
44   fhPMDP1(0),
45   fhPMDC2(0),
46   fhPMDP2(0),
47   fhPMDC3(0),
48   fhPMDP3(0),
49   fhPMDP4(0),
50   fhPMDC5(0),
51   fhPMDP5(0),
52   fhPMDCP0(0),
53   fhPMDCP1(0),
54   fhPMDCP2(0),
55   fhPMDCP3(0),
56   fhPMDCP4(0),
57   fhPMDSM1(0),
58   fhPMDSM2(0),
59   fhPMDSM3(0),
60   fhPMDSM4(0),
61   fhPMDSM5(0),
62   fhPMDSM6(0),
63   fhPMDSM7(0),
64   fhPMDSM8(0),
65   fhPMDSM9(0),
66   fhPMDSM10(0),
67   fhPMDSM11(0),
68   fhPMDSM12(0),
69   fhPMDSM13(0),
70   fhPMDSM14(0),
71   fhPMDSM15(0),
72   fhPMDSM16(0),
73   fhPMDSM17(0),
74   fhPMDSM18(0),
75   fhPMDSM19(0),
76   fhPMDSM20(0),
77   fhPMDSM21(0),
78   fhPMDSM22(0),
79   fhPMDSM23(0),
80   fhPMDSM24(0),
81   fhPMDSM (0)
82 {
83   // Constructor.
84   // Input slot #0 works with an Ntuple
85   DefineInput(0, TChain::Class());
86   // Output slot #0 writes into a TH1 container
87   DefineOutput(0,  TObjArray::Class()) ; 
88 }
89
90 //______________________________________________________________________________
91 AliPMDQATask::AliPMDQATask(const  AliPMDQATask& ta) : 
92 AliAnalysisTask(ta.GetName(), ""),  
93 fChain(ta.fChain),
94 fESD(ta.fESD), 
95 fhPMDP1(ta.fhPMDP1),
96 fhPMDC2(ta.fhPMDC2),
97 fhPMDP2(ta.fhPMDP2),
98 fhPMDC3(ta.fhPMDC3),
99 fhPMDP3(ta.fhPMDP3),
100 fhPMDP4(ta.fhPMDP4),
101 fhPMDC5(ta.fhPMDC5),
102 fhPMDP5(ta.fhPMDP5),
103 fhPMDCP0(ta.fhPMDCP0),
104 fhPMDCP1(ta.fhPMDCP1),
105 fhPMDCP2(ta.fhPMDCP2),
106 fhPMDCP3(ta.fhPMDCP3),
107 fhPMDCP4(ta.fhPMDCP4),
108 fhPMDSM1(ta.fhPMDSM1),
109 fhPMDSM2(ta.fhPMDSM2),
110 fhPMDSM3(ta.fhPMDSM3),
111 fhPMDSM4(ta.fhPMDSM4),
112 fhPMDSM5(ta.fhPMDSM5),
113 fhPMDSM6(ta.fhPMDSM6),
114 fhPMDSM7(ta.fhPMDSM7),
115 fhPMDSM8(ta.fhPMDSM8),
116 fhPMDSM9(ta.fhPMDSM9),
117 fhPMDSM10(ta.fhPMDSM10),
118 fhPMDSM11(ta.fhPMDSM11),
119 fhPMDSM12(ta.fhPMDSM12),
120 fhPMDSM13(ta.fhPMDSM13),
121 fhPMDSM14(ta.fhPMDSM14),
122 fhPMDSM15(ta.fhPMDSM15),
123 fhPMDSM16(ta.fhPMDSM16),
124 fhPMDSM17(ta.fhPMDSM17),
125 fhPMDSM18(ta.fhPMDSM18),
126 fhPMDSM19(ta.fhPMDSM19),
127 fhPMDSM20(ta.fhPMDSM20),
128 fhPMDSM21(ta.fhPMDSM21),
129 fhPMDSM22(ta.fhPMDSM22),
130 fhPMDSM23(ta.fhPMDSM23),
131 fhPMDSM24(ta.fhPMDSM24),
132 fhPMDSM (ta.fhPMDSM)
133 {
134         // copy constructor
135 }
136
137 //_____________________________________________________________________________
138 AliPMDQATask& AliPMDQATask::operator = (const AliPMDQATask& ap)
139 {
140         // assignment operator
141         
142         this->~AliPMDQATask();
143         new(this) AliPMDQATask(ap);
144         return *this;
145 }
146
147 //______________________________________________________________________________
148 AliPMDQATask::~AliPMDQATask()
149 {
150   // dtor
151   fOutputContainer->Clear() ; 
152   delete fOutputContainer ;
153   
154   delete fhPMDP1  ;
155   delete fhPMDC2  ;
156   delete fhPMDP2  ;
157   delete fhPMDC3  ;
158   delete fhPMDP3  ;
159   delete fhPMDP4  ;
160   delete fhPMDC5  ;
161   delete fhPMDP5  ;
162   delete fhPMDCP0 ;
163   delete fhPMDCP1 ;
164   delete fhPMDCP2 ;
165   delete fhPMDCP3 ;
166   delete fhPMDCP4 ;
167   delete fhPMDSM1  ;
168   delete fhPMDSM2  ;
169   delete fhPMDSM3  ;
170   delete fhPMDSM4  ;
171   delete fhPMDSM5  ;
172   delete fhPMDSM6  ;
173   delete fhPMDSM7  ;
174   delete fhPMDSM8  ;
175   delete fhPMDSM9  ;
176   delete fhPMDSM10 ;
177   delete fhPMDSM11 ;
178   delete fhPMDSM12 ;
179   delete fhPMDSM13 ;
180   delete fhPMDSM14 ;
181   delete fhPMDSM15 ;
182   delete fhPMDSM16 ;
183   delete fhPMDSM17 ;
184   delete fhPMDSM18 ;
185   delete fhPMDSM19 ;
186   delete fhPMDSM20 ;
187   delete fhPMDSM21 ;
188   delete fhPMDSM22 ;
189   delete fhPMDSM23 ;
190   delete fhPMDSM24 ;
191   delete fhPMDSM   ;
192   
193 }
194
195 //______________________________________________________________________________
196 void AliPMDQATask::ConnectInputData(const Option_t*)
197 {
198   // Initialisation of branch container and histograms 
199     
200   AliInfo(Form("*** Initialization of %s", GetName())) ; 
201     
202   // Get input data
203   fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
204   if (!fChain) {
205     AliError(Form("Input 0 for %s not found\n", GetName()));
206     return ;
207   }
208   
209   // One should first check if the branch address was taken by some other task
210   char ** address = (char **)GetBranchAddress(0, "ESD");
211   if (address) {
212     fESD = (AliESD*)(*address);
213   } else {
214     fESD = new AliESD();
215     SetBranchAddress(0, "ESD", &fESD);
216   }
217 }
218
219 //________________________________________________________________________
220 void AliPMDQATask::CreateOutputObjects()
221 {  
222   // create histograms 
223   
224   OpenFile(0) ; 
225
226   fhPMDP1   = new TH2F("fhPMDP1","XY of Clusters",100,-100.,100.,100,-100.,100.);
227   fhPMDC2   = new TH1F("fhPMDC2","CPV  PHI",200,-1,9);
228   fhPMDP2   = new TH1F("fhPMDP2","PRE  PHI",200,-1,9);
229   fhPMDC3   = new TH1F("fhPMDC3","CPV  Clus",30,0.,500.);
230   fhPMDP3   = new TH1F("fhPMDP3","PRE  N-gammalike",20,0.,500.);
231   fhPMDP4   = new TH1F("fhPMDP4","PRE  EDEP",30,0.,1000.);
232   fhPMDC5   = new TH1F("fhPMDC5","CPV  n-cell",20,0.,100.);
233   fhPMDP5   = new TH1F("fhPMDP5","PMD  n-cell",20,0.,100.);
234   fhPMDCP0  = new TH2F("fhPMDCP0","PRE CLUS Quad.1 vs 2",150,0.,300.,150,0.,300.);
235   fhPMDCP1  = new TH2F("fhPMDCP1","PRE CLUS Quad.3 vs 4",150,0.,300.,150,0.,300.);
236   fhPMDCP2  = new TH2F("fhPMDCP2","PRE EDEP Quad.3 vs 4",50,0.,300.,50,0.,300.);
237   fhPMDCP3  = new TH2F("fhPMDCP3","PRE EDEP vs Tot Clus ",10,0.,1000.,10,0.,300.);
238   fhPMDCP4  = new TH2F("fhPMDCP4","PRE Clus vs CPV Clus ",150,0.,200.,150,0.,200.);
239
240   fhPMDSM1  = new TH2F("fhPMDSM1","PRE Cluster XY",200,-100,100,200,-100,100);
241   fhPMDSM2  = new TH2F("fhPMDSM2","",999,-100.0,100.0,999,-100.0,100.0);
242   fhPMDSM3  = new TH2F("fhPMDSM3","",999,-100.0,100.0,999,-100.0,100.0);
243   fhPMDSM4  = new TH2F("fhPMDSM4","",999,-100.0,100.0,999,-100.0,100.0);
244   fhPMDSM5  = new TH2F("fhPMDSM5","",999,-100.0,100.0,999,-100.0,100.0);
245   fhPMDSM6  = new TH2F("fhPMDSM6","",999,-100.0,100.0,999,-100.0,100.0);
246   fhPMDSM7  = new TH2F("fhPMDSM7","",999,-100.0,100.0,999,-100.0,100.0);
247   fhPMDSM8  = new TH2F("fhPMDSM8","",999,-100.0,100.0,999,-100.0,100.0);
248   fhPMDSM9  = new TH2F("fhPMDSM9","",999,-100.0,100.0,999,-100.0,100.0);
249   fhPMDSM10 = new TH2F("fhPMDSM10","",999,-100.0,100.0,999,-100.0,100.0);
250   fhPMDSM11 = new TH2F("fhPMDSM11","",999,-100.0,100.0,999,-100.0,100.0);
251   fhPMDSM12 = new TH2F("fhPMDSM12","",999,-100.0,100.0,999,-100.0,100.0);
252   fhPMDSM13 = new TH2F("fhPMDSM13","",999,-100.0,100.0,999,-100.0,100.0);
253   fhPMDSM14 = new TH2F("fhPMDSM14","",999,-100.0,100.0,999,-100.0,100.0);
254   fhPMDSM15 = new TH2F("fhPMDSM15","",999,-100.0,100.0,999,-100.0,100.0);
255   fhPMDSM16 = new TH2F("fhPMDSM16","",999,-100.0,100.0,999,-100.0,100.0);
256   fhPMDSM17 = new TH2F("fhPMDSM17","",999,-100.0,100.0,999,-100.0,100.0);
257   fhPMDSM18 = new TH2F("fhPMDSM18","",999,-100.0,100.0,999,-100.0,100.0);
258   fhPMDSM19 = new TH2F("fhPMDSM19","",999,-100.0,100.0,999,-100.0,100.0);
259   fhPMDSM20 = new TH2F("fhPMDSM20","",999,-100.0,100.0,999,-100.0,100.0);
260   fhPMDSM21 = new TH2F("fhPMDSM21","",999,-100.0,100.0,999,-100.0,100.0);
261   fhPMDSM22 = new TH2F("fhPMDSM22","",999,-100.0,100.0,999,-100.0,100.0);
262   fhPMDSM23 = new TH2F("fhPMDSM23","",999,-100.0,100.0,999,-100.0,100.0);
263   fhPMDSM24 = new TH2F("fhPMDSM24","",999,-100.0,100.0,999,-100.0,100.0);
264   fhPMDSM   = new TH1F("fhPMDSM","Plot of all 24 Super Modules",24,0,24);
265   
266   // create output container
267   
268   fOutputContainer = new TObjArray(38) ; 
269   fOutputContainer->SetName("PMD") ; 
270
271   fOutputContainer->AddAt(fhPMDP1,    0 );
272   fOutputContainer->AddAt(fhPMDC2,    1 );
273   fOutputContainer->AddAt(fhPMDP2,    2 );
274   fOutputContainer->AddAt(fhPMDC3,    3 );
275   fOutputContainer->AddAt(fhPMDP3,    4 );
276   fOutputContainer->AddAt(fhPMDP4,    5 );
277   fOutputContainer->AddAt(fhPMDC5,    6 );
278   fOutputContainer->AddAt(fhPMDP5,    7 );
279   fOutputContainer->AddAt(fhPMDCP0,   8 );
280   fOutputContainer->AddAt(fhPMDCP1,   9);
281   fOutputContainer->AddAt(fhPMDCP2,  10 );
282   fOutputContainer->AddAt(fhPMDCP3,  11 );
283   fOutputContainer->AddAt(fhPMDCP4,  12 );
284   
285   fOutputContainer->AddAt(fhPMDSM1,  13 );
286   fOutputContainer->AddAt(fhPMDSM2,  14 );
287   fOutputContainer->AddAt(fhPMDSM3,  15 );
288   fOutputContainer->AddAt(fhPMDSM4,  16 );
289   fOutputContainer->AddAt(fhPMDSM5,  17 );
290   fOutputContainer->AddAt(fhPMDSM6,  18 );
291   fOutputContainer->AddAt(fhPMDSM7,  19 );
292   fOutputContainer->AddAt(fhPMDSM8,  20 );
293   fOutputContainer->AddAt(fhPMDSM9,  21 );
294   fOutputContainer->AddAt(fhPMDSM10, 22 );
295   fOutputContainer->AddAt(fhPMDSM11, 23 );
296   fOutputContainer->AddAt(fhPMDSM12, 24 );
297   fOutputContainer->AddAt(fhPMDSM13, 25 );
298   fOutputContainer->AddAt(fhPMDSM14, 26 );
299   fOutputContainer->AddAt(fhPMDSM15, 27 );
300   fOutputContainer->AddAt(fhPMDSM16, 28 );
301   fOutputContainer->AddAt(fhPMDSM17, 29 );
302   fOutputContainer->AddAt(fhPMDSM18, 30 );
303   fOutputContainer->AddAt(fhPMDSM19, 31 );
304   fOutputContainer->AddAt(fhPMDSM20, 32 );
305   fOutputContainer->AddAt(fhPMDSM21, 33 );
306   fOutputContainer->AddAt(fhPMDSM22, 34 );
307   fOutputContainer->AddAt(fhPMDSM23, 35 );
308   fOutputContainer->AddAt(fhPMDSM24, 36 );
309   fOutputContainer->AddAt(fhPMDSM,   37 );
310 }
311
312 //______________________________________________________________________________
313 void AliPMDQATask::Exec(Option_t *) 
314 {
315   // Processing of one event
316   
317   Long64_t entry = fChain->GetReadEntry() ;
318   
319   if (!fESD) {
320     AliError("fESD is not connected to the input!") ; 
321     return ; 
322   }
323   
324   if ( !((entry-1)%100) ) 
325     AliInfo(Form("%s ----> Processing event # %lld",  (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ; 
326   
327   // ************************ PMD
328
329   AliPMDUtility *cc = new AliPMDUtility(); 
330   
331   Int_t smn;
332   Int_t n=0;
333   Float_t totCPVClus     ;
334   Float_t totPREClus     ;
335   Float_t totPREEdep  ;
336   Float_t totCPVCell     ;
337   Float_t totPRECell     ;
338   Float_t preCluQUAD[4]  ;
339   Float_t cpvCluQUAD[4]  ;
340   Float_t preADCQUAD[4]  ;
341   Float_t cpvADCQUAD[4]  ;
342   Float_t preCelQUAD[4]  ;
343   Float_t cpvCelQUAD[4]  ;
344
345   Int_t npmdCl = fESD->GetNumberOfPmdTracks();
346   
347   // ****** The loop over PMD clusters
348
349   for (Int_t kk = 0; kk < 4 ; kk++) {
350     cpvCluQUAD[kk] = 0.0 ;
351     preCluQUAD[kk] = 0.0 ;
352     cpvCelQUAD[kk] = 0.0 ;
353     preCelQUAD[kk] = 0.0 ;
354     preADCQUAD[kk] = 0.0 ;
355   } 
356  
357   while (npmdCl--) {
358     
359     AliESDPmdTrack * pmdtr = fESD->GetPmdTrack(npmdCl);
360     Int_t   det   = pmdtr->GetDetector();
361     Float_t clsX  = pmdtr->GetClusterX();
362     Float_t clsY  = pmdtr->GetClusterY();
363     Float_t clsZ  = pmdtr->GetClusterZ();
364     Float_t ncell = pmdtr->GetClusterCells();
365     Float_t adc   = pmdtr->GetClusterADC();
366     
367     cc->SetXYZ(clsX,clsY,clsZ);
368     cc->CalculateEta();
369     cc->CalculatePhi();
370     Float_t eta = cc->GetEta();
371     Float_t phi = cc->GetPhi();
372     
373    // Calculating S.Module Number from Cluster .
374     
375     CalculateSMN(clsX, clsY, smn);
376     if( det == 1)
377       {
378         if(smn >= 0 && smn <= 5) {
379           ++cpvCluQUAD[0] ;
380           cpvADCQUAD[0] =+ adc  ;
381           cpvCelQUAD[0] =+ ncell ;
382         }
383         if(smn >= 6 && smn <=11) {
384           ++cpvCluQUAD[1] ;
385           cpvADCQUAD[1] =+ adc  ;
386           cpvCelQUAD[1] =+ ncell ;
387         }
388         if(smn >=12 && smn <=17) {
389           ++cpvCluQUAD[2] ;
390           cpvADCQUAD[2] =+ adc  ;
391           cpvCelQUAD[2] =+ ncell ;
392         }
393         if(smn >=18 && smn <=23) {
394           ++cpvCluQUAD[3] ;
395           cpvADCQUAD[3] =+ adc  ;
396           cpvCelQUAD[3] =+ ncell ;
397         }
398         
399         if(eta >= 2.3 && eta <= 3.5)
400           {
401             fhPMDC2->Fill(phi);
402           }
403       }
404     if( det == 0)
405       {
406         if(smn >= 0 && smn <= 5) { 
407           ++preCluQUAD[0] ;
408           preADCQUAD[0] =+ adc  ;    
409           preCelQUAD[0] =+ ncell ;    
410         }    
411         if(smn >= 6 && smn <=11) { 
412           ++preCluQUAD[1] ;
413           preADCQUAD[1] =+ adc  ;    
414           preCelQUAD[1] =+ ncell ;    
415         }    
416         if(smn >=12 && smn <=17) { 
417           ++preCluQUAD[2] ;
418           preADCQUAD[2] =+ adc  ;    
419           preCelQUAD[2] =+ ncell ;    
420         }    
421         if(smn >=18 && smn <=23) { 
422           ++preCluQUAD[3] ;
423           preADCQUAD[3] =+ adc  ;    
424           preCelQUAD[3] =+ ncell ;    
425         }    
426         if ( n <= 100 ) { 
427           fhPMDSM->Fill(smn);
428           if(smn == 0) fhPMDSM1->Fill(-clsX,clsY);
429           if(smn == 0) fhPMDSM1->Fill(-clsX,clsY);
430           if(smn == 1) fhPMDSM2->Fill(-clsX,clsY);
431           if(smn == 2) fhPMDSM3->Fill(-clsX,clsY);
432           if(smn == 3) fhPMDSM4->Fill(-clsX,clsY);
433           if(smn == 4) fhPMDSM5->Fill(-clsX,clsY);
434           if(smn == 5) fhPMDSM6->Fill(-clsX,clsY);
435           if(smn == 6) fhPMDSM7->Fill(-clsX,clsY);
436           if(smn == 7) fhPMDSM8->Fill(-clsX,clsY);
437           if(smn == 8) fhPMDSM9->Fill(-clsX,clsY);
438           if(smn == 9) fhPMDSM10->Fill(-clsX,clsY);
439           if(smn ==10) fhPMDSM11->Fill(-clsX,clsY);
440           if(smn ==11) fhPMDSM12->Fill(-clsX,clsY);
441           if(smn ==12) fhPMDSM13->Fill(-clsX,clsY);
442           if(smn ==13) fhPMDSM14->Fill(-clsX,clsY);
443           if(smn ==14) fhPMDSM15->Fill(-clsX,clsY);
444           if(smn ==15) fhPMDSM16->Fill(-clsX,clsY);
445           if(smn ==16) fhPMDSM17->Fill(-clsX,clsY);
446           if(smn ==17) fhPMDSM18->Fill(-clsX,clsY);
447           if(smn ==18) fhPMDSM19->Fill(-clsX,clsY);
448           if(smn ==19) fhPMDSM20->Fill(-clsX,clsY);
449           if(smn ==20) fhPMDSM21->Fill(-clsX,clsY);
450           if(smn ==21) fhPMDSM22->Fill(-clsX,clsY);
451           if(smn ==22) fhPMDSM23->Fill(-clsX,clsY);
452           if(smn ==23) fhPMDSM24->Fill(-clsX,clsY);
453         }     
454         if(eta >= 2.3 && eta <= 3.5)
455           {
456             fhPMDP2->Fill(phi);
457           }
458         fhPMDP1->Fill(clsX,clsY);
459       }
460   } 
461   for (Int_t k = 0 ; k < 4 ; k++) {
462     totCPVClus =+ cpvCluQUAD [k] ;
463     totPREClus =+ preCluQUAD [k] ;
464     totCPVCell =+ cpvCelQUAD [k] ;
465     totPRECell =+ preCelQUAD [k] ;
466     totPREEdep =+ preADCQUAD [k] ;     
467     }
468   Float_t totCPVpreClus = totPREClus + totCPVClus ;
469
470   //  if(eta >= 2.3 && eta <= 3.5) {
471   fhPMDC3->Fill(totCPVClus);
472   fhPMDP3->Fill(totPREClus);
473   fhPMDP4->Fill(totPREEdep);
474   fhPMDP5->Fill(totPRECell);
475   fhPMDCP0->Fill(preCluQUAD[0],preCluQUAD[1]);
476   fhPMDCP1->Fill(preCluQUAD[2],preCluQUAD[3]);
477   fhPMDCP2->Fill(preADCQUAD[2],preADCQUAD[3]);
478   fhPMDCP3->Fill(totPREEdep,totCPVpreClus);
479   fhPMDCP4->Fill(totPREClus,totCPVClus);
480   //    }
481   totCPVClus = 0.0; 
482   totPREClus = 0.0; 
483   totCPVCell = 0.0; 
484   totPRECell = 0.0; 
485   totPREEdep = 0.0; 
486
487   PostData(0, fOutputContainer);
488
489
490 //______________________________________________________________________________
491 void AliPMDQATask::Terminate(Option_t *)
492 {
493   // Processing when the event loop is ended
494   fOutputContainer = (TObjArray*)GetOutputData(0);
495   
496   fhPMDP1   = (TH2F*)fOutputContainer->At(0);
497   fhPMDC2   = (TH1F*)fOutputContainer->At(1);
498   fhPMDP2   = (TH1F*)fOutputContainer->At(2);
499   fhPMDC3   = (TH1F*)fOutputContainer->At(3);
500   fhPMDP3   = (TH1F*)fOutputContainer->At(4);
501   fhPMDP4   = (TH1F*)fOutputContainer->At(5);
502   fhPMDC5   = (TH1F*)fOutputContainer->At(6);
503   fhPMDP5   = (TH1F*)fOutputContainer->At(7);
504   fhPMDCP0  = (TH2F*)fOutputContainer->At(8);
505   fhPMDCP1  = (TH2F*)fOutputContainer->At(9);
506   fhPMDCP2  = (TH2F*)fOutputContainer->At(10);
507   fhPMDCP3  = (TH2F*)fOutputContainer->At(11);
508   fhPMDCP4  = (TH2F*)fOutputContainer->At(12);
509
510   fhPMDSM1  = (TH2F*)fOutputContainer->At(13);
511   fhPMDSM2  = (TH2F*)fOutputContainer->At(14);
512   fhPMDSM3  = (TH2F*)fOutputContainer->At(15);
513   fhPMDSM4  = (TH2F*)fOutputContainer->At(16);
514   fhPMDSM5  = (TH2F*)fOutputContainer->At(17);
515   fhPMDSM6  = (TH2F*)fOutputContainer->At(18);
516   fhPMDSM7  = (TH2F*)fOutputContainer->At(19);
517   fhPMDSM8  = (TH2F*)fOutputContainer->At(20);
518   fhPMDSM9  = (TH2F*)fOutputContainer->At(21);
519   fhPMDSM10 = (TH2F*)fOutputContainer->At(22);
520   fhPMDSM11 = (TH2F*)fOutputContainer->At(23);
521   fhPMDSM12 = (TH2F*)fOutputContainer->At(24);
522   fhPMDSM13 = (TH2F*)fOutputContainer->At(25);
523   fhPMDSM14 = (TH2F*)fOutputContainer->At(26);
524   fhPMDSM15 = (TH2F*)fOutputContainer->At(27);
525   fhPMDSM16 = (TH2F*)fOutputContainer->At(28);
526   fhPMDSM17 = (TH2F*)fOutputContainer->At(29);
527   fhPMDSM18 = (TH2F*)fOutputContainer->At(30);
528   fhPMDSM19 = (TH2F*)fOutputContainer->At(31);
529   fhPMDSM20 = (TH2F*)fOutputContainer->At(32);
530   fhPMDSM21 = (TH2F*)fOutputContainer->At(33);
531   fhPMDSM22 = (TH2F*)fOutputContainer->At(34);
532   fhPMDSM23 = (TH2F*)fOutputContainer->At(35);
533   fhPMDSM24 = (TH2F*)fOutputContainer->At(36);
534   fhPMDSM   = (TH1F*)fOutputContainer->At(37);
535
536   Bool_t problem = kFALSE ; 
537   AliInfo(Form(" *** %s Report:", GetName())) ; 
538
539   gStyle->SetOptStat(110000);
540   gStyle->SetOptFit(1);
541
542   TCanvas *cPMD0 = new TCanvas("cPMD0","PMD ESD Test #1", 10,10, 600, 600);
543   cPMD0->Range(-100, -100,100 ,100 );
544   fhPMDSM1->SetMarkerColor(2);
545   fhPMDSM1->Draw();
546   fhPMDSM1->GetXaxis()->SetTitle("Cluster X");
547   fhPMDSM1->GetYaxis()->SetTitle("Cluster Y");
548   fhPMDSM2->SetMarkerColor(2);
549   fhPMDSM2->Draw("same");
550   fhPMDSM3->SetMarkerColor(2);
551   fhPMDSM3->Draw("same");
552   fhPMDSM4->SetMarkerColor(2);
553   fhPMDSM4->Draw("same");
554   fhPMDSM5->SetMarkerColor(2);
555   fhPMDSM5->Draw("same");
556   fhPMDSM6->SetMarkerColor(2);
557   fhPMDSM6->Draw("same");
558   fhPMDSM7->SetMarkerColor(4);
559   fhPMDSM7->Draw("same");
560   fhPMDSM8->SetMarkerColor(4);
561   fhPMDSM8->Draw("same");
562   fhPMDSM9->SetMarkerColor(4);
563   fhPMDSM9->Draw("same");
564   fhPMDSM10->SetMarkerColor(4);
565   fhPMDSM10->Draw("same");
566   fhPMDSM11->SetMarkerColor(4);
567   fhPMDSM11->Draw("same");
568   fhPMDSM12->SetMarkerColor(4);
569   fhPMDSM12->Draw("same");
570   fhPMDSM13->SetMarkerColor(6);
571   fhPMDSM13->Draw("same");
572   fhPMDSM14->SetMarkerColor(6);
573   fhPMDSM14->Draw("same");
574   fhPMDSM15->SetMarkerColor(6);
575   fhPMDSM15->Draw("same");
576   fhPMDSM16->SetMarkerColor(6);
577   fhPMDSM16->Draw("same");
578   fhPMDSM17->SetMarkerColor(6);
579   fhPMDSM17->Draw("same");
580   fhPMDSM18->SetMarkerColor(6);
581   fhPMDSM18->Draw("same");
582   fhPMDSM19->SetMarkerColor(8);
583   fhPMDSM19->Draw("same");
584   fhPMDSM20->SetMarkerColor(8);
585   fhPMDSM20->Draw("same");
586   fhPMDSM21->SetMarkerColor(8);
587   fhPMDSM21->Draw("same");
588   fhPMDSM22->SetMarkerColor(8);
589   fhPMDSM22->Draw("same");
590   fhPMDSM23->SetMarkerColor(8);
591   fhPMDSM23->Draw("same");
592   fhPMDSM24->SetMarkerColor(8);
593   fhPMDSM24->Draw("same");
594
595   DrawPMDBoundary();
596   DrawPMDBoundarySM1();
597   DrawPMDBoundarySM2();
598   DrawPMDBoundarySM3();
599   DrawPMDBoundarySM4();
600   cPMD0->Print("ClusterXY.eps");
601   
602   TCanvas *cPMD1 = new TCanvas("cPMD1"," PMD ESD Test #2",10, 10, 600,600);
603   cPMD1->Divide(1,2);
604   cPMD1->cd(1);
605   cPMD1->SetFillColor(0);
606   fhPMDC2->SetLineColor(4);
607   fhPMDC2->Draw();
608   cPMD1->cd(2);
609   fhPMDP2->SetLineColor(2);
610   fhPMDP2->Draw();
611   cPMD1->Print("CPVPREphi.eps");
612
613   TCanvas *cPMD2 = new TCanvas("cPMD2","PMD ESD test #3",10, 10, 600, 600);
614   cPMD2->cd();
615   fhPMDSM->SetFillColor(2);
616   fhPMDSM->Draw();
617   cPMD2->Print("AllSMN.eps");
618
619   TCanvas *cPMD3 = new TCanvas("cPMD3", "PMD ESD test #4",10, 10, 600, 600);
620   cPMD3->Divide(2,2);
621   cPMD3->cd(1);
622   fhPMDCP0->SetMarkerColor(9);
623   fhPMDCP0->Draw();
624   cPMD3->cd(2);
625   fhPMDCP1->SetMarkerColor(6);
626   fhPMDCP1->Draw();
627   cPMD3->cd(3);
628   fhPMDP3->SetLineColor(2);
629   fhPMDP3->Draw();
630   cPMD3->cd(4);
631   fhPMDCP4->SetMarkerColor(3);
632   fhPMDCP4->Draw();
633   cPMD3->Print("CPVPREClus.eps");
634
635   TCanvas *cPMD4 = new TCanvas("cPMD4","PMD ESD test #5", 10, 10, 600, 600);
636   cPMD4->Divide(1,2);
637   cPMD4->cd(1);
638   fhPMDC3->SetLineColor(4);
639   fhPMDC3->Draw();
640   cPMD4->cd(2);
641   fhPMDP4->SetLineColor(2);
642   fhPMDP4->Draw();
643   cPMD4->Print("CPVPREAdc.eps");
644
645   char line[1024] ; 
646   sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ; 
647   gROOT->ProcessLine(line);
648   
649   AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
650   
651   TString report ; 
652   if(problem)
653     report="Problems found, please check!!!";  
654   else 
655     report="OK";
656
657   AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report.Data())) ; 
658 }
659
660 //______________________________________________________________________________
661 void AliPMDQATask::CalculateSMN( Float_t clsX, Float_t clsY, Int_t & smn) const 
662 {
663   Double_t xcon[96] = {75.133, 54.204, 53.254, 32.326, 31.376,10.447,
664                        75.133, 54.204, 53.254, 32.326, 31.376,10.447,
665                        75.133, 54.204, 53.254, 32.326, 31.376,10.447,
666                        75.133, 54.204, 53.254, 32.326, 31.376,10.447,
667                        -75.133, -54.204, -53.254, -32.326, -31.376,-10.447,
668                        -75.133, -54.204, -53.254, -32.326, -31.376,-10.447,
669                        -75.133, -54.204, -53.254, -32.326, -31.376,-10.447,
670                        -75.133, -54.204, -53.254, -32.326, -31.376,-10.447,
671                        9.167, -32.543, -33.493, -75.133,
672                        9.167, -32.543, -33.493, -75.133,
673                        9.167, -32.543, -33.493, -75.133,
674                        9.167, -32.543, -33.493, -75.133,
675                        9.167, -32.543, -33.493, -75.133,
676                        9.167, -32.543, -33.493, -75.133,
677                        -9.167, 32.543, 33.493, 75.133,
678                        -9.167, 32.543, 33.493, 75.133,
679                        -9.167, 32.543, 33.493, 75.133,
680                        -9.167, 32.543, 33.493, 75.133,
681                        -9.167, 32.543, 33.493, 75.133,
682                        -9.167, 32.543, 33.493, 75.133};
683   
684   Double_t ycon[96] =  {86.475,  86.475,  86.475, 86.475,  86.475,  86.475,
685                         38.225,  38.225,  38.225, 38.225,  38.225,  38.225,
686                         37.325,  37.325,  37.325, 37.325,  37.325,  37.325,
687                         -10.925, -10.925, -10.925, -10.925, -10.925, -10.925,
688                         -86.475, -86.475, -86.475, -86.475, -86.475, -86.475,
689                         -38.225,  -38.225,  -38.225, -38.225, -38.225, -38.225,
690                         -37.325,  -37.325,  -37.325, -37.325,  -37.325,  -37.325,
691                         10.925, 10.925, 10.925, 10.925, 10.925, 10.925,
692                         86.475,  86.475, 86.475,  86.475,
693                         62.225,  62.225, 62.225,  62.225,
694                         61.325,  61.325, 61.325,  61.325,
695                         37.075, 37.075, 37.075, 37.075,
696                         36.175,  36.175, 36.175,  36.175,
697                         11.925, 11.925, 11.925 , 11.925,
698                         -86.475,  -86.475, -86.475,  -86.475,
699                         -62.225,  -62.225, -62.225,  -62.225,
700                         -61.325,  -61.325, -61.325,  -61.325,
701                         -37.075,  -37.075, -37.075,  -37.075,
702                         -36.175,  -36.175, -36.175,  -36.175,
703                         -11.925, -11.925,  -11.925 , -11.925 };
704   
705   if((clsX <= xcon[0]) && (clsX >= xcon[1]) &&
706      (clsY <= ycon[0]) && (clsY >= ycon[6])) smn = 0 ;
707   
708   else if((clsX <=xcon[2]) && (clsX >= xcon[3]) &&
709           (clsY <= ycon[1]) && (clsY >= ycon[7]))smn = 1 ;
710   
711   else if((clsX <=xcon[4]) && (clsX >= xcon[5]) &&
712           (clsY <= ycon[3]) && (clsY >= ycon[8]))smn = 2 ;
713   
714   else if((clsX <= xcon[0]) && (clsX >= xcon[1]) &&
715           (clsY <= ycon[12]) && (clsY >= ycon[18])) smn = 3 ;
716   
717   else if((clsX <=xcon[2]) && (clsX >= xcon[3]) &&
718           (clsY <= ycon[12]) && (clsY >= ycon[18]))smn = 4 ;
719   
720   else if((clsX <=xcon[4]) && (clsX >= xcon[5]) &&
721           (clsY <= ycon[12]) && (clsY >= ycon[18]))smn = 5 ;
722   //------------------------------------------------------------------
723   else if((clsX >= xcon[24]) && (clsX <= xcon[25]) &&
724           (clsY >= ycon[24]) && (clsY <= ycon[30])) smn = 6 ;
725   
726   else if((clsX >=xcon[26]) && (clsX <= xcon[27]) &&
727           (clsY >= ycon[25]) && (clsY <= ycon[31]))smn = 7 ;
728   
729   else if((clsX >=xcon[28]) && (clsX <= xcon[29]) &&
730           (clsY >= ycon[26]) && (clsY <= ycon[32]))smn = 8 ;
731   
732   else if((clsX >= xcon[24]) && (clsX <= xcon[25]) &&
733           (clsY >= ycon[36]) && (clsY <= ycon[42])) smn = 9 ;
734   
735   else if((clsX >=xcon[26]) && (clsX <= xcon[27]) &&
736           (clsY >= ycon[36]) && (clsY <= ycon[42]))smn = 10;
737   
738   else if((clsX >=xcon[28]) && (clsX <= xcon[29]) &&
739           (clsY >= ycon[36]) && (clsY <= ycon[42]))smn = 11;
740   //------------------------------------------------------------------
741   else if((clsX <= xcon[48]) && (clsX >= xcon[49]) &&
742           (clsY <= ycon[48]) && (clsY >= ycon[52])) smn = 12 ;
743   
744   else if((clsX <=xcon[50]) && (clsX >= xcon[51]) &&
745           (clsY <= ycon[48]) && (clsY >= ycon[52]))smn = 13 ;
746   
747   else if((clsX <=xcon[48]) && (clsX >= xcon[49]) &&
748           (clsY <= ycon[56]) && (clsY >= ycon[60]))smn = 14 ;
749   
750   else if((clsX <=xcon[50]) && (clsX >= xcon[51]) &&
751           (clsY <= ycon[56]) && (clsY >= ycon[60]))smn = 15 ;
752   
753   else if((clsX <=xcon[48]) && (clsX >= xcon[49]) &&
754           (clsY <= ycon[64]) && (clsY >= ycon[68]))smn = 16 ;
755   
756   else if((clsX <=xcon[50]) && (clsX >= xcon[51]) &&
757           (clsY <= ycon[64]) && (clsY >= ycon[68]))smn = 17 ;
758   //--------------------------------------------------------------
759   else if((clsX >= xcon[72]) && (clsX <= xcon[73]) &&
760           (clsY >= ycon[72]) && (clsY <= ycon[76])) smn = 18 ;
761   
762   else if((clsX >=xcon[74]) && (clsX <= xcon[75]) &&
763           (clsY >= ycon[72]) && (clsY <= ycon[76]))smn = 19 ;
764   
765   else if((clsX >=xcon[72]) && (clsX <= xcon[73]) &&
766           (clsY >= ycon[80]) && (clsY <= ycon[84]))smn = 20 ;
767   
768   else if((clsX >=xcon[74]) && (clsX <= xcon[75]) &&
769           (clsY >= ycon[80]) && (clsY <= ycon[84]))smn = 21;
770   
771   else if((clsX >= xcon[72]) && (clsX <= xcon[73]) &&
772           (clsY >= ycon[88]) && (clsY <= ycon[92])) smn = 22 ;
773   
774   else if((clsX >=xcon[74]) && (clsX <= xcon[75]) &&
775           (clsY >= ycon[88]) && (clsY <= ycon[92]))smn = 23 ;
776   else smn = 111;
777  }
778
779 //______________________________________________________________________________
780 void AliPMDQATask::DrawPMDBoundary() const 
781 {
782   // Draw PMD boundaries 
783   
784   gStyle->SetLineWidth(2);
785   gStyle->SetLineColor(2);
786   TLine * l;
787   l = new TLine(75.1333, 86.475, -75.1333, 86.475); l->Draw("same");
788   l = new TLine(-75.1333, 86.470,-75.1333, -86.475); l->Draw("same");
789   l = new TLine(-75.1333, -86.475,75.1333, -86.475); l->Draw("same");
790   l = new TLine(75.1333, -86.475,75.1333, 86.475); l->Draw("same");
791 }
792
793 //______________________________________________________________________________
794 void AliPMDQATask::DrawPMDBoundarySM1() const 
795 {
796   // Draw boundaries of Super Module 1 
797
798   gStyle->SetLineWidth(1);
799   gStyle->SetLineColor(4);
800   TLine * l;
801   l = new TLine(-75.1333, 86.475, -10.447,  86.475); l->Draw("same");
802   l = new TLine(-10.447, 86.475, -10.446, -10.925); l->Draw("same");
803   l = new TLine(-10.446, -10.925, -75.1333,-10.925); l->Draw("same");
804   l = new TLine(-75.1333,-10.925, -75.1333, 86.475); l->Draw("same");
805 }
806
807 //______________________________________________________________________________
808 void AliPMDQATask::DrawPMDBoundarySM2() const 
809 {
810   // Draw boundaries of Super Module 2 
811
812   gStyle->SetLineWidth(1);
813   gStyle->SetLineColor(4);
814   TLine * l;
815   l = new TLine(75.1333, -86.475, 10.446,  -86.475); l->Draw("same");
816   l = new TLine(10.446,  -86.475, 10.446,  10.925); l->Draw("same");
817   l = new TLine(10.446,   10.925, 75.1333, 10.925); l->Draw("same");
818   l = new TLine(75.1333,  10.925, 75.1333, -86.475); l->Draw("same");
819 }
820
821
822 //______________________________________________________________________________
823 void AliPMDQATask::DrawPMDBoundarySM3() const 
824 {
825   // Draw boundaries of Super Module 3 
826
827   gStyle->SetLineWidth(1);
828   gStyle->SetLineColor(1);
829   TLine * l;
830   l = new TLine(  -9.167, 86.475, 75.1333, 86.475); l->Draw("same");
831   l = new TLine(75.1333,86.475, 75.1333, 11.925); l->Draw("same");
832   l = new TLine(75.1333,11.925,   -9.167,  11.925); l->Draw("same");
833   l = new TLine(  -9.167, 11.925,   -9.167,  86.475); l->Draw("same");
834 }
835
836 //______________________________________________________________________________
837 void AliPMDQATask::DrawPMDBoundarySM4() const 
838 {
839   // Draw boundaries of Super Module 4 
840
841   gStyle->SetLineWidth(1);
842   gStyle->SetLineColor(1);
843   TLine * l;
844   l = new TLine(9.167, -86.475, -75.1333,-86.475); l->Draw("same");
845   l = new TLine(-75.1333,-86.475, -75.1333,-11.925); l->Draw("same");
846   l = new TLine(-75.1333,-11.925, 9.167, -11.925); l->Draw("same");
847   l = new TLine(9.167, -11.925, 9.167, -86.475); l->Draw("same");
848 }