From f07b61bc63089715d50729c083d82c517b09fd51 Mon Sep 17 00:00:00 2001 From: Gregor Mittag Date: Mon, 2 Nov 2015 18:14:28 +0100 Subject: [PATCH] Fix bug in caching of surface deformations. This bug has an effect if the DetUnits of a large tracker structure are not listed at all. The net effect of this fix is that omitting them leaves them and the associated surface deformations unchanged. --- Alignment/CommonAlignment/interface/Alignable.h | 2 +- Alignment/CommonAlignment/src/Alignable.cc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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()