1 //////////////////////////////////////////////////////////////////////
2 // Author: Henrik Tydesjo //
3 // For easier handling of dead and noisy pixels they are kept in //
4 // container maps (AliITSIntMap). //
5 // Handling of inactive equipments,HSs,chips have been added. //
6 // A pixel that is either dead or inactive is called SILENT here. //
7 // The lists of single dead and noisy pixels are separated from the //
8 // information about which eq/hs/chip are inactive. //
9 // The TArrayS objects that are put in the AliITSCalibrationSPD //
10 // objects can be obtained from the methods GetDeadArray and //
12 //////////////////////////////////////////////////////////////////////
14 #include "AliITSOnlineCalibrationSPDhandler.h"
15 #include "AliITSOnlineCalibrationSPD.h"
16 #include "AliITSIntMap.h"
17 #include <TObjArray.h>
24 #ifndef SPD_DA_OFF // you may want to exclude cdb classes, if using this class outside aliroot
25 #include "AliITSCalibrationSPD.h"
26 #include "AliCDBManager.h"
27 #include "AliCDBEntry.h"
32 //____________________________________________________________________________________________
33 AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler():
37 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
40 fDeadPixelMap[gloChip] = new AliITSIntMap();
41 fNoisyPixelMap[gloChip] = new AliITSIntMap();
46 //____________________________________________________________________________________________
47 AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler(const AliITSOnlineCalibrationSPDhandler& handle):
51 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
52 fNrDead[gloChip] = handle.fNrDead[gloChip];
53 fNrNoisy[gloChip] = handle.fNrNoisy[gloChip];
54 fDeadPixelMap[gloChip] = handle.fDeadPixelMap[gloChip]->Clone();
55 fNoisyPixelMap[gloChip] = handle.fNoisyPixelMap[gloChip]->Clone();
57 for (UInt_t eq=0; eq<20; eq++) {
58 fActiveEq[eq] = handle.fActiveEq[eq];
59 for (UInt_t hs=0; hs<6; hs++) {
60 fActiveHS[eq][hs] = handle.fActiveHS[eq][hs];
61 for (UInt_t chip=0; chip<10; chip++) {
62 fActiveChip[eq][hs][chip] = handle.fActiveChip[eq][hs][chip];
66 fFileLocation = handle.fFileLocation;
68 //____________________________________________________________________________________________
69 AliITSOnlineCalibrationSPDhandler::~AliITSOnlineCalibrationSPDhandler() {
71 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
72 delete fDeadPixelMap[gloChip];
73 delete fNoisyPixelMap[gloChip];
76 //____________________________________________________________________________________________
77 AliITSOnlineCalibrationSPDhandler& AliITSOnlineCalibrationSPDhandler::operator=(const AliITSOnlineCalibrationSPDhandler& handle) {
78 // assignment operator
81 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
82 fNrDead[gloChip] = handle.fNrDead[gloChip];
83 fNrNoisy[gloChip] = handle.fNrNoisy[gloChip];
84 fDeadPixelMap[gloChip] = handle.fDeadPixelMap[gloChip]->Clone();
85 fNoisyPixelMap[gloChip] = handle.fNoisyPixelMap[gloChip]->Clone();
87 for (UInt_t eq=0; eq<20; eq++) {
88 fActiveEq[eq] = handle.fActiveEq[eq];
89 for (UInt_t hs=0; hs<6; hs++) {
90 fActiveHS[eq][hs] = handle.fActiveHS[eq][hs];
91 for (UInt_t chip=0; chip<10; chip++) {
92 fActiveChip[eq][hs][chip] = handle.fActiveChip[eq][hs][chip];
96 fFileLocation = handle.fFileLocation;
100 //____________________________________________________________________________________________
101 void AliITSOnlineCalibrationSPDhandler::ClearMaps() {
102 // clear the lists of dead and noisy
107 //____________________________________________________________________________________________
108 void AliITSOnlineCalibrationSPDhandler::ResetDead() {
109 // reset the dead pixel map and inactive eq,hs,chip
111 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
113 fDeadPixelMap[gloChip]->Clear();
116 //____________________________________________________________________________________________
117 void AliITSOnlineCalibrationSPDhandler::ResetNoisy() {
118 // clear the list of noisy pixels
119 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
121 fNoisyPixelMap[gloChip]->Clear();
124 //____________________________________________________________________________________________
125 void AliITSOnlineCalibrationSPDhandler::ResetDeadForChip(UInt_t eq, UInt_t hs, UInt_t chip) {
126 // clear the dead pixels for this chip
127 SetDeadChip(eq,hs,chip,kFALSE);
128 UInt_t gloChip = GetGloChip(eq,hs,chip);
129 for (UInt_t col=0; col<32; col++) {
130 for (UInt_t row=0; row<256; row++) {
131 Int_t key = GetKey(eq,hs,chip,col,row);
132 if (fDeadPixelMap[gloChip]->Remove(key)) {
138 //____________________________________________________________________________________________
139 void AliITSOnlineCalibrationSPDhandler::ResetNoisyForChip(UInt_t eq, UInt_t hs, UInt_t chip) {
140 // clear the noisy pixels for this chip
141 UInt_t gloChip = GetGloChip(eq,hs,chip);
143 Error("AliITSOnlineCalibrationSPDhandler::ResetNoisyForChip","global chip nr (%d) out of bounds\n",gloChip);
146 for (UInt_t col=0; col<32; col++) {
147 for (UInt_t row=0; row<256; row++) {
148 Int_t key = GetKey(eq,hs,chip,col,row);
149 if (fNoisyPixelMap[gloChip]->Remove(key)) {
155 //____________________________________________________________________________________________
156 void AliITSOnlineCalibrationSPDhandler::ResetDeadForEq(UInt_t eq) {
157 // clear the dead pixels for this eq
159 Error("AliITSOnlineCalibrationSPDhandler::ResetDeadForEq", "eq (%d) out of bounds.",eq);
162 for (UInt_t hs=0; hs<6; hs++) {
163 for (UInt_t chip=0; chip<10; chip++) {
164 ResetDeadForChip(eq, hs, chip);
168 //____________________________________________________________________________________________
169 void AliITSOnlineCalibrationSPDhandler::ResetNoisyForEq(UInt_t eq) {
170 // clear the noisy pixels for this eq
172 Error("AliITSOnlineCalibrationSPDhandler::ResetNoisyForEq", "eq (%d) out of bounds.",eq);
175 for (UInt_t hs=0; hs<6; hs++) {
176 for (UInt_t chip=0; chip<10; chip++) {
177 ResetNoisyForChip(eq, hs, chip);
183 //____________________________________________________________________________________________
184 Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromFiles() {
185 // read files from file location (active,dead,noisy info). returns true if at least one file found
186 Bool_t b1 = ReadNoisyFromFiles();
187 Bool_t b2 = ReadSilentFromFiles();
190 //____________________________________________________________________________________________
191 Bool_t AliITSOnlineCalibrationSPDhandler::ReadSilentFromFiles() {
192 // read dead,active files from file location. returns true if at least one file found
193 Bool_t returnval=kFALSE;
194 for (UInt_t eq=0; eq<20; eq++) {
195 if (ReadSilentFromFile(eq)) {
201 //____________________________________________________________________________________________
202 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromFiles() {
203 // read dead,active files from file location. returns true if at least one file found
204 Bool_t returnval=kFALSE;
205 for (UInt_t eq=0; eq<20; eq++) {
206 if (ReadDeadFromFile(eq)) {
212 //____________________________________________________________________________________________
213 Bool_t AliITSOnlineCalibrationSPDhandler::ReadSilentFromFile(UInt_t eq) {
214 // read dead file for eq from file location.
215 TString fileName = Form("%s/SPD_Dead_%d.root",fFileLocation.Data(),eq);
216 return ReadSilentFromFileName(fileName.Data());
218 //____________________________________________________________________________________________
219 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromFile(UInt_t eq) {
220 // read dead file for eq from file location.
221 TString fileName = Form("%s/SPD_Dead_%d.root",fFileLocation.Data(),eq);
222 return ReadDeadFromFileName(fileName.Data());
224 //____________________________________________________________________________________________
225 Bool_t AliITSOnlineCalibrationSPDhandler::ReadSilentFromFileName(const char *fileName) {
226 // read dead from file fileName (including inactive)
227 return ReadDeadFromFileName(fileName, kTRUE);
229 //____________________________________________________________________________________________
230 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromFileName(const char *fileName, Bool_t inactive) {
231 // read dead from file fileName
232 AliITSOnlineCalibrationSPD* calib;
233 FILE* fp0 = fopen(fileName, "r");
234 if (fp0 == NULL) {return kFALSE;}
237 TFile file(fileName, "READ");
239 file.GetObject("AliITSOnlineCalibrationSPD", calib);
242 UInt_t nrDead=calib->GetNrBad();
243 for (UInt_t index=0; index<nrDead; index++) {
244 UInt_t key = calib->GetKeyAt(index);
245 UInt_t eq = GetEqIdFromKey(key);
246 UInt_t hs = GetHSFromKey(key);
247 UInt_t chip = GetChipFromKey(key);
248 UInt_t col = GetColFromKey(key);
249 UInt_t row = GetRowFromKey(key);
250 SetDeadPixel(eq,hs,chip,col,row);
252 UInt_t eq = calib->GetEqNr();
253 if (calib->IsDeadEq()) SetDeadEq(eq);
254 else SetDeadEq(eq,kFALSE);
255 for (UInt_t hs=0; hs<6; hs++) {
256 if (calib->IsDeadHS(hs)) SetDeadHS(eq,hs);
257 else SetDeadHS(eq,hs,kFALSE);
258 for (UInt_t chip=0; chip<10; chip++) {
259 if (calib->IsDeadChip(hs,chip)) SetDeadChip(eq,hs,chip);
260 else SetDeadChip(eq,hs,chip,kFALSE);
264 UInt_t eq = calib->GetEqNr();
265 if (calib->IsActiveEq()) ActivateEq(eq);
266 else ActivateEq(eq,kFALSE);
267 for (UInt_t hs=0; hs<6; hs++) {
268 if (calib->IsActiveHS(hs)) ActivateHS(eq,hs);
269 else ActivateHS(eq,hs,kFALSE);
270 for (UInt_t chip=0; chip<10; chip++) {
271 if (calib->IsActiveChip(hs,chip)) ActivateChip(eq,hs,chip);
272 else ActivateChip(eq,hs,chip,kFALSE);
281 //____________________________________________________________________________________________
282 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromFiles() {
283 // read noisy files from file location. returns true if at least one file found
284 Bool_t returnval=kFALSE;
285 for (UInt_t eq=0; eq<20; eq++) {
286 if (ReadNoisyFromFile(eq)) {
292 //____________________________________________________________________________________________
293 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromFile(UInt_t eq) {
294 // read noisy file for eq from file location.
295 TString fileName = Form("%s/SPD_Noisy_%d.root",fFileLocation.Data(),eq);
296 return ReadNoisyFromFileName(fileName.Data());
298 //____________________________________________________________________________________________
299 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromFileName(const char *fileName) {
300 // read noisy from file fileName
301 AliITSOnlineCalibrationSPD* calib;
302 FILE* fp0 = fopen(fileName, "r");
303 if (fp0 == NULL) {return kFALSE;}
306 TFile file(fileName, "READ");
308 file.GetObject("AliITSOnlineCalibrationSPD", calib);
311 UInt_t nrNoisy=calib->GetNrBad();
312 for (UInt_t index=0; index<nrNoisy; index++) {
313 UInt_t key = calib->GetKeyAt(index);
314 UInt_t eq = GetEqIdFromKey(key);
315 UInt_t hs = GetHSFromKey(key);
316 UInt_t chip = GetChipFromKey(key);
317 UInt_t col = GetColFromKey(key);
318 UInt_t row = GetRowFromKey(key);
319 SetNoisyPixel(eq,hs,chip,col,row);
326 //____________________________________________________________________________________________
327 UInt_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromText(const char *fileName, UInt_t module) {
328 // read dead from a text file (lines with eq,hs,chip,col,row). returns nr of pixels added (not already here)
329 // insert only those pixels that belong to module (or all if module=240).
332 textFile.open(fileName, ifstream::in);
333 if (textFile.fail()) {
334 Warning("AliITSOnlineCalibrationSPDhandler::ReadDeadFromText","No dead text file (%s) present.",fileName);
338 UInt_t eq,hs,chip,col,row;
339 textFile >> eq; if (textFile.eof()) break;
340 textFile >> hs; if (textFile.eof()) break;
341 textFile >> chip; if (textFile.eof()) break;
342 textFile >> col; if (textFile.eof()) break;
344 if (module==240 || (Int_t)module==AliITSRawStreamSPD::GetModuleNumber(eq,hs,chip)){
345 if (SetDeadPixel(eq,hs,chip,col,row)) {
349 if (textFile.eof()) break;
355 //____________________________________________________________________________________________
356 UInt_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromText(const char *fileName, UInt_t module) {
357 // read noisy from a text file (lines with eq,hs,chip,col,row). returns nr of pixels added (not already here)
358 // insert only those pixels that belong to module (or all if module=240).
361 textFile.open(fileName, ifstream::in);
362 if (textFile.fail()) {
363 Warning("AliITSOnlineCalibrationSPDhandler::ReadNoisyFromText","No noisy text file (%s) present.",fileName);
367 UInt_t eq,hs,chip,col,row;
368 textFile >> eq; if (textFile.eof()) break;
369 textFile >> hs; if (textFile.eof()) break;
370 textFile >> chip; if (textFile.eof()) break;
371 textFile >> col; if (textFile.eof()) break;
373 if (module==240 || (Int_t)module==AliITSRawStreamSPD::GetModuleNumber(eq,hs,chip)){
374 if (SetNoisyPixel(eq,hs,chip,col,row)) {
378 if (textFile.eof()) break;
384 //____________________________________________________________________________________________
385 void AliITSOnlineCalibrationSPDhandler::WriteToFilesAlways() {
386 // write the lists of active,dead,noisy to files
387 for (UInt_t eq=0; eq<20; eq++) {
388 WriteSilentToFile(eq);
389 WriteNoisyToFile(eq);
392 //____________________________________________________________________________________________
393 UInt_t AliITSOnlineCalibrationSPDhandler::WriteToFiles() {
394 // write the lists of dead and noisy to files (only if there are >0 dead or noisy pixels) , returns nr of files produced
395 return (WriteNoisyToFiles() + WriteSilentToFiles());
397 //____________________________________________________________________________________________
398 void AliITSOnlineCalibrationSPDhandler::WriteSilentToFilesAlways() {
399 // write the lists of silent to files
400 for (UInt_t eq=0; eq<20; eq++) {
401 WriteSilentToFile(eq);
404 //____________________________________________________________________________________________
405 void AliITSOnlineCalibrationSPDhandler::WriteDeadToFilesAlways() {
406 // write the lists of dead to files
407 for (UInt_t eq=0; eq<20; eq++) {
411 //____________________________________________________________________________________________
412 void AliITSOnlineCalibrationSPDhandler::WriteNoisyToFilesAlways() {
413 // write the lists of noisy to files
414 for (UInt_t eq=0; eq<20; eq++) {
415 WriteNoisyToFile(eq);
418 //____________________________________________________________________________________________
419 UInt_t AliITSOnlineCalibrationSPDhandler::WriteSilentToFiles() {
420 // write the list of silent to file (only if there are >0 silent pixels) , returns nr of files produced
422 for (UInt_t eq=0; eq<20; eq++) {
423 if (GetNrSilentEq(eq) > 0) {
424 WriteSilentToFile(eq);
430 //____________________________________________________________________________________________
431 UInt_t AliITSOnlineCalibrationSPDhandler::WriteDeadToFiles() {
432 // write the list of dead to file (only if there are >0 dead pixels) , returns nr of files produced
434 for (UInt_t eq=0; eq<20; eq++) {
435 if (GetNrDeadEq(eq) > 0) {
442 //____________________________________________________________________________________________
443 UInt_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToFiles() {
444 // write the list of noisy to file (only if there are >0 noisy pixels) , returns nr of files produced
446 for (UInt_t eq=0; eq<20; eq++) {
447 if (GetNrNoisyEq(eq) > 0) {
448 WriteNoisyToFile(eq);
454 //____________________________________________________________________________________________
455 void AliITSOnlineCalibrationSPDhandler::WriteSilentToFile(UInt_t eq) {
456 WriteDeadToFile(eq,kTRUE);
458 //____________________________________________________________________________________________
459 void AliITSOnlineCalibrationSPDhandler::WriteDeadToFile(UInt_t eq, Bool_t inactive) {
460 // write the lists of dead (and inactive if input boolean is true) for eq to file
461 AliITSOnlineCalibrationSPD* calib = new AliITSOnlineCalibrationSPD();
463 calib->SetBadList(GetDeadArrayOnline(eq));
464 calib->SetNrBad(GetNrDeadEq(eq));
465 if (IsDeadEq(eq)) calib->SetDeadEq();
466 else calib->SetDeadEq(kFALSE);
467 for (UInt_t hs=0; hs<6; hs++) {
468 if (IsDeadHS(eq,hs)) calib->SetDeadHS(hs);
469 else calib->SetDeadHS(hs,kFALSE);
470 for (UInt_t chip=0; chip<10; chip++) {
471 if (IsDeadChip(eq,hs,chip)) calib->SetDeadChip(hs,chip);
472 else calib->SetDeadChip(hs,chip,kFALSE);
476 if (IsActiveEq(eq)) calib->ActivateEq();
477 else calib->ActivateEq(kFALSE);
478 for (UInt_t hs=0; hs<6; hs++) {
479 if (IsActiveHS(eq,hs)) calib->ActivateHS(hs);
480 else calib->ActivateHS(hs,kFALSE);
481 for (UInt_t chip=0; chip<10; chip++) {
482 if (IsActiveChip(eq,hs,chip)) calib->ActivateChip(hs,chip);
483 else calib->ActivateChip(hs,chip,kFALSE);
487 TString fileName = Form("%s/SPD_Dead_%d.root",fFileLocation.Data(),eq);
488 TFile file(fileName.Data(), "RECREATE");
489 file.WriteTObject(calib, "AliITSOnlineCalibrationSPD");
493 //____________________________________________________________________________________________
494 void AliITSOnlineCalibrationSPDhandler::WriteNoisyToFile(UInt_t eq) {
495 // write the lists of noisy for eq to file
496 AliITSOnlineCalibrationSPD* calib = new AliITSOnlineCalibrationSPD();
498 calib->SetBadList(GetNoisyArrayOnline(eq));
499 calib->SetNrBad(GetNrNoisyEq(eq));
500 TString fileName = Form("%s/SPD_Noisy_%d.root",fFileLocation.Data(),eq);
501 TFile file(fileName.Data(), "RECREATE");
502 file.WriteTObject(calib, "AliITSOnlineCalibrationSPD");
506 //____________________________________________________________________________________________
508 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadModuleFromDB(UInt_t module, Int_t runNr, Bool_t treeSerial) {
509 // reads dead pixels from DB for given module and runNr
510 AliCDBManager* man = AliCDBManager::Instance();
511 if(!man->IsDefaultStorageSet()) {
512 man->SetDefaultStorage("local://$ALICE_ROOT");
514 AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
517 spdEntry = (TObjArray*)cdbEntry->GetObject();
518 if(!spdEntry) return kFALSE;
521 Warning("AliITSOnlineCalibrationSPDhandler::ReadDeadModuleFromDB","Calibration for run %d not found in database.",runNr);
524 AliITSCalibrationSPD* calibSPD;
525 calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
527 UInt_t nrDead = calibSPD->GetNrBadSingle();
529 if (!treeSerial) RecursiveInsertDead(calibSPD,module,0,nrDead-1);
531 for (UInt_t index=0; index<nrDead; index++) {
532 UInt_t colM = calibSPD->GetBadColAt(index);
533 UInt_t rowM = calibSPD->GetBadRowAt(index);
534 SetDeadPixelM(module,colM,rowM);
538 for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
539 UInt_t eq,hs,chip,col,row;
540 AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
541 if (calibSPD->IsChipBad(chipIndex)) {
542 SetDeadChip(eq,hs,chip);
545 SetDeadChip(eq,hs,chip,kFALSE);
549 spdEntry->SetOwner(kTRUE);
553 //____________________________________________________________________________________________
554 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyModuleFromDB(UInt_t module, Int_t runNr, Bool_t treeSerial) {
555 // reads noisy pixels from DB for given module and runNr
556 AliCDBManager* man = AliCDBManager::Instance();
557 if(!man->IsDefaultStorageSet()) {
558 man->SetDefaultStorage("local://$ALICE_ROOT");
560 AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
563 spdEntry = (TObjArray*)cdbEntry->GetObject();
564 if(!spdEntry) return kFALSE;
567 Warning("AliITSOnlineCalibrationSPDhandler::ReadNoisyModuleFromDB","Calibration for run %d not found in database.",runNr);
570 AliITSCalibrationSPD* calibSPD;
571 calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
572 UInt_t nrNoisy = calibSPD->GetNrBadSingle();
574 if (!treeSerial) RecursiveInsertNoisy(calibSPD,module,0,nrNoisy-1);
576 for (UInt_t index=0; index<nrNoisy; index++) {
577 UInt_t colM = calibSPD->GetBadColAt(index);
578 UInt_t rowM = calibSPD->GetBadRowAt(index);
579 SetNoisyPixelM(module,colM,rowM);
583 spdEntry->SetOwner(kTRUE);
587 //____________________________________________________________________________________________
588 Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromDB(Int_t runNr, Bool_t treeSerial) {
589 // reads dead and noisy pixels from DB for given runNr
590 // note that you may want to clear the lists (if they are not empty) before reading
591 return (ReadNoisyFromDB(runNr,treeSerial) && ReadDeadFromDB(runNr,treeSerial));
593 //____________________________________________________________________________________________
594 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB(Int_t runNr, Bool_t treeSerial) {
595 // reads dead pixels from DB for given runNr
596 // note that you may want to clear the list (if it is not empty) before reading
597 AliCDBManager* man = AliCDBManager::Instance();
598 if(!man->IsDefaultStorageSet()) {
599 man->SetDefaultStorage("local://$ALICE_ROOT");
601 AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
604 spdEntry = (TObjArray*)cdbEntry->GetObject();
605 if(!spdEntry) return kFALSE;
608 Warning("AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB","Calibration for run %d not found in database.",runNr);
611 AliITSCalibrationSPD* calibSPD;
612 for (UInt_t module=0; module<240; module++) {
613 calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
614 UInt_t nrDead = calibSPD->GetNrBadSingle();
616 if (!treeSerial) RecursiveInsertDead(calibSPD,module,0,nrDead-1);
618 for (UInt_t index=0; index<nrDead; index++) {
619 UInt_t colM = calibSPD->GetBadColAt(index);
620 UInt_t rowM = calibSPD->GetBadRowAt(index);
621 SetDeadPixelM(module,colM,rowM);
625 for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
626 UInt_t eq,hs,chip,col,row;
627 AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
628 if (calibSPD->IsChipBad(chipIndex)) {
629 SetDeadChip(eq,hs,chip);
632 SetDeadChip(eq,hs,chip,kFALSE);
636 spdEntry->SetOwner(kTRUE);
640 //____________________________________________________________________________________________
641 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, Bool_t treeSerial) {
642 // reads noisy pixels from DB for given runNr
643 // note that you may want to clear the list (if it is not empty) before reading
644 AliCDBManager* man = AliCDBManager::Instance();
645 if(!man->IsDefaultStorageSet()) {
646 man->SetDefaultStorage("local://$ALICE_ROOT");
648 AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
651 spdEntry = (TObjArray*)cdbEntry->GetObject();
652 if(!spdEntry) return kFALSE;
655 Warning("AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB","Calibration for run %d not found in database.",runNr);
658 AliITSCalibrationSPD* calibSPD;
659 for (UInt_t module=0; module<240; module++) {
660 calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
661 UInt_t nrNoisy = calibSPD->GetNrBadSingle();
664 RecursiveInsertNoisy(calibSPD,module,0,nrNoisy-1);
667 for (UInt_t index=0; index<nrNoisy; index++) {
668 UInt_t colM = calibSPD->GetBadColAt(index);
669 UInt_t rowM = calibSPD->GetBadRowAt(index);
670 SetNoisyPixelM(module,colM,rowM);
675 spdEntry->SetOwner(kTRUE);
679 //____________________________________________________________________________________________
680 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromCalibObj(TObjArray* calObj) {
681 // reads dead pixels from calib object
682 for (UInt_t module=0; module<240; module++) {
683 AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*)calObj->At(module);
684 for (Int_t i=0; i<calibSPD->GetNrBadSingle(); i++) {
685 SetDeadPixelM(module,calibSPD->GetBadColAt(i),calibSPD->GetBadRowAt(i));
687 for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
688 UInt_t eq,hs,chip,col,row;
689 AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
690 if (calibSPD->IsChipBad(chipIndex)) {
691 SetDeadChip(eq,hs,chip);
694 SetDeadChip(eq,hs,chip,kFALSE);
700 //____________________________________________________________________________________________
701 Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromCalibObj(TObjArray* calObj) {
702 // reads noisy pixels from calib object
703 for (UInt_t module=0; module<240; module++) {
704 AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*)calObj->At(module);
705 for (Int_t i=0; i<calibSPD->GetNrBadSingle(); i++) {
706 SetNoisyPixelM(module,calibSPD->GetBadColAt(i),calibSPD->GetBadRowAt(i));
711 //____________________________________________________________________________________________
712 Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runNrEnd) {
713 // writes dead and noisy pixels to DB for given runNrs
714 // overwrites any previous entries
715 return (WriteNoisyToDB(runNrStart,runNrEnd) && WriteDeadToDB(runNrStart,runNrEnd));
717 //____________________________________________________________________________________________
718 Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDB(Int_t runNrStart, Int_t runNrEnd) {
719 // writes dead pixels to DB for given runNrs
720 // overwrites any previous entries
721 AliCDBManager* man = AliCDBManager::Instance();
722 if(!man->IsDefaultStorageSet()) {
723 man->SetDefaultStorage("local://$ALICE_ROOT");
725 AliCDBMetaData* metaData = new AliCDBMetaData();
726 metaData->SetResponsible("Henrik Tydesjo");
727 metaData->SetComment("Created by AliITSOnlineCalibrationSPDhandler.");
728 AliCDBId idCalSPD("ITS/Calib/SPDDead",runNrStart,runNrEnd);
729 TObjArray* spdEntry = new TObjArray(240);
730 spdEntry->SetOwner(kTRUE);
731 for(UInt_t module=0; module<240; module++){
732 AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
733 spdEntry->Add(calibSPD);
735 for(UInt_t module=0; module<240; module++){
736 AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
737 calibSPD->SetNrBadSingle( GetNrDeadSingle(module) );
738 calibSPD->SetBadList( GetDeadArray(module) );
739 for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
740 UInt_t eq,hs,chip,col,row;
741 AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
742 if (IsSilentChip(eq,hs,chip)) {
743 calibSPD->SetChipBad(chipIndex);
746 calibSPD->UnSetChipBad(chipIndex);
750 AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
757 //____________________________________________________________________________________________
758 Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDBasNoisy(Int_t runNrStart, Int_t runNrEnd) {
759 // writes dead pixels to DB for given runNrs
760 // overwrites any previous entries
761 AliCDBManager* man = AliCDBManager::Instance();
762 if(!man->IsDefaultStorageSet()) {
763 man->SetDefaultStorage("local://$ALICE_ROOT");
765 AliCDBMetaData* metaData = new AliCDBMetaData();
766 metaData->SetResponsible("Henrik Tydesjo");
767 metaData->SetComment("Created by AliITSOnlineCalibrationSPDhandler.");
768 AliCDBId idCalSPD("ITS/Calib/SPDNoisy",runNrStart,runNrEnd);
769 TObjArray* spdEntry = new TObjArray(240);
770 spdEntry->SetOwner(kTRUE);
771 for(UInt_t module=0; module<240; module++){
772 AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
773 spdEntry->Add(calibSPD);
775 for(UInt_t module=0; module<240; module++){
776 AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
777 calibSPD->SetNrBadSingle( GetNrDeadSingle(module) );
778 calibSPD->SetBadList( GetDeadArray(module) );
779 for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
780 UInt_t eq,hs,chip,col,row;
781 AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
782 if (IsSilentChip(eq,hs,chip)) {
783 calibSPD->SetChipBad(chipIndex);
786 calibSPD->UnSetChipBad(chipIndex);
790 AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
797 //____________________________________________________________________________________________
798 Bool_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToDB(Int_t runNrStart, Int_t runNrEnd) {
799 // writes noisy pixels to DB for given runNrs
800 // overwrites any previous entries
801 AliCDBManager* man = AliCDBManager::Instance();
802 if(!man->IsDefaultStorageSet()) {
803 man->SetDefaultStorage("local://$ALICE_ROOT");
805 AliCDBMetaData* metaData = new AliCDBMetaData();
806 metaData->SetResponsible("Henrik Tydesjo");
807 metaData->SetComment("Created by AliITSOnlineCalibrationSPDhandler.");
808 AliCDBId idCalSPD("ITS/Calib/SPDNoisy",runNrStart,runNrEnd);
809 TObjArray* spdEntry = new TObjArray(240);
810 spdEntry->SetOwner(kTRUE);
811 for(UInt_t module=0; module<240; module++){
812 AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
813 spdEntry->Add(calibSPD);
815 for(UInt_t module=0; module<240; module++){
816 AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
817 calibSPD->SetNrBadSingle( GetNrNoisySingle(module) );
818 calibSPD->SetBadList( GetNoisyArray(module) );
820 AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
827 //____________________________________________________________________________________________
828 void AliITSOnlineCalibrationSPDhandler::RecursiveInsertDead(AliITSCalibrationSPD* calibSPD, UInt_t module, Int_t lowInd, Int_t highInd) {
829 // inserts dead pixels recursively, used when reading from db
830 if (lowInd>highInd) return;
831 Int_t thisInd = lowInd+(highInd-lowInd)/2;
832 SetDeadPixelM(module,calibSPD->GetBadColAt(thisInd),calibSPD->GetBadRowAt(thisInd));
833 RecursiveInsertDead(calibSPD,module,lowInd,thisInd-1);
834 RecursiveInsertDead(calibSPD,module,thisInd+1,highInd);
836 //____________________________________________________________________________________________
837 void AliITSOnlineCalibrationSPDhandler::RecursiveInsertNoisy(AliITSCalibrationSPD* calibSPD, UInt_t module, Int_t lowInd, Int_t highInd) {
838 // inserts noisy pixels recursively, used when reading from db
839 if (lowInd>highInd) return;
840 Int_t thisInd = lowInd+(highInd-lowInd)/2;
841 SetNoisyPixelM(module,calibSPD->GetBadColAt(thisInd),calibSPD->GetBadRowAt(thisInd));
842 RecursiveInsertNoisy(calibSPD,module,lowInd,thisInd-1);
843 RecursiveInsertNoisy(calibSPD,module,thisInd+1,highInd);
847 //____________________________________________________________________________________________
848 void AliITSOnlineCalibrationSPDhandler::GenerateDCSConfigFile(const Char_t* fileName) {
849 // generates an ascii file in the format as the one produced by online da (but with dummy runNr=0)
851 dcsfile.open(fileName);
852 dcsfile << "[SPD SCAN]\n";
853 dcsfile << "RunNumber=" << "0" << "\n"; // dummy value
854 dcsfile << "Type=" << "4" << "\n";
855 dcsfile << "Router=" << "0" << "\n"; // dummy value
856 dcsfile << "ActualDetConfiguration=" << "0,-1,-1\n"; // dummy values
857 dcsfile << "[NOISY]\n";
858 for (UInt_t module=0; module<240; module++) {
859 UInt_t headkey=20*10*6;
860 for (UInt_t ind=0; ind<GetNrNoisy(module); ind++) {
861 UInt_t newkey = GetNoisyEqIdAt(module,ind)*10*6 +
862 GetNoisyHSAt(module,ind)*10 +
863 GetNoisyChipAt(module,ind);
864 if (newkey!=headkey) { // print eq,hs,chip header
866 dcsfile << "-" << newkey/(6*10) << "," << (newkey%(6*10))/10 << "," << (newkey%(6*10))%10 << "\n";
868 dcsfile << GetNoisyColAt(module,ind) << "," << GetNoisyRowAt(module,ind) << "\n";
873 //____________________________________________________________________________________________
874 TArrayS AliITSOnlineCalibrationSPDhandler::GetSilentArray(UInt_t module, Bool_t treeSerial) {
875 // get a TArrayS of the silent=dead+inactive pixels (format for the AliITSCalibrationSPD object)
876 // NB! with new implementation of AliITSCalibrationSPD this is not needed anymore
879 UInt_t eq = GetEqIdFromOffline(module);
880 UInt_t hs = GetHSFromOffline(module);
882 if ( !( IsActiveEq(eq) && IsActiveHS(eq,hs) ) ) {
886 for (UInt_t ch=0; ch<5; ch++) {
887 UInt_t chip = GetChipFromOffline(module,ch*32);
888 if (!(IsActiveChip(eq,hs,chip))) {
892 UInt_t gloChip = GetGloChip(eq,hs,chip);
893 size += fNrDead[gloChip];
897 returnArray.Set(size*2);
900 if ( !( IsActiveEq(eq) && IsActiveHS(eq,hs) ) ) {
901 for (UInt_t colM=0; colM<160; colM++) {
902 for (UInt_t rowM=0; rowM<256; rowM++) {
903 returnArray.AddAt(colM,gloIndex*2);
904 returnArray.AddAt(rowM,gloIndex*2+1);
910 for (UInt_t ch=0; ch<5; ch++) {
911 UInt_t chip = GetChipFromOffline(module,ch*32);
912 if (!(IsActiveChip(eq,hs,chip))) {
913 for (UInt_t colM=ch*32; colM<ch*32+32; colM++) {
914 for (UInt_t rowM=0; rowM<256; rowM++) {
915 returnArray.AddAt(colM,gloIndex*2);
916 returnArray.AddAt(rowM,gloIndex*2+1);
922 UInt_t gloChip = GetGloChip(eq,hs,chip);
923 if (treeSerial) fDeadPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
924 else fDeadPixelMap[gloChip]->PrepareSerializeOrdered(); // for key ordered values
925 for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
926 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
927 Int_t colM = GetColMFromKey(key);
928 Int_t rowM = GetRowMFromKey(key);
929 returnArray.AddAt(colM,gloIndex*2);
930 returnArray.AddAt(rowM,gloIndex*2+1);
938 //____________________________________________________________________________________________
939 TArrayS AliITSOnlineCalibrationSPDhandler::GetDeadArray(UInt_t module, Bool_t treeSerial) {
940 // get a TArrayS of the single dead pixels (format for the AliITSCalibrationSPD object)
943 UInt_t eq = GetEqIdFromOffline(module);
944 UInt_t hs = GetHSFromOffline(module);
945 UInt_t size=GetNrDeadSingle(module);
946 returnArray.Set(size*2);
948 for (UInt_t ch=0; ch<5; ch++) {
949 UInt_t chip = GetChipFromOffline(module,ch*32);
950 UInt_t gloChip = GetGloChip(eq,hs,chip);
951 if (treeSerial) fDeadPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
952 else fDeadPixelMap[gloChip]->PrepareSerializeOrdered(); // for key ordered values
953 if (!IsSilentChip(eq,hs,chip)) {
954 for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
955 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
956 Int_t colM = GetColMFromKey(key);
957 Int_t rowM = GetRowMFromKey(key);
958 returnArray.AddAt(colM,gloIndex*2);
959 returnArray.AddAt(rowM,gloIndex*2+1);
966 //____________________________________________________________________________________________
967 TArrayS AliITSOnlineCalibrationSPDhandler::GetNoisyArray(UInt_t module, Bool_t treeSerial) {
968 // get a TArrayS of the single noisy pixels (format for the AliITSCalibrationSPD object)
971 UInt_t eq = GetEqIdFromOffline(module);
972 UInt_t hs = GetHSFromOffline(module);
973 UInt_t size=GetNrNoisySingle(module);
974 returnArray.Set(size*2);
976 for (UInt_t ch=0; ch<5; ch++) {
977 UInt_t gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
978 if (treeSerial) fNoisyPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
979 else fNoisyPixelMap[gloChip]->PrepareSerializeOrdered(); // for key ordered values
980 for (UInt_t index=0; index<fNrNoisy[gloChip]; index++) {
981 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
982 Int_t colM = GetColMFromKey(key);
983 Int_t rowM = GetRowMFromKey(key);
984 returnArray.AddAt(colM,gloIndex*2);
985 returnArray.AddAt(rowM,gloIndex*2+1);
991 //____________________________________________________________________________________________
992 TArrayI AliITSOnlineCalibrationSPDhandler::GetDeadArrayOnline(UInt_t eq) {
993 // get a TArrayI of the single dead pixels (format for the AliITSOnlineCalibrationSPD object)
997 for (UInt_t hs=0; hs<6; hs++) {
998 for (UInt_t chip=0; chip<10; chip++) {
999 UInt_t gloChip = GetGloChip(eq,hs,chip);
1000 size+=fNrDead[gloChip];
1003 returnArray.Set(size);
1004 // put keys in array
1006 for (UInt_t hs=0; hs<6; hs++) {
1007 for (UInt_t chip=0; chip<10; chip++) {
1008 UInt_t gloChip = GetGloChip(eq,hs,chip);
1009 fDeadPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
1010 for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
1011 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
1012 returnArray.AddAt(key,gloIndex);
1019 //____________________________________________________________________________________________
1020 TArrayI AliITSOnlineCalibrationSPDhandler::GetNoisyArrayOnline(UInt_t eq) {
1021 // get a TArrayI of the single noisy pixels (format for the AliITSOnlineCalibrationSPD object)
1022 TArrayI returnArray;
1023 // fix size of array
1025 for (UInt_t hs=0; hs<6; hs++) {
1026 for (UInt_t chip=0; chip<10; chip++) {
1027 UInt_t gloChip = GetGloChip(eq,hs,chip);
1028 size+=fNrNoisy[gloChip];
1031 returnArray.Set(size);
1032 // put keys in array
1034 for (UInt_t hs=0; hs<6; hs++) {
1035 for (UInt_t chip=0; chip<10; chip++) {
1036 UInt_t gloChip = GetGloChip(eq,hs,chip);
1037 fNoisyPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
1038 for (UInt_t index=0; index<fNrNoisy[gloChip]; index++) {
1039 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
1040 returnArray.AddAt(key,gloIndex);
1047 //____________________________________________________________________________________________
1048 void AliITSOnlineCalibrationSPDhandler::PrintEqSummary() {
1049 // print summary (nr of dead and noisy) for each equipment
1050 printf("-----------\n");
1051 printf("Eq summary:\n");
1052 printf("-----------\n");
1053 for (UInt_t eq=0; eq<20; eq++) {
1054 printf("Eq %*d: %*d silent(dead+inactive) , %*d dead , %*d noisy\n",2,eq,6,GetNrSilentEq(eq),6,GetNrDeadEq(eq),6,GetNrNoisyEq(eq));
1057 //____________________________________________________________________________________________
1058 void AliITSOnlineCalibrationSPDhandler::PrintSilent() const {
1059 // print the inactive and dead pixels to screen
1060 printf("-----------------------------------------------------------\n");
1061 printf("Inactive or dead Equipments: (eq | module1 .. module12)\n");
1062 printf("-----------------------------------------------------------\n");
1063 for (UInt_t eq=0; eq<20; eq++) {
1064 if (IsSilentEq(eq)) {
1065 printf("%*d | ",2,eq);
1066 for (UInt_t hs=0; hs<6; hs++) {
1067 for (UInt_t chip=0; chip<10; chip+=5) {
1068 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1069 if (hs>0 || chip==5) printf(",");
1070 printf("%*d",3,module);
1077 printf("-----------------------------------------------------------\n");
1078 printf("Inactive or dead Half-staves: (eq,hs | module1,module2)\n");
1079 printf("-----------------------------------------------------------\n");
1080 for (UInt_t eq=0; eq<20; eq++) {
1081 if (!IsSilentEq(eq)) {
1082 for (UInt_t hs=0; hs<6; hs++) {
1083 if (IsSilentHS(eq,hs)) {
1084 printf("%*d,%*d | ",2,eq,1,hs);
1085 for (UInt_t chip=0; chip<10; chip+=5) {
1086 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1087 if (chip==5) printf(",");
1088 printf("%*d",3,module);
1096 printf("-----------------------------------------------------------\n");
1097 printf("Inactive or dead Chips: (eq,hs,chip | module,colM1-colM2)\n");
1098 printf("-----------------------------------------------------------\n");
1099 for (UInt_t eq=0; eq<20; eq++) {
1100 if (!IsSilentEq(eq)) {
1101 for (UInt_t hs=0; hs<6; hs++) {
1102 if (!IsSilentHS(eq,hs)) {
1103 for (UInt_t chip=0; chip<10; chip++) {
1104 if (IsSilentChip(eq,hs,chip)) {
1105 printf("%*d,%*d,%*d | ",2,eq,1,hs,1,chip);
1106 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1107 UInt_t colM1 = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,0);
1108 UInt_t colM2 = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,31);
1109 printf("%*d,%*d-%*d\n",3,module,3,colM1,3,colM2);
1120 //____________________________________________________________________________________________
1121 void AliITSOnlineCalibrationSPDhandler::PrintDead() const {
1122 // print the single dead pixels to screen (disregards inactive eq,hs,chip)
1123 printf("------------------------------------------------------\n");
1124 printf("Dead Pixels: (eq,hs,chip,col,row | module,colM,rowM)\n");
1125 printf("------------------------------------------------------\n");
1126 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
1127 for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
1128 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
1129 UInt_t eq = GetEqIdFromKey(key);
1130 UInt_t hs = GetHSFromKey(key);
1131 UInt_t chip = GetChipFromKey(key);
1132 UInt_t col = GetColFromKey(key);
1133 UInt_t row = GetRowFromKey(key);
1135 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1136 UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
1137 UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
1139 printf("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d\n",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
1143 //____________________________________________________________________________________________
1144 void AliITSOnlineCalibrationSPDhandler::PrintNoisy() const {
1145 // print the dead pixels to screen
1146 printf("-------------------------------------------------------\n");
1147 printf("Noisy Pixels: (eq,hs,chip,col,row | module,colM,rowM)\n");
1148 printf("-------------------------------------------------------\n");
1149 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
1150 for (UInt_t index=0; index<fNrNoisy[gloChip]; index++) {
1151 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
1152 UInt_t eq = GetEqIdFromKey(key);
1153 UInt_t hs = GetHSFromKey(key);
1154 UInt_t chip = GetChipFromKey(key);
1155 UInt_t col = GetColFromKey(key);
1156 UInt_t row = GetRowFromKey(key);
1158 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1159 UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
1160 UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
1162 printf("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d\n",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
1166 //____________________________________________________________________________________________
1167 Bool_t AliITSOnlineCalibrationSPDhandler::SetDeadPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) {
1168 // set a dead pixel, returns false if pixel is already dead
1169 UInt_t gloChip = GetGloChip(eq,hs,chip);
1170 if (gloChip>=1200) {
1171 Error("AliITSOnlineCalibrationSPDhandler::SetDeadPixel", "eq,hs,chip nrs (%d,%d,%d) out of bounds.",eq,hs,chip);
1174 if (col>=32 && row>=256) {
1175 Error("AliITSOnlineCalibrationSPDhandler::SetDeadPixel", "col,row nrs (%d,%d) out of bounds.",col,row);
1178 Int_t key = GetKey(eq,hs,chip,col,row);
1179 // if noisy we dont want to add it...
1180 if (fNoisyPixelMap[gloChip]->Find(key) != NULL) return kFALSE;
1181 if (fDeadPixelMap[gloChip]->Insert(key,gloChip)) {
1187 //____________________________________________________________________________________________
1188 Bool_t AliITSOnlineCalibrationSPDhandler::SetNoisyPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) {
1189 // set a noisy pixel, returns false if pixel is already noisy
1190 UInt_t gloChip = GetGloChip(eq,hs,chip);
1191 if (gloChip>=1200) {
1192 Error("AliITSOnlineCalibrationSPDhandler::SetNoisyPixel", "eq,hs,chip nrs (%d,%d,%d) out of bounds.",eq,hs,chip);
1195 if (col>=32 && row>=256) {
1196 Error("AliITSOnlineCalibrationSPDhandler::SetNoisyPixel", "col,row nrs (%d,%d) out of bounds.",col,row);
1199 Int_t key = GetKey(eq,hs,chip,col,row);
1200 // if dead before - remove from the dead list
1201 if (fDeadPixelMap[gloChip]->Remove(key)) {
1204 if (fNoisyPixelMap[gloChip]->Insert(key,gloChip)) {
1205 fNrNoisy[gloChip]++;
1210 //____________________________________________________________________________________________
1211 Bool_t AliITSOnlineCalibrationSPDhandler::SetDeadPixelM(UInt_t module, UInt_t colM, UInt_t rowM) {
1212 // set a dead pixel, returns false if pixel is already dead
1213 UInt_t eq = GetEqIdFromOffline(module);
1214 UInt_t hs = GetHSFromOffline(module);
1215 UInt_t chip = GetChipFromOffline(module,colM);
1216 UInt_t col = GetColFromOffline(module,colM);
1217 UInt_t row = GetRowFromOffline(module,rowM);
1218 return SetDeadPixel(eq,hs,chip,col,row);
1220 //____________________________________________________________________________________________
1221 Bool_t AliITSOnlineCalibrationSPDhandler::SetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t rowM) {
1222 // set a noisy pixel, returns false if pixel is already noisy
1223 UInt_t eq = GetEqIdFromOffline(module);
1224 UInt_t hs = GetHSFromOffline(module);
1225 UInt_t chip = GetChipFromOffline(module,colM);
1226 UInt_t col = GetColFromOffline(module,colM);
1227 UInt_t row = GetRowFromOffline(module,rowM);
1228 return SetNoisyPixel(eq,hs,chip,col,row);
1230 //____________________________________________________________________________________________
1231 Bool_t AliITSOnlineCalibrationSPDhandler::UnSetDeadPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) {
1232 // unset a dead pixel, returns false if pixel is not dead
1233 UInt_t gloChip = GetGloChip(eq,hs,chip);
1234 if (gloChip>=1200) {
1235 Error("AliITSOnlineCalibrationSPDhandler::UnSetDeadPixel", "eq,hs,chip nrs (%d,%d,%d) out of bounds.",eq,hs,chip);
1238 Int_t key = GetKey(eq,hs,chip,col,row);
1239 if (fDeadPixelMap[gloChip]->Remove(key)) {
1245 //____________________________________________________________________________________________
1246 Bool_t AliITSOnlineCalibrationSPDhandler::UnSetNoisyPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) {
1247 // unset a noisy pixel, returns false if pixel is not noisy
1248 UInt_t gloChip = GetGloChip(eq,hs,chip);
1249 if (gloChip>=1200) {
1250 Error("AliITSOnlineCalibrationSPDhandler::UnSetNoisyPixel", "eq,hs,chip nrs (%d,%d,%d) out of bounds.",eq,hs,chip);
1253 Int_t key = GetKey(eq,hs,chip,col,row);
1254 if (fNoisyPixelMap[gloChip]->Remove(key)) {
1255 fNrNoisy[gloChip]--;
1260 //____________________________________________________________________________________________
1261 Bool_t AliITSOnlineCalibrationSPDhandler::UnSetDeadPixelM(UInt_t module, UInt_t colM, UInt_t rowM) {
1262 // unset a dead pixel, returns false if pixel is not dead
1263 UInt_t eq = GetEqIdFromOffline(module);
1264 UInt_t hs = GetHSFromOffline(module);
1265 UInt_t chip = GetChipFromOffline(module,colM);
1266 UInt_t col = GetColFromOffline(module,colM);
1267 UInt_t row = GetRowFromOffline(module,rowM);
1268 return UnSetDeadPixel(eq,hs,chip,col,row);
1270 //____________________________________________________________________________________________
1271 Bool_t AliITSOnlineCalibrationSPDhandler::UnSetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t rowM) {
1272 // unset a noisy pixel, returns false if pixel is not noisy
1273 UInt_t eq = GetEqIdFromOffline(module);
1274 UInt_t hs = GetHSFromOffline(module);
1275 UInt_t chip = GetChipFromOffline(module,colM);
1276 UInt_t col = GetColFromOffline(module,colM);
1277 UInt_t row = GetRowFromOffline(module,rowM);
1278 return UnSetNoisyPixel(eq,hs,chip,col,row);
1280 //____________________________________________________________________________________________
1281 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBad(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
1282 // is the pixel bad (silent or noisy)
1283 return (IsPixelSilent(eq,hs,chip,col,row) || IsPixelNoisy(eq,hs,chip,col,row));
1285 //____________________________________________________________________________________________
1286 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilent(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
1287 // is the pixel silent (dead or inactive)?
1288 UInt_t gloChip = GetGloChip(eq,hs,chip);
1289 if (gloChip>=1200 || col>=32 || row>=256) {
1290 Error("AliITSOnlineCalibrationSPDhandler::IsPixelSilent", "eq,hs,chip,col,row nrs (%d,%d,%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
1293 if (IsSilentChip(eq,hs,chip)) return kTRUE;
1294 else return IsPixelDead(eq,hs,chip,col,row);
1296 //____________________________________________________________________________________________
1297 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelDead(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
1298 // is the pixel dead?
1299 UInt_t gloChip = GetGloChip(eq,hs,chip);
1300 if (gloChip>=1200 || col>=32 || row>=256) {
1301 Error("AliITSOnlineCalibrationSPDhandler::IsPixelDead", "eq,hs,chip,col,row nrs (%d,%d,%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
1304 UInt_t key = GetKey(eq,hs,chip,col,row);
1305 if (IsDeadEq(eq) || IsDeadHS(eq,hs) || IsDeadChip(eq,hs,chip)) return kTRUE;
1307 if ( fDeadPixelMap[gloChip]->Find(key) != NULL ) return kTRUE;
1311 //____________________________________________________________________________________________
1312 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisy(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
1313 // is the pixel noisy?
1314 UInt_t gloChip = GetGloChip(eq,hs,chip);
1315 if (gloChip>=1200 || col>=32 || row>=256) {
1316 Error("AliITSOnlineCalibrationSPDhandler::IsPixelNoisy", "eq,hs,chip,col,row nrs (%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
1319 UInt_t key = GetKey(eq,hs,chip,col,row);
1320 if ( fNoisyPixelMap[gloChip]->Find(key) != NULL ) return kTRUE;
1323 //____________________________________________________________________________________________
1324 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBadM(UInt_t module, UInt_t colM, UInt_t rowM) const {
1325 // is the pixel bad (silent or noisy)?
1326 return (IsPixelSilentM(module,colM,rowM) || IsPixelNoisyM(module,colM,rowM));
1328 //____________________________________________________________________________________________
1329 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilentM(UInt_t module, UInt_t colM, UInt_t rowM) const {
1330 // is the pixel silent (dead or inactive)?
1331 UInt_t eq = GetEqIdFromOffline(module);
1332 UInt_t hs = GetHSFromOffline(module);
1333 UInt_t chip = GetChipFromOffline(module,colM);
1334 UInt_t col = GetColFromOffline(module,colM);
1335 UInt_t row = GetRowFromOffline(module,rowM);
1336 return IsPixelSilent(eq,hs,chip,col,row);
1338 //____________________________________________________________________________________________
1339 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelDeadM(UInt_t module, UInt_t colM, UInt_t rowM) const {
1340 // is the pixel dead?
1341 UInt_t eq = GetEqIdFromOffline(module);
1342 UInt_t hs = GetHSFromOffline(module);
1343 UInt_t chip = GetChipFromOffline(module,colM);
1344 UInt_t col = GetColFromOffline(module,colM);
1345 UInt_t row = GetRowFromOffline(module,rowM);
1346 return IsPixelDead(eq,hs,chip,col,row);
1348 //____________________________________________________________________________________________
1349 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisyM(UInt_t module, UInt_t colM, UInt_t rowM) const {
1350 // is the pixel noisy?
1351 UInt_t eq = GetEqIdFromOffline(module);
1352 UInt_t hs = GetHSFromOffline(module);
1353 UInt_t chip = GetChipFromOffline(module,colM);
1354 UInt_t col = GetColFromOffline(module,colM);
1355 UInt_t row = GetRowFromOffline(module,rowM);
1356 return IsPixelNoisy(eq,hs,chip,col,row);
1358 //____________________________________________________________________________________________
1359 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBadKey(Int_t key) const {
1360 // is this pixel silent (dead or inactive)?
1361 UInt_t eq = GetEqIdFromKey(key);
1362 UInt_t hs = GetHSFromKey(key);
1363 UInt_t chip = GetChipFromKey(key);
1364 UInt_t col = GetColFromKey(key);
1365 UInt_t row = GetRowFromKey(key);
1366 return IsPixelBad(eq,hs,chip,col,row);
1368 //____________________________________________________________________________________________
1369 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilentKey(Int_t key) const {
1370 // is this pixel silent (dead or inactive)?
1371 UInt_t eq = GetEqIdFromKey(key);
1372 UInt_t hs = GetHSFromKey(key);
1373 UInt_t chip = GetChipFromKey(key);
1374 UInt_t col = GetColFromKey(key);
1375 UInt_t row = GetRowFromKey(key);
1376 return IsPixelSilent(eq,hs,chip,col,row);
1378 //____________________________________________________________________________________________
1379 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelDeadKey(Int_t key) const {
1380 // is this pixel dead?
1381 UInt_t eq = GetEqIdFromKey(key);
1382 UInt_t hs = GetHSFromKey(key);
1383 UInt_t chip = GetChipFromKey(key);
1384 UInt_t col = GetColFromKey(key);
1385 UInt_t row = GetRowFromKey(key);
1386 return IsPixelDead(eq,hs,chip,col,row);
1388 //____________________________________________________________________________________________
1389 Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisyKey(Int_t key) const {
1390 // is this pixel noisy?
1391 UInt_t eq = GetEqIdFromKey(key);
1392 UInt_t hs = GetHSFromKey(key);
1393 UInt_t chip = GetChipFromKey(key);
1394 UInt_t col = GetColFromKey(key);
1395 UInt_t row = GetRowFromKey(key);
1396 return IsPixelNoisy(eq,hs,chip,col,row);
1398 //____________________________________________________________________________________________
1399 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBad() const {
1400 // returns the total nr of bad pixels (silent or noisy)
1402 nrBad+=GetNrSilent();
1403 UInt_t nrNoisy = GetNrNoisy();
1404 for (UInt_t i=0; i<nrNoisy; i++) {
1405 UInt_t eq = GetNoisyEqIdAt(i);
1406 UInt_t hs = GetNoisyHSAt(i);
1407 UInt_t chip = GetNoisyChipAt(i);
1408 UInt_t col = GetNoisyColAt(i);
1409 UInt_t row = GetNoisyRowAt(i);
1410 if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
1414 //____________________________________________________________________________________________
1415 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilent() const {
1416 // returns the total nr of silent pixels (dead or inactive)
1418 for (UInt_t eq=0; eq<20; eq++) {
1419 if (IsSilentEq(eq)) {
1423 for (UInt_t hs=0; hs<6; hs++) {
1424 if (IsSilentHS(eq,hs)) {
1428 for (UInt_t chip=0; chip<10; chip++) {
1429 if (IsSilentChip(eq,hs,chip)) {
1434 UInt_t gloChip = GetGloChip(eq,hs,chip);
1435 nrDead+=fNrDead[gloChip];
1442 //____________________________________________________________________________________________
1443 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDead() const {
1444 // returns the total nr of dead pixels
1446 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
1447 nrDead+=fNrDead[gloChip];
1451 //____________________________________________________________________________________________
1452 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisy() const {
1453 // returns the total nr of noisy pixels
1455 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
1456 nrNoisy+=fNrNoisy[gloChip];
1460 //____________________________________________________________________________________________
1461 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t index) const {
1462 // get eq for the dead pixel at position index in list of dead
1465 GetChipAndIndexTotDead(index,gloChip,chipIndex);
1466 return GetDeadEqIdAtC2(gloChip,chipIndex);
1468 //____________________________________________________________________________________________
1469 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t index) const {
1470 // get eq for the noisy pixel at position index in list of noisy
1473 GetChipAndIndexTotNoisy(index,gloChip,chipIndex);
1474 return GetNoisyEqIdAtC2(gloChip,chipIndex);
1476 //____________________________________________________________________________________________
1477 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t index) const {
1478 // get hs for the dead pixel at position index in list of dead
1481 GetChipAndIndexTotDead(index,gloChip,chipIndex);
1482 return GetDeadHSAtC2(gloChip,chipIndex);
1484 //____________________________________________________________________________________________
1485 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t index) const {
1486 // get hs for the noisy pixel at position index in list of noisy
1489 GetChipAndIndexTotNoisy(index,gloChip,chipIndex);
1490 return GetNoisyHSAtC2(gloChip,chipIndex);
1492 //____________________________________________________________________________________________
1493 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t index) const {
1494 // get chip for the dead pixel at position index in list of dead
1497 GetChipAndIndexTotDead(index,gloChip,chipIndex);
1498 return GetDeadChipAtC2(gloChip,chipIndex);
1500 //____________________________________________________________________________________________
1501 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t index) const {
1502 // get chip for the noisy pixel at position index in list of noisy
1505 GetChipAndIndexTotNoisy(index,gloChip,chipIndex);
1506 return GetNoisyChipAtC2(gloChip,chipIndex);
1508 //____________________________________________________________________________________________
1509 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t index) const {
1510 // get hs for the dead pixel at position index in list of dead
1513 GetChipAndIndexTotDead(index,gloChip,chipIndex);
1514 return GetDeadColAtC2(gloChip,chipIndex);
1516 //____________________________________________________________________________________________
1517 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t index) const {
1518 // get hs for the noisy pixel at position index in list of noisy
1521 GetChipAndIndexTotNoisy(index,gloChip,chipIndex);
1522 return GetNoisyColAtC2(gloChip,chipIndex);
1524 //____________________________________________________________________________________________
1525 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t index) const {
1526 // get hs for the dead pixel at position index in list of dead
1529 GetChipAndIndexTotDead(index,gloChip,chipIndex);
1530 return GetDeadRowAtC2(gloChip,chipIndex);
1532 //____________________________________________________________________________________________
1533 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t index) const {
1534 // get hs for the noisy pixel at position index in list of noisy
1537 GetChipAndIndexTotNoisy(index,gloChip,chipIndex);
1538 return GetNoisyRowAtC2(gloChip,chipIndex);
1540 //____________________________________________________________________________________________
1541 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBad(UInt_t module) const {
1542 // returns the number of bad pixels for a certain module (silent or noisy)
1544 nrBad+=GetNrSilent(module);
1545 UInt_t nrNoisy = GetNrNoisy(module);
1546 for (UInt_t i=0; i<nrNoisy; i++) {
1547 UInt_t eq = GetNoisyEqIdAt(module,i);
1548 UInt_t hs = GetNoisyHSAt(module,i);
1549 UInt_t chip = GetNoisyChipAt(module,i);
1550 UInt_t col = GetNoisyColAt(module,i);
1551 UInt_t row = GetNoisyRowAt(module,i);
1552 if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
1556 //____________________________________________________________________________________________
1557 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilent(UInt_t module) const {
1558 // returns the number of silent pixels for a certain module (dead or inactive)
1560 Error("AliITSOnlineCalibrationSPDhandler::GetNrSilent", "module nr (%d) out of bounds.",module);
1563 UInt_t nrSilent = 0;
1564 UInt_t eq = GetEqIdFromOffline(module);
1565 if (IsSilentEq(eq)) return 160*256;
1566 UInt_t hs = GetHSFromOffline(module);
1567 if (IsSilentHS(eq,hs)) return 160*256;
1568 for (UInt_t ch=0; ch<5; ch++) {
1569 UInt_t chip = GetChipFromOffline(module,ch*32);
1570 if (IsSilentChip(eq,hs,chip)) {
1574 UInt_t gloChip = GetGloChip(eq,hs,chip);
1575 nrSilent+=fNrDead[gloChip];
1580 //____________________________________________________________________________________________
1581 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDeadSingle(UInt_t module) const {
1582 // returns the number of single dead pixels (excluding the ones on silent chips) for a certain module
1584 Error("AliITSOnlineCalibrationSPDhandler::GetNrDeadSingle", "module nr (%d) out of bounds.",module);
1588 UInt_t eq = GetEqIdFromOffline(module);
1589 UInt_t hs = GetHSFromOffline(module);
1590 for (UInt_t ch=0; ch<5; ch++) {
1591 UInt_t chip = GetChipFromOffline(module,ch*32);
1592 if (!IsSilentChip(eq,hs,chip)) {
1593 UInt_t gloChip = GetGloChip(eq,hs,chip);
1594 nrDead+=fNrDead[gloChip];
1599 //____________________________________________________________________________________________
1600 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisySingle(UInt_t module) const {
1601 // returns the number of noisy pixels for a certain module
1602 return GetNrNoisy(module);
1604 //____________________________________________________________________________________________
1605 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDead(UInt_t module) const {
1606 // returns the number of dead pixels for a certain module
1608 Error("AliITSOnlineCalibrationSPDhandler::GetNrDead", "module nr (%d) out of bounds.",module);
1612 UInt_t eq = GetEqIdFromOffline(module);
1613 UInt_t hs = GetHSFromOffline(module);
1614 for (UInt_t ch=0; ch<5; ch++) {
1615 UInt_t gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
1616 nrDead+=fNrDead[gloChip];
1620 //____________________________________________________________________________________________
1621 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisy(UInt_t module) const {
1622 // returns the number of noisy pixels for a certain module
1624 Error("AliITSOnlineCalibrationSPDhandler::GetNrNoisy", "module nr (%d) out of bounds.",module);
1628 UInt_t eq = GetEqIdFromOffline(module);
1629 UInt_t hs = GetHSFromOffline(module);
1630 for (UInt_t ch=0; ch<5; ch++) {
1631 UInt_t gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
1632 nrNoisy+=fNrNoisy[gloChip];
1636 //____________________________________________________________________________________________
1637 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t module, UInt_t index) const {
1638 // get eq for the dead pixel at position index in list of dead
1641 GetChipAndIndexDead(module,index,gloChip,chipIndex);
1642 return GetDeadEqIdAtC2(gloChip,chipIndex);
1644 //____________________________________________________________________________________________
1645 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t module, UInt_t index) const {
1646 // get eq for the noisy pixel at position index in list of noisy
1649 GetChipAndIndexNoisy(module,index,gloChip,chipIndex);
1650 return GetNoisyEqIdAtC2(gloChip,chipIndex);
1652 //____________________________________________________________________________________________
1653 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t module, UInt_t index) const {
1654 // get hs for the dead pixel at position index in list of dead
1657 GetChipAndIndexDead(module,index,gloChip,chipIndex);
1658 return GetDeadHSAtC2(gloChip,chipIndex);
1660 //____________________________________________________________________________________________
1661 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t module, UInt_t index) const {
1662 // get hs for the noisy pixel at position index in list of noisy
1665 GetChipAndIndexNoisy(module,index,gloChip,chipIndex);
1666 return GetNoisyHSAtC2(gloChip,chipIndex);
1668 //____________________________________________________________________________________________
1669 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t module, UInt_t index) const {
1670 // get chip for the dead pixel at position index in list of dead
1673 GetChipAndIndexDead(module,index,gloChip,chipIndex);
1674 return GetDeadChipAtC2(gloChip,chipIndex);
1676 //____________________________________________________________________________________________
1677 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t module, UInt_t index) const {
1678 // get chip for the noisy pixel at position index in list of noisy
1681 GetChipAndIndexNoisy(module,index,gloChip,chipIndex);
1682 return GetNoisyChipAtC2(gloChip,chipIndex);
1684 //____________________________________________________________________________________________
1685 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t module, UInt_t index) const {
1686 // get hs for the dead pixel at position index in list of dead
1689 GetChipAndIndexDead(module,index,gloChip,chipIndex);
1690 return GetDeadColAtC2(gloChip,chipIndex);
1692 //____________________________________________________________________________________________
1693 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t module, UInt_t index) const {
1694 // get hs for the noisy pixel at position index in list of noisy
1697 GetChipAndIndexNoisy(module,index,gloChip,chipIndex);
1698 return GetNoisyColAtC2(gloChip,chipIndex);
1700 //____________________________________________________________________________________________
1701 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t module, UInt_t index) const {
1702 // get hs for the dead pixel at position index in list of dead
1705 GetChipAndIndexDead(module,index,gloChip,chipIndex);
1706 return GetDeadRowAtC2(gloChip,chipIndex);
1708 //____________________________________________________________________________________________
1709 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t module, UInt_t index) const {
1710 // get hs for the noisy pixel at position index in list of noisy
1713 GetChipAndIndexNoisy(module,index,gloChip,chipIndex);
1714 return GetNoisyRowAtC2(gloChip,chipIndex);
1716 //____________________________________________________________________________________________
1717 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBadEq(UInt_t eq) const {
1718 // returns nr of bad for eq (silent or noisy)
1720 nrBad+=GetNrSilentEq(eq);
1721 UInt_t nrNoisy = GetNrNoisy(eq);
1722 for (UInt_t i=0; i<nrNoisy; i++) {
1723 UInt_t hs = GetNoisyHSAtEq(eq,i);
1724 UInt_t chip = GetNoisyChipAtEq(eq,i);
1725 UInt_t col = GetNoisyColAtEq(eq,i);
1726 UInt_t row = GetNoisyRowAtEq(eq,i);
1727 if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
1731 //____________________________________________________________________________________________
1732 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilentEq(UInt_t eq) const {
1733 // returns nr of silent for eq (dead or inactive)
1735 if (IsSilentEq(eq)) return 81920*6;
1736 for (UInt_t hs=0; hs<6; hs++) {
1737 if (IsSilentHS(eq,hs)) {
1741 for (UInt_t chip=0; chip<10; chip++) {
1742 if (IsSilentChip(eq,hs,chip)) {
1747 returnval+=GetNrDeadC(eq,hs,chip);
1753 //____________________________________________________________________________________________
1754 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDeadEq(UInt_t eq) const {
1755 // returns nr of dead for eq
1757 for (UInt_t hs=0; hs<6; hs++) {
1758 for (UInt_t chip=0; chip<10; chip++) {
1759 returnval+=GetNrDeadC(eq,hs,chip);
1764 //____________________________________________________________________________________________
1765 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisyEq(UInt_t eq) const {
1766 // returns nr of noisy for eq
1768 for (UInt_t hs=0; hs<6; hs++) {
1769 for (UInt_t chip=0; chip<10; chip++) {
1770 returnval+=GetNrNoisyC(eq,hs,chip);
1775 //____________________________________________________________________________________________
1776 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAtEq(UInt_t eq, UInt_t index) const {
1777 // get eq for the dead pixel at position index in list of dead
1778 if (eq<20 && index<GetNrDeadEq(eq)) {
1785 //____________________________________________________________________________________________
1786 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAtEq(UInt_t eq, UInt_t index) const {
1787 // get eq for the noisy pixel at position index in list of noisy
1788 if (eq<20 && index<GetNrNoisyEq(eq)) {
1795 //____________________________________________________________________________________________
1796 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAtEq(UInt_t eq, UInt_t index) const {
1797 // get hs for the dead pixel at position index in list of dead
1800 GetChipAndIndexEqDead(eq,index,gloChip,chipIndex);
1801 return GetDeadHSAtC2(gloChip,chipIndex);
1803 //____________________________________________________________________________________________
1804 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtEq(UInt_t eq, UInt_t index) const {
1805 // get hs for the noisy pixel at position index in list of noisy
1808 GetChipAndIndexEqNoisy(eq,index,gloChip,chipIndex);
1809 return GetNoisyHSAtC2(gloChip,chipIndex);
1811 //____________________________________________________________________________________________
1812 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAtEq(UInt_t eq, UInt_t index) const {
1813 // get chip for the dead pixel at position index in list of dead
1816 GetChipAndIndexEqDead(eq,index,gloChip,chipIndex);
1817 return GetDeadChipAtC2(gloChip,chipIndex);
1819 //____________________________________________________________________________________________
1820 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtEq(UInt_t eq, UInt_t index) const {
1821 // get chip for the noisy pixel at position index in list of noisy
1824 GetChipAndIndexEqNoisy(eq,index,gloChip,chipIndex);
1825 return GetNoisyChipAtC2(gloChip,chipIndex);
1827 //____________________________________________________________________________________________
1828 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAtEq(UInt_t eq, UInt_t index) const {
1829 // get hs for the dead pixel at position index in list of dead
1832 GetChipAndIndexEqDead(eq,index,gloChip,chipIndex);
1833 return GetDeadColAtC2(gloChip,chipIndex);
1835 //____________________________________________________________________________________________
1836 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAtEq(UInt_t eq, UInt_t index) const {
1837 // get hs for the noisy pixel at position index in list of noisy
1840 GetChipAndIndexEqNoisy(eq,index,gloChip,chipIndex);
1841 return GetNoisyColAtC2(gloChip,chipIndex);
1843 //____________________________________________________________________________________________
1844 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAtEq(UInt_t eq, UInt_t index) const {
1845 // get hs for the dead pixel at position index in list of dead
1848 GetChipAndIndexEqDead(eq,index,gloChip,chipIndex);
1849 return GetDeadRowAtC2(gloChip,chipIndex);
1851 //____________________________________________________________________________________________
1852 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtEq(UInt_t eq, UInt_t index) const {
1853 // get hs for the noisy pixel at position index in list of noisy
1856 GetChipAndIndexEqNoisy(eq,index,gloChip,chipIndex);
1857 return GetNoisyRowAtC2(gloChip,chipIndex);
1859 //____________________________________________________________________________________________
1860 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBadC(UInt_t eq, UInt_t hs, UInt_t chip) const {
1861 // returns nr of bad for chip (silent or noisy)
1863 nrBad+=GetNrSilentC(eq,hs,chip);
1864 UInt_t nrNoisy = GetNrNoisyC(eq,hs,chip);
1865 for (UInt_t i=0; i<nrNoisy; i++) {
1866 UInt_t col = GetNoisyColAtC(eq,hs,chip,i);
1867 UInt_t row = GetNoisyRowAtC(eq,hs,chip,i);
1868 if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
1872 //____________________________________________________________________________________________
1873 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilentC(UInt_t eq, UInt_t hs, UInt_t chip) const {
1874 // returns nr of silent for chip (dead or inactive)
1875 if (IsSilentChip(eq,hs,chip)) return 8192;
1876 else return GetNrDeadC(eq,hs,chip);
1878 //____________________________________________________________________________________________
1879 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDeadC(UInt_t eq, UInt_t hs, UInt_t chip) const {
1880 // returns nr of dead for chip
1881 UInt_t gloChip = GetGloChip(eq,hs,chip);
1882 return GetNrDeadC2(gloChip);
1884 //____________________________________________________________________________________________
1885 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisyC(UInt_t eq, UInt_t hs, UInt_t chip) const {
1886 // returns nr of noisy for chip
1887 UInt_t gloChip = GetGloChip(eq,hs,chip);
1888 return GetNrNoisyC2(gloChip);
1890 //____________________________________________________________________________________________
1891 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1892 UInt_t gloChip = GetGloChip(eq,hs,chip);
1893 return GetDeadEqIdAtC2(gloChip,index);
1895 //____________________________________________________________________________________________
1896 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1897 UInt_t gloChip = GetGloChip(eq,hs,chip);
1898 return GetNoisyEqIdAtC2(gloChip,index);
1900 //____________________________________________________________________________________________
1901 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1902 UInt_t gloChip = GetGloChip(eq,hs,chip);
1903 return GetDeadHSAtC2(gloChip,index);
1905 //____________________________________________________________________________________________
1906 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1907 UInt_t gloChip = GetGloChip(eq,hs,chip);
1908 return GetNoisyHSAtC2(gloChip,index);
1910 //____________________________________________________________________________________________
1911 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1912 UInt_t gloChip = GetGloChip(eq,hs,chip);
1913 return GetDeadChipAtC2(gloChip,index);
1915 //____________________________________________________________________________________________
1916 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1917 UInt_t gloChip = GetGloChip(eq,hs,chip);
1918 return GetNoisyChipAtC2(gloChip,index);
1920 //____________________________________________________________________________________________
1921 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1922 UInt_t gloChip = GetGloChip(eq,hs,chip);
1923 return GetDeadColAtC2(gloChip,index);
1925 //____________________________________________________________________________________________
1926 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1927 UInt_t gloChip = GetGloChip(eq,hs,chip);
1928 return GetNoisyColAtC2(gloChip,index);
1930 //____________________________________________________________________________________________
1931 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1932 UInt_t gloChip = GetGloChip(eq,hs,chip);
1933 return GetDeadRowAtC2(gloChip,index);
1935 //____________________________________________________________________________________________
1936 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1937 UInt_t gloChip = GetGloChip(eq,hs,chip);
1938 return GetNoisyRowAtC2(gloChip,index);
1940 //____________________________________________________________________________________________
1941 const Char_t* AliITSOnlineCalibrationSPDhandler::GetDeadPixelAsTextC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1942 // get a string of dead pixel info
1943 TString returnMess = "";
1944 UInt_t gloChip = GetGloChip(eq,hs,chip);
1945 if (gloChip>=1200) {
1946 Error("AliITSOnlineCalibrationSPDhandler::GetDeadPixelAsTextC", "global chip nr (%d) out of bounds.",gloChip);
1947 return returnMess.Data();
1949 if (index<fNrDead[gloChip]) {
1950 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
1951 UInt_t col = GetColFromKey(key);
1952 UInt_t row = GetRowFromKey(key);
1953 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1954 UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
1955 UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
1956 returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
1957 return returnMess.Data();
1960 Error("AliITSOnlineCalibrationSPDhandler::GetDeadPixelAsTextC", "Index %d out of bounds.", index);
1961 return returnMess.Data();
1964 //____________________________________________________________________________________________
1965 const Char_t* AliITSOnlineCalibrationSPDhandler::GetNoisyPixelAsTextC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const {
1966 // get a string of noisy pixel info
1967 TString returnMess = "";
1968 UInt_t gloChip = GetGloChip(eq,hs,chip);
1969 if (gloChip>=1200) {
1970 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyPixelAsTextC", "global chip nr (%d) out of bounds.",gloChip);
1971 return returnMess.Data();
1973 if (index<fNrNoisy[gloChip]) {
1974 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
1975 UInt_t col = GetColFromKey(key);
1976 UInt_t row = GetRowFromKey(key);
1977 UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
1978 UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
1979 UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
1980 returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
1981 return returnMess.Data();
1984 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyPixelAsTextC", "Index %d out of bounds.", index);
1985 return returnMess.Data();
1988 //____________________________________________________________________________________________
1989 UInt_t AliITSOnlineCalibrationSPDhandler::AddSilentFrom(AliITSOnlineCalibrationSPDhandler* other) {
1990 // returns number of new silent pixels in this' list (dead or inactive)
1991 UInt_t tmpdead = GetNrSilent();
1993 for (UInt_t eq=0; eq<20; eq++) {
1994 if (!(other->IsActiveEq(eq))) ActivateEq(eq,kFALSE);
1995 if (other->IsDeadEq(eq)) SetDeadEq(eq,kTRUE);
1996 for (UInt_t hs=0; hs<6; hs++) {
1997 if (!(other->IsActiveHS(eq,hs))) ActivateHS(eq,hs,kFALSE);
1998 if (other->IsDeadHS(eq,hs)) SetDeadHS(eq,hs,kTRUE);
1999 for (UInt_t chip=0; chip<10; chip++) {
2000 if (!(other->IsActiveChip(eq,hs,chip))) ActivateChip(eq,hs,chip,kFALSE);
2001 if (other->IsDeadChip(eq,hs,chip)) SetDeadChip(eq,hs,chip,kTRUE);
2008 return GetNrSilent() - tmpdead;
2010 //____________________________________________________________________________________________
2011 UInt_t AliITSOnlineCalibrationSPDhandler::AddDeadFrom(AliITSOnlineCalibrationSPDhandler* other) {
2012 // returns number of new dead pixels in this' list
2014 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2015 for (UInt_t ind1=0; ind1<other->fNrDead[gloChip]; ind1++) {
2016 UInt_t eq = other->GetDeadEqIdAtC2(gloChip,ind1);
2017 UInt_t hs = other->GetDeadHSAtC2(gloChip,ind1);
2018 UInt_t chip = other->GetDeadChipAtC2(gloChip,ind1);
2019 UInt_t col = other->GetDeadColAtC2(gloChip,ind1);
2020 UInt_t row = other->GetDeadRowAtC2(gloChip,ind1);
2021 if (SetDeadPixel(eq,hs,chip,col,row)) {
2028 //____________________________________________________________________________________________
2029 UInt_t AliITSOnlineCalibrationSPDhandler::AddNoisyFrom(AliITSOnlineCalibrationSPDhandler* other) {
2030 // returns number of new noisy pixels in this' list
2032 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2033 for (UInt_t ind1=0; ind1<other->fNrNoisy[gloChip]; ind1++) {
2034 UInt_t eq = other->GetNoisyEqIdAtC2(gloChip,ind1);
2035 UInt_t hs = other->GetNoisyHSAtC2(gloChip,ind1);
2036 UInt_t chip = other->GetNoisyChipAtC2(gloChip,ind1);
2037 UInt_t col = other->GetNoisyColAtC2(gloChip,ind1);
2038 UInt_t row = other->GetNoisyRowAtC2(gloChip,ind1);
2039 if (SetNoisyPixel(eq,hs,chip,col,row)) {
2046 //____________________________________________________________________________________________
2047 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2048 // returns nr of dead/noisy in this' lists and not in other's lists (including inactive)
2049 return GetNrSilentDiff(other) + GetNrNoisyDiff(other);
2051 //____________________________________________________________________________________________
2052 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilentDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2053 // returns nr of single silent pixels in this' lists and not in other's lists (dead or inactive)
2055 for (UInt_t eq=0; eq<20; eq++) {
2056 for (UInt_t hs=0; hs<6; hs++) {
2057 for (UInt_t chip=0; chip<10; chip++) {
2058 if (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs) || !IsActiveChip(eq,hs,chip) || IsDeadChip(eq,hs,chip)) {
2059 if (other->IsActiveEq(eq) && !other->IsDeadEq(eq) && other->IsActiveHS(eq,hs) && !other->IsDeadHS(eq,hs) && other->IsActiveChip(eq,hs,chip) && !other->IsDeadChip(eq,hs,chip)) {
2060 // if this is inactive and the other is active...
2061 returnval+= 8192 - other->GetNrDeadC(eq,hs,chip);
2065 UInt_t gloChip = GetGloChip(eq,hs,chip);
2066 for (UInt_t ind1=0; ind1<fNrDead[gloChip]; ind1++) {
2067 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(ind1);
2068 UInt_t col = GetColFromKey(key);
2069 UInt_t row = GetRowFromKey(key);
2070 if (!(other->IsPixelSilent(eq,hs,chip,col,row))) {
2080 //____________________________________________________________________________________________
2081 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDeadDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2082 // returns nr of dead in this' lists and not in other's lists
2084 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2085 for (UInt_t ind1=0; ind1<fNrDead[gloChip]; ind1++) {
2086 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(ind1);
2087 UInt_t eq = GetEqIdFromKey(key);
2088 UInt_t hs = GetHSFromKey(key);
2089 UInt_t chip = GetChipFromKey(key);
2090 UInt_t col = GetColFromKey(key);
2091 UInt_t row = GetRowFromKey(key);
2092 if (!(other->IsPixelDead(eq,hs,chip,col,row))) {
2099 //____________________________________________________________________________________________
2100 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisyDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2101 // returns nr of noisy in this' lists and not in other's lists
2103 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2104 for (UInt_t ind1=0; ind1<fNrNoisy[gloChip]; ind1++) {
2105 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(ind1);
2106 UInt_t eq = GetEqIdFromKey(key);
2107 UInt_t hs = GetHSFromKey(key);
2108 UInt_t chip = GetChipFromKey(key);
2109 UInt_t col = GetColFromKey(key);
2110 UInt_t row = GetRowFromKey(key);
2111 if (!(other->IsPixelNoisy(eq,hs,chip,col,row))) {
2118 //____________________________________________________________________________________________
2119 AliITSOnlineCalibrationSPDhandler* AliITSOnlineCalibrationSPDhandler::GetDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2120 // returns handler with active/dead/noisy in this' lists, removing those that are in other's lists
2121 AliITSOnlineCalibrationSPDhandler* newHandler = new AliITSOnlineCalibrationSPDhandler();
2123 for (UInt_t eq=0; eq<20; eq++) {
2124 if (!(IsActiveEq(eq))) {
2125 newHandler->ActivateEq(eq,kFALSE);
2126 if (!other->IsActiveEq(eq)) newHandler->ActivateEq(eq);
2129 newHandler->SetDeadEq(eq);
2130 if (other->IsDeadEq(eq)) newHandler->SetDeadEq(eq,kFALSE);
2132 for (UInt_t hs=0; hs<6; hs++) {
2133 if (!(IsActiveHS(eq,hs))) {
2134 newHandler->ActivateHS(eq,hs,kFALSE);
2135 if (!other->IsActiveHS(eq,hs)) newHandler->ActivateHS(eq,hs);
2137 if (IsDeadHS(eq,hs)) {
2138 newHandler->SetDeadHS(eq,hs);
2139 if (other->IsDeadHS(eq,hs)) newHandler->SetDeadHS(eq,hs,kFALSE);
2141 for (UInt_t chip=0; chip<10; chip++) {
2142 if (!(IsActiveChip(eq,hs,chip))) {
2143 newHandler->ActivateChip(eq,hs,chip,kFALSE);
2144 if (!other->IsActiveChip(eq,hs,chip)) newHandler->ActivateHS(eq,hs,chip);
2146 if (IsDeadChip(eq,hs,chip)) {
2147 newHandler->SetDeadChip(eq,hs,chip);
2148 if (other->IsDeadChip(eq,hs,chip)) newHandler->SetDeadChip(eq,hs,chip,kFALSE);
2154 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2155 for (UInt_t ind1=0; ind1<fNrDead[gloChip]; ind1++) {
2156 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(ind1);
2157 UInt_t eq = GetEqIdFromKey(key);
2158 UInt_t hs = GetHSFromKey(key);
2159 UInt_t chip = GetChipFromKey(key);
2160 UInt_t col = GetColFromKey(key);
2161 UInt_t row = GetRowFromKey(key);
2162 if (!(other->IsPixelDead(eq,hs,chip,col,row))) {
2163 newHandler->SetDeadPixel(eq,hs,chip,col,row);
2168 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2169 for (UInt_t ind2=0; ind2<fNrNoisy[gloChip]; ind2++) {
2170 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(ind2);
2171 UInt_t eq = GetEqIdFromKey(key);
2172 UInt_t hs = GetHSFromKey(key);
2173 UInt_t chip = GetChipFromKey(key);
2174 UInt_t col = GetColFromKey(key);
2175 UInt_t row = GetRowFromKey(key);
2176 if (!(other->IsPixelNoisy(eq,hs,chip,col,row))) {
2177 newHandler->SetNoisyPixel(eq,hs,chip,col,row);
2184 //____________________________________________________________________________________________
2185 AliITSOnlineCalibrationSPDhandler* AliITSOnlineCalibrationSPDhandler::GetSilentDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2186 // returns handler with active/dead in this' lists, removing those that are in other's lists
2187 AliITSOnlineCalibrationSPDhandler* newHandler = new AliITSOnlineCalibrationSPDhandler();
2189 for (UInt_t eq=0; eq<20; eq++) {
2190 if (!(IsActiveEq(eq))) {
2191 newHandler->ActivateEq(eq,kFALSE);
2192 if (!other->IsActiveEq(eq)) newHandler->ActivateEq(eq);
2195 newHandler->SetDeadEq(eq);
2196 if (other->IsDeadEq(eq)) newHandler->SetDeadEq(eq,kFALSE);
2198 for (UInt_t hs=0; hs<6; hs++) {
2199 if (!(IsActiveHS(eq,hs))) {
2200 newHandler->ActivateHS(eq,hs,kFALSE);
2201 if (!other->IsActiveHS(eq,hs)) newHandler->ActivateHS(eq,hs);
2203 if (IsDeadHS(eq,hs)) {
2204 newHandler->SetDeadHS(eq,hs);
2205 if (other->IsDeadHS(eq,hs)) newHandler->SetDeadHS(eq,hs,kFALSE);
2207 for (UInt_t chip=0; chip<10; chip++) {
2208 if (!(IsActiveChip(eq,hs,chip))) {
2209 newHandler->ActivateChip(eq,hs,chip,kFALSE);
2210 if (!other->IsActiveChip(eq,hs,chip)) newHandler->ActivateHS(eq,hs,chip);
2212 if (IsDeadChip(eq,hs,chip)) {
2213 newHandler->SetDeadChip(eq,hs,chip);
2214 if (other->IsDeadChip(eq,hs,chip)) newHandler->SetDeadChip(eq,hs,chip,kFALSE);
2220 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2221 for (UInt_t ind1=0; ind1<fNrDead[gloChip]; ind1++) {
2222 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(ind1);
2223 UInt_t eq = GetEqIdFromKey(key);
2224 UInt_t hs = GetHSFromKey(key);
2225 UInt_t chip = GetChipFromKey(key);
2226 UInt_t col = GetColFromKey(key);
2227 UInt_t row = GetRowFromKey(key);
2228 if (!(other->IsPixelDead(eq,hs,chip,col,row))) {
2229 newHandler->SetDeadPixel(eq,hs,chip,col,row);
2236 //____________________________________________________________________________________________
2237 AliITSOnlineCalibrationSPDhandler* AliITSOnlineCalibrationSPDhandler::GetDeadDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2238 // returns handler with dead in this' lists, except for those in other's lists
2239 AliITSOnlineCalibrationSPDhandler* newHandler = new AliITSOnlineCalibrationSPDhandler();
2240 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2241 for (UInt_t ind1=0; ind1<fNrDead[gloChip]; ind1++) {
2242 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(ind1);
2243 UInt_t eq = GetEqIdFromKey(key);
2244 UInt_t hs = GetHSFromKey(key);
2245 UInt_t chip = GetChipFromKey(key);
2246 UInt_t col = GetColFromKey(key);
2247 UInt_t row = GetRowFromKey(key);
2248 if (!(other->IsPixelDead(eq,hs,chip,col,row))) {
2249 newHandler->SetDeadPixel(eq,hs,chip,col,row);
2255 //____________________________________________________________________________________________
2256 AliITSOnlineCalibrationSPDhandler* AliITSOnlineCalibrationSPDhandler::GetNoisyDiff(AliITSOnlineCalibrationSPDhandler* other) const {
2257 // returns handler with noisy in this' lists, except for those in other's lists
2258 AliITSOnlineCalibrationSPDhandler* newHandler = new AliITSOnlineCalibrationSPDhandler();
2259 for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
2260 for (UInt_t ind2=0; ind2<fNrNoisy[gloChip]; ind2++) {
2261 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(ind2);
2262 UInt_t eq = GetEqIdFromKey(key);
2263 UInt_t hs = GetHSFromKey(key);
2264 UInt_t chip = GetChipFromKey(key);
2265 UInt_t col = GetColFromKey(key);
2266 UInt_t row = GetRowFromKey(key);
2267 if (!(other->IsPixelNoisy(eq,hs,chip,col,row))) {
2268 newHandler->SetNoisyPixel(eq,hs,chip,col,row);
2274 //____________________________________________________________________________________________
2275 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexDead(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2276 // find gloChip and chipIndex from module and index
2277 if (index<GetNrDead(module)) {
2278 UInt_t eq = GetEqIdFromOffline(module);
2279 UInt_t hs = GetHSFromOffline(module);
2282 for (UInt_t ch=0; ch<5; ch++) {
2283 gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
2284 if (glVal+fNrDead[gloChip]>index) {
2285 chipIndex = index-glVal;
2289 glVal+=fNrDead[gloChip];
2295 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexDead", "Index %d out of bounds.", index);
2298 //____________________________________________________________________________________________
2299 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexNoisy(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2300 // find gloChip and chipIndex from module and index
2301 if (index<GetNrNoisy(module)) {
2302 UInt_t eq = GetEqIdFromOffline(module);
2303 UInt_t hs = GetHSFromOffline(module);
2306 for (UInt_t ch=0; ch<5; ch++) {
2307 gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
2308 if (glVal+fNrNoisy[gloChip]>index) {
2309 chipIndex = index-glVal;
2313 glVal+=fNrNoisy[gloChip];
2319 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexNoisy", "Index %d out of bounds.", index);
2322 //____________________________________________________________________________________________
2323 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqDead(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2324 // find gloChip and chipIndex from module and index
2325 if (index<GetNrDeadEq(eq)) {
2328 for (UInt_t hs=0; hs<6; hs++) {
2329 for (UInt_t chip=0; chip<10; chip++) {
2330 gloChip = GetGloChip(eq,hs,chip);
2331 if (glVal+fNrDead[gloChip]>index) {
2332 chipIndex = index-glVal;
2336 glVal+=fNrDead[gloChip];
2343 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqDead", "Index %d out of bounds.", index);
2346 //____________________________________________________________________________________________
2347 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqNoisy(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2348 // find gloChip and chipIndex from module and index
2349 if (index<GetNrNoisyEq(eq)) {
2352 for (UInt_t hs=0; hs<6; hs++) {
2353 for (UInt_t chip=0; chip<10; chip++) {
2354 gloChip = GetGloChip(eq,hs,chip);
2355 if (glVal+fNrNoisy[gloChip]>index) {
2356 chipIndex = index-glVal;
2360 glVal+=fNrNoisy[gloChip];
2367 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqNoisy", "Index %d out of bounds.", index);
2370 //____________________________________________________________________________________________
2371 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotDead(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2372 // find gloChip and chipIndex from global index
2373 if (index<GetNrDead()) {
2376 for (gloChip=0; gloChip<1200; gloChip++) {
2377 if (glVal+fNrDead[gloChip]>index) {
2378 chipIndex = index-glVal;
2382 glVal+=fNrDead[gloChip];
2388 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotDead", "Index %d out of bounds.", index);
2391 //____________________________________________________________________________________________
2392 void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotNoisy(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
2393 // find gloChip and chipIndex from global index
2394 if (index<GetNrNoisy()) {
2397 for (gloChip=0; gloChip<1200; gloChip++) {
2398 if (glVal+fNrNoisy[gloChip]>index) {
2399 chipIndex = index-glVal;
2403 glVal+=fNrNoisy[gloChip];
2409 Error("AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotNoisy", "Index %d out of bounds.", index);
2412 //____________________________________________________________________________________________
2413 UInt_t AliITSOnlineCalibrationSPDhandler::GetEqIdFromOffline(UInt_t module) const {
2414 // module to eq mapping
2416 Error("AliITSOnlineCalibrationSPDhandler::GetEqIdFromOffline", "module nr (%d) out of bounds.",module);
2419 return AliITSRawStreamSPD::GetOnlineEqIdFromOffline(module);
2421 //____________________________________________________________________________________________
2422 UInt_t AliITSOnlineCalibrationSPDhandler::GetHSFromOffline(UInt_t module) const {
2423 // module to hs mapping
2425 Error("AliITSOnlineCalibrationSPDhandler::GetHSFromOffline", "module nr (%d) out of bounds.",module);
2428 return AliITSRawStreamSPD::GetOnlineHSFromOffline(module);
2430 //____________________________________________________________________________________________
2431 UInt_t AliITSOnlineCalibrationSPDhandler::GetChipFromOffline(UInt_t module, UInt_t colM) const {
2432 // module,colM to chip mapping
2433 if (module>=240 || colM>=160) {
2434 Error("AliITSOnlineCalibrationSPDhandler::GetChipFromOffline", "module,colM nrs (%d,%d) out of bounds.",module,colM);
2437 return AliITSRawStreamSPD::GetOnlineChipFromOffline(module,colM);
2439 //____________________________________________________________________________________________
2440 UInt_t AliITSOnlineCalibrationSPDhandler::GetColFromOffline(UInt_t module, UInt_t colM) const {
2441 // colM to col mapping
2443 Error("AliITSOnlineCalibrationSPDhandler::GetColFromOffline", "colM nr (%d) out of bounds.",colM);
2446 return AliITSRawStreamSPD::GetOnlineColFromOffline(module,colM);
2448 //____________________________________________________________________________________________
2449 UInt_t AliITSOnlineCalibrationSPDhandler::GetRowFromOffline(UInt_t module, UInt_t rowM) const {
2450 // rowM to row mapping
2452 Error("AliITSOnlineCalibrationSPDhandler::GetRowFromOffline", "rowM nr (%d) out of bounds.",rowM);
2455 return AliITSRawStreamSPD::GetOnlineRowFromOffline(module,rowM);
2457 //____________________________________________________________________________________________
2458 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrDeadC2(UInt_t gloChip) const {
2459 // returns nr of dead pixels on this chip
2460 if (gloChip>=1200) {
2461 Error("AliITSOnlineCalibrationSPDhandler::GetNrDeadC2", "global chip nr (%d) out of bounds.",gloChip);
2464 return fNrDead[gloChip];
2466 //____________________________________________________________________________________________
2467 UInt_t AliITSOnlineCalibrationSPDhandler::GetNrNoisyC2(UInt_t gloChip) const {
2468 // returns nr of noisy pixels on this chip
2469 if (gloChip>=1200) {
2470 Error("AliITSOnlineCalibrationSPDhandler::GetNrNoisyC2", "global chip nr (%d) out of bounds.",gloChip);
2473 return fNrNoisy[gloChip];
2475 //____________________________________________________________________________________________
2476 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAtC2(UInt_t gloChip, UInt_t index) const {
2477 // get eq for the dead pixel at position index in list of dead
2478 if (gloChip>=1200) {
2479 Error("AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAtC", "global chip nr (%d) out of bounds.",gloChip);
2482 if (index<fNrDead[gloChip]) {
2483 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
2484 return GetEqIdFromKey(key);
2487 Error("AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAtC", "Index %d out of bounds.", index);
2491 //____________________________________________________________________________________________
2492 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAtC2(UInt_t gloChip, UInt_t index) const {
2493 // get eq for the noisy pixel at position index in list of noisy
2494 if (gloChip>=1200) {
2495 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAtC", "global chip nr (%d) out of bounds.",gloChip);
2498 if (index<fNrNoisy[gloChip]) {
2499 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
2500 return GetEqIdFromKey(key);
2503 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAtC", "Index %d out of bounds.", index);
2507 //____________________________________________________________________________________________
2508 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAtC2(UInt_t gloChip, UInt_t index) const {
2509 // get hs for the dead pixel at position index in list of dead
2510 if (gloChip>=1200) {
2511 Error("AliITSOnlineCalibrationSPDhandler::GetDeadHSAtC", "global chip nr (%d) out of bounds.",gloChip);
2514 if (index<fNrDead[gloChip]) {
2515 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
2516 return GetHSFromKey(key);
2519 Error("AliITSOnlineCalibrationSPDhandler::GetDeadHSAtC", "Index %d out of bounds.", index);
2523 //____________________________________________________________________________________________
2524 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtC2(UInt_t gloChip, UInt_t index) const {
2525 // get hs for the noisy pixel at position index in list of noisy
2526 if (gloChip>=1200) {
2527 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtC", "global chip nr (%d) out of bounds.",gloChip);
2530 if (index<fNrNoisy[gloChip]) {
2531 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
2532 return GetHSFromKey(key);
2535 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtC", "Index %d out of bounds.", index);
2539 //____________________________________________________________________________________________
2540 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAtC2(UInt_t gloChip, UInt_t index) const {
2541 // get chip for the dead pixel at position index in list of dead
2542 if (gloChip>=1200) {
2543 Error("AliITSOnlineCalibrationSPDhandler::GetDeadChipAtC", "global chip nr (%d) out of bounds.",gloChip);
2546 if (index<fNrDead[gloChip]) {
2547 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
2548 return GetChipFromKey(key);
2551 Error("AliITSOnlineCalibrationSPDhandler::GetDeadChipAtC", "Index %d out of bounds.", index);
2555 //____________________________________________________________________________________________
2556 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtC2(UInt_t gloChip, UInt_t index) const {
2557 // get chip for the noisy pixel at position index in list of noisy
2558 if (gloChip>=1200) {
2559 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtC", "global chip nr (%d) out of bounds.",gloChip);
2562 if (index<fNrNoisy[gloChip]) {
2563 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
2564 return GetChipFromKey(key);
2567 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtC", "Index %d out of bounds.", index);
2571 //____________________________________________________________________________________________
2572 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAtC2(UInt_t gloChip, UInt_t index) const {
2573 // get col for the dead pixel at position index in list of dead
2574 if (gloChip>=1200) {
2575 Error("AliITSOnlineCalibrationSPDhandler::GetDeadColAtC2", "global chip nr (%d) out of bounds.",gloChip);
2578 if (index<fNrDead[gloChip]) {
2579 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
2580 return GetColFromKey(key);
2583 Error("AliITSOnlineCalibrationSPDhandler::GetDeadColAtC2", "Index %d out of bounds.", index);
2587 //____________________________________________________________________________________________
2588 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAtC2(UInt_t gloChip, UInt_t index) const {
2589 // get col for the noisy pixel at position index in list of noisy
2590 if (gloChip>=1200) {
2591 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyColAtC", "global chip nr (%d) out of bounds.",gloChip);
2594 if (index<fNrNoisy[gloChip]) {
2595 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
2596 return GetColFromKey(key);
2599 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyColAtC", "Index %d out of bounds.", index);
2603 //____________________________________________________________________________________________
2604 UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAtC2(UInt_t gloChip, UInt_t index) const {
2605 // get row for the dead pixel at position index in list of dead
2606 if (gloChip>=1200) {
2607 Error("AliITSOnlineCalibrationSPDhandler::GetDeadRowAtC", "global chip nr (%d) out of bounds.",gloChip);
2610 if (index<fNrDead[gloChip]) {
2611 Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
2612 return GetRowFromKey(key);
2615 Error("AliITSOnlineCalibrationSPDhandler::GetDeadRowAtC", "Index %d out of bounds.", index);
2619 //____________________________________________________________________________________________
2620 UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtC2(UInt_t gloChip, UInt_t index) const {
2621 // get row for the noisy pixel at position index in list of noisy
2622 if (gloChip>=1200) {
2623 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtC", "global chip nr (%d) out of bounds.",gloChip);
2626 if (index<fNrNoisy[gloChip]) {
2627 Int_t key = fNoisyPixelMap[gloChip]->GetKeyIndex(index);
2628 return GetRowFromKey(key);
2631 Error("AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtC", "Index %d out of bounds.", index);
2635 //____________________________________________________________________________________________
2636 void AliITSOnlineCalibrationSPDhandler::ActivateALL() {
2637 // activate all eq,hs,chips
2638 for (UInt_t eq=0; eq<20; eq++) {
2640 for (UInt_t hs=0; hs<6; hs++) {
2642 for (UInt_t chip=0; chip<10; chip++) {
2643 ActivateChip(eq,hs,chip);
2648 //____________________________________________________________________________________________
2649 void AliITSOnlineCalibrationSPDhandler::ActivateEq(UInt_t eq, Bool_t setval) {
2652 Error("AliITSOnlineCalibrationSPDhandler::ActivateEq", "eq (%d) out of bounds.",eq);
2655 fActiveEq[eq] = setval;
2657 //____________________________________________________________________________________________
2658 void AliITSOnlineCalibrationSPDhandler::ActivateHS(UInt_t eq, UInt_t hs, Bool_t setval) {
2660 if (eq>=20 || hs>=6) {
2661 Error("AliITSOnlineCalibrationSPDhandler::ActivateHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
2664 fActiveHS[eq][hs] = setval;
2666 //____________________________________________________________________________________________
2667 void AliITSOnlineCalibrationSPDhandler::ActivateChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval) {
2669 if (eq>=20 || hs>=6 || chip>=10) {
2670 Error("AliITSOnlineCalibrationSPDhandler::ActivateChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
2673 fActiveChip[eq][hs][chip] = setval;
2675 //____________________________________________________________________________________________
2676 Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveEq(UInt_t eq) const {
2679 Error("AliITSOnlineCalibrationSPDhandler::IsActiveEq", "eq (%d) out of bounds.",eq);
2682 return fActiveEq[eq];
2684 //____________________________________________________________________________________________
2685 Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveHS(UInt_t eq, UInt_t hs) const {
2687 if (eq>=20 || hs>=6) {
2688 Error("AliITSOnlineCalibrationSPDhandler::IsActiveHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
2691 return fActiveHS[eq][hs];
2693 //____________________________________________________________________________________________
2694 Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
2696 if (eq>=20 || hs>=6 || chip>=10) {
2697 Error("AliITSOnlineCalibrationSPDhandler::IsActiveChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
2700 return fActiveChip[eq][hs][chip];
2702 //____________________________________________________________________________________________
2703 void AliITSOnlineCalibrationSPDhandler::UnSetDeadALL() {
2704 // Clear all dead eq,hs,chips
2705 for (UInt_t eq=0; eq<20; eq++) {
2706 SetDeadEq(eq,kFALSE);
2707 for (UInt_t hs=0; hs<6; hs++) {
2708 SetDeadHS(eq,hs,kFALSE);
2709 for (UInt_t chip=0; chip<10; chip++) {
2710 SetDeadChip(eq,hs,chip,kFALSE);
2715 //____________________________________________________________________________________________
2716 void AliITSOnlineCalibrationSPDhandler::SetDeadEq(UInt_t eq, Bool_t setval) {
2719 Error("AliITSOnlineCalibrationSPDhandler::SetDeadEq", "eq (%d) out of bounds.",eq);
2722 fDeadEq[eq] = setval;
2724 //____________________________________________________________________________________________
2725 void AliITSOnlineCalibrationSPDhandler::SetDeadHS(UInt_t eq, UInt_t hs, Bool_t setval) {
2727 if (eq>=20 || hs>=6) {
2728 Error("AliITSOnlineCalibrationSPDhandler::SetDeadHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
2731 fDeadHS[eq][hs] = setval;
2733 //____________________________________________________________________________________________
2734 void AliITSOnlineCalibrationSPDhandler::SetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval) {
2736 if (eq>=20 || hs>=6 || chip>=10) {
2737 Error("AliITSOnlineCalibrationSPDhandler::SetDeadChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
2740 fDeadChip[eq][hs][chip] = setval;
2742 //____________________________________________________________________________________________
2743 Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadEq(UInt_t eq) const {
2746 Error("AliITSOnlineCalibrationSPDhandler::IsDeadEq", "eq (%d) out of bounds.",eq);
2751 //____________________________________________________________________________________________
2752 Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadHS(UInt_t eq, UInt_t hs) const {
2754 if (eq>=20 || hs>=6) {
2755 Error("AliITSOnlineCalibrationSPDhandler::IsDeadHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
2758 return fDeadHS[eq][hs];
2760 //____________________________________________________________________________________________
2761 Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
2763 if (eq>=20 || hs>=6 || chip>=10) {
2764 Error("AliITSOnlineCalibrationSPDhandler::IsDeadChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
2767 return fDeadChip[eq][hs][chip];
2769 //____________________________________________________________________________________________
2770 Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentEq(UInt_t eq) const {
2773 Error("AliITSOnlineCalibrationSPDhandler::IsSilentEq", "eq (%d) out of bounds.",eq);
2776 return (!IsActiveEq(eq) || IsDeadEq(eq));
2778 //____________________________________________________________________________________________
2779 Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentHS(UInt_t eq, UInt_t hs) const {
2781 if (eq>=20 || hs>=6) {
2782 Error("AliITSOnlineCalibrationSPDhandler::IsSilentHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
2785 return (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs));
2787 //____________________________________________________________________________________________
2788 Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
2790 if (eq>=20 || hs>=6 || chip>=10) {
2791 Error("AliITSOnlineCalibrationSPDhandler::IsSilentChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
2794 return (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs) || !IsActiveChip(eq,hs,chip) || IsDeadChip(eq,hs,chip));