36 edm::LogWarning(
"HGCalTriggerGeometry") <<
"WARNING: This HGCal trigger geometry is incomplete.\n" 37 <<
"WARNING: Only the EE part is covered.\n" 38 <<
"WARNING: There is no neighbor information.\n";
49 <<
"HGCalTriggerGeometryImp1 geometry cannot be initialized with the V9 HGCAL geometry";
59 if (!l1tCellsMappingStream.is_open())
60 edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TCellsMapping file\n";
65 short triggercell = 0;
66 for (; l1tCellsMappingStream >> layer >> subsector >> cell >> module >> triggercell;) {
67 if (layer > 30 || layer <= 0) {
68 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Bad layer index in L1TCellsMapping\n";
73 for (
unsigned z = 0;
z <= 1;
z++) {
74 int zside = (
z == 0 ? -1 : 1);
75 for (
unsigned sector = 1; sector <= 18; sector++) {
82 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Duplicate cell in L1TCellsMapping\n";
86 std::make_pair(triggerDetid, moduleDetid));
90 if (!l1tCellsMappingStream.eof())
92 <<
"Error reading L1TCellsMapping'" << layer <<
" " << cell <<
" " << triggercell <<
" " << subsector <<
"' \n";
93 l1tCellsMappingStream.close();
98 std::map<unsigned, list_cells> trigger_cells_to_cells;
100 unsigned cell = cell_triggercell.first;
101 unsigned triggercell = cell_triggercell.second;
102 trigger_cells_to_cells.insert(std::make_pair(triggercell, list_cells()));
103 trigger_cells_to_cells.at(triggercell).insert(cell);
105 for (
const auto& triggercell_cells : trigger_cells_to_cells) {
106 unsigned triggercellId = triggercell_cells.first;
107 list_cells cellIds = triggercell_cells.second;
110 for (
const auto& cell : cellIds) {
114 GlobalPoint triggercellPoint(triggercellVector / cellIds.size());
121 std::unique_ptr<const HGCalTriggerGeometry::TriggerCell> triggercellPtr(
130 std::map<unsigned, list_triggercells> modules_to_trigger_cells;
132 unsigned triggercell = triggercell_module.first;
133 unsigned module = triggercell_module.second;
134 modules_to_trigger_cells.insert(std::make_pair(module, list_triggercells()));
135 modules_to_trigger_cells.at(module).insert(triggercell);
137 for (
const auto& module_triggercell : modules_to_trigger_cells) {
138 unsigned moduleId = module_triggercell.first;
139 list_triggercells triggercellIds = module_triggercell.second;
140 tc_map_to_cells cellsInTriggerCells;
143 for (
const auto& triggercell : triggercellIds) {
144 const auto& cells_in_tc = trigger_cells_to_cells[triggercell];
145 for (
const unsigned cell : cells_in_tc) {
146 cellsInTriggerCells.emplace(triggercell, cell);
148 moduleVector +=
trigger_cells_.at(triggercell)->position().basicVector();
150 GlobalPoint modulePoint(moduleVector / triggercellIds.size());
153 moduleId, modulePoint, list_triggercells(), triggercellIds, cellsInTriggerCells));
std::unordered_set< unsigned > list_type
std::unordered_multimap< unsigned, unsigned > tc_map_type
ret
prodAgent to be discontinued
const HGCalGeometry * eeGeometry() const
GlobalPoint getPosition(const DetId &id) const
void initialize(const CaloGeometry *) final
HGCalTriggerGeometryImp1(const edm::ParameterSet &conf)
geom_map cells_to_trigger_cells_
static const uint32_t UndefinedCell()
void setCaloGeometry(const CaloGeometry *geom)
geom_map trigger_cells_to_modules_
edm::FileInPath l1tCellsMapping_
trigger_cell_map trigger_cells_
std::string fullPath() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
const BasicVectorType & basicVector() const
std::unordered_set< unsigned > list_type