StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofRawHit.h
1 
5 /***************************************************************************
6  *
7  * $Id: StBTofRawHit.h,v 2.3 2009/08/25 15:41:28 fine Exp $
8  *
9  * Author: Xin Dong, Nov 2008
10  ***************************************************************************
11  *
12  * Description: TOF raw hits from daq
13  *
14  ***************************************************************************
15  *
16  * $Log: StBTofRawHit.h,v $
17  * Revision 2.3 2009/08/25 15:41:28 fine
18  * fix the compilation issues under SL5_64_bits gcc 4.3.2
19  *
20  * Revision 2.2 2009/01/15 00:48:10 ullrich
21  * mLeTeFlag changed to mFlag, tray(), module(), cell() now return int.
22  *
23  * Revision 2.1 2008/12/22 20:31:01 ullrich
24  * Initial Revision.
25  *
26  *
27  **************************************************************************/
28 #ifndef StBTofRawHit_hh
29 #define StBTofRawHit_hh
30 
31 #include <Stiostream.h>
32 #include "StObject.h"
33 #include "TMath.h"
34 
35 class StBTofRawHit : public StObject {
36 public:
37  StBTofRawHit();
38 
39  StBTofRawHit(char, unsigned char, unsigned char, unsigned int);
40  ~StBTofRawHit();
41 
42  int operator==(const StBTofRawHit&) const;
43  int operator!=(const StBTofRawHit&) const;
44 
45  bool leadingEdge() const;
46  bool trailingEdge() const;
47  int fiberId() const;
48  int flag() const;
49  int tray() const;
50  int channel() const;
51  unsigned int tdc() const;
52 
53  void setFlag(char);
54  void setTray(unsigned char);
55  void setChannel(unsigned char);
56  void setTdc(unsigned int);
57 
58 protected:
59  Char_t mFlag;
60  UChar_t mTray;
61  UChar_t mChannel;
62  UInt_t mTdc;
63 
64  ClassDef(StBTofRawHit,1)
65 };
66 
67 ostream& operator<<(ostream&, const StBTofRawHit&); // Printing operator
68 
69 inline void
70 StBTofRawHit::setFlag(char iflag)
71 {
72  mFlag = iflag;
73 }
74 
75 inline void
76 StBTofRawHit::setTray(unsigned char itray)
77 {
78  mTray = itray;
79 }
80 
81 inline void
82 StBTofRawHit::setChannel(unsigned char ichannel)
83 {
84  mChannel = ichannel;
85 }
86 
87 inline void
88 StBTofRawHit::setTdc(unsigned int rawTdc)
89 {
90  mTdc = rawTdc;
91 }
92 
93 inline bool
94 StBTofRawHit::leadingEdge() const
95 {
96  return (mFlag>0);
97 }
98 
99 inline bool
100 StBTofRawHit::trailingEdge() const
101 {
102  return (mFlag<0);
103 }
104 
105 inline int
107 {
108  return TMath::Abs(mFlag) - 1;
109 }
110 
111 inline int
112 StBTofRawHit::flag() const
113 {
114  return mFlag;
115 }
116 
117 inline int
118 StBTofRawHit::tray() const
119 {
120  return mTray;
121 }
122 
123 inline int
124 StBTofRawHit::channel() const
125 {
126  return mChannel;
127 }
128 
129 inline unsigned int
130 StBTofRawHit::tdc() const
131 {
132  return mTdc;
133 }
134 
135 #endif
int fiberId() const
Definition: StBTofRawHit.h:106