]>
Commit | Line | Data |
---|---|---|
10bb1a34 | 1 | /////////////////////////////////////////////////////////////////////// |
2 | // Author: Henrik Tydesjo // | |
3 | // For easier handling of error messages from AliITSRawStreamSPD. // | |
4 | // The purpose of this class is to make possible the switch to the // | |
5 | // AliRoot raw data parsing routines in the onlinte monitoring // | |
6 | // programs, like SPD-MOOD, and still keep all the old functionality.// | |
7 | /////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #include "AliITSRawStreamSPDErrorLog.h" | |
10 | #include "AliLog.h" | |
11 | ||
54a5b3aa | 12 | /* $Id$ */ |
13 | ||
10bb1a34 | 14 | ClassImp(AliITSRawStreamSPDErrorLog) |
15 | //________________________________________________________________________________________________ | |
16 | AliITSRawStreamSPDErrorLog::AliITSRawStreamSPDErrorLog() : | |
17 | fText(NULL), fTextTmpGeneral(NULL) | |
18 | { | |
19 | // default constructor | |
20 | fText=new TGText(); | |
21 | fTextTmpGeneral=new TGText(); | |
22 | for (UInt_t eq=0; eq<20; eq++) { | |
23 | fTextTmp[eq] = new TGText(); | |
24 | fNEvents[eq] = 0; | |
10bb1a34 | 25 | fByteOffset[eq] = 0; |
26 | fSuppressEq[eq] = kFALSE; | |
27 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
28 | fNErrors[err][eq] = 0; | |
b457135f | 29 | fNErrorsTotal[err][eq] = 0; |
10bb1a34 | 30 | } |
31 | } | |
32 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
33 | fSuppressMess[err] = kFALSE; | |
34 | } | |
35 | InitHistograms(); | |
36 | } | |
37 | //________________________________________________________________________________________________ | |
38 | AliITSRawStreamSPDErrorLog::AliITSRawStreamSPDErrorLog(const AliITSRawStreamSPDErrorLog& logger) : | |
39 | TObject(logger), fText(NULL), fTextTmpGeneral(NULL) | |
40 | { | |
41 | // copy constructor | |
42 | for (UInt_t eq=0; eq<20; eq++) { | |
43 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
44 | fNErrors[err][eq] = logger.fNErrors[err][eq]; | |
b457135f | 45 | fNErrorsTotal[err][eq] = logger.fNErrorsTotal[err][eq]; |
10bb1a34 | 46 | fErrEventCounter[err][eq] = logger.fErrEventCounter[err][eq]; |
47 | } | |
48 | fNEvents[eq] = logger.fNEvents[eq]; | |
10bb1a34 | 49 | fByteOffset[eq] = logger.fByteOffset[eq]; |
50 | fSuppressEq[eq] = logger.fSuppressEq[eq]; | |
51 | } | |
52 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
53 | fSuppressMess[err] = logger.fSuppressMess[err]; | |
54 | } | |
55 | ||
56 | fText = new TGText(logger.fText); | |
57 | fTextTmpGeneral = new TGText(logger.fTextTmpGeneral); | |
58 | for (UInt_t eq=0; eq<20; eq++) { | |
59 | fTextTmp[eq] = new TGText(logger.fTextTmp[eq]); | |
60 | } | |
61 | ||
62 | for (UInt_t eq=0; eq<20; eq++) { | |
63 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
64 | fConsErrEvent[err][eq] = new TGraph(*logger.fConsErrEvent[err][eq]); | |
478d804c | 65 | fConsErrPos[err][eq] = new TGraph(*logger.fConsErrPos[err][eq]); |
10bb1a34 | 66 | } |
67 | fConsErrType[eq] = new TH1F(*logger.fConsErrType[eq]); | |
c4113cbf | 68 | fConsErrType[eq]->SetDirectory(0); |
10bb1a34 | 69 | fConsErrFraction[eq] = new TH1F(*logger.fConsErrFraction[eq]); |
c4113cbf | 70 | fConsErrFraction[eq]->SetDirectory(0); |
10bb1a34 | 71 | } |
72 | ||
73 | } | |
74 | //________________________________________________________________________________________________ | |
75 | AliITSRawStreamSPDErrorLog& AliITSRawStreamSPDErrorLog::operator=(const AliITSRawStreamSPDErrorLog& logger) { | |
76 | // assignment operator | |
77 | if (this!=&logger) { | |
78 | delete fText; | |
79 | delete fTextTmpGeneral; | |
71abf6b7 | 80 | for(Int_t eq=0; eq<20;eq++){ |
81 | delete fTextTmp[eq]; | |
82 | } | |
10bb1a34 | 83 | this->DeleteHistograms(); |
84 | ||
85 | for (UInt_t eq=0; eq<20; eq++) { | |
86 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
87 | fNErrors[err][eq] = logger.fNErrors[err][eq]; | |
b457135f | 88 | fNErrorsTotal[err][eq] = logger.fNErrorsTotal[err][eq]; |
10bb1a34 | 89 | fErrEventCounter[err][eq] = logger.fErrEventCounter[err][eq]; |
90 | } | |
91 | fNEvents[eq] = logger.fNEvents[eq]; | |
10bb1a34 | 92 | fByteOffset[eq] = logger.fByteOffset[eq]; |
93 | fSuppressEq[eq] = logger.fSuppressEq[eq]; | |
94 | } | |
95 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
96 | fSuppressMess[err] = logger.fSuppressMess[err]; | |
97 | } | |
98 | ||
99 | fText = new TGText(logger.fText); | |
100 | fTextTmpGeneral = new TGText(logger.fTextTmpGeneral); | |
101 | for (UInt_t eq=0; eq<20; eq++) { | |
102 | fTextTmp[eq] = new TGText(logger.fTextTmp[eq]); | |
103 | } | |
104 | ||
105 | for (UInt_t eq=0; eq<20; eq++) { | |
106 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
107 | fConsErrEvent[err][eq] = new TGraph(*logger.fConsErrEvent[err][eq]); | |
478d804c | 108 | fConsErrPos[err][eq] = new TGraph(*logger.fConsErrPos[err][eq]); |
10bb1a34 | 109 | } |
110 | fConsErrType[eq] = new TH1F(*logger.fConsErrType[eq]); | |
c4113cbf | 111 | fConsErrType[eq]->SetDirectory(0); |
10bb1a34 | 112 | fConsErrFraction[eq] = new TH1F(*logger.fConsErrFraction[eq]); |
c4113cbf | 113 | fConsErrFraction[eq]->SetDirectory(0); |
10bb1a34 | 114 | } |
115 | ||
116 | } | |
117 | return *this; | |
118 | ||
119 | } | |
120 | //________________________________________________________________________________________________ | |
121 | AliITSRawStreamSPDErrorLog::~AliITSRawStreamSPDErrorLog() { | |
122 | // destructor | |
123 | DeleteHistograms(); | |
124 | delete fText; | |
125 | delete fTextTmpGeneral; | |
71abf6b7 | 126 | for(Int_t eq=0; eq<20; eq++){ |
127 | delete fTextTmp[eq]; | |
128 | } | |
10bb1a34 | 129 | } |
130 | //________________________________________________________________________________________________ | |
131 | void AliITSRawStreamSPDErrorLog::InitHistograms() { | |
132 | // initialize histograms | |
133 | for (UInt_t eq=0; eq<20; eq++) { | |
134 | TString histName, histTitle; | |
135 | histName = Form("ConsErrType %d",eq); | |
136 | histTitle = Form("Distribution of errors, eq %d",eq); | |
137 | fConsErrType[eq]=new TH1F(histName.Data(),histTitle.Data(),kNrErrorCodes,-0.5,kNrErrorCodes-0.5); | |
c4113cbf | 138 | fConsErrType[eq]->SetDirectory(0); |
10bb1a34 | 139 | fConsErrType[eq]->SetXTitle("Error Code"); |
140 | fConsErrType[eq]->SetYTitle("Nr Errors"); | |
141 | ||
142 | histName = Form("ConsErrFraction %d",eq); | |
143 | histTitle = Form("Fraction of events with errors, eq %d",eq); | |
144 | fConsErrFraction[eq]=new TH1F(histName.Data(),histTitle.Data(),kNrErrorCodes,-0.5,kNrErrorCodes-0.5); | |
c4113cbf | 145 | fConsErrFraction[eq]->SetDirectory(0); |
10bb1a34 | 146 | fConsErrFraction[eq]->SetXTitle("Error Code"); |
147 | fConsErrFraction[eq]->SetYTitle("Fraction"); | |
148 | ||
149 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
150 | fConsErrEvent[err][eq]=new TGraph(); | |
478d804c | 151 | fConsErrPos[err][eq]=new TGraph(); |
152 | fConsErrPosTMP[err][eq]=new TGraph(); | |
10bb1a34 | 153 | fErrEventCounter[err][eq] = 0; |
478d804c | 154 | fErrPosCounter[err][eq] = 0; |
155 | fErrPosTMPCounter[err][eq] = 0; | |
10bb1a34 | 156 | } |
157 | } | |
158 | } | |
159 | //________________________________________________________________________________________________ | |
71abf6b7 | 160 | void AliITSRawStreamSPDErrorLog::DeleteHistograms() { |
10bb1a34 | 161 | // delete histograms |
162 | for (UInt_t eq=0; eq<20; eq++) { | |
163 | delete fConsErrType[eq]; | |
164 | delete fConsErrFraction[eq]; | |
165 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
166 | delete fConsErrEvent[err][eq]; | |
167 | delete fConsErrPos[err][eq]; | |
478d804c | 168 | delete fConsErrPosTMP[err][eq]; |
10bb1a34 | 169 | } |
170 | } | |
171 | } | |
172 | //________________________________________________________________________________________________ | |
173 | void AliITSRawStreamSPDErrorLog::Reset() { | |
174 | // Reset | |
175 | fText->Clear(); | |
b457135f | 176 | fTextTmpGeneral->Clear(); |
10bb1a34 | 177 | for (UInt_t eq=0; eq<20; eq++) { |
178 | fTextTmp[eq]->Clear(); | |
179 | fConsErrType[eq]->Reset(); | |
180 | fConsErrFraction[eq]->Reset(); | |
181 | fNEvents[eq] = 0; | |
10bb1a34 | 182 | for (UInt_t err=0; err<kNrErrorCodes; err++) { |
183 | fNErrors[err][eq] = 0; | |
b457135f | 184 | fNErrorsTotal[err][eq] = 0; |
10bb1a34 | 185 | delete fConsErrEvent[err][eq]; |
478d804c | 186 | delete fConsErrPos[err][eq]; |
187 | delete fConsErrPosTMP[err][eq]; | |
10bb1a34 | 188 | fErrEventCounter[err][eq] = 0; |
478d804c | 189 | fErrPosCounter[err][eq] = 0; |
190 | fErrPosTMPCounter[err][eq] = 0; | |
10bb1a34 | 191 | fConsErrEvent[err][eq] = new TGraph(); |
478d804c | 192 | fConsErrPos[err][eq] = new TGraph(); |
193 | fConsErrPosTMP[err][eq] = new TGraph(); | |
10bb1a34 | 194 | } |
195 | } | |
196 | } | |
197 | //________________________________________________________________________________________________ | |
198 | void AliITSRawStreamSPDErrorLog::ProcessError(UInt_t errorCode, UInt_t eq, Int_t bytesRead, Int_t headersRead, const Char_t *errMess) { | |
199 | // Process an error | |
200 | if (eq>=20) { | |
201 | AliWarning(Form("Equipment number (%d) out of bounds",eq)); | |
202 | return; | |
203 | } | |
204 | // check if we want to exclude the error... | |
205 | if (!(fSuppressMess[errorCode] || fSuppressEq[eq])) { | |
206 | fNErrors[errorCode][eq]++; | |
b457135f | 207 | fNErrorsTotal[errorCode][eq]++; |
208 | if (errorCode!=kTotal) { | |
209 | fNErrors[kTotal][eq]++; | |
210 | fNErrorsTotal[kTotal][eq]++; | |
211 | } | |
10bb1a34 | 212 | |
478d804c | 213 | if (bytesRead>=0) { |
214 | fConsErrPosTMP[errorCode][eq]->SetPoint(fErrPosTMPCounter[errorCode][eq],0,bytesRead+fByteOffset[eq]); | |
215 | fErrPosTMPCounter[errorCode][eq]++; | |
216 | if (errorCode!=kTotal) { | |
217 | fConsErrPosTMP[kTotal][eq]->SetPoint(fErrPosTMPCounter[kTotal][eq],0,bytesRead+fByteOffset[eq]); | |
218 | fErrPosTMPCounter[kTotal][eq]++; | |
219 | } | |
10bb1a34 | 220 | } |
221 | ||
222 | TString msg; | |
223 | if (bytesRead<0) { | |
224 | msg = Form("%s",errMess); | |
225 | } | |
226 | else { | |
227 | msg = Form("%s (%d bytes read, %d chip headers read)",errMess,bytesRead+fByteOffset[eq],headersRead); | |
228 | } | |
229 | fTextTmp[eq]->InsLine(fTextTmp[eq]->RowCount(),msg.Data()); | |
230 | } | |
231 | } | |
232 | //________________________________________________________________________________________________ | |
233 | void AliITSRawStreamSPDErrorLog::AddMessage(const Char_t *errMess) { | |
234 | // add a general message to the buffer | |
235 | fTextTmpGeneral->InsLine(fTextTmpGeneral->RowCount(),errMess); | |
236 | } | |
237 | //________________________________________________________________________________________________ | |
b457135f | 238 | void AliITSRawStreamSPDErrorLog::ResetEvent() { |
239 | // reset error counters for current event | |
240 | for (UInt_t eq=0; eq<20; eq++) { | |
241 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
242 | fNErrors[err][eq]=0; | |
243 | } | |
244 | fByteOffset[eq]=0; | |
245 | fTextTmpGeneral->Clear(); | |
246 | fTextTmp[eq]->Clear(); | |
247 | } | |
248 | ||
249 | for (UInt_t eq=0; eq<20; eq++) { | |
250 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
251 | delete fConsErrPosTMP[err][eq]; | |
252 | fErrPosTMPCounter[err][eq] = 0; | |
253 | fConsErrPosTMP[err][eq] = new TGraph(); | |
254 | } | |
255 | } | |
256 | } | |
257 | //________________________________________________________________________________________________ | |
258 | void AliITSRawStreamSPDErrorLog::AddErrorMessagesFromCurrentEvent(UInt_t eventNum) { | |
10bb1a34 | 259 | TString msg; |
260 | if (fText->RowCount()>5000) { | |
261 | fText->Clear(); | |
262 | msg = "*** previous errors cleared ***"; | |
263 | fText->InsLine(fText->RowCount(),msg.Data()); | |
264 | } | |
265 | if (fTextTmpGeneral->RowCount()>1) { | |
266 | msg = Form("*** Event %d , General Errors: ***",eventNum); | |
267 | fText->InsLine(fText->RowCount(),msg.Data()); | |
268 | fText->AddText(fTextTmpGeneral); | |
b457135f | 269 | // fTextTmpGeneral->Clear(); |
270 | } | |
271 | ||
272 | for (UInt_t eq=0; eq<20; eq++) { | |
273 | if (fNErrors[kTotal][eq]>0) { | |
274 | msg = Form("*** Event %d , Eq %d: ***",eventNum,eq); | |
275 | fText->InsLine(fText->RowCount(),msg.Data()); | |
276 | fText->AddText(fTextTmp[eq]); | |
277 | fText->InsLine(fText->RowCount()," "); | |
278 | } | |
279 | // fTextTmp[eq]->Clear(); | |
10bb1a34 | 280 | } |
b457135f | 281 | } |
282 | //________________________________________________________________________________________________ | |
283 | void AliITSRawStreamSPDErrorLog::ProcessEvent(UInt_t eventNum) { | |
284 | // summarize the information for the current event | |
285 | // TString msg; | |
286 | // if (fText->RowCount()>5000) { | |
287 | // fText->Clear(); | |
288 | // msg = "*** previous errors cleared ***"; | |
289 | // fText->InsLine(fText->RowCount(),msg.Data()); | |
290 | // } | |
291 | // if (fTextTmpGeneral->RowCount()>1) { | |
292 | // msg = Form("*** Event %d , General Errors: ***",eventNum); | |
293 | // fText->InsLine(fText->RowCount(),msg.Data()); | |
294 | // fText->AddText(fTextTmpGeneral); | |
295 | // fTextTmpGeneral->Clear(); | |
296 | // } | |
297 | ||
298 | AddErrorMessagesFromCurrentEvent(eventNum); | |
299 | ||
10bb1a34 | 300 | for (UInt_t eq=0; eq<20; eq++) { |
301 | for (UInt_t err=0; err<kNrErrorCodes; err++) { | |
302 | fConsErrType[eq]->Fill(err,fNErrors[err][eq]); | |
b457135f | 303 | if (fNErrors[err][eq]>0) { |
10bb1a34 | 304 | fConsErrEvent[err][eq]->SetPoint(fErrEventCounter[err][eq],eventNum,fNErrors[err][eq]); |
305 | fErrEventCounter[err][eq]++; | |
306 | fConsErrFraction[eq]->Fill(err); | |
307 | } | |
478d804c | 308 | for (UInt_t pind=0; pind<fErrPosTMPCounter[err][eq]; pind++) { |
309 | Double_t x,y; | |
310 | fConsErrPosTMP[err][eq]->GetPoint(pind,x,y); | |
311 | fConsErrPos[err][eq]->SetPoint(fErrPosCounter[err][eq],eventNum,y); | |
312 | fErrPosCounter[err][eq]++; | |
313 | } | |
10bb1a34 | 314 | } |
478d804c | 315 | |
10bb1a34 | 316 | fNEvents[eq]++; |
b457135f | 317 | // if (fNErrors[kTotal][eq]>0) { |
318 | // msg = Form("*** Event %d , Eq %d: ***",eventNum,eq); | |
319 | // fText->InsLine(fText->RowCount(),msg.Data()); | |
320 | // fText->AddText(fTextTmp[eq]); | |
321 | // fText->InsLine(fText->RowCount()," "); | |
322 | // } | |
323 | // fByteOffset[eq]=0; | |
324 | // fTextTmp[eq]->Clear(); | |
10bb1a34 | 325 | } |
478d804c | 326 | |
b457135f | 327 | } |
328 | //________________________________________________________________________________________________ | |
329 | void AliITSRawStreamSPDErrorLog::SummarizeEvent(UInt_t eventNum) { | |
330 | // summarize the information for the current event | |
b457135f | 331 | ProcessEvent(eventNum); |
332 | ResetEvent(); | |
10bb1a34 | 333 | } |
334 | //________________________________________________________________________________________________ | |
335 | void AliITSRawStreamSPDErrorLog::SetByteOffset(UInt_t eq, Int_t size) { | |
336 | // set byte offset (equipment header size) | |
337 | if (eq<20) { | |
338 | fByteOffset[eq]=size; | |
339 | } | |
340 | else { | |
341 | AliWarning(Form("Equipment number (%d) out of range",eq)); | |
342 | } | |
343 | } | |
344 | //________________________________________________________________________________________________ | |
345 | void AliITSRawStreamSPDErrorLog::SuppressErrorMessages(UInt_t errorCode, Bool_t suppr) { | |
346 | // suppress error messages for specific error code | |
347 | if (errorCode<kNrErrorCodes) { | |
348 | fSuppressMess[errorCode] = suppr; | |
349 | } | |
350 | else { | |
351 | AliWarning(Form("Error code (%d) out of range",errorCode)); | |
352 | } | |
353 | } | |
354 | //________________________________________________________________________________________________ | |
355 | void AliITSRawStreamSPDErrorLog::SuppressErrorEq(UInt_t eq, Bool_t suppr) { | |
356 | // suppress error messages for specific equipment | |
357 | if (eq<20) { | |
358 | fSuppressEq[eq] = suppr; | |
359 | } | |
360 | else { | |
361 | AliWarning(Form("Eq id (%d) out of range",eq)); | |
362 | } | |
363 | } | |
364 | //________________________________________________________________________________________________ | |
365 | UInt_t AliITSRawStreamSPDErrorLog::GetNrErrors(UInt_t errorCode, UInt_t eq) { | |
366 | // returns the number of errors for this event for a specific error code and equipment | |
367 | if (errorCode<kNrErrorCodes && eq<20) return fNErrors[errorCode][eq]; | |
368 | else { | |
369 | AliWarning(Form("Error code (%d) or equipment (%d) out of range, returning 0",errorCode,eq)); | |
370 | return 0; | |
371 | } | |
372 | } | |
373 | //________________________________________________________________________________________________ | |
374 | UInt_t AliITSRawStreamSPDErrorLog::GetNrErrorsAllEq(UInt_t errorCode) { | |
375 | // returns the number of errors for this event for a specific error code and all equipments | |
376 | if (errorCode<kNrErrorCodes) { | |
377 | UInt_t returnval=0; | |
378 | for (UInt_t eq=0; eq<20; eq++) { | |
379 | returnval += fNErrors[errorCode][eq]; | |
380 | } | |
381 | return returnval; | |
382 | } | |
383 | else { | |
384 | AliWarning(Form("Error code (%d) out of range, returning 0",errorCode)); | |
385 | return 0; | |
386 | } | |
387 | } | |
388 | //________________________________________________________________________________________________ | |
389 | UInt_t AliITSRawStreamSPDErrorLog::GetNrErrorsTotal(UInt_t errorCode, UInt_t eq) { | |
390 | // returns the total number of errors for a specific error code and equipment | |
391 | if (errorCode<kNrErrorCodes && eq<20) { | |
b457135f | 392 | return fNErrorsTotal[errorCode][eq]; |
393 | // return (UInt_t) fConsErrType[eq]->GetBinContent(errorCode+1); | |
10bb1a34 | 394 | } |
395 | else { | |
396 | AliWarning(Form("Error code (%d) or equipment (%d) out of range, returning 0",errorCode,eq)); | |
397 | return 0; | |
398 | } | |
399 | } | |
400 | //________________________________________________________________________________________________ | |
401 | UInt_t AliITSRawStreamSPDErrorLog::GetNrErrorsTotalAllEq(UInt_t errorCode) { | |
b457135f | 402 | // returns the total number of errors for a specific error code and for all equipments |
10bb1a34 | 403 | if (errorCode<kNrErrorCodes) { |
404 | UInt_t returnval=0; | |
405 | for (UInt_t eq=0; eq<20; eq++) { | |
b457135f | 406 | returnval += fNErrorsTotal[errorCode][eq]; |
407 | // returnval += (UInt_t) fConsErrType[eq]->GetBinContent(errorCode+1); | |
10bb1a34 | 408 | } |
409 | return returnval; | |
410 | } | |
411 | else { | |
412 | AliWarning(Form("Error code (%d) out of range, returning 0",errorCode)); | |
413 | return 0; | |
414 | } | |
415 | } | |
416 | //________________________________________________________________________________________________ | |
417 | TGraph* AliITSRawStreamSPDErrorLog::GetConsErrEvent(UInt_t errorCode, UInt_t eq) { | |
418 | // returns a pointer to the graph | |
419 | if (errorCode<kNrErrorCodes && eq<20) return fConsErrEvent[errorCode][eq]; | |
420 | else { | |
421 | AliWarning(Form("Error code (%d) or equipment (%d) out of range, returning NULL",errorCode,eq)); | |
422 | return NULL; | |
423 | } | |
424 | } | |
425 | //________________________________________________________________________________________________ | |
426 | TH1F* AliITSRawStreamSPDErrorLog::GetConsErrType(UInt_t eq) { | |
427 | // returns a pointer to the histogram | |
428 | if (eq<20) return fConsErrType[eq]; | |
429 | else { | |
430 | AliWarning(Form("Eq nr (%d) out of bounds",eq)); | |
431 | return NULL; | |
432 | } | |
433 | } | |
434 | //________________________________________________________________________________________________ | |
435 | TH1F* AliITSRawStreamSPDErrorLog::GetConsErrFraction(UInt_t eq) { | |
436 | // creates a new histogram and returns a pointer to it. | |
437 | // NB!!! Take care of deleting this object later | |
438 | if (eq<20) { | |
439 | TH1F* returnhisto = (TH1F*)(fConsErrFraction[eq]->Clone()); | |
440 | if (fNEvents[eq]!=0) returnhisto->Scale(1./fNEvents[eq]); | |
441 | // returnhisto->SetMaximum(1.); | |
442 | return returnhisto; | |
443 | } | |
444 | else { | |
445 | AliWarning(Form("Eq nr (%d) out of bounds",eq)); | |
446 | return NULL; | |
447 | } | |
448 | } | |
449 | //________________________________________________________________________________________________ | |
54a5b3aa | 450 | TH1F* AliITSRawStreamSPDErrorLog::GetConsErrFractionUnScaled(UInt_t eq) { |
451 | // returns a pointer to the histogram | |
452 | if (eq<20) return fConsErrFraction[eq]; | |
453 | else { | |
454 | AliWarning(Form("Eq nr (%d) out of bounds",eq)); | |
455 | return NULL; | |
456 | } | |
457 | } | |
458 | //________________________________________________________________________________________________ | |
478d804c | 459 | TGraph* AliITSRawStreamSPDErrorLog::GetConsErrPos(UInt_t errorCode, UInt_t eq) { |
10bb1a34 | 460 | // returns a pointer to the histogram |
461 | if (errorCode<kNrErrorCodes && eq<20) return fConsErrPos[errorCode][eq]; | |
462 | else { | |
463 | AliWarning(Form("Error code (%d) or equipment (%d) out of range, returning NULL",errorCode,eq)); | |
464 | return NULL; | |
465 | } | |
466 | } | |
b457135f | 467 | //________________________________________________________________________________________________ |
468 | UInt_t AliITSRawStreamSPDErrorLog::GetEventErrPosCounter(UInt_t errorCode, UInt_t eq) { | |
469 | // returns the number of errors with bytes information for current event | |
470 | if (errorCode<kNrErrorCodes && eq<20) return fErrPosTMPCounter[errorCode][eq]; | |
471 | else { | |
472 | AliError(Form("Error code (%d) or equipment (%d) out of range, returning 0",errorCode,eq)); | |
473 | return 0; | |
474 | } | |
475 | } | |
476 | //________________________________________________________________________________________________ | |
477 | UInt_t AliITSRawStreamSPDErrorLog::GetEventErrPos(UInt_t index, UInt_t errorCode, UInt_t eq) { | |
478 | // returns the bytes read for the index'th error of current event | |
479 | if (errorCode<kNrErrorCodes && eq<20) { | |
480 | if (index<fErrPosTMPCounter[errorCode][eq]) { | |
481 | Double_t x,y; | |
482 | fConsErrPosTMP[errorCode][eq]->GetPoint(index,x,y); | |
483 | return (UInt_t) y; | |
484 | } | |
485 | else { | |
486 | AliError(Form("Index %d out of range, returning 0",index)); | |
487 | return 0; | |
488 | } | |
489 | } | |
490 | else { | |
491 | AliError(Form("Error code (%d) or equipment (%d) out of range, returning 0",errorCode,eq)); | |
492 | return 0; | |
493 | } | |
494 | ||
495 | } | |
de12e454 | 496 |