Updated Calibration Object
[u/mrichter/AliRoot.git] / ZDC / AliZDCQADataMakerRec.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 **************************************************************************/
fdc38bb2 15
16///////////////////////////////////////////////////////////////////////
17// //
18// Produces the data needed to calculate the ZDC quality assurance. //
19// QA objects are 1 & 2 Dimensional histograms. //
20// author: C. Oppedisano //
21// //
22///////////////////////////////////////////////////////////////////////
23
075a0e70 24// --- ROOT system ---
25#include <TClonesArray.h>
26#include <TFile.h>
27#include <TH1F.h>
28#include <TH2F.h>
29#include <TProfile.h>
30#include <Riostream.h>
31// --- Standard library ---
32
33// --- AliRoot header files ---
34#include "AliLog.h"
35#include "AliQAChecker.h"
78328afd 36#include "AliRawReader.h"
075a0e70 37#include "AliZDCQADataMakerRec.h"
38#include "AliZDCRawStream.h"
44ed7a66 39#include "AliZDCDigit.h"
075a0e70 40#include "AliESDZDC.h"
41#include "AliESDEvent.h"
42
43ClassImp(AliZDCQADataMakerRec)
44
45//____________________________________________________________________________
46 AliZDCQADataMakerRec::AliZDCQADataMakerRec() :
eca4fa66 47 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kZDC), "ZDC Quality Assurance Data Maker"),
48 fDigit(0)
075a0e70 49{
50 // ctor
51}
52
53//____________________________________________________________________________
54AliZDCQADataMakerRec::AliZDCQADataMakerRec(const AliZDCQADataMakerRec& qadm) :
eca4fa66 55 AliQADataMakerRec(),
56 fDigit(0)
075a0e70 57{
58 //copy ctor
59 SetName((const char*)qadm.GetName());
60 SetTitle((const char*)qadm.GetTitle());
61}
62
63//__________________________________________________________________
64AliZDCQADataMakerRec& AliZDCQADataMakerRec::operator = (const AliZDCQADataMakerRec& qadm )
65{
66 // Equal operator.
67 this->~AliZDCQADataMakerRec();
68 new(this) AliZDCQADataMakerRec(qadm);
69 return *this;
70}
71
72//____________________________________________________________________________
73
74void AliZDCQADataMakerRec::InitRaws()
75{
76 // create Digits histograms in Digits subdir
213a7d34 77 const Bool_t expert = kTRUE ;
78 const Bool_t image = kTRUE ;
075a0e70 79 //
fdc38bb2 80 // ------------------- HIGH GAIN CHAIN ---------------------------
db72ff3b 81 TH1F * hRawZNCTot = new TH1F("hRawZNCTot", "Raw signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 6000.);
82 TH1F * hRawZNATot = new TH1F("hRawZNATot", "Raw signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 6000.);
83 TH1F * hRawZPCTot = new TH1F("hRawZPCTot", "Raw signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 10000.);
84 TH1F * hRawZPATot = new TH1F("hRawZPATot", "Raw signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 10000.);
213a7d34 85 Add2RawsList(hRawZNCTot, 0, !expert, image);
86 Add2RawsList(hRawZNATot, 1, !expert, image);
87 Add2RawsList(hRawZPCTot, 2, !expert, image);
88 Add2RawsList(hRawZPATot, 3, !expert, image);
075a0e70 89 //
db72ff3b 90 TH1F * hRawSumQZNC = new TH1F("hRawSumQZNC", "Raw summed 4 ZNC quadrants;Amplitude [ADC counts];Counts",100, 0., 4000.);
91 TH1F * hRawSumQZNA = new TH1F("hRawSumQZNA", "Raw summed 4 ZNA quadrants;Amplitude [ADC counts];Counts",100, 0., 4000.);
92 TH1F * hRawSumQZPC = new TH1F("hRawSumQZPC", "Raw summed 4 ZPC quadrants;Amplitude [ADC counts];Counts",100, 0., 4000.);
93 TH1F * hRawSumQZPA = new TH1F("hRawSumQZPA", "Raw summed 4 ZPA quadrants;Amplitude [ADC counts];Counts",100, 0., 4000.);
213a7d34 94 Add2RawsList(hRawSumQZNC, 4, expert, !image);
95 Add2RawsList(hRawSumQZNA, 5, expert, !image);
96 Add2RawsList(hRawSumQZPC, 6, expert, !image);
97 Add2RawsList(hRawSumQZPA, 7, expert, !image);
075a0e70 98 //
db72ff3b 99 TH1F * hRawPMCZNC = new TH1F("hRawPMCZNC", "Raw common ZNC PMT;Amplitude [ADC counts];Counts",100, 0., 4000.);
100 TH1F * hRawPMCZNA = new TH1F("hRawPMCZNA", "Raw common ZNA PMT;Amplitude [ADC counts];Counts",100, 0., 4000.);
101 TH1F * hRawPMCZPC = new TH1F("hRawPMCZPC", "Raw common ZPC PMT;Amplitude [ADC counts];Counts",100, 0., 4000.);
102 TH1F * hRawPMCZPA = new TH1F("hRawPMCZPA", "Raw common ZPA PMT;Amplitude [ADC counts];Counts",100, 0., 4000.);
213a7d34 103 Add2RawsList(hRawPMCZNC, 8 , expert, !image);
104 Add2RawsList(hRawPMCZNA, 9 , expert, !image);
105 Add2RawsList(hRawPMCZPC, 10, expert, !image);
106 Add2RawsList(hRawPMCZPA, 11, expert, !image);
075a0e70 107 //
213a7d34 108 // ------------------- LOW GAIN CHAIN ---------------------------
075a0e70 109 TH1F * hRawZNCTotlg = new TH1F("hRawZNCTotlg", "Rawit lg signal in ZNC", 100, 0., 6000.);
110 TH1F * hRawZNATotlg = new TH1F("hRawZNATotlg", "Rawit lg signal in ZNA", 100, 0., 6000.);
111 TH1F * hRawZPCTotlg = new TH1F("hRawZPCTotlg", "Rawit lg signal in ZPC", 100, 0., 10000.);
112 TH1F * hRawZPATotlg = new TH1F("hRawZPATotlg", "Rawit lg signal in ZPA", 100, 0., 10000.);
213a7d34 113 Add2RawsList(hRawZNCTotlg, 12, !expert, image);
114 Add2RawsList(hRawZNATotlg, 13, !expert, image);
115 Add2RawsList(hRawZPCTotlg, 14, !expert, image);
116 Add2RawsList(hRawZPATotlg, 15, !expert, image);
075a0e70 117 //
3d26d59b 118 TH1F * hRawSumQZNClg = new TH1F("hRawSumQZNClg", "Raw summed 4 lg ZNC quadrants",100, 0., 4000.);
3d26d59b 119 TH1F * hRawSumQZNAlg = new TH1F("hRawSumQZNAlg", "Raw summed 4 lg ZNA quadrants",100, 0., 4000.);
fdc38bb2 120 TH1F * hRawSumQZPClg = new TH1F("hRawSumQZPClg", "Raw summed 4 lg ZPC quadrants",100, 0., 4000.);
3d26d59b 121 TH1F * hRawSumQZPAlg = new TH1F("hRawSumQZPAlg", "Raw summed 4 lg ZPA quadrants",100, 0., 4000.);
213a7d34 122 Add2RawsList(hRawSumQZNClg, 16, kTRUE, expert, !image);
123 Add2RawsList(hRawSumQZNAlg, 17, kTRUE, expert, !image);
124 Add2RawsList(hRawSumQZPClg, 18, kTRUE, expert, !image);
125 Add2RawsList(hRawSumQZPAlg, 19, kTRUE, expert, !image);
075a0e70 126 //
3d26d59b 127 TH1F * hRawPMCZNClg = new TH1F("hRawPMCZNClg", "Raw common lg ZNC PMT",100, 0., 4000.);
3d26d59b 128 TH1F * hRawPMCZNAlg = new TH1F("hRawPMCZNAlg", "Raw common lg ZNA PMT",100, 0., 4000.);
fdc38bb2 129 TH1F * hRawPMCZPClg = new TH1F("hRawPMCZPClg", "Raw common lg ZPC PMT",100, 0., 4000.);
3d26d59b 130 TH1F * hRawPMCZPAlg = new TH1F("hRawPMCZPAlg", "Raw common lg ZPA PMT",100, 0., 4000.);
213a7d34 131 Add2RawsList(hRawPMCZNClg, 20, kTRUE, expert, !image);
132 Add2RawsList(hRawPMCZNAlg, 21, kTRUE, expert, !image);
133 Add2RawsList(hRawPMCZPClg, 22, kTRUE, expert, !image);
134 Add2RawsList(hRawPMCZPAlg, 23, kTRUE, expert, !image);
075a0e70 135}
136
44ed7a66 137//____________________________________________________________________________
138void AliZDCQADataMakerRec::InitDigits()
139{
140 // create Digits histograms in Digits subdir
141 //
142 const Bool_t expert = kTRUE ;
143 const Bool_t image = kTRUE ;
144
145 // ------------------- HIGH GAIN CHAIN ---------------------------
db72ff3b 146 TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 6000.);
147 TH1F * hDigZNATot = new TH1F("hDigZNATot", "Signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 6000.);
148 TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 6000.);
149 TH1F * hDigZPATot = new TH1F("hDigZPATot", "Signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 6000.);
44ed7a66 150 Add2DigitsList(hDigZNCTot, 0, !expert, image);
151 Add2DigitsList(hDigZNATot, 1, !expert, image);
152 Add2DigitsList(hDigZPCTot, 2, !expert, image);
153 Add2DigitsList(hDigZPATot, 3, !expert, image);
154 //
db72ff3b 155 TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);
156 TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);
157 TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);
158 TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);
44ed7a66 159 Add2DigitsList(hDigSumQZNC, 4, expert, !image);
160 Add2DigitsList(hDigSumQZNA, 5, expert, !image);
161 Add2DigitsList(hDigSumQZPC, 6, expert, !image);
162 Add2DigitsList(hDigSumQZPA, 7, expert, !image);
163 //
db72ff3b 164 TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in ZNC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);
165 TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in ZNA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);
166 TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in ZPC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);
167 TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in ZPA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);
44ed7a66 168 Add2DigitsList(hDigPMCZNC, 8, expert, !image);
169 Add2DigitsList(hDigPMCZNA, 9, expert, !image);
170 Add2DigitsList(hDigPMCZPC, 10, expert, !image);
171 Add2DigitsList(hDigPMCZPA, 11, expert, !image);
172 //
173 // ------------------- LOW GAIN CHAIN ---------------------------
213a7d34 174 TH1F * hDigZNCTotlg = new TH1F("hDigZNCTotlg", "Digit lg signal in ZNC", 100, 0., 6000.);
44ed7a66 175 TH1F * hDigZNATotlg = new TH1F("hDigZNATotlg", "Digit lg signal in ZNA", 100, 0., 6000.);
176 TH1F * hDigZPCTotlg = new TH1F("hDigZPCTotlg", "Digit lg signal in ZPC", 100, 0., 6000.);
177 TH1F * hDigZPATotlg = new TH1F("hDigZPATotlg", "Digit lg signal in ZPA", 100, 0., 6000.);
178 Add2DigitsList(hDigZNCTotlg, 12, !expert, image);
179 Add2DigitsList(hDigZNATotlg, 13, !expert, image);
180 Add2DigitsList(hDigZPCTotlg, 14, !expert, image);
181 Add2DigitsList(hDigZPATotlg, 15, !expert, image);
182 //
183 TH1F * hDigSumQZNClg = new TH1F("hDigSumQZNClg", "Signal in 4 ZNC PMQlg",100, 0., 4000.);
184 TH1F * hDigSumQZNAlg = new TH1F("hDigSumQZNAlg", "Signal in 4 ZNA PMQlg",100, 0., 4000.);
185 TH1F * hDigSumQZPClg = new TH1F("hDigSumQZPClg", "Signal in 4 ZPC PMQlg",100, 0., 4000.);
186 TH1F * hDigSumQZPAlg = new TH1F("hDigSumQZPAlg", "Signal in 4 ZPA PMQlg",100, 0., 4000.);
187 Add2DigitsList(hDigSumQZNClg, 16, expert, !image);
188 Add2DigitsList(hDigSumQZNAlg, 17, expert, !image);
189 Add2DigitsList(hDigSumQZPClg, 18, expert, !image);
190 Add2DigitsList(hDigSumQZPAlg, 19, expert, !image);
191 //
192 TH1F * hDigPMCZNClg = new TH1F("hDigPMCZNClg", "Signal in ZNC PMClg",100, 0., 4000.);
193 TH1F * hDigPMCZNAlg = new TH1F("hDigPMCZNAlg", "Signal in ZNA PMClg",100, 0., 4000.);
194 TH1F * hDigPMCZPClg = new TH1F("hDigPMCZPClg", "Signal in ZPC PMClg",100, 0., 4000.);
195 TH1F * hDigPMCZPAlg = new TH1F("hDigPMCZPAlg", "Signal in ZPA PMClg",100, 0., 4000.);
196 Add2DigitsList(hDigPMCZNClg, 20, expert, !image);
197 Add2DigitsList(hDigPMCZNAlg, 21, expert, !image);
198 Add2DigitsList(hDigPMCZPClg, 22, expert, !image);
199 Add2DigitsList(hDigPMCZPAlg, 23, expert, !image);
213a7d34 200
44ed7a66 201}
202
075a0e70 203//____________________________________________________________________________
204void AliZDCQADataMakerRec::InitESDs()
205{
206 //Booking ESDs histograms
207 //
7d297381 208 const Bool_t expert = kTRUE ;
209 const Bool_t image = kTRUE ;
210
075a0e70 211 TH2F * hZNC = new TH2F("hZNC", "Centroid in ZNC", 100, -5.,5.,100,-5.,5.);
212 TH2F * hZNA = new TH2F("hZNA", "Centroid in ZNA", 100, -5.,5.,100,-5.,5.);
7d297381 213 Add2ESDsList(hZNC, 0, !expert, image);
214 Add2ESDsList(hZNA, 1, !expert, image);
075a0e70 215 //
fdc38bb2 216 // ------------------- HIGH GAIN CHAIN ---------------------------
3d26d59b 217 TH1F * hESDZNCTot = new TH1F("hESDZNCTot", "Energy in ZNC", 100, 0., 6000.);
3d26d59b 218 TH1F * hESDZNATot = new TH1F("hESDZNATot", "Energy in ZNA", 100, 0., 6000.);
fdc38bb2 219 TH1F * hESDZPCTot = new TH1F("hESDZPCTot", "Energy in ZPC", 100, 0., 10000.);
3d26d59b 220 TH1F * hESDZPATot = new TH1F("hESDZPATot", "Energy in ZPA", 100, 0., 10000.);
7d297381 221 Add2ESDsList(hESDZNCTot, 2, !expert, image);
222 Add2ESDsList(hESDZNATot, 3, !expert, image);
223 Add2ESDsList(hESDZPCTot, 4, !expert, image);
224 Add2ESDsList(hESDZPATot, 5, !expert, image);
075a0e70 225 //
3d26d59b 226 TH1F * hESDSumQZNC = new TH1F("hESDSumQZNC", "Sum of 4 ZNC energy",100, 0., 4000.);
3d26d59b 227 TH1F * hESDSumQZNA = new TH1F("hESDSumQZNA", "Sum of 4 ZNA energy",100, 0., 4000.);
fdc38bb2 228 TH1F * hESDSumQZPC = new TH1F("hESDSumQZPC", "Sum of 4 ZPC energy",100, 0., 4000.);
3d26d59b 229 TH1F * hESDSumQZPA = new TH1F("hESDSumQZPA", "Sum of 4 ZPA energy",100, 0., 4000.);
7d297381 230 Add2ESDsList(hESDSumQZNC, 6, expert, !image);
231 Add2ESDsList(hESDSumQZNA, 7, expert, !image);
232 Add2ESDsList(hESDSumQZPC, 8, expert, !image);
233 Add2ESDsList(hESDSumQZPA, 9, expert, !image);
075a0e70 234 //
3d26d59b 235 TH1F * hESDPMCZNC = new TH1F("hESDPMCZNC", "Energy in common ZNC PMT",100, 0., 4000.);
3d26d59b 236 TH1F * hESDPMCZNA = new TH1F("hESDPMCZNA", "Energy in common ZNA PMT",100, 0., 4000.);
fdc38bb2 237 TH1F * hESDPMCZPC = new TH1F("hESDPMCZPC", "Energy in common ZPC PMT",100, 0., 4000.);
3d26d59b 238 TH1F * hESDPMCZPA = new TH1F("hESDPMCZPA", "Energy in common ZPA PMT",100, 0., 4000.);
7d297381 239 Add2ESDsList(hESDPMCZNC, 10, expert, !image);
240 Add2ESDsList(hESDPMCZNA, 11, expert, !image);
241 Add2ESDsList(hESDPMCZPC, 12, expert, !image);
242 Add2ESDsList(hESDPMCZPA, 13, expert, !image);
075a0e70 243 //
213a7d34 244 // ------------------- LOW GAIN CHAIN ---------------------------
3d26d59b 245 TH1F * hESDZNCTotlg = new TH1F("hESDZNCTotlg", "ESD lg signal in ZNC", 100, 0., 6000.);
246 TH1F * hESDZNATotlg = new TH1F("hESDZNATotlg", "ESD lg signal in ZNA", 100, 0., 6000.);
247 TH1F * hESDZPCTotlg = new TH1F("hESDZPCTotlg", "ESD lg signal in ZPC", 100, 0., 10000.);
248 TH1F * hESDZPATotlg = new TH1F("hESDZPATotlg", "ESD lg signal in ZPA", 100, 0., 10000.);
7d297381 249 Add2ESDsList(hESDZNCTotlg, !expert, image);
250 Add2ESDsList(hESDZNATotlg, !expert, image);
251 Add2ESDsList(hESDZPCTotlg, !expert, image);
252 Add2ESDsList(hESDZPATotlg, !expert, image);
075a0e70 253 //
3d26d59b 254 TH1F * hESDSumQZNClg = new TH1F("hESDSumQZNClg", "Sum of 4 lg ZNC sectors",100, 0., 4000.);
3d26d59b 255 TH1F * hESDSumQZNAlg = new TH1F("hESDSumQZNAlg", "Sum of 4 lg ZNA sectors",100, 0., 4000.);
fdc38bb2 256 TH1F * hESDSumQZPClg = new TH1F("hESDSumQZPClg", "Sum of 4 lg ZPC sectors",100, 0., 4000.);
3d26d59b 257 TH1F * hESDSumQZPAlg = new TH1F("hESDSumQZPAlg", "Sum of 4 lg ZPA sectors",100, 0., 4000.);
7d297381 258 Add2ESDsList(hESDSumQZNClg, 18, expert, !image);
259 Add2ESDsList(hESDSumQZNAlg, 19, expert, !image);
260 Add2ESDsList(hESDSumQZPClg, 20, expert, !image);
261 Add2ESDsList(hESDSumQZPAlg, 21, expert, !image);
075a0e70 262 //
3d26d59b 263 TH1F * hESDPMCZNClg = new TH1F("hESDPMCZNClg", "Signal in common ZNC lg PMT",100, 0., 4000.);
3d26d59b 264 TH1F * hESDPMCZNAlg = new TH1F("hESDPMCZNAlg", "Signal in common ZNA lg PMT",100, 0., 4000.);
fdc38bb2 265 TH1F * hESDPMCZPClg = new TH1F("hESDPMCZPClg", "Signal in common ZPC lg PMT",100, 0., 4000.);
3d26d59b 266 TH1F * hESDPMCZPAlg = new TH1F("hESDPMCZPAlg", "Signal in common ZPA lg PMT",100, 0., 4000.);
7d297381 267 Add2ESDsList(hESDPMCZNClg, 22, expert, !image);
268 Add2ESDsList(hESDPMCZNAlg, 23, expert, !image);
269 Add2ESDsList(hESDPMCZPClg, 24, expert, !image);
213a7d34 270 Add2ESDsList(hESDPMCZPAlg, 25, expert, !image);
075a0e70 271}
272
273//____________________________________________________________________________
274
275void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
276{
277 // Filling Raws QA histos
278 //
213a7d34 279 // Check if histograms already created for this Event Specie
eca4fa66 280 if ( ! GetRawsData(0) )
213a7d34 281 InitRaws();
eca4fa66 282
78328afd 283 rawReader->Reset() ;
fdc38bb2 284 Float_t sum_ZNC=0., sum_ZNA=0., sum_ZPC=0., sum_ZPA=0.;
285 Float_t sumQ_ZNC=0., sumQ_ZNA=0., sumQ_ZPC=0., sumQ_ZPA=0.;
213a7d34 286 Float_t sum_ZNC_lg=0., sum_ZNA_lg=0., sum_ZPC_lg=0., sum_ZPA_lg=0.;
287 Float_t sumQ_ZNC_lg=0., sumQ_ZNA_lg=0., sumQ_ZPC_lg=0., sumQ_ZPA_lg=0.;
075a0e70 288 //
289 AliZDCRawStream stream(rawReader);
290 while(stream.Next()){
291 if(stream.IsADCDataWord() &&
292 (stream.GetADCModule()==0 || stream.GetADCModule()==1)){
293 if(stream.GetSector(0)==1){
294 if(stream.GetADCGain()==0){
fdc38bb2 295 sum_ZNC += stream.GetADCValue();
296 if(stream.GetSector(1)!=0) sumQ_ZNC += stream.GetADCValue();
075a0e70 297 else GetRawsData(8)->Fill(stream.GetADCValue());
298 }
213a7d34 299 else{
fdc38bb2 300 sum_ZNC_lg += stream.GetADCValue();
301 if(stream.GetSector(1)!=0) sumQ_ZNC_lg += stream.GetADCValue();
075a0e70 302 else GetRawsData(20)->Fill(stream.GetADCValue());
213a7d34 303 }
075a0e70 304 }
305 else if(stream.GetSector(0)==2){
306 if(stream.GetADCGain()==0){
fdc38bb2 307 sum_ZPC += stream.GetADCValue();
308 if(stream.GetSector(1)!=0) sumQ_ZPC += stream.GetADCValue();
309 else GetRawsData(10)->Fill(stream.GetADCValue());
075a0e70 310 }
213a7d34 311 else{
fdc38bb2 312 sum_ZPC_lg += stream.GetADCValue();
313 if(stream.GetSector(1)!=0) sumQ_ZPC_lg += stream.GetADCValue();
314 else GetRawsData(22)->Fill(stream.GetADCValue());
213a7d34 315 }
075a0e70 316 }
317 else if(stream.GetSector(0)==4){
318 if(stream.GetADCGain()==0){
fdc38bb2 319 sum_ZNA += stream.GetADCValue();
320 if(stream.GetSector(1)!=0) sumQ_ZNA += stream.GetADCValue();
321 else GetRawsData(9)->Fill(stream.GetADCValue());
075a0e70 322 }
213a7d34 323 else{
fdc38bb2 324 sum_ZNA_lg += stream.GetADCValue();
325 if(stream.GetSector(1)!=0) sumQ_ZNA_lg += stream.GetADCValue();
326 else GetRawsData(21)->Fill(stream.GetADCValue());
213a7d34 327 }
075a0e70 328 }
329 else if(stream.GetSector(0)==5){
330 if(stream.GetADCGain()==0){
fdc38bb2 331 sum_ZPA += stream.GetADCValue();
332 if(stream.GetSector(1)!=0) sumQ_ZPA += stream.GetADCValue();
075a0e70 333 else GetRawsData(11)->Fill(stream.GetADCValue());
334 }
213a7d34 335 else{
fdc38bb2 336 sum_ZPA_lg += stream.GetADCValue();
337 if(stream.GetSector(1)!=0) sumQ_ZPA_lg += stream.GetADCValue();
075a0e70 338 else GetRawsData(23)->Fill(stream.GetADCValue());
213a7d34 339 }
075a0e70 340 }
341 }
342 }
343 //
fdc38bb2 344 GetRawsData(0)->Fill(sum_ZNC);
345 GetRawsData(1)->Fill(sum_ZNA);
346 GetRawsData(2)->Fill(sum_ZPC);
347 GetRawsData(3)->Fill(sum_ZPA);
075a0e70 348 //
fdc38bb2 349 GetRawsData(4)->Fill(sumQ_ZNC);
350 GetRawsData(5)->Fill(sumQ_ZNA);
351 GetRawsData(6)->Fill(sumQ_ZPC);
352 GetRawsData(7)->Fill(sumQ_ZPA);
075a0e70 353 //
213a7d34 354 GetRawsData(12)->Fill(sum_ZNC_lg);
fdc38bb2 355 GetRawsData(13)->Fill(sum_ZNA_lg);
356 GetRawsData(14)->Fill(sum_ZPC_lg);
357 GetRawsData(15)->Fill(sum_ZPA_lg);
075a0e70 358 //
fdc38bb2 359 GetRawsData(16)->Fill(sumQ_ZNC_lg);
360 GetRawsData(17)->Fill(sumQ_ZNA_lg);
361 GetRawsData(18)->Fill(sumQ_ZPC_lg);
213a7d34 362 GetRawsData(19)->Fill(sumQ_ZPA_lg);
075a0e70 363 //
bc6cefce 364// stream.Delete();
075a0e70 365}
366
44ed7a66 367//___________________________________________________________________________
368void AliZDCQADataMakerRec::MakeDigits(TTree *digitTree )
369{
44ed7a66 370 TBranch * branch = digitTree->GetBranch("ZDC");
371 if(!branch){
372 AliError("ZDC branch in Digit Tree not found");
373 return;
374 }
eca4fa66 375
376 // Check id histograms already created for this Event Specie
377 if ( ! GetDigitsData(0) )
378 InitDigits() ;
379
380 branch->SetAddress(&fDigit);
44ed7a66 381
382 Int_t ndig = digitTree->GetEntries();
383
384 Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.;
385 Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.;
213a7d34 386 Float_t adcSum_ZNC_lg=0., adcSum_ZNA_lg=0., adcSum_ZPC_lg=0., adcSum_ZPA_lg=0.;
387 Float_t adcSumQ_ZNC_lg=0., adcSumQ_ZNA_lg=0., adcSumQ_ZPC_lg=0., adcSumQ_ZPA_lg=0.;
44ed7a66 388 //
389 for(Int_t i = 0; i < ndig; i++){
390 digitTree->GetEntry(i);
391 if(fDigit->GetSector(0)==1){
392 adcSum_ZNC += fDigit->GetADCValue(0);
213a7d34 393 adcSum_ZNC_lg += fDigit->GetADCValue(1);
44ed7a66 394 //
395 if(fDigit->GetSector(1)!=0){
396 adcSumQ_ZNC += fDigit->GetADCValue(0);
213a7d34 397 adcSumQ_ZNC_lg+= fDigit->GetADCValue(1);
44ed7a66 398 }
399 else{
400 GetDigitsData(8)->Fill(fDigit->GetADCValue(0));
213a7d34 401 GetDigitsData(20)->Fill(fDigit->GetADCValue(1));
44ed7a66 402 }
403 }
404 else if(fDigit->GetSector(0)==2){
405 adcSum_ZPC += fDigit->GetADCValue(0);
213a7d34 406 adcSum_ZPC_lg += fDigit->GetADCValue(1);
44ed7a66 407 //
408 if(fDigit->GetSector(1)!=0){
409 adcSumQ_ZPC += fDigit->GetADCValue(0);
213a7d34 410 adcSumQ_ZPC_lg+= fDigit->GetADCValue(1);
44ed7a66 411 }
412 else{
413 GetDigitsData(10)->Fill(fDigit->GetADCValue(0));
213a7d34 414 GetDigitsData(22)->Fill(fDigit->GetADCValue(1));
44ed7a66 415 }
416 }
417 else if(fDigit->GetSector(0)==4){
418 adcSum_ZNA += fDigit->GetADCValue(0);
213a7d34 419 adcSum_ZNA_lg += fDigit->GetADCValue(1);
44ed7a66 420 //
421 if(fDigit->GetSector(1)!=0){
422 adcSumQ_ZNA += fDigit->GetADCValue(0);
213a7d34 423 adcSumQ_ZNA_lg+= fDigit->GetADCValue(1);
44ed7a66 424 }
425 else{
426 GetDigitsData(9)->Fill(fDigit->GetADCValue(0));
213a7d34 427 GetDigitsData(21)->Fill(fDigit->GetADCValue(1));
44ed7a66 428 }
429 }
430 else if(fDigit->GetSector(0)==5){
431 adcSum_ZPA += fDigit->GetADCValue(0);
213a7d34 432 adcSum_ZPA_lg += fDigit->GetADCValue(1);
44ed7a66 433 //
434 if(fDigit->GetSector(1)!=0){
435 adcSumQ_ZPA += fDigit->GetADCValue(0);
213a7d34 436 adcSumQ_ZPA_lg+= fDigit->GetADCValue(1);
44ed7a66 437 }
438 else{
439 GetDigitsData(11)->Fill(fDigit->GetADCValue(0));
213a7d34 440 GetDigitsData(23)->Fill(fDigit->GetADCValue(1));
44ed7a66 441 }
442 }
443 }
444 //
445 GetDigitsData(0)->Fill(adcSum_ZNC);
446 GetDigitsData(1)->Fill(adcSum_ZNA);
447 GetDigitsData(2)->Fill(adcSum_ZPC);
448 GetDigitsData(3)->Fill(adcSum_ZPA);
449 //
450 GetDigitsData(4)->Fill(adcSumQ_ZNC);
451 GetDigitsData(5)->Fill(adcSumQ_ZNA);
452 GetDigitsData(6)->Fill(adcSumQ_ZPC);
453 GetDigitsData(7)->Fill(adcSumQ_ZPA);
454 //
213a7d34 455 GetDigitsData(12)->Fill(adcSum_ZNC_lg);
456 GetDigitsData(13)->Fill(adcSum_ZNA_lg);
457 GetDigitsData(14)->Fill(adcSum_ZPC_lg);
458 GetDigitsData(15)->Fill(adcSum_ZPA_lg);
459 //
460 GetDigitsData(16)->Fill(adcSumQ_ZNC_lg);
461 GetDigitsData(17)->Fill(adcSumQ_ZNA_lg);
462 GetDigitsData(18)->Fill(adcSumQ_ZPC_lg);
463 GetDigitsData(19)->Fill(adcSumQ_ZPA_lg);
44ed7a66 464}
465
075a0e70 466//____________________________________________________________________________
467void AliZDCQADataMakerRec::MakeESDs(AliESDEvent * esd)
468{
469 // make QA data from ESDs
470 //
eca4fa66 471
472 // Check id histograms already created for this Event Specie
473 if ( ! GetESDsData(0) )
474 InitESDs() ;
475
075a0e70 476 AliESDZDC * zdcESD = esd->GetESDZDC();
477 //
2b6cdc43 478 Double32_t * centr_ZNC = zdcESD->GetZNCCentroid();
479 GetESDsData(0)->Fill(centr_ZNC[0], centr_ZNC[1]);
480
481 Double32_t * centr_ZNA = zdcESD->GetZNACentroid();
482 GetESDsData(1)->Fill(centr_ZNA[0], centr_ZNA[1]);
483
075a0e70 484 //
485 GetESDsData(2)->Fill(esd->GetZDCN1Energy());
fdc38bb2 486 GetESDsData(3)->Fill(esd->GetZDCN2Energy());
487 GetESDsData(4)->Fill(esd->GetZDCP1Energy());
075a0e70 488 GetESDsData(5)->Fill(esd->GetZDCP2Energy());
489 //
fdc38bb2 490 Double_t sumQZNC=0., sumQZPC=0., sumQZNA=0., sumQZPA=0.;
213a7d34 491 Double_t sumQZNC_lg=0., sumQZPC_lg=0., sumQZNA_lg=0., sumQZPA_lg=0.;
075a0e70 492 //
fdc38bb2 493 const Double_t *towZNC, *towZPC, *towZNA, *towZPA;
213a7d34 494 const Double_t *towZNC_lg, *towZPC_lg, *towZNA_lg, *towZPA_lg;
075a0e70 495 //
fdc38bb2 496 towZNC = zdcESD->GetZN1TowerEnergy();
497 towZPC = zdcESD->GetZP1TowerEnergy();
498 towZNA = zdcESD->GetZN2TowerEnergy();
499 towZPA = zdcESD->GetZP2TowerEnergy();
075a0e70 500 //
213a7d34 501 towZNC_lg = zdcESD->GetZN1TowerEnergyLR();
fdc38bb2 502 towZPC_lg = zdcESD->GetZP1TowerEnergyLR();
503 towZNA_lg = zdcESD->GetZN2TowerEnergyLR();
213a7d34 504 towZPA_lg = zdcESD->GetZP2TowerEnergyLR();
075a0e70 505 //
506 for(Int_t i=0; i<5; i++){
507 if(i==0){
fdc38bb2 508 GetESDsData(10)->Fill(towZNC[i]);
509 GetESDsData(11)->Fill(towZNA[i]);
510 GetESDsData(12)->Fill(towZPC[i]);
511 GetESDsData(13)->Fill(towZPA[i]);
075a0e70 512 //
213a7d34 513 GetESDsData(22)->Fill(towZNC_lg[i]);
fdc38bb2 514 GetESDsData(23)->Fill(towZNA_lg[i]);
515 GetESDsData(24)->Fill(towZPC_lg[i]);
213a7d34 516 GetESDsData(25)->Fill(towZPA_lg[i]);
075a0e70 517 }
518 else{
fdc38bb2 519 sumQZNC += towZNC[i];
520 sumQZPC += towZPC[i];
521 sumQZNA += towZNA[i];
522 sumQZPA += towZPA[i];
075a0e70 523 //
213a7d34 524 sumQZNC_lg += towZNC_lg[i];
fdc38bb2 525 sumQZPC_lg += towZPC_lg[i];
526 sumQZNA_lg += towZNA_lg[i];
213a7d34 527 sumQZPA_lg += towZPA_lg[i];
075a0e70 528 }
529 }
fdc38bb2 530 GetESDsData(6)->Fill(sumQZNC);
531 GetESDsData(7)->Fill(sumQZNA);
532 GetESDsData(8)->Fill(sumQZPC);
533 GetESDsData(9)->Fill(sumQZPA);
075a0e70 534 //
213a7d34 535 GetESDsData(18)->Fill(sumQZNC_lg);
fdc38bb2 536 GetESDsData(19)->Fill(sumQZNA_lg);
537 GetESDsData(20)->Fill(sumQZPC_lg);
213a7d34 538 GetESDsData(21)->Fill(sumQZPA_lg);
075a0e70 539}
540
541//____________________________________________________________________________
542void AliZDCQADataMakerRec::StartOfDetectorCycle()
543{
544 //Detector specific actions at start of cycle
545
546}
547
548//____________________________________________________________________________
4e25ac79 549void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
075a0e70 550{
551 //Detector specific actions at end of cycle
552 // do the QA checking
4e25ac79 553 AliQAChecker::Instance()->Run(AliQAv1::kZDC, task, list) ;
075a0e70 554}
555