FairRoot/PandaRoot
PndGemHit.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemHit source file -----
3 // ----- -----
4 // -------------------------------------------------------------------------
5 
6 
7 #include <iostream>
8 #include "PndGemHit.h"
9 #include "PndDetectorList.h"
10 
11 #include "FairTimeStamp.h"
12 
13 #include "TGeoManager.h"
14 #include "TGeoNode.h"
15 #include "TGeoVolume.h"
16 #include "TGeoMatrix.h"
17 
18 
19 // ----- Default constructor -------------------------------------------
21  : FairHit(),
22  fDr (-1),
23  fDp (-1),
24  fCharge (-1),
25  fNDigiHits (-1),
26  fBotIndex (-1)
27 {
28 }
29 // -------------------------------------------------------------------------
30 
31 
32 
33 // ----- Standard constructor ------------------------------------------
34 PndGemHit::PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos,
35  Int_t index, Double_t charge, Int_t NDigiHits, TString fromStr)
36  : FairHit (detID, pos, dpos, index),
37  fDr (-1),
38  fDp (-1),
39  fCharge (charge),
40  fNDigiHits (NDigiHits),
41  fBotIndex (-1)
42 {
43  fDigiNr[0] = -1;
44  fDigiNr[1] = -1;
45  AddLink(FairLink(fromStr, index));
46 }
47 // -------------------------------------------------------------------------
48 
49 // ----- Standard constructor ------------------------------------------
50 PndGemHit::PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos,
51  Int_t digi1, Int_t digi2, Double_t dr, Double_t dp, Int_t index, TString fromStr)
52  : FairHit(detID, pos, dpos, index),
53  fDr (dr),
54  fDp (dp),
55  fCharge (-1),
56  fNDigiHits (-1),
57  fBotIndex (-1)
58 {
59  fDigiNr[0] = digi1;
60  fDigiNr[1] = digi2;
61  AddLink(FairLink(fromStr, digi1));
62  AddLink(FairLink(fromStr, digi2));
63 }
64 // -------------------------------------------------------------------------
65 
66 // ----- Standard constructor ------------------------------------------
67 PndGemHit::PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos,
68  Double_t charge, Double_t time,
69  Int_t digi1, Int_t digi2,
70  Double_t dr, Double_t dp, Int_t index, TString fromStr)
71  : FairHit(detID, pos, dpos, index),
72  fDr (dr),
73  fDp (dp),
74  fCharge (charge),
75  fNDigiHits (-1),
76  fBotIndex (-1)
77 {
78  fTimeStamp = time;
79  fDigiNr[0] = digi1;
80  fDigiNr[1] = digi2;
81  AddLink(FairLink(fromStr, digi1));
82  AddLink(FairLink(fromStr, digi2));
83 }
84 // -------------------------------------------------------------------------
85 
86 
87 // ----- Destructor ----------------------------------------------------
89 // -------------------------------------------------------------------------
90 
91 
92 
93 // ----- Public method Print -------------------------------------------
94 void PndGemHit::Print(const Option_t* opt) const {
95  std::cout << *this << " opt = " << opt << std::endl;
96 }
97 
98 
99 // Double_t PndGemHit::GetD(Int_t i)
100 // {
101 // if(!gGeoManager){
102 // std::cout<<" -E- in PndGemHit::GetD(): No gGeoManager there. Please use "<<std::endl;
103 // abort();
104 // }
105 //
106 // // Caution! if there is a point reconstructed OUTSIDE its volume,
107 // // then the returned stuff is WRONG!
108 // ((TGeoNode*)(gGeoManager->FindNode(fX,fY,fZ)))->cd();
109 // TGeoHMatrix* currMatrix = gGeoManager->GetCurrentMatrix();
110 //
111 // const Double_t* rotation = (currMatrix->Inverse()).GetRotationMatrix();
112 // Double_t local[3]={fDx,fDy,fDz};
113 //
114 // Double_t result = fabs(rotation[3*i+0]*local[0]) + fabs(rotation[3*i+1]*local[1]) + fabs(rotation[3*i+2]*local[2]);
115 // std::cout"PndGemHit::GetD("<<i<<"): dLocal={"<<fDx<<","<<fDy<<","<<fDz<<"} dLab("<<i<<"="<<result<<std::endl;
116 // return result;
117 // // Double_t master[3];
118 // // gGeoManager->LocalToMasterVect(local,master);
119 // // return master[i];
120 //
121 // }
122 
123 // -------------------------------------------------------------------------
TVector3 pos
virtual ~PndGemHit()
Definition: PndGemHit.cxx:88
virtual void Print(const Option_t *opt=0) const
Definition: PndGemHit.cxx:94
Int_t fDigiNr[2]
Definition: PndGemHit.h:104
Double_t
ClassImp(PndAnaContFact)