Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:33

0001 #ifndef Alignment_CommonAlignment_AlignableDetUnit_H
0002 #define Alignment_CommonAlignment_AlignableDetUnit_H
0003 
0004 #include "Alignment/CommonAlignment/interface/Alignable.h"
0005 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0006 
0007 /// A concrete class that allows to (mis)align a DetUnit.
0008 ///
0009 /// Typically all AlignableComposites have (directly or
0010 /// indirectly) this one as the ultimate component.
0011 
0012 class AlignableDetUnit : public Alignable {
0013 public:
0014   /// Constructor from GeomDetUnit - must not be NULL pointer!
0015   AlignableDetUnit(const GeomDetUnit* geomDetUnit);
0016 
0017   /// Destructor
0018   ~AlignableDetUnit() override;
0019 
0020   /// Updater from GeomDetUnit
0021   /// The given GeomDetUnit id has to match the current id.
0022   void update(const GeomDetUnit* geomDetUnit);
0023 
0024   /// No components here => exception!
0025   void addComponent(Alignable*) final;
0026 
0027   /// Returns a null vector (no components here)
0028   const Alignables& components() const override { return emptyComponents_; }
0029 
0030   /// Do nothing (no components here, so no subcomponents either...)
0031   void recursiveComponents(Alignables& result) const override {}
0032 
0033   /// Move with respect to the global reference frame
0034   void move(const GlobalVector& displacement) override;
0035 
0036   /// Rotation with respect to the global reference frame
0037   void rotateInGlobalFrame(const RotationType& rotation) override;
0038 
0039   /// Set the AlignmentPositionError (no components => second argument ignored)
0040   void setAlignmentPositionError(const AlignmentPositionError& ape, bool /*propDown*/) final;
0041 
0042   /// Add (or set if it does not exist yet) the AlignmentPositionError
0043   /// (no components => second argument without effect)
0044   void addAlignmentPositionError(const AlignmentPositionError& ape, bool /*propDown*/) final;
0045 
0046   /// Add (or set if it does not exist yet) the AlignmentPositionError
0047   /// resulting from a rotation in the global reference frame
0048   /// (no components => second argument without effect)
0049   void addAlignmentPositionErrorFromRotation(const RotationType& rot, bool /*propDown*/) final;
0050 
0051   /// Add (or set if it does not exist yet) the AlignmentPositionError
0052   /// resulting from a rotation in the local reference frame
0053   /// (no components => second argument without effect)
0054   void addAlignmentPositionErrorFromLocalRotation(const RotationType& rot, bool /*propDown*/) final;
0055 
0056   /// Set surface deformation parameters (2nd argument without effect)
0057   void setSurfaceDeformation(const SurfaceDeformation* deformation, bool) final;
0058   /// Add surface deformation parameters to the existing ones (2nd argument without effect)
0059   void addSurfaceDeformation(const SurfaceDeformation* deformation, bool) final;
0060 
0061   /// Return the alignable type identifier
0062   StructureType alignableObjectId() const override { return align::AlignableDetUnit; }
0063 
0064   /// Printout information about GeomDet
0065   void dump() const override;
0066 
0067   /// Return vector of alignment data
0068   Alignments* alignments() const override;
0069 
0070   /// Return vector of alignment errors
0071   AlignmentErrorsExtended* alignmentErrors() const override;
0072 
0073   /// Return surface deformations
0074   int surfaceDeformationIdPairs(std::vector<std::pair<int, SurfaceDeformation*> >&) const override;
0075 
0076   /// cache the current position, rotation and other parameters (e.g. surface deformations)
0077   void cacheTransformation() override;
0078 
0079   /// cache for the given run the current position, rotation and other parameters (e.g. surface deformations)
0080   void cacheTransformation(const align::RunNumber&) override;
0081 
0082   /// restore the previously cached transformation
0083   void restoreCachedTransformation() override;
0084 
0085   /// restore for the given run the previously cached transformation
0086   void restoreCachedTransformation(const align::RunNumber&) override;
0087 
0088   /// alignment position error - for checking only, otherwise use alignmentErrors() above!
0089   const AlignmentPositionError* alignmentPositionError() const { return theAlignmentPositionError; }
0090 
0091 private:
0092   static const Alignables emptyComponents_;
0093   AlignmentPositionError* theAlignmentPositionError;
0094   SurfaceDeformation* theSurfaceDeformation;
0095   SurfaceDeformation* theCachedSurfaceDeformation;
0096   Cache<SurfaceDeformation*> surfaceDeformationsCache_;
0097 };
0098 
0099 #endif