LCOV - code coverage report
Current view: top level - ITS/ITSsim - AliITSFOEfficiencySPDColumn.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 55 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 11 0.0 %

          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 column in this daughter class.         //
       6             : // The values are the probability that a pixel hit will generate a //
       7             : // fast-OR signal.                                                 //
       8             : //                                                                 //
       9             : /////////////////////////////////////////////////////////////////////
      10             : 
      11             : #include "AliITSFOEfficiencySPDColumn.h"
      12             : 
      13             : AliITSFOEfficiencySPDColumn::AliITSFOEfficiencySPDColumn() : 
      14           0 :   AliITSFOEfficiencySPD() 
      15           0 : {
      16             :   // default constructor, sets all efficiency values to 100%
      17           0 :   ResetValues();
      18           0 : }
      19             : //______________________________________________________________________
      20             : AliITSFOEfficiencySPDColumn::AliITSFOEfficiencySPDColumn(const AliITSFOEfficiencySPDColumn& foEff) :
      21           0 :   AliITSFOEfficiencySPD()
      22           0 : {  
      23             :   // copy constructor, copy the array values from input object
      24           0 :   for (UInt_t eq=0; eq<20; eq++) {
      25           0 :     for (UInt_t hs=0; hs<6; hs++) {
      26           0 :       for (UInt_t chip=0; chip<10; chip++) {
      27           0 :         for (UInt_t col=0; col<32; col++) {
      28           0 :           fColumnEfficiency[eq][hs][chip][col] = foEff.fColumnEfficiency[eq][hs][chip][col];
      29             :         }
      30             :       }
      31             :     }
      32             :   }
      33           0 : }
      34             : //______________________________________________________________________
      35           0 : AliITSFOEfficiencySPDColumn::~AliITSFOEfficiencySPDColumn() {}
      36             : //______________________________________________________________________
      37             : AliITSFOEfficiencySPDColumn& AliITSFOEfficiencySPDColumn::operator=(const AliITSFOEfficiencySPDColumn& foEff) {
      38             :   // assignment operator
      39           0 :   if (this!=&foEff) {
      40           0 :     for (UInt_t eq=0; eq<20; eq++) {
      41           0 :       for (UInt_t hs=0; hs<6; hs++) {
      42           0 :         for (UInt_t chip=0; chip<10; chip++) {
      43           0 :           for (UInt_t col=0; col<32; col++) {
      44           0 :             fColumnEfficiency[eq][hs][chip][col] = foEff.fColumnEfficiency[eq][hs][chip][col];
      45             :           }
      46             :         }
      47             :       }
      48             :     }
      49           0 :   }
      50           0 :   return *this;
      51             : }
      52             : //______________________________________________________________________
      53             : void AliITSFOEfficiencySPDColumn::ResetValues() {
      54             :   // set all efficiency values to 100%
      55           0 :   for (UInt_t eq=0; eq<20; eq++) {
      56           0 :     for (UInt_t hs=0; hs<6; hs++) {
      57           0 :       for (UInt_t chip=0; chip<10; chip++) {
      58           0 :         for (UInt_t col=0; col<32; col++) {
      59           0 :           fColumnEfficiency[eq][hs][chip][col] = 1;
      60             :         }
      61             :       }
      62             :     }
      63             :   }
      64           0 : }
      65             : //______________________________________________________________________
      66             : void AliITSFOEfficiencySPDColumn::SetColumnEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, Float_t value) {
      67             :   // set a column efficiency value
      68           0 :   if (eq>=20) {
      69           0 :     Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "eq (%d) out of bounds.",eq);
      70           0 :     return;
      71             :   }
      72           0 :   if (hs>=6) {
      73           0 :     Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "hs (%d) out of bounds.",hs);
      74           0 :     return;
      75             :   }
      76           0 :   if (chip>=10) {
      77           0 :     Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "chip (%d) out of bounds.",chip);
      78           0 :     return;
      79             :   }
      80           0 :   if (col>=32) {
      81           0 :     Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "col (%d) out of bounds.",col);
      82           0 :     return;
      83             :   }
      84             : 
      85           0 :   fColumnEfficiency[eq][hs][chip][col] = value;
      86           0 : }
      87             : //______________________________________________________________________
      88             : Float_t AliITSFOEfficiencySPDColumn::GetColumnEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col) const {
      89             :   // get a column efficiency value
      90           0 :   if (eq>=20) {
      91           0 :     Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "eq (%d) out of bounds.",eq);
      92           0 :     return 0;
      93             :   }
      94           0 :   if (hs>=6) {
      95           0 :     Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "hs (%d) out of bounds.",hs);
      96           0 :     return 0;
      97             :   }
      98           0 :   if (chip>=10) {
      99           0 :     Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "chip (%d) out of bounds.",chip);
     100           0 :     return 0;
     101             :   }
     102           0 :   if (col>=32) {
     103           0 :     Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "col (%d) out of bounds.",col);
     104           0 :     return 0;
     105             :   }
     106             : 
     107           0 :   return fColumnEfficiency[eq][hs][chip][col];
     108           0 : }
     109             : 

Generated by: LCOV version 1.11