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();
206 std::array<const float, 4>
const &par =
b2->parameters();
218 printf(
"TRAP 0x%x %f %f %f %f ", detid.
rawId(), par[0], par[1], par[2], par[3]);
222 float dx =
b2->width() * 0.5;
223 float dy =
b2->length() * 0.5;
232 dz =
b2->thickness() * 0.5;
235 printf(
"RECT 0x%x %f %f %f ", detid.
rawId(),
dx,
dy,
dz);
238 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported Bounds class";
249 printf(
" subdet=%d layer=%d side=%d is_stereo=%d --> mkflayer=%d\n",
259 (*lgc_map)[lay].reset_current();
261 float zbox_min = 1000, zbox_max = 0, rbox_min = 1000, rbox_max = 0;
262 for (
int i = 0;
i < 4; ++
i) {
269 findRZBox(gp1, rbox_min, rbox_max, zbox_min, zbox_max);
270 findRZBox(gp2, rbox_min, rbox_max, zbox_min, zbox_max);
272 (*lgc_map)[lay].extend_current(gp1.
perp2());
273 (*lgc_map)[lay].extend_current(gp2.
perp2());
277 (*lgc_map)[lay].add_current();
283 layer_info.register_module({{
p.x(),
p.y(),
p.z()}, {
z.x(),
z.y(),
z.z()}, {
x.x(),
x.y(),
x.z()}, detid.
rawId()});
285 layer_info.set_subdet(detid.
subdetId());
286 layer_info.set_is_pixel(detid.
subdetId() <= 2);
289 bool doubleSide =
false;
307 for (
int i = std::floor(zbox_min / iBin);
i <
std::ceil(zbox_max / iBin);
i++) {
308 for (
int j = std::floor(rbox_min / jBin);
j <
std::ceil(rbox_max / jBin);
j++) {
309 const float iF =
i * iBin;
310 const float jF =
j * jBin;
314 material_histogram(
i,
j).add(
overlap, bbxi, radL);
333 printf(
"\n*** addPixBGeometry\n\n");
342 printf(
"\n*** addPixEGeometry\n\n");
351 printf(
"\n*** addTIBGeometry\n\n");
360 printf(
"\n*** addTOBGeometry\n\n");
369 printf(
"\n*** addTIDGeometry\n\n");
378 printf(
"\n*** addTECGeometry\n\n");
386 std::ostringstream ostr;
387 ostr <<
"addTECGeometry() gap report:\n";
389 for (
auto &[
layer, gcol] : lgc_map) {
390 gcol.sqrt_elements();
391 if (gcol.find_gap(itvl, 0.5)) {
392 ostr <<
" layer: " <<
layer <<
", gap: " << itvl.
x <<
" -> " << itvl.
y <<
" width = " << itvl.
y - itvl.
x <<
"\n";
393 ostr <<
" all gaps: ";
394 gcol.print_gaps(ostr);
428 for (
int im = 0; im < trk_info.
n_layers(); ++im) {
443 for (
int j = rin;
j < rout;
j++) {
445 float distancesqmin = 100000;
447 for (
int j2 = rin; j2 < rout; j2++) {
448 if (
j == j2 &&
i ==
i2)
450 auto mydistsq = (
i -
i2) * (
i -
i2) + (
j - j2) * (
j - j2);
452 distancesqmin = mydistsq;
453 zneighbor_map(
i,
j) =
i2;
454 rneighbor_map(
i,
j) = j2;
462 for (
int j = rin;
j < rout;
j++) {
464 int iN = zneighbor_map(
i,
j);
465 int jN = rneighbor_map(
i,
j);
477 const float phase1QBins[] = {
479 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,
481 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,
483 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
485 const float phase2QBins[] = {
488 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,
490 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,
492 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
499 auto trackerInfo = std::make_unique<mkfit::TrackerInfo>();
504 const float *qBinDefaults =
nullptr;
508 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseI geometry";
509 trackerInfo->create_layers(18, 27, 27);
510 qBinDefaults = phase1QBins;
512 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
515 edm::LogInfo(
"MkFitGeometryESProducer") <<
"Extracting PhaseII geometry";
517 trackerInfo->create_layers(16, 22, 22);
518 qBinDefaults = phase2QBins;
519 trackerInfo->create_material(300, 300.0
f, 120, 120.0
f);
521 throw cms::Exception(
"UnimplementedFeature") <<
"unsupported / unknowen geometry version";
525 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
526 auto &li = trackerInfo->layer_nc(
i);
529 li.reserve_modules(256);
532 MaterialHistogram material_histogram(trackerInfo->mat_nbins_z(), trackerInfo->mat_nbins_r());
543 unsigned int n_mod = 0;
544 for (
int i = 0;
i < trackerInfo->n_layers(); ++
i) {
545 auto &li = trackerInfo->layer_nc(
i);
547 li.set_propagate_to(li.is_barrel() ? li.r_mean() : li.z_mean());
548 li.set_q_bin(qBinDefaults[
i]);
549 unsigned int maxsid = li.shrink_modules();
554 assert(maxsid < 1u << 13);
564 using namespace mkfit;
578 printf(
"Total number of modules %u, 14-bits fit up to %u modules\n", n_mod, 1u << 13);
581 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)
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
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
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
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