File indexing completed on 2024-08-13 05:00:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016
0017
0018 #include "Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h"
0019 #include "CondFormats/AlignmentRecord/interface/DTAlignmentRcd.h"
0020 #include "CondFormats/AlignmentRecord/interface/DTAlignmentErrorExtendedRcd.h"
0021 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentRcd.h"
0022 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentErrorExtendedRcd.h"
0023 #include "CondFormats/AlignmentRecord/interface/GEMAlignmentRcd.h"
0024 #include "CondFormats/AlignmentRecord/interface/GEMAlignmentErrorExtendedRcd.h"
0025 #include "Geometry/GeometryAligner/interface/GeometryAligner.h"
0026 #include "CondFormats/Alignment/interface/DetectorGlobalPosition.h"
0027 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0028 #include "Geometry/GEMGeometry/interface/GEMGeometry.h"
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 MuonAlignmentInputDB::MuonAlignmentInputDB(const DTGeometry* dtGeometry,
0041 const CSCGeometry* cscGeometry,
0042 const GEMGeometry* gemGeometry,
0043 const Alignments* dtAlignments,
0044 const Alignments* cscAlignments,
0045 const Alignments* gemAlignments,
0046 const Alignments* globalPositionRcd)
0047 : dtGeometry_(dtGeometry),
0048 cscGeometry_(cscGeometry),
0049 gemGeometry_(gemGeometry),
0050 dtAlignments_(dtAlignments),
0051 cscAlignments_(cscAlignments),
0052 gemAlignments_(gemAlignments),
0053 globalPositionRcd_(globalPositionRcd),
0054 m_getAPEs(false) {}
0055 MuonAlignmentInputDB::MuonAlignmentInputDB(const DTGeometry* dtGeometry,
0056 const CSCGeometry* cscGeometry,
0057 const GEMGeometry* gemGeometry,
0058 const Alignments* dtAlignments,
0059 const Alignments* cscAlignments,
0060 const Alignments* gemAlignments,
0061 const AlignmentErrorsExtended* dtAlignmentErrorsExtended,
0062 const AlignmentErrorsExtended* cscAlignmentErrorsExtended,
0063 const AlignmentErrorsExtended* gemAlignmentErrorsExtended,
0064 const Alignments* globalPositionRcd)
0065 : dtGeometry_(dtGeometry),
0066 cscGeometry_(cscGeometry),
0067 gemGeometry_(gemGeometry),
0068 dtAlignments_(dtAlignments),
0069 cscAlignments_(cscAlignments),
0070 gemAlignments_(gemAlignments),
0071 dtAlignmentErrorsExtended_(dtAlignmentErrorsExtended),
0072 cscAlignmentErrorsExtended_(cscAlignmentErrorsExtended),
0073 gemAlignmentErrorsExtended_(gemAlignmentErrorsExtended),
0074 globalPositionRcd_(globalPositionRcd),
0075 m_getAPEs(true) {}
0076
0077
0078
0079
0080
0081
0082 MuonAlignmentInputDB::~MuonAlignmentInputDB() {}
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100 AlignableMuon* MuonAlignmentInputDB::newAlignableMuon() const {
0101 if (m_getAPEs) {
0102 GeometryAligner aligner;
0103 aligner.applyAlignments<DTGeometry>(dtGeometry_,
0104 dtAlignments_,
0105 dtAlignmentErrorsExtended_,
0106 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0107 aligner.applyAlignments<CSCGeometry>(cscGeometry_,
0108 cscAlignments_,
0109 cscAlignmentErrorsExtended_,
0110 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0111 aligner.applyAlignments<GEMGeometry>(gemGeometry_,
0112 gemAlignments_,
0113 gemAlignmentErrorsExtended_,
0114 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0115
0116 } else {
0117 AlignmentErrorsExtended dtAlignmentErrorsExtended2, cscAlignmentErrorsExtended2, gemAlignmentErrorsExtended2;
0118
0119 for (std::vector<AlignTransform>::const_iterator i = dtAlignments_->m_align.begin();
0120 i != dtAlignments_->m_align.end();
0121 ++i) {
0122 CLHEP::HepSymMatrix empty_matrix(3, 0);
0123 AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
0124 dtAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
0125 }
0126 for (std::vector<AlignTransform>::const_iterator i = cscAlignments_->m_align.begin();
0127 i != cscAlignments_->m_align.end();
0128 ++i) {
0129 CLHEP::HepSymMatrix empty_matrix(3, 0);
0130 AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
0131 cscAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
0132 }
0133 for (std::vector<AlignTransform>::const_iterator i = gemAlignments_->m_align.begin();
0134 i != gemAlignments_->m_align.end();
0135 ++i) {
0136 CLHEP::HepSymMatrix empty_matrix(3, 0);
0137 AlignTransformErrorExtended empty_error(empty_matrix, i->rawId());
0138 gemAlignmentErrorsExtended2.m_alignError.push_back(empty_error);
0139 }
0140
0141 GeometryAligner aligner;
0142 aligner.applyAlignments<DTGeometry>(dtGeometry_,
0143 dtAlignments_,
0144 &dtAlignmentErrorsExtended2,
0145 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0146 aligner.applyAlignments<CSCGeometry>(cscGeometry_,
0147 cscAlignments_,
0148 &cscAlignmentErrorsExtended2,
0149 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0150 aligner.applyAlignments<GEMGeometry>(gemGeometry_,
0151 gemAlignments_,
0152 &gemAlignmentErrorsExtended2,
0153 align::DetectorGlobalPosition(*globalPositionRcd_, DetId(DetId::Muon)));
0154 }
0155
0156 return new AlignableMuon(dtGeometry_, cscGeometry_, gemGeometry_);
0157 }
0158
0159
0160
0161
0162
0163
0164
0165