17 virtual void initialize(
const es_info& )
override final;
18 virtual void reset()
override final;
80 edm::LogWarning(
"HGCalTriggerGeometry") <<
"WARNING: This HGCal trigger geometry is incomplete.\n"\
81 <<
"WARNING: There is no neighbor information.\n";
93 unsigned cell = cell_det_id.
cell();
94 unsigned trigger_cell = 0;
100 catch (
const std::out_of_range&
e) {
102 <<
"HGCalTriggerGeometry: HGCal cell " << cell <<
" is not mapped to any trigger cell for the wafer type " << wafer_type
103 <<
". The trigger cell mapping should be modified.\n";
113 unsigned wafer = cell_det_id.
wafer();
114 unsigned subdet = cell_det_id.
subdetId();
127 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown wafer->module mapping for subdet "<<subdet<<
"\n";
131 catch (
const std::out_of_range&
e) {
133 <<
"HGCalTriggerGeometry: Wafer " << wafer <<
" is not mapped to any trigger module for subdetector " << subdet
134 <<
". The module mapping should be modified. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for details.\n";
143 HGCalDetId trigger_cell_det_id(trigger_cell_id);
144 unsigned wafer = trigger_cell_det_id.
wafer();
145 unsigned subdet = trigger_cell_det_id.
subdetId();
158 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown wafer->module mapping for subdet "<<subdet<<
"\n";
162 catch (
const std::out_of_range&
e) {
164 <<
"HGCalTriggerGeometry: Wafer " << wafer <<
" is not mapped to any trigger module for subdetector " << subdet
165 <<
". The module mapping should be modified. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for details.\n";
174 HGCalDetId trigger_cell_det_id(trigger_cell_id);
175 int wafer_type = trigger_cell_det_id.
waferType();
176 unsigned trigger_cell = trigger_cell_det_id.
cell();
180 for(
auto tc_c_itr=cell_range.first; tc_c_itr!=cell_range.second; tc_c_itr++)
194 int wafer_type = module_det_id.
waferType();
195 unsigned subdet = module_det_id.
subdetId();
196 std::pair<std::unordered_multimap<short, short>::const_iterator,
197 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
207 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
211 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
228 int wafer_type = module_det_id.
waferType();
229 unsigned subdet = module_det_id.
subdetId();
230 std::pair<std::unordered_multimap<short, short>::const_iterator,
231 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
241 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
245 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
262 int wafer_type = module_det_id.
waferType();
263 unsigned subdet = module_det_id.
subdetId();
264 std::pair<std::unordered_multimap<short, short>::const_iterator,
265 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
275 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
280 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
288 return trigger_cell_det_ids;
297 int wafer_type = module_det_id.
waferType();
298 unsigned subdet = module_det_id.
subdetId();
299 std::pair<std::unordered_multimap<short, short>::const_iterator,
300 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
310 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
315 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
323 return trigger_cell_det_ids;
334 for(
const auto& cell : cell_ids)
339 return GlobalPoint( triggerCellVector/cell_ids.size() );
350 for(
const auto& cell : cell_ids)
355 return GlobalPoint( moduleVector/cell_ids.size() );
366 if(!l1tModulesMappingStream.is_open())
edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TModulesMapping file\n";
370 for(; l1tModulesMappingStream>>subdet>>wafer>>
module; )
381 int wafer_type = esInfo.topo_ee->dddConstants().waferTypeT(wafer)==1?1:-1;
392 int wafer_type = esInfo.topo_fh->dddConstants().waferTypeT(wafer)==1?1:-1;
397 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Unsupported subdetector number ("<<subdet<<
") in L1TModulesMapping file\n";
401 if(!l1tModulesMappingStream.eof())
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Error reading L1TModulesMapping '"<<wafer<<
" "<<module<<
"' \n";
402 l1tModulesMappingStream.close();
405 if(!l1tCellsMappingStream.is_open())
edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TCellsMapping file\n";
408 short triggerCell = 0;
409 for(; l1tCellsMappingStream>>waferType>>cell>>triggerCell; )
416 if(triggerCell+1 > itr_insert.first->second) itr_insert.first->second = triggerCell+1;
418 if(!l1tCellsMappingStream.eof())
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Error reading L1TCellsMapping'"<<waferType<<
" "<<cell<<
" "<<triggerCell<<
"' \n";
419 l1tCellsMappingStream.close();
427 "HGCalTriggerGeometryHexImp2");
virtual geom_set getCellsFromTriggerCell(const unsigned) const override final
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_map< short, short > number_trigger_cells_in_wafers_
virtual GlobalPoint getModulePosition(const unsigned) const override final
edm::FileInPath l1tModulesMapping_
Global3DPoint GlobalPoint
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned) const override final
GlobalPoint getPosition(const DetId &id) const
std::unordered_multimap< short, short > module_to_wafers_fh_
edm::FileInPath l1tCellsMapping_
virtual void initialize(const es_info &) override final
static const int kHGCalCellMask
int zside() const
get the z-side of the cell (1/-1)
edm::ESHandle< HGCalGeometry > geom_ee
edm::ESHandle< HGCalGeometry > geom_fh
virtual void reset() override final
std::unordered_multimap< short, short > module_to_wafers_ee_
virtual GlobalPoint getTriggerCellPosition(const unsigned) const override final
int wafer() const
get the wafer #
virtual unsigned getTriggerCellFromCell(const unsigned) const override final
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::unordered_map< short, short > wafer_to_module_ee_
int cell() const
get the absolute value of the cell #'s in x and y
virtual unsigned getModuleFromCell(const unsigned) const override final
std::unordered_map< short, short > wafer_to_module_fh_
std::set< unsigned > geom_ordered_set
void fillMaps(const es_info &)
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const override final
std::unordered_set< unsigned > geom_set
virtual geom_set getTriggerCellsFromModule(const unsigned) const override final
int waferType() const
get the wafer type
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::map< std::pair< short, short >, short > cells_to_trigger_cells_
virtual unsigned getModuleFromTriggerCell(const unsigned) const override final
std::string fullPath() const
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
virtual geom_set getCellsFromModule(const unsigned) const override final
int layer() const
get the layer #
HGCalTriggerGeometryHexImp2(const edm::ParameterSet &conf)