125 auto tracker = std::unique_ptr<TrackerGeometry>{trackerBuilder.
build(geometricDet, ptitp, ptp, topology)};
128 std::sort(dets.begin(), dets.end(), [](
const auto&
a,
const auto&
b) {
129 return a->geographicalId().rawId() <
b->geographicalId().rawId();
135 if (dets.size() != alignments->m_align.size()) {
136 throw cms::Exception(
"GeometryMismatch") <<
"Size mismatch between alignments (size=" << alignments->m_align.size()
137 <<
") and ideal geometry (size=" << dets.size() <<
")";
142 auto outlierCounter{0};
143 auto ideal = dets.cbegin();
144 const auto& ideal_end = dets.cend();
145 auto misaligned = alignments->
m_align.cbegin();
146 for (; ideal != ideal_end; ++ideal, ++misaligned) {
147 if ((*ideal)->geographicalId().rawId() != misaligned->rawId()) {
148 throw cms::Exception(
"GeometryMismatch") <<
"Order differs between Dets in alignments ideal geometry.";
152 const auto&
subDetId = (*ideal)->geographicalId().subdetId();
153 auto side = topology->
side((*ideal)->geographicalId());
160 side = topology->
tibSide((*ideal)->geographicalId());
163 side = topology->
tobSide((*ideal)->geographicalId());
176 auto x_diff = misaligned->translation().x() - (*ideal)->position().x();
177 auto y_diff = misaligned->translation().y() - (*ideal)->position().y();
178 auto z_diff = misaligned->translation().z() - (*ideal)->position().z();
180 auto xx_diff = misaligned->rotation().xx() - (*ideal)->rotation().xx();
181 auto xy_diff = misaligned->rotation().xy() - (*ideal)->rotation().xy();
182 auto xz_diff = misaligned->rotation().xz() - (*ideal)->rotation().xz();
183 auto yx_diff = misaligned->rotation().yx() - (*ideal)->rotation().yx();
184 auto yy_diff = misaligned->rotation().yy() - (*ideal)->rotation().yy();
185 auto yz_diff = misaligned->rotation().yz() - (*ideal)->rotation().yz();
186 auto zx_diff = misaligned->rotation().zx() - (*ideal)->rotation().zx();
187 auto zy_diff = misaligned->rotation().zy() - (*ideal)->rotation().zy();
188 auto zz_diff = misaligned->rotation().zz() - (*ideal)->rotation().zz();
194 <<
": delta x: " << x_diff <<
", delta y: " << y_diff <<
", delta z: " << z_diff
195 <<
", delta xx: " << xx_diff <<
", delta xy: " << xy_diff
196 <<
", delta xz: " << xz_diff <<
", delta yx: " << yx_diff
197 <<
", delta yx: " << yy_diff <<
", delta yy: " << yz_diff
198 <<
", delta zz: " << zx_diff <<
", delta zy: " << zy_diff
199 <<
", delta zz: " << zz_diff <<
"\n";
208 CLHEP::HepRep3x3{(*ideal)->rotation().xx() +
scaleFactor * xx_diff,
216 (*ideal)->rotation().zz() +
scaleFactor * zz_diff}};
218 const AlignTransform rescaledTransform{rescaledTranslation, rescaledRotation, misaligned->
rawId()};
219 rescaledAlignments.m_align.emplace_back(rescaledTransform);
225 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
227 edm::LogInfo(
"Alignment") <<
"Writing rescaled tracker-alignment record.";
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_
const TimeTypeSpecs timeTypeSpecs[]
unsigned int tibSide(const DetId &id) const
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > aliToken_
unsigned int tobSide(const DetId &id) const
const edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > pixelQualityToken_
TrackerGeometry * build(const GeometricDet *gd, const PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
constexpr unsigned int subDetId[21]
bool IsModuleBad(uint32_t detid) const
bool IsModuleBad(const uint32_t &detid) const
unsigned int side(const DetId &id) const
std::vector< AlignTransform > m_align
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
const double outlierPullToIdealCut_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
bool getData(T &iHolder) const
static constexpr auto TOB
Log< level::Info, false > LogInfo
static constexpr auto TIB
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const bool pullBadModulesToIdeal_
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_