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
TwoBowedSurfacesDeformation Class Reference

#include <TwoBowedSurfacesDeformation.h>

Inheritance diagram for TwoBowedSurfacesDeformation:
SurfaceDeformation

Public Member Functions

virtual bool add (const SurfaceDeformation &other)
 
virtual
TwoBowedSurfacesDeformation
clone () const
 
virtual std::vector< double > parameters () const
 parameters - see constructor for meaning More...
 
virtual Local2DVector positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const
 
 TwoBowedSurfacesDeformation (const std::vector< double > &parameters)
 
virtual int type () const
 specific type, i.e. SurfaceDeformationFactory::kTwoBowedSurfaces 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

std::vector< double > theParameters
 

Additional Inherited Members

- Public Types inherited from SurfaceDeformation
typedef Topology::Local2DPoint Local2DPoint
 
typedef Vector2DBase< double,
LocalTag
Local2DVector
 
typedef Topology::LocalTrackAngles LocalTrackAngles
 

Detailed Description

TwoBowedSurfacesAlignmentParameters

Class to apply corrections to local positions resulting from two surfaces chained in local y. Possible 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. In addition store relative shifts and rotations of the two surfaces.

Author
: Gero Flucke date : October 2010
Revision:
1.1
Date:
2010/10/26 19:00:00

(last update by

Author:
flucke

)

Definition at line 25 of file TwoBowedSurfacesDeformation.h.

Constructor & Destructor Documentation

TwoBowedSurfacesDeformation::TwoBowedSurfacesDeformation ( const std::vector< double > &  pars)

Constructor from vector of parameters, its size() must be between minParameterSize() and maxParameterSize(). The parameters are (in that order)

  • mean sagittaX of both surfaces
  • mean sagittaXY
  • mean sagittaY
  • 'delta' u of both surfaces (shift surface at lower/higher y by +u/-u)
  • 'delta' v of both surfaces
  • 'delta' w of both surfaces
  • 'delta' alpha of both surfaces (rotate around local x)
  • 'delta' beta
  • 'delta' gamma
  • 'delta' sagittaX of both surfaces (add/subtract for surfaces at lower/higher y)
  • 'delta' sagittaXY
  • 'delta' sagittaY
  • ySplit: y-value where surfaces are split
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 TwoBowedSurfacesDeformation.cc.

References minParameterSize(), and theParameters.

Referenced by clone().

17  : theParameters(pars)
18 {
19  if (pars.size() != minParameterSize()) {
20  edm::LogError("BadSetup") << "@SUB=TwoBowedSurfacesDeformation"
21  << "Input vector of wrong size " << pars.size()
22  << " instead of " << minParameterSize() << ", add zeros to fill up!";
23  }
24  while (theParameters.size() < minParameterSize()) theParameters.push_back(0.);
25 }
static unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector

Member Function Documentation

bool TwoBowedSurfacesDeformation::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 98 of file TwoBowedSurfacesDeformation.cc.

References i, LogDebug, SurfaceDeformation::parameters(), theParameters, SurfaceDeformation::type(), and type().

