120 auto tracker = std::unique_ptr<TrackerGeometry>{trackerBuilder.
build(geometricDet, ptp,
topology)};
123 std::sort(dets.begin(), dets.end(), [](
const auto&
a,
const auto&
b) {
124 return a->geographicalId().rawId() <
b->geographicalId().rawId();
130 if (dets.size() != alignments->m_align.size()) {
131 throw cms::Exception(
"GeometryMismatch") <<
"Size mismatch between alignments (size=" << alignments->m_align.size()
132 <<
") and ideal geometry (size=" << dets.size() <<
")";
137 auto outlierCounter{0};
138 auto ideal = dets.cbegin();
139 const auto& ideal_end = dets.cend();
140 auto misaligned = alignments->
m_align.cbegin();
141 for (; ideal != ideal_end; ++ideal, ++misaligned) {
142 if ((*ideal)->geographicalId().rawId() != misaligned->rawId()) {
143 throw cms::Exception(
"GeometryMismatch") <<
"Order differs between Dets in alignments ideal geometry.";
147 const auto&
subDetId = (*ideal)->geographicalId().subdetId();
171 auto x_diff = misaligned->translation().x() - (*ideal)->position().x();
172 auto y_diff = misaligned->translation().y() - (*ideal)->position().y();
173 auto z_diff = misaligned->translation().z() - (*ideal)->position().z();
175 auto xx_diff = misaligned->rotation().xx() - (*ideal)->rotation().xx();
176 auto xy_diff = misaligned->rotation().xy() - (*ideal)->rotation().xy();
177 auto xz_diff = misaligned->rotation().xz() - (*ideal)->rotation().xz();
178 auto yx_diff = misaligned->rotation().yx() - (*ideal)->rotation().yx();
179 auto yy_diff = misaligned->rotation().yy() - (*ideal)->rotation().yy();
180 auto yz_diff = misaligned->rotation().yz() - (*ideal)->rotation().yz();
181 auto zx_diff = misaligned->rotation().zx() - (*ideal)->rotation().zx();
182 auto zy_diff = misaligned->rotation().zy() - (*ideal)->rotation().zy();
183 auto zz_diff = misaligned->rotation().zz() - (*ideal)->rotation().zz();
189 <<
": delta x: " << x_diff <<
", delta y: " << y_diff <<
", delta z: " << z_diff
190 <<
", delta xx: " << xx_diff <<
", delta xy: " << xy_diff
191 <<
", delta xz: " << xz_diff <<
", delta yx: " << yx_diff
192 <<
", delta yx: " << yy_diff <<
", delta yy: " << yz_diff
193 <<
", delta zz: " << zx_diff <<
", delta zy: " << zy_diff
194 <<
", delta zz: " << zz_diff <<
"\n";
203 CLHEP::HepRep3x3{(*ideal)->rotation().xx() +
scaleFactor * xx_diff,
211 (*ideal)->rotation().zz() +
scaleFactor * zz_diff}};
213 const AlignTransform rescaledTransform{rescaledTranslation, rescaledRotation, misaligned->
rawId()};
214 rescaledAlignments.m_align.emplace_back(rescaledTransform);
220 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
222 edm::LogInfo(
"Alignment") <<
"Writing rescaled tracker-alignment record.";
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_
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
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
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)
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_