CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BowedSurfaceDeformation Class Reference

#include <BowedSurfaceDeformation.h>

Inheritance diagram for BowedSurfaceDeformation:
SurfaceDeformation

Public Member Functions

virtual bool add (const SurfaceDeformation &other)
 
 BowedSurfaceDeformation (double sagittaX, double sagittaXY, double sagittaY)
 constructor from sagittae, i.e. coefficients of Legendre polynomials More...
 
 BowedSurfaceDeformation (const std::vector< double > &parameters)
 
virtual BowedSurfaceDeformationclone () const
 
virtual std::vector< double > parameters () const
 parameters, i.e. sagittae as given in the constructor More...
 
virtual Local2DVector positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const
 
virtual int type () const
 specific type, i.e. SurfaceDeformationFactory::kBowedSurface More...
 
- Public Member Functions inherited from SurfaceDeformation
virtual ~SurfaceDeformation ()
 

Static Public Member Functions

static unsigned int maxParameterSize ()
 maximum size of vector that is accepted by constructor from vector More...
 
static unsigned int minParameterSize ()
 minimum size of vector that is accepted by constructor from vector More...
 

Private Attributes

double theSagittaX
 
double theSagittaXY
 
double theSagittaY
 

Additional Inherited Members

- Public Types inherited from SurfaceDeformation
typedef Topology::Local2DPoint Local2DPoint
 
typedef Vector2DBase< double,
LocalTag
Local2DVector
 
typedef Topology::LocalTrackAngles LocalTrackAngles
 
typedef Topology::MathVector2D MathVector2D
 
typedef Topology::Vector2D Vector2D
 

Detailed Description

BowedSurfaceAlignmentParameters

Class to apply corrections to local positions resulting from a non-planar surface. The bows are parametrised using Legendre polynomials up to second order, excluding 0th and 1st order that are already treated by local w shift and rotations around local u and v axes.

Author
: Gero Flucke date : October 2010

Definition at line 20 of file BowedSurfaceDeformation.h.

Constructor & Destructor Documentation

BowedSurfaceDeformation::BowedSurfaceDeformation ( double  sagittaX,
double  sagittaXY,
double  sagittaY 
)
inline

constructor from sagittae, i.e. coefficients of Legendre polynomials

Definition at line 24 of file BowedSurfaceDeformation.h.

Referenced by clone().

BowedSurfaceDeformation::BowedSurfaceDeformation ( const std::vector< double > &  pars)

constructor from vector of sagittae, parameters.size() must be between minParameterSize() and maxParameterSize()

Author
: Gero Flucke date : October 2010

Definition at line 13 of file BowedSurfaceDeformation.cc.

References minParameterSize().

14  : theSagittaX (pars.size() > 0 ? pars[0] : 0.),
15  theSagittaY (pars.size() > 2 ? pars[2] : 0.),
16  theSagittaXY(pars.size() > 1 ? pars[1] : 0.)
17 {
18  if (pars.size() != minParameterSize()) {
19  edm::LogError("BadSetup") << "@SUB=BowedSurfaceDeformation"
20  << "Input vector of wrong size " << pars.size()
21  << " instead of " << minParameterSize() << ", filled up with zeros!";
22  }
23 }
static unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector

Member Function Documentation

bool BowedSurfaceDeformation::add ( const SurfaceDeformation other)
virtual

update information with parameters of 'other', false in case the type or some parameters do not match and thus the information cannot be used (then no changes are done), true if merge was successful

Implements SurfaceDeformation.

Definition at line 72 of file BowedSurfaceDeformation.cc.

References SurfaceDeformation::parameters(), theSagittaX, theSagittaXY, theSagittaY, SurfaceDeformation::type(), and type().

Referenced by counter.Counter::register().

73 {
74  if (other.type() == this->type()) {
75  const std::vector<double> otherParams(other.parameters());
76  if (otherParams.size() == 3) { // double check!
77  theSagittaX += otherParams[0]; // bows can simply be added up
78  theSagittaXY += otherParams[1];
79  theSagittaY += otherParams[2];
80 
81  return true;
82  }
83  }
84 
85  return false;
86 }
virtual int type() const
specific type, i.e. SurfaceDeformationFactory::kBowedSurface
virtual std::vector< double > parameters() const =0
parameters - interpretation left to the concrete implementation
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
BowedSurfaceDeformation * BowedSurfaceDeformation::clone ( void  ) const
virtual

