CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
BowedSurfaceAlignmentParameters Class Reference

#include <BowedSurfaceAlignmentParameters.h>

Inheritance diagram for BowedSurfaceAlignmentParameters:
AlignmentParameters

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. More...
 
- Public Types inherited from AlignmentParameters
typedef
AlignmentParametersData::DataContainer 
DataContainer
 

Public Member Functions

virtual void apply ()
 apply parameters to alignable More...
 
 BowedSurfaceAlignmentParameters (Alignable *alignable)
 Constructor with empty parameters/covariance. More...
 
 BowedSurfaceAlignmentParameters (Alignable *alignable, const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix)
 Constructor for full set of parameters. More...
 
 BowedSurfaceAlignmentParameters (Alignable *alignable, const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix, const std::vector< bool > &selection)
 Constructor for selection. More...
 
virtual
BowedSurfaceAlignmentParameters
clone (const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
 Clone all parameters (for update of parameters) More...
 
virtual
BowedSurfaceAlignmentParameters
cloneFromSelected (const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
 Clone selected parameters (for update of parameters) More...
 
virtual AlgebraicMatrix derivatives (const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const
 Get all derivatives. More...
 
void print () const
 print parameters to screen More...
 
align::EulerAngles rotation () const
 Get rotation parameters. More...
 
align::LocalVector translation () const
 Get translation parameters in double precision. More...
 
virtual int type () const
 tell type (AlignmentParametersFactory::ParametersType - but no circular dependency) More...
 
virtual ~BowedSurfaceAlignmentParameters ()
 Destructor. More...
 
- Public Member Functions inherited from AlignmentParameters
Alignablealignable (void) const
 Get pointer to corresponding alignable. More...
 
 AlignmentParameters ()
 Default constructor. More...
 
 AlignmentParameters (Alignable *object, const AlgebraicVector &par, const AlgebraicSymMatrix &cov)
 Constructor from given input. More...
 
 AlignmentParameters (Alignable *object, const AlgebraicVector &par, const AlgebraicSymMatrix &cov, const std::vector< bool > &sel)
 Constructor including selection of active parameters. More...
 
 AlignmentParameters (Alignable *object, const DataContainer &data)
 Constructor. More...
 
const AlgebraicSymMatrixcovariance (void) const
 Get parameter covariance matrix. More...
 
virtual unsigned int hierarchyLevel () const
 
bool isValid (void) const
 Get validity flag. More...
 
int numSelected (void) const
 Get number of selected parameters. More...
 
const AlgebraicVectorparameters (void) const
 Get alignment parameters. More...
 
AlgebraicSymMatrix selectedCovariance (void) const
 Get covariance matrix of selected parameters. More...
 
virtual AlgebraicMatrix selectedDerivatives (const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
 
AlgebraicVector selectedParameters (void) const
 Get selected parameters. More...
 
const std::vector< bool > & selector (void) const
 Get alignment parameter selector vector. More...
 
void setUserVariables (AlignmentUserVariables *auv)
 Set pointer to user variables. More...
 
void setValid (bool v)
 Set validity flag. More...
 
int size (void) const
 Get number of parameters. More...
 
AlignmentUserVariablesuserVariables (void) const
 Get pointer to user variables. More...
 
virtual ~AlignmentParameters ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from AlignmentParameters
AlgebraicSymMatrix collapseSymMatrix (const AlgebraicSymMatrix &m, const std::vector< bool > &sel) const
 
AlgebraicVector collapseVector (const AlgebraicVector &m, const std::vector< bool > &sel) const
 
AlgebraicSymMatrix expandSymMatrix (const AlgebraicSymMatrix &m, const std::vector< bool > &sel) const
 
AlgebraicVector expandVector (const AlgebraicVector &m, const std::vector< bool > &sel) const
 
- Protected Attributes inherited from AlignmentParameters
bool bValid
 True if parameters are valid. More...
 
AlignabletheAlignable
 
DataContainer theData
 
AlignmentUserVariablestheUserVariables
 

Detailed Description

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

Date:
2008/09/02 15:08:12
Revision:
1.13

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

32  {
36  dslopeX = BowedDerivs::dslopeX, // NOTE: slope(u) -> k*tan(beta),
37  dslopeY = BowedDerivs::dslopeY, // slope(v) -> l*tan(alpha)
38  drotZ = BowedDerivs::drotZ, // rot(w) -> m*gamma
43  };

Constructor & Destructor Documentation

BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters ( Alignable alignable)

Constructor with empty parameters/covariance.

Definition at line 26 of file BowedSurfaceAlignmentParameters.cc.

Referenced by clone().

26  :
28 {
29 }
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlignmentParameters()
Default constructor.
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 edm::hlt::Exception.

35  :
36  AlignmentParameters(alignable, parameters, covMatrix)
37 {
38  if (parameters.num_row() != N_PARAM) {
39  throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): "
40  << parameters.num_row() << " instead of " << N_PARAM
41  << " parameters.";
42  }
43 }
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignmentParameters()
Default constructor.
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 edm::hlt::Exception.

50  :
51  AlignmentParameters(alignable, parameters, covMatrix, selection)
52 {
53  if (parameters.num_row() != N_PARAM) {
54  throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): "
55  << parameters.num_row() << " instead of " << N_PARAM
56  << " parameters.";
57  }
58 }
selection
main part
Definition: corrVsCorr.py:98
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignmentParameters()
Default constructor.
virtual BowedSurfaceAlignmentParameters::~BowedSurfaceAlignmentParameters ( )
inlinevirtual

Destructor.

Definition at line 59 of file BowedSurfaceAlignmentParameters.h.

59 {};

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, edm::hlt::Exception, Alignable::move(), align::rectify(), makeMuonMisalignmentScenario::rot, Alignable::rotateInGlobalFrame(), rotation(), Alignable::surface(), AlignmentParameters::theData, AlignableSurface::toGlobal(), align::toMatrix(), and translation().

Referenced by heavyIonTools.ConfigureHeavyIons::__call__(), editorTools.UserCodeTool::__call__(), HiCoreTools.RestrictInputToAOD::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), heavyIonTools.ProductionDefaults::__call__(), editorTools.ChangeSource::__call__(), HiCoreTools.RemoveMCMatching::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), jetTools.AddJetCollection::__call__(), heavyIonTools.SelectionDefaults::__call__(), HiCoreTools.RemoveAllPATObjectsBut::__call__(), heavyIonTools.DisbaleMonteCarloDeps::__call__(), HiCoreTools.RemoveSpecificPATObjects::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), trackTools.MakeTrackCandidates::__call__(), tauTools.AddTauCollection::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), HiCoreTools.RemoveCleaning::__call__(), HiCoreTools.AddCleaning::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.AddJetID::__call__(), and jetTools.SetTagInfos::__call__().

