StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofCell.h
1 
5 /***************************************************************************
6  *
7  * $Id: StTofCell.h,v 2.8 2008/03/31 20:09:35 ullrich Exp $
8  *
9  * Author: F. Geurts, May 2003
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Log: StTofCell.h,v $
17  * Revision 2.8 2008/03/31 20:09:35 ullrich
18  * Changed typr of mLeadingEdgeTime and mTrailingEdgeTime from float to double
19  *
20  * Revision 2.7 2007/09/19 17:32:18 ullrich
21  * New member (mLeadingEdgeTime, mTrailingEdgeTime) and related functions and updates added.
22  *
23  * Revision 2.6 2004/06/14 23:54:38 jeromel
24  * Corrected typo
25  *
26  * Revision 2.5 2004/06/11 19:36:48 ullrich
27  * Added implementation of zHit().
28  *
29  * Revision 2.4 2004/02/05 17:59:31 ullrich
30  * Changed $LINK to StLink mechanism and add new member.
31  *
32  * Revision 2.3 2003/08/28 23:24:17 jeromel
33  * Modif in class
34  *
35  * Revision 2.2 2003/08/05 17:12:32 ullrich
36  * Added position() methods and member.
37  *
38  * Revision 2.1 2003/05/21 18:24:20 ullrich
39  * Initial Revision.
40  *
41  **************************************************************************/
42 #ifndef StTofCell_hh
43 #define StTofCell_hh
44 
45 #include "StObject.h"
46 #include "StThreeVectorD.hh"
47 #include "StContainers.h"
48 
49 class StTrack;
50 
51 class StTofCell : public StObject {
52 public:
53  StTofCell();
54  StTofCell(int, int, int, int, int, int, StTrack*,
55  float, int, const StThreeVectorD&);
56  StTofCell(int, int, int, int, StTrack*,
57  float, int, const StThreeVectorD&);
58  ~StTofCell();
59 
60  int operator==(const StTofCell&) const;
61  int operator!=(const StTofCell&) const;
62 
63  int trayIndex() const;
64  int moduleIndex() const;
65  int cellIndex() const;
66  int daqIndex() const;
67  int adc() const;
68  int tdc() const;
69  double leadingEdgeTime() const;
70  double trailingEdgeTime() const;
71  float tot() const;
72  StTrack* associatedTrack();
73  const StTrack* associatedTrack() const;
74  float zHit() const;
75  int matchFlag() const;
76  const StThreeVectorD& position() const;
77 
78  void setTrayIndex(int);
79  void setModuleIndex(int);
80  void setCellIndex(int);
81  void setDaqIndex(int);
82  void setAdc(int);
83  void setTdc(int);
84  void setLeadingEdgeTime(double);
85  void setTrailingEdgeTime(double);
86  void setAssociatedTrack(StTrack*);
87  void setZHit(float);
88  void setMatchFlag(int);
89  void setPosition(const StThreeVectorD&);
90 
91 protected:
92  Int_t mTrayIndex;
93  Int_t mModuleIndex;
94  Int_t mCellIndex;
95  Int_t mDaqIndex;
96  Int_t mAdc;
97  Int_t mTdc;
98  Double_t mLeadingEdgeTime;
99  Double_t mTrailingEdgeTime;
100  // StTrack* mAssociatedTrack; //$LINK
101 #ifdef __CINT__
102  StObjLink mAssociatedTrack;
103 #else
104  StLink<StTrack> mAssociatedTrack;
105 #endif //__CINT__
106  Float_t mZhit;
107  Int_t mMatchFlag;
108  StThreeVectorD mPosition;
109 
110  ClassDef(StTofCell,4)
111 };
112 
113 
114 inline void
115 StTofCell::setTrayIndex(int trayId)
116 {
117  mTrayIndex = trayId;
118 }
119 
120 inline void
121 StTofCell::setModuleIndex(int moduleId)
122 {
123  mModuleIndex = moduleId;
124 }
125 
126 inline void
127 StTofCell::setCellIndex(int cellId)
128 {
129  mCellIndex = cellId;
130 }
131 
132 inline void
133 StTofCell::setDaqIndex(int daqId)
134 {
135  mDaqIndex = daqId;
136 }
137 
138 inline void
139 StTofCell::setAdc(int rawAdc)
140 {
141  mAdc = rawAdc;
142 }
143 
144 inline void
145 StTofCell::setTdc(int rawTdc)
146 {
147  mTdc = rawTdc;
148 }
149 
150 inline void
151 StTofCell::setLeadingEdgeTime(double val)
152 {
153  mLeadingEdgeTime = val;
154 }
155 
156 inline void
157 StTofCell::setTrailingEdgeTime(double val)
158 {
159  mTrailingEdgeTime = val;
160 }
161 
162 inline void
163 StTofCell::setZHit(float zhit) {mZhit = zhit;}
164 
165 inline void
166 StTofCell::setMatchFlag(int flag)
167 {
168  mMatchFlag = flag;
169 }
170 
171 inline int
172 StTofCell::trayIndex() const
173 {
174  return mTrayIndex;
175 }
176 
177 inline int
178 StTofCell::moduleIndex() const
179 {
180  return mModuleIndex;
181 }
182 
183 inline int
184 StTofCell::cellIndex() const
185 {
186  return mCellIndex;
187 }
188 
189 inline int
190 StTofCell::daqIndex() const
191 {
192  return mDaqIndex;
193 }
194 
195 inline int
196 StTofCell::adc() const
197 {
198  return mAdc;
199 }
200 
201 inline int
202 StTofCell::tdc() const
203 {
204  return mTdc;
205 }
206 
207 inline double
208 StTofCell::leadingEdgeTime() const
209 {
210  return mLeadingEdgeTime;
211 }
212 
213 inline double
214 StTofCell::trailingEdgeTime() const
215 {
216  return mTrailingEdgeTime;
217 }
218 
219 inline float
220 StTofCell::tot() const
221 {
222  return mTrailingEdgeTime - mLeadingEdgeTime;
223 }
224 
225 inline int
226 StTofCell::matchFlag() const
227 {
228  return mMatchFlag;
229 }
230 
231 inline float
232 StTofCell::zHit() const
233 {
234  return mZhit;
235 }
236 
237 #endif