LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::LArRotationalTransformationPlugin Class Reference

LArRotationalTransformationPlugin class. More...

#include "LArRotationalTransformationPlugin.h"

Inheritance diagram for lar_content::LArRotationalTransformationPlugin:

Public Member Functions

 LArRotationalTransformationPlugin ()
 Default constructor. More...
 
virtual double UVtoW (const double u, const double v) const
 
virtual double VWtoU (const double v, const double w) const
 
virtual double WUtoV (const double w, const double u) const
 
virtual double UVtoY (const double u, const double v) const
 
virtual double UVtoZ (const double u, const double v) const
 
virtual double UWtoY (const double u, const double w) const
 
virtual double UWtoZ (const double u, const double w) const
 
virtual double VWtoY (const double v, const double w) const
 
virtual double VWtoZ (const double v, const double w) const
 
virtual double YZtoU (const double y, const double z) const
 
virtual double YZtoV (const double y, const double z) const
 
virtual double YZtoW (const double y, const double z) const
 
virtual void GetMinChiSquaredYZ (const double u, const double v, const double w, const double sigmaU, const double sigmaV, const double sigmaW, double &y, double &z, double &chiSquared) const
 
virtual void GetMinChiSquaredYZ (const double u, const double v, const double w, const double sigmaU, const double sigmaV, const double sigmaW, const double uFit, const double vFit, const double wFit, const double sigmaFit, double &y, double &z, double &chiSquared) const
 

Private Member Functions

pandora::StatusCode Initialize ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

double m_thetaU
 inclination of U wires (radians) More...
 
double m_thetaV
 inclination of V wires (radians) More...
 
double m_thetaW
 inclination of W wires (radians) More...
 
double m_sinU
 sin(thetaU) More...
 
double m_sinV
 sin(thetaV) More...
 
double m_sinW
 sin(thetaW) More...
 
double m_cosU
 cos(thetaU) More...
 
double m_cosV
 cos(thetaV) More...
 
double m_cosW
 cos(thetaW) More...
 
double m_sinVminusU
 sin(thetaV - thetaU) More...
 
double m_sinWminusV
 sin(thetaW - thetaV) More...
 
double m_sinUminusW
 sin(thetaU - thetaW) More...
 
double m_maxAngularDiscrepancyU
 Maximum allowed difference between u wire angles between LArTPCs. More...
 
double m_maxAngularDiscrepancyV
 Maximum allowed difference between v wire angles between LArTPCs. More...
 
double m_maxAngularDiscrepancyW
 Maximum allowed difference between w wire angles between LArTPCs. More...
 
double m_maxSigmaDiscrepancy
 Maximum allowed difference between like wire sigma values between LArTPCs. More...
 

Detailed Description

Constructor & Destructor Documentation

lar_content::LArRotationalTransformationPlugin::LArRotationalTransformationPlugin ( )

Default constructor.

Definition at line 28 of file LArRotationalTransformationPlugin.cc.

28  :
29  m_thetaU(0.),
30  m_thetaV(0.),
31  m_thetaW(0.),
32  m_sinU(0.),
33  m_sinV(0.),
34  m_sinW(0.),
35  m_cosU(0.),
36  m_cosV(0.),
37  m_cosW(0.),
38  m_sinVminusU(0.),
39  m_sinWminusV(0.),
40  m_sinUminusW(0.),
45 {
46 }
double m_maxAngularDiscrepancyU
Maximum allowed difference between u wire angles between LArTPCs.
double m_maxAngularDiscrepancyV
Maximum allowed difference between v wire angles between LArTPCs.
double m_maxAngularDiscrepancyW
Maximum allowed difference between w wire angles between LArTPCs.
double m_maxSigmaDiscrepancy
Maximum allowed difference between like wire sigma values between LArTPCs.

Member Function Documentation

void lar_content::LArRotationalTransformationPlugin::GetMinChiSquaredYZ ( const double  u,
const double  v,
const double  w,
const double  sigmaU,
const double  sigmaV,
const double  sigmaW,
double &  y,
double &  z,
double &  chiSquared 
) const
virtual