99 {
100  if (this->type() == other.type()) {
101  const std::vector<double> otherParameters(other.parameters());
102  if (otherParameters.size() == theParameters.size()) {
103  if (theParameters.back() == otherParameters.back()) {
104  for (unsigned int i = 0; i < theParameters.size() - 1; ++i) {// -1 for ySplit
105  // mean bows, delta shifts, delta angles and delta bows can simply be added up
106  theParameters[i] += otherParameters[i];
107  }
108  return true;
109  } else { // ySplit values are different!
110  LogDebug("Alignment") << "@SUB=TwoBowedSurfacesDeformation::add"
111  << "Different ySplit: this " << theParameters.back()
112  << ", to add " << otherParameters.back();
113  }
114  } // same size
115  } // same type
116 
117  return false;
118 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual int type() const
specific type, i.e. SurfaceDeformationFactory::kTwoBowedSurfaces
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
TwoBowedSurfacesDeformation * TwoBowedSurfacesDeformation::clone ( void  ) const
virtual

Implements SurfaceDeformation.

Definition at line 28 of file TwoBowedSurfacesDeformation.cc.

References theParameters, and TwoBowedSurfacesDeformation().

29 {
31 }
TwoBowedSurfacesDeformation(const std::vector< double > &parameters)
static unsigned int TwoBowedSurfacesDeformation::maxParameterSize ( )
inlinestatic

maximum size of vector that is accepted by constructor from vector

Definition at line 73 of file TwoBowedSurfacesDeformation.h.

Referenced by SurfaceDeformationFactory::create().

73 { return 13;}
static unsigned int TwoBowedSurfacesDeformation::minParameterSize ( )
inlinestatic

minimum size of vector that is accepted by constructor from vector

Definition at line 71 of file TwoBowedSurfacesDeformation.h.

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

71 { return 13;}
std::vector< double > TwoBowedSurfacesDeformation::parameters ( void  ) const
virtual

parameters - see constructor for meaning

Implements SurfaceDeformation.

Definition at line 121 of file TwoBowedSurfacesDeformation.cc.

References theParameters.

Referenced by positionCorrection().

122 {
123  return theParameters;
124 }
SurfaceDeformation::Local2DVector TwoBowedSurfacesDeformation::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 41 of file TwoBowedSurfacesDeformation.cc.

References Topology::LocalTrackAngles::dxdz(), Topology::LocalTrackAngles::dydz(), parameters(), tablePrinter::width, PV2DBase< T, PVType, FrameType >::x(), ExpressReco_HICollisions_FallBack::x, PV2DBase< T, PVType, FrameType >::y(), and ExpressReco_HICollisions_FallBack::y.

44 {
45  const double ySplit = this->parameters().back();
46 
47 // treatment of different widthes at high/low y could be done by theRelWidthLowY or so
48 // if (widthLowY > 0. && widthHighY != widthLowY) {
49 // std::cout << "SurfaceDeformation::positionCorrection2Bowed: Cannot yet deal "
50 // << " with different widthes, take " << widthHighY << " not " << widthLowY
51 // << std::endl;
52 // }
53 // const double width = widthHighY;
54 
55  // Some signs depend on whether we are in surface part below or above ySplit:
56  const double sign = (localPos.y() < ySplit ? +1. : -1.);
57  const double yMiddle = ySplit * 0.5 - sign * length * .25;
58  // 'calibrate' y length and transform y to be w.r.t. surface middle
59  const double myY = localPos.y() - yMiddle;
60  const double myLength = length * 0.5 + sign * ySplit;
61 
62  double uRel = 2. * localPos.x() / width; // relative u (-1 .. +1)
63  double vRel = 2. * myY / myLength; // relative v (-1 .. +1)
64  // 'range check':
65  const double cutOff = 1.5;
66  if (uRel < -cutOff) { uRel = -cutOff; } else if (uRel > cutOff) { uRel = cutOff; }
67  if (vRel < -cutOff) { vRel = -cutOff; } else if (vRel > cutOff) { vRel = cutOff; }
68 
69  const std::vector<double> &pars = this->parameters();
70  // 1st, get dw effect depending
71  // - on the surface sagittas (Legendre polynomials),
72  // see BowedSurfaceAlignmentDerivatives::operator()(..)
73  // - relative dw
74  // - surface specific dalpha (note that this shifts surface specific dw)
75  // - surface specific dbeta
76  const double dw
77  = (uRel * uRel - 1./3.) * (pars[0] + sign * pars[9]) // sagittaX
78  + uRel * vRel * (pars[1] + sign * pars[10]) // sagittaXY
79  + (vRel * vRel - 1./3.) * (pars[2] + sign * pars[11]) // sagittaY
80  + sign * pars[5] // different dw
81  + myY * sign * pars[6] // different dalpha
82  - localPos.x() * sign * pars[7]; // different dbeta
83  // 2nd, translate the dw effect to shifts in x and y
84  // Positive dxdz/dydz and positive dw mean negative shift in x/y:
85  Local2DVector::ScalarType x = -dw * localAngles.dxdz();
86  Local2DVector::ScalarType y = -dw * localAngles.dydz();
87  // 3rd, treat in-plane differences depending on surface from xy-shifts...
88  x += (sign * pars[3]); // different du
89  y += (sign * pars[4]); // different dv
90  // ...and gamma-rotation
91  x -= myY * (sign * pars[8]); // different dgamma for u
92  y += localPos.x() * (sign * pars[8]); // different dgamma for v
93 
94  return Local2DVector(x, y);
95 }
T y() const
Definition: PV2DBase.h:40
virtual std::vector< double > parameters() const
parameters - see constructor for meaning
Vector2DBase< double, LocalTag > Local2DVector
T x() const
Definition: PV2DBase.h:39
int TwoBowedSurfacesDeformation::type ( ) const
virtual

Member Data Documentation

std::vector<double> TwoBowedSurfacesDeformation::theParameters
private

Definition at line 77 of file TwoBowedSurfacesDeformation.h.

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