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 #define ID_INDEX 0
00012 #define OFFSET_INDEX 0
00013 #define GAIN_INDEX 1
00014
00015 using namespace lcio ;
00016
00017 class CalibrationConstant ;
00018
00026 class CalibrationConstant : public LCFixedObject<NINT,NFLOAT,NDOUBLE> {
00027
00028 public:
00029
00032 CalibrationConstant(int cellID, float offset, float gain) {
00033
00034 obj()->setIntVal( ID_INDEX , cellID ) ;
00035 obj()->setFloatVal( OFFSET_INDEX , offset ) ;
00036 obj()->setFloatVal( GAIN_INDEX , gain ) ;
00037 }
00038
00041 CalibrationConstant(LCObject* obj) : LCFixedObject<NINT,NFLOAT,NDOUBLE>(obj) { }
00042
00044 virtual ~CalibrationConstant() { }
00045
00046
00047
00048 int getCellID() { return obj()->getIntVal( ID_INDEX ) ; }
00049 float getOffset() { return obj()->getFloatVal( OFFSET_INDEX ) ; }
00050 float getGain() { return obj()->getFloatVal( GAIN_INDEX ) ; }
00051
00052 void print( std::ostream& os ) ;
00053
00054
00055
00056
00057 const std::string getTypeName() const {
00058 return"CalibrationConstant" ;
00059 }
00060
00061 const std::string getDataDescription() const {
00062 return "i:cellID,f:offset,f:gain" ;
00063 }
00064
00065 };
00066
00067
00068 #endif
00069