LCOV - code coverage report
Current view: top level - MUON/MUONbase - AliMUONPadStatusMaker.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 13 53.8 %
Date: 2016-06-14 17:26:59 Functions: 8 17 47.1 %

          Line data    Source code
       1             : #ifndef ALIMUONPADSTATUSMAKER_H
       2             : #define ALIMUONPADSTATUSMAKER_H
       3             : 
       4             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       5             : * See cxx source for full Copyright notice                               */
       6             : 
       7             : // $Id$
       8             : 
       9             : /// \ingroup rec
      10             : /// \class AliMUONPadStatusMaker
      11             : /// \brief Make a 2DStore of pad statuses, using different sources of information
      12             : /// 
      13             : //  Author Laurent Aphecetche
      14             : 
      15             : #ifndef ROOT_TObject
      16             : #  include "TObject.h"
      17             : #endif
      18             : #ifndef ROOT_TVector2
      19             : #  include "TVector2.h"
      20             : #endif
      21             : 
      22             : class TExMap;
      23             : class AliMUONCalibrationData;
      24             : class AliMUONRecoParam;
      25             : class AliMUONVCalibParam;
      26             : class AliMUONVTrackerData;
      27             : class AliMUONVStore;
      28             : 
      29             : using std::ostream;
      30             : 
      31             : class AliMUONPadStatusMaker : public TObject
      32             : {
      33             : public:
      34             :   AliMUONPadStatusMaker(const AliMUONCalibrationData& calibData);
      35             :   virtual ~AliMUONPadStatusMaker();
      36             :   
      37             :   /// Get the reference to the calibrationdata object we use.
      38           8 :   const AliMUONCalibrationData& CalibrationData() const { return fkCalibrationData; }
      39             :   
      40             :   /** Get access to internal status store (for debug only, as it may not be complete,
      41             :     depending on whether you've already called PadStatus for all possible de,manu
      42             :     combinations or not...
      43             :     */
      44           0 :   AliMUONVStore* StatusStore() const { return fStatus; }
      45             : 
      46             :   AliMUONVCalibParam* PadStatus(Int_t detElemId, Int_t manuId) const;
      47             : 
      48             :   Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
      49             :   
      50             :   AliMUONVStore* NeighboursStore() const;
      51             :   
      52             :   AliMUONVCalibParam* Neighbours(Int_t detElemId, Int_t manuId) const;
      53             :   
      54             :   static TString AsString(Int_t status);
      55             : 
      56             :   static TString AsCondition(Int_t status);
      57             :   
      58             :   /// Return HV threshold
      59             :   Double_t HVLimit(Int_t chamberId) const;
      60             :   
      61             :   /// Return Low and High threshold for pedestal mean
      62           0 :   TVector2 PedMeanLimits() const { return fPedMeanLimits; }
      63             :   /// Return Low and High threshold for pedestal sigma
      64           0 :   TVector2 PedSigmaLimits() const { return fPedSigmaLimits; }
      65             :   
      66             :   /// Set HV limit
      67             :   void SetHVLimit(Int_t chamberId, Double_t hv);
      68             : 
      69             :   /// Set Low and High threshold for pedestal mean
      70           4 :   void SetPedMeanLimits(float low, float high) { fPedMeanLimits.Set(low,high); }
      71             :   /// Set Low and High threshold for pedestal sigma 
      72           4 :   void SetPedSigmaLimits(float low, float high) { fPedSigmaLimits.Set(low,high); }
      73             :         
      74             :   /// Set Low and High manu occupancy limits
      75           4 :   void SetManuOccupancyLimits(float low, float high) { fManuOccupancyLimits.Set(low,high); }
      76             :   /// Get manu occupancy limits
      77           0 :   TVector2 ManuOccupancyLimits() const { return fManuOccupancyLimits; }
      78             : 
      79             :   /// Set Low and High bus patch occupancy limits
      80           4 :   void SetBuspatchOccupancyLimits(float low, float high) { fBuspatchOccupancyLimits.Set(low,high); }
      81             :   /// Get bus patch occupancy limits
      82           0 :   TVector2 BuspatchOccupancyLimits() const { return fBuspatchOccupancyLimits; }
      83             : 
      84             :   /// Set Low and High DE occupancy limits
      85           4 :   void SetDEOccupancyLimits(float low, float high) { fDEOccupancyLimits.Set(low,high); }
      86             :   /// Get DE occupancy limits
      87           0 :   TVector2 DEOccupancyLimits() const { return fDEOccupancyLimits; }
      88             :   
      89             :   void SetLimits(const AliMUONRecoParam& recoParams);
      90             : 
      91             :   void Report(UInt_t mask);
      92             :   
      93             :   static Float_t SwitchValue(const TObjArray& dcsArray);
      94             :   
      95             :   Int_t LVStatus(Int_t detElemId) const;
      96             :   
      97             :   Int_t HVStatus(Int_t detElemId, Int_t manuId) const;
      98             :   
      99             :   Int_t OccupancyStatus(Int_t detElemId, Int_t manuId) const;
     100             : 
     101             :   static void DecodeStatus(Int_t status, Int_t& pedStatus, Int_t& hvStatus, 
     102             :                            Int_t&  lvStatus, Int_t& otherStatus);
     103             :   static Int_t BuildStatus(Int_t pedStatus, Int_t hvStatus, 
     104             :                            Int_t lvStatus, Int_t otherStatus);
     105             : private:
     106             :   /// Not implemented
     107             :   AliMUONPadStatusMaker(const AliMUONPadStatusMaker&);
     108             :   /// Not implemented
     109             :   AliMUONPadStatusMaker& operator=(const AliMUONPadStatusMaker&);
     110             : 
     111             :   
     112             :   AliMUONVCalibParam* ComputeStatus(Int_t detElemId, Int_t manuId) const;
     113             : 
     114             :   Bool_t HVSt12Status(Int_t detElemId, Int_t sector,
     115             :                       Bool_t& hvChannelTooLow,
     116             :                       Bool_t& hvChannelTooHigh,
     117             :                       Bool_t& hvChannelON) const;
     118             :   
     119             :   
     120             :   Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex,
     121             :                        Bool_t& hvChannelTooLow,
     122             :                        Bool_t& hvChannelTooHigh,
     123             :                        Bool_t& hvChannelON,
     124             :                        Bool_t& hvSwitchON) const;
     125             : 
     126             :   void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const;
     127             : 
     128             :   Int_t CheckConfigConsistencyWithPedestalInformation(Int_t detElemId,Int_t manuId) const;
     129             : 
     130             : private:
     131             :   /// General status
     132             :   enum EGeneralStatus
     133             :   {
     134             :     kMissing = (1<<7)
     135             :   };
     136             : 
     137             :   /// Pedestal status
     138             :   enum EPedestalStatus
     139             :   {
     140             :     kPedOK = 0,
     141             :     kPedMeanZero = (1<<1),
     142             :     kPedMeanTooLow = (1<<2),
     143             :     kPedMeanTooHigh = (1<<3),
     144             :     kPedSigmaTooLow = (1<<4),
     145             :     kPedSigmaTooHigh = (1<<5),
     146             :     
     147             :     kPedMissing = kMissing // please always use last bit for meaning "missing"
     148             :   };
     149             :   
     150             :   /// LV status
     151             :   enum ELVStatus
     152             :   {
     153             :     kLVOK = 0,
     154             :     kLVTooLow = (1<<3),
     155             :     
     156             :     kLVMissing = kMissing // please always use last bit for meaning "missing"
     157             :   };
     158             :   
     159             :   /// HV Error
     160             :   enum EHVError 
     161             :   {
     162             :     kHVOK = 0,
     163             :     kHVError = (1<<0),
     164             :     kHVTooLow = (1<<1),
     165             :     kHVTooHigh = (1<<2), // no longer to be used
     166             :     kHVChannelOFF = (1<<3),
     167             :     kHVSwitchOFF = (1<<4),
     168             : 
     169             :     kHVMissing = kMissing // please always use last bit for meaning "missing"
     170             :   };
     171             :   
     172             :   /// Other
     173             :   enum EOccupancyStatus
     174             :   {
     175             :     kManuOccupancyTooLow = (1<<1),
     176             :     kManuOccupancyTooHigh = (1<<2),
     177             :     kBusPatchOccupancyTooLow = (1<<3),
     178             :     kBusPatchOccupancyTooHigh = (1<<4),
     179             :     kDEOccupancyTooLow = (1<<5),
     180             :     kDEOccupancyTooHigh = (1<<6),
     181             :     kBusPatchRemovedByPAR = (1<<7),
     182             :     
     183             :   };
     184             :   
     185             :   const AliMUONCalibrationData& fkCalibrationData; //!<! helper class to get data access (not owner)
     186             :   
     187             :   Double_t fHVLimit[10]; //!<! Low thresholds for HV
     188             : 
     189             :   TVector2 fPedMeanLimits; //!<! Low and High threshold for pedestal mean
     190             :   TVector2 fPedSigmaLimits; //!<! Low and High threshold for pedestal sigma
     191             :   
     192             :   TVector2 fManuOccupancyLimits; //!<! Low and High manu occupancy limits
     193             :   TVector2 fBuspatchOccupancyLimits; //!<! Low and High buspatch occupancy limits
     194             :   TVector2 fDEOccupancyLimits; //!<! Low and High DE occupancy limits
     195             :   
     196             :   AliMUONVStore* fStatus; //!<! statuses of the pads
     197             :   
     198             :   mutable TExMap* fHV; //!<! cache of hv statuses
     199             : 
     200             :   AliMUONVStore* fPedestals; //!<! pedestal values
     201             :   AliMUONVStore* fConfig; //!<! readout configuration
     202             :   
     203             :   AliMUONVTrackerData* fTrackerData; //!<! to get occupancies...
     204             :   
     205       73370 :   ClassDef(AliMUONPadStatusMaker,0) // Creates pad statuses from ped,lv,hv
     206             : };
     207             : 
     208             : #endif

Generated by: LCOV version 1.11