28 l1tCellsMapping_(conf.getParameter<
edm::FileInPath>(
"L1TCellsMapping"))
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";
50 <<
"HGCalTriggerGeometryImp1 geometry cannot be initialized with the V9 HGCAL geometry";
61 <<
"HGCalTriggerGeometryImp1 geometry cannot be initialized with the V9 HGCAL+NOSE geometry";
71 if (!l1tCellsMappingStream.is_open())
72 edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TCellsMapping file\n";
77 short triggercell = 0;
78 for (; l1tCellsMappingStream >> layer >> subsector >> cell >>
module >> triggercell;) {
79 if (layer > 30 || layer <= 0) {
80 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Bad layer index in L1TCellsMapping\n";
85 for (
unsigned z = 0;
z <= 1;
z++) {
86 int zside = (
z == 0 ? -1 : 1);
87 for (
unsigned sector = 1; sector <= 18; sector++) {
94 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Duplicate cell in L1TCellsMapping\n";
98 std::make_pair(triggerDetid, moduleDetid));
102 if (!l1tCellsMappingStream.eof())
104 <<
"Error reading L1TCellsMapping'" << layer <<
" " << cell <<
" " << triggercell <<
" " << subsector <<
"' \n";
105 l1tCellsMappingStream.close();
110 std::map<unsigned, list_cells> trigger_cells_to_cells;
112 unsigned cell = cell_triggercell.first;
113 unsigned triggercell = cell_triggercell.second;
114 trigger_cells_to_cells.insert(std::make_pair(triggercell, list_cells()));
115 trigger_cells_to_cells.at(triggercell).insert(cell);
117 for (
const auto& triggercell_cells : trigger_cells_to_cells) {
118 unsigned triggercellId = triggercell_cells.first;
119 list_cells cellIds = triggercell_cells.second;
122 for (
const auto& cell : cellIds) {
126 GlobalPoint triggercellPoint(triggercellVector / cellIds.size());
132 std::unique_ptr<const HGCalTriggerGeometry::TriggerCell> triggercellPtr(
141 std::map<unsigned, list_triggercells> modules_to_trigger_cells;
143 unsigned triggercell = triggercell_module.first;
144 unsigned module = triggercell_module.second;
145 modules_to_trigger_cells.insert(std::make_pair(
module, list_triggercells()));
146 modules_to_trigger_cells.at(
module).insert(triggercell);
148 for (
const auto& module_triggercell : modules_to_trigger_cells) {
149 unsigned moduleId = module_triggercell.first;
150 list_triggercells triggercellIds = module_triggercell.second;
151 tc_map_to_cells cellsInTriggerCells;
154 for (
const auto& triggercell : triggercellIds) {
155 const auto& cells_in_tc = trigger_cells_to_cells[triggercell];
156 for (
const unsigned cell : cells_in_tc) {
157 cellsInTriggerCells.emplace(triggercell, cell);
159 moduleVector +=
trigger_cells_.at(triggercell)->position().basicVector();
161 GlobalPoint modulePoint(moduleVector / triggercellIds.size());
164 moduleId, modulePoint, list_triggercells(), triggercellIds, cellsInTriggerCells));