WCTrack.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file WCTrack.cxx
3 /// \brief Encapsulation of reconstructed Wire Chamber track.
4 /// Part of beamline reconstruction for NOvA test beam.
5 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
6 /// \date November 2018
7 ////////////////////////////////////////////////////////////////////////////
8 
9 #include "WCTrack.h"
10 
11 // -----------------------------------------------------------------------
12 brb::WCTrack::WCTrack(float momentum, float y_kink, TVector3 delta_dist,
13  TVector3 mag_entry, float dist_to_mag_axis,
14  TVector2 xy_face, std::vector<TVector3> wcHits,
15  TVector3 dir, float theta, float phi, float residual) :
16  fMomentum(momentum),
17  fYKink(y_kink),
18  fDeltaDist(delta_dist),
19  fMagnetEntryPoint(mag_entry),
20  fTransDistToMagAxis(dist_to_mag_axis),
21  fXYFace(xy_face),
22  fWCHit(wcHits),
23  fDir(dir),
24  fTheta(theta),
25  fPhi(phi),
26  fResidual(residual) {
27 }
28 
29 // -----------------------------------------------------------------------
30 float brb::WCTrack::Momentum() const {
31  return fMomentum;
32 }
33 
34 // -----------------------------------------------------------------------
35 float brb::WCTrack::YKink() const {
36  return fYKink;
37 }
38 
39 // -----------------------------------------------------------------------
40 TVector3 brb::WCTrack::DeltaDist() const {
41  return fDeltaDist;
42 }
43 
44 // -----------------------------------------------------------------------
46  return fMagnetEntryPoint;
47 }
48 
49 // -----------------------------------------------------------------------
51  return fTransDistToMagAxis;
52 }
53 
54 // -----------------------------------------------------------------------
55 TVector2 brb::WCTrack::XYFace() const {
56  return fXYFace;
57 }
58 
59 // -----------------------------------------------------------------------
60 TVector3 brb::WCTrack::Dir() const {
61  return fDir;
62 }
63 
64 // -----------------------------------------------------------------------
65 TVector3 brb::WCTrack::WCHit(unsigned int wc) const {
66  if (wc > fWCHit.size()) {
67  std::cout << "Requested WC " << wc << " out of range (" << fWCHit.size() << ")" << std::endl
68  << "Aborting..." << std::endl;
69  abort();
70  }
71  return fWCHit[wc];
72 }
73 
74 // -----------------------------------------------------------------------
75 float brb::WCTrack::Theta() const {
76  return fTheta;
77 }
78 
79 // -----------------------------------------------------------------------
80 float brb::WCTrack::Phi() const {
81  return fPhi;
82 }
83 
84 // -----------------------------------------------------------------------
85 float brb::WCTrack::Residual() const {
86  return fResidual;
87 }
88 
89 // -----------------------------------------------------------------------
90 int brb::WCTrack::WC(size_t hit) const {
91  return 0;
92 }
93 
94 // -----------------------------------------------------------------------
95 float brb::WCTrack::HitWire(size_t hit) const {
96  return 0.;
97 }
98 
99 // -----------------------------------------------------------------------
100 float brb::WCTrack::HitPosition(int wc, int wire) const {
101  return 0.;
102 }
103 
104 // -----------------------------------------------------------------------
105 size_t brb::WCTrack::NHits() const {
106  return 0;
107 }
float HitPosition(int wc, int wire) const
Definition: WCTrack.cxx:100
TVector3 fDeltaDist
Distance between upstream and downstream track ends.
Definition: WCTrack.h:56
float fTheta
Theta defined from the Z axis.
Definition: WCTrack.h:62
size_t NHits() const
Definition: WCTrack.cxx:105
TVector3 MagnetEntryPoint() const
Definition: WCTrack.cxx:45
float Phi() const
Definition: WCTrack.cxx:80
float YKink() const
Definition: WCTrack.cxx:35
std::vector< TVector3 > fWCHit
Hits on each chamber used to make the track.
Definition: WCTrack.h:60
TVector3 DeltaDist() const
Definition: WCTrack.cxx:40
float HitWire(size_t hit) const
Definition: WCTrack.cxx:95
int WC(size_t hit) const
Definition: WCTrack.cxx:90
float fPhi
Phi defined counterclockwise from the X axis.
Definition: WCTrack.h:63
Encapsulation of reconstructed Wire Chamber track. Part of beamline reconstruction for NOvA test beam...
TVector3 Dir() const
Definition: WCTrack.cxx:60
float TransDistToMagAxis() const
Definition: WCTrack.cxx:50
float Residual() const
Definition: WCTrack.cxx:85
OStream cout
Definition: OStream.cxx:6
float fMomentum
Reconstructed momentum in the XZ plane (coord system origin is at secondary target) ...
Definition: WCTrack.h:54
TVector2 XYFace() const
Definition: WCTrack.cxx:55
float fResidual
Returns the goodness of fit to a linear regression for points used in track.
Definition: WCTrack.h:64
TDirectory * dir
Definition: macro.C:5
TVector3 fDir
Unit vector describing direction.
Definition: WCTrack.h:61
Definition: structs.h:12
float fYKink
Angle difference between upstream and downstream tracks.
Definition: WCTrack.h:55
float fTransDistToMagAxis
Transverse distance from WC track intercept to central axis of magnet.
Definition: WCTrack.h:58
float Momentum() const
Definition: WCTrack.cxx:30
TVector2 fXYFace
X and Y position of the track on the upstream face of the detector.
Definition: WCTrack.h:59
TVector3 WCHit(unsigned int wc) const
Definition: WCTrack.cxx:65
float Theta() const
Definition: WCTrack.cxx:75
TVector3 fMagnetEntryPoint
X,Y,Z intersect of upstream WC track with front face of magnet.
Definition: WCTrack.h:57