|
|
Go to the documentation of this file.
12 : theMother(nullptr), theSurface(ali.surface()), theSelector(ali.alignmentParameters()->selector()) {
30 throw cms::Exception(
"ConfigError") <<
"The type " <<
type <<
" does not have a survey residual defined!\n"
31 <<
"You have probably set the highest hierarchy. Choose a lower level.";
37 throw cms::Exception(
"ConfigError") <<
"You are finding an unbiased residual of an alignable "
38 <<
" (id = " << ali.
geomDetId().
rawId() <<
") which has no sister. Abort!";
45 std::vector<Scalar> pars;
47 pars.reserve(AlignParams::kSize);
54 pars.push_back(
deltaR.x());
56 pars.push_back(
deltaR.y());
58 pars.push_back(
deltaR.z());
67 for (
unsigned int j = 0;
j < nominalVs.size(); ++
j) {
77 pars.push_back(deltaW(1));
79 pars.push_back(deltaW(2));
81 pars.push_back(deltaW(3));
86 for (
unsigned int j = 0;
j < pars.size(); ++
j)
87 deltaRW(
j + 1) = pars[
j];
97 residuals.reserve(nPoint);
99 for (
unsigned int j = 0;
j < nPoint; ++
j) {
108 throw cms::Exception(
"LogicError") <<
"Mismatched number of dof between ErrorMatrix and Selector.";
111 std::vector<unsigned int>
indices;
113 indices.reserve(ErrorMatrix::kRows);
115 for (
unsigned int i = 0;
i < ErrorMatrix::kRows; ++
i)
121 for (
unsigned int i = 0;
i <
indices.size(); ++
i)
122 for (
unsigned int j = 0;
j <=
i; ++
j)
129 throw cms::Exception(
"ConfigError") <<
"Cannot invert survey error " << invCov;
141 unsigned int nComp =
comp.size();
143 for (
unsigned int i = 0;
i < nComp; ++
i) {
146 if (dau != ali || bias)
157 std::vector<const PositionType*> nominalSisPos;
158 std::vector<const PositionType*> currentSisPos;
160 nominalSisPos.reserve(nSister);
161 currentSisPos.reserve(nSister);
163 for (
unsigned int i = 0;
i < nSister; ++
i) {
168 throw cms::Exception(
"ConfigError") <<
"No survey info is found for Alignable "
172 nominalSisPos.push_back(&survey->
position());
186 for (
unsigned int i = 0;
i < nSister; ++
i) {
192 for (
unsigned int j = 0;
j < nominalSisPoints.size(); ++
j) {
193 nominalSisVs.push_back(nominalSisPoints[
j] - *nominalSisPos[
i]);
194 currentSisVs.push_back(currentSisPoints[
j] - *currentSisPos[
i]);
207 throw cms::Exception(
"ConfigError") <<
"No survey info is found for Alignable "
214 for (
unsigned int j = 0;
j < nominalPoints.size(); ++
j) {
249 theCovariance += ROOT::Math::Similarity(jac,
a->survey()->errors());
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
const align::PositionType & position() const
AlgebraicVector sensorResidual() const
std::vector< LocalVector > LocalVectors
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
align::ErrorMatrix theCovariance
std::vector< const Alignable * > theSisters
ROOT::Math::SMatrix< double, N, M > type
CLHEP::HepVector AlgebraicVector
void findSisters(const Alignable *, bool bias)
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
const AlignableSurface & theSurface
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.
AlgebraicSymMatrix inverseCovariance() const
Get inverse of survey covariance wrt given structure type in constructor.
align::GlobalVectors theCurrentVs
const DetId & geomDetId() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
PositionType motherPosition(const std::vector< const PositionType * > &dauPos)
Find mother's position from the average of its daughters' positions.
align::LocalVectors pointsResidual() const
std::vector< GlobalVector > GlobalVectors
AlgebraicVector EulerAngles
RotationType diffRot(const GlobalVectors ¤t, const GlobalVectors &nominal)
const align::LocalPoints & localPoints() const
const Alignable * theMother
const BasicVectorType & basicVector() const
void calculate(const Alignable &)
Find the nominal and current vectors.
align::GlobalPoints globalPoints() const
constexpr uint32_t rawId() const
get the raw id
const Alignables & deepComponents() const
align::GlobalVectors theNominalVs
const std::vector< bool > & theSelector
std::vector< GlobalPoint > GlobalPoints
SurveyResidual(const Alignable &, align::StructureType, bool bias=false)
const PositionType & globalPosition() const
Return the global position of the object.
virtual const Alignables & components() const =0
Return vector of all direct components.
const SurveyDet * survey() const
Return survey info.
const RotationType & globalRotation() const
Return the global orientation of the object.
Alignable * mother() const
Return pointer to container alignable (if any)