Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:52

0001 #ifndef GeometryCommonTopologiesTwoBowedSurfacesDeformation_H
0002 #define GeometryCommonTopologiesTwoBowedSurfacesDeformation_H
0003 
0004 /// TwoBowedSurfacesAlignmentParameters
0005 ///
0006 /// Class to apply corrections to local positions resulting
0007 /// from two surfaces chained in local y. Possible bows are
0008 /// parametrised using Legendre polynomials up to second order,
0009 /// excluding 0th and 1st order that are already treated by
0010 /// local w shift and rotations around local u and v axes.
0011 /// In addition store relative shifts and rotations of the
0012 /// two surfaces.
0013 ///
0014 
0015 #include "Geometry/CommonTopologies/interface/SurfaceDeformation.h"
0016 
0017 #include <array>
0018 
0019 class TwoBowedSurfacesDeformation : public SurfaceDeformation {
0020 public:
0021   /// Constructor from vector of parameters, its size() must be
0022   /// between minParameterSize() and maxParameterSize().
0023   /// The parameters are (in that order)
0024   /// - mean sagittaX  of both surfaces
0025   /// - mean sagittaXY
0026   /// - mean sagittaY
0027   /// - 'delta' u of both surfaces (shift surface at lower/higher y by +u/-u)
0028   /// - 'delta' v of both surfaces
0029   /// - 'delta' w of both surfaces
0030   /// - 'delta' alpha of both surfaces (rotate around local x)
0031   /// - 'delta' beta
0032   /// - 'delta' gamma
0033   /// - 'delta' sagittaX  of both surfaces (add/subtract for surfaces at lower/higher y)
0034   /// - 'delta' sagittaXY
0035   /// - 'delta' sagittaY
0036   /// - ySplit: y-value where surfaces are split
0037   TwoBowedSurfacesDeformation(const std::vector<double> &parameters);
0038 
0039   TwoBowedSurfacesDeformation *clone() const override;
0040 
0041   /// specific type, i.e. SurfaceDeformationFactory::kTwoBowedSurfaces
0042   int type() const override;
0043 
0044   /// correction to add to local position depending on
0045   /// - track parameters in local frame (from LocalTrajectoryParameters):
0046   ///   * track position as Local2DPoint(x,y)
0047   ///   * track angles   as LocalTrackAngles(dxdz, dydz)
0048   /// - length of surface (local y-coordinate)
0049   /// - width of surface (local x-coordinate)
0050   Local2DVector positionCorrection(const Local2DPoint &localPos,
0051                                    const LocalTrackAngles &localAngles,
0052                                    double length,
0053                                    double width) const override;
0054 
0055   /// update information with parameters of 'other',
0056   /// false in case the type or some parameters do not match and thus
0057   /// the information cannot be used (then no changes are done),
0058   /// true if merge was successful
0059   bool add(const SurfaceDeformation &other) override;
0060 
0061   /// parameters - see constructor for meaning
0062   std::vector<double> parameters() const override;
0063 
0064   // the size
0065   static constexpr unsigned int parSize = 13;
0066   static constexpr unsigned int parameterSize() { return parSize; }
0067 
0068   /// minimum size of vector that is accepted by constructor from vector
0069   static constexpr unsigned int minParameterSize() { return parameterSize(); }
0070   /// maximum size of vector that is accepted by constructor from vector
0071   static constexpr unsigned int maxParameterSize() { return parameterSize(); }
0072 
0073   // location of ySplit
0074   static constexpr unsigned int k_ySplit() { return parameterSize() - 1; }
0075 
0076 private:
0077   double theParameters[parSize];
0078 };
0079 
0080 #endif