Definition at line 134 of file LArRotationalTransformationPlugin.cc.

References m_cosU, m_cosV, m_cosW, m_sinU, m_sinV, m_sinW, YZtoU(), YZtoV(), and YZtoW().

136 {
137  const double sigmaU2(sigmaU * sigmaU), sigmaV2(sigmaV * sigmaV), sigmaW2(sigmaW * sigmaW);
138 
139  // Obtain expression for chi2, differentiate wrt y and z, set both results to zero and solve simultaneously. Here just paste-in result.
140  y = (sigmaW2 * v * m_cosU * m_cosV * m_sinU - sigmaW2 * u * m_cosV * m_cosV * m_sinU + sigmaV2 * w * m_cosU * m_cosW * m_sinU -
141  sigmaV2 * u * m_cosW * m_cosW * m_sinU - sigmaW2 * v * m_cosU * m_cosU * m_sinV + sigmaW2 * u * m_cosU * m_cosV * m_sinV +
142  sigmaU2 * w * m_cosV * m_cosW * m_sinV - sigmaU2 * v * m_cosW * m_cosW * m_sinV - sigmaV2 * w * m_cosU * m_cosU * m_sinW -
143  sigmaU2 * w * m_cosV * m_cosV * m_sinW + sigmaV2 * u * m_cosU * m_cosW * m_sinW + sigmaU2 * v * m_cosV * m_cosW * m_sinW) /
144  (sigmaW2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaV2 * m_cosW * m_cosW * m_sinU * m_sinU - 2. * sigmaW2 * m_cosU * m_cosV * m_sinU * m_sinV +
145  sigmaW2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaU2 * m_cosW * m_cosW * m_sinV * m_sinV - 2. * sigmaV2 * m_cosU * m_cosW * m_sinU * m_sinW -
146  2. * sigmaU2 * m_cosV * m_cosW * m_sinV * m_sinW + sigmaV2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaU2 * m_cosV * m_cosV * m_sinW * m_sinW);
147 
148  z = (sigmaW2 * v * m_cosV * m_sinU * m_sinU + sigmaV2 * w * m_cosW * m_sinU * m_sinU - sigmaW2 * v * m_cosU * m_sinU * m_sinV -
149  sigmaW2 * u * m_cosV * m_sinU * m_sinV + sigmaW2 * u * m_cosU * m_sinV * m_sinV + sigmaU2 * w * m_cosW * m_sinV * m_sinV -
150  sigmaV2 * w * m_cosU * m_sinU * m_sinW - sigmaV2 * u * m_cosW * m_sinU * m_sinW - sigmaU2 * w * m_cosV * m_sinV * m_sinW -
151  sigmaU2 * v * m_cosW * m_sinV * m_sinW + sigmaV2 * u * m_cosU * m_sinW * m_sinW + sigmaU2 * v * m_cosV * m_sinW * m_sinW) /
152  (sigmaW2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaV2 * m_cosW * m_cosW * m_sinU * m_sinU - 2. * sigmaW2 * m_cosU * m_cosV * m_sinU * m_sinV +
153  sigmaW2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaU2 * m_cosW * m_cosW * m_sinV * m_sinV - 2. * sigmaV2 * m_cosU * m_cosW * m_sinU * m_sinW -
154  2. * sigmaU2 * m_cosV * m_cosW * m_sinV * m_sinW + sigmaV2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaU2 * m_cosV * m_cosV * m_sinW * m_sinW);
155 
156  const double deltaU(u - LArRotationalTransformationPlugin::YZtoU(y, z));
157  const double deltaV(v - LArRotationalTransformationPlugin::YZtoV(y, z));
158  const double deltaW(w - LArRotationalTransformationPlugin::YZtoW(y, z));
159  chiSquared = ((deltaU * deltaU) / sigmaU2) + ((deltaV * deltaV) / sigmaV2) + ((deltaW * deltaW) / sigmaW2);
160 }
virtual double YZtoW(const double y, const double z) const
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
virtual double YZtoV(const double y, const double z) const
virtual double YZtoU(const double y, const double z) const
Float_t w
Definition: plot.C:23
void lar_content::LArRotationalTransformationPlugin::GetMinChiSquaredYZ ( const double  u,
const double  v,
const double  w,
const double  sigmaU,
const double  sigmaV,
const double  sigmaW,
const double  uFit,
const double  vFit,
const double  wFit,
const double  sigmaFit,
double &  y,
double &  z,
double &  chiSquared 
) const
virtual

