Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

TCalibration.h

Go to the documentation of this file.
00001 // TCalibration.h.
00002 // author  JEP.
00003 // brief   TCalibration base-class.
00004 // version 1.1.
00005 // date    June 2004.
00006 //
00007 #ifndef TCALIBRATION_H
00008 #define TCALIBRATION_H
00009 
00010 #include <vector>
00011 
00012 #include "TDataItem.h"
00013 
00014 using std::vector;
00015 
00016 class TCalibration {
00017 public:
00018   TCalibration(UShort_t = 1);
00019   TCalibration(const TCalibration &);
00020   ~TCalibration();
00021   TCalibration & operator=(const TCalibration &);
00022   void Clear(const Char_t * = "");
00023   void Print(const Char_t * = "") const;
00024   void SetChannels(UInt_t);
00025   void SetBitMask();
00026   void AddToChannel(UInt_t, UShort_t);
00027   void AddToMap(UInt_t, UShort_t);
00028   void AddToOffset(UInt_t, Short_t);
00029   void AddToGain(UInt_t, Float_t);
00030   void AddToHistogramMap(UInt_t, UShort_t);
00031   void Calibrate(const vector<const TDataItem<UShort_t> *> &,
00032                  vector<const TDataItem<Float_t> *> &) const;
00033   UShort_t GetChannels() const;
00034   UShort_t GetHistogramMap(UInt_t) const;
00035   Bool_t TestChannel(UInt_t) const;
00036   Bool_t IsSet() const;
00037 
00038 private:
00042   UShort_t fChannels;
00046   Bool_t fCalSet;
00049   vector<UShort_t> fChannel;
00052   vector<UShort_t> fMap;
00055   vector<Short_t> fOffset;
00058   vector<Float_t> fGain;
00061   vector<UShort_t> fMapH;
00066   size_t fBits;
00069   UInt_t fMaskMax;
00072   UInt_t *fBitMask;
00073 };
00074 
00075 inline UShort_t TCalibration::GetChannels() const
00076 {
00080   return fChannels;
00081 }
00082 
00083 inline UShort_t TCalibration::GetHistogramMap(UInt_t channel) const
00084 {
00093   return fMapH[channel];
00094 }
00095  
00096 inline Bool_t TCalibration::TestChannel(UInt_t dataChannel) const
00097 {
00104   return (dataChannel / fBits < fMaskMax &&
00105           (fBitMask[dataChannel / fBits] >> dataChannel % fBits) & 0x0001 == 1);
00106 }
00107 
00108 inline Bool_t TCalibration::IsSet() const
00109 {
00115   return fCalSet;
00116 }
00117 
00118 #endif // TCalibration.h

Generated on Mon Jan 8 11:54:31 2007 for DragonRoot by  doxygen 1.3.9.1