FairRoot/PandaRoot
PndSdsHit.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndSdsHit source file -----
3 // ----- -----
4 // -------------------------------------------------------------------------
5 
6 #include "stdlib.h"
7 #include <iostream>
8 #include "PndSdsHit.h"
9 #include "TGeoManager.h"
10 #include "TGeoNode.h"
11 #include "TGeoVolume.h"
12 #include "TGeoMatrix.h"
13 
14 
15 // ----- Default constructor -------------------------------------------
16 PndSdsHit::PndSdsHit() : FairHit(),
17  fSensorID(-1),
18  fCharge(0),
19  fNDigiHits(0),
20  fClusterIndex(-1),
21  fBotIndex(-1),
22  fCov(3,3)
23 {
24 }
25 // -------------------------------------------------------------------------
26 
27 
28 
29 // ----- Standard constructor ------------------------------------------
30 PndSdsHit::PndSdsHit(Int_t detID, Int_t sensorID, TVector3& pos, TVector3& dpos,
31  Int_t clindex, Double_t charge, Int_t NDigiHits, Int_t mcindex)
32 : FairHit(detID, pos, dpos, mcindex),
33  fSensorID(sensorID),
34  fCharge(charge),
35  fNDigiHits(NDigiHits),
36  fClusterIndex(clindex),
37  fBotIndex(-1),
38  fCov(3,3)
39 {}
40 
41 /*PndSdsHit::PndSdsHit(PndSdsHit& c)
42  : FairHit()
43  {
44  fDetName = c.GetDetName();
45  fTrackID = c.GetTrackID();
46  fCharge = c.GetCharge();
47  fNDigiHits = c.GetNDigiHits();
48  SetPosition(c.GetPosition());
49  SetPositionError(c.GetPositionError());
50  SetDetectorID(c.GetDetectorID());
51  SetRefIndex(c.GetRefIndex());
52 
53 
54  }*/
55 // -------------------------------------------------------------------------
56 
57 
58 
59 // ----- Destructor ----------------------------------------------------
61 // -------------------------------------------------------------------------
62 
63 
64 
65 // ----- Public method Print -------------------------------------------
66 void PndSdsHit::Print(const Option_t* opt) const {
67  std::cout << *this << std::endl;
68 }
69 
71 {
72  if (cov.GetNcols()==3 && cov.GetNrows()==3)
73  fCov = cov;
74  else {
75  Error("SetCov","matrix has wrong dimensions!");
76  cov.Print();
77  }
78 }
79 
80 
81 
82 
83 // Double_t PndSdsHit::GetD(Int_t i)
84 // {
85 // if(!gGeoManager){
86 // std::cout<<" -E- in PndSdsHit::GetD(): No gGeoManager there. Please use "<<std::endl;
87 // abort();
88 // }
89 //
90 // // Caution! if there is a point reconstructed OUTSIDE its volume,
91 // // then the returned stuff is WRONG!
92 // ((TGeoNode*)(gGeoManager->FindNode(fX,fY,fZ)))->cd();
93 // TGeoHMatrix* currMatrix = gGeoManager->GetCurrentMatrix();
94 //
95 // const Double_t* rotation = (currMatrix->Inverse()).GetRotationMatrix();
96 // Double_t local[3]={fDx,fDy,fDz};
97 //
98 // Double_t result = fabs(rotation[3*i+0]*local[0]) + fabs(rotation[3*i+1]*local[1]) + fabs(rotation[3*i+2]*local[2]);
99 // std::cout"PndSdsHit::GetD("<<i<<"): dLocal={"<<fDx<<","<<fDy<<","<<fDz<<"} dLab("<<i<<"="<<result<<std::endl;
100 // return result;
101 // // Double_t master[3];
102 // // gGeoManager->LocalToMasterVect(local,master);
103 // // return master[i];
104 //
105 // }
106 
107 // -------------------------------------------------------------------------
TVector3 pos
virtual void Print(const Option_t *opt=0) const
Definition: PndSdsHit.cxx:66
ClassImp(PndSdsHit)
Double_t
TMatrixD fCov
bottom side of strip clusters
Definition: PndSdsHit.h:144
virtual ~PndSdsHit()
Definition: PndSdsHit.cxx:60
void SetCov(TMatrixD cov)
Definition: PndSdsHit.cxx:70
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52