Definition at line 164 of file LArRotationalTransformationPlugin.cc.

References m_cosU, m_cosV, m_cosW, m_sinU, m_sinV, m_sinW, YZtoU(), YZtoV(), and YZtoW().

166 {
167  const double sigmaU2(sigmaU * sigmaU), sigmaV2(sigmaV * sigmaV), sigmaW2(sigmaW * sigmaW), sigmaFit2(sigmaFit * sigmaFit);
168 
169  // Obtain expression for chi2, differentiate wrt y and z, set both results to zero and solve simultaneously. Here just paste-in result.
170  y = (vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosV * m_sinU + vFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinU +
171  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosU * m_cosV * m_sinU + sigmaW2 * sigmaFit2 * sigmaFit2 * v * m_cosU * m_cosV * m_sinU -
172  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinU - uFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinU -
173  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosV * m_cosV * m_sinU - sigmaW2 * sigmaFit2 * sigmaFit2 * u * m_cosV * m_cosV * m_sinU +
174  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosW * m_sinU + wFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosW * m_sinU +
175  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosU * m_cosW * m_sinU + sigmaV2 * sigmaFit2 * sigmaFit2 * w * m_cosU * m_cosW * m_sinU -
176  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinU - uFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinU -
177  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosW * m_cosW * m_sinU - sigmaV2 * sigmaFit2 * sigmaFit2 * u * m_cosW * m_cosW * m_sinU -
178  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinV - vFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinV -
179  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosU * m_cosU * m_sinV - sigmaW2 * sigmaFit2 * sigmaFit2 * v * m_cosU * m_cosU * m_sinV +
180  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosV * m_sinV + uFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinV +
181  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosU * m_cosV * m_sinV + sigmaW2 * sigmaFit2 * sigmaFit2 * u * m_cosU * m_cosV * m_sinV +
182  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosW * m_sinV + wFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosW * m_sinV +
183  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosV * m_cosW * m_sinV + sigmaU2 * sigmaFit2 * sigmaFit2 * w * m_cosV * m_cosW * m_sinV -
184  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinV - vFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinV -
185  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosW * m_cosW * m_sinV - sigmaU2 * sigmaFit2 * sigmaFit2 * v * m_cosW * m_cosW * m_sinV -
186  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinW - wFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinW -
187  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosU * m_cosU * m_sinW - sigmaV2 * sigmaFit2 * sigmaFit2 * w * m_cosU * m_cosU * m_sinW -
188  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinW - wFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinW -
189  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosV * m_cosV * m_sinW - sigmaU2 * sigmaFit2 * sigmaFit2 * w * m_cosV * m_cosV * m_sinW +
190  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosW * m_sinW + uFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_cosW * m_sinW +
191  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosU * m_cosW * m_sinW + sigmaV2 * sigmaFit2 * sigmaFit2 * u * m_cosU * m_cosW * m_sinW +
192  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosW * m_sinW + vFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_cosW * m_sinW +
193  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosV * m_cosW * m_sinW + sigmaU2 * sigmaFit2 * sigmaFit2 * v * m_cosV * m_cosW * m_sinW) /
194  (sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU +
195  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU +
196  sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinU * m_sinU + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU +
197  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU + sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU -
198  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosV * m_sinU * m_sinV - 2. * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV -
199  2. * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV - 2. * sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV +
200  sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV +
201  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV +
202  sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinV * m_sinV + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV +
203  sigmaU2 * sigmaW2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV + sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV -
204  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosW * m_sinU * m_sinW - 2. * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW -
205  2. * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW - 2. * sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW -
206  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosW * m_sinV * m_sinW - 2. * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW -
207  2. * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW - 2. * sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW +
208  sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW +
209  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW +
210  sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinW * m_sinW + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW +
211  sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW+sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW);
212 
213  z = (vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_sinU * m_sinU + vFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosV * m_sinU * m_sinU +
214  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosV * m_sinU * m_sinU + sigmaW2 * sigmaFit2 * sigmaFit2 * v * m_cosV * m_sinU * m_sinU +
215  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_sinU * m_sinU + wFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosW * m_sinU * m_sinU +
216  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosW * m_sinU * m_sinU + sigmaV2 * sigmaFit2 * sigmaFit2 * w * m_cosW * m_sinU * m_sinU -
217  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_sinU * m_sinV - vFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_sinU * m_sinV -
218  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosU * m_sinU * m_sinV - sigmaW2 * sigmaFit2 * sigmaFit2 * v * m_cosU * m_sinU * m_sinV -
219  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_sinU * m_sinV - uFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_sinU * m_sinV -
220  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosV * m_sinU * m_sinV - sigmaW2 * sigmaFit2 * sigmaFit2 * u * m_cosV * m_sinU * m_sinV +
221  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_sinV * m_sinV + uFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_sinV * m_sinV +
222  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosU * m_sinV * m_sinV + sigmaW2 * sigmaFit2 * sigmaFit2 * u * m_cosU * m_sinV * m_sinV +
223  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_sinV * m_sinV + wFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosW * m_sinV * m_sinV +
224  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosW * m_sinV * m_sinV + sigmaU2 * sigmaFit2 * sigmaFit2 * w * m_cosW * m_sinV * m_sinV -
225  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_sinU * m_sinW - wFit * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_sinU * m_sinW -
226  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosU * m_sinU * m_sinW - sigmaV2 * sigmaFit2 * sigmaFit2 * w * m_cosU * m_sinU * m_sinW -
227  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_sinU * m_sinW - uFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_sinU * m_sinW -
228  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosW * m_sinU * m_sinW - sigmaV2 * sigmaFit2 * sigmaFit2 * u * m_cosW * m_sinU * m_sinW -
229  wFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_sinV * m_sinW - wFit * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_sinV * m_sinW -
230  sigmaU2 * sigmaV2 * sigmaFit2 * w * m_cosV * m_sinV * m_sinW - sigmaU2 * sigmaFit2 * sigmaFit2 * w * m_cosV * m_sinV * m_sinW -
231  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_sinV * m_sinW - vFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_sinV * m_sinW -
232  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosW * m_sinV * m_sinW - sigmaU2 * sigmaFit2 * sigmaFit2 * v * m_cosW * m_sinV * m_sinW +
233  uFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_sinW * m_sinW + uFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_sinW * m_sinW +
234  sigmaV2 * sigmaW2 * sigmaFit2 * u * m_cosU * m_sinW * m_sinW + sigmaV2 * sigmaFit2 * sigmaFit2 * u * m_cosU * m_sinW * m_sinW +
235  vFit * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_sinW * m_sinW + vFit * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_sinW * m_sinW +
236  sigmaU2 * sigmaW2 * sigmaFit2 * v * m_cosV * m_sinW * m_sinW + sigmaU2 * sigmaFit2 * sigmaFit2 * v * m_cosV * m_sinW * m_sinW) /
237  (sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU +
238  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU + sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosV * m_sinU * m_sinU +
239  sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinU * m_sinU + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU +
240  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU + sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosW * m_cosW * m_sinU * m_sinU -
241  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosV * m_sinU * m_sinV-2. * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV -
242  2. * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV-2. * sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosV * m_sinU * m_sinV +
243  sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaU2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV +
244  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV + sigmaW2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosU * m_sinV * m_sinV +
245  sigmaU2 * sigmaV2 * sigmaW2 * m_cosW * m_cosW * m_sinV * m_sinV + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV +
246  sigmaU2 * sigmaW2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV + sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosW * m_cosW * m_sinV * m_sinV -
247  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosW * m_sinU * m_sinW - 2. * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW -
248  2. * sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW - 2. * sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosW * m_sinU * m_sinW -
249  2. * sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosW * m_sinV * m_sinW - 2. * sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW -
250  2. * sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW - 2. * sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosW * m_sinV * m_sinW +
251  sigmaU2 * sigmaV2 * sigmaW2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW +
252  sigmaV2 * sigmaW2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW + sigmaV2 * sigmaFit2 * sigmaFit2 * m_cosU * m_cosU * m_sinW * m_sinW +
253  sigmaU2 * sigmaV2 * sigmaW2 * m_cosV * m_cosV * m_sinW * m_sinW + sigmaU2 * sigmaV2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW +
254  sigmaU2 * sigmaW2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW + sigmaU2 * sigmaFit2 * sigmaFit2 * m_cosV * m_cosV * m_sinW * m_sinW);
255 
256  const double outputU(LArRotationalTransformationPlugin::YZtoU(y, z));
257  const double outputV(LArRotationalTransformationPlugin::YZtoV(y, z));
258  const double outputW(LArRotationalTransformationPlugin::YZtoW(y, z));
259 
260  const double deltaU(u - outputU), deltaV(v - outputV), deltaW(w - outputW);
261  const double deltaUFit(uFit - outputU), deltaVFit(vFit - outputV), deltaWFit(wFit - outputW);
262 
263  chiSquared = ((deltaU * deltaU) / sigmaU2) + ((deltaV * deltaV) / sigmaV2) + ((deltaW * deltaW) / sigmaW2) +
264  ((deltaUFit * deltaUFit) / sigmaFit2) + ((deltaVFit * deltaVFit) / sigmaFit2) + ((deltaWFit * deltaWFit) / sigmaFit2);
265 }
virtual double YZtoW(const double y, const double z) const
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
virtual double YZtoV(const double y, const double z) const
virtual double YZtoU(const double y, const double z) const
Float_t w
Definition: plot.C:23
StatusCode lar_content::LArRotationalTransformationPlugin::Initialize ( )
private

