00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef CALPMTDRIFT_H
00012 #define CALPMTDRIFT_H
00013
00014 #include "TMath.h"
00015
00016 #include "DatabaseInterface/DbiTableRow.h"
00017 #include "DatabaseInterface/DbiValidityRec.h"
00018 #include "LeakChecker/Lea.h"
00019 #include "Plex/PlexPixelSpotId.h"
00020 #include "RawData/RawChannelId.h"
00021
00022 class DbiValidityRec;
00023
00024 class CalPmtDrift : public DbiTableRow
00025 {
00026 public:
00027 enum ECalPmtDriftTask {
00028 kPhotonStat = 1,
00029 kPinDrift = 2,
00030 kPhotonStatFarEnd = 3
00031 };
00032
00033
00034
00035 CalPmtDrift() { LEA_CTOR; }
00036
00037 CalPmtDrift( PlexPixelSpotId psid, RawChannelId rcid,
00038 Float_t drift, Float_t statError,
00039 Float_t sysError, Float_t spotsUsed,
00040 Float_t spotsAvailable, Float_t crudeDrift,
00041 Float_t minDrift, Float_t maxDrift);
00042 virtual ~CalPmtDrift(){ LEA_DTOR; };
00043
00044
00045 Bool_t CanL2Cache() const { return kTRUE; }
00046 UInt_t GetIndex(UInt_t) const { return fPmtId; }
00047 PlexPixelSpotId GetPmtId() const { return PlexPixelSpotId(fPmtId); };
00048 RawChannelId GetChannel() const { return RawChannelId(fChannelId); };
00049 Int_t GetCrate() const { return GetChannel().GetCrate(); };
00050 Int_t GetAggregateNo() const { return GetChannel().GetCrate(); };
00051 Float_t GetDrift() const { return fDrift; };
00052 Float_t GetError() const { return sqrt(fSysError*fSysError + fStatError*fStatError); };
00053 Float_t GetStatError() const { return fStatError; };
00054 Float_t GetSysError() const { return fSysError; };
00055 Float_t GetSpotsUsed() const { return fSpotsUsed; };
00056 Float_t GetSpotsAvailable() const { return fSpotsAvailable; };
00057 Float_t GetCrudeDrift() const { return fCrudeDrift; };
00058 Float_t GetMinDrift() const { return fMinDrift; };
00059 Float_t GetMaxDrift() const { return fMaxDrift; };
00060
00061 virtual DbiTableRow* CreateTableRow() const { return new CalPmtDrift; }
00062
00063
00064 virtual void Fill(DbiResultSet& rs,
00065 const DbiValidityRec* vrec);
00066 virtual void Store(DbiOutRowStream& ors,
00067 const DbiValidityRec* vrec) const;
00068
00069 private:
00070
00071 CalPmtDrift(const CalPmtDrift& from) : DbiTableRow(from) { LEA_CTOR; *this = from; };
00072
00073
00074 UInt_t fPmtId;
00075 UInt_t fChannelId;
00076 Float_t fDrift;
00077 Float_t fStatError;
00078 Float_t fSysError;
00079 Float_t fSpotsUsed;
00080 Float_t fSpotsAvailable;
00081 Float_t fCrudeDrift;
00082 Float_t fMinDrift;
00083 Float_t fMaxDrift;
00084
00085 ClassDef(CalPmtDrift,2)
00086 };
00087
00088
00089 #endif // CALPMTDRIFT_H
00090
00091
00092
00093
00094