示例#1
0
double QxrdCenterFinder::getTTH(double x, double y) const
{
  if (get_ImplementTilt()) {
    double beta = get_DetectorTilt()*M_PI/180.0;
    double rot  = get_TiltPlaneRotation()*M_PI/180.0;

    return getTwoTheta(get_CenterX(), get_CenterY(), get_DetectorDistance(),
                       x, y, get_DetectorXPixelSize(), get_DetectorYPixelSize(),
                       cos(beta), sin(beta), cos(rot), sin(rot));
  } else {
    return getTwoTheta(get_CenterX(), get_CenterY(), get_DetectorDistance(),
                       x, y, get_DetectorXPixelSize(), get_DetectorYPixelSize(),
                       1.0, 0.0, 1.0, 0.0);
  }
}
示例#2
0
/**
 * Get the theta and phi angles for the given ID. If the detector was part of a
 * group,
 * as defined in the ExperimentInfo object, then the theta/phi are for the whole
 * set.
 * @param detID A reference to a single ID
 * @param exptInfo A reference to the ExperimentInfo that defines that
 * spectrum->detector mapping
 * @param theta [Output] Set to the theta angle for the detector (set)
 * @param phi [Output] Set to the phi angle for the detector (set)
 * @return A poiner to the Detector object for this spectrum as a whole
 *         (may be a single pixel or group)
 */
Geometry::IDetector_const_sptr
MDNormDirectSC::getThetaPhi(const detid_t detID, const ExperimentInfo &exptInfo,
                            double &theta, double &phi) {
  const auto spectrum = exptInfo.getDetectorByID(detID);
  theta = spectrum->getTwoTheta(m_samplePos, m_beamDir);
  phi = spectrum->getPhi();
  return spectrum;
}