LCOV - code coverage report
Current view: top level - ITS/ITSrec - AliITSOnlineCalibrationSPD.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 73 1.4 %
Date: 2016-06-14 17:26:59 Functions: 1 18 5.6 %

          Line data    Source code
       1             : #include "AliITSOnlineCalibrationSPD.h"
       2             : 
       3             : ///////////////////////////////////////////////////////////////////////
       4             : // Author: Henrik Tydesjo                                            //
       5             : // Implementation of the online container for dead and noisy pixels. //
       6             : //                                                                   //
       7             : ///////////////////////////////////////////////////////////////////////
       8             : 
       9         116 : ClassImp(AliITSOnlineCalibrationSPD)    
      10             : 
      11           0 : AliITSOnlineCalibrationSPD::AliITSOnlineCalibrationSPD():
      12           0 : fEqNr(0),
      13           0 : fNrBad(0),
      14           0 : fBadChannels(0),
      15           0 : fActiveEq(kTRUE),
      16           0 : fDeadEq(kFALSE)
      17           0 : {
      18           0 :   ActivateALL();
      19           0 :   UnSetDeadALL();
      20           0 : }
      21             : //____________________________________________________________________________
      22             : Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
      23             :   // Get key of index-th bad pixel
      24           0 :   if (index<fNrBad) {
      25           0 :     return fBadChannels.At(index);
      26             :   }
      27           0 :   return -1;
      28           0 : }
      29             : //____________________________________________________________________________
      30             : void AliITSOnlineCalibrationSPD::ActivateALL() {
      31             :   // activate eq, all hs, all chips
      32           0 :   ActivateEq();
      33           0 :   for (UInt_t hs=0; hs<6; hs++) {
      34           0 :     ActivateHS(hs);
      35           0 :     for (UInt_t chip=0; chip<10; chip++) {
      36           0 :       ActivateChip(hs,chip);
      37             :     }
      38             :   }
      39           0 : }
      40             : //____________________________________________________________________________
      41             : void AliITSOnlineCalibrationSPD::ActivateEq(Bool_t setval) {
      42             :   // activate this eq
      43           0 :   fActiveEq = setval;
      44           0 : }
      45             : //____________________________________________________________________________
      46             : void AliITSOnlineCalibrationSPD::ActivateHS(UInt_t hs, Bool_t setval) {
      47             :   // activate hs on this eq
      48           0 :   if (hs>=6) {
      49           0 :     Error("AliITSOnlineCalibrationSPD::ActivateHS", "hs (%d) out of bounds.",hs);
      50           0 :     return;
      51             :   }
      52           0 :   fActiveHS[hs] = setval;
      53           0 : }
      54             : //____________________________________________________________________________
      55             : void AliITSOnlineCalibrationSPD::ActivateChip(UInt_t hs, UInt_t chip, Bool_t setval) {
      56             :   // activate chip on this eq
      57           0 :   if (hs>=6 || chip>=10) {
      58           0 :     Error("AliITSOnlineCalibrationSPD::ActivateChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
      59           0 :     return;
      60             :   }
      61           0 :   fActiveChip[hs*10+chip] = setval;
      62           0 : }
      63             : //____________________________________________________________________________
      64             : Bool_t AliITSOnlineCalibrationSPD::IsActiveEq() const {
      65             :   // is this eq active?
      66           0 :   return fActiveEq;
      67             : }
      68             : //____________________________________________________________________________
      69             : Bool_t AliITSOnlineCalibrationSPD::IsActiveHS(UInt_t hs) const {
      70             :   // is this hs active?
      71           0 :   if (hs>=6) {
      72           0 :     Error("AliITSOnlineCalibrationSPD::IsActiveHS", "hs (%d) out of bounds.",hs);
      73           0 :     return kFALSE;
      74             :   }
      75           0 :   return fActiveHS[hs];
      76           0 : }
      77             : //____________________________________________________________________________
      78             : Bool_t AliITSOnlineCalibrationSPD::IsActiveChip(UInt_t hs, UInt_t chip) const {
      79             :   // is this chip active?
      80           0 :   if (hs>=6 || chip>=10) {
      81           0 :     Error("AliITSOnlineCalibrationSPD::IsActiveChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
      82           0 :     return kFALSE;
      83             :   }
      84           0 :   return fActiveChip[hs*10+chip];
      85           0 : }
      86             : //____________________________________________________________________________
      87             : void AliITSOnlineCalibrationSPD::UnSetDeadALL() {
      88             :   // activate eq, all hs, all chips
      89           0 :   SetDeadEq(kFALSE);
      90           0 :   for (UInt_t hs=0; hs<6; hs++) {
      91           0 :     SetDeadHS(hs,kFALSE);
      92           0 :     for (UInt_t chip=0; chip<10; chip++) {
      93           0 :       SetDeadChip(hs,chip,kFALSE);
      94             :     }
      95             :   }
      96           0 : }
      97             : //____________________________________________________________________________
      98             : void AliITSOnlineCalibrationSPD::SetDeadEq(Bool_t setval) {
      99             :   // set this eq dead
     100           0 :   fDeadEq = setval;
     101           0 : }
     102             : //____________________________________________________________________________
     103             : void AliITSOnlineCalibrationSPD::SetDeadHS(UInt_t hs, Bool_t setval) {
     104             :   // set dead hs on this eq
     105           0 :   if (hs>=6) {
     106           0 :     Error("AliITSOnlineCalibrationSPD::SetDeadHS", "hs (%d) out of bounds.",hs);
     107           0 :     return;
     108             :   }
     109           0 :   fDeadHS[hs] = setval;
     110           0 : }
     111             : //____________________________________________________________________________
     112             : void AliITSOnlineCalibrationSPD::SetDeadChip(UInt_t hs, UInt_t chip, Bool_t setval) {
     113             :   // set dead chip on this eq
     114           0 :   if (hs>=6 || chip>=10) {
     115           0 :     Error("AliITSOnlineCalibrationSPD::SetDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
     116           0 :     return;
     117             :   }
     118           0 :   fDeadChip[hs*10+chip] = setval;
     119           0 : }
     120             : //____________________________________________________________________________
     121             : Bool_t AliITSOnlineCalibrationSPD::IsDeadEq() const {
     122             :   // is this eq dead?
     123           0 :   return fDeadEq;
     124             : }
     125             : //____________________________________________________________________________
     126             : Bool_t AliITSOnlineCalibrationSPD::IsDeadHS(UInt_t hs) const {
     127             :   // is this hs dead?
     128           0 :   if (hs>=6) {
     129           0 :     Error("AliITSOnlineCalibrationSPD::IsDeadHS", "hs (%d) out of bounds.",hs);
     130           0 :     return kFALSE;
     131             :   }
     132           0 :   return fDeadHS[hs];
     133           0 : }
     134             : //____________________________________________________________________________
     135             : Bool_t AliITSOnlineCalibrationSPD::IsDeadChip(UInt_t hs, UInt_t chip) const {
     136             :   // is this chip dead?
     137           0 :   if (hs>=6 || chip>=10) {
     138           0 :     Error("AliITSOnlineCalibrationSPD::IsDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
     139           0 :     return kFALSE;
     140             :   }
     141           0 :   return fDeadChip[hs*10+chip];
     142           0 : }

Generated by: LCOV version 1.11