31 #ifndef _ST_FGT_HIT_H_
32 #define _ST_FGT_HIT_H_
37 #include "StFgtStrip.h"
43 typedef std::map< StFgtStrip*, float, stripPtrLessThan > stripWeightMap_t;
48 StFgtHit(
int key = -1,
int centralStripGeoId = -1,
float charge = 0,
49 short disc = -1,
short quad = -1,
char layer =
' ',
50 float rPos = 0,
float rErr = 10000,
float phiPos = 0,
float phiErr = 10000,
float zPos = 0,
float zErr = 10000 );
57 StDetectorId detector()
const {
return kFgtId;};
60 stripWeightMap_t& getStripWeightMap();
61 const stripWeightMap_t& getStripWeightMap()
const;
64 void setHardwareId(
short disc,
short quad,
char layer );
70 char getLayer()
const;
71 int getCentralStripGeoId()
const;
72 float getPositionR()
const;
73 float getPositionPhi()
const;
74 float getPositionZ()
const;
75 float getErrorR()
const;
76 float getErrorPhi()
const;
77 float getErrorZ()
const;
79 float getChargeUncert()
const;
81 short getMaxAdc()
const;
82 float getLandauNorm()
const;
83 float getLandauMpv()
const;
84 float getLandauSigma()
const;
85 float getLandauChi2()
const;
86 int getNstrip()
const;
87 int getMaxTimeBin()
const;
88 int getSeedType()
const;
89 float getEvenOddChargeAsy()
const;
92 void setCentralStripGeoId(
int geoId );
93 void setPositionR(
float position );
94 void setPositionPhi(
float position );
95 void setPositionZ(
float position );
96 void setErrorR(
float error );
97 void setErrorPhi(
float error );
98 void setErrorZ(
float error );
99 void setDisc(
short disc );
100 void setQuad(
short quad );
101 void setLayer(
char layer );
102 void setChargeUncert(
float sigma );
103 void setMaxAdc(
short v);
104 void setNstrip(
int v);
105 void setMaxTimeBin(
int v);
106 void setLandau(
float norm,
float mpv,
float sigma,
float chi2);
107 void setSeedType(
int v);
108 void setEvenOddChargeAsy(
float v);
117 Float_t mR, mErrR, mPhi, mErrPhi;
118 Int_t mCentralStripGeoId;
119 Float_t mChargeUncert;
123 Float_t mLandauSigma;
128 Float_t mEvenOddChargeAsy;
130 stripWeightMap_t mStripWeightMap;
139 inline short StFgtHit::calcMaxAdc() {
142 for(stripWeightMap_t::const_iterator it=mStripWeightMap.begin(); it != mStripWeightMap.end(); it++ ){
143 short adcVal = it->first->getMaxAdc();
144 if( adcVal > mMaxAdc )
151 inline int StFgtHit::getDisc()
const {
152 return static_cast< int >(mHardwarePosition/8);
155 inline int StFgtHit::getQuad()
const {
156 return static_cast< int >((mHardwarePosition/2)%4);
159 inline char StFgtHit::getLayer()
const {
160 return (mHardwarePosition % 2) ?
'R' :
'P';
163 inline int StFgtHit::getKey()
const {
167 inline stripWeightMap_t& StFgtHit::getStripWeightMap() {
168 return mStripWeightMap;
171 inline const stripWeightMap_t& StFgtHit::getStripWeightMap()
const {
172 return mStripWeightMap;
175 inline void StFgtHit::setHardwareId(
short disc,
short quad,
char layer ){
176 mHardwarePosition = disc*8+quad*2+(layer==
'R');
179 inline int StFgtHit::getCentralStripGeoId()
const {
180 return mCentralStripGeoId;
183 inline float StFgtHit::getPositionR()
const {
187 inline float StFgtHit::getPositionPhi()
const {
191 inline float StFgtHit::getPositionZ()
const {
192 return mPosition.z();
195 inline float StFgtHit::getErrorR()
const {
199 inline float StFgtHit::getErrorPhi()
const {
203 inline float StFgtHit::getErrorZ()
const {
204 return mPositionError.z();
207 inline void StFgtHit::setCentralStripGeoId(
int geoId ){
208 mCentralStripGeoId = geoId;
211 inline void StFgtHit::setDisc(
short disc ){
212 short quad = getQuad();
213 char layer = getLayer();
215 setHardwareId( disc, quad, layer );
218 inline void StFgtHit::setQuad(
short quad ){
219 short disc = getDisc();
220 char layer = getLayer();
222 setHardwareId( disc, quad, layer );
225 inline void StFgtHit::setLayer(
char layer ){
226 short disc = getDisc();
227 short quad = getQuad();
229 setHardwareId( disc, quad, layer );
232 inline void StFgtHit::setPositionR(
float position ){
234 mPosition.setX( mR*cos( mPhi ) );
235 mPosition.setY( mR*sin( mPhi ) );
238 inline void StFgtHit::setPositionPhi(
float position ){
240 mPosition.setX( mR*cos( mPhi ) );
241 mPosition.setY( mR*sin( mPhi ) );
244 inline void StFgtHit::setPositionZ(
float position ){
245 mPosition.setZ( position );
248 inline void StFgtHit::setErrorR(
float error ){
253 inline void StFgtHit::setErrorPhi(
float error ){
258 inline void StFgtHit::setErrorZ(
float error ){
259 mPositionError.setZ( error );
264 inline float StFgtHit::getChargeUncert()
const {
return mChargeUncert; };
265 inline void StFgtHit::setChargeUncert(
float sigma ){ mChargeUncert = sigma; };
266 inline short StFgtHit::getMaxAdc()
const {
return mMaxAdc;};
267 inline void StFgtHit::setMaxAdc(
short v) {mMaxAdc=v;};
268 inline int StFgtHit::getNstrip()
const {
return mNstrip;};
269 inline void StFgtHit::setNstrip(
int v) {mNstrip=v;};
270 inline int StFgtHit::getMaxTimeBin()
const {
return mMaxTimeBin;};
271 inline void StFgtHit::setMaxTimeBin(
int v) {mMaxTimeBin=v;};
272 inline int StFgtHit::getSeedType()
const {
return mSeedType;};
273 inline void StFgtHit::setSeedType(
int v) {mSeedType=v;};
274 inline float StFgtHit::getEvenOddChargeAsy()
const {
return mEvenOddChargeAsy;};
275 inline void StFgtHit::setEvenOddChargeAsy(
float v) {mEvenOddChargeAsy=v;};
276 inline float StFgtHit::getLandauNorm()
const {
return mLandauNorm;};
277 inline float StFgtHit::getLandauMpv()
const {
return mLandauMpv;};
278 inline float StFgtHit::getLandauSigma()
const {
return mLandauSigma;};
279 inline float StFgtHit::getLandauChi2()
const {
return mLandauChi2;};
280 inline void StFgtHit::setLandau(
float n,
float m,
float s,
float c) {mLandauNorm=n; mLandauMpv=m; mLandauSigma=s; mLandauChi2=c;};