StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdHit.cxx
1 /***************************************************************************
2  *
3  * $Id: StSsdHit.cxx,v 2.14 2009/11/23 22:20:51 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Jan 1999
6  * Lilian Martin, Dec 1999
7  ***************************************************************************
8  *
9  * Description:
10  *
11  ***************************************************************************
12  *
13  * $Log: StSsdHit.cxx,v $
14  * Revision 2.14 2009/11/23 22:20:51 ullrich
15  * Minor cleanup performed, fixed compiler warnings.
16  *
17  * Revision 2.13 2009/11/23 16:34:07 fisyak
18  * Cleanup, remove dependence on dst tables, clean up software monitors
19  *
20  * Revision 2.12 2009/11/10 00:40:17 ullrich
21  * Changed print-out format.
22  *
23  * Revision 2.11 2006/04/27 21:58:53 ullrich
24  * Added data member and methods to deal with local positions.
25  *
26  * Revision 2.10 2005/12/19 19:24:10 ullrich
27  * Applied patch by A. Kiesel to fix tp correct decoding of hardware info.
28  *
29  * Revision 2.9 2004/07/15 16:36:25 ullrich
30  * Removed all clone() declerations and definitions. Use StObject::clone() only.
31  *
32  * Revision 2.8 2001/04/05 04:00:55 ullrich
33  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
34  *
35  * Revision 2.7 2001/03/24 03:34:58 perev
36  * clone() -> clone() const
37  *
38  * Revision 2.6 2000/06/01 21:39:00 ullrich
39  * Added member mFlag and access member flag() and setFlag().
40  *
41  * Revision 2.5 2000/01/05 16:05:37 ullrich
42  * Updated for actual use in StEvent. Unpacking changed.
43  *
44  * Revision 2.4 1999/11/09 19:35:15 ullrich
45  * Memory now allocated using StMemoryPool via overloaded new/delete
46  *
47  * Revision 2.3 1999/11/04 21:40:52 ullrich
48  * Added missing default constructor
49  *
50  * Revision 2.2 1999/10/28 22:26:36 ullrich
51  * Adapted new StArray version. First version to compile on Linux and Sun.
52  *
53  * Revision 2.1 1999/10/13 19:45:11 ullrich
54  * Initial Revision
55  *
56  **************************************************************************/
57 #include "StSsdHit.h"
58 #include "StTrack.h"
59 
60 static const char rcsid[] = "$Id: StSsdHit.cxx,v 2.14 2009/11/23 22:20:51 ullrich Exp $";
61 
62 StMemoryPool StSsdHit::mPool(sizeof(StSsdHit));
63 
64 ClassImp(StSsdHit)
65 
67 {
68  mLocalPosition[0] = 0;
69  mLocalPosition[1] = 0;
70 }
71 
72 
73 StSsdHit::StSsdHit(const StThreeVectorF& p,
74  const StThreeVectorF& e,
75  unsigned int hw, float q, unsigned char c)
76  : StHit(p, e, hw, q, c)
77 {
78  mLocalPosition[0] = 0;
79  mLocalPosition[1] = 0;
80 }
81 
82 
83 StSsdHit::~StSsdHit() {/* noop */}
84 
85 unsigned int
86 StSsdHit::ladder() const
87 {
88  unsigned long numwaf = (mHardwarePosition>>4) & ~(~0UL<<9);
89  return (numwaf/mWaferPerLadder+1);
90 }
91 
92 unsigned int
93 StSsdHit::wafer() const
94 {
95  unsigned long numwaf = (mHardwarePosition>>4) & ~(~0UL<<9);
96  return (numwaf-(numwaf/mWaferPerLadder)*mWaferPerLadder+1);
97 }
98 
99 unsigned int
100 StSsdHit::centralStripNSide() const
101 {
102  return bits(13, 10); // bits 13-22
103 }
104 
105 unsigned int
106 StSsdHit::centralStripPSide() const
107 {
108  return (bits(23, 5)+bits(13,10)-15); // bits 23-27
109 }
110 
111 unsigned int
112 StSsdHit::clusterSizeNSide() const
113 {
114  return bits(28, 2)+1; // bits 28-29
115 }
116 
117 unsigned int
118 StSsdHit::clusterSizePSide() const
119 {
120  return bits(30, 2)+1; // bits 30-31
121 }
122 
123 float
124 StSsdHit::localPosition(unsigned int i) const
125 {
126  if (i<2)
127  return mLocalPosition[i];
128  else
129  return 0;
130 }
131 
132 void
133 StSsdHit::setLocalPosition(float u, float v)
134 {
135  mLocalPosition[0] = u;
136  mLocalPosition[1] = v;
137 }
138 
139 int
140 StSsdHit::volumeID() const {return 10000 * sector() + 7000 + 100 * wafer() + ladder();}
141 
142 ostream& operator<<(ostream& os, const StSsdHit& v)
143 {
144  return os << Form("Ssd l:%2i w:%2i",v.ladder(), v.wafer())
145  << *((StHit *)&v)
146  << Form(" Luv: %8.3f %8.3f",v.localPosition(0),v.localPosition(1));
147 }
148 void StSsdHit::Print(const Option_t *option) const { cout << *this << endl;}
Definition: StHit.h:125