23 theCachedSurface(surf),
24 theAlignmentParameters(
nullptr),
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 (
const auto& iComp: comps) {
76 if (iComp->alignmentParameters()) {
77 paramComps.push_back(iComp);
78 if (!first && !hasAliComp) isConsistent =
false;
81 const unsigned int nCompBefore = paramComps.size();
82 if (!(iComp->firstCompsWithParams(paramComps))) {
85 if (paramComps.size() != nCompBefore) {
86 if (!first && !hasAliComp) isConsistent =
false;
88 }
else if (hasAliComp) {
101 bool isConsistent =
true;
102 bool hasAliComp =
false;
105 for (
const auto& iComp: comps) {
106 const auto nCompsBefore = paramComps.size();
107 isConsistent = iComp->lastCompsWithParams(paramComps);
108 if (paramComps.size() == nCompsBefore) {
109 if (iComp->alignmentParameters()) {
110 paramComps.push_back(iComp);
111 if (!first && !hasAliComp) isConsistent =
false;
116 isConsistent =
false;
118 if (!first && !hasAliComp) isConsistent =
false;
266 typedef std::pair<int,SurfaceDeformation*> IdSurfaceDeformationPtrPair;
268 std::vector<IdSurfaceDeformationPtrPair>
result;
270 std::sort( result.begin(),
276 for ( std::vector<IdSurfaceDeformationPtrPair>::const_iterator iPair = result.begin();
277 iPair != result.end();
282 allSurfaceDeformations->
add((*iPair).first,
283 (*iPair).second->type(),
284 (*iPair).second->parameters());
287 return allSurfaceDeformations;
299 for (
const auto& it: this->
components()) it->cacheTransformation();
310 for (
const auto& it: this->
components()) it->cacheTransformation(run);
321 for (
const auto& it: this->
components()) it->restoreCachedTransformation();
328 <<
"@SUB=Alignable::restoreCachedTransformation\n" 329 <<
"Trying to restore cached transformation for a run (" << run
330 <<
") that has not been cached.";
338 for (
const auto& it: this->
components()) it->restoreCachedTransformation();
358 const auto motherShift = shift *
static_cast<Scalar>(thisComps) / motherComps;
379 -currentPosition.y(),
380 -currentPosition.z()});
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_
virtual const Alignables & components() const =0
Return vector of all direct components.
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.
virtual void recenterSurface()
Recenter surface object without moving possible components.
const RotationType & rotation() const
Return change of orientation since the creation of the object.
AlignmentParameters * theAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
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
const PositionType & globalPosition() const
Return the global position of the object.
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