Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CalPmtDrift.h

Go to the documentation of this file.
00001 
00002 // $Id: CalPmtDrift.h,v 1.5 2007/01/15 13:07:33 west Exp $
00003 // CalPmtDrift
00004 //
00005 // DB Row class corresponding to a single attenuation curve along a strip.
00006 //
00007 //
00008 // Nathaniel Tagg n.tagg1@physics.ox.ac.uk
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,  // Task 1: Data uses mean/rms2 to get PMT gains
00029     kPinDrift = 2,    // Task 2: Data is from ADC/PIN
00030     kPhotonStatFarEnd = 3 // Task 3: as 1, but uses far end of flashed strip
00031   };
00032 
00033  
00034   // Constructors and destructors.
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   // State testing member functions
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   // State changing member functions
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   // Data members
00074   UInt_t  fPmtId;
00075   UInt_t  fChannelId; // Used to encode readout crate, which is used as the aggregate
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)    // Example of non-aggregated datadata type. 
00086 };
00087 
00088 
00089 #endif  // CALPMTDRIFT_H
00090 
00091 
00092 
00093 
00094 

Generated on Mon Feb 15 11:06:27 2010 for loon by  doxygen 1.3.9.1