37 edm::LogWarning(
"HGCalTriggerGeometry") <<
"WARNING: This HGCal trigger geometry is incomplete.\n"\
38 <<
"WARNING: Only the EE part is covered.\n"\
39 <<
"WARNING: There is no neighbor information.\n";
43 if(!l1tCellsMappingStream.is_open())
edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TCellsMapping file\n";
48 short triggercell = 0;
49 for(; l1tCellsMappingStream>>layer>>subsector>>cell>>module>>triggercell; )
51 if(layer>30 || layer<=0)
53 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Bad layer index in L1TCellsMapping\n";
58 for(
unsigned z=0;
z<=1;
z++)
60 int zside = (
z==0 ? -1 : 1);
61 for(
unsigned sector=1; sector<=18; sector++)
68 if(!ret.second)
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Duplicate cell in L1TCellsMapping\n";
75 if(!l1tCellsMappingStream.eof())
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Error reading L1TCellsMapping'"<<layer<<
" "<<cell<<
" "<<triggercell<<
" "<<subsector<<
"' \n";
76 l1tCellsMappingStream.close();
81 std::map<unsigned, list_cells> trigger_cells_to_cells;
84 unsigned cell = cell_triggercell.first;
85 unsigned triggercell = cell_triggercell.second;
86 trigger_cells_to_cells.insert( std::make_pair(triggercell, list_cells()) );
87 trigger_cells_to_cells.at(triggercell).insert(cell);
89 for(
const auto& triggercell_cells : trigger_cells_to_cells)
91 unsigned triggercellId = triggercell_cells.first;
92 list_cells cellIds = triggercell_cells.second;
95 for(
const auto& cell : cellIds)
98 triggercellVector += esInfo.geom_ee->getPosition(cellId).basicVector();
100 GlobalPoint triggercellPoint( triggercellVector/cellIds.size() );
105 std::unique_ptr<const HGCalTriggerGeometry::TriggerCell> triggercellPtr(
new HGCalTriggerGeometry::TriggerCell(triggercellId, moduleId, triggercellPoint, list_cells(), cellIds));
113 std::map<unsigned, list_triggercells> modules_to_trigger_cells;
116 unsigned triggercell = triggercell_module.first;
117 unsigned module = triggercell_module.second;
118 modules_to_trigger_cells.insert( std::make_pair(module, list_triggercells()) );
119 modules_to_trigger_cells.at(module).insert(triggercell);
121 for(
const auto& module_triggercell : modules_to_trigger_cells)
123 unsigned moduleId = module_triggercell.first;
124 list_triggercells triggercellIds = module_triggercell.second;
125 tc_map_to_cells cellsInTriggerCells;
128 for(
const auto& triggercell : triggercellIds)
130 const auto& cells_in_tc = trigger_cells_to_cells[triggercell];
131 for(
const unsigned cell : cells_in_tc ) {
132 cellsInTriggerCells.emplace(triggercell,cell);
134 moduleVector +=
trigger_cells_.at(triggercell)->position().basicVector();
136 GlobalPoint modulePoint( moduleVector/triggercellIds.size() );
138 std::unique_ptr<const HGCalTriggerGeometry::Module> modulePtr(
new HGCalTriggerGeometry::Module(moduleId, modulePoint, list_triggercells(), triggercellIds, cellsInTriggerCells));
std::unordered_set< unsigned > list_type
geom_map cells_to_trigger_cells_
std::unordered_multimap< unsigned, unsigned > tc_map_type
static const uint32_t UndefinedCell()
geom_map trigger_cells_to_modules_
edm::FileInPath l1tCellsMapping_
trigger_cell_map trigger_cells_
std::string fullPath() const
std::unordered_set< unsigned > list_type