CMS 3D CMS Logo

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

void apply () override
 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...
 
BowedSurfaceAlignmentParametersclone (const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const override
 Clone all parameters (for update of parameters) More...
 
BowedSurfaceAlignmentParameterscloneFromSelected (const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const override
 Clone selected parameters (for update of parameters) More...
 
AlgebraicMatrix derivatives (const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const override
 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...
 
int type () const override
 tell type (AlignmentParametersFactory::ParametersType - but no circular dependency) More...
 
 ~BowedSurfaceAlignmentParameters () override
 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

◆ BowedDerivs

Give parameters a name.

Definition at line 30 of file BowedSurfaceAlignmentParameters.h.

Member Enumeration Documentation

◆ AlignmentParameterName

Enumerator
dx 
dy 
dz 
dslopeX 
dslopeY 
drotZ 
dsagittaX 
dsagittaXY 
dsagittaY 
N_PARAM 

Definition at line 31 of file BowedSurfaceAlignmentParameters.h.

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

Constructor & Destructor Documentation

◆ BowedSurfaceAlignmentParameters() [1/3]

BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters ( Alignable alignable)

Constructor with empty parameters/covariance.

Definition at line 25 of file BowedSurfaceAlignmentParameters.cc.

Referenced by clone().

CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlignmentParameters()
Default constructor.

◆ BowedSurfaceAlignmentParameters() [2/3]

BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters ( Alignable alignable,
const AlgebraicVector parameters,
const AlgebraicSymMatrix covMatrix 
)

Constructor for full set of parameters.

Definition at line 29 of file BowedSurfaceAlignmentParameters.cc.

References Exception, N_PARAM, and AlignmentParameters::parameters().

33  if (parameters.num_row() != N_PARAM) {
34  throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): " << parameters.num_row()
35  << " instead of " << N_PARAM << " parameters.";
36  }
37 }
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignmentParameters()
Default constructor.

◆ BowedSurfaceAlignmentParameters() [3/3]

BowedSurfaceAlignmentParameters::BowedSurfaceAlignmentParameters ( Alignable alignable,
const AlgebraicVector parameters,
const AlgebraicSymMatrix covMatrix,
const std::vector< bool > &  selection 
)

Constructor for selection.

Definition at line 40 of file BowedSurfaceAlignmentParameters.cc.

References Exception, N_PARAM, and AlignmentParameters::parameters().

45  if (parameters.num_row() != N_PARAM) {
46  throw cms::Exception("BadParameters") << "in BowedSurfaceAlignmentParameters(): " << parameters.num_row()
47  << " instead of " << N_PARAM << " parameters.";
48  }
49 }
Alignable * alignable(void) const
Get pointer to corresponding alignable.
selection
main part
Definition: corrVsCorr.py:100
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignmentParameters()
Default constructor.

◆ ~BowedSurfaceAlignmentParameters()

BowedSurfaceAlignmentParameters::~BowedSurfaceAlignmentParameters ( )
inlineoverride

Destructor.

Definition at line 59 of file BowedSurfaceAlignmentParameters.h.

59 {}

Member Function Documentation

◆ apply()

void BowedSurfaceAlignmentParameters::apply ( )
overridevirtual

apply parameters to alignable

Implements AlignmentParameters.

Definition at line 119 of file BowedSurfaceAlignmentParameters.cc.

References Alignable::addSurfaceDeformation(), AlignmentParameters::alignable(), dsagittaX, dsagittaXY, dsagittaY, Exception, Alignable::move(), submitPVValidationJobs::params, align::rectify(), makeMuonMisalignmentScenario::rot, Alignable::rotateInGlobalFrame(), rotation(), AlignmentParameters::selector(), Alignable::surface(), AlignmentParameters::theData, AlignableSurface::toGlobal(), align::toMatrix(), and translation().

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

119  {
120  Alignable *alignable = this->alignable();
121  if (!alignable) {
122  throw cms::Exception("BadParameters") << "BowedSurfaceAlignmentParameters::apply: parameters without "
123  "alignable";
124  }
125 
126  // Get translation in local frame, transform to global and apply:
128 
129  // Rotation in local frame
130  const align::EulerAngles angles(this->rotation());
131  // original code:
132  // alignable->rotateInLocalFrame( align::toMatrix(angles) );
133  // correct for rounding errors:
137 
138  // only update the surface deformations if they were selected for alignment
140  const auto &params = theData->parameters();
142 
143  // FIXME: true to propagate down?
144  // Needed for hierarchy with common deformation parameter,
145  // but that is not possible now anyway.
146  alignable->addSurfaceDeformation(&deform, false);
147  }
148 }
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Alignable * alignable(void) const
Get pointer to corresponding alignable.
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
Definition: Utilities.cc:185
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
AlgebraicVector EulerAngles
Definition: Definitions.h:34
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
align::LocalVector translation() const
Get translation parameters in double precision.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:34
align::EulerAngles rotation() const
Get rotation parameters.

◆ clone()

BowedSurfaceAlignmentParameters * BowedSurfaceAlignmentParameters::clone ( const AlgebraicVector parameters,
const AlgebraicSymMatrix covMatrix 
) const
overridevirtual

Clone all parameters (for update of parameters)

Implements AlignmentParameters.

Definition at line 52 of file BowedSurfaceAlignmentParameters.cc.

References AlignmentParameters::alignable(), BowedSurfaceAlignmentParameters(), AlignmentParameters::isValid(), AlignmentParameters::selector(), AlignmentParameters::setUserVariables(), AlignmentParameters::setValid(), and AlignmentParameters::userVariables().

Referenced by cloneFromSelected().

