64 void add(
float w,
float x,
float r) {
114 bool handled =
false;
120 }
else if (
x >
i->y) {
122 }
else if (x < i->
x) {
126 }
else if (
y >
i->y) {
148 for (
auto &itvl : m_coverage) {
155 auto i = m_coverage.begin();
156 while (
i != m_coverage.end()) {
159 if (
j != m_coverage.end()) {
160 if (
j->x -
i->y >
eps) {
173 auto i = m_coverage.begin();
174 while (
i != m_coverage.end()) {
177 if (
j != m_coverage.end()) {
178 ostr <<
"(" <<
i->y <<
", " <<
j->x <<
")->" <<
j->x -
i->y;
190 float r =
gp.perp2(),
z =
gp.z();
201 float half_length,
dz;
206 std::array<const float, 4>
const &par =
b2->parameters();
215 half_length = par[3];
219 printf(
"TRAP 0x%x %f %f %f %f ", detid.
rawId(), par[0], par[1], par[2], par[3]);
223 float dx =
b2->width() * 0.5;
224 float dy =
b2->length() * 0.5;
234 dz =
b2->thickness() * 0.5;
237 printf(
"RECT 0x%x %f %f %f ", detid.
rawId(),
dx,
dy,
dz);
240 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported Bounds class";
251 printf(
" subdet=%d layer=%d side=%d is_stereo=%d --> mkflayer=%d\n",
261 (*lgc_map)[lay].reset_current();
263 float zbox_min = 1000, zbox_max = 0, rbox_min = 1000, rbox_max = 0;
264 for (
int i = 0;
i < 4; ++
i) {
271 findRZBox(gp1, rbox_min, rbox_max, zbox_min, zbox_max);
272 findRZBox(gp2, rbox_min, rbox_max, zbox_min, zbox_max);
274 (*lgc_map)[lay].extend_current(gp1.
perp2());
275 (*lgc_map)[lay].extend_current(gp2.
perp2());
279 (*lgc_map)[lay].add_current();
285 layer_info.register_module(
286 {{
p.x(),
p.y(),
p.z()}, {
z.x(),
z.y(),
z.z()}, {
x.x(),
x.y(),
x.z()}, half_length, detid.
rawId()});
288 layer_info.set_subdet(detid.
subdetId());
289 layer_info.set_is_pixel(detid.
subdetId() <= 2);
292 bool doubleSide =
false;
310 for (
int i = std::floor(zbox_min / iBin);
i <
std::ceil(zbox_max / iBin);
i++) {
311 for (
int j = std::floor(rbox_min / jBin);
j <
std::ceil(rbox_max / jBin);
j++) {
312 const float iF =
i * iBin;
313 const float jF =
j * jBin;
317 material_histogram(
i,
j).add(
overlap, bbxi, radL);
336 printf(
"\n*** addPixBGeometry\n\n");
345 printf(
"\n*** addPixEGeometry\n\n");
354 printf(
"\n*** addTIBGeometry\n\n");
363 printf(
"\n*** addTOBGeometry\n\n");
372 printf(
"\n*** addTIDGeometry\n\n");
381 printf(
"\n*** addTECGeometry\n\n");
389 std::ostringstream ostr;
390 ostr <<
"addTECGeometry() gap report:\n";
392 for (
auto &[
layer, gcol] : lgc_map) {
393 gcol.sqrt_elements();
394 if (gcol.find_gap(itvl, 0.5)) {
395 ostr <<
" layer: " <<
layer <<
", gap: " << itvl.
x <<
" -> " << itvl.
y <<
" width = " << itvl.
y - itvl.
x <<
"\n";
396 ostr <<
" all gaps: ";
397 gcol.print_gaps(ostr);
431 for (
int im = 0; im < trk_info.
n_layers(); ++im) {
446 for (
int j = rin;
j < rout;
j++) {
448 float distancesqmin = 100000;
450 for (
int j2 = rin; j2 < rout; j2++) {
451 if (
j == j2 &&
i ==
i2)
453 auto mydistsq = (
i -
i2) * (
i -
i2) + (
j - j2) * (
j - j2);
455 distancesqmin = mydistsq;
456 zneighbor_map(
i,
j) =
i2;
457 rneighbor_map(
i,
j) = j2;
465 for (
int j = rin;
j < rout;
j++) {
467 int iN = zneighbor_map(
i,
j);
468 int jN = rneighbor_map(
i,
j);
480 const float phase1QBins[] = {
482 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,
484 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,
486 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
488 const float phase2QBins[] = {
491 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,
493 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,
495 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
502 auto trackerInfo = std::make_unique<mkfit::TrackerInfo>();
507 const float *qBinDefaults =
nullptr;
511 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseI geometry";
512 trackerInfo->create_layers(18, 27, 27);
513 qBinDefaults = phase1QBins;
515 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
518 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseII geometry";
520 trackerInfo->create_layers(16, 22, 22);
521 qBinDefaults = phase2QBins;
522 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
524 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported / unknowen geometry version";
528 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
529 auto &li = trackerInfo->layer_nc(
i);
532 li.reserve_modules(256);
535 MaterialHistogram material_histogram(trackerInfo->mat_nbins_z(), trackerInfo->mat_nbins_r());
546 unsigned int n_mod = 0;
547 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
548 auto &li = trackerInfo->layer_nc(
i);
550 li.set_propagate_to(li.is_barrel() ? li.r_mean() : li.z_mean());
551 li.set_q_bin(qBinDefaults[
i]);
552 unsigned int maxsid = li.shrink_modules();
557 assert(maxsid < 1u << 13);
567 using namespace mkfit;
584 printf(
"Total number of modules %u, 14-bits fit up to %u modules\n", n_mod, 1u << 13);
587 return std::make_unique<MkFitGeometry>(iRecord.
get(
geomToken_),
const DetContainer & detsTIB() const
Log< level::Info, true > LogVerbatim
constexpr int32_t ceil(float num)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
bool tibIsDoubleSide(const DetId &id) const
void extend_limits(float r, float z)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
bool tecIsDoubleSide(const DetId &id) const
bool tidIsDoubleSide(const DetId &id) const
bool find_gap(Interval &itvl, float eps)
void addTIDGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
void set_r_hole_range(float rh1, float rh2)
void addTOBGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
const DetContainer & detsPXB() const
void addTECGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
PropagationFlags forward_fit_pflags
void fillLayers(mkfit::TrackerInfo &trk_info)
void addPixBGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
uint32_t cc[maxCellsPerHit]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > trackerToken_
PropagationFlags backward_fit_pflags
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)
void swap(Association< C > &lhs, Association< C > &rhs)
bool tobIsDoubleSide(const DetId &id) const
constexpr bool useMatched
unsigned int layer(const DetId &id) const
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
void extend_current(float q)
PropagationFlags finding_inter_layer_pflags
Basic3DVector< T > x() const
float material_radl(int binZ, int binR) const
const DetContainer & detsTOB() const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
const TrackerGeometry * trackerGeom_
bool isThere(GeomDetEnumerators::SubDetector subdet) const
int mat_bin_z(float z) const
float mat_range_z() const
Basic3DVector< T > z() const
Abs< T >::type abs(const T &t)
void considerPoint(const GlobalPoint &gp, mkfit::LayerInfo &lay_info)
PropagationFlags seed_fit_pflags
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void fillShapeAndPlacement(const GeomDet *det, mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram, layer_gap_map_t *lgc_map=nullptr)
void addTIBGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
PropagationFlags pca_prop_pflags
bool finding_requires_propagation_to_hit_pos
DetId geographicalId() const
The label of this GeomDet.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
float mat_range_r() const
int mat_bin_r(float r) const
void add(float w, float x, float r)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const LayerInfo & layer(int l) const
Log< level::Info, false > LogInfo
void aggregateMaterialInfo(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
const Plane & surface() const
The nominal surface of the GeomDet.
constexpr uint32_t rawId() const
get the raw id
float material_bbxi(int binZ, int binR) const
void findRZBox(const GlobalPoint &gp, float &rmin, float &rmax, float &zmin, float &zmax)
const Surface::PositionType & position() const
The position (origin of the R.F.)
mkfit::LayerNumberConverter layerNrConv_
void apply_tracker_info(const TrackerInfo *ti)
void addPixEGeometry(mkfit::TrackerInfo &trk_info, MaterialHistogram &material_histogram)
PropagationFlags finding_intra_layer_pflags
std::unique_ptr< MkFitGeometry > produce(const TrackerRecoGeometryRecord &iRecord)
void reset(TkLayout layout)
const DetContainer & detsTEC() const
constexpr bool usePropToPlane
const MediumProperties & mediumProperties() 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
const DetContainer & detsTID() const
std::unordered_map< int, GapCollector > layer_gap_map_t