]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSOnlineCalibrationSPD.cxx
Mainly changes related to the added treatment of inactive detector parts in
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineCalibrationSPD.cxx
index 4981f1b68877fab21bf7a8a0f0a0d413e0216f2f..a6364bd899f65717975b680d92a4dbf95522850b 100644 (file)
@@ -11,8 +11,11 @@ ClassImp(AliITSOnlineCalibrationSPD)
 AliITSOnlineCalibrationSPD::AliITSOnlineCalibrationSPD():
 fEqNr(0),
 fNrBad(0),
-fBadChannels(0)
-{}
+fBadChannels(0),
+fActiveEq(kTRUE)
+{
+  ActivateALL();
+}
 //____________________________________________________________________________
 Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
   // Get key of index-th bad pixel
@@ -21,3 +24,61 @@ Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
   }
   return -1;
 }
+//____________________________________________________________________________
+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);
+    }
+  }
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::ActivateEq(Bool_t setval) {
+  // activate this eq
+  fActiveEq = setval;
+}
+//____________________________________________________________________________
+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;
+  }
+  fActiveHS[hs] = setval;
+}
+//____________________________________________________________________________
+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;
+  }
+  fActiveChip[hs*10+chip] = setval;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsActiveEq() const {
+  // is this eq active?
+  return fActiveEq;
+}
+//____________________________________________________________________________
+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];
+}
+