Definition at line 270 of file LArRotationalTransformationPlugin.cc.

References m_cosU, m_cosV, m_cosW, m_maxAngularDiscrepancyU, m_maxAngularDiscrepancyV, m_maxAngularDiscrepancyW, m_maxSigmaDiscrepancy, m_sinU, m_sinUminusW, m_sinV, m_sinVminusU, m_sinW, m_sinWminusV, m_thetaU, m_thetaV, and m_thetaW.

271 {
272  const LArTPCMap &larTPCMap(this->GetPandora().GetGeometry()->GetLArTPCMap());
273 
274  if (larTPCMap.empty())
275  {
276  std::cout << "LArRotationalTransformationPlugin::Initialize - LArTPC description not registered with Pandora as required " << std::endl;
277  return STATUS_CODE_NOT_INITIALIZED;
278  }
279 
280  const LArTPC *const pFirstLArTPC(larTPCMap.begin()->second);
281  m_thetaU = pFirstLArTPC->GetWireAngleU();
282  m_thetaV = pFirstLArTPC->GetWireAngleV();
283  m_thetaW = pFirstLArTPC->GetWireAngleW();
284  const double sigmaUVW(pFirstLArTPC->GetSigmaUVW());
285 
286  m_sinU = std::sin(m_thetaU);
287  m_sinV = std::sin(m_thetaV);
288  m_sinW = std::sin(m_thetaW);
289  m_cosU = std::cos(m_thetaU);
290  m_cosV = std::cos(m_thetaV);
291  m_cosW = std::cos(m_thetaW);
292 
293  m_sinVminusU = std::sin(m_thetaV - m_thetaU);
294  m_sinWminusV = std::sin(m_thetaW - m_thetaV);
295  m_sinUminusW = std::sin(m_thetaU - m_thetaW);
296 
297  if ((std::fabs(m_sinVminusU) < std::numeric_limits<double>::epsilon()) || (std::fabs(m_sinWminusV) < std::numeric_limits<double>::epsilon()) ||
298  (std::fabs(m_sinUminusW) < std::numeric_limits<double>::epsilon()))
299  {
300  std::cout << "LArRotationalTransformationPlugin::Initialize - Equal wire angles; Plugin does not support provided LArTPC configurations. " << std::endl;
301  return STATUS_CODE_INVALID_PARAMETER;
302  }
303 
304  for (const LArTPCMap::value_type &mapEntry : larTPCMap)
305  {
306  const LArTPC *const pLArTPC(mapEntry.second);
307 
308  if ((std::fabs(m_thetaU - pLArTPC->GetWireAngleU()) > m_maxAngularDiscrepancyU) ||
309  (std::fabs(m_thetaV - pLArTPC->GetWireAngleV()) > m_maxAngularDiscrepancyV) ||
310  (std::fabs(m_thetaW - pLArTPC->GetWireAngleW()) > m_maxAngularDiscrepancyW) ||
311  (std::fabs(sigmaUVW - pLArTPC->GetSigmaUVW()) > m_maxSigmaDiscrepancy))
312  {
313  std::cout << "LArRotationalTransformationPlugin::Initialize - Dissimilar drift volumes; Plugin does not support provided LArTPC configurations. " << std::endl;
314  return STATUS_CODE_INVALID_PARAMETER;
315  }
316  }
317 
318  return STATUS_CODE_SUCCESS;
319 }
double m_maxAngularDiscrepancyU
Maximum allowed difference between u wire angles between LArTPCs.
double m_maxAngularDiscrepancyV
Maximum allowed difference between v wire angles between LArTPCs.
double m_maxAngularDiscrepancyW
Maximum allowed difference between w wire angles between LArTPCs.
double m_maxSigmaDiscrepancy
Maximum allowed difference between like wire sigma values between LArTPCs.
pandora::StatusCode lar_content::LArRotationalTransformationPlugin::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 323 of file LArRotationalTransformationPlugin.cc.

