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();
200 bool doubleSide =
false;
211 float half_length,
dz;
216 std::array<const float, 4>
const &par =
b2->parameters();
225 half_length = par[3];
229 printf(
"TRAP 0x%x %f %f %f %f ", detid.
rawId(), par[0], par[1], par[2], par[3]);
233 float dx =
b2->width() * 0.5;
234 float dy =
b2->length() * 0.5;
244 dz =
b2->thickness() * 0.5;
247 printf(
"RECT 0x%x %f %f %f ", detid.
rawId(),
dx,
dy,
dz);
250 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported Bounds class";
261 printf(
" subdet=%d layer=%d side=%d is_stereo=%d is_double_side=%d --> mkflayer=%d\n",
272 (*lgc_map)[lay].reset_current();
274 float zbox_min = 1000, zbox_max = 0, rbox_min = 1000, rbox_max = 0;
275 for (
int i = 0;
i < 4; ++
i) {
282 findRZBox(gp1, rbox_min, rbox_max, zbox_min, zbox_max);
283 findRZBox(gp2, rbox_min, rbox_max, zbox_min, zbox_max);
285 (*lgc_map)[lay].extend_current(gp1.
perp2());
286 (*lgc_map)[lay].extend_current(gp2.
perp2());
290 (*lgc_map)[lay].add_current();
302 layer_info.register_module(
303 {{
p.x(),
p.y(),
p.z()}, {
z.x(),
z.y(),
z.z()}, {
x.x(),
x.y(),
x.z()}, half_length, detid.
rawId()});
305 layer_info.set_subdet(detid.
subdetId());
306 layer_info.set_is_pixel(detid.
subdetId() <= 2);
309 layer_info.set_has_charge(
false);
319 for (
int i = std::floor(zbox_min / iBin);
i <
std::ceil(zbox_max / iBin);
i++) {
320 for (
int j = std::floor(rbox_min / jBin);
j <
std::ceil(rbox_max / jBin);
j++) {
321 const float iF =
i * iBin;
322 const float jF =
j * jBin;
326 material_histogram(
i,
j).add(
overlap, bbxi, radL);
345 printf(
"\n*** addPixBGeometry\n\n");
354 printf(
"\n*** addPixEGeometry\n\n");
363 printf(
"\n*** addTIBGeometry\n\n");
372 printf(
"\n*** addTOBGeometry\n\n");
381 printf(
"\n*** addTIDGeometry\n\n");
390 printf(
"\n*** addTECGeometry\n\n");
398 std::ostringstream ostr;
399 ostr <<
"addTECGeometry() gap report:\n";
401 for (
auto &[
layer, gcol] : lgc_map) {
402 gcol.sqrt_elements();
403 if (gcol.find_gap(itvl, 0.5)) {
404 ostr <<
" layer: " <<
layer <<
", gap: " << itvl.
x <<
" -> " << itvl.
y <<
" width = " << itvl.
y - itvl.
x <<
"\n";
405 ostr <<
" all gaps: ";
406 gcol.print_gaps(ostr);
440 for (
int im = 0; im < trk_info.
n_layers(); ++im) {
455 for (
int j = rin;
j < rout;
j++) {
457 float distancesqmin = 100000;
459 for (
int j2 = rin; j2 < rout; j2++) {
460 if (
j == j2 &&
i ==
i2)
462 auto mydistsq = (
i -
i2) * (
i -
i2) + (
j - j2) * (
j - j2);
464 distancesqmin = mydistsq;
465 zneighbor_map(
i,
j) =
i2;
466 rneighbor_map(
i,
j) = j2;
474 for (
int j = rin;
j < rout;
j++) {
476 int iN = zneighbor_map(
i,
j);
477 int jN = rneighbor_map(
i,
j);
489 const float phase1QBins[] = {
491 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,
493 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,
495 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
497 const float phase2QBins[] = {
500 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,
502 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,
504 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
511 auto trackerInfo = std::make_unique<mkfit::TrackerInfo>();
516 const float *qBinDefaults =
nullptr;
520 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseI geometry";
521 trackerInfo->create_layers(18, 27, 27);
522 qBinDefaults = phase1QBins;
524 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
527 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseII geometry";
529 trackerInfo->create_layers(16, 22, 22);
530 qBinDefaults = phase2QBins;
531 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
533 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported / unknowen geometry version";
537 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
538 auto &li = trackerInfo->layer_nc(
i);
541 li.reserve_modules(256);
544 MaterialHistogram material_histogram(trackerInfo->mat_nbins_z(), trackerInfo->mat_nbins_r());
556 unsigned int n_mod = 0;
557 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
558 auto &li = trackerInfo->layer_nc(
i);
560 li.set_propagate_to(li.is_barrel() ? li.r_mean() : li.z_mean());
561 li.set_q_bin(qBinDefaults[
i]);
562 unsigned int maxsid = li.shrink_modules();
567 assert(maxsid < 1u << 13);
577 using namespace mkfit;
594 printf(
"Total number of modules %u, 14-bits fit up to %u modules\n", n_mod, 1u << 13);
597 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