46 : dtGeometry_(dtGeometry), cscGeometry_(cscGeometry), gemGeometry_(gemGeometry) {
67 align::LocalVector lvector(displacements.at(0), displacements.at(1), displacements.at(2));
71 theAlignable->
move(gvector);
89 theAlignable->
move(gvector);
100 for (align::Alignables::const_iterator alignable = alignables.begin(); alignable != alignables.end(); ++alignable) {
102 theList.push_back(*alignable);
109 for (align::Alignables::const_iterator alignable = alignables.begin(); alignable != alignables.end(); ++alignable) {
110 unsigned int rawId = (*alignable)->geomDetId().rawId();
112 theMap[rawId] = *alignable;
121 std::map<std::pair<align::StructureType, align::ID>,
Alignable*>& theMap) {
122 for (align::Alignables::const_iterator alignable = alignables.begin(); alignable != alignables.end(); ++alignable) {
123 theMap[std::pair<align::StructureType, align::ID>((*alignable)->alignableObjectId(), (*alignable)->id())] =
132 std::map<align::ID, Alignable*> alignableMap;
141 std::vector<AlignTransformErrorExtended> alignmentErrors;
142 std::copy(dtAlignmentErrorsExtended->m_alignError.begin(),
143 dtAlignmentErrorsExtended->m_alignError.end(),
144 std::back_inserter(alignmentErrors));
147 std::back_inserter(alignmentErrors));
150 std::back_inserter(alignmentErrors));
152 for (std::vector<AlignTransformErrorExtended>::const_iterator alignmentError = alignmentErrors.begin();
153 alignmentError != alignmentErrors.end();
156 CLHEP::HepSymMatrix matrix6x6new = alignmentError->matrix();
158 for (
int i = 0;
i < 6;
i++) {
159 for (
int j = 0;
j < 6;
j++) {
160 matrix6x6(
i,
j) = matrix6x6new(
i + 1,
j + 1);
167 Alignable* alignable = alignableMap[alignmentError->rawId()];
179 std::map<std::pair<align::StructureType, align::ID>,
Alignable*> alignableStructureMap;
183 for (std::map<std::pair<align::StructureType, align::ID>,
Alignable*>::const_iterator iter =
184 alignableStructureMap.begin();
185 iter != alignableStructureMap.end();
187 if (iter->second->survey() ==
nullptr) {
195 iter->second->setSurvey(
new SurveyDet(iter->second->surface(), matrix6x6));
203 if (alignable->
survey() !=
nullptr) {
218 for (
int i = 0;
i < 6;
i++) {
219 for (
int j = 0;
j <=
i;
j++) {
220 matrix6x6new(
i,
j) = matrix6x6(
i,
j);
230 for (align::Alignables::const_iterator
comp = components.begin();
comp != components.end(); ++
comp) {
251 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
260 for (align::Alignables::const_iterator alignable = alignableList.begin(); alignable != alignableList.end();
266 CLHEP::HepRotation(CLHEP::HepRep3x3(
267 rot.
xx(), rot.
xy(), rot.
xz(), rot.
yx(), rot.
yy(), rot.
yz(), rot.
zx(), rot.
zy(), rot.
zz())),
269 SurveyError error((*alignable)->alignableObjectId(), (*alignable)->id(), (*alignable)->survey()->errors());
271 dtAlignments.m_align.push_back(
value);
272 dtSurveyErrors.m_surveyErrors.push_back(
error);
284 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
293 for (align::Alignables::const_iterator alignable = alignableList.begin(); alignable != alignableList.end();
299 CLHEP::HepRotation(CLHEP::HepRep3x3(
300 rot.
xx(), rot.
xy(), rot.
xz(), rot.
yx(), rot.
yy(), rot.
yz(), rot.
zx(), rot.
zy(), rot.
zz())),
302 SurveyError error((*alignable)->alignableObjectId(), (*alignable)->id(), (*alignable)->survey()->errors());
304 cscAlignments.m_align.push_back(
value);
305 cscSurveyErrors.m_surveyErrors.push_back(
error);
322 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
338 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
354 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
AlignableNavigator * theAlignableNavigator
std::string theCSCErrorRecordName
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
void copyAlignmentToSurvey(double shiftErr, double angleErr)
align::Alignables DTBarrel()
const SurveyDet * survey() const
Return survey info.
const RotationType & globalRotation() const
Return the global orientation of the object.
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
const align::ErrorMatrix & errors() const
void copySurveyToAlignment()
std::string theGEMAlignRecordName
static std::string const input
std::string theDTAlignRecordName
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
const align::RotationType & rotation() const
const align::PositionType & position() const
void recursiveCopySurveyToAlignment(Alignable *alignable)
std::string theGEMErrorRecordName
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
align::Alignables CSCEndcaps()
std::string theDTSurveyRecordName
void writeXML(const edm::ParameterSet &iConfig, const DTGeometry *dtGeometryXML, const CSCGeometry *cscGeometryXML, const GEMGeometry *gemGeometryXML)
std::vector< Scalar > Scalars
const DTGeometry * dtGeometry_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
virtual const Alignables & components() const =0
Return vector of all direct components.
std::string theCSCSurveyErrorRecordName
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
Set the alignment position error - if (!propagateDown) do not affect daughters.
AlignableMuon * theAlignableMuon
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
GlobalErrorBaseExtended< double, ErrorMatrixTag > GlobalErrorExtended
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
std::string theCSCSurveyRecordName
std::string theDTSurveyErrorRecordName
void fillGapsInSurvey(double shiftErr, double angleErr)
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
void recursiveList(const align::Alignables &alignables, align::Alignables &theList)
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
std::vector< AlignTransformErrorExtended > m_alignError
void setSurvey(const SurveyDet *)
Set survey info.
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
Alignments * gemAlignments()
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
void moveAlignableLocalCoord(DetId &, align::Scalars &, align::Scalars &)
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
AlignmentErrorsExtended * gemAlignmentErrorsExtended()
std::vector< Alignable * > Alignables
align::Alignables GEMEndcaps()
void moveAlignableGlobalCoord(DetId &, align::Scalars &, align::Scalars &)
std::string theCSCAlignRecordName
void write(AlignableMuon *alignableMuon) const
const GEMGeometry * gemGeometry_
cond::Time_t currentTime() const
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
TkRotation transposed() const
void recursiveMap(const align::Alignables &alignables, std::map< align::ID, Alignable * > &theMap)
std::string theDTErrorRecordName
void recursiveStructureMap(const align::Alignables &alignables, std::map< std::pair< align::StructureType, align::ID >, Alignable * > &theMap)
const PositionType & globalPosition() const
Return the global position of the object.
math::Error< 6 >::type ErrorMatrix
const CSCGeometry * cscGeometry_
AlignableDetOrUnitPtr alignableFromDetId(const DetId &detid)
Returns AlignableDetOrUnitPtr corresponding to given DetId.
MuonAlignment(const DTGeometry *dtGeometry, const CSCGeometry *cscGeometry, const GEMGeometry *gemGeometry)