Class BMTGeometry

java.lang.Object
org.jlab.rec.cvt.bmt.BMTGeometry

public class BMTGeometry extends Object
Author:
devita
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Handles BMT geometry
  • Method Summary

    Modifier and Type
    Method
    Description
    org.jlab.groot.group.DataGroup
     
    getAxis(int layer, int sector)
    Return axis for the selected tile, identified by layer and sector
    getCstrip(int region, int sector, int strip)
    Returns Arc3D corresponding to the selected C-detector strip according to real geometry
    int
    getCstrip(int region, Point3D traj)
    Return the number of the closest strip to the given trajectory point in the detector local frame
    double
    getCstripZ(int region, int strip)
    Returns the Z position of the selected C-detector strip in the local frame
    static BMTType
    getDetectorType(int layer)
    Return region number for a given layer
    double
    getDPhi(int layer, int sector)
    Return half tile phi coverage
    getIdealLCZstrip(int region, int sector, int strip, Swim swim)
    Returns Line3D for Z detector pseudostrip identified from region, sector, strip numbers, for ideal geometry After Loentz angle correction
     
    int
    getLayer(int region, BMTType detector)
    Return layer number for a given region and detector type
    int
    getLayer(Point3D localtraj, double strip2Det)
    Return the layer number
    static int[]
     
    getLCZstrip(int region, int sector, int strip, Swim swim)
    Returns Line3D for Z detector pseudo-strip identified from region, sector, strip numbers, for real geometry After Lorentz angle correction
    double
    getLocalAngle(int layer, int sector, Point3D trackPos, Vector3D trackDir)
     
    getLocalTrack(int layer, int sector, Point3D trackPos, Vector3D trackDir)
    Return track vector for local angle calculations 1) transform to the geometry service local frame first, 2) rotates to bring the track intersection at phi=90.
    static int[]
     
    static int
    getModuleId(int layer, int sector)
     
    int
     
    int
     
    int
    getNStrips(int layer)
    Return number of strips of the selected layer
    getOffset(int layer, int sector)
    Return offset of the selected tile, identified by layer and sector
     
    double
    getPhi(int layer, int sector)
    Return tile phi center
    double
    getPhi(int layer, int sector, Point3D traj)
     
    double
    getPitch(int layer, int strip)
    Return pitch for the selected layer and strip
    double
    getRadius(int layer)
    Return radius of the selected strip layer
    double
    getRadiusMidDrift(int layer)
    Return radius of the selected layer corresponding to the center of the drift gap
    int
    getRegion(int layer)
    Return region number for a given layer
    getRotation(int layer, int sector)
    Return ROTATIONS for the selected tile, identified by layer and sector
    int
    getSector(int layer, double localAngle)
    Return the sector number
    int
    getSector(int layer, Point3D localTraj)
    Return the sector number
    int
    getStrip(int layer, int sector, Point3D traj)
    Return the number of the closest strip to the given trajectory point Detector mis-alignments geometry are taken into account by transforming the trajectory point to detector local frame
    int
    getStrip(Point3D traj, double strip2Det)
    Checks whether a trajectory point is within the active area of a tile
    getSurface(int layer, int sector, Strip strip)
     
    getSurfaceC(int layer, int sector, int stripId, double centroid, double centroidValue)
     
     
    getSurfaceZ(int layer, int sector, int stripId, double centroid, double x, double y, double centroidValue)
     
    double
    getThetaC(int layer, int sector, Point3D trackPos, Vector3D trackDir)
    Returns the local angle of the track for C detectors the angle is positive for tracks going at positive z
    double
    getThetaLorentz(int layer, int sector, double x, double y, double z, Swim swim)
    Calculate Theta Lorentz based on solenoid scale and drift settings
    double
    getThetaLorentz(int layer, int sector, Point3D pos, Swim swim)
    Calculate Theta Lorentz based on solenoid scale and drift settings
    double
    getThetaZ(int layer, int sector, Point3D trackPos, Vector3D trackDir)
    Returns the local angle of the track for Z detectors the angle is positive for tracks going toward positive phi
    double
    Return thickness of the drift gap
    getTileSurface(int layer, int sector)
     
    double
    getZmax(int layer)
    Return maximum z of the selected layer in the local frame
    double
    getZmin(int layer)
    Return minimum z of the selected layer in the local frame
    getZstrip(int region, int sector, int strip)
    Returns Line3D for Z detector strip identified from region, sector, strip numbers, for real geometry
    int
    getZstrip(int region, Point3D localTraj)
    Return the number of the closest strip to the given trajectory point in the detector local frame
    double
    getZstripPhi(int region, int sector, int strip)
     
    boolean
    inDetector(int layer, int sector, Point3D traj)
    Checks whether a trajectory point is within the active area of a tile
    static void
    main(String[] arg)
    Executable method: implements checks
    toGlobal(int layer, int sector)
     
    toGlobal(Point3D local, int layer, int sector)
     
    toLocal(int layer, int sector)
     
    toLocal(Point3D global, int layer, int sector)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BMTGeometry

      public BMTGeometry(IndexedTable voltage)
      Handles BMT geometry
      Parameters:
      voltage - HV table
  • Method Details

    • getNLayers

      public int getNLayers()
    • getNSectors

      public int getNSectors()
    • getLayer

      public int getLayer(int region, BMTType detector)
      Return layer number for a given region and detector type
      Parameters:
      region - (1-3)
      detector - (C or Z)
      Returns:
      layer (1-6)
    • getlZ

      public static int[] getlZ()
      Returns:
      the lZ
    • getlC

      public static int[] getlC()
      Returns:
      the lC
    • getRegion

      public int getRegion(int layer)
      Return region number for a given layer
      Parameters:
      layer - (1-6)
      Returns:
      region (1-3)
    • getModuleId

      public static int getModuleId(int layer, int sector)
    • getDetectorType

      public static BMTType getDetectorType(int layer)
      Return region number for a given layer
      Parameters:
      layer - (1-6)
      Returns:
      type ("C" or "Z");
    • getRadius

      public double getRadius(int layer)
      Return radius of the selected strip layer
      Parameters:
      layer - (1-6)
      Returns:
      radius
    • getRadiusMidDrift

      public double getRadiusMidDrift(int layer)
      Return radius of the selected layer corresponding to the center of the drift gap
      Parameters:
      layer - (1-6)
      Returns:
      radius (=0 if layer is out of range)
    • getNStrips

      public int getNStrips(int layer)
      Return number of strips of the selected layer
      Parameters:
      layer - (1-6)
      Returns:
      nstrips (=0 if layer is out of range)
    • getPitch

      public double getPitch(int layer, int strip)
      Return pitch for the selected layer and strip
      Parameters:
      layer - (1-6)
      strip -
      Returns:
      pitch (=0 if layer is out of range)
    • getZmin

      public double getZmin(int layer)
      Return minimum z of the selected layer in the local frame
      Parameters:
      layer - (1-6)
      Returns:
      z (=udf if layer is out of range)
    • getZmax

      public double getZmax(int layer)
      Return maximum z of the selected layer in the local frame
      Parameters:
      layer - (1-6)
      Returns:
      z (=udf if layer is out of range)
    • getPhi

      public double getPhi(int layer, int sector)
      Return tile phi center
      Parameters:
      layer - (1-6)
      sector - (1-3)
      Returns:
      phi (=udf if layer is out of range)
    • getDPhi

      public double getDPhi(int layer, int sector)
      Return half tile phi coverage
      Parameters:
      layer - (1-6)
      sector - (1-3)
      Returns:
      dz (=udf if layer is out of range)
    • getThickness

      public double getThickness()
      Return thickness of the drift gap
      Returns:
      thickness
    • getOffset

      public Point3D getOffset(int layer, int sector)
      Return offset of the selected tile, identified by layer and sector
      Parameters:
      layer - (1-6)
      sector - (1-3)
      Returns:
      Point3D offset: 3D offset
    • getRotation

      public Vector3D getRotation(int layer, int sector)
      Return ROTATIONS for the selected tile, identified by layer and sector
      Parameters:
      layer - (1-6)
      sector - (1-3)
      Returns:
      Point3D offset: 3D offset
    • toGlobal

      public Transformation3D toGlobal(int layer, int sector)
    • toLocal

      public Transformation3D toLocal(int layer, int sector)
    • getAxis

      public Line3D getAxis(int layer, int sector)
      Return axis for the selected tile, identified by layer and sector
      Parameters:
      layer - (1-6)
      sector - (1-3)
      Returns:
      Point3D offset: 3D offset
    • toLocal

      public Point3D toLocal(Point3D global, int layer, int sector)
    • toGlobal

      public Point3D toGlobal(Point3D local, int layer, int sector)
    • getZstrip

      public Line3D getZstrip(int region, int sector, int strip)
      Returns Line3D for Z detector strip identified from region, sector, strip numbers, for real geometry
      Parameters:
      region -
      sector -
      strip -
      Returns:
      stripline
    • getIdealLCZstrip

      public Line3D getIdealLCZstrip(int region, int sector, int strip, Swim swim)
      Returns Line3D for Z detector pseudostrip identified from region, sector, strip numbers, for ideal geometry After Loentz angle correction
      Parameters:
      region -
      sector -
      strip -
      swim -
      Returns:
      Line3D
    • getLCZstrip

      public Line3D getLCZstrip(int region, int sector, int strip, Swim swim)
      Returns Line3D for Z detector pseudo-strip identified from region, sector, strip numbers, for real geometry After Lorentz angle correction
      Parameters:
      region -
      sector -
      strip -
      swim -
      Returns:
      stripline
    • getZstripPhi

      public double getZstripPhi(int region, int sector, int strip)
      Parameters:
      region -
      sector -
      strip -
      Returns:
      the phi angle of the strip center in radians
    • getCstripZ

      public double getCstripZ(int region, int strip)
      Returns the Z position of the selected C-detector strip in the local frame
      Parameters:
      region -
      strip -
      Returns:
      zc
    • getCstrip

      public Arc3D getCstrip(int region, int sector, int strip)
      Returns Arc3D corresponding to the selected C-detector strip according to real geometry
      Parameters:
      region -
      sector -
      strip -
      Returns:
    • getTileSurface

      public Cylindrical3D getTileSurface(int layer, int sector)
    • getSector

      public int getSector(int layer, double localAngle)
      Return the sector number
      Parameters:
      layer - [0-6]
      localAngle - track angle in the local frame in radians
      Returns:
      sector [1-3] (not) accounting for dead areas if layer (0) [1-6] or 0 if layer is undefined
    • getSector

      public int getSector(int layer, Point3D localTraj)
      Return the sector number
      Parameters:
      layer - [0-6]
      localTraj - trajectory point in the local frame
      Returns:
      sector [1-3] (not) accounting for dead areas if layer (0) [1-6] or 0 if layer is undefined
    • getLayer

      public int getLayer(Point3D localtraj, double strip2Det)
      Return the layer number
      Parameters:
      localtraj - point on one of the detector surfaces
      strip2Det -
      Returns:
      layer [1-6] or 0 if undefined
    • inDetector

      public boolean inDetector(int layer, int sector, Point3D traj)
      Checks whether a trajectory point is within the active area of a tile
      Parameters:
      layer -
      sector -
      traj -
      Returns:
      true/false
    • getStrip

      public int getStrip(Point3D traj, double strip2Det)
      Checks whether a trajectory point is within the active area of a tile
      Parameters:
      traj -
      Returns:
      true/false
    • getStrip

      public int getStrip(int layer, int sector, Point3D traj)
      Return the number of the closest strip to the given trajectory point Detector mis-alignments geometry are taken into account by transforming the trajectory point to detector local frame
      Parameters:
      layer - (1-6)
      sector - (1-3)
      traj - trajectory point on the layer surface in the lab
      Returns:
      strip number (0 if the point is not within the active area)
    • getCstrip

      public int getCstrip(int region, Point3D traj)
      Return the number of the closest strip to the given trajectory point in the detector local frame
      Parameters:
      region - (1-3)
      traj - trajectory point on the layer surface in the local frame
      Returns:
      strip number (0 if the point is not within the active area)
    • getZstrip

      public int getZstrip(int region, Point3D localTraj)
      Return the number of the closest strip to the given trajectory point in the detector local frame
      Parameters:
      region - (1-3)
      localTraj - trajectory point on the layer surface in the local frame
      Returns:
      strip number (0 if the point is not within the active area)
    • getPhi

      public double getPhi(int layer, int sector, Point3D traj)
    • getThetaLorentz

      public double getThetaLorentz(int layer, int sector, Point3D pos, Swim swim)
      Calculate Theta Lorentz based on solenoid scale and drift settings
      Parameters:
      layer -
      sector -
      pos -
      swim -
      Returns:
      thetaL in radians
    • getThetaLorentz

      public double getThetaLorentz(int layer, int sector, double x, double y, double z, Swim swim)
      Calculate Theta Lorentz based on solenoid scale and drift settings
      Parameters:
      layer -
      sector -
      x -
      y -
      z -
      swim -
      Returns:
      thetaL in radians
    • getLocalTrack

      public Vector3D getLocalTrack(int layer, int sector, Point3D trackPos, Vector3D trackDir)
      Return track vector for local angle calculations 1) transform to the geometry service local frame first, 2) rotates to bring the track intersection at phi=90. The final frame has: - z along the axis of the tile cylinder - y perpendicular to the surface The y and x components determine the local angle for Z strips The x and z components determine the local angle for C strips
      Parameters:
      layer -
      sector -
      trackPos -
      trackDir -
      Returns:
      track direction unit vector
    • getThetaZ

      public double getThetaZ(int layer, int sector, Point3D trackPos, Vector3D trackDir)
      Returns the local angle of the track for Z detectors the angle is positive for tracks going toward positive phi
      Parameters:
      layer -
      sector -
      trackPos -
      trackDir -
      Returns:
      local angle
    • getThetaC

      public double getThetaC(int layer, int sector, Point3D trackPos, Vector3D trackDir)
      Returns the local angle of the track for C detectors the angle is positive for tracks going at positive z
      Parameters:
      layer -
      sector -
      trackPos -
      trackDir -
      Returns:
      local angle
    • getLocalAngle

      public double getLocalAngle(int layer, int sector, Point3D trackPos, Vector3D trackDir)
    • getSurfaces

      public List<Surface> getSurfaces()
    • getSurfaceC

      public Surface getSurfaceC(int layer, int sector, int stripId, double centroid, double centroidValue)
    • getSurfaceZ

      public Surface getSurfaceZ(int layer, int sector, int stripId, double centroid, double x, double y, double centroidValue)
    • getSurface

      public Surface getSurface(int layer, int sector, Strip strip)
    • getInnerTube

      public Surface getInnerTube()
    • getOuterTube

      public Surface getOuterTube()
    • draw

      public org.jlab.groot.group.DataGroup draw()
    • main

      public static void main(String[] arg)
      Executable method: implements checks
      Parameters:
      arg -