23 theCachedSurface(surf),
24 theAlignmentParameters(0),
36 theAlignmentParameters(0),
52 bool isConsistent =
true;
53 bool hasAliComp =
false;
56 for (Alignables::const_iterator iComp = comps.begin(), iCompEnd = comps.end();
57 iComp != iCompEnd; ++iComp) {
58 if ((*iComp)->alignmentParameters()) {
59 paramComps.push_back(*iComp);
60 if (!first && !hasAliComp) isConsistent =
false;
63 const unsigned int nCompBefore = paramComps.size();
64 if (!(*iComp)->firstCompsWithParams(paramComps)) {
67 if (paramComps.size() != nCompBefore) {
68 if (!first && !hasAliComp) isConsistent =
false;
70 }
else if (hasAliComp) {
83 bool isConsistent =
true;
84 bool hasAliComp =
false;
87 for (
const auto& iComp: comps) {
88 const auto nCompsBefore = paramComps.size();
89 isConsistent = iComp->lastCompsWithParams(paramComps);
90 if (paramComps.size() == nCompsBefore) {
91 if (iComp->alignmentParameters()) {
92 paramComps.push_back(iComp);
93 if (!first && !hasAliComp) isConsistent =
false;
100 if (!first && !hasAliComp) isConsistent =
false;
248 typedef std::pair<int,SurfaceDeformation*> IdSurfaceDeformationPtrPair;
250 std::vector<IdSurfaceDeformationPtrPair>
result;
252 std::sort( result.begin(),
258 for ( std::vector<IdSurfaceDeformationPtrPair>::const_iterator iPair = result.begin();
259 iPair != result.end();
264 allSurfaceDeformations->
add((*iPair).first,
265 (*iPair).second->type(),
266 (*iPair).second->parameters());
269 return allSurfaceDeformations;
283 for (
auto it = comps.begin(); it != comps.end(); ++it) {
284 (*it)->cacheTransformation();
299 for (
auto it = comps.begin(); it != comps.end(); ++it) {
300 (*it)->restoreCachedTransformation();
RotationType theCachedRotation
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
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.
virtual void rotateAroundGlobalAxis(const GlobalVector &axis, Scalar radians)
Rotation around arbitratry global axis.
virtual Alignables components() const =0
Return vector of all direct components.
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
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
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
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
AlignableSurface theCachedSurface
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 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.
const BasicVectorType & basicVector() const
virtual ~Alignable()
Destructor.
const SurveyDet * theSurvey
align::Alignables Alignables
AlignableSurface theSurface
bool lastCompsWithParams(Alignables ¶mComps) const