CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
BowedSurfaceDeformation Class Reference

#include <BowedSurfaceDeformation.h>

Inheritance diagram for BowedSurfaceDeformation:
SurfaceDeformation

Public Member Functions

bool add (const SurfaceDeformation &other) override
 
 BowedSurfaceDeformation (double sagittaX, double sagittaXY, double sagittaY)
 constructor from sagittae, i.e. coefficients of Legendre polynomials More...
 
 BowedSurfaceDeformation (const std::vector< double > &parameters)
 
BowedSurfaceDeformationclone () const override
 
std::vector< double > parameters () const override
 parameters, i.e. sagittae as given in the constructor More...
 
Local2DVector positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const override
 
int type () const override
 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...
 
static unsigned int parameterSize ()
 

Static Public Attributes

static unsigned int parSize = 3
 

Private Attributes

double theSagittaX
 
double theSagittaXY
 
double theSagittaY
 

Additional Inherited Members

- Public Types inherited from SurfaceDeformation
typedef Topology::Local2DPoint Local2DPoint
 
typedef Vector2DBase< double, LocalTagLocal2DVector
 
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.

References add(), clone(), trackingPlots::other, parameters(), positionCorrection(), type(), and ApeEstimator_cff::width.

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.empty() ? 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)
overridevirtual

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(), parameterSize(), theSagittaX, theSagittaXY, theSagittaY, SurfaceDeformation::type(), and type().

Referenced by BowedSurfaceDeformation(), and counter.Counter::register().

73 {
74  if (other.type() == this->type()) {
75  const std::vector<double> otherParams(other.parameters());
76  if (otherParams.size() == parameterSize()) { // 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 std::vector< double > parameters() const =0
parameters - interpretation left to the concrete implementation
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
int type() const override
specific type, i.e. SurfaceDeformationFactory::kBowedSurface
static unsigned int parameterSize()
BowedSurfaceDeformation * BowedSurfaceDeformation::clone ( void  ) const
overridevirtual

Implements SurfaceDeformation.

Definition at line 26 of file BowedSurfaceDeformation.cc.

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

Referenced by BowedSurfaceDeformation().

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 61 of file BowedSurfaceDeformation.h.

References parameterSize().

Referenced by SurfaceDeformationFactory::create().

61 { return parameterSize(); }
static unsigned int parameterSize()
static unsigned int BowedSurfaceDeformation::minParameterSize ( )
inlinestatic

minimum size of vector that is accepted by constructor from vector

Definition at line 59 of file BowedSurfaceDeformation.h.

References parameterSize().

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

59 { return parameterSize(); }
static unsigned int parameterSize()
std::vector< double > BowedSurfaceDeformation::parameters ( void  ) const
overridevirtual

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

Implements SurfaceDeformation.

Definition at line 89 of file BowedSurfaceDeformation.cc.

References parameterSize(), mps_fire::result, theSagittaX, theSagittaXY, and theSagittaY.

Referenced by BowedSurfaceDeformation().

90 {
91  std::vector<double> result(parameterSize());
92  result[0] = theSagittaX;
93  result[1] = theSagittaXY;
94  result[2] = theSagittaY;
95 
96  return result;
97 }
static unsigned int parameterSize()
static unsigned int BowedSurfaceDeformation::parameterSize ( )
inlinestatic

Definition at line 56 of file BowedSurfaceDeformation.h.

References parSize.

Referenced by add(), maxParameterSize(), minParameterSize(), and parameters().

56 { return parSize; }
SurfaceDeformation::Local2DVector BowedSurfaceDeformation::positionCorrection ( const Local2DPoint localPos,
const LocalTrackAngles localAngles,
double  length,
double  width 
) const
overridevirtual

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().

Referenced by BowedSurfaceDeformation().

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
overridevirtual

Member Data Documentation

unsigned int BowedSurfaceDeformation::parSize = 3
static

Definition at line 55 of file BowedSurfaceDeformation.h.

Referenced by parameterSize().

double BowedSurfaceDeformation::theSagittaX
private

Definition at line 64 of file BowedSurfaceDeformation.h.

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

double BowedSurfaceDeformation::theSagittaXY
private

Definition at line 66 of file BowedSurfaceDeformation.h.

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

double BowedSurfaceDeformation::theSagittaY
private

Definition at line 65 of file BowedSurfaceDeformation.h.

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