Public Member Functions | Public Attributes | Private Member Functions | List of all members
trk::RLFit Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/TrackFit/RLFit.h"

Public Member Functions

 RLFit (const std::vector< art::Ptr< rawdata::RawDigit > > &d, unsigned int i1, unsigned int i2)
 
void Fit ()
 
void AssumeDownGoing ()
 
void AssumeNorthGoing ()
 
double CosThetaBeam ()
 
double PhiBeam ()
 
double CosThetaCosmic ()
 
double PhiCosmic ()
 
void SetRTSchedule (const std::vector< double > &r, const std::vector< double > &t)
 

Public Attributes

std::vector< double > fR
 Range of weight function. More...
 
std::vector< double > fT
 Transition width of weight function. More...
 
std::vector< const rawdata::RawDigit * > fXhit
 X view hits. More...
 
std::vector< const rawdata::RawDigit * > fYhit
 Y view hits. More...
 
std::vector< double > fXx
 x positions (cm) More...
 
std::vector< double > fZx
 z positions (cm) More...
 
std::vector< double > fWx
 x view weights More...
 
std::vector< double > fYy
 y positions (cm) More...
 
std::vector< double > fZy
 z positions (cm) More...
 
std::vector< double > fWy
 y view weights More...
 
double fMzx
 Slope in x-z view. More...
 
double fBzx
 Intercept in x-z view. More...
 
double fMzy
 Slope in y-z view. More...
 
double fBzy
 Intercept in y-z view. More...
 
double fX1
 Start x position (cm) More...
 
double fY1
 Start y position (cm) More...
 
double fZ1
 Start z position (cm) More...
 
double fX2
 End x position (cm) More...
 
double fY2
 End y positon (cm) More...
 
double fZ2
 End z position (cm) More...
 
double fBoxXlo
 Detector box X edge. More...
 
double fBoxXhi
 Detector box X edge. More...
 
double fBoxYlo
 Detector box Y edge. More...
 
double fBoxYhi
 Detector box Y edge. More...
 
double fBoxZlo
 Detector box Z edge. More...
 
double fBoxZhi
 Detector box Z edge. More...
 
double fChi2
 
double fDOF
 Sum of weights * deltas. More...
 

Private Member Functions

void UpdateSlopes ()
 
void SeedWeights (const std::vector< double > &x, const std::vector< double > &zx, const std::vector< double > &y, const std::vector< double > &zy, std::vector< double > &w)
 

Detailed Description

Perform a straight line fit to a collection of raw hits

RLFit = Raw Line Fit

Definition at line 22 of file RLFit.h.

Constructor & Destructor Documentation

trk::RLFit::RLFit ( const std::vector< art::Ptr< rawdata::RawDigit > > &  d,
unsigned int  i1,
unsigned int  i2 
)

Construct the RLFit object

Parameters
d- list of raw digits to fit
i1- first hit in list to fit
i2- last hit in list to fit (inclusive)

Definition at line 23 of file RLFit.cxx.

References getBrightness::cell, geo::PlaneGeo::Cell(), visualisationForPaperMasterPlot::cmap, d, geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), fBoxXhi, fBoxXlo, fBoxYhi, fBoxYlo, fBoxZhi, fBoxZlo, fR, fT, fWx, fWy, fXhit, fXx, fYhit, fYy, fZx, fZy, cmap::dataprov::CMap::GetCell(), geo::CellGeo::GetCenter(), cmap::dataprov::CMap::GetPlane(), MECModelEnuComparisons::i, geo::kX, geo::kY, geo::GeometryBase::Plane(), NDAPDHVSetting::plane, SeedWeights(), POTSpillRate::view, and geo::PlaneGeo::View().

