Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 07:55:53

0001 #ifndef CALIB_H
0002 #define CALIB_H
0003 
0004 #include <cstddef>
0005 #include <map>
0006 #include "TTimeStamp.h"
0007 #include "Setup.h"
0008 
0009 struct TileCalib{
0010   double PedestalMeanH  = -1000.;
0011   double PedestalMeanL  = -1000.;
0012   double PedestalSigH   = -1000.;
0013   double PedestalSigL   = -1000.;
0014   double ScaleH         = -1000.;
0015   double ScaleWidthH    = -1000.;
0016   double ScaleL         = -1000.;
0017   double ScaleWidthL    = -1000.;
0018   double LGHGCorr       = -64;
0019   double LGHGCorrOff    = -1000.;
0020   double HGLGCorr       = -64;
0021   double HGLGCorrOff    = -1000.;
0022   short BadChannel      = -64;
0023 } ;
0024 
0025 class Calib{
0026 
0027  public:
0028   Calib() {}
0029   virtual ~Calib() {}
0030     
0031   double GetPedestalMeanH (int /**/) const;
0032   double GetPedestalMeanL (int /**/) const;
0033   double GetPedestalMeanH (int /**/, int /**/, int /**/, int /**/) const;
0034   double GetPedestalMeanL (int /**/, int /**/, int /**/, int /**/) const;
0035   double GetPedestalSigH (int /**/) const;
0036   double GetPedestalSigL (int /**/) const;
0037   double GetPedestalSigH (int /**/, int /**/, int /**/, int /**/) const;
0038   double GetPedestalSigL (int /**/, int /**/, int /**/, int /**/) const;
0039   double GetScaleHigh(int /**/) const;
0040   double GetScaleHigh(int /**/, int /**/, int /**/, int /**/) const;
0041   double GetScaleWidthHigh(int /**/) const;
0042   double GetScaleWidthHigh(int /**/, int /**/, int /**/, int /**/) const;
0043   double GetCalcScaleLow (int /**/) const;
0044   double GetCalcScaleLow (int /**/, int /**/, int /**/, int /**/) const;
0045   double GetScaleLow (int /**/) const;
0046   double GetScaleLow (int /**/, int /**/, int /**/, int /**/) const;
0047   double GetScaleWidthLow (int /**/) const;
0048   double GetScaleWidthLow (int /**/, int /**/, int /**/, int /**/) const;
0049   double GetLGHGCorr (int /**/) const;
0050   double GetLGHGCorr (int /**/, int /**/, int /**/, int /**/) const;
0051   double GetLGHGCorrOff (int /**/) const;
0052   double GetLGHGCorrOff (int /**/, int /**/, int /**/, int /**/) const;
0053   double GetHGLGCorr (int /**/) const;
0054   double GetHGLGCorr (int /**/, int /**/, int /**/, int /**/) const;
0055   double GetHGLGCorrOff (int /**/) const;
0056   double GetHGLGCorrOff (int /**/, int /**/, int /**/, int /**/) const;
0057   
0058   double GetAveragePedestalMeanHigh() const;
0059   double GetAveragePedestalSigHigh() const;
0060   double GetAveragePedestalMeanLow() const;
0061   double GetAveragePedestalSigLow() const;
0062   double GetAverageScaleHigh() const;
0063   double GetAverageScaleHigh(int &) const;
0064   double GetAverageScaleWidthHigh() const;
0065   double GetAverageScaleLow() const;
0066   double GetAverageScaleWidthLow() const;
0067   double GetAverageHGLGCorr() const;
0068   double GetAverageHGLGCorrOff() const;
0069   double GetAverageLGHGCorr() const;
0070   double GetAverageLGHGCorrOff() const;
0071   
0072   int GetNumberOfChannelsWithBCflag (short ) const;
0073   short GetBadChannel(int /**/) const;
0074   short GetBadChannel(int /**/, int /**/, int /**/, int /**/) const;
0075   
0076   TileCalib* GetTileCalib(int /**/);
0077   TileCalib* GetTileCalib(int /**/, int /**/, int /**/, int /**/);
0078 
0079   void   SetPedestalMeanH (double, int);
0080   void   SetPedestalMeanL (double, int);
0081   void   SetPedestalMeanH (double, int, int, int, int);
0082   void   SetPedestalMeanL (double, int, int, int, int);
0083   void   SetPedestalSigH (double, int);
0084   void   SetPedestalSigL (double, int);
0085   void   SetPedestalSigH (double, int, int, int, int);
0086   void   SetPedestalSigL (double, int, int, int, int);
0087   void   SetScaleHigh(double, int);
0088   void   SetScaleHigh(double, int, int, int, int);
0089   void   SetScaleWidthHigh(double, int);
0090   void   SetScaleWidthHigh(double, int, int, int, int);
0091   void   SetScaleLow (double, int);
0092   void   SetScaleLow (double, int, int, int, int);
0093   void   SetScaleWidthLow (double, int);
0094   void   SetScaleWidthLow (double, int, int, int, int);
0095   void   SetLGHGCorr (double, int);
0096   void   SetLGHGCorr (double, int, int, int, int);
0097   void   SetLGHGCorrOff (double, int);
0098   void   SetLGHGCorrOff (double, int, int, int, int);
0099   void   SetHGLGCorr (double, int);
0100   void   SetHGLGCorr (double, int, int, int, int);
0101   void   SetHGLGCorrOff (double, int);
0102   void   SetHGLGCorrOff (double, int, int, int, int);
0103   void   SetBadChannel (short, int);
0104   void   SetBadChannel (short, int, int, int, int);
0105   
0106   int GetRunNumber(void);
0107   int GetRunNumberPed(void);
0108   int GetRunNumberMip(void);
0109   const TTimeStamp* GetBeginRunTime(void) const;
0110   const TTimeStamp* GetBeginRunTimePed(void) const;
0111   const TTimeStamp* GetBeginRunTimeMip(void) const;
0112   double GetVov(void);
0113   double GetVop(void);
0114   bool GetBCCalib(void);            // is bad channel map calculated
0115 
0116   void SetRunNumber(int);           // 
0117   void SetRunNumberPed(int);           // 
0118   void SetRunNumberMip(int);           // 
0119   void SetBeginRunTime(TTimeStamp); // 
0120   void SetBeginRunTimePed(TTimeStamp); // 
0121   void SetBeginRunTimeMip(TTimeStamp); // 
0122   void SetVop(double);              // 
0123   void SetVov(double);              // 
0124   void SetBCCalib(bool);            // Bad channel map calculated
0125 
0126   void PrintGlobalInfo();
0127   void PrintCalibToFile( TString );
0128   void ReadCalibFromTextFile( TString, int);
0129 
0130   inline std::map<int, TileCalib>::const_iterator begin() {return CaloCalib.cbegin();};
0131   inline std::map<int, TileCalib>::const_iterator end()   {return CaloCalib.cend();};
0132   
0133  private:
0134    
0135   std::map<int, TileCalib> CaloCalib;
0136   int RunNumber    = -1 ;
0137   int RunNumberPed = -1;
0138   int RunNumberMip = -1;
0139   TTimeStamp BeginRunTime;
0140   TTimeStamp BeginRunTimePed;
0141   TTimeStamp BeginRunTimeMip;
0142   double Vop;
0143   double Vov;
0144   bool BCcalc = false;
0145   ClassDef(Calib,5)
0146 };
0147 
0148 
0149 #endif