...also histos are now correctly booked
[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
a6bcaa19 28// Last update: Sept. 29th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) \r
29// --> ACOMultiSL0_DQM_Shifter filling histogram fixed\r
30// --> Expert histogram updated: 2 histograms (Checks the hits for SL0 and AMU mode)\r
31// --> To be include in the next update: threshold settings from AliACORDEQAThreshold class (not yet)\r
92664bc8 32// Last update: May 5th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) -->Creates QA expert histograms \r
33// and QA-shifter histograms also with threshold lines and visual alarm\r
dc7f1e9e 34// Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram\r
92664bc8 35// Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP) \r
1b368017 36// |--> Change in Multiplicity histogram for AMORE (to detect empty triggers events of ACORDE)\r
37\r
dc7f1e9e 38\r
39\r
40// --- ROOT system ---\r
41#include <TClonesArray.h>\r
42#include <TFile.h> \r
43#include <TH1F.h> \r
44#include <TDirectory.h>\r
7626fda4 45#include <TPaveText.h>\r
dc7f1e9e 46// --- Standard library ---\r
47\r
48// --- AliRoot header files ---\r
49#include "AliESDEvent.h"\r
50#include "AliLog.h"\r
51#include "AliACORDEdigit.h" \r
52#include "AliACORDEhit.h"\r
53#include "AliACORDEQADataMakerRec.h"\r
54#include "AliQAChecker.h"\r
55#include "AliACORDERawReader.h"\r
56#include "AliACORDERawStream.h"\r
57ClassImp(AliACORDEQADataMakerRec)\r
58 \r
59//____________________________________________________________________________ \r
92664bc8 60 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker"),\r
61 fhACOMean(new TLine(0.,4.,60.,4.)),\r
62 fhACOMin(new TLine(0.,4.,60.,4.)),\r
63 fhACOMax(new TLine(0.,4.,60.,4.)),\r
64 fhACOMulti(new TLine(0.,4.,60.,4.)),\r
65 fhACOMeanAMU(new TLine(0.,4.,60.,4.)),\r
66 fhACOMinAMU(new TLine(0.,4.,60.,4.)),\r
67 fhACOMaxAMU(new TLine(0.,4.,60.,4.)),\r
a6bcaa19 68 fhACOMultiAMU(new TLine(0.,4.,60.,4.))\r
dc7f1e9e 69{\r
70\r
71}\r
72//____________________________________________________________________________ \r
92664bc8 73AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):\r
74 AliQADataMakerRec(),\r
75 fhACOMean(qadm.fhACOMean),\r
76 fhACOMin(qadm.fhACOMin),\r
77 fhACOMax(qadm.fhACOMax),\r
78 fhACOMulti(qadm.fhACOMulti),\r
79 fhACOMeanAMU(qadm.fhACOMeanAMU),\r
80 fhACOMinAMU(qadm.fhACOMinAMU),\r
81 fhACOMaxAMU(qadm.fhACOMaxAMU),\r
a6bcaa19 82 fhACOMultiAMU(qadm.fhACOMultiAMU)\r
dc7f1e9e 83{\r
84 SetName((const char*)qadm.GetName()) ; \r
85 SetTitle((const char*)qadm.GetTitle()); \r
86}\r
92664bc8 87\r
dc7f1e9e 88//__________________________________________________________________\r
7626fda4 89AliACORDEQADataMakerRec::~AliACORDEQADataMakerRec()\r
90{\r
92664bc8 91 delete fhACOMean;\r
92 delete fhACOMin;\r
93 delete fhACOMax;\r
94 delete fhACOMulti;\r
47f5f498 95 delete fhACOMeanAMU;\r
96 delete fhACOMinAMU;\r
97 delete fhACOMaxAMU;\r
98 delete fhACOMultiAMU;\r
7626fda4 99}\r
100\r
101//__________________________________________________________________\r
dc7f1e9e 102AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )\r
103{\r
104 // Equal operator.\r
105 this->~AliACORDEQADataMakerRec();\r
106 new(this) AliACORDEQADataMakerRec(qadm);\r
107 return *this;\r
108}\r
109//____________________________________________________________________________\r
110void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)\r
111{\r
112 //Detector specific actions at end of cycle\r
113 // do the QA checking\r
92664bc8 114 ResetEventTrigClasses(); // reset triggers list to select all histos\r
115 // Update for DQM GUI\r
116 //\r
a6bcaa19 117\r
118 // Thresholds and alarms definitions\r
119 /*******************************************************************************************\r
120\r
121 We check the performance of the ACORDE's modules respect to the mean\r
122 value over the integral for hits for all the modules (in SL0 and AMU), then\r
123 for the threshold lines we don't use a fixed threshold value.\r
124\r
125 For the alarms, we need two fixed values (one for each configuration, SL0 and AMU):\r
126\r
127 -) SL0_ThresholdAlarm: minimum number of ACORDE's modules woriking properly\r
128 -) AMU_ThresholdAlarm: minimum number of ACORDE's modules woriking properly\r
129\r
130 This should work for p-p*, HI* and cosmic** data taking.\r
131\r
132 * only as readout detector (if ACORDE is triggering, in some rare trigger cluster, \r
133 an improvement should be done)\r
134 ** as readout and trigger detector.\r
135\r
136 *********************************************************************************************/\r
137\r
92664bc8 138 for (Int_t specie = 0; specie < AliRecoParam::kNSpecies ; specie++) {\r
139 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;\r
140 // \r
141 // RS Set event specie\r
142 SetEventSpecie(AliRecoParam::ConvertIndex(specie));\r
143 //\r
144 for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS Loop over the trigger classes\r
145 //\r
a6bcaa19 146 TObjArray * parr = GetRawsDataOfTrigClass(itc);\r
147 if (!parr) continue;\r
148 TObjArray &harr = *parr;\r
149 TH1* h0 = (TH1*)harr[0];\r
150 TH1* h1 = (TH1*)harr[1];\r
151 if (!h0 || !h1) continue;\r
152 TH1* h2 = (TH1*)harr[2];\r
153 TH1* h3 = (TH1*)harr[3];\r
154 if (!h2 || !h3) continue;\r
155\r
156 Double_t integralSL0 = 0;\r
157 Double_t integralAMU = 0;\r
158\r
159 // maximimum and minimum for Pads\r
160\r
161 Double_t maxPad = h0->GetMaximum();\r
7626fda4 162 \r
a6bcaa19 163 if ((itc==-1 && !(integralAMU=h2->Integral()) || h2->GetMaximum()==0)||(itc==-1 && !(integralSL0=h0->Integral()) || h0->GetMaximum()==0)) { // default clone\r
164 printf("No entries in ACORDE Hits histograms for trigger class %d, fatal error, please check !!!\n",itc);\r
165 Float_t maxPadAMU = h3->GetMaximum();\r
166 TPaveText *acoBoxFatalAMU = new TPaveText(35,0,55,1,"b");\r
167 acoBoxFatalAMU->SetFillColor(kRed);\r
168 acoBoxFatalAMU->SetLineColor(kRed);\r
169 acoBoxFatalAMU->SetLineWidth(2);\r
170 acoBoxFatalAMU->AddText("ACO: Not O.K.");\r
171 acoBoxFatalAMU->AddText("Call the experts");\r
172\r
173 TPaveText *acoBoxFatalMultiAMU = new TPaveText(35,0,55,maxPadAMU,"b");\r
174 acoBoxFatalMultiAMU->SetFillColor(kRed);\r
175 acoBoxFatalMultiAMU->SetLineColor(kRed);\r
176 acoBoxFatalMultiAMU->SetLineWidth(2);\r
177 acoBoxFatalMultiAMU->AddText("ACO: Not O.K.");\r
178 acoBoxFatalMultiAMU->AddText("Call the experts");\r
179\r
180 h2->GetListOfFunctions()->Add(acoBoxFatalAMU);\r
181 h3->GetListOfFunctions()->Add(acoBoxFatalMultiAMU);\r
182\r
183 Float_t maxPadSL0 = h1->GetMaximum();\r
184\r
185 printf("No entries in ACORDE Hits histograms for trigger class %d, fatal error, please check !!!\n",itc);\r
186 TPaveText *acoBoxFatal = new TPaveText(35,0,55,1,"b");\r
187 acoBoxFatal->SetFillColor(kRed);\r
188 acoBoxFatal->SetLineColor(kRed);\r
189 acoBoxFatal->SetLineWidth(2);\r
190 acoBoxFatal->AddText("ACO: Not O.K.");\r
191 acoBoxFatal->AddText("Call the experts");\r
192\r
193 TPaveText *acoBoxFatalMulti = new TPaveText(35,0,55,maxPadSL0,"b");\r
194 acoBoxFatalMulti->SetFillColor(kRed);\r
195 acoBoxFatalMulti->SetLineColor(kRed);\r
196 acoBoxFatalMulti->SetLineWidth(2);\r
197 acoBoxFatalMulti->AddText("ACO: Not O.K.");\r
198 acoBoxFatalMulti->AddText("Call the experts");\r
199\r
200 h0->GetListOfFunctions()->Add(acoBoxFatal);\r
201 h1->GetListOfFunctions()->Add(acoBoxFatalMulti);\r
202 continue;\r
203 }\r
92664bc8 204 \r
a6bcaa19 205 // Check DQM\r
206\r
207 // setting the thresholds\r
208\r
209 Int_t SL0_ThresholdAlarm = 45; // default value until the creation of AliACORDEThreshold class\r
210 Int_t AMU_ThresholdAlarm = 45; // default value until the creation of AliACORDEThreshold class\r
211\r
212 // SL0 - histograms\r
213\r
214 Int_t indexActiveModuleSL0 = 0;\r
215 for(Int_t iModule=0;iModule<60;iModule++){ \r
216 if (h0->GetBinContent(iModule)>0) indexActiveModuleSL0++;\r
217 }\r
92664bc8 218 \r
a6bcaa19 219 Float_t meanHitsSL0 = 0.;\r
220 if (indexActiveModuleSL0!=0) meanHitsSL0=h0->Integral()/indexActiveModuleSL0;\r
221\r
222 Int_t indexSL0 = 0;\r
92664bc8 223 \r
a6bcaa19 224 // set the threshold lines: minimum, maximum and mean\r
225\r
226 fhACOMean->SetX1(0);\r
227 fhACOMean->SetY1(meanHitsSL0);\r
228 fhACOMean->SetX2(59);\r
229 fhACOMean->SetY2(meanHitsSL0);\r
230 \r
231 fhACOMin->SetX1(0);\r
232 fhACOMin->SetX2(59);\r
233 fhACOMin->SetY1(meanHitsSL0-0.80*meanHitsSL0);\r
234 fhACOMin->SetY2(meanHitsSL0-0.80*meanHitsSL0);\r
235\r
236 fhACOMax->SetX1(0);\r
237 fhACOMax->SetX2(59);\r
238 fhACOMax->SetY1(meanHitsSL0+0.80*meanHitsSL0);\r
239 fhACOMax->SetY2(meanHitsSL0+0.80*meanHitsSL0);\r
240\r
241 fhACOMulti->SetX1(0);\r
242 fhACOMulti->SetY1(0);\r
243 fhACOMulti->SetX2(0);\r
244 Float_t maxMulti = 0;\r
245 if (h1->GetMaximum()>0) maxMulti = h1->GetMaximum();\r
246 fhACOMulti->SetY2(maxMulti);\r
247\r
248 TPaveText *acoBoxOkHitsSL0 = new TPaveText(35,meanHitsSL0+0.5*meanHitsSL0,55,maxPad,"b");\r
249 acoBoxOkHitsSL0->SetFillColor(kGreen);\r
250 acoBoxOkHitsSL0->SetLineColor(kGreen);\r
251 acoBoxOkHitsSL0->SetLineWidth(2);\r
252 acoBoxOkHitsSL0->AddText("ACO: O.K.");\r
253\r
254 TPaveText *acoBoxErrorHitsSL0 = new TPaveText(35,meanHitsSL0+0.5*meanHitsSL0,55,maxPad,"b");\r
255 acoBoxErrorHitsSL0->SetFillColor(kRed);\r
256 acoBoxErrorHitsSL0->SetLineColor(kRed);\r
257 acoBoxErrorHitsSL0->SetLineWidth(2);\r
258 acoBoxErrorHitsSL0->AddText("ACO: Not O.K.");\r
259\r
260 Float_t maxPadMulti = h1->GetMaximum();\r
261\r
262 TPaveText *acoBoxOkMultiSL0 = new TPaveText(35,maxPadMulti-0.3*maxPadMulti,55,maxPadMulti,"b");\r
263 acoBoxOkMultiSL0->SetFillColor(kGreen);\r
264 acoBoxOkMultiSL0->SetLineColor(kGreen);\r
265 acoBoxOkMultiSL0->SetLineWidth(2);\r
266 acoBoxOkMultiSL0->AddText("ACO: O.K.");\r
267\r
268 TPaveText *acoBoxErrorMultiSL0 = new TPaveText(35,maxPadMulti-0.3*maxPadMulti,55,maxPadMulti,"b");\r
269 acoBoxErrorMultiSL0->SetFillColor(kRed);\r
270 acoBoxErrorMultiSL0->SetLineColor(kRed);\r
271 acoBoxErrorMultiSL0->SetLineWidth(2);\r
272 acoBoxErrorMultiSL0->AddText("ACO: Not O.K.");\r
273 TH1* h4 = (TH1*)harr[4];\r
274\r
275 for (Int_t iModule = 0; iModule < 60; iModule++){\r
276 if (meanHitsSL0!=0){\r
277 if (TMath::Abs(h0->GetBinContent(iModule)/meanHitsSL0-1) < 1) indexSL0++;\r
278 if (h4){\r
279 h4->Fill(h0->GetBinContent(iModule)/meanHitsSL0-1);\r
280 }\r
281 }\r
282 }\r
283\r
284 if (indexSL0>=SL0_ThresholdAlarm){\r
285 h0->GetListOfFunctions()->Add(acoBoxOkHitsSL0);\r
286 h1->GetListOfFunctions()->Add(acoBoxOkMultiSL0);\r
92664bc8 287 }\r
a6bcaa19 288 else{\r
289 h0->GetListOfFunctions()->Add(acoBoxErrorHitsSL0);\r
290 h1->GetListOfFunctions()->Add(acoBoxErrorMultiSL0);\r
291 }\r
292\r
293\r
294 // AMU - histograms \r
295\r
296 Int_t indexActiveModuleAMU = 0;\r
297 for(Int_t iModule=0;iModule<60;iModule++){\r
298 if (h2->GetBinContent(iModule)>0) indexActiveModuleAMU++;\r
299 }\r
300\r
301 Float_t meanHitsAMU = 0.;\r
302 if (indexActiveModuleAMU!=0) meanHitsAMU=h2->Integral()/indexActiveModuleAMU;\r
303\r
304 // setting the line's thresholds: min, max and mean of hits\r
305\r
306 fhACOMeanAMU->SetX1(0);\r
307 fhACOMeanAMU->SetY1(meanHitsAMU);\r
308 fhACOMeanAMU->SetX2(59);\r
309 fhACOMeanAMU->SetY2(meanHitsAMU);\r
310\r
311 fhACOMinAMU->SetX1(0);\r
312 fhACOMinAMU->SetX2(59);\r
313 fhACOMinAMU->SetY1(meanHitsAMU-0.80*meanHitsAMU);\r
314 fhACOMinAMU->SetY2(meanHitsAMU-0.80*meanHitsAMU);\r
315\r
316\r
317 fhACOMaxAMU->SetX1(0);\r
318 fhACOMaxAMU->SetX2(59);\r
319 fhACOMaxAMU->SetY1(meanHitsAMU+0.80*meanHitsAMU);\r
320 fhACOMaxAMU->SetY2(meanHitsAMU+0.80*meanHitsAMU);\r
321\r
322\r
323 fhACOMultiAMU->SetX1(0);\r
324 fhACOMultiAMU->SetY1(0);\r
325 fhACOMultiAMU->SetX2(0);\r
326 Float_t maxMultiAMU = 0;\r
327 if (h3->GetMaximum()>0) maxMultiAMU = h3->GetMaximum();\r
328 fhACOMultiAMU->SetY2(maxMultiAMU);\r
92664bc8 329 \r
a6bcaa19 330 // setting the alarms\r
331\r
332 TPaveText *acoBoxOkHitsAMU = new TPaveText(35,meanHitsAMU+0.5*meanHitsAMU,55,maxPad,"b");\r
333 acoBoxOkHitsAMU->SetFillColor(kGreen);\r
334 acoBoxOkHitsAMU->SetLineColor(kGreen);\r
335 acoBoxOkHitsAMU->SetLineWidth(2);\r
336 acoBoxOkHitsAMU->AddText("ACO: O.K.");\r
337\r
338 TPaveText *acoBoxErrorHitsAMU = new TPaveText(35,meanHitsAMU+0.5*meanHitsAMU,55,maxPad,"b");\r
339 acoBoxErrorHitsAMU->SetFillColor(kRed);\r
340 acoBoxErrorHitsAMU->SetLineColor(kRed);\r
341 acoBoxErrorHitsAMU->SetLineWidth(2);\r
342 acoBoxErrorHitsAMU->AddText("ACO: Not O.K.");\r
343\r
344 Float_t maxPadMultiAMU = h3->GetMaximum();\r
345\r
346 TPaveText *acoBoxOkMultiAMU = new TPaveText(35,maxPadMultiAMU-0.3*maxPadMultiAMU,55,maxPadMultiAMU,"b");\r
347 acoBoxOkMultiAMU->SetFillColor(kGreen);\r
348 acoBoxOkMultiAMU->SetLineColor(kGreen);\r
349 acoBoxOkMultiAMU->SetLineWidth(2);\r
350 acoBoxOkMultiAMU->AddText("ACO: O.K.");\r
351\r
352 TPaveText *acoBoxErrorMultiAMU = new TPaveText(35,maxPadMultiAMU-0.3*maxPadMultiAMU,55,maxPadMultiAMU,"b");\r
353 acoBoxErrorMultiAMU->SetFillColor(kRed);\r
354 acoBoxErrorMultiAMU->SetLineColor(kRed);\r
355 acoBoxErrorMultiAMU->SetLineWidth(2);\r
356 acoBoxErrorMultiAMU->AddText("ACO: Not O.K.");\r
357 TH1* h5 = (TH1*)harr[5];\r
358\r
359 Int_t indexAMU=0;\r
360\r
361 for (Int_t iModule = 0; iModule < 60; iModule++){\r
362 if (meanHitsAMU!=0){\r
363 if (TMath::Abs(h2->GetBinContent(iModule)/meanHitsAMU-1) < 1) indexAMU++;\r
364 if (h5){\r
365 h5->Fill(h2->GetBinContent(iModule)/meanHitsAMU-1);\r
366 }\r
367 }\r
368 }\r
369\r
370 if (indexAMU>=AMU_ThresholdAlarm) {\r
371 h2->GetListOfFunctions()->Add(acoBoxOkHitsAMU);\r
372 h3->GetListOfFunctions()->Add(acoBoxOkMultiAMU);\r
92664bc8 373 }\r
a6bcaa19 374 else{\r
375 h2->GetListOfFunctions()->Add(acoBoxErrorHitsAMU);\r
376 h3->GetListOfFunctions()->Add(acoBoxErrorMultiAMU);\r
92664bc8 377 }\r
a6bcaa19 378 \r
92664bc8 379 } // end of trigger classes loop\r
380 } // end specie loop\r
381 // QA Checker standar (to be updated)\r
382 //\r
dc7f1e9e 383 AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;\r
384}\r
385\r
386//____________________________________________________________________________\r
387void AliACORDEQADataMakerRec::StartOfDetectorCycle()\r
388{\r
389 //Detector specific actions at start of cycle\r
390\r
391}\r
392 \r
393//____________________________________________________________________________ \r
394void AliACORDEQADataMakerRec::InitRaws()\r
395{\r
396 // create Raw histograms in Raw subdir\r
397\r
a6bcaa19 398 const Bool_t expert = kTRUE ; \r
399 const Bool_t saveCorr = kTRUE ; \r
400 const Bool_t image = kTRUE ; \r
401 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
402 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
403 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
404 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
405 TH1F * fhACORDEBitPatternCheckDQMSL0 = new TH1F("ACOHitsTriggerCheck_DQMExpertSL0","Check the activity of ACORDE's modules; |Hits per module/mean of Hits - 1|; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)\r
406 TH1F * fhACORDEBitPatternCheckDQMAMU = new TH1F("ACOHitsTriggerCheck_DQMExpertAMU","Check the activity of ACORDE's modules; |Hits per module/mean of Hits - 1|; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)\r
92664bc8 407 // Expert histograms\r
92664bc8 408 // Check the hits multiplicity from trigger configuration\r
a6bcaa19 409 Add2RawsList(fhACORDEBitPatternCheckDQMSL0,4,expert,image,!saveCorr);\r
410 fhACORDEBitPatternCheckDQMSL0->SetFillColor(kOrange);\r
411 Add2RawsList(fhACORDEBitPatternCheckDQMAMU,5,expert,image,!saveCorr);\r
412 fhACORDEBitPatternCheckDQMAMU->SetFillColor(kRed+2);\r
413\r
414 \r
415 // AMORE diplay settings for shifter on GUI\r
92664bc8 416 \r
a6bcaa19 417 // For SL0 ACO trigger mode\r
92664bc8 418 \r
419 Add2RawsList(fhACORDEBitPatternDQM,0,!expert,image,!saveCorr);\r
420 ForbidCloning(fhACORDEBitPatternDQM);\r
421 Add2RawsList(fhACORDEMultiplicitySL0DQM,1,!expert,image,!saveCorr);\r
422 ForbidCloning(fhACORDEMultiplicitySL0DQM);\r
a6bcaa19 423\r
92664bc8 424 // For Hits distribution on ACORDE\r
425 \r
a6bcaa19 426 fhACORDEBitPatternDQM->SetFillColor(kMagenta+2);\r
92664bc8 427 fhACOMean->SetLineColor(kBlue);\r
428 fhACOMean->SetLineStyle(2);\r
429 fhACOMean->SetLineWidth(4);\r
430 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMean);\r
431 fhACOMin->SetLineColor(kGreen);\r
432 fhACOMin->SetLineStyle(2);\r
433 fhACOMin->SetLineWidth(4);\r
434 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMin);\r
435 fhACOMax->SetLineColor(kGreen);\r
436 fhACOMax->SetLineStyle(2);\r
437 fhACOMax->SetLineWidth(4);\r
438 fhACORDEBitPatternDQM->GetListOfFunctions()->Add(fhACOMax);\r
439 \r
440 // For ACORDE Multiplicity distribution of fired modules\r
441 \r
a6bcaa19 442 fhACORDEMultiplicitySL0DQM->SetFillColor(kMagenta);\r
92664bc8 443 fhACOMulti->SetLineColor(kMagenta);\r
444 fhACOMulti->SetLineStyle(2);\r
445 fhACOMulti->SetLineWidth(4);\r
446 fhACORDEMultiplicitySL0DQM->GetListOfFunctions()->Add(fhACOMulti);\r
447 \r
448 // For AMU ACO trigger mode\r
449 \r
450 Add2RawsList(fhACORDEBitPatternAMUDQM,2,!expert,image,!saveCorr);\r
451 Add2RawsList(fhACORDEMultiplicityAMUDQM,3,!expert,image,!saveCorr);\r
452 \r
453 // For Hits distribution on ACORDE\r
454 \r
a6bcaa19 455 fhACORDEBitPatternAMUDQM->SetFillColor(kViolet+7);\r
92664bc8 456 fhACOMeanAMU->SetLineColor(kBlue);\r
457 fhACOMeanAMU->SetLineStyle(2);\r
458 fhACOMeanAMU->SetLineWidth(4);\r
459 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMeanAMU);\r
460 fhACOMinAMU->SetLineColor(kGreen);\r
461 fhACOMinAMU->SetLineStyle(2);\r
462 fhACOMinAMU->SetLineWidth(4);\r
463 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMinAMU);\r
464 fhACOMaxAMU->SetLineColor(kGreen);\r
465 fhACOMaxAMU->SetLineStyle(2);\r
466 fhACOMaxAMU->SetLineWidth(4);\r
467 fhACORDEBitPatternAMUDQM->GetListOfFunctions()->Add(fhACOMaxAMU);\r
468 \r
469 // For ACORDE Multiplicity distribution of fired modules\r
470 \r
a6bcaa19 471 fhACORDEMultiplicityAMUDQM->SetFillColor(kViolet+6);\r
472 fhACOMultiAMU->SetLineColor(kAzure-2);\r
92664bc8 473 fhACOMultiAMU->SetLineStyle(2);\r
474 fhACOMultiAMU->SetLineWidth(4);\r
475 fhACORDEMultiplicityAMUDQM->GetListOfFunctions()->Add(fhACOMultiAMU);\r
476 \r
92664bc8 477 //\r
478 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line\r
dc7f1e9e 479}\r
92664bc8 480\r
dc7f1e9e 481//____________________________________________________________________________ \r
482void AliACORDEQADataMakerRec::InitDigits()\r
483{\r
484 // create Digits histograms in Digits subdir\r
485 \r
486 const Bool_t expert = kTRUE ; \r
487 const Bool_t image = kTRUE ; \r
488 TH1F * fhDigitsModule;\r
41d0241f 489 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 490 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
491 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
492 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
493 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
494 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
495\r
496\r
497 fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE from DIGITS;Modules;Counts",60,1,60);\r
498 Add2DigitsList(fhDigitsModule,0,!expert,image);\r
499 for (Int_t i=0;i<60;i++) fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]); \r
92664bc8 500 //\r
3542faa1 501 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line\r
dc7f1e9e 502}\r
503\r
504//____________________________________________________________________________ \r
505\r
506void AliACORDEQADataMakerRec::InitRecPoints()\r
507{\r
508 // create cluster histograms in RecPoint subdir\r
509 // Not needed for ACORDE by now !!!\r
92664bc8 510 //\r
511 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line\r
dc7f1e9e 512}\r
513\r
514//____________________________________________________________________________\r
515void AliACORDEQADataMakerRec::InitESDs()\r
516{\r
517 //create ESDs histograms in ESDs subdir\r
518\r
519 const Bool_t expert = kTRUE ; \r
520 const Bool_t image = kTRUE ; \r
521 \r
522 TH1F * fhESDsSingle;\r
523 TH1F * fhESDsMulti;\r
1b368017 524 TH1F * fhESDsMultiplicity;\r
41d0241f 525 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 526 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
527 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
528 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
529 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
530 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
531\r
532\r
533 fhESDsSingle = new TH1F("ACORDEBitPatternfromESDsSingle","Distribution of ACORDE fired modules from ESDs-Single;Modules;Counts",60,1,60);\r
534 Add2ESDsList(fhESDsSingle,0,!expert,image);\r
535\r
536 fhESDsMulti = new TH1F("ACORDEBitPatternfromESDsMulti","Distribution of ACORDE fired modules from ESDs-Multi;Modules;Counts",60,1,60);\r
537 Add2ESDsList(fhESDsMulti,1,!expert,image);\r
1b368017 538 \r
539 fhESDsMultiplicity = new TH1F("ACORDEMultiplicityfromESD","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);\r
540 Add2ESDsList(fhESDsMultiplicity,2,!expert,image); \r
dc7f1e9e 541 for (Int_t i=0;i<60;i++)\r
542 {\r
543 fhESDsSingle->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
544 fhESDsMulti->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
545 }\r
92664bc8 546 //\r
547 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line\r
dc7f1e9e 548}\r
549//____________________________________________________________________________\r
550void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)\r
551{\r
552 //fills QA histos for RAW\r
92664bc8 553 IncEvCountCycleRaws();\r
554 IncEvCountTotalRaws();\r
dc7f1e9e 555 rawReader->Reset();\r
556 AliACORDERawStream rawStream(rawReader);\r
557 size_t contSingle=0;\r
558 size_t contMulti=0;\r
559 UInt_t dy[4];\r
560\r
561 bool kroSingle[60],kroMulti[60];\r
562 UInt_t tmpDy;\r
563\r
564 for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}\r
565\r
566if(rawStream.Next())\r
567{\r
568 dy[0]=rawStream.GetWord(0);\r
569 dy[1]=rawStream.GetWord(1);\r
570 dy[2]=rawStream.GetWord(2);\r
571 dy[3]=rawStream.GetWord(3);\r
572 tmpDy=dy[0];\r
10f9e41a 573 for(Int_t r=0;r<30;r++)\r
dc7f1e9e 574 {\r
575 kroSingle[r] = tmpDy & 1;\r
576 tmpDy>>=1;\r
577 }\r
578 tmpDy=dy[1];\r
10f9e41a 579 for(Int_t r=30;r<60;r++)\r
dc7f1e9e 580 {\r
581 kroSingle[r] = tmpDy & 1;\r
582 tmpDy>>=1;\r
583 }\r
584 tmpDy=dy[2];\r
10f9e41a 585 for(Int_t r=0;r<30;r++)\r
dc7f1e9e 586 {\r
587 kroMulti[r] = tmpDy & 1;\r
588 tmpDy>>=1;\r
589 }\r
590 tmpDy=dy[3];\r
10f9e41a 591 for(Int_t r=30;r<60;r++)\r
dc7f1e9e 592 {\r
593 kroMulti[r] = tmpDy & 1;\r
594 tmpDy>>=1;\r
595 }\r
596 contSingle=0;\r
92664bc8 597 contMulti=0;\r
10f9e41a 598 for(Int_t r=0;r<60;r++)\r
dc7f1e9e 599 {\r
92664bc8 600 if(kroSingle[r]==1)\r
601 {\r
602 FillRawsData(0,r);\r
603 //FillRawsData(4,r);\r
604 contSingle++;\r
605 }\r
1b368017 606 if(kroMulti[r]==1)\r
607 {\r
92664bc8 608 FillRawsData(2,r);\r
609 //FillRawsData(6,r);\r
610 contMulti++;\r
1b368017 611 }\r
92664bc8 612 \r
613 } \r
47f5f498 614 FillRawsData(1,contSingle); \r
615 FillRawsData(3,contMulti); \r
9f9f68fb 616 // FillRawsData(7,contMulti);\r
dc7f1e9e 617}\r
618}\r
619//____________________________________________________________________________\r
620void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)\r
621{\r
622 //fills QA histos for Digits\r
3542faa1 623 IncEvCountCycleDigits();\r
624 IncEvCountTotalDigits();\r
92664bc8 625\r
dc7f1e9e 626 if (fDigitsArray) \r
627 fDigitsArray->Clear() ; \r
628 else \r
629 fDigitsArray = new TClonesArray("AliACORDEdigit",1000);\r
630 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");\r
631 if (!branch) {\r
632 AliWarning("ACORDE branch in Digits Tree not found");\r
633 } else {\r
634 branch->SetAddress(&fDigitsArray);\r
635 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {\r
636 branch->GetEntry(track);\r
637 for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {\r
638 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);\r
639 if (!AcoDigit) {\r
640 AliError("The unchecked digit doesn't exist");\r
641 continue ;\r
642 }\r
92664bc8 643 FillDigitsData(0,AcoDigit->GetModule()-1);\r
dc7f1e9e 644 }\r
645 }\r
646 }\r
647}\r
648\r
649//____________________________________________________________________________\r
650void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)\r
651{\r
652 //fills QA histos for ESD\r
92664bc8 653 IncEvCountCycleESDs();\r
654 IncEvCountTotalESDs();\r
655 //\r
dc7f1e9e 656 AliESDACORDE * fESDACORDE= esd->GetACORDEData();\r
1b368017 657 Int_t acoMulti=0;\r
dc7f1e9e 658 for(int i=0;i<60;i++)\r
659 {\r
92664bc8 660 if(fESDACORDE->GetHitChannel(i)) \r
661 {\r
662 FillESDsData(0,i+1);\r
663 FillESDsData(1,i+1);\r
664 acoMulti++;\r
dc7f1e9e 665 }\r
92664bc8 666 } FillESDsData(2,acoMulti);\r
dc7f1e9e 667\r
668}\r