StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstDigiHit.cxx
1 #include "StIstDigiHit.h"
2 
3 
4 StMemoryPool StIstDigiHit::mPool(sizeof(StIstDigiHit));
5 
6 
7 StIstDigiHit::StIstDigiHit() : StIstHit(), mApv(0), mMeanColumn(-1),
8  mMeanRow(-1), mClusterSizeFlag(false)
9 { }
10 
11 
12 StIstDigiHit::StIstDigiHit(const StIstHit &istHit) : StIstHit(istHit)
13 {
14  mApv = ((unsigned char)((0.5 * kIstSensorActiveSizeZ + istHit.localPosition(2)) / kIstPadPitchColumn)) / 2 + 1;
15  mMeanColumn = 0.5 + (0.5 * kIstSensorActiveSizeZ + istHit.localPosition(2)) / kIstPadPitchColumn;
16  mMeanRow = 0.5 + (0.5 * kIstSensorActiveSizeRPhi - istHit.localPosition(0)) / kIstPadPitchRow;
17  mClusterSizeFlag = istHit.getNRawHitsRPhi() < 2 ? 1 : 0;
18 }
19 
20 
21 void StIstDigiHit::setApv(unsigned char apvId) { mApv = apvId; }
22 void StIstDigiHit::setMeanColumn(float meanColumn) { mMeanColumn = meanColumn; }
23 void StIstDigiHit::setClusterSizeFlag(bool flag) { mClusterSizeFlag = flag; }
24 void StIstDigiHit::setMeanRow(float meanRow) { mMeanRow = meanRow;}
25 
26 unsigned char StIstDigiHit::getApv() const { return mApv; }
27 float StIstDigiHit::getMeanColumn() const { return mMeanColumn; }
28 float StIstDigiHit::getMeanRow() const { return mMeanRow; }
29 bool StIstDigiHit::getClusterSizeFlag() const { return mClusterSizeFlag; }
30 float StIstDigiHit::localPositionErr(unsigned int i) const
31 {
32  if (i == 0) {
33  if (mClusterSizeFlag)
34  return kIstPosResolutionRPhi;
35  else
36  return kIstPosResolutionRPhi2;
37  }
38  else if (i == 2)
39  return kIstPosResolutionZ;
40  else
41  return 0;
42 }