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 (const std::vector< double > &parameters)
 
 BowedSurfaceDeformation (double sagittaX, double sagittaXY, double sagittaY)
 constructor from sagittae, i.e. coefficients of Legendre polynomials More...
 
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.

24  : theSagittaX(sagittaX), theSagittaY(sagittaY), theSagittaXY(sagittaXY) {}

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.

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 }

References minParameterSize().

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.

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 }

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

Referenced by counter.Counter::register().

◆ clone()

BowedSurfaceDeformation * BowedSurfaceDeformation::clone ( void  ) const
overridevirtual

◆ maxParameterSize()

static constexpr unsigned int BowedSurfaceDeformation::maxParameterSize ( )
inlinestaticconstexpr

maximum size of vector that is accepted by constructor from vector

Definition at line 61 of file BowedSurfaceDeformation.h.

61 { return parameterSize(); }

References parameterSize().

Referenced by SurfaceDeformationFactory::create().

◆ minParameterSize()

static constexpr unsigned int BowedSurfaceDeformation::minParameterSize ( )
inlinestaticconstexpr

minimum size of vector that is accepted by constructor from vector

Definition at line 59 of file BowedSurfaceDeformation.h.

59 { return parameterSize(); }

References parameterSize().

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

◆ 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.

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

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

◆ parameterSize()

static constexpr unsigned int BowedSurfaceDeformation::parameterSize ( )
inlinestaticconstexpr

Definition at line 56 of file BowedSurfaceDeformation.h.

56 { return parSize; }

References parSize.

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

◆ 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.

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 }

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

◆ type()

int BowedSurfaceDeformation::type ( ) const
overridevirtual

Member Data Documentation

◆ parSize

constexpr unsigned int BowedSurfaceDeformation::parSize = 3
staticconstexpr

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

ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
BowedSurfaceDeformation::minParameterSize
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
Definition: BowedSurfaceDeformation.h:59
BowedSurfaceDeformation::theSagittaY
double theSagittaY
Definition: BowedSurfaceDeformation.h:65
BowedSurfaceDeformation::parSize
static constexpr unsigned int parSize
Definition: BowedSurfaceDeformation.h:55
BowedSurfaceDeformation::type
int type() const override
specific type, i.e. SurfaceDeformationFactory::kBowedSurface
Definition: BowedSurfaceDeformation.cc:30
BowedSurfaceDeformation::parameterSize
static constexpr unsigned int parameterSize()
Definition: BowedSurfaceDeformation.h:56
SurfaceDeformation::Local2DVector
Vector2DBase< double, LocalTag > Local2DVector
Definition: SurfaceDeformation.h:20
trackingPlots.other
other
Definition: trackingPlots.py:1464
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
SurfaceDeformationFactory::kBowedSurface
Definition: SurfaceDeformationFactory.h:19
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
BowedSurfaceDeformation::theSagittaXY
double theSagittaXY
Definition: BowedSurfaceDeformation.h:66
BowedSurfaceDeformation::BowedSurfaceDeformation
BowedSurfaceDeformation(double sagittaX, double sagittaXY, double sagittaY)
constructor from sagittae, i.e. coefficients of Legendre polynomials
Definition: BowedSurfaceDeformation.h:23
mps_fire.result
result
Definition: mps_fire.py:311
BowedSurfaceDeformation::theSagittaX
double theSagittaX
Definition: BowedSurfaceDeformation.h:64