FairRoot/PandaRoot
PndRichBarPoint.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndRichBarPoint source file -----
3 // ----- Created 09/04/2008 by E. Fioravanti & A. Cecchi -----
4 // -------------------------------------------------------------------------
5 
6 
7 #include "PndRichBarPoint.h"
8 #include <iostream>
9 
10 using std::cout;
11 using std::endl;
12 
13 
14 // ----- Default constructor -------------------------------------------
16  :FairMCPoint(),
17  fPdgCode(0),
18  fThetaC(0.),
19  fMass(0.),
20  fTrackStatus(0),
21  fTrackPos0(0.,0.,0.),
22  fTrackMom0(0.,0.,0.),
23  fTime0(-1.),
24  fAxisX(0.,0.,0.),
25  fAxisY(0.,0.,0.),
26  fAxisZ(0.,0.,0.)
27 {
28 }
29 // -------------------------------------------------------------------------
30 
31 
32 
33 // ----- Standard constructor ------------------------------------------
34 PndRichBarPoint::PndRichBarPoint(Int_t trackID, Int_t detID, TVector3 pos,
35  TVector3 mom, Double_t tof, Double_t length, Int_t pdgCode, Double_t thetaC, Int_t eventID, Double_t mass)
36  :FairMCPoint(trackID,detID,pos,mom, tof, length, 0.0, (UInt_t) eventID),
37  fPdgCode( pdgCode),
38  fThetaC( thetaC),
39  fMass( mass),
40  fTrackStatus(0),
41  fTrackPos0(0.,0.,0.),
42  fTrackMom0(0.,0.,0.),
43  fTime0(-1.),
44  fAxisX(0.,0.,0.),
45  fAxisY(0.,0.,0.),
46  fAxisZ(0.,0.,0.)
47 {
48 }
49 // -------------------------------------------------------------------------
50 
51 // ----- Standard constructor 2 ------------------------------------------
52 PndRichBarPoint::PndRichBarPoint(Int_t trackID, Int_t detID, TVector3 pos,
53  TVector3 mom, Double_t tof, Double_t length,
54  Int_t pdgCode, Double_t thetaC, Int_t eventID,
55  Double_t mass, TVector3 pos0, TVector3 mom0)
56  :FairMCPoint(trackID,detID,pos,mom, tof, length, 0.0, (UInt_t) eventID),
57  fPdgCode( pdgCode),
58  fThetaC( thetaC),
59  fMass( mass),
60  fTrackStatus(0),
61  fTrackPos0(pos0),
62  fTrackMom0(mom0),
63  fTime0(-1.),
64  fAxisX(0.,0.,0.),
65  fAxisY(0.,0.,0.),
66  fAxisZ(0.,0.,0.)
67 {
68 }
69 // -------------------------------------------------------------------------
70 
71 
72 PndRichBarPoint::PndRichBarPoint(TVector3 pos, TVector3 dir, Double_t time)
73  :FairMCPoint(),
74  fPdgCode(0),
75  fThetaC(0.),
76  fMass(0.),
77  fTrackStatus(0),
78  fTrackPos0(pos),
79  fTrackMom0(0.,0.,0.),
80  fTime0(time),
81  fAxisX(0.,0.,0.),
82  fAxisY(0.,0.,0.),
83  fAxisZ(0.,0.,0.)
84 {
85  SetMomentum0(dir);
86 }
87 
89 {
90  if (fTrackMom0!=dir) {
91  fTrackMom0 = dir;
92  TVector3 axis = TVector3(0,0,1);
93  fAxisZ = dir.Unit();
94  fAxisX = axis-fAxisZ*(fAxisZ*axis);
95  if (fAxisX.Mag())
96  fAxisX = fAxisX.Unit();
97  else
98  fAxisX = TVector3(1,0,0);
99  fAxisY = (fAxisZ.Cross(fAxisX)).Unit();
100  }
101 }
102 
103 // ----- Destructor ----------------------------------------------------
105 // -------------------------------------------------------------------------
106 
107 
108 
109 void PndRichBarPoint::Print(const Option_t* opt) const {
110  (void)opt; // to remove "unused" warnings
111  cout << "-I- PndRichPoint: DRC Point for trackID---> " << fTrackID
112  << " in detector " << fDetectorID << endl;
113 
114  cout << " Position (" << fX << ", " << fY << ", " << fZ
115  << ") cm" << endl;
116  cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz
117  << ") GeV" << endl;
118  cout << " Time " << fTime << " ns, Length " << fLength
119  << " cm "<< endl;
120 
121 }
123 
TVector3 pos
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t mom
Definition: plot_dirc.C:14
Double_t fZ
Definition: PndCaloDraw.cxx:34
Double_t
virtual void Print(const Option_t *opt) const
axis
Definition: PndRadMapPlane.h:9
void SetMomentum0(TVector3 dir)
Double_t fY
Definition: PndCaloDraw.cxx:34
ClassImp(PndAnaContFact)
virtual ~PndRichBarPoint()
Double_t thetaC
Definition: plot_dirc.C:16