diff --git a/Alignment/CommonAlignment/interface/Alignable.h b/Alignment/CommonAlignment/interface/Alignable.h index 7c85caba35ea1..f6592f8048cfd 100644 --- a/Alignment/CommonAlignment/interface/Alignable.h +++ b/Alignment/CommonAlignment/interface/Alignable.h @@ -195,7 +195,7 @@ class Alignable /// and pointers to surface deformations virtual int surfaceDeformationIdPairs(std::vector > &) const = 0; - /// cache the current position, rotation and other parameters (e.g. surface deformations) + /// cache the current position, rotation and other parameters (e.g. surface deformations), also for possible components virtual void cacheTransformation(); /// restore the previously cached transformation, also for possible components diff --git a/Alignment/CommonAlignment/src/Alignable.cc b/Alignment/CommonAlignment/src/Alignable.cc index b62a4eb7e080b..b34fb5211ac81 100644 --- a/Alignment/CommonAlignment/src/Alignable.cc +++ b/Alignment/CommonAlignment/src/Alignable.cc @@ -243,9 +243,18 @@ AlignmentSurfaceDeformations* Alignable::surfaceDeformations( void ) const void Alignable::cacheTransformation() { + // first treat itself theCachedSurface = theSurface; theCachedDisplacement = theDisplacement; theCachedRotation = theRotation; + + // now treat components (a clean design would move that to AlignableComposite...) + const Alignables comps(this->components()); + + for (auto it = comps.begin(); it != comps.end(); ++it) { + (*it)->cacheTransformation(); + } + } void Alignable::restoreCachedTransformation()