8 #include "LayerNumberConverter.h"
9 #include "TrackerInfo.h"
10 #include "mkFit/IterationConfig.h"
21 std::unique_ptr<mkfit::TrackerInfo> trackerInfo,
22 std::unique_ptr<mkfit::IterationsInfo> iterationsInfo)
26 iterationsInfo_(
std::move(iterationsInfo)) {
29 throw cms::Exception(
"Assert") <<
"For now this code works only with phase1 tracker, you have something else";
33 dets_.resize(lnc_->nLayers(),
nullptr);
34 auto setDet = [
this](
const int subdet,
const int layer,
const int isStereo,
const DetId& detId,
const DetLayer* lay) {
35 const int index = lnc_->convertLayerNumber(subdet,
layer,
false, isStereo, isPlusSide(*ttopo_, detId));
36 if (
index < 0
or static_cast<unsigned>(
index) >= dets_.size()) {
37 throw cms::Exception(
"LogicError") <<
"Invalid mkFit layer index " <<
index <<
" for DetId " << detId.rawId()
38 <<
" subdet " << subdet <<
" layer " <<
layer <<
" isStereo " << isStereo;
42 constexpr
int monoLayer = 0;
43 constexpr
int stereoLayer = 1;
45 const auto&
comp = lay->basicComponents();
47 throw cms::Exception(
"LogicError") <<
"Got a tracker layer (subdet " << lay->subDetector()
48 <<
") with empty basicComponents.";
51 const auto& detId =
comp.front()->geographicalId();
52 const auto subdet = detId.subdetId();
53 const auto layer = ttopo.layer(detId);
56 setDet(subdet,
layer, monoLayer, detId, lay);
59 setDet(subdet,
layer, stereoLayer, detId, lay);
64 detIdToShortId_.resize(lnc_->nLayers());
65 for (
const auto& detId :
geom.detIds()) {
66 const auto ilay = mkFitLayerNumber(detId);
67 auto&
map = detIdToShortId_[ilay];
68 const unsigned int ind =
map.size();
70 assert(ind < (
int)1 << 11);
71 map[detId.rawId()] = ind;
80 return lnc_->convertLayerNumber(