Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaSpectrometerDetector.cxx
Go to the documentation of this file.
1
//*-- Author : Ole Hansen 7-Sep-00
2
4
//
5
// THaSpectrometerDetector
6
//
8
9
#include "
THaSpectrometerDetector.h
"
10
#include "
THaTrack.h
"
11
#include "
TMath.h
"
12
13
ClassImp
(
THaSpectrometerDetector
)
14
15
//______________________________________________________________________________
16
THaSpectrometerDetector::THaSpectrometerDetector
(
const
char
* name,
17
const
char
* description,
18
THaApparatus
* apparatus )
19
:
THaDetector
(
name
,description,apparatus)
20
{
21
// Constructor
22
23
}
24
25
//_____________________________________________________________________________
26
Bool_t
THaSpectrometerDetector::CalcTrackIntercept
(
THaTrack
* theTrack,
27
TVector3
& icept,
28
Double_t
& pathl )
29
{
30
// Find intercept coordinates of given track with the plane of
31
// this detector. Results are in 'icept' and 'pathl'
32
//
33
// icept: Vector to track crossing point in track coordinate system
34
// pathl: pathlength from track origin (in the track coordinate system)
35
// to intersection point (m). This is identical to the length
36
// of the vector icept-t0
37
38
TVector3
t0( theTrack->
GetX
(), theTrack->
GetY
(), 0.0 );
39
TVector3
td( theTrack->
GetTheta
(), theTrack->
GetPhi
(), 1.0 );
40
td = td.
Unit
();
41
42
return
IntersectPlaneWithRay
(
fXax
,
fYax
,
fOrigin
, t0, td, pathl, icept );
43
}
44
45
//_____________________________________________________________________________
46
Bool_t
THaSpectrometerDetector::CalcTrackIntercept
(
THaTrack
* theTrack,
47
Double_t
& pathl,
48
Double_t
& xdet,
49
Double_t
& ydet )
50
{
51
// Find intercept coordinates of given track with the plane of
52
// this detector. Results are in xdet, ydet and pathl.
53
//
54
// pathl: pathlength from track origin (in the track coordinate system)
55
// to intersection point (m). This is identical to the length
56
// of the vector icept-track_origin
57
// xdet: x-coordinate of intercept in detector coordinate system (m)
58
// ydet: y-coordinate of intercept in detector coordinate system (m)
59
60
// Does not check if the intercept coordinates are actually within
61
// the active area of the detector; use IsInActiveArea(val[1],val[2])
62
// to find out.
63
64
TVector3
icept;
65
if
( !
CalcTrackIntercept
(theTrack, icept, pathl) )
66
return
false
;
67
TVector3
v
=
TrackToDetCoord
(icept);
68
xdet =
v
.X();
69
ydet =
v
.Y();
70
return
true
;
71
}
72
73
//_____________________________________________________________________________
74
Bool_t
THaSpectrometerDetector::CheckIntercept
(
THaTrack
*track )
75
{
76
TVector3
icept;
// dummy
77
Double_t
t = 0;
// dummy
78
return
CalcTrackIntercept
(track, icept, t);
79
}
80
81
//_____________________________________________________________________________
82
Bool_t
THaSpectrometerDetector::CalcInterceptCoords
(
THaTrack
* track,
83
Double_t
& x,
Double_t
& y)
84
{
85
Double_t
t = 0;
// dummy
86
return
CalcTrackIntercept
(track, t,
x
,
y
);
87
}
88
89
//_____________________________________________________________________________
90
Bool_t
THaSpectrometerDetector::CalcPathLen
(
THaTrack
* track,
Double_t
& t )
91
{
92
TVector3
icept;
// dummy
93
return
CalcTrackIntercept
(track, icept, t);
94
}
Bool_t
bool Bool_t
Double_t
double Double_t
name
char name[80]
THaSpectrometerDetector.h
THaTrack.h
TMath.h
THaAnalysisObject::IntersectPlaneWithRay
static Bool_t IntersectPlaneWithRay(const TVector3 &xax, const TVector3 &yax, const TVector3 &org, const TVector3 &ray_start, const TVector3 &ray_vect, Double_t &length, TVector3 &intersect)
Definition
THaAnalysisObject.cxx:637
THaApparatus
Definition
THaApparatus.h:16
THaDetectorBase::fXax
TVector3 fXax
Definition
THaDetectorBase.h:67
THaDetectorBase::fYax
TVector3 fYax
Definition
THaDetectorBase.h:68
THaDetectorBase::TrackToDetCoord
TVector3 TrackToDetCoord(const TVector3 &point) const
Definition
THaDetectorBase.cxx:166
THaDetectorBase::fOrigin
TVector3 fOrigin
Definition
THaDetectorBase.h:64
THaDetector
Definition
THaDetector.h:20
THaSpectrometerDetector
Definition
THaSpectrometerDetector.h:20
THaSpectrometerDetector::CalcPathLen
Bool_t CalcPathLen(THaTrack *track, Double_t &t)
Definition
THaSpectrometerDetector.cxx:90
THaSpectrometerDetector::THaSpectrometerDetector
THaSpectrometerDetector()=default
THaSpectrometerDetector::CalcTrackIntercept
Bool_t CalcTrackIntercept(THaTrack *track, TVector3 &icept, Double_t &pathl)
Definition
THaSpectrometerDetector.cxx:26
THaSpectrometerDetector::CheckIntercept
Bool_t CheckIntercept(THaTrack *track)
Definition
THaSpectrometerDetector.cxx:74
THaSpectrometerDetector::CalcInterceptCoords
Bool_t CalcInterceptCoords(THaTrack *track, Double_t &x, Double_t &y)
Definition
THaSpectrometerDetector.cxx:82
THaTrack
Definition
THaTrack.h:21
THaTrack::GetX
Double_t GetX() const
Definition
THaTrack.h:90
THaTrack::GetPhi
Double_t GetPhi() const
Definition
THaTrack.h:87
THaTrack::GetTheta
Double_t GetTheta() const
Definition
THaTrack.h:89
THaTrack::GetY
Double_t GetY() const
Definition
THaTrack.h:91
TVector3
TVector3::Unit
TVector3 Unit() const
y
Double_t y[n]
x
Double_t x[n]
v
v
ClassImp
ClassImp(TPyArg)
Podd
THaSpectrometerDetector.cxx
Generated by
1.9.8