Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:22

0001 #ifndef DetPositioner_H
0002 #define DetPositioner_H
0003 
0004 #include "Geometry/CommonTopologies/interface/GeomDet.h"
0005 #include "Geometry/CommonTopologies/interface/GeomDet.h"
0006 
0007 /* A base class for classes which modify the positions/orientations of GeomDets.
0008  * The derived classes can call the methods moveGeomDet, rotateGeomDet, setGeomDetPosition,
0009  * setAlignmentPositionError and setSurfaceDeformation to change the position, orientation etc.
0010  */
0011 
0012 class DetPositioner {
0013 public:
0014   virtual ~DetPositioner() {}
0015 
0016 protected:
0017   void moveGeomDet(GeomDet& det, const GlobalVector& displacement) { det.move(displacement); }
0018 
0019   /** Relative rotation (with respect to current orientation)
0020    * Does not move components (if any).
0021    */
0022   void rotateGeomDet(GeomDet& det, const Surface::RotationType& rotation) { det.rotate(rotation); }
0023 
0024   /** Replaces the current position and rotation with new ones; actually replaces the 
0025    *  surface with a new surface.
0026    *  Does not move components (if any).
0027    */
0028   void setGeomDetPosition(GeomDet& det, const Surface::PositionType& position, const Surface::RotationType& rotation) {
0029     det.setPosition(position, rotation);
0030   }
0031 
0032   /** create the AlignmentPositionError for this Det if not existing yet,
0033    *  or replace the existing one by the given one. For adding, use the
0034    *  +=,-=  methods of the AlignmentPositionError
0035    *  Does not affect the AlignmentPositionError of components (if any).
0036    */
0037   bool setAlignmentPositionError(GeomDet& det, const AlignmentPositionError& ape) {
0038     return det.setAlignmentPositionError(ape);
0039   }
0040 
0041   /** set the SurfaceDeformation for this DetUnit.
0042    *  Does not affect the SurfaceDeformation of components (if any).
0043    */
0044   void setSurfaceDeformation(GeomDetUnit& detUnit, const SurfaceDeformation* deformation) {
0045     detUnit.setSurfaceDeformation(deformation);
0046   }
0047 };
0048 
0049 #endif