53  {
56 
57  if (this->userVariables())
58  rbap->setUserVariables(this->userVariables()->clone());
59  rbap->setValid(this->isValid());
60 
61  return rbap;
62 }
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlgebraicVector & parameters(void) const
Get alignment parameters.
BowedSurfaceAlignmentParameters(Alignable *alignable)
Constructor with empty parameters/covariance.
void setValid(bool v)
Set validity flag.
AlignmentUserVariables * userVariables(void) const
Get pointer to user variables.
bool isValid(void) const
Get validity flag.
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
BowedSurfaceAlignmentParameters * clone(const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const override
Clone all parameters (for update of parameters)

◆ cloneFromSelected()

BowedSurfaceAlignmentParameters * BowedSurfaceAlignmentParameters::cloneFromSelected ( const AlgebraicVector parameters,
const AlgebraicSymMatrix covMatrix 
) const
overridevirtual

Clone selected parameters (for update of parameters)

Implements AlignmentParameters.

Definition at line 65 of file BowedSurfaceAlignmentParameters.cc.

References clone(), AlignmentParameters::expandSymMatrix(), AlignmentParameters::expandVector(), and AlignmentParameters::selector().

66  {
67  return this->clone(this->expandVector(parameters, this->selector()),
68  this->expandSymMatrix(covMatrix, this->selector()));
69 }
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlgebraicVector expandVector(const AlgebraicVector &m, const std::vector< bool > &sel) const
AlgebraicSymMatrix expandSymMatrix(const AlgebraicSymMatrix &m, const std::vector< bool > &sel) const
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
BowedSurfaceAlignmentParameters * clone(const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const override
Clone all parameters (for update of parameters)

◆ derivatives()

AlgebraicMatrix BowedSurfaceAlignmentParameters::derivatives ( const TrajectoryStateOnSurface tsos,
const AlignableDetOrUnitPtr aliDet 
) const
overridevirtual

Get all derivatives.

Implements AlignmentParameters.

Definition at line 72 of file BowedSurfaceAlignmentParameters.cc.

References AlignmentParameters::alignable(), Exception, AlignableSurface::length(), N_PARAM, Alignable::surface(), and AlignableSurface::width().

73  {
74  const Alignable *ali = this->alignable(); // Alignable of these parameters
75 
76  if (ali == alidet) {
77  const AlignableSurface &surf = ali->surface();
78  return BowedDerivs()(tsos, surf.width(), surf.length());
79  } else {
80  // We could give this a meaning by applying frame-to-frame derivatives
81  // to the first six parameters (be careful that alpha and beta changed
82  // their scale and switched their place compared to RigidBody!) and
83  // keep the remaining three untouched in local meaning.
84  // In this way we could do higher level alignment and determine 'average'
85  // surface structures for the components.
86  throw cms::Exception("MisMatch") << "BowedSurfaceAlignmentParameters::derivatives: The hit alignable "
87  "must match the "
88  << "aligned one (i.e. bowed surface parameters cannot be used for "
89  "composed alignables)\n";
90  return AlgebraicMatrix(N_PARAM, 2); // please compiler
91  }
92 }
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Alignable * alignable(void) const
Get pointer to corresponding alignable.
align::Scalar width() const
CLHEP::HepMatrix AlgebraicMatrix
align::Scalar length() const
BowedSurfaceAlignmentDerivatives BowedDerivs
Give parameters a name.

◆ print()

void BowedSurfaceAlignmentParameters::print ( void  ) const

print parameters to screen

Definition at line 154 of file BowedSurfaceAlignmentParameters.cc.

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

154  {
155  std::cout << "Contents of BowedSurfaceAlignmentParameters:"
156  << "\nParameters: " << theData->parameters() << "\nCovariance: " << theData->covariance() << std::endl;
157 }

◆ rotation()

align::EulerAngles BowedSurfaceAlignmentParameters::rotation ( void  ) const

Get rotation parameters.

Definition at line 102 of file BowedSurfaceAlignmentParameters.cc.

References AlignmentParameters::alignable(), drotZ, dslopeX, dslopeY, BowedSurfaceAlignmentDerivatives::gammaScale(), AlignableSurface::length(), submitPVValidationJobs::params, Alignable::surface(), AlignmentParameters::theData, and AlignableSurface::width().

Referenced by apply().

102  {
103  const AlgebraicVector &params = theData->parameters();
104  const Alignable *alignable = this->alignable();
105  const AlignableSurface &surface = alignable->surface();
106 
107  align::EulerAngles eulerAngles(3);
108  // Note that dslopeX <-> -beta and dslopeY <-> alpha:
109  // Should we use atan of these values? Anyway it is small...
110  eulerAngles[0] = params[dslopeY] * 2. / surface.length();
111  eulerAngles[1] = -params[dslopeX] * 2. / surface.width();
112  const double aScale = BowedDerivs::gammaScale(surface.width(), surface.length());
113  eulerAngles[2] = params[drotZ] / aScale;
114 
115  return eulerAngles;
116 }
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Alignable * alignable(void) const
Get pointer to corresponding alignable.
align::Scalar width() const
static double gammaScale(double width, double splitLength)
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:34
align::Scalar length() const

◆ translation()

align::LocalVector BowedSurfaceAlignmentParameters::translation ( void  ) const

Get translation parameters in double precision.

Definition at line 95 of file BowedSurfaceAlignmentParameters.cc.

References dx, dy, dz, submitPVValidationJobs::params, and AlignmentParameters::theData.

Referenced by apply().

95  {
96  // align::LocalVector uses double while LocalVector uses float only!
97  const AlgebraicVector &params = theData->parameters();
99 }
Vector3DBase< Scalar, LocalTag > LocalVector
Definition: Definitions.h:32
CLHEP::HepVector AlgebraicVector

◆ type()

int BowedSurfaceAlignmentParameters::type ( ) const
overridevirtual