StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstHit.cxx
1 /***************************************************************************
2 *
3 * $Id: StIstHit.cxx,v 2.1 2014/04/10 16:25:24 jeromel Exp $
4 *
5 * Author: Yaping Wang, March 2013
6 ****************************************************************************
7 * Description:
8 * See header file.
9 ***************************************************************************/
10 
11 #include "StIstHit.h"
12 
13 
14 StMemoryPool StIstHit::mPool(sizeof(StIstHit));
15 
16 
17 StIstHit::StIstHit(unsigned char ladder, unsigned char sensor, float charge, float chargeErr, unsigned char maxTB,
18  unsigned char nRawHits, unsigned char nRawHitsZ, unsigned char nRawHitsRPhi) : StHit(),
19  mMaxTimeBin(maxTB),
20  mChargeErr(chargeErr),
21  mNRawHits(nRawHits),
22  mNRawHitsZ(nRawHitsZ),
23  mNRawHitsRPhi(nRawHitsRPhi),
24  mLocalPosition(),
25  mDetectorId(kIstId)
26 {
27  StHit::setHardwarePosition((ladder - 1)*kIstNumSensorsPerLadder + sensor);
28  StHit::setCharge(charge);
29 }
30 
31 
32 StIstHit::StIstHit(const StThreeVectorF &p, const StThreeVectorF &e, unsigned int hw, float q, unsigned char c) :
33  StHit(p, e, hw, q, c),
34  mMaxTimeBin(0),
35  mChargeErr(0),
36  mNRawHits(1),
37  mNRawHitsZ(0),
38  mNRawHitsRPhi(0),
39  mLocalPosition(),
40  mDetectorId(kIstId)
41 {
42 }
43 
44 
45 StDetectorId StIstHit::detector() const {return mDetectorId;}
46 
47 void StIstHit::setDetectorId(StDetectorId id) {mDetectorId = id;}
48 
49 void StIstHit::setLocalPosition(float vRPhi, float vY, float vZ)
50 {
51  mLocalPosition[0] = vRPhi;
52  mLocalPosition[1] = vY;
53  mLocalPosition[2] = vZ;
54 }
55 
56 float StIstHit::localPosition(unsigned int i) const
57 {
58  if (i < 3)
59  return mLocalPosition[i];
60  else
61  return 0;
62 }
63 
64 ostream &operator<<(ostream &os, const StIstHit &hit)
65 {
66  os << "IST Hit -I- ladder: " << static_cast<int>(hit.getLadder())
67  << " sensor: " << static_cast<int>(hit.getSensor())
68  << " localPosition[0]/localPosition[2] : " << hit.localPosition(0)
69  << "/" << hit.localPosition(2)
70  << " ADC : " << hit.charge() << "+-" << hit.getChargeErr()
71  << " detector: " << hit.detector()
72  << endl;
73  return os;
74 }
75 
76 ClassImp(StIstHit);
77 
78 
79 /***************************************************************************
80 *
81 * $Log: StIstHit.cxx,v $
82 * Revision 2.1 2014/04/10 16:25:24 jeromel
83 * Forgot source - added
84 *
85 * Revision 1.8 2014/03/13 22:10:30 smirnovd
86 * Expand tabs and trim trailing whitespace
87 *
88 * Revision 1.7 2014/03/13 22:10:21 smirnovd
89 * Fixed constructor's initialization list
90 *
91 * Revision 1.6 2014/03/13 22:10:12 smirnovd
92 * Move some constants from StIstUtil/StIstConsts.h to StEvent/StEnumerations.h to avoid external dependance of StEvent on StIstUtil
93 *
94 * Revision 1.5 2014/02/26 21:18:08 smirnovd
95 * Style corrected with astyle -s3 -p -H -A3 -k3 -O -o -y -Y -f
96 *
97 * Revision 1.4 2014/02/26 01:35:36 ypwang
98 * get rid of meanColumn/meanRow/Apv transformations and local position uncertainties to avoid external constants access
99 *
100 * Revision 1.3 2014/02/25 17:04:50 ypwang
101 * get rid of mClusteringType and its accessory/modifier functions
102 *
103 * Revision 1.2 2014/01/29 18:25:00 ypwang
104 * updating scripts
105 *
106 *
107 ****************************************************************************
108 * StIstHit.cxx,v 1.0
109 * Revision 1.0 2013/11/04 15:25:30 Yaping
110 * Initial version
111 ****************************************************************************/
Definition: StHit.h:125
const int kIstNumSensorsPerLadder
6 sensor per one IST Ladder
Float_t mLocalPosition[3]
local position of hit inside the sensor
Definition: StIstHit.h:59