LCOV - code coverage report
Current view: top level - ITS/ITSsim - AliITSFOEfficiencySPD.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 46 32.6 %
Date: 2016-06-14 17:26:59 Functions: 7 11 63.6 %

          Line data    Source code
       1             : /////////////////////////////////////////////////////////////////////
       2             : // Author: Henrik Tydesjo                                          //
       3             : //                                                                 //
       4             : // This class is used to store Fast-OR efficiency values in OCDB.  //
       5             : // One value per pixel chip in this base class (if per column      //
       6             : // accuracy is needed, use AliITSFOEfficiencySPDColumn class).     //
       7             : // The values are the probability that a pixel hit will generate a //
       8             : // fast-OR signal.                                                 //
       9             : //                                                                 //
      10             : /////////////////////////////////////////////////////////////////////
      11             : 
      12             : #include "AliITSFOEfficiencySPD.h"
      13             : 
      14             : AliITSFOEfficiencySPD::AliITSFOEfficiencySPD() :
      15           3 :   TObject()
      16          15 : {
      17             :   // default constructor, puts all efficiency values to 100%
      18           3 :   ResetValues();
      19           6 : }
      20             : //______________________________________________________________________
      21             : AliITSFOEfficiencySPD::AliITSFOEfficiencySPD(const AliITSFOEfficiencySPD& foEff) :
      22           0 :   TObject() 
      23           0 : {  
      24             :   // copy constructor, copy the array values from input object
      25           0 :   for (UInt_t eq=0; eq<20; eq++) {
      26           0 :     for (UInt_t hs=0; hs<6; hs++) {
      27           0 :       for (UInt_t chip=0; chip<10; chip++) {
      28           0 :         fChipEfficiency[eq][hs][chip] = foEff.fChipEfficiency[eq][hs][chip];
      29             :       }
      30             :     }
      31             :   }
      32           0 : }
      33             : //______________________________________________________________________
      34           6 : AliITSFOEfficiencySPD::~AliITSFOEfficiencySPD() {}
      35             : //______________________________________________________________________
      36             : void AliITSFOEfficiencySPD::ResetValues() {
      37             :   // Set all efficiency values to 100%
      38         129 :   for (UInt_t eq=0; eq<20; eq++) {
      39         840 :     for (UInt_t hs=0; hs<6; hs++) {
      40        7920 :       for (UInt_t chip=0; chip<10; chip++) {
      41        3600 :         fChipEfficiency[eq][hs][chip] = 1;
      42             :       }
      43             :     }
      44             :   }
      45           3 : }
      46             : //______________________________________________________________________
      47             : AliITSFOEfficiencySPD& AliITSFOEfficiencySPD::operator=(const AliITSFOEfficiencySPD& foEff) {
      48             :   // assignment operator
      49           0 :   if (this!=&foEff) {
      50           0 :     for (UInt_t eq=0; eq<20; eq++) {
      51           0 :       for (UInt_t hs=0; hs<6; hs++) {
      52           0 :         for (UInt_t chip=0; chip<10; chip++) {
      53           0 :           fChipEfficiency[eq][hs][chip] = foEff.fChipEfficiency[eq][hs][chip];
      54             :         }
      55             :       }
      56             :     }
      57           0 :   }
      58           0 :   return *this;
      59             : }
      60             : //______________________________________________________________________
      61             : void AliITSFOEfficiencySPD::SetChipEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, Float_t value) {
      62             :   // set a chip efficiency value
      63           0 :   if (eq>=20) {
      64           0 :     Error("AliITSFOEfficiencySPD::SetChipEfficiency", "eq (%d) out of bounds.",eq);
      65           0 :     return;
      66             :   }
      67           0 :   if (hs>=6) {
      68           0 :     Error("AliITSFOEfficiencySPD::SetChipEfficiency", "hs (%d) out of bounds.",hs);
      69           0 :     return;
      70             :   }
      71           0 :   if (chip>=10) {
      72           0 :     Error("AliITSFOEfficiencySPD::SetChipEfficiency", "chip (%d) out of bounds.",chip);
      73           0 :     return;
      74             :   }
      75             :   
      76           0 :   fChipEfficiency[eq][hs][chip] = value;
      77           0 : }
      78             : //______________________________________________________________________
      79             : Float_t AliITSFOEfficiencySPD::GetChipEfficiency(UInt_t eq, UInt_t hs, UInt_t chip) const {
      80             :   // get a chip efficiency value
      81         296 :   if (eq>=20) {
      82           0 :     Error("AliITSFOEfficiencySPD::GetChipEfficiency", "eq (%d) out of bounds.",eq);
      83           0 :     return 0;
      84             :   }
      85         148 :   if (hs>=6) {
      86           0 :     Error("AliITSFOEfficiencySPD::GetChipEfficiency", "hs (%d) out of bounds.",hs);
      87           0 :     return 0;
      88             :   }
      89         148 :   if (chip>=10) {
      90           0 :     Error("AliITSFOEfficiencySPD::GetChipEfficiency", "chip (%d) out of bounds.",chip);
      91           0 :     return 0;
      92             :   }
      93             : 
      94         148 :   return fChipEfficiency[eq][hs][chip];
      95         148 : }
      96             : 

Generated by: LCOV version 1.11