]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSOnlineCalibrationSPD.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineCalibrationSPD.cxx
index 198bc4e94ecfba2655a55ab76e94daac9b375890..2942cd438255a3a469fbe70ccd2aed0176df5574 100644 (file)
 ClassImp(AliITSOnlineCalibrationSPD)   
 
 AliITSOnlineCalibrationSPD::AliITSOnlineCalibrationSPD():
-fModuleNr(0),
-fNrDead(0),
-fDeadChannels(0),
-fNrNoisy(0),
-fNoisyChannels(0)
-{}
-//_________________________________________________________________________
-void AliITSOnlineCalibrationSPD::AddDead(UInt_t col, UInt_t row) {
-  //
-  // Add a dead channel to fDeadChannel array
-  //
-  fDeadChannels.Set(fNrDead*2+2);
-  fDeadChannels.AddAt(col,fNrDead*2);
-  fDeadChannels.AddAt(row,fNrDead*2+1);
-  fNrDead++;
-}
-//_________________________________________________________________________
-Int_t AliITSOnlineCalibrationSPD::GetDeadColAt(UInt_t index) const {
-  // 
-  // Returns column of index-th dead channel
-  //
-  if (index<fNrDead) {
-    return fDeadChannels.At(index*2);
-  }
-  return -1;
+fEqNr(0),
+fNrBad(0),
+fBadChannels(0),
+fActiveEq(kTRUE),
+fDeadEq(kFALSE)
+{
+  ActivateALL();
+  UnSetDeadALL();
 }
-//_________________________________________________________________________
-Int_t AliITSOnlineCalibrationSPD::GetDeadRowAt(UInt_t index) const {
-  // 
-  // Returns row of index-th dead channel
-  //
-  if (index<fNrDead) {
-    return fDeadChannels.At(index*2+1);
+//____________________________________________________________________________
+Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
+  // Get key of index-th bad pixel
+  if (index<fNrBad) {
+    return fBadChannels.At(index);
   }
   return -1;
 }
-//_________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const {
-  //
-  // Check if pixel (col,row) is dead
-  //
-  for (UInt_t i=0; i<fNrDead; i++) { 
-    if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) {
-      return kTRUE;
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::ActivateALL() {
+  // activate eq, all hs, all chips
+  ActivateEq();
+  for (UInt_t hs=0; hs<6; hs++) {
+    ActivateHS(hs);
+    for (UInt_t chip=0; chip<10; chip++) {
+      ActivateChip(hs,chip);
     }
   }
-  return kFALSE;
 }
 //____________________________________________________________________________
-void AliITSOnlineCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
-  //
-  // add noisy pixel 
-  //
-  fDeadChannels.Set(fNrNoisy*2+2);
-  fNoisyChannels.AddAt(col,fNrNoisy*2);
-  fNoisyChannels.AddAt(row,fNrNoisy*2+1);
-  fNrNoisy++;
+void AliITSOnlineCalibrationSPD::ActivateEq(Bool_t setval) {
+  // activate this eq
+  fActiveEq = setval;
 }
 //____________________________________________________________________________
-Int_t AliITSOnlineCalibrationSPD::GetNoisyColAt(UInt_t index) const {
-  //
-  // Get column of index-th noisy pixel
-  //
-  if (index<fNrNoisy) {
-    return fNoisyChannels.At(index*2);
+void AliITSOnlineCalibrationSPD::ActivateHS(UInt_t hs, Bool_t setval) {
+  // activate hs on this eq
+  if (hs>=6) {
+    Error("AliITSOnlineCalibrationSPD::ActivateHS", "hs (%d) out of bounds.",hs);
+    return;
   }
-  return -1;
+  fActiveHS[hs] = setval;
 }
 //____________________________________________________________________________
-Int_t AliITSOnlineCalibrationSPD::GetNoisyRowAt(UInt_t index) const {
-  //
-  // Get row of index-th noisy pixel
-  //
-  if (index<fNrNoisy) {
-    return fNoisyChannels.At(index*2+1);
+void AliITSOnlineCalibrationSPD::ActivateChip(UInt_t hs, UInt_t chip, Bool_t setval) {
+  // activate chip on this eq
+  if (hs>=6 || chip>=10) {
+    Error("AliITSOnlineCalibrationSPD::ActivateChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+    return;
   }
-  return -1;
+  fActiveChip[hs*10+chip] = setval;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsActiveEq() const {
+  // is this eq active?
+  return fActiveEq;
 }
 //____________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
-  //
-  // Check if pixel (col,row) is noisy
-  //
-  for (UInt_t i=0; i<fNrNoisy; i++) { 
-    if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
-      return kTRUE;
+Bool_t AliITSOnlineCalibrationSPD::IsActiveHS(UInt_t hs) const {
+  // is this hs active?
+  if (hs>=6) {
+    Error("AliITSOnlineCalibrationSPD::IsActiveHS", "hs (%d) out of bounds.",hs);
+    return kFALSE;
+  }
+  return fActiveHS[hs];
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsActiveChip(UInt_t hs, UInt_t chip) const {
+  // is this chip active?
+  if (hs>=6 || chip>=10) {
+    Error("AliITSOnlineCalibrationSPD::IsActiveChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+    return kFALSE;
+  }
+  return fActiveChip[hs*10+chip];
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::UnSetDeadALL() {
+  // activate eq, all hs, all chips
+  SetDeadEq(kFALSE);
+  for (UInt_t hs=0; hs<6; hs++) {
+    SetDeadHS(hs,kFALSE);
+    for (UInt_t chip=0; chip<10; chip++) {
+      SetDeadChip(hs,chip,kFALSE);
     }
   }
-  return kFALSE;
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadEq(Bool_t setval) {
+  // set this eq dead
+  fDeadEq = setval;
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadHS(UInt_t hs, Bool_t setval) {
+  // set dead hs on this eq
+  if (hs>=6) {
+    Error("AliITSOnlineCalibrationSPD::SetDeadHS", "hs (%d) out of bounds.",hs);
+    return;
+  }
+  fDeadHS[hs] = setval;
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadChip(UInt_t hs, UInt_t chip, Bool_t setval) {
+  // set dead chip on this eq
+  if (hs>=6 || chip>=10) {
+    Error("AliITSOnlineCalibrationSPD::SetDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+    return;
+  }
+  fDeadChip[hs*10+chip] = setval;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadEq() const {
+  // is this eq dead?
+  return fDeadEq;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadHS(UInt_t hs) const {
+  // is this hs dead?
+  if (hs>=6) {
+    Error("AliITSOnlineCalibrationSPD::IsDeadHS", "hs (%d) out of bounds.",hs);
+    return kFALSE;
+  }
+  return fDeadHS[hs];
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadChip(UInt_t hs, UInt_t chip) const {
+  // is this chip dead?
+  if (hs>=6 || chip>=10) {
+    Error("AliITSOnlineCalibrationSPD::IsDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+    return kFALSE;
+  }
+  return fDeadChip[hs*10+chip];
 }