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 constexpr unsigned int maxParameterSize ()
 maximum size of vector that is accepted by constructor from vector More...
 
static constexpr unsigned int minParameterSize ()
 minimum size of vector that is accepted by constructor from vector More...
 
static constexpr unsigned int parameterSize ()
 

Static Public Attributes

static constexpr 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() [1/2]

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

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

Definition at line 23 of file BowedSurfaceDeformation.h.

Referenced by clone().

◆ BowedSurfaceDeformation() [2/2]

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  if (pars.size() != minParameterSize()) {
18  edm::LogError("BadSetup") << "@SUB=BowedSurfaceDeformation"
19  << "Input vector of wrong size " << pars.size() << " instead of " << minParameterSize()
20  << ", filled up with zeros!";
21  }
22 }
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
Log< level::Error, false > LogError

Member Function Documentation

◆ add()

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 71 of file BowedSurfaceDeformation.cc.

References trackingPlots::other, parameterSize(), theSagittaX, theSagittaXY, theSagittaY, and type().

Referenced by counter.Counter::register().

71  {
72  if (other.type() == this->type()) {
73  const std::vector<double> otherParams(other.parameters());
74  if (otherParams.size() == parameterSize()) { // double check!
75  theSagittaX += otherParams[0]; // bows can simply be added up
76  theSagittaXY += otherParams[1];
77  theSagittaY += otherParams[2];
78 
79  return true;
80  }
81  }
82 
83  return false;
84 }
static constexpr unsigned int parameterSize()
int type() const override
specific type, i.e. SurfaceDeformationFactory::kBowedSurface

◆ clone()

BowedSurfaceDeformation * BowedSurfaceDeformation::clone ( void  ) const
overridevirtual

Implements SurfaceDeformation.

Definition at line 25 of file BowedSurfaceDeformation.cc.

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

25  {
27 }
BowedSurfaceDeformation(double sagittaX, double sagittaXY, double sagittaY)
constructor from sagittae, i.e. coefficients of Legendre polynomials

◆ maxParameterSize()

static constexpr 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 constexpr unsigned int parameterSize()

◆ minParameterSize()

static constexpr 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 constexpr unsigned int parameterSize()

◆ parameters()

std::vector< double > BowedSurfaceDeformation::parameters ( void  ) const
overridevirtual

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

Implements SurfaceDeformation.

Definition at line 87 of file BowedSurfaceDeformation.cc.

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

87  {
88  std::vector<double> result(parameterSize());
89  result[0] = theSagittaX;
90  result[1] = theSagittaXY;
91  result[2] = theSagittaY;
92 
93  return result;
94 }
static constexpr unsigned int parameterSize()

◆ parameterSize()

static constexpr 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; }
static constexpr unsigned int parSize

◆ positionCorrection()

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 33 of file BowedSurfaceDeformation.cc.

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

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

◆ type()

int BowedSurfaceDeformation::type ( ) const
overridevirtual

Member Data Documentation

◆ parSize

constexpr unsigned int BowedSurfaceDeformation::parSize = 3
static

Definition at line 55 of file BowedSurfaceDeformation.h.

Referenced by parameterSize().

◆ theSagittaX

double BowedSurfaceDeformation::theSagittaX
private

Definition at line 64 of file BowedSurfaceDeformation.h.

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

◆ theSagittaXY

double BowedSurfaceDeformation::theSagittaXY
private

Definition at line 66 of file BowedSurfaceDeformation.h.

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

◆ theSagittaY

double BowedSurfaceDeformation::theSagittaY
private

Definition at line 65 of file BowedSurfaceDeformation.h.

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