Updated QA classes
[u/mrichter/AliRoot.git] / ZDC / AliZDCQADataMaker.cxx
CommitLineData
075a0e70 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// --- Standard library ---
16#include <Riostream.h>
17// --- ROOT system ---
18#include <TClonesArray.h>
19#include <TFile.h>
20#include <TH1F.h>
21#include <TH2F.h>
22#include <TBranch.h>
23#include <TTree.h>
24// --- AliRoot header files ---
25#include "AliLog.h"
26#include "AliQAChecker.h"
27#include "AliZDCQADataMaker.h"
28#include "AliZDCHit.h"
29#include "AliZDCDigit.h"
30#include "AliZDCRawStream.h"
31#include "AliESDZDC.h"
32#include "AliESDEvent.h"
33
34ClassImp(AliZDCQADataMaker)
35
36//____________________________________________________________________________
37 AliZDCQADataMaker::AliZDCQADataMaker() :
38 AliQADataMaker(AliQA::GetDetName(AliQA::kZDC), "ZDC Quality Assurance Data Maker")
39{
40 // ctor
41}
42
43//____________________________________________________________________________
44AliZDCQADataMaker::AliZDCQADataMaker(const AliZDCQADataMaker& qadm) :
45 AliQADataMaker()
46{
47 //copy ctor
48 SetName((const char*)qadm.GetName());
49 SetTitle((const char*)qadm.GetTitle());
50}
51
52//__________________________________________________________________
53AliZDCQADataMaker& AliZDCQADataMaker::operator = (const AliZDCQADataMaker& qadm )
54{
55 // Equal operator.
56 this->~AliZDCQADataMaker();
57 new(this) AliZDCQADataMaker(qadm);
58 return *this;
59}
60
61//____________________________________________________________________________
62void AliZDCQADataMaker::InitHits()
63{
64 // create Hits histograms in Hits subdir
65 //
66 TH2F * hZNCh = new TH2F("hZNCh", "Hits centroid in ZNC", 100, -5.,5.,100,-5.,5.);
67 TH2F * hZNAh = new TH2F("hZNAh", "Hits centroid in ZNA", 100, -5.,5.,100,-5.,5.);
68 TH2F * hZPCh = new TH2F("hZPCh", "Hits centroid in ZPC", 100,-12.,12.,100,-12.,12.)
69 TH2F * hZPAh = new TH2F("hZPAh", "Hits centroid in ZPA", 100,-12.,12.,100,-12.,12.)
70 Add2HitsList(hZNCh, 0);
71 Add2HitsList(hZPCh, 1);
72 Add2HitsList(hZNAh, 2);
73 Add2HitsList(hZPAh, 3);
74}
75
76//____________________________________________________________________________
77void AliZDCQADataMaker::InitDigits()
78{
79 // create Digits histograms in Digits subdir
80 //
81 TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Digit signal in ZNC", 100, 0., 6000.);
82 TH1F * hDigZNATot = new TH1F("hDigZNATot", "Digit signal in ZNA", 100, 0., 6000.);
83 TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Digit signal in ZPC", 100, 0., 10000.);
84 TH1F * hDigZPATot = new TH1F("hDigZPATot", "Digit signal in ZPA", 100, 0., 10000.);
85 Add2DigitsList(hDigZNCTot, 0);
86 Add2DigitsList(hDigZPCTot, 1);
87 Add2DigitsList(hDigZNATot, 2);
88 Add2DigitsList(hDigZPATot, 3);
89 //
90 TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ[i]",100, 0., 4000.);
91 TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ[i]",100, 0., 4000.);
92 TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ[i]",100, 0., 4000.);
93 TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ[i]",100, 0., 4000.);
94 Add2DigitsList(hDigSumQZNC, 4);
95 Add2DigitsList(hDigSumQZPC, 5);
96 Add2DigitsList(hDigSumQZNA, 6);
97 Add2DigitsList(hDigSumQZPA, 7);
98 //
99 TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in 4 ZNC PMQ[i]",100, 0., 4000.);
100 TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in 4 ZPC PMQ[i]",100, 0., 4000.);
101 TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in 4 ZNA PMQ[i]",100, 0., 4000.);
102 TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in 4 ZPA PMQ[i]",100, 0., 4000.);
103 Add2DigitsList(hDigPMCZNC, 8);
104 Add2DigitsList(hDigPMCZPC, 9);
105 Add2DigitsList(hDigPMCZNA, 10);
106 Add2DigitsList(hDigPMCZPA, 11);
107 //
108 // ------------------- LOW GAIN CHAIN ---------------------------
109 TH1F * hDigZNCTotlg = new TH1F("hDigZNCTotlg", "Digit lg signal in ZNC", 100, 0., 6000.);
110 TH1F * hDigZNATotlg = new TH1F("hDigZNATotlg", "Digit lg signal in ZNA", 100, 0., 6000.);
111 TH1F * hDigZPCTotlg = new TH1F("hDigZPCTotlg", "Digit lg signal in ZPC", 100, 0., 10000.);
112 TH1F * hDigZPATotlg = new TH1F("hDigZPATotlg", "Digit lg signal in ZPA", 100, 0., 10000.);
113 Add2DigitsList(hDigZNCTotlg, 12);
114 Add2DigitsList(hDigZPCTotlg, 13);
115 Add2DigitsList(hDigZNATotlg, 14);
116 Add2DigitsList(hDigZPATotlg, 15);
117 //
118 TH1F * hDigSumQZNClg = new TH1F("hDigSumQZNClg", "Signal in 4 ZNC PMQlg[i]",100, 0., 4000.);
119 TH1F * hDigSumQZPClg = new TH1F("hDigSumQZPClg", "Signal in 4 ZPC PMQlg[i]",100, 0., 4000.);
120 TH1F * hDigSumQZNAlg = new TH1F("hDigSumQZNAlg", "Signal in 4 ZNA PMQlg[i]",100, 0., 4000.);
121 TH1F * hDigSumQZPAlg = new TH1F("hDigSumQZPAlg", "Signal in 4 ZPA PMQlg[i]",100, 0., 4000.);
122 Add2DigitsList(hDigSumQZNClg, 16);
123 Add2DigitsList(hDigSumQZPClg, 17);
124 Add2DigitsList(hDigSumQZNAlg, 18);
125 Add2DigitsList(hDigSumQZPAlg, 19);
126 //
127 TH1F * hDigPMCZNClg = new TH1F("hDigPMCZNClg", "Signal in 4 ZNC PMQlg[i]",100, 0., 4000.);
128 TH1F * hDigPMCZPClg = new TH1F("hDigPMCZPClg", "Signal in 4 ZPC PMQlg[i]",100, 0., 4000.);
129 TH1F * hDigPMCZNAlg = new TH1F("hDigPMCZNAlg", "Signal in 4 ZNA PMQlg[i]",100, 0., 4000.);
130 TH1F * hDigPMCZPAlg = new TH1F("hDigPMCZPAlg", "Signal in 4 ZPA PMQlg[i]",100, 0., 4000.);
131 Add2DigitsList(hDigPMCZNClg, 20);
132 Add2DigitsList(hDigPMCZPClg, 21);
133 Add2DigitsList(hDigPMCZNAlg, 22);
134 Add2DigitsList(hDigPMCZPAlg, 23);
135}
136
137
138//____________________________________________________________________________
139
3d26d59b 140void AliZDCQADataMakerRec::InitRaws()
075a0e70 141{
142 // create Digits histograms in Digits subdir
143 //
144 TH1F * hRawZNCTot = new TH1F("hRawZNCTot", "Raw signal in ZNC", 100, 0., 6000.);
145 TH1F * hRawZNATot = new TH1F("hRawZNATot", "Raw signal in ZNA", 100, 0., 6000.);
146 TH1F * hRawZPCTot = new TH1F("hRawZPCTot", "Raw signal in ZPC", 100, 0., 10000.);
147 TH1F * hRawZPATot = new TH1F("hRawZPATot", "Raw signal in ZPA", 100, 0., 10000.);
148 Add2RawsList(hRawZNCTot, 0);
149 Add2RawsList(hRawZPCTot, 1);
150 Add2RawsList(hRawZNATot, 2);
151 Add2RawsList(hRawZPATot, 3);
152 //
3d26d59b 153 TH1F * hRawSumQZNC = new TH1F("hRawSumQZNC", "Raw summed 4 ZNC quadrants",100, 0., 4000.);
154 TH1F * hRawSumQZPC = new TH1F("hRawSumQZPC", "Raw summed 4 ZPC quadrants",100, 0., 4000.);
155 TH1F * hRawSumQZNA = new TH1F("hRawSumQZNA", "Raw summed 4 ZNA quadrants",100, 0., 4000.);
156 TH1F * hRawSumQZPA = new TH1F("hRawSumQZPA", "Raw summed 4 ZPA quadrants",100, 0., 4000.);
075a0e70 157 Add2RawsList(hRawSumQZNC, 4);
158 Add2RawsList(hRawSumQZPC, 5);
159 Add2RawsList(hRawSumQZNA, 6);
160 Add2RawsList(hRawSumQZPA, 7);
161 //
3d26d59b 162 TH1F * hRawPMCZNC = new TH1F("hRawPMCZNC", "Raw common ZNC PMT",100, 0., 4000.);
163 TH1F * hRawPMCZPC = new TH1F("hRawPMCZPC", "Raw common ZPC PMT",100, 0., 4000.);
164 TH1F * hRawPMCZNA = new TH1F("hRawPMCZNA", "Raw common ZNA PMT",100, 0., 4000.);
165 TH1F * hRawPMCZPA = new TH1F("hRawPMCZPA", "Raw common ZPA PMT",100, 0., 4000.);
075a0e70 166 Add2RawsList(hRawPMCZNC, 8);
167 Add2RawsList(hRawPMCZPC, 9);
168 Add2RawsList(hRawPMCZNA, 10);
169 Add2RawsList(hRawPMCZPA, 11);
170 //
171 // ------------------- LOW GAIN CHAIN ---------------------------
172 TH1F * hRawZNCTotlg = new TH1F("hRawZNCTotlg", "Rawit lg signal in ZNC", 100, 0., 6000.);
173 TH1F * hRawZNATotlg = new TH1F("hRawZNATotlg", "Rawit lg signal in ZNA", 100, 0., 6000.);
174 TH1F * hRawZPCTotlg = new TH1F("hRawZPCTotlg", "Rawit lg signal in ZPC", 100, 0., 10000.);
175 TH1F * hRawZPATotlg = new TH1F("hRawZPATotlg", "Rawit lg signal in ZPA", 100, 0., 10000.);
176 Add2RawsList(hRawZNCTotlg, 12);
177 Add2RawsList(hRawZPCTotlg, 13);
178 Add2RawsList(hRawZNATotlg, 14);
179 Add2RawsList(hRawZPATotlg, 15);
180 //
3d26d59b 181 TH1F * hRawSumQZNClg = new TH1F("hRawSumQZNClg", "Raw summed 4 lg ZNC quadrants",100, 0., 4000.);
182 TH1F * hRawSumQZPClg = new TH1F("hRawSumQZPClg", "Raw summed 4 lg ZPC quadrants",100, 0., 4000.);
183 TH1F * hRawSumQZNAlg = new TH1F("hRawSumQZNAlg", "Raw summed 4 lg ZNA quadrants",100, 0., 4000.);
184 TH1F * hRawSumQZPAlg = new TH1F("hRawSumQZPAlg", "Raw summed 4 lg ZPA quadrants",100, 0., 4000.);
075a0e70 185 Add2RawsList(hRawSumQZNClg, 16);
186 Add2RawsList(hRawSumQZPClg, 17);
187 Add2RawsList(hRawSumQZNAlg, 18);
188 Add2RawsList(hRawSumQZPAlg, 19);
189 //
3d26d59b 190 TH1F * hRawPMCZNClg = new TH1F("hRawPMCZNClg", "Raw common lg ZNC PMT",100, 0., 4000.);
191 TH1F * hRawPMCZPClg = new TH1F("hRawPMCZPClg", "Raw common lg ZPC PMT",100, 0., 4000.);
192 TH1F * hRawPMCZNAlg = new TH1F("hRawPMCZNAlg", "Raw common lg ZNA PMT",100, 0., 4000.);
193 TH1F * hRawPMCZPAlg = new TH1F("hRawPMCZPAlg", "Raw common lg ZPA PMT",100, 0., 4000.);
075a0e70 194 Add2RawsList(hRawPMCZNClg, 20);
195 Add2RawsList(hRawPMCZPClg, 21);
196 Add2RawsList(hRawPMCZNAlg, 22);
197 Add2RawsList(hRawPMCZPAlg, 23);
198}
199
200//____________________________________________________________________________
3d26d59b 201void AliZDCQADataMakerRec::InitESDs()
075a0e70 202{
203 //Booking ESDs histograms
204 //
205 TH2F * hZNC = new TH2F("hZNC", "Centroid in ZNC", 100, -5.,5.,100,-5.,5.);
206 TH2F * hZNA = new TH2F("hZNA", "Centroid in ZNA", 100, -5.,5.,100,-5.,5.);
207 Add2DigitsList(hZNC, 0);
208 Add2DigitsList(hZNA, 1);
209 //
210 TH1F * hESDZNCTot = new TH1F("hESDZNCTot", "ESD signal in ZNC", 100, 0., 6000.);
211 TH1F * hESDZPCTot = new TH1F("hESDZPCTot", "ESD signal in ZPC", 100, 0., 10000.);
212 TH1F * hESDZNATot = new TH1F("hESDZNATot", "ESD signal in ZNA", 100, 0., 6000.);
213 TH1F * hESDZPATot = new TH1F("hESDZPATot", "ESD signal in ZPA", 100, 0., 10000.);
214 Add2ESDsList(hESDZNCTot, 2);
215 Add2ESDsList(hESDZPCTot, 3);
216 Add2ESDsList(hESDZNATot, 4);
217 Add2ESDsList(hESDZPATot, 5);
218 //
3d26d59b 219 TH1F * hESDSumQZNC = new TH1F("hESDSumQZNC", "Sum of 4 ZNC sectors",100, 0., 4000.);
220 TH1F * hESDSumQZPC = new TH1F("hESDSumQZPC", "Sum of 4 ZPC sectors",100, 0., 4000.);
221 TH1F * hESDSumQZNA = new TH1F("hESDSumQZNA", "Sum of 4 ZNA sectors",100, 0., 4000.);
222 TH1F * hESDSumQZPA = new TH1F("hESDSumQZPA", "Sum of 4 ZPA sectors",100, 0., 4000.);
075a0e70 223 Add2ESDsList(hESDSumQZNC, 6);
224 Add2ESDsList(hESDSumQZPC, 7);
225 Add2ESDsList(hESDSumQZNA, 8);
226 Add2ESDsList(hESDSumQZPA, 9);
227 //
3d26d59b 228 TH1F * hESDPMCZNC = new TH1F("hESDPMCZNC", "Signal in common ZNC PMT",100, 0., 4000.);
229 TH1F * hESDPMCZPC = new TH1F("hESDPMCZPC", "Signal in common ZPC PMT",100, 0., 4000.);
230 TH1F * hESDPMCZNA = new TH1F("hESDPMCZNA", "Signal in common ZNA PMT",100, 0., 4000.);
231 TH1F * hESDPMCZPA = new TH1F("hESDPMCZPA", "Signal in common ZPA PMT",100, 0., 4000.);
075a0e70 232 Add2ESDsList(hESDPMCZNC, 10);
233 Add2ESDsList(hESDPMCZPC, 11);
234 Add2ESDsList(hESDPMCZNA, 12);
235 Add2ESDsList(hESDPMCZPA, 13);
236 //
237 // ------------------- LOW GAIN CHAIN ---------------------------
3d26d59b 238 TH1F * hESDZNCTotlg = new TH1F("hESDZNCTotlg", "ESD lg signal in ZNC", 100, 0., 6000.);
239 TH1F * hESDZNATotlg = new TH1F("hESDZNATotlg", "ESD lg signal in ZNA", 100, 0., 6000.);
240 TH1F * hESDZPCTotlg = new TH1F("hESDZPCTotlg", "ESD lg signal in ZPC", 100, 0., 10000.);
241 TH1F * hESDZPATotlg = new TH1F("hESDZPATotlg", "ESD lg signal in ZPA", 100, 0., 10000.);
075a0e70 242 Add2ESDsList(hESDZNCTotlg, 14);
243 Add2ESDsList(hESDZPCTotlg, 15);
244 Add2ESDsList(hESDZNATotlg, 16);
245 Add2ESDsList(hESDZPATotlg, 17);
246 //
3d26d59b 247 TH1F * hESDSumQZNClg = new TH1F("hESDSumQZNClg", "Sum of 4 lg ZNC sectors",100, 0., 4000.);
248 TH1F * hESDSumQZPClg = new TH1F("hESDSumQZPClg", "Sum of 4 lg ZPC sectors",100, 0., 4000.);
249 TH1F * hESDSumQZNAlg = new TH1F("hESDSumQZNAlg", "Sum of 4 lg ZNA sectors",100, 0., 4000.);
250 TH1F * hESDSumQZPAlg = new TH1F("hESDSumQZPAlg", "Sum of 4 lg ZPA sectors",100, 0., 4000.);
075a0e70 251 Add2ESDsList(hESDSumQZNClg, 18);
252 Add2ESDsList(hESDSumQZPClg, 19);
253 Add2ESDsList(hESDSumQZNAlg, 20);
254 Add2ESDsList(hESDSumQZPAlg, 21);
255 //
3d26d59b 256 TH1F * hESDPMCZNClg = new TH1F("hESDPMCZNClg", "Signal in common ZNC lg PMT",100, 0., 4000.);
257 TH1F * hESDPMCZPClg = new TH1F("hESDPMCZPClg", "Signal in common ZPC lg PMT",100, 0., 4000.);
258 TH1F * hESDPMCZNAlg = new TH1F("hESDPMCZNAlg", "Signal in common ZNA lg PMT",100, 0., 4000.);
259 TH1F * hESDPMCZPAlg = new TH1F("hESDPMCZPAlg", "Signal in common ZPA lg PMT",100, 0., 4000.);
075a0e70 260 Add2ESDsList(hESDPMCZNClg, 22);
261 Add2ESDsList(hESDPMCZPClg, 23);
262 Add2ESDsList(hESDPMCZNAlg, 24);
263 Add2ESDsList(hESDPMCZPAlg, 25);
264}
3d26d59b 265
075a0e70 266//____________________________________________________________________________
267void AliZDCQADataMaker::MakeHits(TClonesArray * data)
268{
269 //filling QA histos for Hits
270 //
271 TClonesArray * hits = dynamic_cast<TClonesArray *>(data);
272 if(!hits){
273 AliError("Wrong type of hits container");
274 }
275 else {
276 TIter next(hits);
277 AliZDCHit * hit;
278 while((hit = dynamic_cast<AliZDCHit *>(next()))){
279 if(hit->GetVolume(0)==1) GetHitsData(0)->Fill(hit->GetXImpact(),hit->GetYImpact());
280 else if(hit->GetVolume(0)==2) GetHitsData(1)->Fill(hit->GetXImpact(), hit->GetYImpact());
281 else if(hit->GetVolume(0)==4) GetHitsData(2)->Fill(hit->GetXImpact(), hit->GetYImpact());
282 else if(hit->GetVolume(0)==5) GetHitsData(3)->Fill(hit->GetXImpact(), hit->GetYImpact());
283 }
284 }
285
286}
287//___________________________________________________________________________
288void AliZDCQADataMakerSim::MakeHits(TTree * hitTree)
289{
290 // make QA data from Hit Tree
291 //
292 if(!hitTree){
293 AliError("Hit Tree not found!");
294 return;
295 }
296 //
075a0e70 297 TBranch * branch = hitTree->GetBranch("ZDC") ;
298 if(!branch){
299 AliError("ZDC branch in Hit Tree not found!");
300 return;
301 }
3d26d59b 302 else{
303 //
304 TClonesArray * hits = new TClonesArray("AliZDCHit", 1000);
305 //
306 Int_t ntracks = (Int_t) hitTree->GetEntries();
307 if (ntracks<=0) return;
308 //
309 for(Int_t itrack=0; itrack<ntracks; itrack++){
310 branch->SetAddress(&hits) ;
311 branch->GetEntry(itrack);
312 //
313 MakeHits(hits);
314 }
315 }
075a0e70 316}
317
318//____________________________________________________________________________
319void AliZDCQADataMakerSim::MakeDigits(TClonesArray * digits)
320{
321 // makes data from Digits
322 //
323 TIter next(digits) ;
324 AliZDCDigit * digit ;
325 //
326 Float_t ADCSum_ZNC=0., ADCSum_ZNA=0., ADCSum_ZPC=0., ADCSum_ZPA=0.;
327 Float_t ADCSumQ_ZNC=0., ADCSumQ_ZNA=0., ADCSumQ_ZPC=0., ADCSumQ_ZPA=0.;
328 Float_t ADCSum_ZNC_lg=0., ADCSum_ZNA_lg=0., ADCSum_ZPC_lg=0., ADCSum_ZPA_lg=0.;
329 Float_t ADCSumQ_ZNC_lg=0., ADCSumQ_ZNA_lg=0., ADCSumQ_ZPC_lg=0., ADCSumQ_ZPA_lg=0.;
330 //
331 //
332 GetDigitsData(0)->Fill(ADCSum_ZNC);
333 GetDigitsData(1)->Fill(ADCSum_ZPC);
334 GetDigitsData(2)->Fill(ADCSum_ZNA);
335 GetDigitsData(3)->Fill(ADCSum_ZPA);
336 //
337 GetDigitsData(4)->Fill(ADCSumQ_ZNC);
338 GetDigitsData(5)->Fill(ADCSumQ_ZPC);
339 GetDigitsData(6)->Fill(ADCSumQ_ZNA);
340 GetDigitsData(7)->Fill(ADCSumQ_ZPA);
341 //
342 GetDigitsData(12)->Fill(ADCSum_ZNC_lg);
343 GetDigitsData(13)->Fill(ADCSum_ZPC_lg);
344 GetDigitsData(14)->Fill(ADCSum_ZNA_lg);
345 GetDigitsData(15)->Fill(ADCSum_ZPA_lg);
346 //
347 GetDigitsData(16)->Fill(ADCSumQ_ZNC_lg);
348 GetDigitsData(17)->Fill(ADCSumQ_ZPC_lg);
349 GetDigitsData(18)->Fill(ADCSumQ_ZNA_lg);
350 GetDigitsData(19)->Fill(ADCSumQ_ZPA_lg);
351
352}
353//___________________________________________________________________________
354void AliZDCQADataMakerSim::MakeDigits(TTree *digitTree )
355{
356 // makes data from Digit Tree
357 TClonesArray * digits = new TClonesArray("AliZDCDigit", 1000);
358 //
359 TBranch * branch = digitTree->GetBranch("ZDC");
360 if(!branch){
361 AliError("ZDC branch in Digit Tree not found");
362 return;
363 }
364 branch->SetAddress(&digits) ;
365 branch->GetEntry(0) ;
366 MakeDigits(digits) ;
367}
368
369//____________________________________________________________________________
370
371void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
372{
373 // Filling Raws QA histos
374 //
375 Float_t Sum_ZNC=0., Sum_ZNA=0., Sum_ZPC=0., Sum_ZPA=0.;
376 Float_t SumQ_ZNC=0., SumQ_ZNA=0., SumQ_ZPC=0., SumQ_ZPA=0.;
377 Float_t Sum_ZNC_lg=0., Sum_ZNA_lg=0., Sum_ZPC_lg=0., Sum_ZPA_lg=0.;
378 Float_t SumQ_ZNC_lg=0., SumQ_ZNA_lg=0., SumQ_ZPC_lg=0., SumQ_ZPA_lg=0.;
379 //
380 AliZDCRawStream stream(rawReader);
381 while(stream.Next()){
382 if(stream.IsADCDataWord() &&
383 (stream.GetADCModule()==0 || stream.GetADCModule()==1)){
384 if(stream.GetSector(0)==1){
385 if(stream.GetADCGain()==0){
386 Sum_ZNC += stream.GetADCValue();
387 if(stream.GetSector(1)!=0) SumQ_ZNC += stream.GetADCValue();
388 else GetRawsData(8)->Fill(stream.GetADCValue());
389 }
390 else{
391 Sum_ZNC_lg += stream.GetADCValue();
392 if(stream.GetSector(1)!=0) SumQ_ZNC_lg += stream.GetADCValue();
393 else GetRawsData(20)->Fill(stream.GetADCValue());
394 }
395 }
396 else if(stream.GetSector(0)==2){
397 if(stream.GetADCGain()==0){
398 Sum_ZPC += stream.GetADCValue();
399 if(stream.GetSector(1)!=0) SumQ_ZPC += stream.GetADCValue();
400 else GetRawsData(9)->Fill(stream.GetADCValue());
401 }
402 else{
403 Sum_ZPC_lg += stream.GetADCValue();
404 if(stream.GetSector(1)!=0) SumQ_ZPC_lg += stream.GetADCValue();
405 else GetRawsData(21)->Fill(stream.GetADCValue());
406 }
407 }
408 else if(stream.GetSector(0)==4){
409 if(stream.GetADCGain()==0){
410 Sum_ZNA += stream.GetADCValue();
411 if(stream.GetSector(1)!=0) SumQ_ZNA += stream.GetADCValue();
412 else GetRawsData(10)->Fill(stream.GetADCValue());
413 }
414 else{
415 Sum_ZNA_lg += stream.GetADCValue();
416 if(stream.GetSector(1)!=0) SumQ_ZNA_lg += stream.GetADCValue();
417 else GetRawsData(22)->Fill(stream.GetADCValue());
418 }
419 }
420 else if(stream.GetSector(0)==5){
421 if(stream.GetADCGain()==0){
422 Sum_ZPA += stream.GetADCValue();
423 if(stream.GetSector(1)!=0) SumQ_ZPA += stream.GetADCValue();
424 else GetRawsData(11)->Fill(stream.GetADCValue());
425 }
426 else{
427 Sum_ZPA_lg += stream.GetADCValue();
428 if(stream.GetSector(1)!=0) SumQ_ZPA_lg += stream.GetADCValue();
429 else GetRawsData(23)->Fill(stream.GetADCValue());
430 }
431 }
432 }
433 }
434 //
435 GetRawsData(0)->Fill(Sum_ZNC);
436 GetRawsData(1)->Fill(Sum_ZPC);
437 GetRawsData(2)->Fill(Sum_ZNA);
438 GetRawsData(3)->Fill(Sum_ZPA);
439 //
440 GetRawsData(4)->Fill(SumQ_ZNC);
441 GetRawsData(5)->Fill(SumQ_ZPC);
442 GetRawsData(6)->Fill(SumQ_ZNA);
443 GetRawsData(7)->Fill(SumQ_ZPA);
444 //
445 GetRawsData(12)->Fill(Sum_ZNC_lg);
446 GetRawsData(13)->Fill(Sum_ZPC_lg);
447 GetRawsData(14)->Fill(Sum_ZNA_lg);
448 GetRawsData(15)->Fill(Sum_ZPA_lg);
449 //
450 GetRawsData(16)->Fill(SumQ_ZNC_lg);
451 GetRawsData(17)->Fill(SumQ_ZPC_lg);
452 GetRawsData(18)->Fill(SumQ_ZNA_lg);
453 GetRawsData(19)->Fill(SumQ_ZPA_lg);
454 //
455 stream.Delete();
456}
457
458//____________________________________________________________________________
459void AliZDCQADataMakerRec::MakeESDs(AliESDEvent * esd)
460{
461 // make QA data from ESDs
462 //
463 AliESDZDC * zdcESD = esd->GetESDZDC();
464 //
465 const Float_t * Centr_ZNC, * Centr_ZNA;
466 Int_t NSpecnC = (Int_t) (esd->GetZDCN1Energy()/2.7);
467 Int_t NSpecnA = (Int_t) (esd->GetZDCN2Energy()/2.7);
468 Centr_ZNC = zdcESD->GetZNCCentroid(NSpecnC);
469 Centr_ZNA = zdcESD->GetZNACentroid(NSpecnA);
470 GetESDsData(0)->Fill(Centr_ZNC[0], Centr_ZNC[1]);
471 GetESDsData(1)->Fill(Centr_ZNA[0], Centr_ZNA[1]);
472 //
473 GetESDsData(2)->Fill(esd->GetZDCN1Energy());
474 GetESDsData(3)->Fill(esd->GetZDCP1Energy());
475 GetESDsData(4)->Fill(esd->GetZDCN2Energy());
476 GetESDsData(5)->Fill(esd->GetZDCP2Energy());
477 //
478 Double_t ZNCSumQ=0., ZPCSumQ=0., ZNASumQ=0., ZPASumQ=0.;
479 Double_t ZNCSumQ_lg=0., ZPCSumQ_lg=0., ZNASumQ_lg=0., ZPASumQ_lg=0.;
480 //
481 const Double_t *ZNCTow, *ZPCTow, *ZNATow, *ZPATow;
482 const Double_t *ZNCTow_lg, *ZPCTow_lg, *ZNATow_lg, *ZPATow_lg;
483 //
484 ZNCTow = zdcESD->GetZN1TowerEnergy();
485 ZPCTow = zdcESD->GetZP1TowerEnergy();
486 ZNATow = zdcESD->GetZN2TowerEnergy();
487 ZPATow = zdcESD->GetZP2TowerEnergy();
488 //
489 ZNCTow_lg = zdcESD->GetZN1TowerEnergyLR();
490 ZPCTow_lg = zdcESD->GetZP1TowerEnergyLR();
491 ZNATow_lg = zdcESD->GetZN2TowerEnergyLR();
492 ZPATow_lg = zdcESD->GetZP2TowerEnergyLR();
493 //
494 for(Int_t i=0; i<5; i++){
495 if(i==0){
496 GetESDsData(10)->Fill(ZNCTow[i]);
497 GetESDsData(11)->Fill(ZPCTow[i]);
498 GetESDsData(12)->Fill(ZNATow[i]);
499 GetESDsData(13)->Fill(ZPATow[i]);
500 //
501 GetESDsData(22)->Fill(ZNCTow_lg[i]);
502 GetESDsData(23)->Fill(ZPCTow_lg[i]);
503 GetESDsData(24)->Fill(ZNATow_lg[i]);
504 GetESDsData(25)->Fill(ZPATow_lg[i]);
505 }
506 else{
507 ZNCSumQ += ZNCTow[i];
508 ZPCSumQ += ZPCTow[i];
509 ZNASumQ += ZNATow[i];
510 ZPASumQ += ZPATow[i];
511 //
512 ZNCSumQ_lg += ZNCTow_lg[i];
513 ZPCSumQ_lg += ZPCTow_lg[i];
514 ZNASumQ_lg += ZNATow_lg[i];
515 ZPASumQ_lg += ZPATow_lg[i];
516 }
517 }
518 GetESDsData(6)->Fill(ZNCSumQ);
519 GetESDsData(7)->Fill(ZPCSumQ);
520 GetESDsData(8)->Fill(ZNASumQ);
521 GetESDsData(9)->Fill(ZPASumQ);
522 //
523 GetESDsData(18)->Fill(ZNCSumQ_lg);
524 GetESDsData(19)->Fill(ZPCSumQ_lg);
525 GetESDsData(20)->Fill(ZNASumQ_lg);
526 GetESDsData(21)->Fill(ZPASumQ_lg);
527}
528
529//____________________________________________________________________________
530void AliZDCQADataMakerRec::StartOfDetectorCycle()
531{
532 //Detector specific actions at start of cycle
533
534}
535
536//____________________________________________________________________________
537void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
538{
539 //Detector specific actions at end of cycle
540 // do the QA checking
541 AliQAChecker::Instance()->Run(AliQA::kZDC, task, list) ;