00001 #ifndef CalibrationConstant_h
00002 #define CalibrationConstant_h 1
00003
00004 #include "lcio.h"
00005 #include "UTIL/LCFixedObject.h"
00006
00007 #define NINT 1
00008 #define NFLOAT 2
00009 #define NDOUBLE 0
00010
00011 class CalibrationConstant ;
00012
00020 class CalibrationConstant : public UTIL::LCFixedObject<NINT,NFLOAT,NDOUBLE> {
00021
00022 public:
00023
00026 CalibrationConstant(int cellID, float offset, float gain) {
00027
00028 obj()->setIntVal( 0 , cellID ) ;
00029 obj()->setFloatVal( 0 , offset ) ;
00030 obj()->setFloatVal( 1 , gain ) ;
00031 }
00032
00035 CalibrationConstant(LCObject* o) : UTIL::LCFixedObject<NINT,NFLOAT,NDOUBLE>(o) { }
00036
00038 virtual ~CalibrationConstant() { }
00039
00040
00041
00042 int getCellID() { return obj()->getIntVal(0) ; }
00043 float getOffset() { return obj()->getFloatVal( 0 ) ; }
00044 float getGain() { return obj()->getFloatVal( 1 ) ; }
00045
00046 void print( std::ostream& os ) ;
00047
00048
00049
00050
00051 const std::string getTypeName() const {
00052 return"CalibrationConstant" ;
00053 }
00054
00055 const std::string getDataDescription() const {
00056 return "i:cellID,f:offset,f:gain" ;
00057 }
00058
00059 };
00060
00061
00062 #endif
00063