138 {
139  Alignable *alignable = this->alignable();
140  if (!alignable) {
141  throw cms::Exception("BadParameters")
142  << "BowedSurfaceAlignmentParameters::apply: parameters without alignable";
143  }
144 
145  // Get translation in local frame, transform to global and apply:
146  alignable->move(alignable->surface().toGlobal(this->translation()));
147 
148  // Rotation in local frame
149  const align::EulerAngles angles(this->rotation());
150  // original code:
151  // alignable->rotateInLocalFrame( align::toMatrix(angles) );
152  // correct for rounding errors:
153  align::RotationType rot(alignable->surface().toGlobal(align::toMatrix(angles)));
155  alignable->rotateInGlobalFrame(rot);
156 
157  const AlgebraicVector &params = theData->parameters();
158  const BowedSurfaceDeformation deform(params[dsagittaX], params[dsagittaXY], params[dsagittaY]);
159 
160  // FIXME: true to propagate down?
161  // Needed for hierarchy with common deformation parameter,
162  // but that is not possible now anyway.
163  alignable->addSurfaceDeformation(&deform, false);
164 }
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
align::LocalVector translation() const
Get translation parameters in double precision.
align::EulerAngles rotation() const
Get rotation parameters.
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
Definition: Utilities.cc:196
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:36
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:40
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().

