StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuFstHit.cxx
1 /***************************************************************************
2  *
3  * StMuFstHit.cxx
4  *
5  * Author: tchuang 2022
6  ***************************************************************************
7  *
8  * Description: Implementation of StMuFstHit, the StEvent hit structure
9  *
10  ***************************************************************************/
11 #include "StMuFstHit.h"
12 #include "St_base/StMessMgr.h"
13 #include "StEvent/StFstHit.h"
14 #include "StThreeVector.hh"
15 
16 ClassImp(StMuFstHit)
17 
18 StMuFstHit::StMuFstHit() : TObject() { /* no op */ }
19 
20 StMuFstHit::~StMuFstHit() { /* no op */ }
21 
22 void StMuFstHit::print(int opt) {
23 }
24 
25 void StMuFstHit::setLocalPosition(float vR, float vPhi, float vZ)
26 {
27  mLocalPosition[0] = vR;
28  mLocalPosition[1] = vPhi;
29  mLocalPosition[2] = vZ;
30 }
31 
32 float StMuFstHit::localPosition(unsigned int i) const
33 {
34  if (i < 3)
35  return mLocalPosition[i];
36  else
37  return 0;
38 }
39 
40 void StMuFstHit::set( StFstHit *hit ){
41  mId = hit->id();
42  mIdTruth = hit->idTruth();
43  mApv = hit->getApv();
44  mMaxTimeBin = hit->getMaxTimeBin();
45  mMeanRStrip = hit->getMeanRStrip();
46  mMeanPhiStrip = hit->getMeanPhiStrip();
47  mCharge = hit->charge();
48  mChargeErr = hit->getChargeErr();
49  mNRawHits = hit->getNRawHits();
50  mNRawHitsR = hit->getNRawHitsR();
51  mNRawHitsPhi = hit->getNRawHitsPhi();
52  mLocalPosition[0] = hit->localPosition(0);
53  mLocalPosition[1] = hit->localPosition(1);
54  mLocalPosition[2] = hit->localPosition(2);
55 
56  const StThreeVectorF &pos = hit->position();
57  mXYZ = TVector3( pos.x(), pos.y(), pos.z() );
58 
59  mHardwarePosition = hit->hardwarePosition();
60 } // set from StEvent