00001 // $Id: FabNDThickness.h,v 1.2 2008/03/05 15:16:48 rhatcher Exp $ 00002 00003 #ifndef FABNDTHICKNESS_H 00004 #define FABNDTHICKNESS_H 00005 00007 // FabNDThickness 00008 // 00009 // Package: Fabrication 00010 // 00011 // Purpose: Record the NearDet ultrasound plate thickness measurements. 00012 // 00013 // R. Hatcher 2008-02-22 00015 00016 #include "DatabaseInterface/DbiTableRow.h" 00017 #include "LeakChecker/Lea.h" 00018 00019 #include "Validity/VldContext.h" 00020 00021 #include "TMath.h" 00022 #include <cassert> 00023 00024 class DbiValidityRec; 00025 00026 class FabNDThickness; 00027 std::ostream& operator<<(std::ostream& os, const FabNDThickness& pi); 00028 00029 class FabNDThickness : public DbiTableRow 00030 { 00031 00032 public: 00033 00034 // Constructors and destructors. 00035 00036 static const unsigned int npts; 00037 00038 FabNDThickness() : fPlane(-1) 00039 { LEA_CTOR; for (unsigned int i=0; i<npts; i++) fTK[i] = 0.0; }; 00040 00041 virtual ~FabNDThickness(){ LEA_DTOR; }; 00042 00043 // State testing member functions 00044 00045 int GetPlane() const { return fPlane; } 00046 float GetThickness(int i) const 00047 { if ( i<0 || i >= (int)npts ) assert(0); return fTK[i]; } 00048 const float* GetData() const { return fTK; } 00049 float GetMean() const { return TMath::Mean(npts,fTK,0); } 00050 float GetRMS() const { return TMath::RMS(npts,fTK); } 00051 00052 static float GetXPos(int i); 00053 static float GetYPos(int i); 00054 00055 virtual DbiTableRow* CreateTableRow() const { return new FabNDThickness; } 00056 00057 // I/O member functions 00058 00059 virtual void Fill(DbiResultSet& rs, 00060 const DbiValidityRec* vrec); 00061 virtual void Store(DbiOutRowStream& ors, 00062 const DbiValidityRec* vrec) const; 00063 00064 virtual void Print(Option_t *option = "") const; 00065 virtual std::ostream& FormatToOStream(std::ostream& os, 00066 Option_t *option="") const; 00067 00068 virtual Int_t GetAggregateNo() const; 00069 virtual UInt_t GetIndex(UInt_t defIndex) const; 00070 00071 static const char* GetTableDescr(); 00072 static void SetDefensiveUnpkg(Bool_t defensive) 00073 { fgDefensiveUnpkg = defensive; } 00074 static Bool_t GetDefensiveUnpkg() { return fgDefensiveUnpkg; } 00075 00076 private: 00077 00078 // Constructors and destructors. 00079 00080 FabNDThickness(const FabNDThickness& from) 00081 : DbiTableRow(from) { LEA_CTOR; *this = from; } 00082 00083 // Data members 00084 00085 int fPlane; // plane # 00086 float fTK[37]; // measurements 00087 00088 // class-wide static 00089 00090 static Bool_t fgDefensiveUnpkg; 00091 00092 const static float xfeet[37]; 00093 const static float yfeet[37]; 00094 00095 ClassDef(FabNDThickness,0) 00096 00097 }; 00098 00099 #endif // FABNDTHICKNESS_H
1.3.9.1