17 virtual void initialize(
const es_info& )
override final;
56 l1tCellsMapping_(conf.getParameter<edm::
FileInPath>(
"L1TCellsMapping")),
57 l1tModulesMapping_(conf.getParameter<edm::
FileInPath>(
"L1TModulesMapping"))
66 edm::LogWarning(
"HGCalTriggerGeometry") <<
"WARNING: This HGCal trigger geometry is incomplete.\n"\
67 <<
"WARNING: There is no neighbor information.\n";
79 unsigned cell = cell_det_id.
cell();
90 unsigned wafer = cell_det_id.
wafer();
91 unsigned subdet = cell_det_id.
subdetId();
102 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown wafer->module mapping for subdet "<<subdet<<
"\n";
112 HGCalDetId trigger_cell_det_id(trigger_cell_id);
113 unsigned wafer = trigger_cell_det_id.
wafer();
114 unsigned subdet = trigger_cell_det_id.
subdetId();
125 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown wafer->module mapping for subdet "<<subdet<<
"\n";
135 HGCalDetId trigger_cell_det_id(trigger_cell_id);
136 int wafer_type = trigger_cell_det_id.
waferType();
137 unsigned trigger_cell = trigger_cell_det_id.
cell();
141 for(
auto tc_c_itr=cell_range.first; tc_c_itr!=cell_range.second; tc_c_itr++)
155 int wafer_type = module_det_id.
waferType();
156 unsigned subdet = module_det_id.
subdetId();
157 std::pair<std::unordered_multimap<short, short>::const_iterator,
158 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
168 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
172 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
189 int wafer_type = module_det_id.
waferType();
190 unsigned subdet = module_det_id.
subdetId();
191 std::pair<std::unordered_multimap<short, short>::const_iterator,
192 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
202 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
206 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
223 int wafer_type = module_det_id.
waferType();
224 unsigned subdet = module_det_id.
subdetId();
225 std::pair<std::unordered_multimap<short, short>::const_iterator,
226 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
236 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
241 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
249 return trigger_cell_det_ids;
258 int wafer_type = module_det_id.
waferType();
259 unsigned subdet = module_det_id.
subdetId();
260 std::pair<std::unordered_multimap<short, short>::const_iterator,
261 std::unordered_multimap<short, short>::const_iterator> wafer_itrs;
271 edm::LogError(
"HGCalTriggerGeometry") <<
"Unknown module->wafers mapping for subdet "<<subdet<<
"\n";
276 for(
auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
284 return trigger_cell_det_ids;
295 for(
const auto& cell : cell_ids)
300 return GlobalPoint( triggerCellVector/cell_ids.size() );
311 for(
const auto& cell : cell_ids)
316 return GlobalPoint( moduleVector/cell_ids.size() );
327 if(!l1tModulesMappingStream.is_open())
edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TModulesMapping file\n";
331 for(; l1tModulesMappingStream>>subdet>>wafer>>
module; )
342 int wafer_type = esInfo.topo_ee->dddConstants().waferTypeT(wafer)==1?1:-1;
353 int wafer_type = esInfo.topo_fh->dddConstants().waferTypeT(wafer)==1?1:-1;
358 edm::LogWarning(
"HGCalTriggerGeometry") <<
"Unsupported subdetector number ("<<subdet<<
") in L1TModulesMapping file\n";
362 if(!l1tModulesMappingStream.eof())
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Error reading L1TModulesMapping '"<<wafer<<
" "<<module<<
"' \n";
363 l1tModulesMappingStream.close();
366 if(!l1tCellsMappingStream.is_open())
edm::LogError(
"HGCalTriggerGeometry") <<
"Cannot open L1TCellsMapping file\n";
369 short triggerCell = 0;
370 for(; l1tCellsMappingStream>>waferType>>cell>>triggerCell; )
377 if(triggerCell+1 > itr_insert.first->second) itr_insert.first->second = triggerCell+1;
379 if(!l1tCellsMappingStream.eof())
edm::LogWarning(
"HGCalTriggerGeometry") <<
"Error reading L1TCellsMapping'"<<waferType<<
" "<<cell<<
" "<<triggerCell<<
"' \n";
380 l1tCellsMappingStream.close();
388 "HGCalTriggerGeometryHexImp2");
virtual geom_set getCellsFromTriggerCell(const unsigned) const overridefinal
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_map< short, short > number_trigger_cells_in_wafers_
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const overridefinal
edm::FileInPath l1tModulesMapping_
Global3DPoint GlobalPoint
std::unordered_multimap< short, short > module_to_wafers_fh_
edm::FileInPath l1tCellsMapping_
virtual unsigned getModuleFromCell(const unsigned) const overridefinal
static const int kHGCalCellMask
virtual GlobalPoint getModulePosition(const unsigned) const overridefinal
int zside() const
get the z-side of the cell (1/-1)
virtual geom_set getCellsFromModule(const unsigned) const overridefinal
edm::ESHandle< HGCalGeometry > geom_ee
virtual geom_set getTriggerCellsFromModule(const unsigned) const overridefinal
edm::ESHandle< HGCalGeometry > geom_fh
std::unordered_multimap< short, short > module_to_wafers_ee_
int wafer() const
get the wafer #
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual unsigned getModuleFromTriggerCell(const unsigned) const overridefinal
std::unordered_map< short, short > wafer_to_module_ee_
virtual GlobalPoint getTriggerCellPosition(const unsigned) const overridefinal
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned) const overridefinal
int cell() const
get the absolute value of the cell #'s in x and y
std::unordered_map< short, short > wafer_to_module_fh_
std::set< unsigned > geom_ordered_set
void fillMaps(const es_info &)
std::unordered_set< unsigned > geom_set
virtual unsigned getTriggerCellFromCell(const unsigned) const overridefinal
virtual void initialize(const es_info &) overridefinal
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_
std::string fullPath() const
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
int layer() const
get the layer #
HGCalTriggerGeometryHexImp2(const edm::ParameterSet &conf)