AliFMDParameters.h

Go to the documentation of this file.
00001 #ifndef ALIFMDPARAMETERS_H
00002 #define ALIFMDPARAMETERS_H
00003 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
00004  * reserved. 
00005  *
00006  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
00007  *
00008  * See cxx source for full Copyright notice                               
00009  */
00010 
00011 //____________________________________________________________________
00012 //
00013 //  Singleton class to handle various parameters (not geometry) of the
00014 //  FMD
00015 //  Should get ata fromm Conditions DB.
00016 //
00017 #ifndef ROOT_TNamed
00018 # include <TNamed.h>
00019 #endif
00020 #ifndef ROOT_TArrayI
00021 # include <TArrayI.h>
00022 #endif
00023 #ifndef ALIFMDUSHORTMAP_H
00024 # include <AliFMDUShortMap.h>
00025 #endif
00026 #ifndef ALIFMDBOOLMAP_H
00027 # include <AliFMDBoolMap.h>
00028 #endif
00029 typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
00030 typedef AliFMDBoolMap   AliFMDCalibDeadMap;
00031 class AliFMDCalibPedestal;
00032 class AliFMDCalibGain;
00033 class AliFMDCalibSampleRate;
00034 class AliFMDAltroMapping;
00035 
00063 class AliFMDParameters : public TNamed
00064 {
00065 public:
00068   static AliFMDParameters* Instance();
00069 
00073   void Init();
00074   
00077   void SetVA1MipRange(UShort_t r=20)          { fVA1MipRange = r; }
00078   void SetAltroChannelSize(UShort_t s=1024)   { fAltroChannelSize = s;}
00079   void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
00080   void SetPedestalFactor(Float_t f=3)         { fPedestalFactor = f; }
00085   void SetZeroSuppression(UShort_t s=0)       { fFixedZeroSuppression = s; }
00086   void SetSampleRate(UShort_t r=1)            { fFixedSampleRate = (r>2?2:r);}
00087   void SetPedestal(Float_t p=10)              { fFixedPedestal = p; }
00088   void SetPedestalWidth(Float_t w=1)          { fFixedPedestalWidth = w; }
00089   void SetThreshold(Float_t t=0)              { fFixedThreshold = t; }
00094   UShort_t GetVA1MipRange()          const { return fVA1MipRange; }
00095   UShort_t GetAltroChannelSize()     const { return fAltroChannelSize; }
00096   UShort_t GetChannelsPerAltro()     const { return fChannelsPerAltro; }
00097   Float_t  GetEdepMip()              const;
00098   Float_t  GetPedestalFactor()       const { return fPedestalFactor; }
00103   Bool_t   IsDead(UShort_t detector, 
00104                   Char_t ring, 
00105                   UShort_t sector, 
00106                   UShort_t strip) const;
00107   Float_t  GetThreshold() const;
00108   Float_t  GetPulseGain(UShort_t detector, 
00109                         Char_t ring, 
00110                         UShort_t sector, 
00111                         UShort_t strip) const;
00112   Float_t  GetPedestal(UShort_t detector, 
00113                        Char_t ring, 
00114                        UShort_t sector, 
00115                        UShort_t strip) const;
00116   Float_t  GetPedestalWidth(UShort_t detector, 
00117                             Char_t ring, 
00118                             UShort_t sector, 
00119                             UShort_t strip) const;
00120   UShort_t GetZeroSuppression(UShort_t detector, 
00121                               Char_t ring, 
00122                               UShort_t sector, 
00123                               UShort_t strip) const;
00124   UShort_t GetSampleRate(UShort_t ddl) const;
00125 
00126   Bool_t   Hardware2Detector(UInt_t ddl, UInt_t addr, UShort_t& det,
00127                              Char_t& ring, UShort_t& sec, UShort_t& str) const;
00128   Bool_t   Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec, 
00129                              UShort_t str, UInt_t& ddl, UInt_t& addr) const;
00130   AliFMDAltroMapping* GetAltroMap() const;
00133   enum { 
00134     kBaseDDL = 0x1000 // DDL offset for the FMD
00135   };
00136   static const char* fgkPulseGain;       // Path to PulseGain calib object
00137   static const char* fgkPedestal;        // Path to Pedestal calib object
00138   static const char* fgkDead;            // Path to Dead calib object
00139   static const char* fgkSampleRate;      // Path to SampleRate calib object
00140   static const char* fgkAltroMap;        // Path to AltroMap calib object
00141   static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
00142 protected:
00144   AliFMDParameters();
00146   virtual ~AliFMDParameters() {}
00148   static AliFMDParameters* fgInstance;   // Static singleton instance
00150   void InitPulseGain();
00152   void InitPedestal();
00154   void InitDeadMap();
00156   void InitSampleRate();
00158   void InitZeroSuppression();
00160   void InitAltroMap();
00161 
00162   Bool_t          fIsInit;               // Whether we've been initialised  
00163 
00164   const Float_t   fSiDeDxMip;            // MIP dE/dx in Silicon
00165   UShort_t        fVA1MipRange;          // # MIPs the pre-amp can do    
00166   UShort_t        fAltroChannelSize;     // Largest # to store in 1 ADC ch.
00167   UShort_t        fChannelsPerAltro;     // Number of pre-amp. chan/adc chan.
00168   Float_t         fPedestalFactor;       // Number of pedestal widths
00169 
00170   Float_t         fFixedPedestal;        // Pedestal to subtract
00171   Float_t         fFixedPedestalWidth;   // Width of pedestal
00172   UShort_t        fFixedZeroSuppression; // Threshold for zero-suppression
00173   UShort_t        fFixedSampleRate;      // Times the ALTRO samples pre-amp.
00174   Float_t         fFixedThreshold;       //
00175   mutable Float_t fFixedPulseGain;       
00176   mutable Float_t fEdepMip;              
00177   
00178   AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
00179   AliFMDCalibSampleRate*      fSampleRate;      // Sample rate from CDB 
00180   AliFMDCalibPedestal*        fPedestal;        // Pedestals 
00181   AliFMDCalibGain*            fPulseGain;       // Pulser gain
00182   AliFMDCalibDeadMap*         fDeadMap;         // Pulser gain
00183   AliFMDAltroMapping*         fAltroMap;        // Map of hardware
00184   
00185   ClassDef(AliFMDParameters,3)
00186 };
00187 
00188 #endif
00189 //____________________________________________________________________
00190 //
00191 // Local Variables:
00192 //   mode: C++
00193 // End:
00194 //
00195 // EOF
00196 //
00197 

Generated on Fri Mar 24 17:11:21 2006 for ALICE FMD Off-line by  doxygen 1.4.6