23 theCachedSurface(surf),
24 theAlignmentParameters(nullptr),
34 theAlignmentParameters(nullptr),
48 <<
"Current alignable ID does not match ID of the update.";
63 bool isConsistent =
true;
64 bool hasAliComp =
false;
67 for (
const auto& iComp : comps) {
68 if (iComp->alignmentParameters()) {
69 paramComps.push_back(iComp);
70 if (!
first && !hasAliComp)
74 const unsigned int nCompBefore = paramComps.size();
75 if (!(iComp->firstCompsWithParams(paramComps))) {
78 if (paramComps.size() != nCompBefore) {
79 if (!
first && !hasAliComp)
82 }
else if (hasAliComp) {
94 bool isConsistent =
true;
95 bool hasAliComp =
false;
98 for (
const auto& iComp : comps) {
99 const auto nCompsBefore = paramComps.size();
100 isConsistent = iComp->lastCompsWithParams(paramComps);
101 if (paramComps.size() == nCompsBefore) {
102 if (iComp->alignmentParameters()) {
103 paramComps.push_back(iComp);
104 if (!
first && !hasAliComp)
105 isConsistent =
false;
110 isConsistent =
false;
112 if (!
first && !hasAliComp)
113 isConsistent =
false;
197 typedef std::pair<int, SurfaceDeformation*> IdSurfaceDeformationPtrPair;
199 std::vector<IdSurfaceDeformationPtrPair>
result;
205 for (std::vector<IdSurfaceDeformationPtrPair>::const_iterator iPair =
result.begin(); iPair !=
result.end();
209 allSurfaceDeformations->add((*iPair).first, (*iPair).second->type(), (*iPair).second->parameters());
212 return allSurfaceDeformations;
223 it->cacheTransformation();
234 it->cacheTransformation(run);
245 it->restoreCachedTransformation();
250 throw cms::Exception(
"Alignment") <<
"@SUB=Alignable::restoreCachedTransformation\n" 251 <<
"Trying to restore cached transformation for a run (" <<
run 252 <<
") that has not been cached.";
261 it->restoreCachedTransformation();
278 const auto motherShift =
shift *
static_cast<Scalar>(thisComps) / motherComps;
RotationType theCachedRotation
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
void update(align::ID, const AlignableSurface &)
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
virtual void rotateAroundLocalAxis(const LocalVector &axis, Scalar radians)
Rotation around arbitratry local axis.
Alignable()
private default ctr. to enforce usage of the specialised ones
Sin< T >::type sin(const T &t)
void move(const GlobalVector &displacement)
Cache< GlobalVector > displacementsCache_
Cache< AlignableSurface > surfacesCache_
const Alignables & deepComponents() const
Cache< RotationType > rotationsCache_
virtual void rotateAroundGlobalAxis(const GlobalVector &axis, Scalar radians)
Rotation around arbitratry global axis.
GlobalVector theDisplacement
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
bool firstCompsWithParams(Alignables ¶mComps) const
virtual void recenterSurface()
Recenter surface object without moving possible components.
const PositionType & globalPosition() const
Return the global position of the object.
AlignmentParameters * theAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
const SurveyDet * survey() const
Return survey info.
Cos< T >::type cos(const T &t)
virtual void restoreCachedTransformation()
restore the previously cached transformation, also for possible components
virtual const Alignables & components() const =0
Return vector of all direct components.
virtual void updateMother(const GlobalVector &shift)
const BasicVectorType & basicVector() const
virtual CompConstraintType compConstraintType() const
Return the alignable type of contraints wrt. its components.
AlignableSurface theCachedSurface
const PositionType & position() const
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
void setSurvey(const SurveyDet *)
Set survey info.
void addRotation(const RotationType &rotation)
align::RotationType RotationType
bool lastCompsWithParams(Alignables ¶mComps) const
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
GlobalVector theCachedDisplacement
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
void addDisplacement(const GlobalVector &displacement)
virtual void cacheTransformation()
cache the current position, rotation and other parameters (e.g. surface deformations), also for possible components
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
static unsigned int const shift
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation *> > &) const =0
align::GlobalVector GlobalVector
virtual ~Alignable()
Destructor.
const SurveyDet * theSurvey
align::Alignables Alignables
AlignableSurface theSurface
cond::RealTimeType< cond::runnumber >::type RunNumber
const RotationType & rotation() const
Return change of orientation since the creation of the object.