StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuMtdHit.cxx
1 #include "StMuMtdHit.h"
2 #include "StEvent/StEvent.h"
3 #include "StEvent/StTrack.h"
4 #include "StEvent/StMtdHit.h"
5 #include "StEvent/StMtdRawHit.h"
6 
7 ClassImp(StMuMtdHit)
8 
9 
10 StMuMtdHit::StMuMtdHit(): mBackLeg(-1), mModule(-1), mCell(-1),
11  mLeadingEdgeTime{-999,-999}, mTrailingEdgeTime{-999,-999},
12  mIdTruth(-1), mQuality(0), mTrackKey(0), mIndex2Primary(-1), mIndex2Global(-1)
13 {
14  // default constructor
15 }
16 
17 StMuMtdHit::StMuMtdHit(const StMtdHit *hit)
18 {
19 
20  mBackLeg = hit->backleg();
21  mModule = hit->module();
22  mCell = hit->cell();
23  mLeadingEdgeTime = hit->leadingEdgeTime();
24  mTrailingEdgeTime = hit->trailingEdgeTime();
25 
26  mIdTruth = hit->idTruth();
27  mQuality = hit->qaTruth();
28  if(hit->associatedTrack()!=0) mTrackKey = hit->associatedTrack()->key();
29  else mTrackKey = 0;
30 
31  // rongrong
32  mIndex2Primary = -1;
33  mIndex2Global = -1;
34 }
35 
36 int
37 StMuMtdHit::backleg() const { return mBackLeg; }
38 
39 int
40 StMuMtdHit::module() const { return mModule; }
41 
42 int
43 StMuMtdHit::cell() const { return mCell; }
44 
45 pair<double,double>
46 StMuMtdHit::leadingEdgeTime() const { return mLeadingEdgeTime; }
47 
48 pair<double,double>
49 StMuMtdHit::trailingEdgeTime() const { return mTrailingEdgeTime; }
50 
51 pair<double,double>
52 StMuMtdHit::tot() const { return pair<double,double>(mTrailingEdgeTime.first - mLeadingEdgeTime.first, mTrailingEdgeTime.second - mLeadingEdgeTime.second); }
53 
54 double
55 StMuMtdHit::tof() const { return 0.5*(mLeadingEdgeTime.first+mLeadingEdgeTime.second); }
56 
57 short
58 StMuMtdHit::associatedTrackKey() const { return mTrackKey; }
59 
60 int
61 StMuMtdHit::idTruth() const { return mIdTruth; }
62 
63 int
64 StMuMtdHit::qaTruth() const { return mQuality; }
65 
66 
67 int
68 StMuMtdHit::index2Primary() const { return mIndex2Primary; }
69 
70 int
71 StMuMtdHit::index2Global() const {return mIndex2Global; }