New function to calculate the RMS by rejecting uncalibrated chambers + an additional...
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQADataMakerRec.cxx
CommitLineData
dc7f1e9e 1/**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15//---\r
16// Produces the data needed to calculate the quality assurance. \r
17// All data must be mergeable objects.\r
18\r
19\r
20// Authors:\r
21//\r
22// Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)\r
23// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)\r
24// Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)\r
25//\r
26// Created: June 13th 2008\r
27//---\r
92664bc8 28// Last update: May 5th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) -->Creates QA expert histograms \r
29// and QA-shifter histograms also with threshold lines and visual alarm\r
dc7f1e9e 30// Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram\r
92664bc8 31// Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP) \r
1b368017 32// |--> Change in Multiplicity histogram for AMORE (to detect empty triggers events of ACORDE)\r
33\r
dc7f1e9e 34\r
35\r
36// --- ROOT system ---\r
37#include <TClonesArray.h>\r
38#include <TFile.h> \r
39#include <TH1F.h> \r
40#include <TDirectory.h>\r
7626fda4 41#include <TPaveText.h>\r
dc7f1e9e 42// --- Standard library ---\r
43\r
44// --- AliRoot header files ---\r
45#include "AliESDEvent.h"\r
46#include "AliLog.h"\r
47#include "AliACORDEdigit.h" \r
48#include "AliACORDEhit.h"\r
49#include "AliACORDEQADataMakerRec.h"\r
50#include "AliQAChecker.h"\r
51#include "AliACORDERawReader.h"\r
52#include "AliACORDERawStream.h"\r
53ClassImp(AliACORDEQADataMakerRec)\r
54 \r
55//____________________________________________________________________________ \r
92664bc8 56 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker"),\r
57 fhACOMean(new TLine(0.,4.,60.,4.)),\r
58 fhACOMin(new TLine(0.,4.,60.,4.)),\r
59 fhACOMax(new TLine(0.,4.,60.,4.)),\r
60 fhACOMulti(new TLine(0.,4.,60.,4.)),\r
61 fhACOMeanAMU(new TLine(0.,4.,60.,4.)),\r
62 fhACOMinAMU(new TLine(0.,4.,60.,4.)),\r
63 fhACOMaxAMU(new TLine(0.,4.,60.,4.)),\r
64 fhACOMultiAMU(new TLine(0.,4.,60.,4.)),\r
65 fhACOTriggerCheck(new TLine(0.,4.,60.,4.))\r
dc7f1e9e 66{\r
67\r
68}\r
69//____________________________________________________________________________ \r
92664bc8 70AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):\r
71 AliQADataMakerRec(),\r
72 fhACOMean(qadm.fhACOMean),\r
73 fhACOMin(qadm.fhACOMin),\r
74 fhACOMax(qadm.fhACOMax),\r
75 fhACOMulti(qadm.fhACOMulti),\r
76 fhACOMeanAMU(qadm.fhACOMeanAMU),\r
77 fhACOMinAMU(qadm.fhACOMinAMU),\r
78 fhACOMaxAMU(qadm.fhACOMaxAMU),\r
79 fhACOMultiAMU(qadm.fhACOMultiAMU),\r
80 fhACOTriggerCheck(qadm.fhACOTriggerCheck)\r
dc7f1e9e 81{\r
82 SetName((const char*)qadm.GetName()) ; \r
83 SetTitle((const char*)qadm.GetTitle()); \r
84}\r
92664bc8 85\r
dc7f1e9e 86//__________________________________________________________________\r
7626fda4 87AliACORDEQADataMakerRec::~AliACORDEQADataMakerRec()\r
88{\r
92664bc8 89 delete fhACOMean;\r
90 delete fhACOMin;\r
91 delete fhACOMax;\r
92 delete fhACOMulti;\r
93 delete fhACOTriggerCheck;\r
7626fda4 94}\r
95\r
96//__________________________________________________________________\r
dc7f1e9e 97AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )\r
98{\r
99 // Equal operator.\r
100 this->~AliACORDEQADataMakerRec();\r
101 new(this) AliACORDEQADataMakerRec(qadm);\r
102 return *this;\r
103}\r
104//____________________________________________________________________________\r
105void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)\r
106{\r
107 //Detector specific actions at end of cycle\r
108 // do the QA checking\r
92664bc8 109 ResetEventTrigClasses(); // reset triggers list to select all histos\r
110 // Update for DQM GUI\r
111 //\r
112 for (Int_t specie = 0; specie < AliRecoParam::kNSpecies ; specie++) {\r
113 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;\r
114 // \r
115 // RS Set event specie\r
116 SetEventSpecie(AliRecoParam::ConvertIndex(specie));\r
117 //\r
118 for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS Loop over the trigger classes\r
119 //\r
120 TObjArray &harr = *GetRawsDataOfTrigClass(itc);\r
121 //\r
385b26a8 122 TH1* h0 = (TH1*)harr[0];\r
123 TH1* h1 = (TH1*)harr[1];\r
124 if (!h0 || !h1) continue;\r
92664bc8 125 double integral = 0;\r
385b26a8 126 if (itc==-1 && !(integral=h0->Integral())) { // default clone\r
92664bc8 127 printf("No entries in ACORDE Hits histograms for trigger class %d, fatal error, please check !!!\n",itc);\r
128 TPaveText *acoBoxFatal=new TPaveText(35,0.5,55,1,"b");\r
129 acoBoxFatal->SetFillColor(kRed);\r
130 acoBoxFatal->SetLineColor(kRed);\r
131 acoBoxFatal->SetLineWidth(2);\r
132 //acoBox2->SetTextSize(3);\r
133 //acoBox2->SetTextColor(kBlack);\r
134 acoBoxFatal->AddText("FLAG MESSAGE: ACO. Not Ok, Call the expert !!!");\r
135 acoBoxFatal->AddText("Blue line: mean of hits");\r
136 acoBoxFatal->AddText("Between GREEN lines: ACO. O.K.");\r
137 h0->GetListOfFunctions()->Add(acoBoxFatal);\r
7626fda4 138 \r
92664bc8 139 TPaveText *acoMultiBoxFatal = new TPaveText(20,0.5,40,1,"b");\r
140 acoMultiBoxFatal->SetFillColor(kRed);\r
141 acoMultiBoxFatal->SetLineColor(kRed);\r
142 acoMultiBoxFatal->SetLineWidth(2);\r
143 acoMultiBoxFatal->AddText("ACO. Not O.K., Call the experts");\r
144 h1->GetListOfFunctions()->Add(acoMultiBoxFatal);\r
145 continue;\r
146 }\r
147 Double_t mean = integral/60;\r
148 fhACOMean->SetY1(mean);\r
149 fhACOMean->SetY2(mean);\r
150 fhACOMin->SetY1(0.05*mean);\r
151 fhACOMin->SetY2(0.05*mean);\r
152 fhACOMax->SetY1(2.25*mean);\r
153 fhACOMax->SetY2(2.25*mean);\r
154 \r
155 // alarms\r
156 Double_t max = h0->GetMaximum();\r
157 if (max == 0) {\r
158 printf("Maximum of hits equal to ZERO, please check the status of ACORDE !!\n");\r
159 continue;\r
160 }\r
161 // Multiplicity histogram threshold\r
162 Double_t maxMulti = h1->GetMaximum();\r
163 if (maxMulti == 0) {\r
164 printf("Maximum of entries equal to ZERO, please check the status of ACORDE !!\n");\r
165 continue;\r
166 }\r
167 fhACOMulti->SetX1(1);\r
168 fhACOMulti->SetY1(1);\r
169 fhACOMulti->SetX2(1);\r
170 fhACOMulti->SetY2(maxMulti);\r
171 TPaveText *acoBox=new TPaveText(35,max-0.20*max,55,max,"b");\r
172 //acoBox->SetFillStyle(0);\r
173 TPaveText *acoBox1=new TPaveText(35,max-0.20*max,55,max,"b");\r
174 //acoBox1->SetFillStyle(0);\r
175 TPaveText *acoBox2=new TPaveText(35,max-0.20*max,55,max,"b");\r
176 //acoBox2->SetFillStyle(0);\r
177 Int_t flagACO_DQM = 0;\r
178 Bool_t isACOOk = kTRUE;\r
179 Bool_t isACOWarning = kFALSE;\r
180 for(Int_t iModule=0;iModule<60;iModule++) {\r
181 if ((h0->GetBinContent(iModule))/max < 0.5) flagACO_DQM++;\r
182 }\r
183 if (flagACO_DQM < 15) {\r
184 acoBox->SetFillColor(kGreen);\r
185 acoBox->SetLineColor(kGreen);\r
186 acoBox->SetLineWidth(2);\r
187 //acoBox->SetTextSize(3);\r
188 //acoBox->SetTextColor(kBlack);\r
189 acoBox->AddText("FLAG MESSAGE: O.K. !!!");\r
190 acoBox->AddText("Blue line: mean of hits");\r
191 acoBox->AddText("Between GREEN lines: ACO. O.K.");\r
192 h0->GetListOfFunctions()->Add(acoBox); \r
193 //\r
194 } \r
195 else if (flagACO_DQM > 15 && flagACO_DQM<30) {\r
196 acoBox1->SetFillColor(kYellow);\r
197 acoBox1->SetLineColor(kYellow);\r
198 acoBox1->SetLineWidth(2);\r
199 //acoBox1->SetTextSize(3);\r
200 //acoBox1->SetTextColor(kBlack);\r
201 acoBox1->AddText("FLAG MESSAGE: Warning, some modules are not working properly !!!");\r
202 acoBox1->AddText("Blue line: mean of hits");\r
203 acoBox1->AddText("Between GREEN lines: ACO. O.K.");\r
204 h0->GetListOfFunctions()->Add(acoBox1);\r
205 isACOWarning=kTRUE; \r
206 }\r
207 else if (flagACO_DQM > 30) {\r
208 acoBox2->SetFillColor(kRed);\r
209 acoBox2->SetLineColor(kRed);\r
210 acoBox2->SetLineWidth(2);\r
211 //acoBox2->SetTextSize(3);\r
212 //acoBox2->SetTextColor(kBlack);\r
213 acoBox2->AddText("FLAG MESSAGE: ACO. Not Ok, Call the expert !!!");\r
214 acoBox2->AddText("Blue line: mean of hits");\r
215 acoBox2->AddText("Between GREEN lines: ACO. O.K.");\r
216 h0->GetListOfFunctions()->Add(acoBox2);\r
217 isACOOk=kFALSE; \r
218 }\r
219 //\r
220 \r
221 TPaveText *acoMultiBox = new TPaveText(20,maxMulti-0.20*maxMulti,40,maxMulti,"b");\r
222 if (h1->Integral()==0 || isACOOk==kFALSE) {\r
223 acoMultiBox->SetFillColor(kRed);\r
224 acoMultiBox->SetLineColor(kRed);\r
225 acoMultiBox->SetLineWidth(2);\r
226 acoMultiBox->AddText("ACO. Not O.K., Call the experts");\r
227 h1->GetListOfFunctions()->Add(acoMultiBox);\r
228 }\r
229 /* if (GetRawsData(5)->GetBinContent(1) > 0 || isACOOk && GetRawsData(5)->Integral()!=0 && isACOOk==kTRUE){\r
230 acoMultiBox->SetFillColor(kYellow);\r
231 acoMultiBox->SetLineColor(kYellow);\r
232 acoMultiBox->SetLineWidth(2);\r
233 acoMultiBox->AddText("Warning: possible empy events only IF ACORDE is triggering, else: O.K.");\r
234 GetRawsData(5)->GetListOfFunctions()->Add(acoMultiBox);\r
235 }\r
236 */\r
237 if (isACOOk==kTRUE) {\r
238 acoMultiBox->SetFillColor(kGreen);\r
239 acoMultiBox->SetLineColor(kGreen);\r
240 acoMultiBox->SetLineWidth(2);\r
241 acoMultiBox->AddText("FLAG MESSAGE: ACO. O.K.");\r
242 //acoMultiBox->AddText("NOTE: if entries below the pink line and ACO is triggering, then call the expert (possible empty events)");\r
243 h1->GetListOfFunctions()->Add(acoMultiBox);\r
244 }\r
245 if (isACOWarning==kTRUE) {\r
246 acoMultiBox->SetFillColor(kYellow);\r
247 acoMultiBox->SetLineColor(kYellow);\r
248 acoMultiBox->SetLineWidth(2);\r
249 acoMultiBox->AddText("FLAG MESSAGE: ACO. O.K., warning, some modules are not working properly");\r
250 //acoMultiBox->AddText("NOTE: if entries below the pink line and ACO is triggering, then call the expert (possible empty events)");\r
251 h1->GetListOfFunctions()->Add(acoMultiBox);\r
252 }\r
253 \r
254 // for AMU ACORDE trigger option\r
255 TH1* h2 = (TH1*)harr[2];\r
256 TH1* h3 = (TH1*)harr[3];\r
257 if (!h2 || !h3) continue;\r
258 Double_t integral1 = h2->Integral();\r
259 if (integral1==0) {\r
260 printf("No entries in ACORDE Hits histograms for trigger class %d --> fatal error, please check !!!\n",itc);\r
261 TPaveText *acoBoxFatalAMU=new TPaveText(35,0.5,55,1,"b");\r
262 acoBoxFatalAMU->SetFillColor(kRed);\r
263 acoBoxFatalAMU->SetLineColor(kRed);\r
264 acoBoxFatalAMU->SetLineWidth(2);\r
265 //acoBox2->SetTextSize(3);\r
266 //acoBox2->SetTextColor(kBlack);\r
267 acoBoxFatalAMU->AddText("FLAG MESSAGE: ACO. Not Ok, Call the expert !!!");\r
268 acoBoxFatalAMU->AddText("Blue line: mean of hits");\r
269 acoBoxFatalAMU->AddText("Between GREEN lines: ACO. O.K.");\r
270 h2->GetListOfFunctions()->Add(acoBoxFatalAMU);\r
271 \r
272 TPaveText *acoMultiBoxFatalAMU = new TPaveText(20,0.5,40,1,"b");\r
273 acoMultiBoxFatalAMU->SetFillColor(kRed);\r
274 acoMultiBoxFatalAMU->SetLineColor(kRed);\r
275 acoMultiBoxFatalAMU->SetLineWidth(2);\r
276 acoMultiBoxFatalAMU->AddText("ACO. Not O.K., Call the experts");\r
277 h3->GetListOfFunctions()->Add(acoMultiBoxFatalAMU);\r
278 \r
279 continue;\r
280 }\r
281 Double_t mean1 = integral1/60;\r
282 fhACOMeanAMU->SetY1(mean1);\r
283 fhACOMeanAMU->SetY2(mean1);\r
284 fhACOMinAMU->SetY1(0.05*mean1);\r
285 fhACOMinAMU->SetY2(0.05*mean1);\r
286 fhACOMaxAMU->SetY1(2.25*mean1);\r
287 fhACOMaxAMU->SetY2(2.25*mean1);\r
288 \r
289 // alarms\r
290 Double_t max1 = h2->GetMaximum();\r
291 if (max1 == 0) {\r
292 printf("Maximum of hits equal to ZERO, please check the status of ACORDE !!\n");\r
293 continue;\r
294 }\r
295 // Multiplicity histogram threshold\r
296 Double_t maxMulti1 = h3->GetMaximum();\r
297 if (maxMulti1 == 0) {\r
298 printf("Maximum of entries equal to ZERO, please check the status of ACORDE !!\n");\r
299 continue;\r
300 }\r
301 fhACOMultiAMU->SetX1(1);\r
302 fhACOMultiAMU->SetY1(1);\r
303 fhACOMultiAMU->SetX2(1);\r
304 fhACOMultiAMU->SetY2(maxMulti1);\r
305 TPaveText *acoBoxAMU=new TPaveText(35,max1-0.20*max1,55,max1,"b");\r
306 //acoBox->SetFillStyle(0);\r
307 TPaveText *acoBox1AMU=new TPaveText(35,max1-0.20*max1,55,max1,"b");\r
308 //acoBox1->SetFillStyle(0);\r
309 TPaveText *acoBox2AMU=new TPaveText(35,max1-0.20*max1,55,max1,"b");\r
310 //acoBox2->SetFillStyle(0);\r
311 Int_t flagACO_DQMAMU = 0;\r
312 Bool_t isACOOkAMU = kTRUE;\r
313 Bool_t isACOWarningAMU = kFALSE;\r
314 for(Int_t iModule=0;iModule<60;iModule++) {\r
315 if ((h2->GetBinContent(iModule))/max1 < 0.5) flagACO_DQMAMU++;\r
316 }\r
317 if (flagACO_DQMAMU < 15) {\r
318 acoBoxAMU->SetFillColor(kGreen);\r
319 acoBoxAMU->SetLineColor(kGreen);\r
320 acoBoxAMU->SetLineWidth(2);\r
321 //acoBox->SetTextSize(3);\r
322 //acoBox->SetTextColor(kBlack);\r
323 acoBoxAMU->AddText("FLAG MESSAGE: O.K. !!!");\r
324 acoBoxAMU->AddText("Blue line: mean of hits");\r
325 acoBoxAMU->AddText("Between GREEN lines: ACO. O.K.");\r
326 h2->GetListOfFunctions()->Add(acoBoxAMU); \r
327 //\r
328 }\r
329 else if (flagACO_DQMAMU > 15 && flagACO_DQMAMU<30) {\r
330 acoBox1AMU->SetFillColor(kYellow);\r
331 acoBox1AMU->SetLineColor(kYellow);\r
332 acoBox1AMU->SetLineWidth(2);\r
333 //acoBox1->SetTextSize(3);\r
334 //acoBox1->SetTextColor(kBlack);\r
335 acoBox1AMU->AddText("FLAG MESSAGE: Warning, some modules are not working properly !!!");\r
336 acoBox1AMU->AddText("Blue line: mean of hits");\r
337 acoBox1AMU->AddText("Between GREEN lines: ACO. O.K.");\r
338 h2->GetListOfFunctions()->Add(acoBox1AMU);\r
339 isACOWarningAMU=kTRUE;\r
340 //\r
341 } \r
342 else if (flagACO_DQMAMU > 30) {\r
343 acoBox2AMU->SetFillColor(kRed);\r
344 acoBox2AMU->SetLineColor(kRed);\r
345 acoBox2AMU->SetLineWidth(2);\r
346 //acoBox2->SetTextSize(3);\r
347 //acoBox2->SetTextColor(kBlack);\r
348 acoBox2AMU->AddText("FLAG MESSAGE: ACO. Not Ok, Call the expert !!!");\r
349 acoBox2AMU->AddText("Blue line: mean of hits");\r
350 acoBox2AMU->AddText("Between GREEN lines: ACO. O.K.");\r
351 h2->GetListOfFunctions()->Add(acoBox2AMU);\r
352 isACOOkAMU=kFALSE;\r
353 }\r
354 //\r
355 TPaveText *acoMultiBoxAMU = new TPaveText(20,maxMulti1-0.20*maxMulti1,40,maxMulti1,"b");\r
356 if (h3->Integral()==0 || isACOOkAMU==kFALSE) {\r
357 acoMultiBoxAMU->SetFillColor(kRed);\r
358 acoMultiBoxAMU->SetLineColor(kRed);\r
359 acoMultiBoxAMU->SetLineWidth(2);\r
360 acoMultiBoxAMU->AddText("ACO. Not O.K., Call the experts");\r
361 h3->GetListOfFunctions()->Add(acoMultiBoxAMU);\r
362 }\r
363 /* if (GetRawsData(5)->GetBinContent(1) > 0 || isACOOk && GetRawsData(5)->Integral()!=0 && isACOOk==kTRUE){\r
364 acoMultiBox->SetFillColor(kYellow);\r
365 acoMultiBox->SetLineColor(kYellow);\r
366 acoMultiBox->SetLineWidth(2);\r
367 acoMultiBox->AddText("Warning: possible empy events only IF ACORDE is triggering, else: O.K.");\r
368 GetRawsData(5)->GetListOfFunctions()->Add(acoMultiBox);\r
369 }\r
370 */\r
371 if (isACOOkAMU==kTRUE) {\r
372 acoMultiBoxAMU->SetFillColor(kGreen);\r
373 acoMultiBoxAMU->SetLineColor(kGreen);\r
374 acoMultiBoxAMU->SetLineWidth(2);\r
375 acoMultiBoxAMU->AddText("FLAG MESSAGE: ACO. O.K.");\r
376 //acoMultiBox->AddText("NOTE: if entries below the pink line and ACO is triggering, then call the expert (possible empty events)");\r
377 h3->GetListOfFunctions()->Add(acoMultiBoxAMU);\r
378 }\r
379 if (isACOWarningAMU==kTRUE) {\r
380 acoMultiBoxAMU->SetFillColor(kYellow);\r
381 acoMultiBoxAMU->SetLineColor(kYellow);\r
382 acoMultiBoxAMU->SetLineWidth(2);\r
383 acoMultiBoxAMU->AddText("FLAG MESSAGE: ACO. O.K., warning, some modules are not working properly");\r
384 //acoMultiBox->AddText("NOTE: if entries below the pink line and ACO is triggering, then call the expert (possible empty events)");\r
385 h3->GetListOfFunctions()->Add(acoMultiBoxAMU);\r
386 }\r
387 \r
388 // Checks if hits distribution from SL0 and AMU are equal\r
389 Float_t eff = 0.0;\r
390 Int_t effFlag = 0;\r
391 //\r
392 TH1* h4 = (TH1*)harr[4];\r
393 if (h4) {\r
394 for (Int_t iModule = 0; iModule < 60; iModule++) {\r
395 if (h2->GetBinContent(iModule)==0) {\r
396 eff = 0.0;\r
397 continue;\r
398 }\r
399 else {\r
400 eff = h0->GetBinContent(iModule)/h2->GetBinContent(iModule);\r
401 h4->Fill(iModule,eff);\r
402 if (eff!=1) effFlag++;\r
403 }\r
404 }\r
405 \r
406 if (effFlag == 0) {\r
407 TPaveText *checkTriggerBox = new TPaveText(20,0.6,40,0.8,"b");\r
408 checkTriggerBox->SetFillColor(kGreen);\r
409 checkTriggerBox->SetLineColor(kGreen);\r
410 checkTriggerBox->SetLineWidth(2);\r
411 checkTriggerBox->AddText("FLAG MESSAGE: ACO. trigger O.K.");\r
412 h4->GetListOfFunctions()->Add(checkTriggerBox);\r
413 }\r
414 else {\r
415 TPaveText *checkTriggerBox1 = new TPaveText(20,0.6,40,0.8,"b");\r
416 checkTriggerBox1->SetFillColor(kYellow);\r
417 checkTriggerBox1->SetLineColor(kYellow);\r
418 checkTriggerBox1->SetLineWidth(2);\r
419 checkTriggerBox1->AddText("FLAG MESSAGE: Warning, please check the ACO trigger configuration");\r
420 h4->GetListOfFunctions()->Add(checkTriggerBox1);\r
421 }\r
422 } // h4\r
423 } // end of trigger classes loop\r
424 } // end specie loop\r
425 // QA Checker standar (to be updated)\r
426 //\r
dc7f1e9e 427 AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;\r
428}\r
429\r
430//____________________________________________________________________________\r
431void AliACORDEQADataMakerRec::StartOfDetectorCycle()\r
432{\r
433 //Detector specific actions at start of cycle\r
434\r
435}\r
436 \r
437//____________________________________________________________________________ \r
438void AliACORDEQADataMakerRec::InitRaws()\r
439{\r
440 // create Raw histograms in Raw subdir\r
441\r
442 const Bool_t expert = kTRUE ; \r
443 const Bool_t saveCorr = kTRUE ; \r
444 const Bool_t image = kTRUE ; \r
92664bc8 445 /*\r
446 const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",\r
dc7f1e9e 447 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
448 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
449 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
450 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
451 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
92664bc8 452 */\r
453 // TH1F *fhACORDEBitPattern[4];\r
454 //TH1F *fhACORDEBitPatternDQM;\r
455 // fhACORDEBitPattern[0] = new TH1F("ACORDEBitPatternfromRAWSingle","Distribution of ACORDE fired modules from RAW-Single;Modules;Counts",60,-0.5,59.5);//AcordeSingleMuon BitPattern\r
456 // fhACORDEBitPattern[1] = new TH1F("ACORDEBitPatternfromRAWMulti","Distribution of ACORDE fired modules from RAW-Multi;Modules;Counts",60,-0.5,59.5);//AcordeMultiMuon BitPattern\r
457 // fhACORDEBitPattern[2] = new TH1F("ACORDEMultiplicityfromRAWSingle","Number of fired ACORDE modules;No. of fired ACORDE modules;No. of events in ACORDE",61,-1,60);//AcordeSingleMuon Multiplicity\r
458 // fhACORDEBitPattern[3] = new TH1F("ACORDEMultiplicityfromRAWMulti","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",61,-1,60);//AcordeMultiMuon Multiplicity\r
459 TH1F * fhACORDEBitPatternDQM = new TH1F("ACOHitsSL0_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode\r
460 TH1F * fhACORDEMultiplicitySL0DQM = new TH1F("ACOMultiSL0_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode\r
461 TH1F * fhACORDEBitPatternAMUDQM = new TH1F("ACOHitsAMU_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode\r
462 TH1F * fhACORDEMultiplicityAMUDQM = new TH1F("ACOMultiAMU_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode\r
463 TH1F * fhACORDEBitPatternCheckDQM = new TH1F("ACOHitsTriggerCheck_DQMExpert","Check distribution for ACORDE trigger configuration; No. of module; Trigger hits difference",60,-0.5,59.5); // Check the trigger status of ACORDE (SL0 vs AMU)\r
464 // Expert histograms\r
465 // for(Int_t i=0;i<4;i++)\r
466 // Add2RawsList(fhACORDEBitPattern[i],i,expert, !image, !saveCorr);\r
467 // Check the hits multiplicity from trigger configuration\r
468 Add2RawsList(fhACORDEBitPatternCheckDQM,4,expert,image,!saveCorr);\r
469 fhACORDEBitPatternCheckDQM->SetFillColor(kOrange);\r
470 // AMORE diplay settings for shifter on GUI\r
471 \r
472 // For SL0 ACO trigger mode\r
473 \r
474 Add2RawsList(fhACORDEBitPatternDQM,0,!expert,image,!saveCorr);\r
475 ForbidCloning(fhACORDEBitPatternDQM);\r
476 Add2RawsList(fhACORDEMultiplicitySL0DQM,1,!expert,image,!saveCorr);\r
477 ForbidCloning(fhACORDEMultiplicitySL0DQM);\r
478 // For Hits distribution on ACORDE\r
479 \r
480 fhACORDEBitPatternDQM->SetFillColor(kCyan-7);\r
481 fhACOMean->SetLineColor(kBlue);\r
482 fhACOMean->SetLineStyle(2);\r
483 fhACOMean->SetLineWidth(4);\r
484 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMean);\r
485 fhACOMin->SetLineColor(kGreen);\r
486 fhACOMin->SetLineStyle(2);\r
487 fhACOMin->SetLineWidth(4);\r
488 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMin);\r
489 fhACOMax->SetLineColor(kGreen);\r
490 fhACOMax->SetLineStyle(2);\r
491 fhACOMax->SetLineWidth(4);\r
492 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMax);\r
493 \r
494 // For ACORDE Multiplicity distribution of fired modules\r
495 \r
496 fhACORDEMultiplicitySL0DQM->SetFillColor(kBlue+1);\r
497 fhACOMulti->SetLineColor(kMagenta);\r
498 fhACOMulti->SetLineStyle(2);\r
499 fhACOMulti->SetLineWidth(4);\r
500 fhACORDEMultiplicitySL0DQM->GetListOfFunctions()->Add(fhACOMulti);\r
501 \r
502 // For AMU ACO trigger mode\r
503 \r
504 Add2RawsList(fhACORDEBitPatternAMUDQM,2,!expert,image,!saveCorr);\r
505 Add2RawsList(fhACORDEMultiplicityAMUDQM,3,!expert,image,!saveCorr);\r
506 \r
507 // For Hits distribution on ACORDE\r
508 \r
509 fhACORDEBitPatternAMUDQM->SetFillColor(kCyan-7);\r
510 fhACOMeanAMU->SetLineColor(kBlue);\r
511 fhACOMeanAMU->SetLineStyle(2);\r
512 fhACOMeanAMU->SetLineWidth(4);\r
513 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMeanAMU);\r
514 fhACOMinAMU->SetLineColor(kGreen);\r
515 fhACOMinAMU->SetLineStyle(2);\r
516 fhACOMinAMU->SetLineWidth(4);\r
517 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMinAMU);\r
518 fhACOMaxAMU->SetLineColor(kGreen);\r
519 fhACOMaxAMU->SetLineStyle(2);\r
520 fhACOMaxAMU->SetLineWidth(4);\r
521 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMaxAMU);\r
522 \r
523 // For ACORDE Multiplicity distribution of fired modules\r
524 \r
525 fhACORDEMultiplicityAMUDQM->SetFillColor(kBlue+1);\r
526 fhACOMultiAMU->SetLineColor(kMagenta);\r
527 fhACOMultiAMU->SetLineStyle(2);\r
528 fhACOMultiAMU->SetLineWidth(4);\r
529 fhACORDEMultiplicityAMUDQM->GetListOfFunctions()->Add(fhACOMultiAMU);\r
530 \r
531 /*\r
dc7f1e9e 532 for (Int_t iModule = 0; iModule<60; iModule++)\r
533 {\r
92664bc8 534 fhACORDEBitPattern[0]->GetXaxis()->SetBinLabel(iModule+1,acoModule[iModule]);\r
535 fhACORDEBitPattern[1]->GetXaxis()->SetBinLabel(iModule+1,acoModule[iModule]);\r
dc7f1e9e 536 }\r
92664bc8 537 */\r
538 //\r
539 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line\r
dc7f1e9e 540}\r
92664bc8 541\r
dc7f1e9e 542//____________________________________________________________________________ \r
543void AliACORDEQADataMakerRec::InitDigits()\r
544{\r
545 // create Digits histograms in Digits subdir\r
546 \r
547 const Bool_t expert = kTRUE ; \r
548 const Bool_t image = kTRUE ; \r
549 TH1F * fhDigitsModule;\r
41d0241f 550 const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",\r
dc7f1e9e 551 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
552 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
553 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
554 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
555 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
556\r
557\r
558 fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE from DIGITS;Modules;Counts",60,1,60);\r
559 Add2DigitsList(fhDigitsModule,0,!expert,image);\r
560 for (Int_t i=0;i<60;i++) fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]); \r
92664bc8 561 //\r
562 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line\r
dc7f1e9e 563}\r
564\r
565//____________________________________________________________________________ \r
566\r
567void AliACORDEQADataMakerRec::InitRecPoints()\r
568{\r
569 // create cluster histograms in RecPoint subdir\r
570 // Not needed for ACORDE by now !!!\r
92664bc8 571 //\r
572 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line\r
dc7f1e9e 573}\r
574\r
575//____________________________________________________________________________\r
576void AliACORDEQADataMakerRec::InitESDs()\r
577{\r
578 //create ESDs histograms in ESDs subdir\r
579\r
580 const Bool_t expert = kTRUE ; \r
581 const Bool_t image = kTRUE ; \r
582 \r
583 TH1F * fhESDsSingle;\r
584 TH1F * fhESDsMulti;\r
1b368017 585 TH1F * fhESDsMultiplicity;\r
41d0241f 586 const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",\r
dc7f1e9e 587 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
588 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
589 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
590 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
591 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
592\r
593\r
594 fhESDsSingle = new TH1F("ACORDEBitPatternfromESDsSingle","Distribution of ACORDE fired modules from ESDs-Single;Modules;Counts",60,1,60);\r
595 Add2ESDsList(fhESDsSingle,0,!expert,image);\r
596\r
597 fhESDsMulti = new TH1F("ACORDEBitPatternfromESDsMulti","Distribution of ACORDE fired modules from ESDs-Multi;Modules;Counts",60,1,60);\r
598 Add2ESDsList(fhESDsMulti,1,!expert,image);\r
1b368017 599 \r
600 fhESDsMultiplicity = new TH1F("ACORDEMultiplicityfromESD","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);\r
601 Add2ESDsList(fhESDsMultiplicity,2,!expert,image); \r
dc7f1e9e 602 for (Int_t i=0;i<60;i++)\r
603 {\r
604 fhESDsSingle->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
605 fhESDsMulti->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
606 }\r
92664bc8 607 //\r
608 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line\r
dc7f1e9e 609}\r
610//____________________________________________________________________________\r
611void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)\r
612{\r
613 //fills QA histos for RAW\r
92664bc8 614 IncEvCountCycleRaws();\r
615 IncEvCountTotalRaws();\r
dc7f1e9e 616 rawReader->Reset();\r
617 AliACORDERawStream rawStream(rawReader);\r
618 size_t contSingle=0;\r
619 size_t contMulti=0;\r
620 UInt_t dy[4];\r
621\r
622 bool kroSingle[60],kroMulti[60];\r
623 UInt_t tmpDy;\r
624\r
625 for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}\r
626\r
627if(rawStream.Next())\r
628{\r
629 dy[0]=rawStream.GetWord(0);\r
630 dy[1]=rawStream.GetWord(1);\r
631 dy[2]=rawStream.GetWord(2);\r
632 dy[3]=rawStream.GetWord(3);\r
633 tmpDy=dy[0];\r
10f9e41a 634 for(Int_t r=0;r<30;r++)\r
dc7f1e9e 635 {\r
636 kroSingle[r] = tmpDy & 1;\r
637 tmpDy>>=1;\r
638 }\r
639 tmpDy=dy[1];\r
10f9e41a 640 for(Int_t r=30;r<60;r++)\r
dc7f1e9e 641 {\r
642 kroSingle[r] = tmpDy & 1;\r
643 tmpDy>>=1;\r
644 }\r
645 tmpDy=dy[2];\r
10f9e41a 646 for(Int_t r=0;r<30;r++)\r
dc7f1e9e 647 {\r
648 kroMulti[r] = tmpDy & 1;\r
649 tmpDy>>=1;\r
650 }\r
651 tmpDy=dy[3];\r
10f9e41a 652 for(Int_t r=30;r<60;r++)\r
dc7f1e9e 653 {\r
654 kroMulti[r] = tmpDy & 1;\r
655 tmpDy>>=1;\r
656 }\r
657 contSingle=0;\r
92664bc8 658 contMulti=0;\r
10f9e41a 659 for(Int_t r=0;r<60;r++)\r
dc7f1e9e 660 {\r
92664bc8 661 if(kroSingle[r]==1)\r
662 {\r
663 FillRawsData(0,r);\r
664 //FillRawsData(4,r);\r
665 contSingle++;\r
666 }\r
1b368017 667 if(kroMulti[r]==1)\r
668 {\r
92664bc8 669 FillRawsData(2,r);\r
670 //FillRawsData(6,r);\r
671 contMulti++;\r
1b368017 672 }\r
92664bc8 673 \r
674 } \r
675 FillRawsData(3,contSingle); \r
676 FillRawsData(7,contMulti);\r
dc7f1e9e 677}\r
678}\r
679//____________________________________________________________________________\r
680void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)\r
681{\r
682 //fills QA histos for Digits\r
92664bc8 683 IncEvCountCycleDigits();\r
684 IncEvCountTotalDigits();\r
685\r
dc7f1e9e 686 if (fDigitsArray) \r
687 fDigitsArray->Clear() ; \r
688 else \r
689 fDigitsArray = new TClonesArray("AliACORDEdigit",1000);\r
690 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");\r
691 if (!branch) {\r
692 AliWarning("ACORDE branch in Digits Tree not found");\r
693 } else {\r
694 branch->SetAddress(&fDigitsArray);\r
695 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {\r
696 branch->GetEntry(track);\r
697 for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {\r
698 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);\r
699 if (!AcoDigit) {\r
700 AliError("The unchecked digit doesn't exist");\r
701 continue ;\r
702 }\r
92664bc8 703 FillDigitsData(0,AcoDigit->GetModule()-1);\r
dc7f1e9e 704 }\r
705 }\r
706 }\r
707}\r
708\r
709//____________________________________________________________________________\r
710void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)\r
711{\r
712 //fills QA histos for ESD\r
92664bc8 713 IncEvCountCycleESDs();\r
714 IncEvCountTotalESDs();\r
715 //\r
dc7f1e9e 716 AliESDACORDE * fESDACORDE= esd->GetACORDEData();\r
1b368017 717 Int_t acoMulti=0;\r
dc7f1e9e 718 for(int i=0;i<60;i++)\r
719 {\r
92664bc8 720 if(fESDACORDE->GetHitChannel(i)) \r
721 {\r
722 FillESDsData(0,i+1);\r
723 FillESDsData(1,i+1);\r
724 acoMulti++;\r
dc7f1e9e 725 }\r
92664bc8 726 } FillESDsData(2,acoMulti);\r
dc7f1e9e 727\r
728}\r