18 auto n_zones =
model.zones_.size();
20 for (
unsigned int zone_id = 0; zone_id < n_zones; ++zone_id) {
21 unsigned int zone_mask = (1u << zone_id);
22 unsigned int tzone_mask = (1u << 0);
24 const auto& model_hm =
model.zones_[zone_id].hitmap;
25 auto& hitmap = zone_hitmaps.emplace_back();
26 bool hitmap_is_blank =
true;
28 auto n_rows = model_hm.size();
30 for (
unsigned int row_id = 0; row_id < n_rows; ++row_id) {
32 const auto& model_hm_row = model_hm[row_id];
33 auto& row = hitmap[row_id];
36 for (
const auto& model_hm_site : model_hm_row) {
38 for (
const auto& model_hm_chamber : model_hm_site.chambers) {
43 const auto& seg = segments[seg_id];
51 if ((seg.zones & zone_mask) != zone_mask) {
55 <<
"Hitmap Segment not in zone: " 56 <<
" zone " << zone_id <<
" row " << row_id <<
" seg_id " << seg_id <<
" seg_phi " << seg.phi
57 <<
" seg_zones " << seg.zones <<
" seg_tzones " << seg.tzones << std::endl;
64 if ((seg.tzones & tzone_mask) != tzone_mask) {
68 <<
"Hitmap Segment not in timezone: " 69 <<
" zone " << zone_id <<
" row " << row_id <<
" seg_id " << seg_id <<
" seg_phi " << seg.phi
70 <<
" seg_zones " << seg.zones <<
" seg_tzones " << seg.tzones << std::endl;
82 edm::LogInfo(
"L1TEMTFpp") <<
"Hitmap Segment Before Assert" 83 <<
" zone " << zone_id <<
" row " << row_id <<
" col " << col_id <<
" seg_id " 84 << seg_id <<
" seg_phi " << seg.phi <<
" seg_zones " << seg.zones
85 <<
" seg_tzones " << seg.tzones <<
" ch_col_begin " << model_hm_chamber.begin
86 <<
" ch_col_end " << model_hm_chamber.end << std::endl;
89 emtf_assert(model_hm_chamber.begin <= col_id && col_id < model_hm_chamber.end);
97 edm::LogInfo(
"L1TEMTFpp") <<
"Hitmap Segment out of bounds: " 98 <<
" zone " << zone_id <<
" row " << row_id <<
" col " << col_id <<
" seg_id " 99 << seg_id <<
" seg_phi " << seg.phi <<
" seg_zones " << seg.zones
100 <<
" seg_tzones " << seg.tzones << std::endl;
116 <<
" zone " << zone_id <<
" row " << row_id <<
" col " << col_id <<
" seg_id " 117 << seg_id <<
" seg_phi " << seg.phi <<
" seg_zones " << seg.zones
118 <<
" seg_tzones " << seg.tzones << std::endl;
127 if (hitmap_is_blank && row != 0) {
128 hitmap_is_blank =
false;
135 if (hitmap_is_blank) {
141 edm::LogInfo(
"L1TEMTFpp") <<
"Zone " << zone_id <<
" Image" << std::endl;
144 for (
int row_id = (model_hm.size() - 1); 0 <= row_id; --row_id) {
145 const auto& row = hitmap[row_id];
151 pixel_mask = pixel_mask << col_id;
153 bool is_present = (row & pixel_mask) == pixel_mask;
HitmapLayer(const EMTFContext &)
const EMTFContext & context_
constexpr int kHitmapNCols
void apply(const segment_collection_t &, std::vector< hitmap_t > &) const
constexpr int kHitmapCropColStart
Log< level::Info, false > LogInfo
constexpr int kChamberSegments
constexpr int kHitmapColFactorLog2
ap_uint< v3::kHitmapNCols > hitmap_row_t
constexpr int kHitmapCropColStop
EMTFConfiguration config_
std::array< segment_t, v3::kNumSegments > segment_collection_t