]>
Commit | Line | Data |
---|---|---|
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 ZDC quality assurance. // | |
19 | // QA objects are 1 & 2 Dimensional histograms. // | |
20 | // author: C. Oppedisano // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | // --- ROOT system --- | |
25 | #include <TClonesArray.h> | |
26 | #include <TFile.h> | |
27 | #include <TH1F.h> | |
28 | #include <TH2F.h> | |
29 | #include <TLine.h> | |
30 | #include <TProfile.h> | |
31 | #include <Riostream.h> | |
32 | // --- Standard library --- | |
33 | ||
34 | // --- AliRoot header files --- | |
35 | #include "AliLog.h" | |
36 | #include "AliQAChecker.h" | |
37 | #include "AliZDCReco.h" | |
38 | #include "AliRawReader.h" | |
39 | #include "AliZDCQADataMakerRec.h" | |
40 | #include "AliZDCPedestals.h" | |
41 | #include "AliZDCRawStream.h" | |
42 | #include "AliZDCDigit.h" | |
43 | #include "AliESDZDC.h" | |
44 | #include "AliESDEvent.h" | |
45 | ||
46 | ClassImp(AliZDCQADataMakerRec) | |
47 | ||
48 | //____________________________________________________________________________ | |
49 | AliZDCQADataMakerRec::AliZDCQADataMakerRec() : | |
50 | AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kZDC), "ZDC Quality Assurance Data Maker"), | |
51 | fPedCalibData(0x0) | |
52 | { | |
53 | // ctor | |
54 | } | |
55 | ||
56 | //____________________________________________________________________________ | |
57 | AliZDCQADataMakerRec::AliZDCQADataMakerRec(const AliZDCQADataMakerRec& qadm) : | |
58 | AliQADataMakerRec(), | |
59 | fPedCalibData(qadm.fPedCalibData) | |
60 | ||
61 | { | |
62 | //copy ctor | |
63 | SetName((const char*)qadm.GetName()); | |
64 | SetTitle((const char*)qadm.GetTitle()); | |
65 | } | |
66 | ||
67 | //__________________________________________________________________ | |
68 | AliZDCQADataMakerRec& AliZDCQADataMakerRec::operator = (const AliZDCQADataMakerRec& qadm ) | |
69 | { | |
70 | // Equal operator. | |
71 | this->~AliZDCQADataMakerRec(); | |
72 | new(this) AliZDCQADataMakerRec(qadm); | |
73 | return *this; | |
74 | } | |
75 | ||
76 | //____________________________________________________________________________ | |
77 | AliZDCQADataMakerRec::~AliZDCQADataMakerRec() | |
78 | { | |
79 | if(fPedCalibData && !(AliCDBManager::Instance()->GetCacheFlag())){ | |
80 | delete fPedCalibData; | |
81 | fPedCalibData=0; | |
82 | } | |
83 | } | |
84 | ||
85 | //____________________________________________________________________________ | |
86 | AliZDCPedestals* AliZDCQADataMakerRec::GetPedCalibData() const | |
87 | { | |
88 | ||
89 | // Retrieving pedestal calibration object from OCDB | |
90 | AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Pedestals"); | |
91 | if(!entry) AliWarning("No calibration data loaded!"); | |
92 | ||
93 | AliZDCPedestals *calibdata = (AliZDCPedestals*) (entry->GetObject()); | |
94 | if(!calibdata) AliFatal("Wrong calibration object in calibration file!"); | |
95 | ||
96 | return calibdata; | |
97 | ||
98 | } | |
99 | ||
100 | //____________________________________________________________________________ | |
101 | void AliZDCQADataMakerRec::InitDigits() | |
102 | { | |
103 | // create Digits histograms in Digits subdir | |
104 | // | |
105 | const Bool_t expert = kTRUE ; | |
106 | const Bool_t image = kTRUE ; | |
107 | ||
108 | // ------------------- HIGH GAIN CHAIN --------------------------- | |
109 | TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
110 | TH1F * hDigZNATot = new TH1F("hDigZNATot", "Signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
111 | TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
112 | TH1F * hDigZPATot = new TH1F("hDigZPATot", "Signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
113 | Add2DigitsList(hDigZNCTot, 0, !expert, image); | |
114 | Add2DigitsList(hDigZNATot, 1, !expert, image); | |
115 | Add2DigitsList(hDigZPCTot, 2, !expert, image); | |
116 | Add2DigitsList(hDigZPATot, 3, !expert, image); | |
117 | // | |
118 | TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
119 | TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
120 | TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
121 | TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
122 | Add2DigitsList(hDigSumQZNC, 4, expert, !image); | |
123 | Add2DigitsList(hDigSumQZNA, 5, expert, !image); | |
124 | Add2DigitsList(hDigSumQZPC, 6, expert, !image); | |
125 | Add2DigitsList(hDigSumQZPA, 7, expert, !image); | |
126 | // | |
127 | TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in ZNC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
128 | TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in ZNA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
129 | TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in ZPC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
130 | TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in ZPA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
131 | Add2DigitsList(hDigPMCZNC, 8, expert, !image); | |
132 | Add2DigitsList(hDigPMCZNA, 9, expert, !image); | |
133 | Add2DigitsList(hDigPMCZPC, 10, expert, !image); | |
134 | Add2DigitsList(hDigPMCZPA, 11, expert, !image); | |
135 | // | |
136 | ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line | |
137 | } | |
138 | ||
139 | //____________________________________________________________________________ | |
140 | void AliZDCQADataMakerRec::InitRaws() | |
141 | { | |
142 | // create Digits histograms in Digits subdir | |
143 | const Bool_t expert = kTRUE ; | |
144 | const Bool_t image = kTRUE ; | |
145 | ||
146 | TH1F * hZNCSpectrum = new TH1F("hZNCSpectrum","ZNC spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
147 | TH1F * hZPCSpectrum = new TH1F("hZPCSpectrum","ZPC spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
148 | TH1F * hZNASpectrum = new TH1F("hZNASpectrum","ZNA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
149 | TH1F * hZPASpectrum = new TH1F("hZPASpectrum","ZPA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
150 | // Booking from ch. 8 for checked signals to avoid running QA on pedestals! | |
151 | TH1F * hZEM1Spectrum = new TH1F("hZEM1Spectrum","ZEM1 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.); | |
152 | TH1F * hZEM2Spectrum = new TH1F("hZEM2Spectrum","ZEM2 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.); | |
153 | Add2RawsList(hZNCSpectrum, 0, expert, !image); | |
154 | Add2RawsList(hZNASpectrum, 1, expert, !image); | |
155 | Add2RawsList(hZPCSpectrum, 2, expert, !image); | |
156 | Add2RawsList(hZPASpectrum, 3, expert, !image); | |
157 | Add2RawsList(hZEM1Spectrum, 4, expert, !image); | |
158 | Add2RawsList(hZEM2Spectrum, 5, expert, !image); | |
159 | ||
160 | TH1F * hRawPMCZNC = new TH1F("hRawPMCZNC", "Raw ZNC PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
161 | TH1F * hRawPMCZNA = new TH1F("hRawPMCZNA", "Raw ZNA PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
162 | TH1F * hRawPMCZPC = new TH1F("hRawPMCZPC", "Raw ZPC PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
163 | TH1F * hRawPMCZPA = new TH1F("hRawPMCZPA", "Raw ZPA PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
164 | Add2RawsList(hRawPMCZNC, 6, expert, !image); | |
165 | Add2RawsList(hRawPMCZNA, 7, expert, !image); | |
166 | Add2RawsList(hRawPMCZPC, 8, expert, !image); | |
167 | Add2RawsList(hRawPMCZPA, 9, expert, !image); | |
168 | TH1F * hRawSumQZNC = new TH1F("hRawSumQZNC", "Raw sumQ ZNC;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
169 | TH1F * hRawSumQZNA = new TH1F("hRawSumQZNA", "Raw sumQ ZNA;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
170 | TH1F * hRawSumQZPC = new TH1F("hRawSumQZPC", "Raw sumQ ZPC;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
171 | TH1F * hRawSumQZPA = new TH1F("hRawSumQZPA", "Raw sumQ ZPA;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
172 | Add2RawsList(hRawSumQZNC, 10, expert, !image); | |
173 | Add2RawsList(hRawSumQZNA, 11, expert, !image); | |
174 | Add2RawsList(hRawSumQZPC, 12, expert, !image); | |
175 | Add2RawsList(hRawSumQZPA, 13, expert, !image); | |
176 | ||
177 | TH1F * hRawTDCZNC = new TH1F("hRawTDCZNC", "TDC ZNC;TDC [ns]",160, -320., -260.); | |
178 | Add2RawsList(hRawTDCZNC, 14, expert, !image); | |
179 | TH1F * hRawTDCZPC = new TH1F("hRawTDCZPC", "TDC ZPC;TDC [ns]",160, -340., -280.); | |
180 | Add2RawsList(hRawTDCZPC, 15, expert, !image); | |
181 | TH1F * hRawTDCZNA = new TH1F("hRawTDCZNA", "TDC ZNA;TDC [ns]",160, -340., -280.); | |
182 | Add2RawsList(hRawTDCZNA, 16, expert, !image); | |
183 | TH1F * hRawTDCZPA = new TH1F("hRawTDCZPA", "TDC ZPA;TDC [ns]",160, -340., -280.); | |
184 | Add2RawsList(hRawTDCZPA, 17, expert, !image); | |
185 | TH1F * hRawTDCZEM1 = new TH1F("hRawTDCZEM1", "TDC ZEM1;TDC [ns]",160, -320., -280.); | |
186 | Add2RawsList(hRawTDCZEM1, 18, expert, !image); | |
187 | TH1F * hRawTDCZEM2 = new TH1F("hRawTDCZEM2", "TDC ZEM2;TDC [ns]",160, -320., -280.); | |
188 | Add2RawsList(hRawTDCZEM2, 19, expert, !image); | |
189 | ||
190 | TProfile * hRawADCProfs = new TProfile("hRawADCProfs", "ADC profiles;ADC id;Mean ADC values",22,-0.5,21.5,10.,1210.,""); | |
191 | Add2RawsList(hRawADCProfs, 20, expert, !image); | |
192 | TProfile * hRawTDCProfs = new TProfile("hRawTDCProfs", "TDC profiles;TDC id;Mean TDC values",6,0.5,6.5,-340.,-290.,"S"); | |
193 | Add2RawsList(hRawTDCProfs, 21, expert, !image); | |
194 | ||
195 | TH1F * hRawADCs = new TH1F("hRawADCs", "ADCs;ADC id;Mean ADC values",22,-0.5,21.5); | |
196 | Add2RawsList(hRawADCs, 22, !expert, image); | |
197 | ||
198 | TH1F * hRawTDCs = new TH1F("hRawTDCs", "TDCs;TDC id;Mean TDC values",6,0.5,6.5); | |
199 | // hRawTDCs->SetMaximum(-300); hRawTDCs->SetMinimum(-340); | |
200 | Add2RawsList(hRawTDCs, 23, !expert, image); | |
201 | ||
202 | TH2F *hTimeZDC = new TH2F("hTimeZDC", "ZDC timing;(ZNC-ZNA) (ns);(ZNC+ZNA) (ns)", 120,-30.,30.,120,-100.,-40.); | |
203 | Add2RawsList(hTimeZDC, 24, !expert, image); | |
204 | ||
205 | TH2F *hZNCrawCentr = new TH2F("hZNCrawCentr", "ZNC centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5); | |
206 | Add2RawsList(hZNCrawCentr, 25, expert, image); | |
207 | TH2F *hZNArawCentr = new TH2F("hZNArawCentr", "ZNA centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5); | |
208 | Add2RawsList(hZNArawCentr, 26, expert, image); | |
209 | ||
210 | // | |
211 | ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line | |
212 | } | |
213 | ||
214 | //____________________________________________________________________________ | |
215 | void AliZDCQADataMakerRec::InitRecPoints() | |
216 | { | |
217 | // create Digits histograms in Digits subdir | |
218 | const Bool_t expert = kTRUE ; | |
219 | const Bool_t image = kTRUE ; | |
220 | // | |
221 | // ------------------- HIGH GAIN CHAIN --------------------------- | |
222 | TH1F * hRecZNCTot = new TH1F("hRecZNCTot", "Rec signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 2000.); | |
223 | TH1F * hRecZNATot = new TH1F("hRecZNATot", "Rec signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 2000.); | |
224 | TH1F * hRecZPCTot = new TH1F("hRecZPCTot", "Rec signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 8000.); | |
225 | TH1F * hRecZPATot = new TH1F("hRecZPATot", "Rec signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 8000.); | |
226 | Add2RecPointsList(hRecZNCTot, 0, !expert, image); | |
227 | Add2RecPointsList(hRecZNATot, 1, !expert, image); | |
228 | Add2RecPointsList(hRecZPCTot, 2, !expert, image); | |
229 | Add2RecPointsList(hRecZPATot, 3, !expert, image); | |
230 | // | |
231 | TH1F * hRecSumQZNC = new TH1F("hRecSumQZNC", "Rec summed 4 ZNC quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
232 | TH1F * hRecSumQZNA = new TH1F("hRecSumQZNA", "Rec summed 4 ZNA quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
233 | TH1F * hRecSumQZPC = new TH1F("hRecSumQZPC", "Rec summed 4 ZPC quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
234 | TH1F * hRecSumQZPA = new TH1F("hRecSumQZPA", "Rec summed 4 ZPA quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
235 | Add2RecPointsList(hRecSumQZNC, 4, expert, !image); | |
236 | Add2RecPointsList(hRecSumQZNA, 5, expert, !image); | |
237 | Add2RecPointsList(hRecSumQZPC, 6, expert, !image); | |
238 | Add2RecPointsList(hRecSumQZPA, 7, expert, !image); | |
239 | // | |
240 | TH1F * hRecPMCZNC = new TH1F("hRecPMCZNC", "Rec common ZNC PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
241 | TH1F * hRecPMCZNA = new TH1F("hRecPMCZNA", "Rec common ZNA PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
242 | TH1F * hRecPMCZPC = new TH1F("hRecPMCZPC", "Rec common ZPC PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
243 | TH1F * hRecPMCZPA = new TH1F("hRecPMCZPA", "Rec common ZPA PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
244 | Add2RecPointsList(hRecPMCZNC, 8 , expert, !image); | |
245 | Add2RecPointsList(hRecPMCZNA, 9 , expert, !image); | |
246 | Add2RecPointsList(hRecPMCZPC, 10, expert, !image); | |
247 | Add2RecPointsList(hRecPMCZPA, 11, expert, !image); | |
248 | // | |
249 | ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line | |
250 | } | |
251 | ||
252 | //____________________________________________________________________________ | |
253 | void AliZDCQADataMakerRec::InitESDs() | |
254 | { | |
255 | //Booking ESDs histograms | |
256 | // | |
257 | const Bool_t expert = kTRUE ; | |
258 | const Bool_t image = kTRUE ; | |
259 | ||
260 | // ------------------- HIGH GAIN CHAIN --------------------------- | |
261 | TH1F * hESDZNCTot = new TH1F("hESDZNCTot", "Energy in ZNC", 100, 0., 4000.); | |
262 | TH1F * hESDZNATot = new TH1F("hESDZNATot", "Energy in ZNA", 100, 0., 4000.); | |
263 | TH1F * hESDZPCTot = new TH1F("hESDZPCTot", "Energy in ZPC", 100, 0., 4000.); | |
264 | TH1F * hESDZPATot = new TH1F("hESDZPATot", "Energy in ZPA", 100, 0., 4000.); | |
265 | Add2ESDsList(hESDZNCTot, 0, !expert, image); | |
266 | Add2ESDsList(hESDZNATot, 1, !expert, image); | |
267 | Add2ESDsList(hESDZPCTot, 2, !expert, image); | |
268 | Add2ESDsList(hESDZPATot, 3, !expert, image); | |
269 | // | |
270 | TH1F * hESDZEM1 = new TH1F("hESDZEM1", "Energy in ZEM1", 100, 0., 2000.); | |
271 | TH1F * hESDZEM2 = new TH1F("hESDZEM2", "Energy in ZEM2", 100, 0., 2000.); | |
272 | Add2ESDsList(hESDZEM1,4, !expert, image); | |
273 | Add2ESDsList(hESDZEM2,5, !expert, image); | |
274 | // | |
275 | TH1F * hESDSumQZNC = new TH1F("hESDSumQZNC", "Sum of 4 ZNC energy",100, 0., 2000.); | |
276 | TH1F * hESDSumQZNA = new TH1F("hESDSumQZNA", "Sum of 4 ZNA energy",100, 0., 2000.); | |
277 | TH1F * hESDSumQZPC = new TH1F("hESDSumQZPC", "Sum of 4 ZPC energy",100, 0., 2000.); | |
278 | TH1F * hESDSumQZPA = new TH1F("hESDSumQZPA", "Sum of 4 ZPA energy",100, 0., 2000.); | |
279 | Add2ESDsList(hESDSumQZNC, 6, expert, !image); | |
280 | Add2ESDsList(hESDSumQZNA, 7, expert, !image); | |
281 | Add2ESDsList(hESDSumQZPC, 8, expert, !image); | |
282 | Add2ESDsList(hESDSumQZPA, 9, expert, !image); | |
283 | // | |
284 | TH1F * hESDPMCZNC = new TH1F("hESDPMCZNC", "Energy in ZNC PMC",100, 0., 2000.); | |
285 | TH1F * hESDPMCZNA = new TH1F("hESDPMCZNA", "Energy in ZNA PMC",100, 0., 2000.); | |
286 | TH1F * hESDPMCZPC = new TH1F("hESDPMCZPC", "Energy in ZPC PMC",100, 0., 2000.); | |
287 | TH1F * hESDPMCZPA = new TH1F("hESDPMCZPA", "Energy in ZPA PMC",100, 0., 2000.); | |
288 | Add2ESDsList(hESDPMCZNC, 10, expert, !image); | |
289 | Add2ESDsList(hESDPMCZNA, 11, expert, !image); | |
290 | Add2ESDsList(hESDPMCZPC, 12, expert, !image); | |
291 | Add2ESDsList(hESDPMCZPA, 13, expert, !image); | |
292 | // | |
293 | ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line | |
294 | } | |
295 | ||
296 | //___________________________________________________________________________ | |
297 | void AliZDCQADataMakerRec::MakeDigits(TTree *digitTree) | |
298 | { | |
299 | // makes data from Digit Tree | |
300 | if(!GetDigitsData(0)) InitDigits(); | |
301 | ||
302 | if(!digitTree){ | |
303 | AliError("Can't get ZDC digit tree!!"); | |
304 | return; | |
305 | } | |
306 | ||
307 | TBranch * branch = digitTree->GetBranch("ZDC"); | |
308 | if(!branch){ | |
309 | AliError("ZDC branch in digit tree not found"); | |
310 | return; | |
311 | } | |
312 | ||
313 | AliZDCDigit *digit = 0x0; | |
314 | branch->SetAddress(&digit); | |
315 | ||
316 | Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.; | |
317 | Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.; | |
318 | //Float_t adcSum_ZNC_lg=0., adcSum_ZNA_lg=0., adcSum_ZPC_lg=0., adcSum_ZPA_lg=0.; | |
319 | //Float_t adcSumQ_ZNC_lg=0., adcSumQ_ZNA_lg=0., adcSumQ_ZPC_lg=0., adcSumQ_ZPA_lg=0.; | |
320 | ||
321 | Int_t ndig = digitTree->GetEntries(); | |
322 | for(Int_t i=0; i<ndig; i++){ | |
323 | branch->GetEntry(i); | |
324 | ||
325 | if(digit->GetSector(0)==1 && digit->GetSector(1)!=5){ | |
326 | adcSum_ZNC += digit->GetADCValue(0); | |
327 | //adcSum_ZNC_lg += digit->GetADCValue(1); | |
328 | // | |
329 | if(digit->GetSector(1)!=0){ | |
330 | adcSumQ_ZNC += digit->GetADCValue(0); | |
331 | //adcSumQ_ZNC_lg+= digit->GetADCValue(1); | |
332 | } | |
333 | else{ | |
334 | FillDigitsData(8,digit->GetADCValue(0)); | |
335 | //FillDigitsData(20,digit->GetADCValue(1)); | |
336 | } | |
337 | } | |
338 | else if(digit->GetSector(0)==2){ | |
339 | adcSum_ZPC += digit->GetADCValue(0); | |
340 | //adcSum_ZPC_lg += digit->GetADCValue(1); | |
341 | // | |
342 | if(digit->GetSector(1)!=0){ | |
343 | adcSumQ_ZPC += digit->GetADCValue(0); | |
344 | //adcSumQ_ZPC_lg+= digit->GetADCValue(1); | |
345 | } | |
346 | else{ | |
347 | FillDigitsData(10,digit->GetADCValue(0)); | |
348 | //FillDigitsData(22,digit->GetADCValue(1)); | |
349 | } | |
350 | } | |
351 | else if(digit->GetSector(0)==4 && digit->GetSector(1)!=5){ | |
352 | adcSum_ZNA += digit->GetADCValue(0); | |
353 | //adcSum_ZNA_lg += digit->GetADCValue(1); | |
354 | // | |
355 | if(digit->GetSector(1)!=0){ | |
356 | adcSumQ_ZNA += digit->GetADCValue(0); | |
357 | //adcSumQ_ZNA_lg+= digit->GetADCValue(1); | |
358 | } | |
359 | else{ | |
360 | FillDigitsData(9,digit->GetADCValue(0)); | |
361 | //FillDigitsData(21,digit->GetADCValue(1)); | |
362 | } | |
363 | } | |
364 | else if(digit->GetSector(0)==5){ | |
365 | adcSum_ZPA += digit->GetADCValue(0); | |
366 | //adcSum_ZPA_lg += digit->GetADCValue(1); | |
367 | // | |
368 | if(digit->GetSector(1)!=0){ | |
369 | adcSumQ_ZPA += digit->GetADCValue(0); | |
370 | //adcSumQ_ZPA_lg+= digit->GetADCValue(1); | |
371 | } | |
372 | else{ | |
373 | FillDigitsData(11,digit->GetADCValue(0)); | |
374 | //FillDigitsData(23,digit->GetADCValue(1)); | |
375 | } | |
376 | } | |
377 | } | |
378 | // | |
379 | FillDigitsData(0,adcSum_ZNC); | |
380 | FillDigitsData(1,adcSum_ZNA); | |
381 | FillDigitsData(2,adcSum_ZPC); | |
382 | FillDigitsData(3,adcSum_ZPA); | |
383 | // | |
384 | FillDigitsData(4,adcSumQ_ZNC); | |
385 | FillDigitsData(5,adcSumQ_ZNA); | |
386 | FillDigitsData(6,adcSumQ_ZPC); | |
387 | FillDigitsData(7,adcSumQ_ZPA); | |
388 | ||
389 | delete digit; | |
390 | digit=0; | |
391 | // | |
392 | IncEvCountCycleDigits(); | |
393 | IncEvCountTotalDigits(); | |
394 | // | |
395 | } | |
396 | ||
397 | ||
398 | //____________________________________________________________________________ | |
399 | void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader) | |
400 | { | |
401 | // Filling Raws QA histos | |
402 | // | |
403 | // Checking the event type | |
404 | // if (rawReader->GetType()!=7){ | |
405 | ||
406 | // Check if histograms already created for this Event Specie | |
407 | if(!GetRawsData(0)) InitRaws(); | |
408 | // Parameters for mean value pedestal subtraction | |
409 | int const kNch = 24; | |
410 | Float_t meanPed[2*kNch]; | |
411 | for(Int_t jj=0; jj<2*kNch; jj++) meanPed[jj] = fPedCalibData->GetMeanPed(jj); | |
412 | ||
413 | Float_t zncSignal=0., znaSignal=0., zpcSignal=0., zpaSignal=0.; | |
414 | Float_t zncSumQ=0., znaSumQ=0., zpcSumQ=0., zpaSumQ=0.; | |
415 | Float_t zncpmC=0., znapmC=0., zpcpmC=0., zpapmC=0.; | |
416 | Bool_t isZNCFired=kFALSE, isZPCFired=kFALSE, isZNAFired=kFALSE, isZPAFired=kFALSE; | |
417 | Int_t indZNC=0, indZNA=0, indZPC=0, indZPA=0; | |
418 | Double_t zncTDC=0., zpcTDC=0., zem1TDC=0., zem2TDC=0., znaTDC=0., zpaTDC=0.; | |
419 | Double_t zncSumTDC=0., znaSumTDC=0., tdcGate=0., l0=0.; | |
420 | ||
421 | const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75}; | |
422 | const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75}; | |
423 | const Float_t alpha=0.5; | |
424 | Float_t numXZNC=0., numYZNC=0., denZNC=0., wZNC=0.; | |
425 | Float_t numXZNA=0., numYZNA=0., denZNA=0., wZNA=0.; | |
426 | ||
427 | rawReader->Reset(); | |
428 | AliZDCRawStream stream(rawReader); | |
429 | while(stream.Next()){ | |
430 | ||
431 | if(stream.IsADCDataWord() && | |
432 | (stream.GetADCModule()==0 || stream.GetADCModule()==1)){ | |
433 | ||
434 | Int_t det = stream.GetSector(0); | |
435 | Int_t quad = stream.GetSector(1); | |
436 | Int_t gain = stream.GetADCGain(); | |
437 | Int_t pedindex=0; | |
438 | ||
439 | // Stuff for pedestal subtraction | |
440 | if(quad != 5){ // ZDCs (not reference PTMs) | |
441 | Float_t rawVal=-99., pedSubVal=-99.; | |
442 | if(det == 1){ | |
443 | pedindex = quad; | |
444 | if(gain == 0){ | |
445 | rawVal = (Float_t) (stream.GetADCValue()); | |
446 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
447 | zncSignal += pedSubVal; | |
448 | isZNCFired = kTRUE; | |
449 | if(quad!=0){ | |
450 | zncSumQ += pedSubVal; | |
451 | if(pedSubVal>0.&& zncpmC>7.){ | |
452 | wZNC = TMath::Power(pedSubVal, alpha); | |
453 | numXZNC += x[quad-1]*wZNC; | |
454 | numYZNC += y[quad-1]*wZNC; | |
455 | denZNC += wZNC; | |
456 | } | |
457 | } | |
458 | else{ | |
459 | zncpmC = pedSubVal; | |
460 | FillRawsData(6,zncpmC); | |
461 | } | |
462 | indZNC++; | |
463 | ||
464 | FillRawsData(20, pedindex, pedSubVal); | |
465 | } | |
466 | } | |
467 | else if(det == 2){ | |
468 | pedindex = quad+5; | |
469 | if(gain == 0){ | |
470 | rawVal = (Float_t) (stream.GetADCValue()); | |
471 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
472 | zpcSignal += pedSubVal; | |
473 | isZPCFired = kTRUE; | |
474 | if(quad!=0) zpcSumQ += pedSubVal; | |
475 | else{ | |
476 | zpcpmC = pedSubVal; | |
477 | FillRawsData(8,zpcpmC); | |
478 | } | |
479 | indZPC++; | |
480 | ||
481 | FillRawsData(20, pedindex, pedSubVal); | |
482 | } | |
483 | } | |
484 | else if(det == 3){ | |
485 | pedindex = quad+9; | |
486 | if(quad==1){ | |
487 | if(gain == 0){ | |
488 | rawVal = (Float_t) (stream.GetADCValue()); | |
489 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
490 | FillRawsData(4,pedSubVal); | |
491 | FillRawsData(20,pedindex, pedSubVal); | |
492 | } | |
493 | } | |
494 | else if(quad==2){ | |
495 | if(gain == 0){ | |
496 | rawVal = (Float_t) (stream.GetADCValue()); | |
497 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
498 | FillRawsData(5,pedSubVal); | |
499 | FillRawsData(20,pedindex, pedSubVal); | |
500 | } | |
501 | } | |
502 | } | |
503 | else if(det == 4){ | |
504 | pedindex = quad+12; | |
505 | if(gain == 0){ | |
506 | rawVal = (Float_t) (stream.GetADCValue()); | |
507 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
508 | znaSignal += pedSubVal; | |
509 | isZNAFired = kTRUE; | |
510 | if(quad!=0){ | |
511 | znaSumQ += pedSubVal; | |
512 | if(pedSubVal>0.&& znapmC>7.) { | |
513 | wZNA = TMath::Power(pedSubVal, alpha); | |
514 | numXZNA += x[quad-1]*wZNA; | |
515 | numYZNA += y[quad-1]*wZNA; | |
516 | denZNA += wZNA; | |
517 | } | |
518 | } | |
519 | else{ | |
520 | znapmC = pedSubVal; | |
521 | FillRawsData(7,znapmC); | |
522 | } | |
523 | indZNA++; | |
524 | ||
525 | FillRawsData(20,pedindex, pedSubVal); | |
526 | } | |
527 | } | |
528 | else if(det == 5){ | |
529 | pedindex = quad+17; | |
530 | if(gain == 0){ | |
531 | rawVal = (Float_t) (stream.GetADCValue()); | |
532 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
533 | zpaSignal += pedSubVal; | |
534 | isZPAFired = kTRUE; | |
535 | if(quad!=0) zpaSumQ += pedSubVal; | |
536 | else{ | |
537 | zpapmC = pedSubVal; | |
538 | FillRawsData(9,zpapmC); | |
539 | } | |
540 | indZPA++; | |
541 | ||
542 | FillRawsData(20,pedindex, pedSubVal); | |
543 | } | |
544 | } | |
545 | ||
546 | } | |
547 | ||
548 | if(isZNCFired && indZNC==5){ | |
549 | FillRawsData(0,zncSignal); | |
550 | FillRawsData(10,zncSumQ); | |
551 | // | |
552 | Float_t xZNC, yZNC; | |
553 | if(denZNC!=0){ | |
554 | xZNC = numXZNC/denZNC; | |
555 | yZNC = numYZNC/denZNC; | |
556 | } | |
557 | else xZNC = yZNC = 999.; | |
558 | FillRawsData(25, xZNC, yZNC, zncpmC); | |
559 | } | |
560 | if(isZPCFired && indZPC==5){ | |
561 | FillRawsData(2,zpcSignal); | |
562 | FillRawsData(12,zpcSumQ); | |
563 | } | |
564 | if(isZNAFired && indZNA==5){ | |
565 | FillRawsData(1,znaSignal); | |
566 | FillRawsData(11,znaSumQ); | |
567 | // | |
568 | Float_t xZNA, yZNA; | |
569 | if(denZNA!=0){ | |
570 | xZNA = numXZNA/denZNA; | |
571 | yZNA = numYZNA/denZNA; | |
572 | } | |
573 | else xZNA = yZNA = 999.; | |
574 | FillRawsData(26, xZNA, yZNA, znapmC); | |
575 | } | |
576 | if(isZPAFired && indZPA==5){ | |
577 | FillRawsData(3,zpaSignal); | |
578 | FillRawsData(13,zpaSumQ); | |
579 | } | |
580 | ||
581 | if(indZNC==5){ | |
582 | zncSignal = zncSumQ = zncpmC = 0; | |
583 | isZNCFired=kFALSE; indZNC=0; | |
584 | } | |
585 | if(indZPC==5){ | |
586 | zpcSignal = zpcSumQ = zpcpmC = 0; | |
587 | isZPCFired=kFALSE; indZPC=0; | |
588 | } | |
589 | if(indZNA==5){ | |
590 | znaSignal = znaSumQ = znapmC = 0; | |
591 | isZNAFired=kFALSE; indZNA=0; | |
592 | } | |
593 | if(indZPA==5){ | |
594 | zpaSignal = zpaSumQ = zpapmC = 0; | |
595 | isZPAFired=kFALSE; indZPA=0; | |
596 | } | |
597 | ||
598 | } //IsADCDataWord && signal ADCs | |
599 | else if(stream.IsZDCTDCDatum()){ | |
600 | Float_t tdcValue = 0.025*stream.GetZDCTDCDatum(); | |
601 | if(stream.GetChannel()==1 && tdcValue!=0.){ | |
602 | zncTDC = tdcValue; | |
603 | } | |
604 | else if(stream.GetChannel()==3 && tdcValue!=0.){ | |
605 | zpcTDC = tdcValue; | |
606 | } | |
607 | else if(stream.GetChannel()==5 && tdcValue!=0.){ | |
608 | znaTDC = tdcValue; | |
609 | } | |
610 | else if(stream.GetChannel()==7 && tdcValue!=0.){ | |
611 | zpaTDC = tdcValue; | |
612 | } | |
613 | else if(stream.GetChannel()==8 && tdcValue!=0.){ | |
614 | zem1TDC = tdcValue; | |
615 | } | |
616 | else if(stream.GetChannel()==9 && tdcValue!=0.){ | |
617 | zem2TDC = tdcValue; | |
618 | } | |
619 | else if(stream.GetChannel()==10 && tdcValue!=0.){ | |
620 | zncSumTDC = tdcValue; | |
621 | } | |
622 | else if(stream.GetChannel()==12 && tdcValue!=0.){ | |
623 | znaSumTDC = tdcValue; | |
624 | } | |
625 | else if(stream.GetChannel()==14 && tdcValue!=0.) tdcGate = tdcValue; | |
626 | else if(stream.GetChannel()==15 && tdcValue!=0.) l0 = tdcValue; | |
627 | ||
628 | if(stream.GetChannel()==16 && tdcGate!=0. && l0!=0.){ | |
629 | if(zncTDC!=0.){ | |
630 | Float_t znc = zncTDC-tdcGate; | |
631 | FillRawsData(14,znc); | |
632 | if(znc>-340. && znc<-290.) FillRawsData(21,1, znc); | |
633 | } | |
634 | if(zpcTDC!=0.){ | |
635 | Float_t zpc = zpcTDC-tdcGate; | |
636 | FillRawsData(15,zpc); | |
637 | if(zpc>-340. && zpc<-290.) FillRawsData(21,2, zpc); | |
638 | } | |
639 | if(znaTDC!=0.){ | |
640 | Float_t zna = znaTDC-tdcGate; | |
641 | FillRawsData(16,zna); | |
642 | if(zna>-340. && zna<-290.) FillRawsData(21,3, zna); | |
643 | } | |
644 | if(zpaTDC!=0.){ | |
645 | Float_t zpa = zpaTDC-tdcGate; | |
646 | FillRawsData(17,zpa); | |
647 | if(zpa>-340. && zpa<-290.) FillRawsData(21,4, zpa); | |
648 | } | |
649 | if(zem1TDC!=0.){ | |
650 | Float_t zem1 = zem1TDC-tdcGate; | |
651 | FillRawsData(18,zem1); | |
652 | if(zem1>-340. && zem1<-290.) FillRawsData(21,5, zem1); | |
653 | } | |
654 | if(zem2TDC!=0.){ | |
655 | Float_t zem2 = zem2TDC-tdcGate; | |
656 | FillRawsData(19,zem2); | |
657 | if(zem2TDC>-340. && zem2<-290.) FillRawsData(21,6, zem2); | |
658 | } | |
659 | if(znaSumTDC!=0. && zncSumTDC!=0.){ | |
660 | Float_t tdcC = zncSumTDC-l0; | |
661 | Float_t tdcA = znaSumTDC-l0; | |
662 | FillRawsData(24, tdcC-tdcA, tdcC+tdcA); | |
663 | } | |
664 | // | |
665 | tdcGate = zncTDC = zpcTDC = zem1TDC = zem2TDC = znaTDC = zpaTDC = 0.; | |
666 | zncSumTDC = znaSumTDC = 0.; | |
667 | } | |
668 | } | |
669 | ||
670 | } //stream.Next() | |
671 | // } // check on event type | |
672 | // else{ | |
673 | // AliDebug(1,Form("Skipping non-physics event for QA -> event type %d \n", rawReader->GetType())); | |
674 | // } | |
675 | // | |
676 | IncEvCountCycleRaws(); | |
677 | IncEvCountTotalRaws(); | |
678 | // | |
679 | } | |
680 | ||
681 | //____________________________________________________________________________ | |
682 | void AliZDCQADataMakerRec::MakeRecPoints(TTree * clustersTree) | |
683 | { | |
684 | // Filling QA histos from RecPoints | |
685 | ||
686 | TBranch *branch = clustersTree->GetBranch("ZDC"); | |
687 | if(!branch){ | |
688 | AliError("Can't get the ZDC branch for rec points!"); | |
689 | return; | |
690 | } | |
691 | ||
692 | if(!GetRecPointsData(0)) InitRecPoints() ; | |
693 | ||
694 | Float_t sum_ZNC=0., sum_ZNA=0., sum_ZPC=0., sum_ZPA=0.; | |
695 | Float_t sumQ_ZNC=0., sumQ_ZNA=0., sumQ_ZPC=0., sumQ_ZPA=0.; | |
696 | ||
697 | AliZDCReco reco; | |
698 | AliZDCReco* preco = &reco; | |
699 | clustersTree->SetBranchAddress("ZDC", &preco); | |
700 | ||
701 | clustersTree->GetEntry(0); | |
702 | for(Int_t i=0; i<5; i++){ | |
703 | sum_ZNC += reco.GetZN1HREnTow(i); | |
704 | sum_ZPC += reco.GetZN2HREnTow(i); | |
705 | sum_ZNA += reco.GetZP1HREnTow(i); | |
706 | sum_ZPA += reco.GetZP2HREnTow(i); | |
707 | if(i==0){ | |
708 | FillRecPointsData(8,reco.GetZN1HREnTow(i)); | |
709 | FillRecPointsData(9,reco.GetZN2HREnTow(i)); | |
710 | FillRecPointsData(10,reco.GetZP1HREnTow(i)); | |
711 | FillRecPointsData(11,reco.GetZP2HREnTow(i)); | |
712 | } | |
713 | else{ | |
714 | sumQ_ZNC += reco.GetZN1HREnTow(i); | |
715 | sumQ_ZPC += reco.GetZN2HREnTow(i); | |
716 | sumQ_ZNA += reco.GetZP1HREnTow(i); | |
717 | sumQ_ZPA += reco.GetZP2HREnTow(i); | |
718 | } | |
719 | } | |
720 | ||
721 | FillRecPointsData(0,sum_ZNC); | |
722 | FillRecPointsData(1,sum_ZNA); | |
723 | FillRecPointsData(2,sum_ZPC); | |
724 | FillRecPointsData(3,sum_ZPA); | |
725 | // | |
726 | FillRecPointsData(4,sumQ_ZNC); | |
727 | FillRecPointsData(5,sumQ_ZNA); | |
728 | FillRecPointsData(6,sumQ_ZPC); | |
729 | FillRecPointsData(7,sumQ_ZPA); | |
730 | // | |
731 | IncEvCountCycleRecPoints(); | |
732 | IncEvCountTotalRecPoints(); | |
733 | // | |
734 | } | |
735 | ||
736 | //____________________________________________________________________________ | |
737 | void AliZDCQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
738 | { | |
739 | // make QA data from ESDs | |
740 | // | |
741 | ||
742 | // Check id histograms already created for this Event Specie | |
743 | if(!GetESDsData(0)) InitESDs() ; | |
744 | ||
745 | AliESDZDC * zdcESD = esd->GetESDZDC(); | |
746 | // | |
747 | /*TString beamType = esd->GetBeamType(); | |
748 | Double_t centr_ZNC[2]={999.,999}, centr_ZNA[2]={999.,999}; | |
749 | if(((beamType.CompareTo("pp"))==0) || ((beamType.CompareTo("p-p"))==0) | |
750 | ||((beamType.CompareTo("PP"))==0) || ((beamType.CompareTo("P-P"))==0)){ | |
751 | zdcESD->GetZNCentroidInpp(centr_ZNC, centr_ZNA); | |
752 | } | |
753 | else if((beamType.CompareTo("A-A")) == 0 || (beamType.CompareTo("Pb-Pb")) == 0){ | |
754 | Float_t beamEne = esd->GetBeamEnergy(); | |
755 | zdcESD->GetZNCentroidInPbPb(beamEne, centr_ZNC, centr_ZNA); | |
756 | } | |
757 | else printf("\n WARNING!!! AliZDCQADataMakerRec::MakeESDs: can't calculate centroids for beam type: %s\n\n",beamType.Data()); | |
758 | FillESDsData(0,centr_ZNC[0], centr_ZNC[1]); | |
759 | FillESDsData(1,centr_ZNA[0], centr_ZNA[1]);*/ | |
760 | ||
761 | FillESDsData(0,esd->GetZDCN1Energy()); | |
762 | FillESDsData(1,esd->GetZDCN2Energy()); | |
763 | FillESDsData(2,esd->GetZDCP1Energy()); | |
764 | FillESDsData(3,esd->GetZDCP2Energy()); | |
765 | FillESDsData(4,esd->GetZDCEMEnergy(0)); | |
766 | FillESDsData(5,esd->GetZDCEMEnergy(1)); | |
767 | // | |
768 | Double_t sumQZNC=0., sumQZPC=0., sumQZNA=0., sumQZPA=0.; | |
769 | //Double_t sumQZNC_lg=0., sumQZPC_lg=0., sumQZNA_lg=0., sumQZPA_lg=0.; | |
770 | // | |
771 | const Double_t *towZNC, *towZPC, *towZNA, *towZPA; | |
772 | //const Double_t *towZNC_lg, *towZPC_lg, *towZNA_lg, *towZPA_lg; | |
773 | // | |
774 | towZNC = zdcESD->GetZN1TowerEnergy(); | |
775 | towZPC = zdcESD->GetZP1TowerEnergy(); | |
776 | towZNA = zdcESD->GetZN2TowerEnergy(); | |
777 | towZPA = zdcESD->GetZP2TowerEnergy(); | |
778 | // | |
779 | /*towZNC_lg = zdcESD->GetZN1TowerEnergyLR(); | |
780 | towZPC_lg = zdcESD->GetZP1TowerEnergyLR(); | |
781 | towZNA_lg = zdcESD->GetZN2TowerEnergyLR(); | |
782 | towZPA_lg = zdcESD->GetZP2TowerEnergyLR();*/ | |
783 | // | |
784 | for(Int_t i=0; i<5; i++){ | |
785 | if(i==0){ | |
786 | FillESDsData(10,towZNC[i]); | |
787 | FillESDsData(11,towZNA[i]); | |
788 | FillESDsData(12,towZPC[i]); | |
789 | FillESDsData(13,towZPA[i]); | |
790 | } | |
791 | else{ | |
792 | sumQZNC += towZNC[i]; | |
793 | sumQZPC += towZPC[i]; | |
794 | sumQZNA += towZNA[i]; | |
795 | sumQZPA += towZPA[i]; | |
796 | } | |
797 | } | |
798 | FillESDsData(6,sumQZNC); | |
799 | FillESDsData(7,sumQZNA); | |
800 | FillESDsData(8,sumQZPC); | |
801 | FillESDsData(9,sumQZPA); | |
802 | // | |
803 | IncEvCountCycleESDs(); | |
804 | IncEvCountTotalESDs(); | |
805 | // | |
806 | } | |
807 | ||
808 | //____________________________________________________________________________ | |
809 | void AliZDCQADataMakerRec::StartOfDetectorCycle() | |
810 | { | |
811 | //Detector specific actions at start of cycle | |
812 | ||
813 | fPedCalibData = GetPedCalibData(); | |
814 | ||
815 | } | |
816 | ||
817 | //____________________________________________________________________________ | |
818 | void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) | |
819 | { | |
820 | //Detector specific actions at end of cycle | |
821 | // do the QA checking | |
822 | // | |
823 | ResetEventTrigClasses(); | |
824 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { // RS: loop over event types | |
825 | // | |
826 | if (!IsValidEventSpecie(specie, list)) continue; | |
827 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)); | |
828 | // | |
829 | for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class | |
830 | // | |
831 | if(task == AliQAv1::kRAWS) { | |
832 | TH1F* h14 = dynamic_cast<TH1F*> (GetRawsData(14, itc)); | |
833 | TH1F* h15 = dynamic_cast<TH1F*> (GetRawsData(15, itc)); | |
834 | TH1F* h16 = dynamic_cast<TH1F*> (GetRawsData(16, itc)); | |
835 | TH1F* h17 = dynamic_cast<TH1F*> (GetRawsData(17, itc)); | |
836 | TH1F* h18 = dynamic_cast<TH1F*> (GetRawsData(18, itc)); | |
837 | TH1F* h19 = dynamic_cast<TH1F*> (GetRawsData(19, itc)); | |
838 | TProfile* h20 = dynamic_cast<TProfile*> (GetRawsData(20, itc)); | |
839 | //TProfile* h21 = dynamic_cast<TProfile*> (GetRawsData(21, itc)); | |
840 | TH1F* h22 = dynamic_cast<TH1F*> (GetRawsData(22, itc)); | |
841 | TH1F* h23 = dynamic_cast<TH1F*> (GetRawsData(23, itc)); | |
842 | TH2F* h24 = dynamic_cast<TH2F*> (GetRawsData(24, itc)); | |
843 | TH2F* h25 = dynamic_cast<TH2F*> (GetRawsData(25, itc)); | |
844 | TH2F* h26 = dynamic_cast<TH2F*> (GetRawsData(26, itc)); | |
845 | if(!h20){ | |
846 | AliWarning("AliZDCQADataMakerRec -> RAW ADC histo not found!"); | |
847 | AliWarning(Form("for specie %s and trigger class %s", | |
848 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
849 | } | |
850 | else{ | |
851 | if(h22){ | |
852 | ||
853 | for(Int_t ibin=1; ibin<=h20->GetNbinsX(); ibin++){ | |
854 | h22->SetBinContent(ibin, h20->GetBinContent(ibin)); | |
855 | h22->SetBinError(ibin, h20->GetBinError(ibin)); | |
856 | } | |
857 | h22->SetLineColor(kBlue+1); h22->SetLineWidth(2); | |
858 | } | |
859 | else printf("Warning: Raw ADC QA histo not found \n\n"); | |
860 | } | |
861 | if(!h14 || !h15 || !h16 || !h17 || !h18 || !h19){ | |
862 | AliWarning("AliZDCQADataMakerRec -> RAW TDC histos not found!"); | |
863 | AliWarning(Form("for specie %s and trigger class %s", | |
864 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
865 | } | |
866 | else{ | |
867 | /*for(Int_t ibin=1; ibin<=h21->GetNbinsX(); ibin++){ | |
868 | printf(" bin %d TDC %f\n",ibin, h21->GetBinContent(ibin)); | |
869 | h23->SetBinContent(ibin, h21->GetBinContent(ibin)); | |
870 | h23->SetBinError(ibin, h21->GetBinError(ibin)); | |
871 | }*/ | |
872 | if(h23){ | |
873 | h23->SetBinContent(1, h14->GetMean()); | |
874 | h23->SetBinError(1, h14->GetRMS()); | |
875 | h23->SetBinContent(2, h15->GetMean()); | |
876 | h23->SetBinError(2, h15->GetRMS()); | |
877 | h23->SetBinContent(3, h16->GetMean()); | |
878 | h23->SetBinError(3, h16->GetRMS()); | |
879 | h23->SetBinContent(4, h17->GetMean()); | |
880 | h23->SetBinError(4, h17->GetRMS()); | |
881 | h23->SetBinContent(5, h18->GetMean()); | |
882 | h23->SetBinError(5, h18->GetRMS()); | |
883 | h23->SetBinContent(6, h19->GetMean()); | |
884 | h23->SetBinError(6, h19->GetRMS()); | |
885 | // | |
886 | h23->SetLineColor(kAzure+6); h22->SetLineWidth(2); | |
887 | } | |
888 | else printf(" Warning: Raw TDC QA histo not found\n\n"); | |
889 | } | |
890 | if(!h25 || !h26){ | |
891 | AliWarning("AliZDCQADataMakerRec -> RAW centroid histos not found!"); | |
892 | AliWarning(Form("for specie %s and trigger class %s", | |
893 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
894 | } | |
895 | else{ | |
896 | h25->SetMarkerColor(kPink-2); | |
897 | h26->SetMarkerColor(kAzure-2); | |
898 | } | |
899 | if(!h24) { | |
900 | AliWarning("AliZDCQADataMakerRec -> RAW debunching histo not found!"); | |
901 | AliWarning(Form("for specie %s and trigger class %s", | |
902 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
903 | } | |
904 | else h24->SetMarkerColor(kAzure); | |
905 | } | |
906 | } // loop over t | |
907 | } // loop over species | |
908 | ||
909 | AliQAChecker::Instance()->Run(AliQAv1::kZDC, task, list) ; | |
910 | } |