FairRoot/PandaRoot
PndSttPoint.cxx
Go to the documentation of this file.
1 #include "PndSttPoint.h"
2 
3 #include "PndDetectorList.h"
4 
5 #include <iostream>
6 #include "math.h"
7 
8 using std::cout;
9 using std::endl;
10 
11 // ----- Default constructor -------------------------------------------
12 PndSttPoint::PndSttPoint() : FairMCPoint(),
13  fX_out_local(0), fY_out_local(0), fZ_out_local(0),
14  fX_in_local(0.), fY_in_local(0), fZ_in_local(0),
15  fPx_in(0), fPy_in(0), fPz_in(0),
16  fPx_out(0), fPy_out(0), fPz_out(0),
17  fMass(0), fTubeID(0)
18 {
19 }
20 // -------------------------------------------------------------------------
21 
22 
23 
24 // ----- Standard constructor ------------------------------------------
25 PndSttPoint::PndSttPoint(Int_t trackID, Int_t detID, TVector3 pos,
26  TVector3 posInLocal, TVector3 posOutLocal,
27  TVector3 momIn, TVector3 momOut,
28  Double_t tof, Double_t length, Double_t eLoss, Double_t mass)
29  : FairMCPoint(trackID, detID, pos, momIn, tof, length, eLoss),
30  fX_out_local(posOutLocal.X()), fY_out_local(posOutLocal.Y()), fZ_out_local(posOutLocal.Z()),
31  fX_in_local(posInLocal.X()), fY_in_local(posInLocal.Y()), fZ_in_local(posInLocal.Z()),
32  fPx_in(momIn.Px()), fPy_in(momIn.Py()), fPz_in(momIn.Pz()),
33  fPx_out(momOut.Px()), fPy_out(momOut.Py()), fPz_out(momOut.Pz()),
34  fMass(mass), fTubeID(0)
35 {
36  // reset MC monentum
37  fPx = (momIn.Px() + momOut.Px()) / 2.;
38  fPy = (momIn.Py() + momOut.Py()) / 2.;
39  fPz = (momIn.Pz() + momOut.Pz()) / 2.;
40  SetLink(FairLink("MCTrack", trackID));
41 }
42 
44  FairMCPoint(point.fTrackID, point.fDetectorID, TVector3(point.fX, point.fY, point.fZ), TVector3(point.fPx, point.fPy, point.fPz), point.fTime, point.fLength, point.fELoss, point.fEventId),
45  fX_out_local(point.fX_out_local),
46  fY_out_local(point.fY_out_local),
47  fZ_out_local(point.fZ_out_local),
48  fX_in_local(point.fX_in_local),
49  fY_in_local(point.fY_in_local),
50  fZ_in_local(point.fZ_in_local),
51  fPx_in(point.fPx_in),
52  fPy_in(point.fPy_in),
53  fPz_in(point.fPz_in),
54  fPx_out(point.fPx_out),
55  fPy_out(point.fPy_out),
56  fPz_out(point.fPz_out),
57  fMass(point.fMass),
58  fTubeID(point.fTubeID)
59 {
60  SetLink(FairLink("MCTrack", point.fTrackID));
61 }
62 // -------------------------------------------------------------------------
63 
65 
66  TVector3 x1(0., 0., -75.); // CHECK
67  TVector3 x2(0., 0., 75.); // CHECK
68  TVector3 x3(fX_in_local, fY_in_local, fZ_in_local);
69  TVector3 x4(fX_out_local, fY_out_local, fZ_out_local);
70 
71  return fabs((x3 - x1).Dot((x2 - x1).Cross(x4 - x3))) / fabs(((x2 - x1).Cross(x4 - x3)).Mag()) ;
72 }
73 
74 // ----- Destructor ----------------------------------------------------
76 // -------------------------------------------------------------------------
77 
78 // ----- Public method Print -------------------------------------------
79 void PndSttPoint::Print(const Option_t* opt) const {
80  cout << "-I- CbmStsPoint: STS Point for track " << fTrackID
81  << " in detector " << fDetectorID << endl;
82  cout << " Position (" << fX << ", " << fY << ", " << fZ
83  << ") cm" << endl;
84  cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz
85  << ") GeV" << endl;
86  cout << " Time " << fTime << " ns, Length " << fLength
87  << " cm, Energy loss " << fELoss*1.0e06 << " keV" << " opt = "<<opt<<endl;
88 }
89 // -------------------------------------------------------------------------
90 
91 
92 
TVector3 pos
Double_t GetTrueDistance()
Definition: PndSttPoint.cxx:64
Double_t fX
Definition: PndCaloDraw.cxx:34
double Y
Definition: anaLmdDigi.C:68
Double_t fZ
Definition: PndCaloDraw.cxx:34
virtual ~PndSttPoint()
Definition: PndSttPoint.cxx:75
Double_t fY_out_local
Definition: PndSttPoint.h:86
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t fZ_out_local
Definition: PndSttPoint.h:86
double X
Definition: anaLmdDigi.C:68
Double_t fY
Definition: PndCaloDraw.cxx:34
Double_t fZ_in_local
Definition: PndSttPoint.h:88
virtual void Print(const Option_t *opt) const
Definition: PndSttPoint.cxx:79
ClassImp(PndAnaContFact)
double Z
Definition: anaLmdDigi.C:68
Double_t fX_in_local
Definition: PndSttPoint.h:88
Double_t fY_in_local
Definition: PndSttPoint.h:88
Double_t fX_out_local
Definition: PndSttPoint.h:86
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72