00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef StBTofRawHit_hh
00029 #define StBTofRawHit_hh
00030
00031 #include <Stiostream.h>
00032 #include "StObject.h"
00033 #include "TMath.h"
00034
00035 class StBTofRawHit : public StObject {
00036 public:
00037 StBTofRawHit();
00038
00039 StBTofRawHit(char, unsigned char, unsigned char, unsigned int);
00040 ~StBTofRawHit();
00041
00042 int operator==(const StBTofRawHit&) const;
00043 int operator!=(const StBTofRawHit&) const;
00044
00045 bool leadingEdge() const;
00046 bool trailingEdge() const;
00047 int fiberId() const;
00048 int flag() const;
00049 int tray() const;
00050 int channel() const;
00051 unsigned int tdc() const;
00052
00053 void setFlag(char);
00054 void setTray(unsigned char);
00055 void setChannel(unsigned char);
00056 void setTdc(unsigned int);
00057
00058 protected:
00059 Char_t mFlag;
00060 UChar_t mTray;
00061 UChar_t mChannel;
00062 UInt_t mTdc;
00063
00064 ClassDef(StBTofRawHit,1)
00065 };
00066
00067 ostream& operator<<(ostream&, const StBTofRawHit&);
00068
00069 inline void
00070 StBTofRawHit::setFlag(char iflag)
00071 {
00072 mFlag = iflag;
00073 }
00074
00075 inline void
00076 StBTofRawHit::setTray(unsigned char itray)
00077 {
00078 mTray = itray;
00079 }
00080
00081 inline void
00082 StBTofRawHit::setChannel(unsigned char ichannel)
00083 {
00084 mChannel = ichannel;
00085 }
00086
00087 inline void
00088 StBTofRawHit::setTdc(unsigned int rawTdc)
00089 {
00090 mTdc = rawTdc;
00091 }
00092
00093 inline bool
00094 StBTofRawHit::leadingEdge() const
00095 {
00096 return (mFlag>0);
00097 }
00098
00099 inline bool
00100 StBTofRawHit::trailingEdge() const
00101 {
00102 return (mFlag<0);
00103 }
00104
00105 inline int
00106 StBTofRawHit::fiberId() const
00107 {
00108 return TMath::Abs(mFlag) - 1;
00109 }
00110
00111 inline int
00112 StBTofRawHit::flag() const
00113 {
00114 return mFlag;
00115 }
00116
00117 inline int
00118 StBTofRawHit::tray() const
00119 {
00120 return mTray;
00121 }
00122
00123 inline int
00124 StBTofRawHit::channel() const
00125 {
00126 return mChannel;
00127 }
00128
00129 inline unsigned int
00130 StBTofRawHit::tdc() const
00131 {
00132 return mTdc;
00133 }
00134
00135 #endif