#include <BowedSurfaceDeformation.h>
Public Member Functions | |
virtual bool | add (const SurfaceDeformation &other) |
BowedSurfaceDeformation (const std::vector< double > ¶meters) | |
BowedSurfaceDeformation (double sagittaX, double sagittaXY, double sagittaY) | |
constructor from sagittae, i.e. coefficients of Legendre polynomials | |
virtual BowedSurfaceDeformation * | clone () const |
virtual std::vector< double > | parameters () const |
parameters, i.e. sagittae as given in the constructor | |
virtual Local2DVector | positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const |
virtual int | type () const |
specific type, i.e. SurfaceDeformationFactory::kBowedSurface | |
Static Public Member Functions | |
static unsigned int | maxParameterSize () |
maximum size of vector that is accepted by constructor from vector | |
static unsigned int | minParameterSize () |
minimum size of vector that is accepted by constructor from vector | |
Private Attributes | |
double | theSagittaX |
double | theSagittaXY |
double | theSagittaY |
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.
(last update by
)
Definition at line 23 of file BowedSurfaceDeformation.h.
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().
: theSagittaX(sagittaX),theSagittaY(sagittaY), theSagittaXY(sagittaXY) { }
BowedSurfaceDeformation::BowedSurfaceDeformation | ( | const std::vector< double > & | pars | ) |
constructor from vector of sagittae, parameters.size() must be between minParameterSize() and maxParameterSize()
(last update by
)
Definition at line 16 of file BowedSurfaceDeformation.cc.
References minParameterSize().
: theSagittaX (pars.size() > 0 ? pars[0] : 0.), theSagittaY (pars.size() > 2 ? pars[2] : 0.), theSagittaXY(pars.size() > 1 ? pars[1] : 0.) { if (pars.size() != minParameterSize()) { edm::LogError("BadSetup") << "@SUB=BowedSurfaceDeformation" << "Input vector of wrong size " << pars.size() << " instead of " << minParameterSize() << ", filled up with zeros!"; } }
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 75 of file BowedSurfaceDeformation.cc.
References SurfaceDeformation::parameters(), theSagittaX, theSagittaXY, theSagittaY, SurfaceDeformation::type(), and type().
{ if (other.type() == this->type()) { const std::vector<double> otherParams(other.parameters()); if (otherParams.size() == 3) { // double check! theSagittaX += otherParams[0]; // bows can simply be added up theSagittaXY += otherParams[1]; theSagittaY += otherParams[2]; return true; } } return false; }
BowedSurfaceDeformation * BowedSurfaceDeformation::clone | ( | void | ) | const [virtual] |
Implements SurfaceDeformation.
Definition at line 29 of file BowedSurfaceDeformation.cc.
References BowedSurfaceDeformation(), theSagittaX, theSagittaXY, and theSagittaY.
{ return new BowedSurfaceDeformation(theSagittaX, theSagittaXY, theSagittaY); }
static unsigned int BowedSurfaceDeformation::maxParameterSize | ( | ) | [inline, static] |
maximum size of vector that is accepted by constructor from vector
Definition at line 60 of file BowedSurfaceDeformation.h.
Referenced by SurfaceDeformationFactory::create().
{ return 3;}
static unsigned int BowedSurfaceDeformation::minParameterSize | ( | ) | [inline, static] |
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().
{ return 3;}
std::vector< double > BowedSurfaceDeformation::parameters | ( | void | ) | const [virtual] |
parameters, i.e. sagittae as given in the constructor
Implements SurfaceDeformation.
Definition at line 92 of file BowedSurfaceDeformation.cc.
References query::result, theSagittaX, theSagittaXY, and theSagittaY.
{ std::vector<double> result(3); result[0] = theSagittaX; result[1] = theSagittaXY; result[2] = theSagittaY; return result; }
SurfaceDeformation::Local2DVector BowedSurfaceDeformation::positionCorrection | ( | const Local2DPoint & | localPos, |
const LocalTrackAngles & | localAngles, | ||
double | length, | ||
double | width | ||
) | const [virtual] |
correction to add to local position depending on
Implements SurfaceDeformation.
Definition at line 42 of file BowedSurfaceDeformation.cc.
References theSagittaX, theSagittaXY, theSagittaY, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().
{ // different widthes at high/low y could somehow be treated by theRelWidthLowY // if (widthLowY > 0. && widthHighY != widthLowY) { // // TEC would always create a warning... // edm::LogWarning("UnusableData") << "@SUB=BowedSurfaceDeformation::positionCorrection" // << "Cannot yet deal with different widthes, take " // << widthHighY << " not " << widthLowY; // } // const double width = widthHighY; double uRel = (width ? 2. * localPos.x() / width : 0.); // relative u (-1 .. +1) double vRel = (length ? 2. * localPos.y() / length : 0.); // relative v (-1 .. +1) // 'range check': const double cutOff = 1.5; if (uRel < -cutOff) { uRel = -cutOff; } else if (uRel > cutOff) { uRel = cutOff; } if (vRel < -cutOff) { vRel = -cutOff; } else if (vRel > cutOff) { vRel = cutOff; } // apply coefficients to Legendre polynomials // to get local height relative to 'average' const double dw = (uRel * uRel - 1./3.) * theSagittaX + uRel * vRel * theSagittaXY + (vRel * vRel - 1./3.) * theSagittaY; // positive dxdz/dydz and positive dw mean negative shift in x/y: return Local2DVector(-dw * localAngles); }
int BowedSurfaceDeformation::type | ( | ) | const [virtual] |
specific type, i.e. SurfaceDeformationFactory::kBowedSurface
Implements SurfaceDeformation.
Definition at line 35 of file BowedSurfaceDeformation.cc.
References AlignmentParametersFactory::kBowedSurface.
Referenced by add().
{ return SurfaceDeformationFactory::kBowedSurface; }
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 65 of file BowedSurfaceDeformation.h.
Referenced by add(), clone(), parameters(), and positionCorrection().
double BowedSurfaceDeformation::theSagittaY [private] |
Definition at line 64 of file BowedSurfaceDeformation.h.
Referenced by add(), clone(), parameters(), and positionCorrection().