References m_maxAngularDiscrepancyU, m_maxAngularDiscrepancyV, m_maxAngularDiscrepancyW, and m_maxSigmaDiscrepancy.

324 {
325  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
326  "MaxAngularDiscrepancyU", m_maxAngularDiscrepancyU));
327 
328  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
329  "MaxAngularDiscrepancyV", m_maxAngularDiscrepancyV));
330 
331  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
332  "MaxAngularDiscrepancyW", m_maxAngularDiscrepancyW));
333 
334  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
335  "MaxSigmaDiscrepancy", m_maxSigmaDiscrepancy));
336 
337  return STATUS_CODE_SUCCESS;
338 }
double m_maxAngularDiscrepancyU
Maximum allowed difference between u wire angles between LArTPCs.
double m_maxAngularDiscrepancyV
Maximum allowed difference between v wire angles between LArTPCs.
double m_maxAngularDiscrepancyW
Maximum allowed difference between w wire angles between LArTPCs.
double m_maxSigmaDiscrepancy
Maximum allowed difference between like wire sigma values between LArTPCs.
double lar_content::LArRotationalTransformationPlugin::UVtoW ( const double  u,
const double  v 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::UVtoY ( const double  u,
const double  v 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::UVtoZ ( const double  u,
const double  v 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::UWtoY ( const double  u,
const double  w 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::UWtoZ ( const double  u,
const double  w 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::VWtoU ( const double  v,
const double  w 
) const
virtual

Definition at line 57 of file LArRotationalTransformationPlugin.cc.

References m_sinUminusW, m_sinVminusU, and m_sinWminusV.

58 {
59  return (-1. * (v * m_sinUminusW + w * m_sinVminusU) / m_sinWminusV);
60 }
Float_t w
Definition: plot.C:23
double lar_content::LArRotationalTransformationPlugin::VWtoY ( const double  v,
const double  w 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::VWtoZ ( const double  v,
const double  w 
) const
virtual
double lar_content::LArRotationalTransformationPlugin::WUtoV ( const double  w,
const double  u 
) const
virtual

Definition at line 64 of file LArRotationalTransformationPlugin.cc.

References m_sinUminusW, m_sinVminusU, and m_sinWminusV.

65 {
66  return (-1. * (u * m_sinWminusV + w * m_sinVminusU) / m_sinUminusW);
67 }
Float_t w
Definition: plot.C:23
double lar_content::LArRotationalTransformationPlugin::YZtoU ( const double  y,
const double  z 
) const
virtual

Definition at line 113 of file LArRotationalTransformationPlugin.cc.

References m_cosU, and m_sinU.

Referenced by GetMinChiSquaredYZ().

114 {
115  return (z * m_cosU - y * m_sinU);
116 }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double lar_content::LArRotationalTransformationPlugin::YZtoV ( const double  y,
const double  z 
) const
virtual

Definition at line 120 of file LArRotationalTransformationPlugin.cc.

References m_cosV, and m_sinV.

Referenced by GetMinChiSquaredYZ().

121 {
122  return (z * m_cosV - y * m_sinV);
123 }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double lar_content::LArRotationalTransformationPlugin::YZtoW ( const double  y,
const double  z 
) const
virtual

Definition at line 127 of file LArRotationalTransformationPlugin.cc.

References m_cosW, and m_sinW.

Referenced by GetMinChiSquaredYZ().

128 {
129  return (z * m_cosW - y * m_sinW);
130 }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279

Member Data Documentation

double lar_content::LArRotationalTransformationPlugin::m_cosU
private

cos(thetaU)

Definition at line 58 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UVtoY(), UWtoY(), and YZtoU().

double lar_content::LArRotationalTransformationPlugin::m_cosV
private

cos(thetaV)

Definition at line 59 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UVtoY(), VWtoY(), and YZtoV().

double lar_content::LArRotationalTransformationPlugin::m_cosW
private

cos(thetaW)

Definition at line 60 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UWtoY(), VWtoY(), and YZtoW().

double lar_content::LArRotationalTransformationPlugin::m_maxAngularDiscrepancyU
private

Maximum allowed difference between u wire angles between LArTPCs.

Definition at line 65 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), and ReadSettings().

double lar_content::LArRotationalTransformationPlugin::m_maxAngularDiscrepancyV
private

Maximum allowed difference between v wire angles between LArTPCs.

Definition at line 66 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), and ReadSettings().

double lar_content::LArRotationalTransformationPlugin::m_maxAngularDiscrepancyW
private

Maximum allowed difference between w wire angles between LArTPCs.

Definition at line 67 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), and ReadSettings().

double lar_content::LArRotationalTransformationPlugin::m_maxSigmaDiscrepancy
private

Maximum allowed difference between like wire sigma values between LArTPCs.

Definition at line 68 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), and ReadSettings().

double lar_content::LArRotationalTransformationPlugin::m_sinU
private

sin(thetaU)

Definition at line 55 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UVtoZ(), UWtoZ(), and YZtoU().

double lar_content::LArRotationalTransformationPlugin::m_sinUminusW
private

sin(thetaU - thetaW)

Definition at line 63 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), UVtoW(), UWtoY(), UWtoZ(), VWtoU(), and WUtoV().

double lar_content::LArRotationalTransformationPlugin::m_sinV
private

sin(thetaV)

Definition at line 56 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UVtoZ(), VWtoZ(), and YZtoV().

double lar_content::LArRotationalTransformationPlugin::m_sinVminusU
private

sin(thetaV - thetaU)

Definition at line 61 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), UVtoW(), UVtoY(), UVtoZ(), VWtoU(), and WUtoV().

double lar_content::LArRotationalTransformationPlugin::m_sinW
private

sin(thetaW)

Definition at line 57 of file LArRotationalTransformationPlugin.h.

Referenced by GetMinChiSquaredYZ(), Initialize(), UWtoZ(), VWtoZ(), and YZtoW().

double lar_content::LArRotationalTransformationPlugin::m_sinWminusV
private

sin(thetaW - thetaV)

Definition at line 62 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize(), UVtoW(), VWtoU(), VWtoY(), VWtoZ(), and WUtoV().

double lar_content::LArRotationalTransformationPlugin::m_thetaU
private

inclination of U wires (radians)

Definition at line 51 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize().

double lar_content::LArRotationalTransformationPlugin::m_thetaV
private

inclination of V wires (radians)

Definition at line 52 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize().

double lar_content::LArRotationalTransformationPlugin::m_thetaW
private

inclination of W wires (radians)

Definition at line 53 of file LArRotationalTransformationPlugin.h.

Referenced by Initialize().


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