#include <BowedSurfaceAlignmentParameters.h>
Public Types | |
enum | AlignmentParameterName { dx = BowedDerivs::dx, dy = BowedDerivs::dy, dz = BowedDerivs::dz, dslopeX = BowedDerivs::dslopeX, dslopeY = BowedDerivs::dslopeY, drotZ = BowedDerivs::drotZ, dsagittaX = BowedDerivs::dsagittaX, dsagittaXY = BowedDerivs::dsagittaXY, dsagittaY = BowedDerivs::dsagittaY, N_PARAM = BowedDerivs::N_PARAM } |
typedef BowedSurfaceAlignmentDerivatives | BowedDerivs |
Give parameters a name. | |
Public Member Functions | |
virtual void | apply () |
apply parameters to alignable | |
BowedSurfaceAlignmentParameters (Alignable *alignable) | |
Constructor with empty parameters/covariance. | |
BowedSurfaceAlignmentParameters (Alignable *alignable, const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) | |
Constructor for full set of parameters. | |
BowedSurfaceAlignmentParameters (Alignable *alignable, const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix, const std::vector< bool > &selection) | |
Constructor for selection. | |
virtual BowedSurfaceAlignmentParameters * | clone (const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const |
Clone all parameters (for update of parameters) | |
virtual BowedSurfaceAlignmentParameters * | cloneFromSelected (const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const |
Clone selected parameters (for update of parameters) | |
virtual AlgebraicMatrix | derivatives (const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const |
Get all derivatives. | |
void | print () const |
print parameters to screen | |
align::EulerAngles | rotation () const |
Get rotation parameters. | |
align::LocalVector | translation () const |
Get translation parameters in double precision. | |
virtual int | type () const |
tell type (AlignmentParametersFactory::ParametersType - but no circular dependency) | |
virtual | ~BowedSurfaceAlignmentParameters () |
Destructor. |
Concrete class for alignment parameters and associated quantities [derived from AlignmentParameters]. The number of parameters N_PARAM is 9
(last update by
)
Definition at line 27 of file BowedSurfaceAlignmentParameters.h.
Give parameters a name.
Definition at line 31 of file BowedSurfaceAlignmentParameters.h.
Definition at line 32 of file BowedSurfaceAlignmentParameters.h.
{ dx = BowedDerivs::dx, dy = BowedDerivs::dy, dz = BowedDerivs::dz, dslopeX = BowedDerivs::dslopeX, // NOTE: slope(u) -> k*tan(beta), dslopeY = BowedDerivs::dslopeY, // slope(v) -> l*tan(alpha) drotZ = BowedDerivs::drotZ, // rot(w) -> m*gamma dsagittaX = BowedDerivs::dsagittaX, dsagittaXY = BowedDerivs::dsagittaXY, dsagittaY = BowedDerivs::dsagittaY, N_PARAM = BowedDerivs::N_PARAM };
BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters | ( | Alignable * | alignable | ) |
Constructor with empty parameters/covariance.
Definition at line 26 of file BowedSurfaceAlignmentParameters.cc.
Referenced by clone().
: AlignmentParameters(ali, AlgebraicVector(N_PARAM), AlgebraicSymMatrix(N_PARAM, 0)) { }
BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters | ( | Alignable * | alignable, |
const AlgebraicVector & | parameters, | ||
const AlgebraicSymMatrix & | covMatrix | ||
) |
Constructor for full set of parameters.
Definition at line 33 of file BowedSurfaceAlignmentParameters.cc.
References Exception.
: AlignmentParameters(alignable, parameters, covMatrix) { if (parameters.num_row() != N_PARAM) { throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): " << parameters.num_row() << " instead of " << N_PARAM << " parameters."; } }
BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters | ( | Alignable * | alignable, |
const AlgebraicVector & | parameters, | ||
const AlgebraicSymMatrix & | covMatrix, | ||
const std::vector< bool > & | selection | ||
) |
Constructor for selection.
Definition at line 47 of file BowedSurfaceAlignmentParameters.cc.
References Exception.
: AlignmentParameters(alignable, parameters, covMatrix, selection) { if (parameters.num_row() != N_PARAM) { throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): " << parameters.num_row() << " instead of " << N_PARAM << " parameters."; } }
virtual BowedSurfaceAlignmentParameters::~BowedSurfaceAlignmentParameters | ( | ) | [inline, virtual] |
void BowedSurfaceAlignmentParameters::apply | ( | ) | [virtual] |
apply parameters to alignable
Implements AlignmentParameters.
Definition at line 137 of file BowedSurfaceAlignmentParameters.cc.
References Alignable::addSurfaceDeformation(), AlignmentParameters::alignable(), dsagittaX, dsagittaXY, dsagittaY, Exception, Alignable::move(), align::rectify(), makeMuonMisalignmentScenario::rot, Alignable::rotateInGlobalFrame(), rotation(), Alignable::surface(), AlignmentParameters::theData, AlignableSurface::toGlobal(), align::toMatrix(), and translation().
{ Alignable *alignable = this->alignable(); if (!alignable) { throw cms::Exception("BadParameters") << "BowedSurfaceAlignmentParameters::apply: parameters without alignable"; } // Get translation in local frame, transform to global and apply: alignable->move(alignable->surface().toGlobal(this->translation())); // Rotation in local frame const align::EulerAngles angles(this->rotation()); // original code: // alignable->rotateInLocalFrame( align::toMatrix(angles) ); // correct for rounding errors: align::RotationType rot(alignable->surface().toGlobal(align::toMatrix(angles))); align::rectify(rot); alignable->rotateInGlobalFrame(rot); const AlgebraicVector ¶ms = theData->parameters(); const BowedSurfaceDeformation deform(params[dsagittaX], params[dsagittaXY], params[dsagittaY]); // FIXME: true to propagate down? // Needed for hierarchy with common deformation parameter, // but that is not possible now anyway. alignable->addSurfaceDeformation(&deform, false); }
BowedSurfaceAlignmentParameters * BowedSurfaceAlignmentParameters::clone | ( | const AlgebraicVector & | parameters, |
const AlgebraicSymMatrix & | covMatrix | ||
) | const [virtual] |
Clone all parameters (for update of parameters)
Implements AlignmentParameters.
Definition at line 62 of file BowedSurfaceAlignmentParameters.cc.
References AlignmentParameters::alignable(), BowedSurfaceAlignmentParameters(), AlignmentParameters::isValid(), AlignmentParameters::selector(), AlignmentParameters::setUserVariables(), AlignmentParameters::setValid(), and AlignmentParameters::userVariables().
Referenced by cloneFromSelected().
{ BowedSurfaceAlignmentParameters* rbap = new BowedSurfaceAlignmentParameters(this->alignable(), parameters, covMatrix, selector()); if (this->userVariables()) rbap->setUserVariables(this->userVariables()->clone()); rbap->setValid(this->isValid()); return rbap; }
BowedSurfaceAlignmentParameters * BowedSurfaceAlignmentParameters::cloneFromSelected | ( | const AlgebraicVector & | parameters, |
const AlgebraicSymMatrix & | covMatrix | ||
) | const [virtual] |
Clone selected parameters (for update of parameters)
Implements AlignmentParameters.
Definition at line 76 of file BowedSurfaceAlignmentParameters.cc.
References clone(), AlignmentParameters::expandSymMatrix(), AlignmentParameters::expandVector(), and AlignmentParameters::selector().
{ return this->clone(this->expandVector(parameters, this->selector()), this->expandSymMatrix(covMatrix, this->selector())); }
AlgebraicMatrix BowedSurfaceAlignmentParameters::derivatives | ( | const TrajectoryStateOnSurface & | tsos, |
const AlignableDetOrUnitPtr & | aliDet | ||
) | const [virtual] |
Get all derivatives.
Implements AlignmentParameters.
Definition at line 86 of file BowedSurfaceAlignmentParameters.cc.
References AlignmentParameters::alignable(), Exception, AlignableSurface::length(), N_PARAM, Alignable::surface(), and AlignableSurface::width().
{ const Alignable *ali = this->alignable(); // Alignable of these parameters if (ali == alidet) { const AlignableSurface &surf = ali->surface(); return BowedDerivs()(tsos, surf.width(), surf.length()); } else { // We could give this a meaning by applying frame-to-frame derivatives // to the first six parameters (be careful that alpha and beta changed // their scale and switched their place compared to RigidBody!) and // keep the remaining three untouched in local meaning. // In this way we could do higher level alignment and determine 'average' // surface structures for the components. throw cms::Exception("MisMatch") << "BowedSurfaceAlignmentParameters::derivatives: The hit alignable must match the " << "aligned one (i.e. bowed surface parameters cannot be used for composed alignables)\n"; return AlgebraicMatrix(N_PARAM, 2); // please compiler } }
void BowedSurfaceAlignmentParameters::print | ( | void | ) | const |
print parameters to screen
Definition at line 173 of file BowedSurfaceAlignmentParameters.cc.
References gather_cfg::cout, and AlignmentParameters::theData.
align::EulerAngles BowedSurfaceAlignmentParameters::rotation | ( | void | ) | const |
Get rotation parameters.
Definition at line 119 of file BowedSurfaceAlignmentParameters.cc.
References AlignmentParameters::alignable(), drotZ, dslopeX, dslopeY, BowedSurfaceAlignmentDerivatives::gammaScale(), AlignableSurface::length(), Alignable::surface(), AlignmentParameters::theData, and AlignableSurface::width().
Referenced by apply().
{ const AlgebraicVector ¶ms = theData->parameters(); const Alignable *alignable = this->alignable(); const AlignableSurface &surface = alignable->surface(); align::EulerAngles eulerAngles(3); // Note that dslopeX <-> -beta and dslopeY <-> alpha: // Should we use atan of these values? Anyway it is small... eulerAngles[0] = params[dslopeY] * 2. / surface.length(); eulerAngles[1] = -params[dslopeX] * 2. / surface.width(); const double aScale = BowedDerivs::gammaScale(surface.width(), surface.length()); eulerAngles[2] = params[drotZ] / aScale; return eulerAngles; }
align::LocalVector BowedSurfaceAlignmentParameters::translation | ( | void | ) | const |
Get translation parameters in double precision.
Definition at line 110 of file BowedSurfaceAlignmentParameters.cc.
References dx, dy, dz, and AlignmentParameters::theData.
Referenced by apply().
{ // align::LocalVector uses double while LocalVector uses float only! const AlgebraicVector ¶ms = theData->parameters(); return align::LocalVector(params[dx], params[dy], params[dz]); }
int BowedSurfaceAlignmentParameters::type | ( | ) | const [virtual] |
tell type (AlignmentParametersFactory::ParametersType - but no circular dependency)
Implements AlignmentParameters.
Definition at line 167 of file BowedSurfaceAlignmentParameters.cc.
References AlignmentParametersFactory::kBowedSurface.
{ return AlignmentParametersFactory::kBowedSurface; }