StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstCluster.cxx
1 // $Id: StIstCluster.cxx,v 1.16 2018/01/04 17:34:38 smirnovd Exp $
2 
10 #include "StIstConsts.h"
11 #include "StIstCluster.h"
12 #include "St_base/StMessMgr.h"
13 
14 
15 StIstCluster::StIstCluster(int key, int ladder, int sensor,
16  float meanRow, float meanColumn, float totCharge, float totChargeErr,
17  int clusteringType):
18  mKey(key),
19  mMeanRow(meanRow),
20  mMeanColumn(meanColumn),
21  mTotCharge(totCharge),
22  mTotChargeErr(totChargeErr),
23  mIdTruth(0),
24  mLadderId(ladder),
25  mSensorId(sensor),
26  mClusteringType(clusteringType),
27  mMaxTimeBin(3), mNRawHits(1), mNRawHitsRPhi(1),
28  mNRawHitsZ(1), mRawHitVec()
29 {
30 }
31 
32 StIstCluster::~StIstCluster()
33 {
34  while (!mRawHitVec.empty()) delete mRawHitVec.back(), mRawHitVec.pop_back();
35 }
36 
37 //accessors
38 vector<StIstRawHit *> &StIstCluster::getRawHitVec() { return mRawHitVec; };
39 const vector<StIstRawHit *> &StIstCluster::getRawHitVec() const { return mRawHitVec; };
40 int StIstCluster::getKey() const { return mKey; };
41 unsigned char StIstCluster::getLadder() const { return mLadderId; };
42 unsigned char StIstCluster::getSensor() const { return mSensorId; };
43 float StIstCluster::getMeanRow() const { return mMeanRow; };
44 float StIstCluster::getMeanColumn() const { return mMeanColumn; };
45 float StIstCluster::getTotCharge() const { return mTotCharge; };
46 float StIstCluster::getTotChargeErr() const { return mTotChargeErr; };
47 unsigned char StIstCluster::getMaxTimeBin() const { return mMaxTimeBin; };
48 unsigned char StIstCluster::getClusteringType() const { return mClusteringType;};
49 unsigned char StIstCluster::getNRawHits() const { return mNRawHits; };
50 unsigned char StIstCluster::getNRawHitsRPhi() const { return mNRawHitsRPhi; };
51 unsigned char StIstCluster::getNRawHitsZ() const { return mNRawHitsZ; };
52 unsigned short StIstCluster::getIdTruth() const { return mIdTruth; };
53 
54 //modifiers
55 void StIstCluster::setLadder(int ladder)
56 {
57  mLadderId = ladder;
58 };
59 
60 void StIstCluster::setSensor(int sensor)
61 {
62  mSensorId = sensor;
63 };
64 
65 void StIstCluster::setMeanRow(float meanRow)
66 {
67  mMeanRow = meanRow;
68 };
69 
70 void StIstCluster::setMeanColumn(float meanColumn)
71 {
72  mMeanColumn = meanColumn;
73 };
74 
75 void StIstCluster::setTotCharge(float totCharge)
76 {
77  mTotCharge = totCharge;
78 };
79 
80 void StIstCluster::setTotChargeErr(float totChargeErr)
81 {
82  mTotChargeErr = totChargeErr;
83 };
84 
85 void StIstCluster::setMaxTimeBin(int tb)
86 {
87  mMaxTimeBin = tb;
88 };
89 
90 void StIstCluster::setClusteringType(int clusteringType)
91 {
92  mClusteringType = clusteringType;
93 };
94 
95 void StIstCluster::setNRawHits(int nRawHits)
96 {
97  mNRawHits = nRawHits;
98 };
99 
100 void StIstCluster::setNRawHitsRPhi(int nRawHitsRPhi)
101 {
102  mNRawHitsRPhi = nRawHitsRPhi;
103 };
104 
105 void StIstCluster::setNRawHitsZ(int nRawHitsZ)
106 {
107  mNRawHitsZ = nRawHitsZ;
108 };
109 
110 void StIstCluster::setIdTruth(unsigned short idTruth)
111 {
112  mIdTruth = idTruth;
113 };
114 
115 
116 void StIstCluster::Print(Option_t *opt) const
117 {
118  LOG_DEBUG << " totCharge=" << getTotCharge() << " totChargeErr=" << getTotChargeErr()
119  << " meanColumn=" << getMeanColumn() << " meanRow= " << getMeanRow()
120  << " at ladder=" << (short) getLadder() << " sensor=" << (short) getSensor()
121  << " clusterSize=" << (short) getNRawHits()
122  << " clusterSize(Z)=" << (short) getNRawHitsZ()
123  << " clusterSize(R-Phi)=" << (short) getNRawHitsRPhi() << endm;
124 }
125 
126 
127 ClassImp(StIstCluster);
UChar_t mNRawHitsRPhi
Cluster size in r-phi direction.
Definition: StIstCluster.h:71
unsigned char getSensor() const
1-6
UChar_t mMaxTimeBin
Max ADC time bin index.
Definition: StIstCluster.h:69
UChar_t mClusteringType
Clustering algorithm type.
Definition: StIstCluster.h:68
Int_t mKey
Cluster unique label.
Definition: StIstCluster.h:60
Float_t mTotCharge
Charge sum of the cluster.
Definition: StIstCluster.h:63
StIstCluster(int key=-1, int ladder=-1, int sensor=-1, float meanRow=-1, float meanColumn=-1, float totCharge=0, float totChargeErr=0, int clusteringType=-1)
Float_t mMeanRow
Cluster&#39;s mean row.
Definition: StIstCluster.h:61
Float_t mMeanColumn
Cluster&#39;s mean column.
Definition: StIstCluster.h:62
UChar_t mSensorId
Sensor id the cluster belongs to.
Definition: StIstCluster.h:67
UChar_t mNRawHitsZ
Cluster size in beam direction.
Definition: StIstCluster.h:72
Float_t mTotChargeErr
rMS noise of the cluster
Definition: StIstCluster.h:64
UChar_t mLadderId
Ladder id the cluster belongs to.
Definition: StIstCluster.h:66
UChar_t mNRawHits
Cluster size.
Definition: StIstCluster.h:70
std::vector< StIstRawHit * > mRawHitVec
Map container to save raw hits who contribute to the cluster.
Definition: StIstCluster.h:73
UShort_t mIdTruth
For embedding, 0 as background.
Definition: StIstCluster.h:65
unsigned char getLadder() const
1-24