Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Alignment_CommonAlignment_TwoBowedSurfacesAlignmentParameters_h
0002 #define Alignment_CommonAlignment_TwoBowedSurfacesAlignmentParameters_h
0003 
0004 #include "Alignment/CommonAlignment/interface/AlignmentParameters.h"
0005 #include "CondFormats/Alignment/interface/Definitions.h"
0006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0007 
0008 #include "Alignment/CommonAlignmentParametrization/interface/BowedSurfaceAlignmentDerivatives.h"
0009 
0010 /// \class TwoBowedSurfacesAlignmentParameters
0011 ///
0012 /// Concrete class for alignment parameters and associated quantities
0013 /// [derived from AlignmentParameters].
0014 /// The alignable is assumed to have in fact two surfaces devided at
0015 /// a specific local ySplit.
0016 /// The number of parameters N_PARAM is 2x9, i.e. one set of
0017 ///  - 3 translations
0018 ///  - 3 rotations/slopes
0019 ///  - 3 bows/sagittas (u, v and mixed term)
0020 /// for the two surfaces (similar as in BowedSurfaceAlignmentParameters).
0021 /// Storage is done differently:
0022 /// The movements and translations are averaged and applied to the
0023 /// alignable in the 'classical' way.
0024 /// In SurfaceDeformation we store:
0025 /// - the half differences of the movements and rotations, to be taken into
0026 /// account,
0027 ///   with positive/negative sign, for corrections for the surface at
0028 ///   lower/higher y,
0029 /// - the mean values 'm' and half differences 'hd' of the bows/sagittas of each
0030 /// surface,
0031 ///   where these corrections have to be applied as m+hd for the one and m-hd
0032 ///   for the other sensor
0033 ///
0034 ///
0035 ///  $Date: 2010/10/26 20:41:08 $
0036 ///  $Revision: 1.1 $
0037 /// (last update by $Author: flucke $)
0038 
0039 class Alignable;
0040 class AlignableDetOrUnitPtr;
0041 class TrajectoryStateOnSurface;
0042 
0043 class TwoBowedSurfacesAlignmentParameters : public AlignmentParameters {
0044 public:
0045   /// Give parameters a name (do not change order, see derivatives(..)!)
0046   typedef BowedSurfaceAlignmentDerivatives BowedDerivs;
0047   enum AlignmentParameterName {
0048     // 1st surface
0049     dx1 = BowedDerivs::dx,
0050     dy1 = BowedDerivs::dy,
0051     dz1 = BowedDerivs::dz,
0052     dslopeX1 = BowedDerivs::dslopeX,  // NOTE: slope(u) -> halfWidth*tan(beta),
0053     dslopeY1 = BowedDerivs::dslopeY,  //       slope(v) -> halfLength*tan(alpha)
0054     drotZ1 = BowedDerivs::drotZ,      //       rot(w)   -> g-scale*gamma
0055     dsagittaX1 = BowedDerivs::dsagittaX,
0056     dsagittaXY1 = BowedDerivs::dsagittaXY,
0057     dsagittaY1 = BowedDerivs::dsagittaY,
0058     // 2nd surface
0059     dx2 = BowedDerivs::dx + BowedDerivs::N_PARAM,
0060     dy2 = BowedDerivs::dy + BowedDerivs::N_PARAM,
0061     dz2 = BowedDerivs::dz + BowedDerivs::N_PARAM,
0062     dslopeX2 = BowedDerivs::dslopeX + BowedDerivs::N_PARAM,  // NOTE: slope(u) -> k*tan(beta),
0063     dslopeY2 = BowedDerivs::dslopeY + BowedDerivs::N_PARAM,  //       slope(v) -> k*tan(alpha)
0064     drotZ2 = BowedDerivs::drotZ + BowedDerivs::N_PARAM,      //       rot(w)   -> m*gamma
0065     dsagittaX2 = BowedDerivs::dsagittaX + BowedDerivs::N_PARAM,
0066     dsagittaXY2 = BowedDerivs::dsagittaXY + BowedDerivs::N_PARAM,
0067     dsagittaY2 = BowedDerivs::dsagittaY + BowedDerivs::N_PARAM,
0068     // number of parameters
0069     N_PARAM = BowedDerivs::N_PARAM + BowedDerivs::N_PARAM
0070   };
0071 
0072   /// Constructor with empty parameters/covariance
0073   TwoBowedSurfacesAlignmentParameters(Alignable *alignable);
0074 
0075   /// Constructor for full set of parameters
0076   TwoBowedSurfacesAlignmentParameters(Alignable *alignable,
0077                                       const AlgebraicVector &parameters,
0078                                       const AlgebraicSymMatrix &covMatrix);
0079 
0080   /// Constructor for selection
0081   TwoBowedSurfacesAlignmentParameters(Alignable *alignable,
0082                                       const AlgebraicVector &parameters,
0083                                       const AlgebraicSymMatrix &covMatrix,
0084                                       const std::vector<bool> &selection);
0085 
0086   /// Destructor
0087   ~TwoBowedSurfacesAlignmentParameters() override{};
0088   void apply() override;
0089   int type() const override;
0090 
0091   /// Clone all parameters (for update of parameters)
0092   TwoBowedSurfacesAlignmentParameters *clone(const AlgebraicVector &parameters,
0093                                              const AlgebraicSymMatrix &covMatrix) const override;
0094 
0095   /// Clone selected parameters (for update of parameters)
0096   TwoBowedSurfacesAlignmentParameters *cloneFromSelected(const AlgebraicVector &parameters,
0097                                                          const AlgebraicSymMatrix &covMatrix) const override;
0098 
0099   /// Get all derivatives
0100   AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const override;
0101 
0102   /// print parameters to screen
0103   virtual void print() const;
0104 
0105   double ySplit() const { return ySplit_; }
0106 
0107 private:
0108   double ySplitFromAlignable(const Alignable *ali) const;
0109 
0110   double ySplit_;
0111 };
0112 
0113 #endif