emcTracedValue.h

Go to the documentation of this file.
00001 #ifndef  __EMCTRACEDVALUE_H__
00002 #define  __EMCTRACEDVALUE_H__
00003 
00004 #include <Rtypes.h>
00005 #include <iosfwd>
00006 #include <cstdio>
00007 
00016 class emcTracedValue
00017 {
00018  public:
00019 
00021   emcTracedValue(Float_t* bp=0, bool isconstant=false);
00022 
00024   emcTracedValue(int thetime, float constant, float slope, bool isconstant=false); 
00025 
00027   emcTracedValue(const emcTracedValue&);
00028 
00030   emcTracedValue& operator=(const emcTracedValue&);
00031 
00033   ~emcTracedValue() {};
00034 
00036   bool isConstant(void) const { return fIsConstant; }
00037 
00039   int GetX(void) const { return (int)GLine[0]; }
00040 
00042   float GetConstant(void) const { return GLine[1]; }
00043 
00045   float GetSlope(void) const { return GLine[2]; }
00046 
00049   inline Float_t getValue(void) { return GLine[1]; }
00050 
00053   Float_t getValue(Float_t _x);
00054         
00055 
00057   inline Float_t getValue(Int_t _x) { 
00058     return getValue(static_cast<Float_t>(_x)); }
00059 
00061   void MakeConstant(bool isconstant=true) { fIsConstant = isconstant; }
00062 
00064   void readData(FILE *);
00065 
00067   void Set(int x, float constant, float slope, bool isconstant);
00068 
00070   void Set(int x, float constant, float slope);
00071 
00073   void writeData(FILE *);
00074   
00076   Bool_t operator== (const Int_t & time)
00077     {return ( GLine[0] == float(time)) ? kTRUE : kFALSE;} 
00079   Bool_t operator>  (const Int_t & time)
00080     {return ( GLine[0] >  float(time)) ? kTRUE : kFALSE;} 
00082   Bool_t operator<  (const Int_t & time)
00083     {return ( GLine[0] <  float(time)) ? kTRUE : kFALSE;} 
00085   Bool_t operator== (const emcTracedValue & GL)
00086     {return ( GLine[0] == GL.GLine[0]) ? kTRUE : kFALSE;} 
00088   Bool_t operator>  (const emcTracedValue & GL)
00089     {return ( GLine[0] >  GL.GLine[0]) ? kTRUE : kFALSE;} 
00091   Bool_t operator<  (const emcTracedValue & GL)
00092     {return ( GLine[0] <  GL.GLine[0]) ? kTRUE : kFALSE;} 
00093 
00094  protected:
00096   Float_t  GLine[3]; 
00097   bool fIsConstant;
00098 
00100   friend std::ostream& operator << (std::ostream&, const emcTracedValue&);
00101 };
00102 
00103 #endif