101 }
else if (
x >
i->y) {
103 }
else if (x < i->
x) {
107 }
else if (
y >
i->y) {
129 for (
auto &itvl : m_coverage) {
136 auto i = m_coverage.begin();
137 while (
i != m_coverage.end()) {
140 if (
j != m_coverage.end()) {
141 if (
j->x -
i->y >
eps) {
154 auto i = m_coverage.begin();
155 while (
i != m_coverage.end()) {
158 if (
j != m_coverage.end()) {
159 ostr <<
"(" <<
i->y <<
", " <<
j->x <<
")->" <<
j->x -
i->y;
171 float r =
gp.perp2(),
z =
gp.z();
186 std::array<const float, 4>
const &par =
b2->parameters();
198 printf(
"TRAP 0x%x %f %f %f %f ", detid.
rawId(), par[0], par[1], par[2], par[3]);
202 float dx =
b2->width() * 0.5;
203 float dy =
b2->length() * 0.5;
212 dz =
b2->thickness() * 0.5;
215 printf(
"RECT 0x%x %f %f %f ", detid.
rawId(),
dx,
dy,
dz);
218 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported Bounds class";
229 printf(
" subdet=%d layer=%d side=%d is_stereo=%d --> mkflayer=%d\n",
239 (*lgc_map)[lay].reset_current();
241 for (
int i = 0;
i < 4; ++
i) {
249 (*lgc_map)[lay].extend_current(gp1.
perp2());
250 (*lgc_map)[lay].extend_current(gp2.
perp2());
254 (*lgc_map)[lay].add_current();
260 layer_info.register_module({{
p.x(),
p.y(),
p.z()}, {
z.x(),
z.y(),
z.z()}, {
x.x(),
x.y(),
x.z()}, detid.
rawId()});
262 layer_info.set_subdet(detid.
subdetId());
263 layer_info.set_is_pixel(detid.
subdetId() <= 2);
280 printf(
"\n*** addPixBGeometry\n\n");
289 printf(
"\n*** addPixEGeometry\n\n");
298 printf(
"\n*** addTIBGeometry\n\n");
307 printf(
"\n*** addTOBGeometry\n\n");
316 printf(
"\n*** addTIDGeometry\n\n");
325 printf(
"\n*** addTECGeometry\n\n");
333 std::ostringstream ostr;
334 ostr <<
"addTECGeometry() gap report:\n";
336 for (
auto &[
layer, gcol] : lgc_map) {
337 gcol.sqrt_elements();
338 if (gcol.find_gap(itvl, 0.5)) {
339 ostr <<
" layer: " <<
layer <<
", gap: " << itvl.
x <<
" -> " << itvl.
y <<
" width = " << itvl.
y - itvl.
x <<
"\n";
340 ostr <<
" all gaps: ";
341 gcol.print_gaps(ostr);
352 const float phase1QBins[] = {
354 2.0, 2.0, 2.0, 2.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5,
356 1.0, 1.0, 1.0, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5,
358 1.0, 1.0, 1.0, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5, 10.25, 7.5
360 const float phase2QBins[] = {
363 2.0, 2.0, 2.0, 2.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0,
365 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6,
367 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6, 5.6
374 auto trackerInfo = std::make_unique<mkfit::TrackerInfo>();
379 const float *qBinDefaults =
nullptr;
383 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseI geometry";
384 trackerInfo->create_layers(18, 27, 27);
385 qBinDefaults = phase1QBins;
388 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseII geometry";
390 trackerInfo->create_layers(16, 22, 22);
391 qBinDefaults = phase2QBins;
393 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported / unknowen geometry version";
397 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
398 auto &li = trackerInfo->layer_nc(
i);
401 li.reserve_modules(256);
412 unsigned int n_mod = 0;
413 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
414 auto &li = trackerInfo->layer_nc(
i);
416 li.set_propagate_to(li.is_barrel() ? li.r_mean() : li.z_mean());
417 li.set_q_bin(qBinDefaults[
i]);
418 unsigned int maxsid = li.shrink_modules();
423 assert(maxsid < 1u << 13);
427 printf(
"Total number of modules %u, 14-bits fit up to %u modules\n", n_mod, 1u << 13);
430 return std::make_unique<MkFitGeometry>(iRecord.
get(
geomToken_),
const DetContainer & detsTIB() const
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void extend_limits(float r, float z)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
bool find_gap(Interval &itvl, float eps)
void addPixBGeometry(mkfit::TrackerInfo &trk_info)
void set_r_hole_range(float rh1, float rh2)
const DetContainer & detsPXB() const
void addTOBGeometry(mkfit::TrackerInfo &trk_info)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > trackerToken_
const DetContainer & detsPXF() const
bool isStereo(const DetId &id) const
const TrackerTopology * trackerTopo_
void print_gaps(std::ostream &ostr)
unsigned int side(const DetId &id) const
void add_interval(float x, float y)
MkFitGeometryESProducer(const edm::ParameterSet &iConfig)
std::list< Interval > m_coverage
LayerInfo & layer_nc(int l)
constexpr bool useMatched
unsigned int layer(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
void extend_current(float q)
Basic3DVector< T > x() const
const DetContainer & detsTOB() const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
const TrackerGeometry * trackerGeom_
bool isThere(GeomDetEnumerators::SubDetector subdet) const
void addTIDGeometry(mkfit::TrackerInfo &trk_info)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Basic3DVector< T > z() const
void considerPoint(const GlobalPoint &gp, mkfit::LayerInfo &lay_info)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
DetId geographicalId() const
The label of this GeomDet.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Log< level::Info, false > LogInfo
void fillShapeAndPlacement(const GeomDet *det, mkfit::TrackerInfo &trk_info, layer_gap_map_t *lgc_map=nullptr)
const Plane & surface() const
The nominal surface of the GeomDet.
constexpr uint32_t rawId() const
get the raw id
const Surface::PositionType & position() const
The position (origin of the R.F.)
void addPixEGeometry(mkfit::TrackerInfo &trk_info)
mkfit::LayerNumberConverter layerNrConv_
std::unique_ptr< MkFitGeometry > produce(const TrackerRecoGeometryRecord &iRecord)
void reset(TkLayout layout)
const DetContainer & detsTEC() const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const
void addTIBGeometry(mkfit::TrackerInfo &trk_info)
const DetContainer & detsTID() const
void addTECGeometry(mkfit::TrackerInfo &trk_info)
std::unordered_map< int, GapCollector > layer_gap_map_t