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()) {
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()) {
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()) {
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 " 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="")
const DetContainer & detsTOB() const
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