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
Revision:
1.3
Date:
2012/01/26 10:56:43

(last update by

Author:
innocent

)

Definition at line 23 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 27 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
Revision:
1.7
Date:
2012/01/28 10:18:26

(last update by

Author:
innocent

)

Definition at line 16 of file BowedSurfaceDeformation.cc.

References minParameterSize().

17  : theSagittaX (pars.size() > 0 ? pars[0] : 0.),
18  theSagittaY (pars.size() > 2 ? pars[2] : 0.),
19  theSagittaXY(pars.size() > 1 ? pars[1] : 0.)
20 {
21  if (pars.size() != minParameterSize()) {
22  edm::LogError("BadSetup") << "@SUB=BowedSurfaceDeformation"
23  << "Input vector of wrong size " << pars.size()
24  << " instead of " << minParameterSize() << ", filled up with zeros!";
25  }
26 }
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 75 of file BowedSurfaceDeformation.cc.

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

76 {
77  if (other.type() == this->type()) {
78  const std::vector<double> otherParams(other.parameters());
79  if (otherParams.size() == 3) { // double check!
80  theSagittaX += otherParams[0]; // bows can simply be added up
81  theSagittaXY += otherParams[1];
82  theSagittaY += otherParams[2];
83 
84  return true;
85  }
86  }
87 
88  return false;
89 }
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 29 of file BowedSurfaceDeformation.cc.

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

30 {
32 }
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 60 of file BowedSurfaceDeformation.h.

Referenced by SurfaceDeformationFactory::create().

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

minimum size of vector that is accepted by constructor from vector

Definition at line 58 of file BowedSurfaceDeformation.h.

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

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

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

Implements SurfaceDeformation.

Definition at line 92 of file BowedSurfaceDeformation.cc.

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

93 {
94  std::vector<double> result(3);
95  result[0] = theSagittaX;
96  result[1] = theSagittaXY;
97  result[2] = theSagittaY;
98 
99  return result;
100 }
tuple result
Definition: query.py:137
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 42 of file BowedSurfaceDeformation.cc.

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

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

Member Data Documentation

double BowedSurfaceDeformation::theSagittaX
private

Definition at line 63 of file BowedSurfaceDeformation.h.

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

double BowedSurfaceDeformation::theSagittaXY
private

Definition at line 65 of file BowedSurfaceDeformation.h.

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

double BowedSurfaceDeformation::theSagittaY
private

Definition at line 64 of file BowedSurfaceDeformation.h.

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