26 : trackerGeometry_(trackerGeometry),
27 trackerTopology_(trackerTopology),
28 alignableObjectId_(trackerGeometry, nullptr, nullptr, nullptr),
29 alignableMap_(nullptr),
30 trackerAlignmentLevelBuilder_(trackerTopology, trackerGeometry) {
31 std::ostringstream
ss;
35 ss <<
"RunI geometry";
38 ss <<
"PhaseI geometry";
41 ss <<
"PhaseII geometry";
44 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] unknown version of TrackerGeometry";
47 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::AlignableTrackerBuilder"
48 <<
"GeometryVersion: " <<
ss.str();
108 alignables.reserve(geomDets.size());
114 aliUnits.reserve(geomDets.size());
116 for (
auto& geomDet : geomDets) {
117 int subdetId = geomDet->geographicalId().subdetId();
129 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] GeomDet of unknown subdetector";
140 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::convertGeomDetsToAlignables"
141 <<
"converted GeomDets to Alignables for " <<
moduleName <<
"\n"
142 <<
" GeomDets: " << geomDets.size() <<
"\n"
150 if (!geomDetUnit->
isLeaf()) {
151 throw cms::Exception(
"BadHierarchy") <<
"[AlignableTrackerBuilder] Pixel GeomDet (subdetector " << subdetId
152 <<
") is not a GeomDetUnit.";
156 auto ali = std::find_if(aliDets.cbegin(), aliDets.cend(), [&geomDetUnit](
const auto&
i) {
159 if (ali != aliDets.end()) {
161 auto aliDetUnit = dynamic_cast<AlignableDetUnit*>(*ali);
163 aliDetUnit->update(geomDetUnit);
165 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder::buildPixelDetectorAlignable] "
166 <<
"cast to 'AlignableDetUnit*' failed while it should not\n";
170 <<
"[AlignableTrackerBuilder::buildPixelDetectorAlignable] "
171 <<
"GeomDet with DetId " << geomDetUnit->
geographicalId().
rawId() <<
" not found in current geometry.\n";
175 aliDetUnits.push_back(aliDets.back());
191 if (!detId.glued()) {
194 const GluedGeomDet* gluedGeomDet = dynamic_cast<const GluedGeomDet*>(geomDet);
196 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] dynamic_cast<const GluedGeomDet*> "
202 auto ali = std::find_if(aliDets.cbegin(), aliDets.cend(), [&gluedGeomDet](
const auto&
i) {
205 if (ali != aliDets.end()) {
206 auto aliSiStripDet = dynamic_cast<AlignableSiStripDet*>(*ali);
208 aliSiStripDet->update(gluedGeomDet);
210 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder::buildStripDetectorAlignable] "
211 <<
"cast to 'AlignableSiStripDet*' failed while it should not\n";
215 <<
"[AlignableTrackerBuilder::buildStripDetectorAlignable] "
216 <<
"GeomDet with DetId " << gluedGeomDet->
geographicalId().
rawId() <<
" not found in current geometry.\n";
221 const auto& addAliDetUnits = aliDets.back()->components();
222 const auto& nAddedUnits = addAliDetUnits.size();
226 aliDetUnits.reserve(aliDetUnits.size() + nAddedUnits - 1);
227 aliDetUnits.insert(aliDetUnits.end(), addAliDetUnits.begin(), addAliDetUnits.end());
241 unsigned int numCompositeAlignables = 0;
250 for (
auto& trackerSubLevels : trackerLevels) {
252 for (
auto&
level : trackerSubLevels) {
258 compositeBuilder.clearAlignmentLevels();
261 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildAlignableComposites"
262 <<
"AlignableComposites built for Tracker: " << numCompositeAlignables
263 <<
" (note: without Pixel- and Strip-Alignable)";
278 pixelAlignables[0]->addComponent(pxbAlignables[0]);
279 pixelAlignables[0]->addComponent(pxeAlignables[0]);
280 pixelAlignables[0]->addComponent(pxeAlignables[1]);
284 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildPixelDetector"
285 <<
"Built " << pixelName <<
"-detector Alignable, consisting of Alignables"
286 <<
" of " << pxbName <<
" and " << pxeName;
305 stripAlignables[0]->addComponent(tibAlignables[0]);
306 stripAlignables[0]->addComponent(tidAlignables[0]);
307 stripAlignables[0]->addComponent(tidAlignables[1]);
308 stripAlignables[0]->addComponent(tobAlignables[0]);
309 stripAlignables[0]->addComponent(tecAlignables[0]);
310 stripAlignables[0]->addComponent(tecAlignables[1]);
314 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildStripDetector"
315 <<
"Built " << stripName <<
"-detector Alignable, consisting of Alignables"
316 <<
" of " << tibName <<
", " << tidName <<
", " << tobName <<
" and "