11 #include "StMuFstRawHit.h"
12 #include "St_base/StMessMgr.h"
14 #include "StEvent/StFstRawHit.h"
20 StMuFstRawHit::~StMuFstRawHit() { }
25 unsigned char StMuFstRawHit::getMaxTimeBin()
const {
return mMaxTimeBin; };
26 unsigned char StMuFstRawHit::getDefaultTimeBin() {
return mDefaultTimeBin; };
31 return 1 + mGeoId / ((kFstNumInnerSensorsPerWedge * kFstNumStripsPerInnerSensor + kFstNumOuterSensorsPerWedge * kFstNumStripsPerOuterSensor) * kFstNumWedgePerDisk);
36 return 1 + mGeoId / (kFstNumInnerSensorsPerWedge * kFstNumStripsPerInnerSensor + kFstNumOuterSensorsPerWedge * kFstNumStripsPerOuterSensor);
41 int strip = mGeoId % (kFstNumInnerSensorsPerWedge * kFstNumStripsPerInnerSensor + kFstNumOuterSensorsPerWedge * kFstNumStripsPerOuterSensor);
42 return strip % kFstNumPhiSegPerWedge;
47 int strip = mGeoId % (kFstNumInnerSensorsPerWedge * kFstNumStripsPerInnerSensor + kFstNumOuterSensorsPerWedge * kFstNumStripsPerOuterSensor);
48 return strip / kFstNumPhiSegPerWedge;
53 return 1 + mChannelId / (kFstNumArmsPerRdo * kFstNumChanPerArm);
58 return (mChannelId % (kFstNumArmsPerRdo * kFstNumChanPerArm)) / kFstNumChanPerArm;
63 return ((mChannelId % (kFstNumArmsPerRdo * kFstNumChanPerArm)) % kFstNumChanPerArm) / kFstNumApvChannels;
68 int strip = mChannelId % (kFstNumInnerSensorsPerWedge * kFstNumStripsPerInnerSensor + kFstNumOuterSensorsPerWedge * kFstNumStripsPerOuterSensor);
69 if(strip < kFstNumStripsPerInnerSensor)
return strip/kFstNumStripsPerInnerSensor;
70 else return strip / kFstNumStripsPerOuterSensor - 1;
75 return ((mChannelId % (kFstNumArmsPerRdo * kFstNumChanPerArm)) % kFstNumChanPerArm) % kFstNumApvChannels;
78 float StMuFstRawHit::getCharge(
int tb )
const
80 return mCharge[ (tb < 0 || tb >= kFstNumTimeBins) ? mDefaultTimeBin : tb ];
83 float StMuFstRawHit::getChargeErr(
int tb )
const
85 return mChargeErr[ (tb < 0 || tb >= kFstNumTimeBins) ? mDefaultTimeBin : tb ];
89 void StMuFstRawHit::setChannelId(
int rChannelId)
91 mChannelId = rChannelId;
94 void StMuFstRawHit::setGeoId(
int rGeoId)
99 void StMuFstRawHit::setSeedhitflag(
int rSeedhitflag)
101 mSeedhitflag = rSeedhitflag;
104 void StMuFstRawHit::setDefaultTimeBin(
int tb )
106 mDefaultTimeBin = tb;
109 void StMuFstRawHit::setIdTruth(
unsigned short idTruth)
114 void StMuFstRawHit::setCharge(
float charge,
int tb )
116 mCharge[ (tb < 0 || tb >= kFstNumTimeBins) ? mDefaultTimeBin : tb ] = charge;
120 void StMuFstRawHit::setChargeErr(
float rChargeErr,
int tb)
122 mChargeErr[ (tb < 0 || tb >= kFstNumTimeBins) ? mDefaultTimeBin : tb ] = rChargeErr;
125 void StMuFstRawHit::setMaxTimeBin(
int tb)
127 mMaxTimeBin = ((tb < 0 || tb >= kFstNumTimeBins) ? mDefaultTimeBin : tb);
131 void StMuFstRawHit::print(
int nTimeBins)
133 LOG_DEBUG <<
" elecId=" <<
getChannelId() <<
" Charge=(" ;
134 for(
int i=0; i<nTimeBins; i++)
135 LOG_DEBUG << getCharge(i) <<
" " ;
136 LOG_DEBUG <<
") ChargeErr=(" ;
138 for(
int i=0; i<nTimeBins; i++)
139 LOG_DEBUG << getChargeErr(i) <<
" " ;
140 LOG_DEBUG <<
") decode0: at disk=" << (short)
getDisk() <<
" wedge=" << (short)
getWedge() <<
" sensor=" << (short)
getSensor()
144 unsigned char StMuFstRawHit::mDefaultTimeBin = 2;
151 for(
int ibin=0; ibin<kFstNumTimeBins; ibin++){
152 mCharge[ibin] = hit->getCharge(ibin);
153 mChargeErr[ibin] = hit->getChargeErr(ibin);
155 mMaxTimeBin = hit->getMaxTimeBin();
158 mDefaultTimeBin = hit->getDefaultTimeBin();
unsigned char getApv() const
0-15
unsigned char getRStrip() const
0-7
int getSeedhitflag() const
0 or 1
unsigned char getChannel() const
0-127
int getGeoId() const
0-36863
unsigned char getRdo() const
1-6
int getChannelId() const
0-36863
unsigned char getDisk() const
1-3
unsigned char getArm() const
0-2
int getGeoId() const
0-36863
unsigned short getIdTruth() const
for embedding, 0 as background
unsigned short getIdTruth() const
for embedding, 0 as background
int getChannelId() const
0-36863
unsigned char getSensor() const
0-2
unsigned char getWedge() const
1-36
int getSeedhitflag() const
0 or 1
unsigned char getPhiStrip() const
0-127