StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFstHit.cxx
1 /***************************************************************************
2 * $Id: StFstHit.cxx$
3 *
4 * Author: Shenghui Zhang, Oct. 2021
5 ****************************************************************************
6 * Description:
7 * See header file.
8 ***************************************************************************/
9 
10 #include "StFstHit.h"
11 
12 
13 StMemoryPool StFstHit::mPool(sizeof(StFstHit));
14 
15 
16 StFstHit::StFstHit(unsigned char disk, unsigned char wedge, unsigned char sensor, unsigned char apv, float charge, float chargeErr, unsigned char maxTB, float meanRStrip, float meanPhiStrip,
17  unsigned char nRawHits, unsigned char nRawHitsR, unsigned char nRawHitsPhi) : StHit(),
18  mApv(apv),
19  mMaxTimeBin(maxTB),
20  mMeanRStrip(meanRStrip),
21  mMeanPhiStrip(meanPhiStrip),
22  mChargeErr(chargeErr),
23  mNRawHits(nRawHits),
24  mNRawHitsR(nRawHitsR),
25  mNRawHitsPhi(nRawHitsPhi),
26  mLocalPosition(),
27  mDetectorId(kFstId)
28 {
29  StHit::setHardwarePosition(1 + (wedge - 1)*kFstNumSensorsPerWedge + sensor);
30  StHit::setCharge(charge);
31 }
32 
33 
34 StFstHit::StFstHit(const StThreeVectorF &p, const StThreeVectorF &e, unsigned int hw, float q, unsigned char c) :
35  StHit(p, e, hw, q, c),
36  mApv(-1),
37  mMaxTimeBin(0),
38  mMeanRStrip(-1),
39  mMeanPhiStrip(-1),
40  mChargeErr(0),
41  mNRawHits(1),
42  mNRawHitsR(0),
43  mNRawHitsPhi(0),
44  mLocalPosition{0},
45  mDetectorId(kFstId)
46 {
47 }
48 
49 
50 StDetectorId StFstHit::detector() const {return mDetectorId;}
51 
52 void StFstHit::setDetectorId(StDetectorId id) {mDetectorId = id;}
53 
54 void StFstHit::setLocalPosition(float vR, float vPhi, float vZ)
55 {
56  mLocalPosition[0] = vR;
57  mLocalPosition[1] = vPhi;
58  mLocalPosition[2] = vZ;
59 }
60 
61 float StFstHit::localPosition(unsigned int i) const
62 {
63  if (i < 3)
64  return mLocalPosition[i];
65  else
66  return 0;
67 }
68 
69 std::ostream &operator<<(std::ostream &os, const StFstHit &hit)
70 {
71  os << "FST Hit -I- disk: " << static_cast<int>(hit.getDisk())
72  << " wedge: " << static_cast<int>(hit.getWedge())
73  << " sensor: " << static_cast<int>(hit.getSensor())
74  << " localPosition[0]/localPosition[1]/localPosition[2] : " << hit.localPosition(0)
75  << "/" << hit.localPosition(1)
76  << "/" << hit.localPosition(2)
77  << " ADC : " << hit.charge() << "+-" << hit.getChargeErr()
78  << " detector: " << hit.detector()
79  << endl;
80  return os;
81 }
82 
83 ClassImp(StFstHit);
84 /****************************************************************************
85 * StFstHit.cxx,v 1.0
86 * Revision 1.0 2021/10/04 Shenghui Zhang
87 * Initial version
88 ****************************************************************************/
Definition: StHit.h:125
Float_t mLocalPosition[3]
local position of hit inside the sensor
Definition: StFstHit.h:72