25  :
26  fR(8),
27  fT(8)
28  {
29  //
30  // The schedule of the anealing. Units are cm^2. First iteration is
31  // not used as weights come from the seeds.
32  //
33  fR[0] = 0.0; fT[0] = 0.0;
34  fR[1] = 36.0; fT[1] = 1000.0;
35  fR[2] = 36.0; fT[2] = 500.0;
36  fR[3] = 36.0; fT[3] = 250.0;
37  fR[4] = 36.0; fT[4] = 100.0;
38  fR[5] = 36.0; fT[5] = 50.0;
39  fR[6] = 36.0; fT[6] = 25.0;
40  fR[7] = 36.0; fT[7] = 10.0;
41  //
42  // The geometry box
43  //
45  fBoxXlo = -geo->DetHalfWidth();
46  fBoxXhi = geo->DetHalfWidth();
47  fBoxYlo = -geo->DetHalfHeight();
48  fBoxYhi = geo->DetHalfHeight();
49  fBoxZlo = 0.0;
50  fBoxZhi = geo->DetLength();
51 
52  //
53  // Pull out the hit information we need for a fit
54  //
56  for (unsigned int i=i1; i<=i2; ++i) {
57  int plane = cmap->GetPlane(d[i].get());
58  int cell = cmap->GetCell(d[i].get());
59  int view = geo->Plane(plane)->View();
60 
61  double xyz[3];
62  geo->Plane(plane)->Cell(cell)->GetCenter(xyz);
63 
64  if (view==geo::kX) {
65  fXhit.push_back(d[i].get());
66  fXx.push_back(xyz[0]);
67  fZx.push_back(xyz[2]);
68  fWx.push_back(0);
69  }
70  else if (view==geo::kY) {
71  fYhit.push_back(d[i].get());
72  fYy.push_back(xyz[1]);
73  fZy.push_back(xyz[2]);
74  fWy.push_back(0);
75  }
76  }
77  this->SeedWeights(fXx, fZx, fYy, fZy, fWx);
78  this->SeedWeights(fYy, fZy, fXx, fZx, fWy);
79  }
void GetCenter(double *xyz, double localz=0.0) const
Definition: CellGeo.cxx:159
std::vector< double > fXx
x positions (cm)
Definition: RLFit.h:93
double fBoxYlo
Detector box Y edge.
Definition: RLFit.h:114
std::vector< const rawdata::RawDigit * > fYhit
Y view hits.
Definition: RLFit.h:92
std::vector< double > fZx
z positions (cm)
Definition: RLFit.h:94
double fBoxZhi
Detector box Z edge.
Definition: RLFit.h:117
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
std::vector< double > fWy
y view weights
Definition: RLFit.h:98
Vertical planes which measure X.
Definition: PlaneGeo.h:28
std::vector< const rawdata::RawDigit * > fXhit
X view hits.
Definition: RLFit.h:91
double DetLength() const
std::vector< double > fWx
x view weights
Definition: RLFit.h:95
const PlaneGeo * Plane(unsigned int i) const
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
std::vector< double > fYy
y positions (cm)
Definition: RLFit.h:96
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
double fBoxXhi
Detector box X edge.
Definition: RLFit.h:113
void SeedWeights(const std::vector< double > &x, const std::vector< double > &zx, const std::vector< double > &y, const std::vector< double > &zy, std::vector< double > &w)
Definition: RLFit.cxx:82
Float_t d
Definition: plot.C:236
unsigned short GetPlane(const rawdata::RawDigit *dig)
Definition: CMap.cxx:285
std::vector< double > fR
Range of weight function.
Definition: RLFit.h:87
double fBoxZlo
Detector box Z edge.
Definition: RLFit.h:116
double DetHalfHeight() const
std::vector< double > fZy
z positions (cm)
Definition: RLFit.h:97
std::vector< double > fT
Transition width of weight function.
Definition: RLFit.h:88
double DetHalfWidth() const
double fBoxXlo
Detector box X edge.
Definition: RLFit.h:112
unsigned short GetCell(const rawdata::RawDigit *dig)
Definition: CMap.cxx:327
Helper for AttenCurve.
Definition: Path.h:10
double fBoxYhi
Detector box Y edge.
Definition: RLFit.h:115

Member Function Documentation

void trk::RLFit::AssumeDownGoing ( )

Flip the fit results to force a down-going cosmic ray assumption on the results

Definition at line 247 of file RLFit.cxx.

References fX1, fX2, fY1, fY2, fZ1, fZ2, std::swap(), and UpdateSlopes().

