Class SVTAlignmentFactory

java.lang.Object
org.jlab.detector.geant4.v2.SVT.SVTAlignmentFactory

public class SVTAlignmentFactory extends Object

Geometry for the SVT Link icon

Processes fiducial survey data into alignment shifts, and applies those shifts to a given point or volume.
Version:
1.1.0
Author:
pdavies
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    static void
    applyShift(Vector3d aPos, double[] aShift, Vector3d aNominalCenter)
    Applies the given alignment shift to the given point.
    static void
    applyShift(Geant4Basic aVol, double[] aShift, Vector3d aNominalCenter)
    Applies the given alignment shift to the given volume.
    static double[][]
    calcDeltas(double[][] aDataIdeal, double[][] aDataMeasured, String aOutputFile)
    Calculates the difference between two sets of fiducial data, and writes them to the given file.
    static double[][][]
    calcDistanceDeltas(double[][][] aDataIdeal, double[][][] aDataMeasured, String aOutputFile)
    Calculates the difference between two sets of distance data, and writes them to the given file.
    static double[][]
    calcShifts(double[][] aDataIdeal, double[][] aDataMeasured, String aOutputFile)
    Calculates the alignment shifts between two sets of fiducial data, and writes them to the given file.
    static double[][][]
    calcTriangleSides(double[][] aData, double aUncertainty, String aOutputFile)
    Calculates the distances between points for each triangle in a set of fiducial data, and writes them to the given file.
    static Vector3d
    createFiducial(int aFid)
    Returns a fiducial point on a sector module in the local frame.
    static double[][]
     
    static double[][]
     
    static double[][]
    Returns locations of nominal fiducial points.
    static Vector3d
    getIdealFiducialCenter(int aRegion, int aSector)
    Returns the fiducial center for a sector module before any alignment shifts been applied.
    static Vector3d[]
    getIdealFiducials(int aRegion, int aSector)
    Returns a set of fiducial points for a sector module before any alignment shifts been applied.
    static double[][]
    Returns locations of shifted fiducial points.
    static Vector3d[]
    getShiftedFiducials(int aRegion, int aSector)
    Returns a set of fiducial points for a sector module after the alignment shifts been applied.
    static void
    setup(org.jlab.detector.calib.utils.DatabaseConstantProvider cp, String aInputSurveyIdeal, String aInputSurveyMeasured)
    Sets up a new geometry factory to process fiducial survey data into alignment shifts.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • SVTAlignmentFactory Link icon

      public SVTAlignmentFactory()
  • Method Details Link icon

    • setup Link icon

      public static void setup(org.jlab.detector.calib.utils.DatabaseConstantProvider cp, String aInputSurveyIdeal, String aInputSurveyMeasured)
      Sets up a new geometry factory to process fiducial survey data into alignment shifts. Please run SVTConstants.connect() first.
      Parameters:
      cp - a DatabaseConstantProvider that has loaded the necessary tables
      aInputSurveyIdeal - a filename for the ideal data of the fiducial survey
      aInputSurveyMeasured - a filename for the measured data of the fiducial survey
    • calcShifts Link icon

      public static double[][] calcShifts(double[][] aDataIdeal, double[][] aDataMeasured, String aOutputFile)
      Calculates the alignment shifts between two sets of fiducial data, and writes them to the given file.
      Parameters:
      aDataIdeal - fiducial data
      aDataMeasured - fiducial data
      aOutputFile - a filename
      Returns:
      double[][] translations and axis-angle rotations of the form { tx, ty, tz, rx, ry, rz, ra } relative to the first data set
    • calcDeltas Link icon

      public static double[][] calcDeltas(double[][] aDataIdeal, double[][] aDataMeasured, String aOutputFile)
      Calculates the difference between two sets of fiducial data, and writes them to the given file.
      Parameters:
      aDataIdeal - first set of fiducial data
      aDataMeasured - second set of fiducial data
      aOutputFile - a filename
      Returns:
      double[][] point differences relative to the first data set
    • calcDistanceDeltas Link icon

      public static double[][][] calcDistanceDeltas(double[][][] aDataIdeal, double[][][] aDataMeasured, String aOutputFile)
      Calculates the difference between two sets of distance data, and writes them to the given file.
      Parameters:
      aDataIdeal - first set of distance data
      aDataMeasured - second set of distance data
      aOutputFile - a filename
      Returns:
      double[][][] distance differences relative to the first data set in {value,uncertainty} pairs
    • calcTriangleSides Link icon

      public static double[][][] calcTriangleSides(double[][] aData, double aUncertainty, String aOutputFile)
      Calculates the distances between points for each triangle in a set of fiducial data, and writes them to the given file.
      Parameters:
      aData - the set of fiducial data
      aUncertainty - uncertainty in the measurement of the coordinates
      aOutputFile - a filename
      Returns:
      double[][][] distances in {value,uncertainty} pairs
    • applyShift Link icon

      public static void applyShift(Vector3d aPos, double[] aShift, Vector3d aNominalCenter)
      Applies the given alignment shift to the given point.
      Parameters:
      aPos - a volume in the lab frame
      aShift - a translation and axis-angle rotation of the form { tx, ty, tz, rx, ry, rz, ra }
      aNominalCenter - a point about which to rotate the first point (for example the midpoint of the nominal fiducials)
    • applyShift Link icon

      public static void applyShift(Geant4Basic aVol, double[] aShift, Vector3d aNominalCenter)
      Applies the given alignment shift to the given volume.
      Parameters:
      aVol - a volume in the lab frame
      aShift - a translation and axis-angle rotation of the form { tx, ty, tz, rx, ry, rz, ra }
      aNominalCenter - a point about which to rotate the first point (for example the midpoint of the nominal fiducials)
    • getShiftedFiducialData Link icon

      public static double[][] getShiftedFiducialData()
      Returns locations of shifted fiducial points.
      Returns:
      double[][] an array of data in fiducial survey format.
    • getFactoryIdealFiducialData Link icon

      public static double[][] getFactoryIdealFiducialData()
      Returns locations of nominal fiducial points.
      Returns:
      double[][] an array of data in fiducial survey format.
    • getShiftedFiducials Link icon

      public static Vector3d[] getShiftedFiducials(int aRegion, int aSector) throws IllegalArgumentException
      Returns a set of fiducial points for a sector module after the alignment shifts been applied. These indices start from 0.
      Parameters:
      aRegion - an index starting from 0
      aSector - an index starting from 0
      Returns:
      Point3D[] an array of fiducial points in the order Cu+, Cu-, Pk
      Throws:
      IllegalArgumentException - indices out of bounds
    • getIdealFiducials Link icon

      public static Vector3d[] getIdealFiducials(int aRegion, int aSector) throws IllegalArgumentException
      Returns a set of fiducial points for a sector module before any alignment shifts been applied.
      Parameters:
      aRegion - an index starting from 0
      aSector - an index starting from 0
      Returns:
      Point3D[] an array of fiducial points in the order Cu+, Cu-, Pk
      Throws:
      IllegalArgumentException - indices out of bounds
    • getIdealFiducialCenter Link icon

      public static Vector3d getIdealFiducialCenter(int aRegion, int aSector) throws IllegalArgumentException
      Returns the fiducial center for a sector module before any alignment shifts been applied.
      Parameters:
      aRegion - an index starting from 0
      aSector - an index starting from 0
      Returns:
      Point3D the mean average point of the 3 fiducial points (Cu+, Cu-, Pk)
      Throws:
      IllegalArgumentException - indices out of bounds
    • createFiducial Link icon

      public static Vector3d createFiducial(int aFid) throws IllegalArgumentException
      Returns a fiducial point on a sector module in the local frame.
      Parameters:
      aFid - an index for the desired point: 0, 1, 2
      Returns:
      Point3D one of 3 fiducial points: Cu+, Cu-, Pk
      Throws:
      IllegalArgumentException - indices out of bounds
    • getDataSurveyIdeal Link icon

      public static double[][] getDataSurveyIdeal()
    • getDataSurveyMeasured Link icon

      public static double[][] getDataSurveyMeasured()