28 : trackerGeometry_(trackerGeometry),
29 trackerTopology_(trackerTopology),
30 alignableObjectId_(trackerGeometry, nullptr, nullptr, nullptr),
31 alignableMap_(nullptr),
32 trackerAlignmentLevelBuilder_(trackerTopology, trackerGeometry) {
33 std::ostringstream
ss;
37 ss <<
"RunI geometry";
40 ss <<
"PhaseI geometry";
43 ss <<
"PhaseII geometry";
46 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] unknown version of TrackerGeometry";
49 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::AlignableTrackerBuilder" 50 <<
"GeometryVersion: " <<
ss.str();
117 alignables.reserve(geomDets.size());
123 aliUnits.reserve(geomDets.size());
125 for (
auto& geomDet : geomDets) {
126 int subdetId = geomDet->geographicalId().subdetId();
143 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] GeomDet of unknown subdetector";
154 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::convertGeomDetsToAlignables" 155 <<
"converted GeomDets to Alignables for " <<
moduleName <<
"\n" 156 <<
" GeomDets: " << geomDets.size() <<
"\n" 164 if (!geomDetUnit->
isLeaf()) {
165 throw cms::Exception(
"BadHierarchy") <<
"[AlignableTrackerBuilder] Pixel GeomDet (subdetector " << subdetId
166 <<
") is not a GeomDetUnit.";
170 auto ali = std::find_if(aliDets.cbegin(), aliDets.cend(), [&geomDetUnit](
const auto&
i) {
173 if (ali != aliDets.end()) {
177 aliDetUnit->
update(geomDetUnit);
179 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder::buildPixelDetectorAlignable] " 180 <<
"cast to 'AlignableDetUnit*' failed while it should not\n";
184 <<
"[AlignableTrackerBuilder::buildPixelDetectorAlignable] " 185 <<
"GeomDet with DetId " << geomDetUnit->
geographicalId().
rawId() <<
" not found in current geometry.\n";
189 aliDetUnits.push_back(aliDets.back());
205 if (!
detId.glued()) {
210 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] dynamic_cast<const GluedGeomDet*> " 216 auto ali = std::find_if(aliDets.cbegin(), aliDets.cend(), [&gluedGeomDet](
const auto&
i) {
219 if (ali != aliDets.end()) {
222 aliSiStripDet->
update(gluedGeomDet);
224 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder::buildStripDetectorAlignable] " 225 <<
"cast to 'AlignableSiStripDet*' failed while it should not\n";
229 <<
"[AlignableTrackerBuilder::buildStripDetectorAlignable] " 230 <<
"GeomDet with DetId " << gluedGeomDet->
geographicalId().
rawId() <<
" not found in current geometry.\n";
235 const auto& addAliDetUnits = aliDets.back()->components();
236 const auto& nAddedUnits = addAliDetUnits.size();
240 aliDetUnits.reserve(aliDetUnits.size() + nAddedUnits - 1);
241 aliDetUnits.insert(aliDetUnits.end(), addAliDetUnits.begin(), addAliDetUnits.end());
261 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder] dynamic_cast<const StackGeomDet*> " 267 auto ali = std::find_if(aliDets.cbegin(), aliDets.cend(), [&stackGeomDet](
const auto&
i) {
270 if (ali != aliDets.end()) {
273 aliStackDet->
update(geomDet);
275 throw cms::Exception(
"LogicError") <<
"[AlignableTrackerBuilder::buildOuterTrackerDetectorAlignable] " 276 <<
"cast to 'AlignableStackDet*' failed while it should not\n";
280 <<
"[AlignableTrackerBuilder::buildStripDetectorAlignable] " 281 <<
"GeomDet with DetId " << stackGeomDet->
geographicalId().
rawId() <<
" not found in current geometry.\n";
286 const auto& addAliDetUnits = aliDets.back()->components();
287 const auto& nAddedUnits = addAliDetUnits.size();
291 aliDetUnits.reserve(aliDetUnits.size() + nAddedUnits - 1);
292 aliDetUnits.insert(aliDetUnits.end(), addAliDetUnits.begin(), addAliDetUnits.end());
301 unsigned int numCompositeAlignables = 0;
310 for (
auto& trackerSubLevels : trackerLevels) {
312 for (
auto&
level : trackerSubLevels) {
318 compositeBuilder.clearAlignmentLevels();
321 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildAlignableComposites" 322 <<
"AlignableComposites built for Tracker: " << numCompositeAlignables
323 <<
" (note: without Pixel- and Strip-Alignable)";
338 pixelAlignables[0]->addComponent(pxbAlignables[0]);
339 pixelAlignables[0]->addComponent(pxeAlignables[0]);
340 pixelAlignables[0]->addComponent(pxeAlignables[1]);
344 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildPixelDetector" 345 <<
"Built " << pixelName <<
"-detector Alignable, consisting of Alignables" 346 <<
" of " << pxbName <<
" and " << pxeName;
365 stripAlignables[0]->addComponent(tibAlignables[0]);
366 stripAlignables[0]->addComponent(tidAlignables[0]);
367 stripAlignables[0]->addComponent(tidAlignables[1]);
368 stripAlignables[0]->addComponent(tobAlignables[0]);
369 stripAlignables[0]->addComponent(tecAlignables[0]);
370 stripAlignables[0]->addComponent(tecAlignables[1]);
374 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildStripDetector" 375 <<
"Built " << stripName <<
"-detector Alignable, consisting of Alignables" 376 <<
" of " << tibName <<
", " << tidName <<
", " << tobName <<
" and " 391 stripAlignables[0]->addComponent(tobAlignables[0]);
392 stripAlignables[0]->addComponent(tidAlignables[0]);
393 stripAlignables[0]->addComponent(tidAlignables[1]);
397 edm::LogInfo(
"AlignableBuildProcess") <<
"@SUB=AlignableTrackerBuilder::buildStripDetector" 398 <<
"Built " << stripName <<
"-detector Alignable, consisting of Alignables" 399 <<
" of " << tidName <<
" and " << tobName;
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
const DetContainer & detsTIB() const
align::Alignables & get(const std::string &name="")
virtual bool isLeaf() const
is a Unit
void buildPixelDetectorAlignable(const GeomDet *, int subdetId, Alignables &aliDets, Alignables &aliDetUnits, bool update=false)
Converts GeomDetUnits of PXB and PXE to AlignableDetUnits.
void addDetUnitInfo(const DetId &detId)
void buildPixelDetector(AlignableTracker *)
Builds the PixelDetector by hand.
const DetContainer & detsPXB() const
static constexpr auto TID
AlignableMap alignableMap_
const DetContainer & detsPXF() const
const Alignables & components() const override
Return vector of direct components.
const TrackerTopology * trackerTopology_
std::vector< align::AlignmentLevels > build()
void update(const GeomDetUnit *geomDetUnit)
std::vector< const GeomDet * > DetContainer
align::Alignables & find(const std::string &name="")
void buildOuterTrackerDetectorAlignable(const GeomDet *, int subdetId, Alignables &aliDets, Alignables &aliDetUnits, bool update=false)
const DetContainer & detsTOB() const
void buildOuterTrackerDetector(AlignableTracker *)
Builds the Phase-2 Outer Tracker Detector by hand.
const AlignableObjectId alignableObjectId_
TrackerAlignmentLevelBuilder trackerAlignmentLevelBuilder_
DetId geographicalId() const
The label of this GeomDet.
static constexpr auto TOB
const align::TrackerNameSpace & trackerNameSpace() const
void buildAlignableDetUnits(bool update=false)
Builds Alignables on module-level for each part of the tracker.
AlignableMap * alignableMap_
align::Alignables Alignables
void buildStripDetector(AlignableTracker *)
Builds the StripDetector by hand.
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
AlignableTrackerBuilder(const TrackerGeometry *, const TrackerTopology *)
const char * idToString(align::StructureType type) const
constexpr uint32_t rawId() const
get the raw id
static constexpr auto TIB
Geometry geometry() const
retrieve the geometry information
void update(const GeomDet *geomDet, bool updateComponents=true)
const DetContainer & detsTEC() const
void buildStripDetectorAlignable(const GeomDet *, int subdetId, Alignables &aliDets, Alignables &aliDetUnits, bool update=false)
void buildAlignables(AlignableTracker *, bool update=false)
void convertGeomDetsToAlignables(const TrackingGeometry::DetContainer &, const std::string &moduleName, bool update=false)
const TrackerGeometry * trackerGeometry_
void buildAlignableComposites(bool update=false)
void addComponent(Alignable *component) final
static constexpr auto TEC
const DetContainer & detsTID() const