StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFstCluster.cxx
1 
8 #include "StFstConsts.h"
9 #include "StFstCluster.h"
10 #include "St_base/StMessMgr.h"
11 
12 
13 StFstCluster::StFstCluster(int key, int disk, int wedge, int sensor, int apv,
14  float meanRStrip, float meanPhiStrip, float totCharge, float totChargeErr,
15  int clusteringType):
16  mKey(key),
17  mMeanRStrip(meanRStrip),
18  mMeanPhiStrip(meanPhiStrip),
19  mTotCharge(totCharge),
20  mTotChargeErr(totChargeErr),
21  mIdTruth(0),
22  mDiskId(disk),
23  mWedgeId(wedge),
24  mSensorId(sensor),
25  mApv(apv),
26  mClusteringType(clusteringType),
27  mMaxTimeBin(1), mNRawHits(1), mNRawHitsR(1),
28  mNRawHitsPhi(1), mRawHitVec()
29 {
30 }
31 
32 StFstCluster::~StFstCluster()
33 {
34  while (!mRawHitVec.empty()) delete mRawHitVec.back(), mRawHitVec.pop_back();
35 }
36 
37 //accessors
38 vector<StFstRawHit *> &StFstCluster::getRawHitVec() { return mRawHitVec; };
39 const vector<StFstRawHit *> &StFstCluster::getRawHitVec() const { return mRawHitVec; };
40 int StFstCluster::getKey() const { return mKey; };
41 unsigned char StFstCluster::getDisk() const { return mDiskId; };
42 unsigned char StFstCluster::getWedge() const { return mWedgeId; };
43 unsigned char StFstCluster::getSensor() const { return mSensorId; };
44 unsigned char StFstCluster::getApv() const { return mApv; };
45 float StFstCluster::getMeanRStrip() const { return mMeanRStrip; };
46 float StFstCluster::getMeanPhiStrip() const { return mMeanPhiStrip; };
47 float StFstCluster::getTotCharge() const { return mTotCharge; };
48 float StFstCluster::getTotChargeErr() const { return mTotChargeErr; };
49 unsigned char StFstCluster::getMaxTimeBin() const { return mMaxTimeBin; };
50 unsigned char StFstCluster::getClusteringType() const { return mClusteringType; };
51 unsigned char StFstCluster::getNRawHits() const { return mNRawHits; };
52 unsigned char StFstCluster::getNRawHitsR() const { return mNRawHitsR; };
53 unsigned char StFstCluster::getNRawHitsPhi() const { return mNRawHitsPhi; };
54 unsigned short StFstCluster::getIdTruth() const { return mIdTruth; };
55 
56 //modifiers
57 void StFstCluster::setDisk(int disk)
58 {
59  mDiskId = disk;
60 };
61 
62 void StFstCluster::setWedge(int wedge)
63 {
64  mWedgeId = wedge;
65 };
66 
67 void StFstCluster::setSensor(int sensor)
68 {
69  mSensorId = sensor;
70 };
71 
72 void StFstCluster::setApv(int apv)
73 {
74  mApv = apv;
75 };
76 
77 void StFstCluster::setMeanRStrip(float meanRStrip)
78 {
79  mMeanRStrip = meanRStrip;
80 };
81 
82 void StFstCluster::setMeanPhiStrip(float meanPhiStrip)
83 {
84  mMeanPhiStrip = meanPhiStrip;
85 };
86 
87 void StFstCluster::setTotCharge(float totCharge)
88 {
89  mTotCharge = totCharge;
90 };
91 
92 void StFstCluster::setTotChargeErr(float totChargeErr)
93 {
94  mTotChargeErr = totChargeErr;
95 };
96 
97 void StFstCluster::setMaxTimeBin(int tb)
98 {
99  mMaxTimeBin = tb;
100 };
101 
102 void StFstCluster::setClusteringType(int clusteringType)
103 {
104  mClusteringType = clusteringType;
105 };
106 
107 void StFstCluster::setNRawHits(int nRawHits)
108 {
109  mNRawHits = nRawHits;
110 };
111 
112 void StFstCluster::setNRawHitsR(int nRawHitsR)
113 {
114  mNRawHitsR = nRawHitsR;
115 };
116 
117 void StFstCluster::setNRawHitsPhi(int nRawHitsPhi)
118 {
119  mNRawHitsPhi = nRawHitsPhi;
120 };
121 
122 void StFstCluster::setIdTruth(unsigned short idTruth)
123 {
124  mIdTruth = idTruth;
125 };
126 
127 
128 void StFstCluster::Print(Option_t *opt) const
129 {
130  LOG_DEBUG << " totCharge=" << getTotCharge() << " totChargeErr=" << getTotChargeErr()
131  << " meanPhiStrip=" << getMeanPhiStrip() << " meanRStrip= " << getMeanRStrip()
132  << " at disk=" << (short) getDisk() << " wedge=" << (short) getWedge() << " sensor=" << (short) getSensor()
133  << " clusterSize=" << (short) getNRawHits()
134  << " clusterSizeR=" << (short) getNRawHitsR()
135  << " clusterSizePhi=" << (short) getNRawHitsPhi() << endm;
136 }
137 
138 
139 ClassImp(StFstCluster);
UChar_t mApv
Apv id the cluster belongs to.
Definition: StFstCluster.h:71
Int_t mKey
Cluster unique label.
Definition: StFstCluster.h:62
UChar_t mDiskId
Disk id the cluster belongs to.
Definition: StFstCluster.h:68
UShort_t mIdTruth
For embedding, 0 as background.
Definition: StFstCluster.h:67
unsigned char getSensor() const
0-2
UChar_t mNRawHits
Cluster size.
Definition: StFstCluster.h:74
StFstCluster(int key=-1, int disk=-1, int wedge=-1, int sensor=-1, int apv=-1, float meanRStrip=-1, float meanPhiStrip=-1, float totCharge=0, float totChargeErr=0, int clusteringType=-1)
UChar_t mNRawHitsPhi
Cluster size in Phi direction.
Definition: StFstCluster.h:76
UChar_t mWedgeId
Wedge id the cluster belongs to.
Definition: StFstCluster.h:69
UChar_t mMaxTimeBin
Max ADC time bin index.
Definition: StFstCluster.h:73
Float_t mMeanPhiStrip
Cluster&#39;s mean phistrip.
Definition: StFstCluster.h:64
unsigned char getDisk() const
1-3
unsigned char getApv() const
0-15
UChar_t mNRawHitsR
Cluster size in R direction.
Definition: StFstCluster.h:75
Float_t mMeanRStrip
Cluster&#39;s mean rstrip.
Definition: StFstCluster.h:63
UChar_t mClusteringType
Clustering algorithm type.
Definition: StFstCluster.h:72
unsigned char getWedge() const
1-36
Float_t mTotChargeErr
rMS noise of the cluster
Definition: StFstCluster.h:66
Float_t mTotCharge
Charge sum of the cluster.
Definition: StFstCluster.h:65
std::vector< StFstRawHit * > mRawHitVec
Map container to save raw hits who contribute to the cluster.
Definition: StFstCluster.h:77
UChar_t mSensorId
Sensor id the cluster belongs to.
Definition: StFstCluster.h:70