]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDQADataMakerRec.cxx
Wrong header file names.
[u/mrichter/AliRoot.git] / PMD / AliPMDQADataMakerRec.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16
17 /*
18   Produces the data needed to calculate the quality assurance. 
19   All data must be mergeable objects.
20   B.K. Nandi
21 */
22
23 // --- ROOT system ---
24 #include <TClonesArray.h>
25 #include <TFile.h> 
26 #include <TH1F.h> 
27 #include <TH1I.h> 
28 #include <TH2F.h> 
29
30 // --- Standard library ---
31
32 // --- AliRoot header files ---
33
34 #include "AliESDEvent.h"
35 #include "AliLog.h"
36 #include "AliPMDQADataMakerRec.h"
37 #include "AliQAChecker.h"
38 #include "AliPMDdigit.h" 
39 #include "AliPMDrecpoint1.h" 
40 #include "AliPMDRawStream.h"
41 #include "AliPMDddldata.h"
42 #include "AliPMDUtility.h"
43 #include "AliESDPmdTrack.h"
44 //#include "AliPMDRecoParam.h"
45
46 ClassImp(AliPMDQADataMakerRec)
47            
48 //____________________________________________________________________________ 
49   AliPMDQADataMakerRec::AliPMDQADataMakerRec() : 
50   AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kPMD), "PMD Quality Assurance Data Maker")
51 {
52   // ctor
53 }
54
55 //____________________________________________________________________________ 
56 AliPMDQADataMakerRec::AliPMDQADataMakerRec(const AliPMDQADataMakerRec& qadm) :
57   AliQADataMakerRec()
58 {
59   //copy ctor 
60   SetName((const char*)qadm.GetName()) ; 
61   SetTitle((const char*)qadm.GetTitle()); 
62 }
63
64 //__________________________________________________________________
65 AliPMDQADataMakerRec& AliPMDQADataMakerRec::operator = (const AliPMDQADataMakerRec& qadm )
66 {
67   // Equal operator.
68   this->~AliPMDQADataMakerRec();
69   new(this) AliPMDQADataMakerRec(qadm);
70   return *this;
71 }
72  
73
74 //____________________________________________________________________________ 
75 void AliPMDQADataMakerRec::InitRaws()
76 {
77   // create Raws histograms in Raws subdir
78
79   const Bool_t expert   = kTRUE ; 
80   const Bool_t saveCorr = kTRUE ; 
81   const Bool_t image    = kTRUE ; 
82   // Preshower plane
83
84     TH1I * h0 = new TH1I("hPreEdepM0","ADC Distribution PRE - Module 0", 100, 0, 2000);
85     h0->Sumw2();
86     Add2RawsList(h0, 0, !expert, image, !saveCorr); 
87
88     TH1I * h1 = new TH1I("hPreEdepM1","ADC Distribution PRE - Module 1", 100, 0, 2000);
89     h1->Sumw2();
90     Add2RawsList(h1, 1, !expert, image, !saveCorr); 
91
92     TH1I * h2 = new TH1I("hPreEdepM2","ADC Distribution PRE - Module 2", 100, 0, 2000);
93     h2->Sumw2();
94     Add2RawsList(h2, 2, !expert, image, !saveCorr); 
95     
96     TH1I * h3 = new TH1I("hPreEdepM3","ADC Distribution PRE - Module 3", 100, 0, 2000);
97     h3->Sumw2(); 
98     Add2RawsList(h3, 3, !expert, image, !saveCorr); 
99
100     TH1I * h4 = new TH1I("hPreEdepM4","ADC Distribution PRE - Module 4", 100, 0, 2000);
101     h4->Sumw2(); 
102     Add2RawsList(h4, 4, !expert, image, !saveCorr); 
103
104     TH1I * h5 = new TH1I("hPreEdepM5","ADC Distribution PRE - Module 5", 100, 0, 2000);
105     h5->Sumw2(); 
106     Add2RawsList(h5, 5, !expert, image, !saveCorr); 
107
108     TH1I * h6 = new TH1I("hPreEdepM6","ADC Distribution PRE - Module 6", 100, 0, 2000);
109     h6->Sumw2(); 
110     Add2RawsList(h6, 6, !expert, image, !saveCorr); 
111
112     TH1I * h7 = new TH1I("hPreEdepM7","ADC Distribution PRE - Module 7", 100, 0, 2000);
113     h7->Sumw2(); 
114     Add2RawsList(h7, 7, !expert, image, !saveCorr); 
115
116     TH1I * h8 = new TH1I("hPreEdepM8","ADC Distribution PRE - Module 8", 100, 0, 2000);
117     h8->Sumw2(); 
118     Add2RawsList(h8, 8, !expert, image, !saveCorr); 
119
120     TH1I * h9 = new TH1I("hPreEdepM9","ADC Distribution PRE - Module 9", 100, 0, 2000);
121     h9->Sumw2(); 
122     Add2RawsList(h9, 9, !expert, image, !saveCorr); 
123
124     TH1I * h10 = new TH1I("hPreEdepM10","ADC Distribution PRE - Module 10", 100, 0, 2000);
125     h10->Sumw2(); 
126     Add2RawsList(h10, 10, !expert, image, !saveCorr); 
127
128     TH1I * h11 = new TH1I("hPreEdepM11","ADC Distribution PRE - Module 11", 100, 0, 2000);
129     h11->Sumw2(); 
130     Add2RawsList(h11, 11, !expert, image, !saveCorr); 
131
132     TH1I * h12 = new TH1I("hPreEdepM12","ADC Distribution PRE - Module 12", 100, 0, 2000);
133     h12->Sumw2(); 
134     Add2RawsList(h12, 12, !expert, image, !saveCorr); 
135
136     TH1I * h13 = new TH1I("hPreEdepM13","ADC Distribution PRE - Module 13", 100, 0, 2000);
137     h13->Sumw2(); 
138     Add2RawsList(h13, 13, !expert, image, !saveCorr); 
139
140     TH1I * h14 = new TH1I("hPreEdepM14","ADC Distribution PRE - Module 14", 100, 0, 2000);
141     h14->Sumw2(); 
142     Add2RawsList(h14, 14, !expert, image, !saveCorr); 
143
144     TH1I * h15 = new TH1I("hPreEdepM15","ADC Distribution PRE - Module 15", 100, 0, 2000);
145     h15->Sumw2(); 
146     Add2RawsList(h15, 15, !expert, image, !saveCorr); 
147
148     TH1I * h16 = new TH1I("hPreEdepM16","ADC Distribution PRE - Module 16", 100, 0, 2000);
149     h16->Sumw2(); 
150     Add2RawsList(h16, 16, !expert, image, !saveCorr); 
151
152     TH1I * h17 = new TH1I("hPreEdepM17","ADC Distribution PRE - Module 17", 100, 0, 2000);
153     h17->Sumw2(); 
154     Add2RawsList(h17, 17, !expert, image, !saveCorr); 
155
156     TH1I * h18 = new TH1I("hPreEdepM18","ADC Distribution PRE - Module 18", 100, 0, 2000);
157     h18->Sumw2(); 
158     Add2RawsList(h18, 18, !expert, image, !saveCorr); 
159
160     TH1I * h19 = new TH1I("hPreEdepM19","ADC Distribution PRE - Module 19", 100, 0, 2000);
161     h19->Sumw2(); 
162     Add2RawsList(h19, 19, !expert, image, !saveCorr); 
163
164     TH1I * h20 = new TH1I("hPreEdepM20","ADC Distribution PRE - Module 20", 100, 0, 2000);
165     h20->Sumw2(); 
166     Add2RawsList(h20, 20, !expert, image, !saveCorr);
167  
168     TH1I * h21 = new TH1I("hPreEdepM21","ADC Distribution PRE - Module 21", 100, 0, 2000);
169     h21->Sumw2(); 
170     Add2RawsList(h21, 21, !expert, image, !saveCorr); 
171
172     TH1I * h22 = new TH1I("hPreEdepM22","ADC Distribution PRE - Module 22", 100, 0, 2000);
173     h22->Sumw2(); 
174     Add2RawsList(h22, 22, !expert, image, !saveCorr); 
175
176     TH1I * h23 = new TH1I("hPreEdepM23","ADC Distribution PRE - Module 23", 100, 0, 2000);
177     h23->Sumw2(); 
178     Add2RawsList(h23, 23, !expert, image, !saveCorr);
179
180     // CPV histos
181
182     TH1I * h24 = new TH1I("hCpvEdepM24","ADC Distribution CPV - Module 24", 100, 0, 2000);
183     h24->Sumw2();
184     Add2RawsList(h24, 24, !expert, image, !saveCorr); 
185
186     TH1I * h25 = new TH1I("hCpvEdepM25","ADC Distribution CPV - Module 25", 100, 0, 2000);
187     h25->Sumw2(); 
188     Add2RawsList(h25, 25, !expert, image, !saveCorr); 
189
190     TH1I * h26 = new TH1I("hCpvEdepM26","ADC Distribution CPV - Module 26", 100, 0, 2000);
191     h26->Sumw2(); 
192     Add2RawsList(h26, 26, !expert, image, !saveCorr); 
193
194     TH1I * h27 = new TH1I("hCpvEdepM27","ADC Distribution CPV - Module 27", 100, 0, 2000);
195     h27->Sumw2(); 
196     Add2RawsList(h27, 27, !expert, image, !saveCorr); 
197
198     TH1I * h28 = new TH1I("hCpvEdepM28","ADC Distribution CPV - Module 28", 100, 0, 2000);
199     h28->Sumw2(); 
200     Add2RawsList(h28, 28, !expert, image, !saveCorr); 
201
202     TH1I * h29 = new TH1I("hCpvEdepM29","ADC Distribution CPV - Module 29", 100, 0, 2000);
203     h29->Sumw2(); 
204     Add2RawsList(h29, 29, !expert, image, !saveCorr); 
205
206     TH1I * h30 = new TH1I("hCpvEdepM30","ADC Distribution CPV - Module 30", 100, 0, 2000);
207     h30->Sumw2(); 
208     Add2RawsList(h30, 30, !expert, image, !saveCorr); 
209
210     TH1I * h31 = new TH1I("hCpvEdepM31","ADC Distribution CPV - Module 31", 100, 0, 2000);
211     h31->Sumw2(); 
212     Add2RawsList(h31, 31, !expert, image, !saveCorr); 
213
214     TH1I * h32 = new TH1I("hCpvEdepM32","ADC Distribution CPV - Module 32", 100, 0, 2000);
215     h32->Sumw2();
216     Add2RawsList(h32, 32, !expert, image, !saveCorr); 
217
218     TH1I * h33 = new TH1I("hCpvEdepM33","ADC Distribution CPV - Module 33", 100, 0, 2000);
219     h33->Sumw2();
220     Add2RawsList(h33, 33, !expert, image, !saveCorr); 
221
222     TH1I * h34 = new TH1I("hCpvEdepM34","ADC Distribution CPV - Module 34", 100, 0, 2000);
223     h34->Sumw2(); 
224     Add2RawsList(h34, 34, !expert, image, !saveCorr); 
225
226     TH1I * h35 = new TH1I("hCpvEdepM35","ADC Distribution CPV - Module 35", 100, 0, 2000);
227     h35->Sumw2(); 
228     Add2RawsList(h35, 35, !expert, image, !saveCorr); 
229
230     TH1I * h36 = new TH1I("hCpvEdepM36","ADC Distribution CPV - Module 36", 100, 0, 2000);
231     h36->Sumw2(); 
232     Add2RawsList(h36, 36, !expert, image, !saveCorr); 
233
234     TH1I * h37 = new TH1I("hCpvEdepM37","ADC Distribution CPV - Module 37", 100, 0, 2000);
235     h37->Sumw2(); 
236     Add2RawsList(h37, 37, !expert, image, !saveCorr); 
237
238     TH1I * h38 = new TH1I("hCpvEdepM38","ADC Distribution CPV - Module 38", 100, 0, 2000);
239     h38->Sumw2(); 
240     Add2RawsList(h38, 38, !expert, image, !saveCorr); 
241
242     TH1I * h39 = new TH1I("hCpvEdepM39","ADC Distribution CPV - Module 39", 100, 0, 2000);
243     h39->Sumw2(); 
244     Add2RawsList(h39, 39, !expert, image, !saveCorr); 
245
246     TH1I * h40 = new TH1I("hCpvEdepM40","ADC Distribution CPV - Module 40", 100, 0, 2000);
247     h40->Sumw2(); 
248     Add2RawsList(h40, 40, !expert, image, !saveCorr); 
249
250     TH1I * h41 = new TH1I("hCpvEdepM41","ADC Distribution CPV - Module 41", 100, 0, 2000);
251     h41->Sumw2();
252     Add2RawsList(h41, 41, !expert, image, !saveCorr); 
253
254     TH1I * h42 = new TH1I("hCpvEdepM42","ADC Distribution CPV - Module 42", 100, 0, 2000);
255     h42->Sumw2(); 
256     Add2RawsList(h42, 42, !expert, image, !saveCorr); 
257
258     TH1I * h43 = new TH1I("hCpvEdepM43","ADC Distribution CPV - Module 43", 100, 0, 2000);
259     h43->Sumw2(); 
260     Add2RawsList(h43, 43, !expert, image, !saveCorr); 
261
262     TH1I * h44 = new TH1I("hCpvEdepM44","ADC Distribution CPV - Module 44", 100, 0, 2000);
263     h44->Sumw2(); 
264     Add2RawsList(h44, 44, !expert, image, !saveCorr); 
265
266     TH1I * h45 = new TH1I("hCpvEdepM45","ADC Distribution CPV - Module 45", 100, 0, 2000);
267     h45->Sumw2();
268     Add2RawsList(h45, 45, !expert, image, !saveCorr); 
269
270     TH1I * h46 = new TH1I("hCpvEdepM46","ADC Distribution CPV - Module 46", 100, 0, 2000);
271     h46->Sumw2(); 
272     Add2RawsList(h46, 46, !expert, image, !saveCorr); 
273
274     TH1I * h47 = new TH1I("hCpvEdepM47","ADC Distribution CPV - Module 47", 100, 0, 2000);
275     h47->Sumw2(); 
276     Add2RawsList(h47, 47, !expert, image, !saveCorr); 
277
278
279     // Y vs. X for PRE and CPV planes
280
281     TH2F * h48 = new TH2F("hPreXY","PRE plane",200,-100.,100.,200,-100.,100.);
282     Add2RawsList(h48, 48, !expert, !image, saveCorr);//Ajay
283     //Add2RawsList(h48, 48);//Ajay
284     TH2F * h49 = new TH2F("hCpvXY","CPV plane",200,-100.,100.,200,-100.,100.);
285     Add2RawsList(h49, 49, !expert, !image, saveCorr);//Ajay
286     //Add2RawsList(h49, 49);//Ajay
287
288 }
289
290 //____________________________________________________________________________
291 void AliPMDQADataMakerRec::InitDigits()
292 {
293   // create Digits histograms in Digits subdir
294   const Bool_t expert   = kTRUE ; 
295   const Bool_t image    = kTRUE ; 
296   
297   TH1F *h0 = new TH1F("hPreDigitsEdep","Digits energy distribution in PRE(PMD)", 100, 0., 2000.);
298   h0->Sumw2();
299   Add2DigitsList(h0, 0, !expert, image);
300   
301   TH1F *h1 = new TH1F("hCpvDigitsEdep","Digits energy distribution in CPV(PMD)", 100, 0., 2000.); 
302   h1->Sumw2();
303   Add2DigitsList(h1, 1, !expert, image);
304   
305   TH1I *h2 = new TH1I("hPreDigitsMult","Digits multiplicity distribution in PRE(PMD)", 500, 0, 1000) ; 
306   h2->Sumw2();
307   Add2DigitsList(h2, 2, !expert, image);
308   
309   TH1I *h3 = new TH1I("hCpvDigitsMult","Digits multiplicity distribution in CPV(PMD)", 500, 0, 1000);
310   h3->Sumw2();
311   Add2DigitsList(h3, 3, !expert, image);
312   
313 }
314
315 //____________________________________________________________________________ 
316 void AliPMDQADataMakerRec::InitRecPoints()
317 {
318   // create Reconstructed Points histograms in RecPoints subdir
319   
320   /*
321     TH2F * h0 = new TH2F("hPreXY","RecPoints Y vs X PRE(PMD)", 100,-100.,100.,100,-100.,100.);
322     Add2RecPointsList(h0,0);
323     
324     TH2F * h1 = new TH2F("hCpvXY","RecPoints Y vs X CPV(PMD)", 100,-100.,100.,100,-100.,100.);
325     Add2RecPointsList(h1,1);
326   */
327
328     //  Ncell distribution in a cluster
329   
330     // PRE plane
331
332   const Bool_t expert   = kTRUE ; 
333   const Bool_t image    = kTRUE ; 
334
335   TH1F * h0 = new TH1F("hPreDdl0Ncell","PRE: Ddl0 Ncell in a cluster",50,0.,50.);
336   h0->Sumw2();
337   Add2RecPointsList(h0, 0, !expert, image);
338
339
340   TH1F * h1 = new TH1F("hPreDdl1Ncell","PRE: Ddl1 Ncell in a cluster",50,0.,50.);
341   h1->Sumw2();
342   Add2RecPointsList(h1, 1, !expert, image);
343
344
345   TH1F * h2 = new TH1F("hPreDdl2Ncell","PRE: Ddl2 Ncell in a cluster",50,0.,50.);
346   h2->Sumw2();
347   Add2RecPointsList(h2, 2, !expert, image);
348
349
350   TH1F * h3 = new TH1F("hPreDdl3Ncell","PRE: Ddl3 Ncell in a cluster",50,0.,50.);
351   h3->Sumw2();
352   Add2RecPointsList(h3, 3, !expert, image);
353
354   // CPV plane
355
356   TH1F * h4 = new TH1F("hCpvDdl4Ncell","CPV: Ddl4 Ncell in a cluster",50,0.,50.);
357   h4->Sumw2();
358   Add2RecPointsList(h4, 4, !expert, image);
359
360   TH1F * h5 = new TH1F("hCpvDdl5Ncell","CPV: Ddl5 Ncell in a cluster",50,0.,50.);
361   h5->Sumw2();
362   Add2RecPointsList(h5, 5, !expert, image);
363
364   // Correlation plot
365
366   TH2I *h6 = new TH2I("hPre10","Cluster - DDL1 vs DDL0", 100,0,200,100,0,200);
367   Add2RecPointsList(h6,6, !expert, image);
368
369   TH2I *h7 = new TH2I("hPre32","Cluster - DDL3 vs DDL2", 100,0,200,100,0,200);
370   Add2RecPointsList(h7,7, !expert, image);
371
372   TH2I *h8 = new TH2I("hCpv54","Cluster - DDL5 vs DDL4", 100,0,200,100,0,200);
373   Add2RecPointsList(h8,8, !expert, image);
374
375
376
377 }
378
379 //____________________________________________________________________________ 
380
381 void AliPMDQADataMakerRec::InitESDs()
382 {
383   //Create histograms to controll ESD
384
385   const Bool_t expert   = kTRUE ; 
386   const Bool_t image    = kTRUE ; 
387
388   TH1F *h0 = new TH1F("hPreClADC","Cluster ADC of PRE plane",500,0.,10000.);
389   h0->Sumw2();
390   Add2ESDsList(h0, 0, !expert, image)  ;
391
392   TH1F *h1 = new TH1F("hCpvClADC","Cluster ADC of CPV plane",500,0.,10000.);
393   h1->Sumw2();
394   Add2ESDsList(h1, 1, !expert, image)  ;
395
396   TH2I *h2 = new TH2I("hPmdClMult","Cluster Multiplicity: PRE vs. CPVplane",100,0,1000,100,0,1000);
397   h2->Sumw2();
398   Add2ESDsList(h2, 2, !expert, image)  ;
399
400 /*
401   TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV plane",100,0.,1000.);
402   h3->Sumw2();
403   Add2ESDsList(h3, 3, !expert, image)  ;
404 */
405
406 }
407
408 //____________________________________________________________________________
409 void AliPMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
410 {
411     //Fill prepared histograms with Raw digit properties
412
413     TObjArray *pmdddlcont = 0x0;
414     pmdddlcont = new TObjArray();
415     AliPMDRawStream stream(rawReader);
416     
417     AliPMDddldata *pmdddl = 0x0;
418
419     Int_t   iddl = -1;
420     Int_t   xpad = -1;
421     Int_t   ypad = -1;
422     Float_t xx, yy;
423
424     AliPMDUtility cc;
425
426     while ((iddl = stream.DdlData(pmdddlcont)) >=0)
427     {
428         Int_t ientries = pmdddlcont->GetEntries();
429         //printf(" ======= DDLNO = %d ientries = %d \n", iddl, ientries);
430         
431         for (Int_t ient = 0; ient < ientries; ient++)
432           {
433               //AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont->UncheckedAt(ient);
434             pmdddl = (AliPMDddldata*)pmdddlcont->UncheckedAt(ient);
435
436             Int_t det = pmdddl->GetDetector();
437             Int_t smn = pmdddl->GetSMN();
438             Int_t mcm = pmdddl->GetMCM();
439             //Int_t chno = pmdddl->GetChannel();
440             Int_t row = pmdddl->GetRow();
441             Int_t col = pmdddl->GetColumn();
442             Int_t sig = pmdddl->GetSignal();
443             
444             if (mcm == 0 || smn == -1) continue;
445
446             if (det == 0)
447             {
448                 GetRawsData(smn)->Fill(sig);
449                 if(smn < 12)
450                 {
451                     xpad = col;
452                     ypad = row;
453                 }
454                 else if(smn >= 12 && smn < 24)
455                 {
456                     xpad = row;
457                     ypad = col;
458                 }
459                 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
460                 GetRawsData(48)->Fill(xx,yy);
461             }
462             if (det == 1)
463             {
464                 GetRawsData(24+smn)->Fill(sig);
465                 if(smn < 12)
466                 {
467                     xpad = col;
468                     ypad = row;
469                 }
470                 else if(smn >= 12 && smn < 24)
471                 {
472                     xpad = row;
473                     ypad = col;
474                 }
475
476                 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
477                 GetRawsData(49)->Fill(xx,yy);
478
479             }
480
481           }
482
483         pmdddlcont->Delete();
484     }
485
486     delete pmdddlcont;
487     pmdddlcont = 0x0;
488
489 }
490 //____________________________________________________________________________
491 void AliPMDQADataMakerRec::MakeDigits(TClonesArray * digits)
492 {
493   // makes data from Digits
494   
495   Int_t cpvmul = 0, premul = 0;
496   
497   TIter next(digits) ; 
498   AliPMDdigit * digit ; 
499   while ( (digit = dynamic_cast<AliPMDdigit *>(next())) )
500     {
501     if(digit->GetDetector() == 0)
502       {
503             GetDigitsData(0)->Fill( digit->GetADC()) ;
504             premul++;
505       }
506     if(digit->GetDetector() == 1)
507       {
508             GetDigitsData(1)->Fill( digit->GetADC());
509             cpvmul++;
510       }
511     }  
512   
513   if (premul > 0) GetDigitsData(2)->Fill(premul);
514   if (cpvmul > 0) GetDigitsData(3)->Fill(cpvmul);
515   
516   
517 }
518
519 //____________________________________________________________________________
520 void AliPMDQADataMakerRec::MakeDigits(TTree * digitTree)
521 {
522   // makes data from Digit Tree
523   
524   TClonesArray * digits = new TClonesArray("AliPMDdigit", 1000) ; 
525   
526   TBranch * branch = digitTree->GetBranch("PMDDigit") ;
527   branch->SetAddress(&digits) ;
528   
529   if ( ! branch )
530     {
531     AliWarning("PMD branch in Digit Tree not found") ; 
532     }
533   else
534     {
535     for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
536       {
537             branch->GetEntry(ient) ; 
538             MakeDigits(digits) ; 
539       }
540     
541     }
542 }
543
544 //____________________________________________________________________________
545 void AliPMDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
546 {
547     // makes data from RecPoints
548
549     Int_t multDdl0 = 0, multDdl1 = 0, multDdl2 = 0;
550     Int_t multDdl3 = 0, multDdl4 = 0, multDdl5 = 0;
551
552     AliPMDrecpoint1 * recpoint; 
553
554     TClonesArray * recpoints = 0x0;
555     recpoints = new TClonesArray("AliPMDrecpoint1", 1000) ; 
556     
557     TBranch * branch = clustersTree->GetBranch("PMDRecpoint") ;
558     branch->SetAddress(&recpoints) ;
559
560     if ( ! branch )
561     {
562         AliWarning("PMD branch in Recpoints Tree not found") ; 
563     }
564     else
565     {
566         for (Int_t imod = 0; imod < branch->GetEntries(); imod++)
567         {
568             branch->GetEntry(imod) ;
569
570             TIter next(recpoints) ; 
571
572             while ( (recpoint = dynamic_cast<AliPMDrecpoint1 *>(next())) )
573               {
574                 //Float_t xpos = recpoint->GetClusX();
575                 //Float_t ypos = recpoint->GetClusY();
576                 //Int_t smn = recpoint->GetSMNumber();
577                 
578                   if(recpoint->GetDetector() == 0)
579                   {
580                     if(recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6)
581                       {
582                         GetRecPointsData(0)->Fill(recpoint->GetClusCells());
583                         multDdl0++;
584                       }
585                     if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 12)
586                       {
587                         GetRecPointsData(1)->Fill(recpoint->GetClusCells());
588                         multDdl1++;
589                       }
590                     if(recpoint->GetSMNumber() >= 12 && recpoint->GetSMNumber() < 18)
591                       {
592                         GetRecPointsData(2)->Fill(recpoint->GetClusCells());
593                         multDdl2++;
594                       }
595                     if(recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24)
596                       {
597                         GetRecPointsData(3)->Fill(recpoint->GetClusCells());
598                         multDdl3++;
599                       }
600                   }
601
602                 if(recpoint->GetDetector() == 1)
603                   {
604                     if((recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6) || 
605                        (recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24))
606                       {
607                         GetRecPointsData(4)->Fill(recpoint->GetClusCells());
608                         multDdl4++;
609                       }
610                     if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 18 )
611                       {
612                         GetRecPointsData(5)->Fill(recpoint->GetClusCells());
613                         multDdl5++;
614                       }
615                   }
616               } 
617         }
618     }
619     
620     GetRecPointsData(6)->Fill(multDdl0,multDdl1);
621     GetRecPointsData(7)->Fill(multDdl2,multDdl3);
622     GetRecPointsData(8)->Fill(multDdl4,multDdl5);
623
624     delete recpoints;
625
626 }
627
628 //____________________________________________________________________________
629
630 void AliPMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
631 {
632   // make QA data from ESDs
633
634     Int_t premul = 0, cpvmul = 0;
635
636   for (Int_t icl = 0; icl < esd->GetNumberOfPmdTracks(); icl++)
637     {
638       AliESDPmdTrack *pmdtr = esd->GetPmdTrack(icl);
639       
640       //Int_t   det   = pmdtr->GetDetector(); 
641       //Float_t clsX  = pmdtr->GetClusterX();
642       //Float_t clsY  = pmdtr->GetClusterY();
643       //Float_t clsZ  = pmdtr->GetClusterZ();
644       //Float_t ncell = pmdtr->GetClusterCells();
645       Float_t adc   = pmdtr->GetClusterADC();
646       //Float_t pid   = pmdtr->GetClusterPID();
647
648       if (pmdtr->GetDetector() == 0)
649         {
650           GetESDsData(0)->Fill(adc);
651           premul++;
652         }
653       if (pmdtr->GetDetector() == 1)
654         {
655           GetESDsData(1)->Fill(adc) ;
656           cpvmul++;
657         }
658     }
659   
660   GetESDsData(2)->Fill(cpvmul,premul) ;
661   //GetESDsData(3)->Fill(cpvmul) ;  
662 }
663
664 //____________________________________________________________________________ 
665
666 void AliPMDQADataMakerRec::StartOfDetectorCycle()
667 {
668   //Detector specific actions at start of cycle
669   
670 }
671 //____________________________________________________________________________ 
672 void AliPMDQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
673 {
674   //Detector specific actions at end of cycle
675   // do the QA checking
676   AliQAChecker::Instance()->Run(AliQAv1::kPMD, task, list) ;  
677 }