本文整理汇总了C++中geometry::IDetector_const_sptr::getRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ IDetector_const_sptr::getRotation方法的具体用法?C++ IDetector_const_sptr::getRotation怎么用?C++ IDetector_const_sptr::getRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry::IDetector_const_sptr
的用法示例。
在下文中一共展示了IDetector_const_sptr::getRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: detRadius
/**
* This function calculates the exponential contribution to the He3 tube
* efficiency.
* @param spectraIndex :: the current index to calculate
* @param idet :: the current detector pointer
* @throw out_of_range if twice tube thickness is greater than tube diameter
* @return the exponential contribution for the given detector
*/
double He3TubeEfficiency::calculateExponential(std::size_t spectraIndex, Geometry::IDetector_const_sptr idet)
{
// Get the parameters for the current associated tube
double pressure = this->getParameter("TubePressure", spectraIndex,
"tube_pressure", idet);
double tubethickness = this->getParameter("TubeThickness", spectraIndex,
"tube_thickness", idet);
double temperature = this->getParameter("TubeTemperature", spectraIndex,
"tube_temperature", idet);
double detRadius(0.0);
Kernel::V3D detAxis;
this->getDetectorGeometry(idet, detRadius, detAxis);
double detDiameter = 2.0 * detRadius;
double twiceTubeThickness = 2.0 * tubethickness;
// now get the sin of the angle, it's the magnitude of the cross product of
// unit vector along the detector tube axis and a unit vector directed from
// the sample to the detector center
Kernel::V3D vectorFromSample = idet->getPos() - this->samplePos;
vectorFromSample.normalize();
Kernel::Quat rot = idet->getRotation();
// rotate the original cylinder object axis to get the detector axis in the
// actual instrument
rot.rotate(detAxis);
detAxis.normalize();
// Scalar product is quicker than cross product
double cosTheta = detAxis.scalar_prod(vectorFromSample);
double sinTheta = std::sqrt(1.0 - cosTheta * cosTheta);
const double straight_path = detDiameter - twiceTubeThickness;
if (std::fabs(straight_path - 0.0) < TOL)
{
throw std::out_of_range("Twice tube thickness cannot be greater than "\
"or equal to the tube diameter");
}
const double pathlength = straight_path / sinTheta;
return EXP_SCALAR_CONST * (pressure / temperature) * pathlength;
}