23 theCachedSurface(surf),
24 theAlignmentParameters(0),
54 <<
"@SUB=Alignable::update\n" 55 <<
"Current alignable ID does not match ID of the update.";
71 bool isConsistent =
true;
72 bool hasAliComp =
false;
75 for (Alignables::const_iterator iComp = comps.begin(), iCompEnd = comps.end();
76 iComp != iCompEnd; ++iComp) {
77 if ((*iComp)->alignmentParameters()) {
78 paramComps.push_back(*iComp);
79 if (!first && !hasAliComp) isConsistent =
false;
82 const unsigned int nCompBefore = paramComps.size();
83 if (!(*iComp)->firstCompsWithParams(paramComps)) {
86 if (paramComps.size() != nCompBefore) {
87 if (!first && !hasAliComp) isConsistent =
false;
89 }
else if (hasAliComp) {
102 bool isConsistent =
true;
103 bool hasAliComp =
false;
106 for (
const auto& iComp: comps) {
107 const auto nCompsBefore = paramComps.size();
108 isConsistent = iComp->lastCompsWithParams(paramComps);
109 if (paramComps.size() == nCompsBefore) {
110 if (iComp->alignmentParameters()) {
111 paramComps.push_back(iComp);
112 if (!first && !hasAliComp) isConsistent =
false;
117 isConsistent =
false;
119 if (!first && !hasAliComp) isConsistent =
false;
267 typedef std::pair<int,SurfaceDeformation*> IdSurfaceDeformationPtrPair;
269 std::vector<IdSurfaceDeformationPtrPair>
result;
271 std::sort( result.begin(),
277 for ( std::vector<IdSurfaceDeformationPtrPair>::const_iterator iPair = result.begin();
278 iPair != result.end();
283 allSurfaceDeformations->
add((*iPair).first,
284 (*iPair).second->type(),
285 (*iPair).second->parameters());
288 return allSurfaceDeformations;
302 for (
auto it = comps.begin(); it != comps.end(); ++it) {
303 (*it)->cacheTransformation();
317 for (
auto& it: comps) it->cacheTransformation(run);
330 for (
auto it = comps.begin(); it != comps.end(); ++it) {
331 (*it)->restoreCachedTransformation();
340 <<
"@SUB=Alignable::restoreCachedTransformation\n" 341 <<
"Trying to restore cached transformation for a run (" << run
342 <<
") that has not been cached.";
351 for (
auto it: comps) it->restoreCachedTransformation();
371 const auto motherShift = shift *
static_cast<Scalar>(thisComps) / motherComps;
RotationType theCachedRotation
void update(align::ID, const AlignableSurface &)
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
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)
const SurveyDet * survey() const
Return survey info.
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
void move(const GlobalVector &displacement)
Cache< GlobalVector > displacementsCache_
Cache< AlignableSurface > surfacesCache_
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.
const RotationType & rotation() const
Return change of orientation since the creation of the object.
AlignmentParameters * theAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
virtual Alignables components() const =0
Return vector of all direct components.
Cos< T >::type cos(const T &t)
bool firstCompsWithParams(Alignables ¶mComps) const
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
virtual void restoreCachedTransformation()
restore the previously cached transformation, also for possible components
virtual void updateMother(const GlobalVector &shift)
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
AlignableSurface theCachedSurface
const Alignables & deepComponents() 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
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 CompConstraintType compConstraintType() const
Return the alignable type of contraints wrt. its components.
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
align::GlobalVector GlobalVector
const BasicVectorType & basicVector() const
const PositionType & position() const
virtual ~Alignable()
Destructor.
const SurveyDet * theSurvey
align::Alignables Alignables
AlignableSurface theSurface
bool lastCompsWithParams(Alignables ¶mComps) const
cond::RealTimeType< cond::runnumber >::type RunNumber