Referenced by CosThetaCosmic(), comi::Leana::MuonCandidate(), PhiCosmic(), and comi::Cana::produce().

248  {
249  if (fY2>fY1) {
250  std::swap(fX1, fX2);
251  std::swap(fY1, fY2);
252  std::swap(fZ1, fZ2);
253  this->UpdateSlopes();
254  }
255  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
void UpdateSlopes()
Definition: RLFit.cxx:258
double fX1
Start x position (cm)
Definition: RLFit.h:105
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
double fY1
Start y position (cm)
Definition: RLFit.h:106
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fX2
End x position (cm)
Definition: RLFit.h:108
void trk::RLFit::AssumeNorthGoing ( )

Flip the fit results to force a beam-related assumption on the results

Definition at line 236 of file RLFit.cxx.

References fX1, fX2, fY1, fY2, fZ1, fZ2, std::swap(), and UpdateSlopes().

Referenced by CosThetaBeam(), PhiBeam(), and comi::Cana::produce().

237  {
238  if (fZ1>fZ2) {
239  std::swap(fX1, fX2);
240  std::swap(fY1, fY2);
241  std::swap(fZ1, fZ2);
242  this->UpdateSlopes();
243  }
244  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
void UpdateSlopes()
Definition: RLFit.cxx:258
double fX1
Start x position (cm)
Definition: RLFit.h:105
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
double fY1
Start y position (cm)
Definition: RLFit.h:106
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fX2
End x position (cm)
Definition: RLFit.h:108
double trk::RLFit::CosThetaBeam ( )

Angle of track wrt detector z-axis

Definition at line 268 of file RLFit.cxx.

References AssumeNorthGoing(), dx, dy, dz, fX1, fX2, fY1, fY2, fZ1, fZ2, and std::sqrt().

Referenced by comi::Cana::produce().

269  {
270  this->AssumeNorthGoing();
271 
272  double dz = (fZ2-fZ1);
273  double dx = (fX2-fX1);
274  double dy = (fY2-fY1);
275 
276  return dz/sqrt(dx*dx+dy*dy+dz*dz);
277  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
T sqrt(T number)
Definition: d0nt_math.hpp:156
double fX1
Start x position (cm)
Definition: RLFit.h:105
double fY1
Start y position (cm)
Definition: RLFit.h:106
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double dy[NP][NC]
double dx[NP][NC]
double dz[NP][NC]
void AssumeNorthGoing()
Definition: RLFit.cxx:236
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fX2
End x position (cm)
Definition: RLFit.h:108
double trk::RLFit::CosThetaCosmic ( )

Angle of track wrt to vertical

Definition at line 291 of file RLFit.cxx.

References AssumeDownGoing(), dx, dy, dz, fX1, fX2, fY1, fY2, fZ1, fZ2, and std::sqrt().

Referenced by comi::Cana::produce().

292  {
293  this->AssumeDownGoing();
294 
295  double dz = (fZ2-fZ1);
296  double dx = (fX2-fX1);
297  double dy = (fY2-fY1);
298 
299  return -dy/sqrt(dx*dx+dy*dy+dz*dz);
300  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
T sqrt(T number)
Definition: d0nt_math.hpp:156
double fX1
Start x position (cm)
Definition: RLFit.h:105
double fY1
Start y position (cm)
Definition: RLFit.h:106
void AssumeDownGoing()
Definition: RLFit.cxx:247
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double dy[NP][NC]
double dx[NP][NC]
double dz[NP][NC]
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fX2
End x position (cm)
Definition: RLFit.h:108
void trk::RLFit::Fit ( )

Perform the fit. Results stored into member data.

Definition at line 110 of file RLFit.cxx.

References d, geo::DsqrToLine(), stan::math::exp(), fBoxXhi, fBoxXlo, fBoxYhi, fBoxYlo, fBzx, fBzy, fChi2, fDOF, fMzx, fMzy, fR, fT, fWx, fWy, fX1, fX2, fXx, fY1, fY2, fYy, fZ1, fZ2, fZx, fZy, MECModelEnuComparisons::i, calib::j, geo::LinFitMinDperp(), std::swap(), submit_syst::x, x1, submit_syst::x2, submit_syst::y, y1, and submit_syst::y2.

Referenced by comi::Leana::MuonCandidate(), and comi::Cana::produce().

111  {
112  //
113  // Make a line fit to the hits. To improve preformance in a noisy
114  // environment, use a deterministic annealing algoritm
115  //
116  double x1 = 0;
117  double x2 = 0;
118  double zx1 = 0;
119  double zx2 = 0;
120  double y1 = 0;
121  double y2 = 0;
122  double zy1 = 0;
123  double zy2 = 0;
124  for (unsigned int i=0; i<fR.size(); ++i) {
125  static const double eps = 1.0E-6;
126  //
127  // Calculate weights for this iteration. First iteration uses seed
128  // weights
129  //
130  if (i>0) {
131  for (unsigned int j=0; j<fWx.size(); ++j) {
132  double d = geo::DsqrToLine(fZx[j], fXx[j], zx1, x1, zx2, x2);
133 
134  fWx[j] = (1.0+exp(-fR[i]/fT[i]))/(1.0+exp((d-fR[i])/fT[i]));
135  //
136  // Penalty for hits outside the detector in the other view
137  //
138  double y = fMzy*fZx[j] + fBzy;
139  if (y<fBoxYlo) fWx[j] *= exp(-(fBoxYlo-y)/fT[i]);
140  if (y>fBoxYhi) fWx[j] *= exp(-(y-fBoxYhi)/fT[i]);
141 
142  if (fWx[j]<eps) fWx[j] = eps;
143  }
144  for (unsigned int j=0; j<fWy.size(); ++j) {
145  double d = geo::DsqrToLine(fZy[j], fYy[j], zy1, y1, zy2, y2);
146 
147  fWy[j] = (1.0+exp(-fR[i]/fT[i]))/(1.0+exp((d-fR[i])/fT[i]));
148  //
149  // Penalty for hits outside the detector in the other view
150  //
151  double x = fMzx*fZy[j] + fBzx;
152  if (x<fBoxXlo) fWy[j] *= exp(-(fBoxXlo-x)/fT[i]);
153  if (x>fBoxXhi) fWy[j] *= exp(-(x-fBoxXhi)/fT[i]);
154 
155  if (fWy[j]<eps) fWy[j] = eps;
156  }
157  }
158  //
159  // Perform the fits to the two views
160  //
161  geo::LinFitMinDperp(fZx, fXx, fWx, &zx1, &x1, &zx2, &x2);
162  geo::LinFitMinDperp(fZy, fYy, fWy, &zy1, &y1, &zy2, &y2);
163  //
164  // Compute slopes and intercepts
165  //
166  double dzx = zx2-zx1;
167  if (dzx<=0.0) dzx = 1.0E-9;
168  fMzx = (x2-x1)/dzx;
169  fBzx = (x1*zx2-x2*zx1)/dzx;
170 
171  double dzy = zy2-zy1;
172  if (dzy<=0.0) dzy = 1.0E-9;
173  fMzy = (y2-y1)/dzy;
174  fBzy = (y1*zy2-y2*zy1)/dzy;
175  }
176  fChi2 = 0.0;
177  fDOF = 0.0;
178  for (unsigned int j=0; j<fWx.size(); ++j) {
179  double d = geo::DsqrToLine(fZx[j], fXx[j], zx1, x1, zx2, x2);
180  fChi2 += fWx[j]*d;
181  fDOF += fWx[j];
182  }
183  for (unsigned int j=0; j<fWy.size(); ++j) {
184  double d = geo::DsqrToLine(fZy[j], fYy[j], zy1, y1, zy2, y2);
185  fChi2 += fWy[j]*d;
186  fDOF += fWy[j];
187  }
188 
189  // Force north-going assumption on both views...
190  if (zx1>zx2) { std::swap(x1, x2); std::swap(zx1, zx2); }
191  if (zy1>zy2) { std::swap(y1, y2); std::swap(zy1, zy2); }
192 
193  //
194  // Compute slopes and intercepts
195  //
196  double dzx = zx2-zx1;
197  if (dzx<=0.0) dzx = 1.0E-9;
198  fMzx = (x2-x1)/dzx;
199  fBzx = (x1*zx2-x2*zx1)/dzx;
200 
201  double dzy = zy2-zy1;
202  if (dzy<=0.0) dzy = 1.0E-9;
203  fMzy = (y2-y1)/dzy;
204  fBzy = (y1*zy2-y2*zy1)/dzy;
205 
206  //
207  // Adjust z ranges to completely contain hits on the track. "On
208  // track" is defined as having significant weight
209  //
210  fZ1 = fZx[0];
211  fZ2 = fZx[0]+0.01;
212  for (unsigned int i=0; i<fWx.size(); ++i) {
213  if (fWx[i]>0.001) {
214  if (fZx[i]<fZ1) fZ1 = fZx[i];
215  if (fZx[i]>fZ2) fZ2 = fZx[i];
216  }
217  }
218  for (unsigned int i=0; i<fWy.size(); ++i) {
219  if (fWy[i]>0.001) {
220  if (fZy[i]<fZ1) fZ1 = fZy[i];
221  if (fZy[i]>fZ2) fZ2 = fZy[i];
222  }
223  }
224  //
225  // Use line fits to compute x and y locations at the start and end z
226  // positions
227  //
228  fX1 = fMzx*fZ1 + fBzx;
229  fX2 = fMzx*fZ2 + fBzx;
230 
231  fY1 = fMzy*fZ1 + fBzy;
232  fY2 = fMzy*fZ2 + fBzy;
233  }
double fDOF
Sum of weights * deltas.
Definition: RLFit.h:120
std::vector< double > fXx
x positions (cm)
Definition: RLFit.h:93
double fY2
End y positon (cm)
Definition: RLFit.h:109
double fBoxYlo
Detector box Y edge.
Definition: RLFit.h:114
double fMzy
Slope in y-z view.
Definition: RLFit.h:102
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
std::vector< double > fZx
z positions (cm)
Definition: RLFit.h:94
std::vector< double > fWy
y view weights
Definition: RLFit.h:98
std::vector< double > fWx
x view weights
Definition: RLFit.h:95
double fMzx
Slope in x-z view.
Definition: RLFit.h:100
double fX1
Start x position (cm)
Definition: RLFit.h:105
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
double fY1
Start y position (cm)
Definition: RLFit.h:106
std::vector< double > fYy
y positions (cm)
Definition: RLFit.h:96
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double fBoxXhi
Detector box X edge.
Definition: RLFit.h:113
double LinFitMinDperp(const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w, double *x1, double *y1, double *x2, double *y2)
Find the best-fit line to a collection of points in 2-D by minimizing the squared perpendicular dista...
Definition: Geo.cxx:449
double DsqrToLine(double x0, double y0, double x1, double y1, double x2, double y2)
In two dimensions, return the perpendicular distance from a point (x0,y0) to a line defined by end po...
Definition: Geo.cxx:338
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
Float_t d
Definition: plot.C:236
std::vector< double > fR
Range of weight function.
Definition: RLFit.h:87
const double j
Definition: BetheBloch.cxx:29
std::vector< double > fZy
z positions (cm)
Definition: RLFit.h:97
std::vector< double > fT
Transition width of weight function.
Definition: RLFit.h:88
double fBzy
Intercept in y-z view.
Definition: RLFit.h:103
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fChi2
Definition: RLFit.h:119
double fBzx
Intercept in x-z view.
Definition: RLFit.h:101
double fBoxXlo
Detector box X edge.
Definition: RLFit.h:112
double fX2
End x position (cm)
Definition: RLFit.h:108
double fBoxYhi
Detector box Y edge.
Definition: RLFit.h:115
double trk::RLFit::PhiBeam ( )

Angle of track in detector x-y plane

Definition at line 280 of file RLFit.cxx.

References AssumeNorthGoing(), std::atan2(), dx, dy, fX1, fX2, fY1, and fY2.

Referenced by comi::Cana::produce().

281  {
282  this->AssumeNorthGoing();
283 
284  double dx = (fX2-fX1);
285  double dy = (fY2-fY1);
286 
287  return atan2(dy,dx);
288  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
double fX1
Start x position (cm)
Definition: RLFit.h:105
double fY1
Start y position (cm)
Definition: RLFit.h:106
double dy[NP][NC]
double dx[NP][NC]
void AssumeNorthGoing()
Definition: RLFit.cxx:236
double fX2
End x position (cm)
Definition: RLFit.h:108
T atan2(T number)
Definition: d0nt_math.hpp:72
double trk::RLFit::PhiCosmic ( )

Angle of track in east-west plane

Definition at line 303 of file RLFit.cxx.

References AssumeDownGoing(), std::atan2(), dx, dz, fX1, fX2, fZ1, and fZ2.

Referenced by comi::Cana::produce().

304  {
305  this->AssumeDownGoing();
306 
307  double dx = (fX2-fX1);
308  double dz = (fZ2-fZ1);
309 
310  return atan2(-dx,-dz);
311  }
double fX1
Start x position (cm)
Definition: RLFit.h:105
void AssumeDownGoing()
Definition: RLFit.cxx:247
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double dx[NP][NC]
double dz[NP][NC]
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fX2
End x position (cm)
Definition: RLFit.h:108
T atan2(T number)
Definition: d0nt_math.hpp:72
void trk::RLFit::SeedWeights ( const std::vector< double > &  x,
const std::vector< double > &  zx,
const std::vector< double > &  y,
const std::vector< double > &  zy,
std::vector< double > &  w 
)
private

Definition at line 82 of file RLFit.cxx.

References d, stan::math::fabs(), MECModelEnuComparisons::i, calib::j, and util::pythag().

Referenced by RLFit().

87  {
88  for (unsigned int i=0; i<zx.size(); ++i) {
89  double d;
90  w[i] = 1.0E-9;
91  //
92  // Find closest hit in same view
93  //
94  for (unsigned int j=0; j<zx.size(); ++j) {
95  if (i==j) continue;
96  d = util::pythag(zx[i]-zx[j], x[i]-x[j]);
97  if (d<30.0) w[i] += 1.0;
98  }
99  //
100  // Find closest hit in orthogonal view
101  //
102  for (unsigned int j=0; j<zy.size(); ++j) {
103  d = fabs(zx[i]-zy[j]);
104  if (d<30.0) w[i] += 0.1;
105  }
106  }
107  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
Float_t d
Definition: plot.C:236
const double j
Definition: BetheBloch.cxx:29
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
Float_t w
Definition: plot.C:20
void trk::RLFit::SetRTSchedule ( const std::vector< double > &  r,
const std::vector< double > &  t 
)

Update the schedule of the boundaries and widths used in calculating weights

Definition at line 314 of file RLFit.cxx.

References ana::assert(), fR, fT, and MECModelEnuComparisons::i.

316  {
317  assert(r.size()==r.size());
318  fR.resize(r.size());
319  fT.resize(t.size());
320  for (unsigned int i=0; i<r.size(); ++i) {
321  fR[i] = r[i];
322  fT[i] = t[i];
323  }
324  }
std::vector< double > fR
Range of weight function.
Definition: RLFit.h:87
std::vector< double > fT
Transition width of weight function.
Definition: RLFit.h:88
assert(nhit_max >=nhit_nbins)
TRandom3 r(0)
void trk::RLFit::UpdateSlopes ( )
private

Definition at line 258 of file RLFit.cxx.

References fBzx, fBzy, fMzx, fMzy, fX1, fX2, fY1, fY2, fZ1, and fZ2.

Referenced by AssumeDownGoing(), and AssumeNorthGoing().

259  {
260  fMzx = (fX2-fX1)/(fZ2-fZ1);
261  fBzx = (fX1*fZ2-fX2*fZ1)/(fZ2-fZ1);
262 
263  fMzy = (fY2-fY1)/(fZ2-fZ1);
264  fBzy = (fY1*fZ2-fY2*fZ1)/(fZ2-fZ1);
265  }
double fY2
End y positon (cm)
Definition: RLFit.h:109
double fMzy
Slope in y-z view.
Definition: RLFit.h:102
double fMzx
Slope in x-z view.
Definition: RLFit.h:100
double fX1
Start x position (cm)
Definition: RLFit.h:105
double fY1
Start y position (cm)
Definition: RLFit.h:106
double fZ1
Start z position (cm)
Definition: RLFit.h:107
double fBzy
Intercept in y-z view.
Definition: RLFit.h:103
double fZ2
End z position (cm)
Definition: RLFit.h:110
double fBzx
Intercept in x-z view.
Definition: RLFit.h:101
double fX2
End x position (cm)
Definition: RLFit.h:108

Member Data Documentation

double trk::RLFit::fBoxXhi

Detector box X edge.

Definition at line 113 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fBoxXlo

Detector box X edge.

Definition at line 112 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fBoxYhi

Detector box Y edge.

Definition at line 115 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fBoxYlo

Detector box Y edge.

Definition at line 114 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fBoxZhi

Detector box Z edge.

Definition at line 117 of file RLFit.h.

Referenced by RLFit().

double trk::RLFit::fBoxZlo

Detector box Z edge.

Definition at line 116 of file RLFit.h.

Referenced by RLFit().

double trk::RLFit::fBzx

Intercept in x-z view.

Definition at line 101 of file RLFit.h.

Referenced by Fit(), and UpdateSlopes().

double trk::RLFit::fBzy

Intercept in y-z view.

Definition at line 103 of file RLFit.h.

Referenced by Fit(), and UpdateSlopes().

double trk::RLFit::fChi2

Definition at line 119 of file RLFit.h.

Referenced by Fit().

double trk::RLFit::fDOF

Sum of weights * deltas.

Definition at line 120 of file RLFit.h.

Referenced by Fit().

double trk::RLFit::fMzx

Slope in x-z view.

Definition at line 100 of file RLFit.h.

Referenced by Fit(), and UpdateSlopes().

double trk::RLFit::fMzy

Slope in y-z view.

Definition at line 102 of file RLFit.h.

Referenced by Fit(), and UpdateSlopes().

std::vector<double> trk::RLFit::fR

Range of weight function.

Definition at line 87 of file RLFit.h.

Referenced by Fit(), RLFit(), and SetRTSchedule().

std::vector<double> trk::RLFit::fT

Transition width of weight function.

Definition at line 88 of file RLFit.h.

Referenced by Fit(), RLFit(), and SetRTSchedule().

std::vector<double> trk::RLFit::fWx

x view weights

Definition at line 95 of file RLFit.h.

Referenced by Fit(), comi::Leana::MuonCandidate(), comi::Cana::produce(), and RLFit().

std::vector<double> trk::RLFit::fWy

y view weights

Definition at line 98 of file RLFit.h.

Referenced by Fit(), comi::Leana::MuonCandidate(), comi::Cana::produce(), and RLFit().

double trk::RLFit::fX1
double trk::RLFit::fX2
std::vector<const rawdata::RawDigit*> trk::RLFit::fXhit

X view hits.

Definition at line 91 of file RLFit.h.

Referenced by comi::Leana::MuonCandidate(), comi::Cana::produce(), and RLFit().

std::vector<double> trk::RLFit::fXx

x positions (cm)

Definition at line 93 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fY1
double trk::RLFit::fY2
std::vector<const rawdata::RawDigit*> trk::RLFit::fYhit

Y view hits.

Definition at line 92 of file RLFit.h.

Referenced by comi::Leana::MuonCandidate(), comi::Cana::produce(), and RLFit().

std::vector<double> trk::RLFit::fYy

y positions (cm)

Definition at line 96 of file RLFit.h.

Referenced by Fit(), and RLFit().

double trk::RLFit::fZ1
double trk::RLFit::fZ2
std::vector<double> trk::RLFit::fZx

z positions (cm)

Definition at line 94 of file RLFit.h.

Referenced by Fit(), and RLFit().

std::vector<double> trk::RLFit::fZy

z positions (cm)

Definition at line 97 of file RLFit.h.

Referenced by Fit(), and RLFit().


The documentation for this class was generated from the following files: