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
10#include "THaTrack.h"
11#include "TMath.h"
12
14
15//______________________________________________________________________________
17 const char* description,
18 THaApparatus* apparatus )
19 : THaDetector(name,description,apparatus)
20{
21 // Constructor
22
23}
24
25//_____________________________________________________________________________
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//_____________________________________________________________________________
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//_____________________________________________________________________________
75{
76 TVector3 icept; // dummy
77 Double_t t = 0; // dummy
78 return CalcTrackIntercept(track, icept, t);
79}
80
81//_____________________________________________________________________________
83 Double_t& x, Double_t& y)
84{
85 Double_t t = 0; // dummy
86 return CalcTrackIntercept(track, t, x, y);
87}
88
89//_____________________________________________________________________________
91{
92 TVector3 icept; // dummy
93 return CalcTrackIntercept(track, icept, t);
94}
bool Bool_t
double Double_t
char name[80]
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)
TVector3 TrackToDetCoord(const TVector3 &point) const
Bool_t CalcPathLen(THaTrack *track, Double_t &t)
THaSpectrometerDetector()=default
Bool_t CalcTrackIntercept(THaTrack *track, TVector3 &icept, Double_t &pathl)
Bool_t CheckIntercept(THaTrack *track)
Bool_t CalcInterceptCoords(THaTrack *track, Double_t &x, Double_t &y)
Double_t GetX() const
Definition THaTrack.h:90
Double_t GetPhi() const
Definition THaTrack.h:87
Double_t GetTheta() const
Definition THaTrack.h:89
Double_t GetY() const
Definition THaTrack.h:91
TVector3 Unit() const
Double_t y[n]
Double_t x[n]
v
ClassImp(TPyArg)