64 {
67 
68  if (this->userVariables()) rbap->setUserVariables(this->userVariables()->clone());
69  rbap->setValid(this->isValid());
70 
71  return rbap;
72 }
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
BowedSurfaceAlignmentParameters(Alignable *alignable)
Constructor with empty parameters/covariance.
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignmentUserVariables * userVariables(void) const
Get pointer to user variables.
void setValid(bool v)
Set validity flag.
Alignable * alignable(void) const
Get pointer to corresponding alignable.
virtual BowedSurfaceAlignmentParameters * clone(const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
Clone all parameters (for update of parameters)
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
bool isValid(void) const
Get validity flag.
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().

78 {
79  return this->clone(this->expandVector(parameters, this->selector()),
80  this->expandSymMatrix(covMatrix, this->selector()));
81 
82 }
AlgebraicSymMatrix expandSymMatrix(const AlgebraicSymMatrix &m, const std::vector< bool > &sel) const
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlgebraicVector expandVector(const AlgebraicVector &m, const std::vector< bool > &sel) const
virtual BowedSurfaceAlignmentParameters * clone(const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
Clone all parameters (for update of parameters)
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(), edm::hlt::Exception, AlignableSurface::length(), N_PARAM, Alignable::surface(), and AlignableSurface::width().

88 {
89  const Alignable *ali = this->alignable(); // Alignable of these parameters
90 
91  if (ali == alidet) {
92  const AlignableSurface &surf = ali->surface();
93  return BowedDerivs()(tsos, surf.width(), surf.length());
94  } else {
95  // We could give this a meaning by applying frame-to-frame derivatives
96  // to the first six parameters (be careful that alpha and beta changed
97  // their scale and switched their place compared to RigidBody!) and
98  // keep the remaining three untouched in local meaning.
99  // In this way we could do higher level alignment and determine 'average'
100  // surface structures for the components.
101  throw cms::Exception("MisMatch")
102  << "BowedSurfaceAlignmentParameters::derivatives: The hit alignable must match the "
103  << "aligned one (i.e. bowed surface parameters cannot be used for composed alignables)\n";
104  return AlgebraicMatrix(N_PARAM, 2); // please compiler
105  }
106 
107 }
align::Scalar width() const
CLHEP::HepMatrix AlgebraicMatrix
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
align::Scalar length() const
BowedSurfaceAlignmentDerivatives BowedDerivs
Give parameters a name.
void BowedSurfaceAlignmentParameters::print ( void  ) const

print parameters to screen

Definition at line 173 of file BowedSurfaceAlignmentParameters.cc.

References gather_cfg::cout, and AlignmentParameters::theData.

174 {
175  std::cout << "Contents of BowedSurfaceAlignmentParameters:"
176  << "\nParameters: " << theData->parameters()
177  << "\nCovariance: " << theData->covariance() << std::endl;
178 }
tuple cout
Definition: gather_cfg.py:121
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().

120 {
121  const AlgebraicVector &params = theData->parameters();
122  const Alignable *alignable = this->alignable();
123  const AlignableSurface &surface = alignable->surface();
124 
125  align::EulerAngles eulerAngles(3);
126  // Note that dslopeX <-> -beta and dslopeY <-> alpha:
127  // Should we use atan of these values? Anyway it is small...
128  eulerAngles[0] = params[dslopeY] * 2. / surface.length();
129  eulerAngles[1] = -params[dslopeX] * 2. / surface.width();
130  const double aScale = BowedDerivs::gammaScale(surface.width(), surface.length());
131  eulerAngles[2] = params[drotZ] / aScale;
132 
133  return eulerAngles;
134 }
align::Scalar width() const
static double gammaScale(double width, double splitLength)
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:36
align::Scalar length() const
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().

111 {
112  // align::LocalVector uses double while LocalVector uses float only!
113  const AlgebraicVector &params = theData->parameters();
114  return align::LocalVector(params[dx], params[dy], params[dz]);
115 }
Vector3DBase< Scalar, LocalTag > LocalVector
Definition: Definitions.h:34
CLHEP::HepVector AlgebraicVector
int BowedSurfaceAlignmentParameters::type ( ) const
virtual