CMS 3D CMS Logo

Public Types | Public Member Functions

BowedSurfaceAlignmentParameters Class Reference

#include <BowedSurfaceAlignmentParameters.h>

Inheritance diagram for BowedSurfaceAlignmentParameters:
AlignmentParameters

List of all members.

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 &parameters, const AlgebraicSymMatrix &covMatrix)
 Constructor for full set of parameters.
 BowedSurfaceAlignmentParameters (Alignable *alignable, const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix, const std::vector< bool > &selection)
 Constructor for selection.
virtual
BowedSurfaceAlignmentParameters
clone (const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
 Clone all parameters (for update of parameters)
virtual
BowedSurfaceAlignmentParameters
cloneFromSelected (const AlgebraicVector &parameters, 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.

Detailed Description

Concrete class for alignment parameters and associated quantities [derived from AlignmentParameters]. The number of parameters N_PARAM is 9

Date:
2010/10/26 20:41:07
Revision:
1.1

(last update by

Author:
flucke

)

Definition at line 27 of file BowedSurfaceAlignmentParameters.h.


Member Typedef Documentation

Give parameters a name.

Definition at line 31 of file BowedSurfaceAlignmentParameters.h.


Member Enumeration Documentation

Enumerator:
dx 
dy 
dz 
dslopeX 
dslopeY 
drotZ 
dsagittaX 
dsagittaXY 
dsagittaY 
N_PARAM 

Definition at line 32 of file BowedSurfaceAlignmentParameters.h.


Constructor & Destructor Documentation

BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters ( Alignable alignable)

Constructor with empty parameters/covariance.

Definition at line 26 of file BowedSurfaceAlignmentParameters.cc.

Referenced by clone().

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]

Destructor.

Definition at line 59 of file BowedSurfaceAlignmentParameters.h.

{};

Member Function Documentation

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(), 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 &params = 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]
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.

{
  std::cout << "Contents of BowedSurfaceAlignmentParameters:"
            << "\nParameters: " << theData->parameters()
            << "\nCovariance: " << theData->covariance() << std::endl;
}
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 &params = 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 &params = theData->parameters();
  return align::LocalVector(params[dx], params[dy], params[dz]);
}
int BowedSurfaceAlignmentParameters::type ( ) const [virtual]