StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRnDHit.cxx
1 
5 /***************************************************************************
6  *
7  * $Id: StRnDHit.cxx,v 2.3 2017/05/04 01:07:34 perev Exp $
8  *
9  * Author: Mike Miller and Andrew Rose, Jan 2006
10  ***************************************************************************
11  *
12  * Description: This is an experimental class and not final yet
13  *
14  ***************************************************************************
15  *
16  * $Log: StRnDHit.cxx,v $
17  * Revision 2.3 2017/05/04 01:07:34 perev
18  * Own err matrix added
19  *
20  * Revision 2.2 2016/02/25 17:10:20 ullrich
21  * Implemented detector() which is now a pure abstract method in StHit.
22  *
23  * Revision 2.1 2006/01/19 21:42:06 ullrich
24  * Initial Revision.
25  *
26  **************************************************************************/
27 #include "StRnDHit.h"
28 
29 ClassImp(StRnDHit)
30 
31 StMemoryPool StRnDHit::mPool(sizeof(StRnDHit));
32 
33 StRnDHit::~StRnDHit() { /* noop */ }
34 
35 StRnDHit::StRnDHit() :
36  mLayer(-1),
37  mLadder(-1),
38  mWafer(-1),
39  mExtraByte0(-1),
40  mExtraByte1(-1),
41  mKey(-1),
42  mVolumeId(-1),
43  mDouble0(0),
44  mDouble1(0),
45  mDouble2(0),
46  mDouble3(0),
47  mDouble4(0),
48  mDetectorId(kUnknownId),
49  mErrorMatrix{0,0,0, 0,0,0, 0,0,0}
50 {
51  mLayer = mLadder = mWafer = -1;
52  mExtraByte1 = mExtraByte0 = 0;
53  mKey = mVolumeId = -1;
54  mDouble0 = mDouble1 = mDouble2 = mDouble3 = mDouble4 = 0.;
55  mDetectorId = kUnknownId;
56 }
57 
58 void StRnDHit::setErrorMatrix( const float* M )
59 {
60  for ( int i=0;i<9;i++ )
61  {
62  mErrorMatrix[i] = M[i];
63  }
64 }
65 
66 StMatrixF StRnDHit::covariantMatrix() const {
67 
68  StMatrixF M(3,3);
69 
70  M(1,1) = mErrorMatrix[0];
71  M(1,2) = mErrorMatrix[1];
72  M(1,3) = mErrorMatrix[2];
73 
74  M(2,1) = mErrorMatrix[3];
75  M(2,2) = mErrorMatrix[4];
76  M(2,3) = mErrorMatrix[5];
77 
78  M(3,1) = mErrorMatrix[6];
79  M(3,2) = mErrorMatrix[7];
80  M(3,3) = mErrorMatrix[8];
81 
82  return M;
83 
84 }
85 
86 
87 StRnDHit::StRnDHit(const StThreeVectorF& p,
88  const StThreeVectorF& e,
89  unsigned int hw, float q, unsigned char c,
90  unsigned short idTruth, unsigned short quality,
91  unsigned short id, StDetectorId dId)
92  : StHit(p, e, hw, q, c, idTruth, quality, id)
93 {
94  mLayer = mLadder = mWafer = -1;
95  mExtraByte0 = mExtraByte1 = 0;
96 
97  mKey = mVolumeId = -1;
98 
99  mDouble0 = mDouble1 = mDouble2 = mDouble3 = mDouble4 = 0.;
100  mDetectorId = dId;
101 }
102 
103 StDetectorId StRnDHit::detector() const {return mDetectorId;}
104 
105 void StRnDHit::setDetectorId(StDetectorId id) {mDetectorId = id;}
106 
107 ostream& operator<<(ostream& os, const StRnDHit& hit)
108 {
109  return os << "HFT Hit -I- \tLayer:"<<hit.mLayer<<" ladder: "<<hit.mLadder
110  << " wafer: "<< hit.mWafer<<"\n\t\t"<< hit
111  <<" \n\t\tExtraByte0: "<<hit.mExtraByte0<<" ExtraByte1: "<<hit.mExtraByte1
112  <<"\n\t\tDoubles: "<< hit.mDouble0<< " "<<hit.mDouble1<<" "<<hit.mDouble2
113  << hit.mDouble3 << " " << hit.mDouble4<<endl;
114 }
Short_t mLadder
Layer.
Definition: StRnDHit.h:89
Definition: StHit.h:125
Int_t mExtraByte0
Wafer.
Definition: StRnDHit.h:93
Short_t mWafer
Ladder.
Definition: StRnDHit.h:90
Double_t mDouble0
VolumeId from StMcHit.
Definition: StRnDHit.h:101