Implements SurfaceDeformation.

Definition at line 26 of file BowedSurfaceDeformation.cc.

References BowedSurfaceDeformation(), theSagittaX, theSagittaXY, and theSagittaY.

27 {
29 }
BowedSurfaceDeformation(double sagittaX, double sagittaXY, double sagittaY)
constructor from sagittae, i.e. coefficients of Legendre polynomials
static unsigned int BowedSurfaceDeformation::maxParameterSize ( )
inlinestatic

maximum size of vector that is accepted by constructor from vector

Definition at line 57 of file BowedSurfaceDeformation.h.

Referenced by SurfaceDeformationFactory::create().

57 { return 3;}
static unsigned int BowedSurfaceDeformation::minParameterSize ( )
inlinestatic

minimum size of vector that is accepted by constructor from vector

Definition at line 55 of file BowedSurfaceDeformation.h.

Referenced by BowedSurfaceDeformation(), and SurfaceDeformationFactory::create().

55 { return 3;}
std::vector< double > BowedSurfaceDeformation::parameters ( void  ) const
virtual

parameters, i.e. sagittae as given in the constructor

Implements SurfaceDeformation.

Definition at line 89 of file BowedSurfaceDeformation.cc.

References mps_fire::result, theSagittaX, theSagittaXY, and theSagittaY.

90 {
91  std::vector<double> result(3);
92  result[0] = theSagittaX;
93  result[1] = theSagittaXY;
94  result[2] = theSagittaY;
95 
96  return result;
97 }
tuple result
Definition: mps_fire.py:84
SurfaceDeformation::Local2DVector BowedSurfaceDeformation::positionCorrection ( const Local2DPoint localPos,
const LocalTrackAngles localAngles,
double  length,
double  width 
) const
virtual

correction to add to local position depending on

  • track parameters in local frame (from LocalTrajectoryParameters):
    • track position as Local2DPoint(x,y)
    • track angles as LocalTrackAngles(dxdz, dydz)
  • length of surface (local y-coordinate)
  • width of surface (local x-coordinate)

Implements SurfaceDeformation.

Definition at line 39 of file BowedSurfaceDeformation.cc.

References theSagittaX, theSagittaXY, theSagittaY, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

42 {
43 
44 // different widthes at high/low y could somehow be treated by theRelWidthLowY
45 // if (widthLowY > 0. && widthHighY != widthLowY) {
46 // // TEC would always create a warning...
47 // edm::LogWarning("UnusableData") << "@SUB=BowedSurfaceDeformation::positionCorrection"
48 // << "Cannot yet deal with different widthes, take "
49 // << widthHighY << " not " << widthLowY;
50 // }
51 // const double width = widthHighY;
52 
53  double uRel = (width ? 2. * localPos.x() / width : 0.); // relative u (-1 .. +1)
54  double vRel = (length ? 2. * localPos.y() / length : 0.); // relative v (-1 .. +1)
55  // 'range check':
56  const double cutOff = 1.5;
57  if (uRel < -cutOff) { uRel = -cutOff; } else if (uRel > cutOff) { uRel = cutOff; }
58  if (vRel < -cutOff) { vRel = -cutOff; } else if (vRel > cutOff) { vRel = cutOff; }
59 
60  // apply coefficients to Legendre polynomials
61  // to get local height relative to 'average'
62  const double dw
63  = (uRel * uRel - 1./3.) * theSagittaX
64  + uRel * vRel * theSagittaXY
65  + (vRel * vRel - 1./3.) * theSagittaY;
66 
67  // positive dxdz/dydz and positive dw mean negative shift in x/y:
68  return Local2DVector(-dw * localAngles);
69 }
T y() const
Definition: PV2DBase.h:46
Vector2DBase< double, LocalTag > Local2DVector
T x() const
Definition: PV2DBase.h:45
int BowedSurfaceDeformation::type ( ) const
virtual

Member Data Documentation

double BowedSurfaceDeformation::theSagittaX
private

Definition at line 60 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().

double BowedSurfaceDeformation::theSagittaXY
private

Definition at line 62 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().

double BowedSurfaceDeformation::theSagittaY
private

Definition at line 61 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().