Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaVDCPoint.cxx
Go to the documentation of this file.
1
2// //
3// THaVDCPoint //
4// //
5// A pair of one U and one V VDC cluster in a given VDC chamber //
6// //
8
9#include "THaVDCPoint.h"
10#include "THaVDCChamber.h"
11#include "THaTrack.h"
12#include <cassert>
13
14//_____________________________________________________________________________
16 THaVDCChamber* chamber )
17 : fUClust(u_cl), fVClust(v_cl), fChamber(chamber),
18 fTrack(nullptr), fPartner(nullptr), fX(0.0), fY(0.0), fTheta(0.0), fPhi(0.0)
19{
20 // Constructor
21
22 assert( fUClust && fVClust && fChamber );
23
25}
26
27//_____________________________________________________________________________
29{
30 // Convert U,V coordinates of our two clusters to the detector
31 // coordinate system.
32
34 Set( c.x, c.y, c.theta, c.phi );
36}
37
38//_____________________________________________________________________________
40{
41 // Return z-position of u cluster
42
43 return fChamber->GetZ();
44}
45
46//_____________________________________________________________________________
48{
49 // Return z-position of v cluster
50
51 return fChamber->GetZ() + fChamber->GetSpacing();
52}
53
54//_____________________________________________________________________________
56{
57 // Set global slopes of U and V clusters to mu, mv and recalculate
58 // detector coordinates
59
60 fUClust->SetSlope( mu );
61 fVClust->SetSlope( mv );
63}
64
65//_____________________________________________________________________________
66void THaVDCPoint::CalcChisquare(Double_t& chi2, Int_t& nhits) const
67{
68 // Accumulate the chi2 from the clusters making up this pair,
69 // adding their terms to the chi2 and nhits.
70 //
71 // The global slope and intercept, derived from the entire track,
72 // must already have been set for each cluster
73 // (as done in THaVDC::ConstructTracks)
74 //
75 fUClust->CalcChisquare(chi2,nhits);
76 fVClust->CalcChisquare(chi2,nhits);
77}
78
79//_____________________________________________________________________________
81{
82 // Associate this cluster pair as well as the underlying U and V clusters
83 // with a reconstructed track
84
85 fTrack = track;
86 if( fUClust ) fUClust->SetTrack(track);
87 if( fVClust ) fVClust->SetTrack(track);
88}
89
90//_____________________________________________________________________________
92{
93 // Return index of assigned track (-1 = none, 0 = first/best, etc.)
94
95 if( !fTrack ) return -1;
96 return fTrack->GetIndex();
97}
98
99//_____________________________________________________________________________
int Int_t
#define c(i)
double Double_t
virtual void SetCenter(Double_t x, Double_t y, Double_t z)
Definition THaCluster.h:21
TVector3 DetToTrackCoord(const TVector3 &point) const
Int_t GetIndex() const
Definition THaTrack.h:79
Double_t GetSpacing() const
Double_t GetZ() const
PointCoords_t CalcDetCoords(const THaVDCCluster *u, const THaVDCCluster *v) const
void SetSlope(Double_t slope)
void SetTrack(THaTrack *track)
virtual void CalcChisquare(Double_t &chi2, Int_t &nhits) const
Double_t GetZV() const
void CalcChisquare(Double_t &chi2, Int_t &nhits) const
THaTrack * fTrack
Definition THaVDCPoint.h:56
THaVDCPoint(THaVDCCluster *u_cl, THaVDCCluster *v_cl, THaVDCChamber *chamber)
void CalcDetCoords()
Double_t GetZU() const
THaVDCCluster * fVClust
Definition THaVDCPoint.h:54
THaVDCCluster * fUClust
Definition THaVDCPoint.h:53
void SetSlopes(Double_t mu, Double_t mv)
void SetTrack(THaTrack *track)
Int_t GetTrackIndex() const
THaVDCChamber * fChamber
Definition THaVDCPoint.h:55
void Set(Double_t x, Double_t y, Double_t theta, Double_t phi)
Definition THaVDCPoint.h:66
ClassImp(TPyArg)