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()) {
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();
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[]
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > aliToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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
ALPAKA_FN_ACC int side(int ieta, int iphi)
bool IsModuleBad(const uint32_t &detid) const
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
const double outlierPullToIdealCut_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
constexpr G4double scaleFactor
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_