StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFtpcHit.cxx
1 /***************************************************************************
2  *
3  * $Id: StFtpcHit.cxx,v 2.13 2009/11/23 16:34:06 fisyak Exp $
4  *
5  * Author: Thomas Ullrich, Jan 1999
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StFtpcHit.cxx,v $
13  * Revision 2.13 2009/11/23 16:34:06 fisyak
14  * Cleanup, remove dependence on dst tables, clean up software monitors
15  *
16  * Revision 2.12 2004/09/15 17:20:54 ullrich
17  * Updated from Janet (unpacking of bits).
18  *
19  * Revision 2.11 2004/07/15 16:36:24 ullrich
20  * Removed all clone() declerations and definitions. Use StObject::clone() only.
21  *
22  * Revision 2.10 2004/05/07 15:05:28 calderon
23  * Adding constructor based on StFtpcPoint from Markus.
24  *
25  * Revision 2.9 2004/04/08 19:02:33 ullrich
26  * Added additional data member and access methods to hold the position in
27  * pad and time units including their std deviation. Constructors updated.
28  *
29  * Revision 2.8 2001/04/05 04:00:50 ullrich
30  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
31  *
32  * Revision 2.7 2001/03/24 03:34:46 perev
33  * clone() -> clone() const
34  *
35  * Revision 2.6 2000/06/01 21:38:49 ullrich
36  * Added member mFlag and access member flag() and setFlag().
37  *
38  * Revision 2.5 1999/12/13 20:16:12 ullrich
39  * Changed numbering scheme for hw_position unpack methods (STAR conventions).
40  *
41  * Revision 2.4 1999/12/06 18:28:21 ullrich
42  * Changed method names xxxInCluster to xxxInHit
43  *
44  * Revision 2.3 1999/11/09 19:35:09 ullrich
45  * Memory now allocated using StMemoryPool via overloaded new/delete
46  *
47  * Revision 2.2 1999/11/04 21:40:49 ullrich
48  * Added missing default constructor
49  *
50  * Revision 2.1 1999/10/28 22:25:16 ullrich
51  * Adapted new StArray version. First version to compile on Linux and Sun.
52  *
53  * Revision 2.0 1999/10/12 18:42:02 ullrich
54  * Completely Revised for New Version
55  *
56  **************************************************************************/
57 #include "StFtpcHit.h"
58 #include "StFtpcTrackMaker/StFtpcPoint.hh"
59 #include "StTrack.h"
60 
61 static const char rcsid[] = "$Id: StFtpcHit.cxx,v 2.13 2009/11/23 16:34:06 fisyak Exp $";
62 
63 StMemoryPool StFtpcHit::mPool(sizeof(StFtpcHit));
64 
65 ClassImp(StFtpcHit)
66 
68 {
69  mPadPos = 0;
70  mTimePos = 0;
71  mPadPosSigma = 0;
72  mTimePosSigma = 0;
73 }
74 
75 StFtpcHit::StFtpcHit(const StThreeVectorF& p,
76  const StThreeVectorF& e,
77  unsigned int hw, float q, unsigned char c)
78  : StHit(p, e, hw, q, c)
79 {
80  mPadPos = 0;
81  mTimePos = 0;
82  mPadPosSigma = 0;
83  mTimePosSigma = 0;
84 }
85 
86 
87 StFtpcHit::StFtpcHit(const StFtpcPoint& pt)
88 {
89  update(pt);
90 }
91 
92 void StFtpcHit::update(const StFtpcPoint& pt)
93 {
94  //
95  // charge and status flag
96  //
97  const unsigned int iflag = pt.GetFlags();
98  const unsigned int ftpcq = pt.GetCharge();
99  mCharge = float(ftpcq)/(1<<16);
100  mFlag = static_cast<unsigned char>(iflag);
101 
102  //
103  // position in xyz
104  //
105  mPosition.setX(pt.GetX());
106  mPosition.setY(pt.GetY());
107  mPosition.setZ(pt.GetZ());
108 
109  //
110  // error on position in xyz
111  //
112  mPositionError.setX(pt.GetXerr());
113  mPositionError.setY(pt.GetYerr());
114  mPositionError.setZ(pt.GetZerr());
115 
116  //
117  // The hardware position stays as it is
118  //
119  mHardwarePosition = pt.GetHardwarePosition();
120 
121  mPadPos = pt.GetPadPos();
122  mTimePos = pt.GetTimePos();
123  mPadPosSigma = pt.GetPadPosSigma();
124  mTimePosSigma = pt.GetTimePosSigma();
125 }
126 
127 StFtpcHit::~StFtpcHit() {/* noop */}
128 
129 unsigned int
130 StFtpcHit::sector() const
131 {
132  return bits(9, 3); // bits 9-11
133 }
134 
135 unsigned int
136 StFtpcHit::plane() const
137 {
138  return bits(4, 5); // bits 4-8
139 }
140 
141 unsigned int
142 StFtpcHit::padsInHit() const
143 {
144  return bits(12, 8); // bits 12-19
145 }
146 
147 unsigned int
148 StFtpcHit::timebinsInHit() const
149 {
150  return bits(20, 9); // bits 20-28
151 }
152 
Definition: StHit.h:125