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

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
 

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.1
Date:
2010/10/26 19:00:00

(last update by

Author:
flucke

)

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.1
Date:
2010/10/26 19:00:00

(last update by

Author:
flucke

)

Definition at line 16 of file BowedSurfaceDeformation.cc.

References minParameterSize().

17  : theSagittaX (pars.size() > 0 ? pars[0] : 0.),
18  theSagittaXY(pars.size() > 1 ? pars[1] : 0.),
19  theSagittaY (pars.size() > 2 ? pars[2] : 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 78 of file BowedSurfaceDeformation.cc.

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

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

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

96 {
97  std::vector<double> result(3);
98  result[0] = theSagittaX;
99  result[1] = theSagittaXY;
100  result[2] = theSagittaY;
101 
102  return result;
103 }
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 Topology::LocalTrackAngles::dxdz(), Topology::LocalTrackAngles::dydz(), theSagittaX, theSagittaXY, theSagittaY, PV2DBase< T, PVType, FrameType >::x(), ExpressReco_HICollisions_FallBack::x, PV2DBase< T, PVType, FrameType >::y(), and ExpressReco_HICollisions_FallBack::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  const Local2DVector::ScalarType x = -dw * localAngles.dxdz();
72  const Local2DVector::ScalarType y = -dw * localAngles.dydz();
73 
74  return Local2DVector(x, y);
75 }
T y() const
Definition: PV2DBase.h:40
Vector2DBase< double, LocalTag > Local2DVector
T x() const
Definition: PV2DBase.h:39
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 64 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().