9 #include "Geometry/LArTPC.h" 11 #include "Helpers/XmlHelper.h" 13 #include "Managers/GeometryManager.h" 15 #include "Objects/CartesianVector.h" 17 #include "Pandora/Pandora.h" 41 m_maxAngularDiscrepancyU(0.03),
42 m_maxAngularDiscrepancyV(0.03),
43 m_maxAngularDiscrepancyW(0.03),
44 m_maxSigmaDiscrepancy(0.01)
135 const double sigmaW,
double &
y,
double &
z,
double &chiSquared)
const 137 const double sigmaU2(sigmaU * sigmaU), sigmaV2(sigmaV * sigmaV), sigmaW2(sigmaW * sigmaW);
159 chiSquared = ((deltaU * deltaU) / sigmaU2) + ((deltaV * deltaV) / sigmaV2) + ((deltaW * deltaW) / sigmaW2);
165 const double sigmaW,
const double uFit,
const double vFit,
const double wFit,
const double sigmaFit,
double &
y,
double &
z,
double &chiSquared)
const 167 const double sigmaU2(sigmaU * sigmaU), sigmaV2(sigmaV * sigmaV), sigmaW2(sigmaW * sigmaW), sigmaFit2(sigmaFit * sigmaFit);
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) /
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);
260 const double deltaU(u - outputU), deltaV(v - outputV), deltaW(w - outputW);
261 const double deltaUFit(uFit - outputU), deltaVFit(vFit - outputV), deltaWFit(wFit - outputW);
263 chiSquared = ((deltaU * deltaU) / sigmaU2) + ((deltaV * deltaV) / sigmaV2) + ((deltaW * deltaW) / sigmaW2) +
264 ((deltaUFit * deltaUFit) / sigmaFit2) + ((deltaVFit * deltaVFit) / sigmaFit2) + ((deltaWFit * deltaWFit) / sigmaFit2);
272 const LArTPCMap &larTPCMap(this->GetPandora().GetGeometry()->GetLArTPCMap());
274 if (larTPCMap.empty())
276 std::cout <<
"LArRotationalTransformationPlugin::Initialize - LArTPC description not registered with Pandora as required " << std::endl;
277 return STATUS_CODE_NOT_INITIALIZED;
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());
286 m_sinU = std::sin(m_thetaU);
289 m_cosU = std::cos(m_thetaU);
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()))
300 std::cout <<
"LArRotationalTransformationPlugin::Initialize - Equal wire angles; Plugin does not support provided LArTPC configurations. " << std::endl;
301 return STATUS_CODE_INVALID_PARAMETER;
304 for (
const LArTPCMap::value_type &mapEntry : larTPCMap)
306 const LArTPC *
const pLArTPC(mapEntry.second);
313 std::cout <<
"LArRotationalTransformationPlugin::Initialize - Dissimilar drift volumes; Plugin does not support provided LArTPC configurations. " << std::endl;
314 return STATUS_CODE_INVALID_PARAMETER;
318 return STATUS_CODE_SUCCESS;
325 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
328 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
331 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
334 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
337 return STATUS_CODE_SUCCESS;
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 double UVtoY(const double u, const double v) const
virtual double UVtoW(const double u, const double v) const
pandora::StatusCode Initialize()
virtual double YZtoW(const double y, const double z) const
virtual double UVtoZ(const double u, const double v) const
double m_sinVminusU
sin(thetaV - thetaU)
virtual double VWtoU(const double v, const double w) const
double m_thetaW
inclination of W wires (radians)
double m_maxAngularDiscrepancyU
Maximum allowed difference between u wire angles between LArTPCs.
double m_sinUminusW
sin(thetaU - thetaW)
virtual double UWtoZ(const double u, const double w) const
double m_thetaV
inclination of V wires (radians)
virtual double YZtoV(const double y, const double z) const
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_sinWminusV
sin(thetaW - thetaV)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
virtual double VWtoZ(const double v, const double w) const
virtual double WUtoV(const double w, const double u) const
double m_thetaU
inclination of U wires (radians)
virtual double YZtoU(const double y, const double z) const
double m_maxSigmaDiscrepancy
Maximum allowed difference between like wire sigma values between LArTPCs.
LArRotationalTransformationPlugin()
Default constructor.
virtual double VWtoY(const double v, const double w) const
virtual double UWtoY(const double u, const double w) const