CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalTriggerGeometryHexImp2 Class Reference
Inheritance diagram for HGCalTriggerGeometryHexImp2:
HGCalTriggerGeometryBase

Public Member Functions

virtual geom_set getCellsFromModule (const unsigned) const override final
 
virtual geom_set getCellsFromTriggerCell (const unsigned) const override final
 
virtual unsigned getModuleFromCell (const unsigned) const override final
 
virtual unsigned getModuleFromTriggerCell (const unsigned) const override final
 
virtual GlobalPoint getModulePosition (const unsigned) const override final
 
virtual geom_ordered_set getOrderedCellsFromModule (const unsigned) const override final
 
virtual geom_ordered_set getOrderedTriggerCellsFromModule (const unsigned) const override final
 
virtual unsigned getTriggerCellFromCell (const unsigned) const override final
 
virtual GlobalPoint getTriggerCellPosition (const unsigned) const override final
 
virtual geom_set getTriggerCellsFromModule (const unsigned) const override final
 
 HGCalTriggerGeometryHexImp2 (const edm::ParameterSet &conf)
 
virtual void initialize (const es_info &) override final
 
virtual void reset () override final
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const std::string & bhSDName () const
 
const std::string & eeSDName () const
 
const std::string & fhSDName () const
 
 HGCalTriggerGeometryBase (const edm::ParameterSet &conf)
 
virtual void initialize (const es_info &)=0
 
const std::string & name () const
 
virtual ~HGCalTriggerGeometryBase ()
 

Private Member Functions

void fillMaps (const es_info &)
 

Private Attributes

std::map< std::pair< short, short >, short > cells_to_trigger_cells_
 
es_info es_info_
 
edm::FileInPath l1tCellsMapping_
 
edm::FileInPath l1tModulesMapping_
 
std::unordered_multimap< short, short > module_to_wafers_ee_
 
std::unordered_multimap< short, short > module_to_wafers_fh_
 
std::unordered_map< short, short > number_cells_in_wafers_
 
std::unordered_map< short, short > number_trigger_cells_in_wafers_
 
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
 
std::unordered_map< short, short > wafer_to_module_ee_
 
std::unordered_map< short, short > wafer_to_module_fh_
 

Additional Inherited Members

- Public Types inherited from HGCalTriggerGeometryBase
typedef std::unordered_map< unsigned, unsigned > geom_map
 
typedef std::set< unsigned > geom_ordered_set
 
typedef std::unordered_set< unsigned > geom_set
 

Detailed Description

Definition at line 12 of file HGCalTriggerGeometryHexImp2.cc.

Constructor & Destructor Documentation

HGCalTriggerGeometryHexImp2::HGCalTriggerGeometryHexImp2 ( const edm::ParameterSet conf)

Definition at line 55 of file HGCalTriggerGeometryHexImp2.cc.

References reset().

55  :
57  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
58  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping"))
59 {
60 }
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
T getParameter(std::string const &) const

Member Function Documentation

void HGCalTriggerGeometryHexImp2::fillMaps ( const es_info &  esInfo)
private

Definition at line 361 of file HGCalTriggerGeometryHexImp2.cc.

References cells_to_trigger_cells_, DEFINE_EDM_PLUGIN, edm::FileInPath::fullPath(), HGCEE, HGCHEF, l1tCellsMapping_, l1tModulesMapping_, python.rootplot.argparse::module, module_to_wafers_ee_, module_to_wafers_fh_, number_cells_in_wafers_, number_trigger_cells_in_wafers_, trigger_cells_to_cells_, wafer_to_module_ee_, and wafer_to_module_fh_.

Referenced by getModulePosition(), and initialize().

362 {
363  //
364  // read module mapping file
365  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
366  if(!l1tModulesMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TModulesMapping file\n";
367  short subdet = 0;
368  short wafer = 0;
369  short module = 0;
370  for(; l1tModulesMappingStream>>subdet>>wafer>>module; )
371  {
372  switch(subdet)
373  {
375  {
376  // fill module <-> wafers mappings
377  wafer_to_module_ee_.emplace(wafer,module);
378  module_to_wafers_ee_.emplace(module, wafer);
379  // fill number of cells for a given wafer type
380  // translate wafer type 1/2 to 1/-1
381  int wafer_type = esInfo.topo_ee->dddConstants().waferTypeT(wafer)==1?1:-1;
382  number_cells_in_wafers_.emplace(wafer_type, esInfo.topo_ee->dddConstants().numberCellsHexagon(wafer));
383  break;
384  }
386  {
387  // fill module <-> wafers mappings
388  wafer_to_module_fh_.emplace(wafer,module);
389  module_to_wafers_fh_.emplace(module, wafer);
390  // fill number of cells for a given wafer type
391  // translate wafer type 1/2 to 1/-1
392  int wafer_type = esInfo.topo_fh->dddConstants().waferTypeT(wafer)==1?1:-1;
393  number_cells_in_wafers_.emplace(wafer_type, esInfo.topo_fh->dddConstants().numberCellsHexagon(wafer));
394  break;
395  }
396  default:
397  edm::LogWarning("HGCalTriggerGeometry") << "Unsupported subdetector number ("<<subdet<<") in L1TModulesMapping file\n";
398  break;
399  }
400  }
401  if(!l1tModulesMappingStream.eof()) edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TModulesMapping '"<<wafer<<" "<<module<<"' \n";
402  l1tModulesMappingStream.close();
403  // read trigger cell mapping file
404  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
405  if(!l1tCellsMappingStream.is_open()) edm::LogError("HGCalTriggerGeometry") << "Cannot open L1TCellsMapping file\n";
406  short waferType = 0;
407  short cell = 0;
408  short triggerCell = 0;
409  for(; l1tCellsMappingStream>>waferType>>cell>>triggerCell; )
410  {
411  // fill cell <-> trigger cell mappings
412  cells_to_trigger_cells_.emplace(std::make_pair((waferType?1:-1),cell), triggerCell);
413  trigger_cells_to_cells_.emplace(std::make_pair((waferType?1:-1),triggerCell), cell);
414  // fill number of cells for a given wafer type
415  auto itr_insert = number_trigger_cells_in_wafers_.emplace((waferType?1:-1), 0);
416  if(triggerCell+1 > itr_insert.first->second) itr_insert.first->second = triggerCell+1;
417  }
418  if(!l1tCellsMappingStream.eof()) edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellsMapping'"<<waferType<<" "<<cell<<" "<<triggerCell<<"' \n";
419  l1tCellsMappingStream.close();
420 }
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_map< short, short > number_trigger_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
std::unordered_multimap< short, short > module_to_wafers_ee_
std::unordered_map< short, short > wafer_to_module_ee_
std::unordered_map< short, short > wafer_to_module_fh_
std::map< std::pair< short, short >, short > cells_to_trigger_cells_
std::string fullPath() const
Definition: FileInPath.cc:184
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
Definition: vlib.h:208
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryHexImp2::getCellsFromModule ( const unsigned  module_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 189 of file HGCalTriggerGeometryHexImp2.cc.

References getOrderedCellsFromModule(), HGCEE, HGCHEF, HGCalDetId::layer(), module_to_wafers_ee_, module_to_wafers_fh_, number_cells_in_wafers_, DetId::subdetId(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getCellsFromTriggerCell(), and getModulePosition().

190 {
191 
192  HGCalDetId module_det_id(module_id);
193  unsigned module = module_det_id.wafer();
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;
198  switch(subdet)
199  {
201  wafer_itrs = module_to_wafers_ee_.equal_range(module);
202  break;
204  wafer_itrs = module_to_wafers_fh_.equal_range(module);
205  break;
206  default:
207  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet "<<subdet<<"\n";
208  return geom_set();
209  };
210  geom_set cell_det_ids;
211  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
212  {
213  // loop on the cells in each wafer
214  for(int cell=0; cell<number_cells_in_wafers_.at(wafer_type); cell++)
215  {
216  cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer_itr->second, cell).rawId());
217  }
218  }
219  return cell_det_ids;
220 }
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
ForwardSubdetector
std::unordered_multimap< short, short > module_to_wafers_ee_
std::unordered_set< unsigned > geom_set
Definition: vlib.h:208
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryHexImp2::getCellsFromTriggerCell ( const unsigned  trigger_cell_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 172 of file HGCalTriggerGeometryHexImp2.cc.

References HGCalDetId::cell(), getCellsFromModule(), HGCalDetId::layer(), DetId::subdetId(), trigger_cells_to_cells_, HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getModuleFromTriggerCell(), and getTriggerCellPosition().

173 {
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();
177  // FIXME: better way to do this TC->cell mapping?
178  const auto& cell_range = trigger_cells_to_cells_.equal_range(std::make_pair(wafer_type,trigger_cell));
179  geom_set cell_det_ids;
180  for(auto tc_c_itr=cell_range.first; tc_c_itr!=cell_range.second; tc_c_itr++)
181  {
182  cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(), trigger_cell_det_id.zside(), trigger_cell_det_id.layer(), trigger_cell_det_id.waferType(), trigger_cell_det_id.wafer(), tc_c_itr->second).rawId());
183  }
184  return cell_det_ids;
185 }
ForwardSubdetector
std::unordered_set< unsigned > geom_set
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
unsigned HGCalTriggerGeometryHexImp2::getModuleFromCell ( const unsigned  cell_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 110 of file HGCalTriggerGeometryHexImp2.cc.

References MillePedeFileConverter_cfg::e, Exception, getModuleFromTriggerCell(), HGCEE, HGCHEF, HGCalDetId::kHGCalCellMask, HGCalDetId::layer(), python.rootplot.argparse::module, DetId::subdetId(), HGCalDetId::wafer(), wafer_to_module_ee_, wafer_to_module_fh_, HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getTriggerCellFromCell().

111 {
112  HGCalDetId cell_det_id(cell_id);
113  unsigned wafer = cell_det_id.wafer();
114  unsigned subdet = cell_det_id.subdetId();
115  unsigned module = 0;
116  try
117  {
118  switch(subdet)
119  {
121  module = wafer_to_module_ee_.at(wafer);
122  break;
124  module = wafer_to_module_fh_.at(wafer);
125  break;
126  default:
127  edm::LogError("HGCalTriggerGeometry") << "Unknown wafer->module mapping for subdet "<<subdet<<"\n";
128  return 0;
129  };
130  }
131  catch (const std::out_of_range& e) {
132  throw cms::Exception("BadGeometry")
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";
135  }
136  return HGCalDetId((ForwardSubdetector)cell_det_id.subdetId(), cell_det_id.zside(), cell_det_id.layer(), cell_det_id.waferType(), module, HGCalDetId::kHGCalCellMask).rawId();
137 }
ForwardSubdetector
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
std::unordered_map< short, short > wafer_to_module_ee_
std::unordered_map< short, short > wafer_to_module_fh_
Definition: vlib.h:208
unsigned HGCalTriggerGeometryHexImp2::getModuleFromTriggerCell ( const unsigned  trigger_cell_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 141 of file HGCalTriggerGeometryHexImp2.cc.

References MillePedeFileConverter_cfg::e, Exception, getCellsFromTriggerCell(), HGCEE, HGCHEF, HGCalDetId::kHGCalCellMask, HGCalDetId::layer(), python.rootplot.argparse::module, DetId::subdetId(), HGCalDetId::wafer(), wafer_to_module_ee_, wafer_to_module_fh_, HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getModuleFromCell().

142 {
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();
146  unsigned module = 0;
147  try
148  {
149  switch(subdet)
150  {
152  module = wafer_to_module_ee_.at(wafer);
153  break;
155  module = wafer_to_module_fh_.at(wafer);
156  break;
157  default:
158  edm::LogError("HGCalTriggerGeometry") << "Unknown wafer->module mapping for subdet "<<subdet<<"\n";
159  return 0;
160  }
161  }
162  catch (const std::out_of_range& e) {
163  throw cms::Exception("BadGeometry")
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";
166  };
167  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(), trigger_cell_det_id.zside(), trigger_cell_det_id.layer(), trigger_cell_det_id.waferType(), module, HGCalDetId::kHGCalCellMask).rawId();
168 }
ForwardSubdetector
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
std::unordered_map< short, short > wafer_to_module_ee_
std::unordered_map< short, short > wafer_to_module_fh_
Definition: vlib.h:208
GlobalPoint HGCalTriggerGeometryHexImp2::getModulePosition ( const unsigned  module_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 345 of file HGCalTriggerGeometryHexImp2.cc.

References es_info_, fillMaps(), HGCalTriggerGeometryBase::es_info::geom_ee, HGCalTriggerGeometryBase::es_info::geom_fh, getCellsFromModule(), HGCalGeometry::getPosition(), HGCEE, and DetId::subdetId().

Referenced by getTriggerCellPosition().

346 {
347  // Position: barycenter of the module.
348  Basic3DVector<float> moduleVector(0.,0.,0.);
349  const auto cell_ids = getCellsFromModule(module_det_id);
350  for(const auto& cell : cell_ids)
351  {
352  HGCalDetId cellDetId(cell);
353  moduleVector += (cellDetId.subdetId()==ForwardSubdetector::HGCEE ? es_info_.geom_ee->getPosition(cellDetId) : es_info_.geom_fh->getPosition(cellDetId)).basicVector();
354  }
355  return GlobalPoint( moduleVector/cell_ids.size() );
356 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
edm::ESHandle< HGCalGeometry > geom_ee
edm::ESHandle< HGCalGeometry > geom_fh
virtual geom_set getCellsFromModule(const unsigned) const override final
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryHexImp2::getOrderedCellsFromModule ( const unsigned  module_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 224 of file HGCalTriggerGeometryHexImp2.cc.

References getTriggerCellsFromModule(), HGCEE, HGCHEF, HGCalDetId::layer(), module_to_wafers_ee_, module_to_wafers_fh_, number_cells_in_wafers_, DetId::subdetId(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getCellsFromModule().

225 {
226  HGCalDetId module_det_id(module_id);
227  unsigned module = module_det_id.wafer();
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;
232  switch(subdet)
233  {
235  wafer_itrs = module_to_wafers_ee_.equal_range(module);
236  break;
238  wafer_itrs = module_to_wafers_fh_.equal_range(module);
239  break;
240  default:
241  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet "<<subdet<<"\n";
242  return geom_ordered_set();
243  };
244  geom_ordered_set cell_det_ids;
245  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
246  {
247  // loop on the cells in each wafer
248  for(int cell=0; cell<number_cells_in_wafers_.at(wafer_type); cell++)
249  {
250  cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer_itr->second, cell).rawId());
251  }
252  }
253  return cell_det_ids;
254 }
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
ForwardSubdetector
std::unordered_multimap< short, short > module_to_wafers_ee_
std::set< unsigned > geom_ordered_set
Definition: vlib.h:208
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryHexImp2::getOrderedTriggerCellsFromModule ( const unsigned  module_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 293 of file HGCalTriggerGeometryHexImp2.cc.

References getTriggerCellPosition(), HGCEE, HGCHEF, HGCalDetId::layer(), module_to_wafers_ee_, module_to_wafers_fh_, number_trigger_cells_in_wafers_, DetId::subdetId(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getTriggerCellsFromModule().

294 {
295  HGCalDetId module_det_id(module_id);
296  unsigned module = module_det_id.wafer();
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;
301  switch(subdet)
302  {
304  wafer_itrs = module_to_wafers_ee_.equal_range(module);
305  break;
307  wafer_itrs = module_to_wafers_fh_.equal_range(module);
308  break;
309  default:
310  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet "<<subdet<<"\n";
311  return geom_ordered_set();
312  };
313  geom_ordered_set trigger_cell_det_ids;
314  // loop on the wafers included in the module
315  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
316  {
317  // loop on the trigger cells in each wafer
318  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++)
319  {
320  trigger_cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer_itr->second, trigger_cell).rawId());
321  }
322  }
323  return trigger_cell_det_ids;
324 }
std::unordered_map< short, short > number_trigger_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
ForwardSubdetector
std::unordered_multimap< short, short > module_to_wafers_ee_
std::set< unsigned > geom_ordered_set
Definition: vlib.h:208
unsigned HGCalTriggerGeometryHexImp2::getTriggerCellFromCell ( const unsigned  cell_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 89 of file HGCalTriggerGeometryHexImp2.cc.

References HGCalDetId::cell(), cells_to_trigger_cells_, MillePedeFileConverter_cfg::e, Exception, getModuleFromCell(), HGCalDetId::layer(), DetId::subdetId(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by initialize().

90 {
91  HGCalDetId cell_det_id(cell_id);
92  int wafer_type = cell_det_id.waferType();
93  unsigned cell = cell_det_id.cell();
94  unsigned trigger_cell = 0;
95  try
96  {
97  // FIXME: better way to do this cell->TC mapping?
98  trigger_cell = cells_to_trigger_cells_.at(std::make_pair(wafer_type,cell));
99  }
100  catch (const std::out_of_range& e) {
101  throw cms::Exception("BadGeometry")
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";
104  }
105  return HGCalDetId((ForwardSubdetector)cell_det_id.subdetId(), cell_det_id.zside(), cell_det_id.layer(), cell_det_id.waferType(), cell_det_id.wafer(), trigger_cell).rawId();
106 }
ForwardSubdetector
std::map< std::pair< short, short >, short > cells_to_trigger_cells_
GlobalPoint HGCalTriggerGeometryHexImp2::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 329 of file HGCalTriggerGeometryHexImp2.cc.

References es_info_, HGCalTriggerGeometryBase::es_info::geom_ee, HGCalTriggerGeometryBase::es_info::geom_fh, getCellsFromTriggerCell(), getModulePosition(), HGCalGeometry::getPosition(), HGCEE, and DetId::subdetId().

Referenced by getOrderedTriggerCellsFromModule().

330 {
331  // Position: barycenter of the trigger cell.
332  Basic3DVector<float> triggerCellVector(0.,0.,0.);
333  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
334  for(const auto& cell : cell_ids)
335  {
336  HGCalDetId cellDetId(cell);
337  triggerCellVector += (cellDetId.subdetId()==ForwardSubdetector::HGCEE ? es_info_.geom_ee->getPosition(cellDetId) : es_info_.geom_fh->getPosition(cellDetId)).basicVector();
338  }
339  return GlobalPoint( triggerCellVector/cell_ids.size() );
340 
341 }
virtual geom_set getCellsFromTriggerCell(const unsigned) const override final
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
edm::ESHandle< HGCalGeometry > geom_ee
edm::ESHandle< HGCalGeometry > geom_fh
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryHexImp2::getTriggerCellsFromModule ( const unsigned  module_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 258 of file HGCalTriggerGeometryHexImp2.cc.

References getOrderedTriggerCellsFromModule(), HGCEE, HGCHEF, HGCalDetId::layer(), module_to_wafers_ee_, module_to_wafers_fh_, number_trigger_cells_in_wafers_, DetId::subdetId(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getOrderedCellsFromModule().

259 {
260  HGCalDetId module_det_id(module_id);
261  unsigned module = module_det_id.wafer();
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;
266  switch(subdet)
267  {
269  wafer_itrs = module_to_wafers_ee_.equal_range(module);
270  break;
272  wafer_itrs = module_to_wafers_fh_.equal_range(module);
273  break;
274  default:
275  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet "<<subdet<<"\n";
276  return geom_set();
277  };
278  geom_set trigger_cell_det_ids;
279  // loop on the wafers included in the module
280  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
281  {
282  // loop on the trigger cells in each wafer
283  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++)
284  {
285  trigger_cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer_itr->second, trigger_cell).rawId());
286  }
287  }
288  return trigger_cell_det_ids;
289 }
std::unordered_map< short, short > number_trigger_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
ForwardSubdetector
std::unordered_multimap< short, short > module_to_wafers_ee_
std::unordered_set< unsigned > geom_set
Definition: vlib.h:208
void HGCalTriggerGeometryHexImp2::initialize ( const es_info &  esInfo)
finaloverridevirtual

Definition at line 78 of file HGCalTriggerGeometryHexImp2.cc.

References es_info_, fillMaps(), and getTriggerCellFromCell().

Referenced by reset().

79 {
80  edm::LogWarning("HGCalTriggerGeometry") << "WARNING: This HGCal trigger geometry is incomplete.\n"\
81  << "WARNING: There is no neighbor information.\n";
82  es_info_ = esInfo;
83  fillMaps(esInfo);
84 
85 }
void HGCalTriggerGeometryHexImp2::reset ( void  )
finaloverridevirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 64 of file HGCalTriggerGeometryHexImp2.cc.

References cells_to_trigger_cells_, initialize(), module_to_wafers_ee_, module_to_wafers_fh_, number_cells_in_wafers_, number_trigger_cells_in_wafers_, trigger_cells_to_cells_, wafer_to_module_ee_, and wafer_to_module_fh_.

Referenced by HGCalTriggerGeometryHexImp2().

65 {
66  wafer_to_module_ee_.clear();
67  wafer_to_module_fh_.clear();
68  module_to_wafers_ee_.clear();
69  module_to_wafers_fh_.clear();
74 }
std::unordered_map< short, short > number_cells_in_wafers_
std::unordered_map< short, short > number_trigger_cells_in_wafers_
std::unordered_multimap< short, short > module_to_wafers_fh_
std::unordered_multimap< short, short > module_to_wafers_ee_
std::unordered_map< short, short > wafer_to_module_ee_
std::unordered_map< short, short > wafer_to_module_fh_
std::map< std::pair< short, short >, short > cells_to_trigger_cells_
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_

Member Data Documentation

std::map<std::pair<short,short>, short> HGCalTriggerGeometryHexImp2::cells_to_trigger_cells_
private

Definition at line 45 of file HGCalTriggerGeometryHexImp2.cc.

Referenced by fillMaps(), getTriggerCellFromCell(), and reset().

es_info HGCalTriggerGeometryHexImp2::es_info_
private
edm::FileInPath HGCalTriggerGeometryHexImp2::l1tCellsMapping_
private

Definition at line 35 of file HGCalTriggerGeometryHexImp2.cc.

Referenced by fillMaps().

edm::FileInPath HGCalTriggerGeometryHexImp2::l1tModulesMapping_
private

Definition at line 36 of file HGCalTriggerGeometryHexImp2.cc.

Referenced by fillMaps().

std::unordered_multimap<short, short> HGCalTriggerGeometryHexImp2::module_to_wafers_ee_
private
std::unordered_multimap<short, short> HGCalTriggerGeometryHexImp2::module_to_wafers_fh_
private
std::unordered_map<short, short> HGCalTriggerGeometryHexImp2::number_cells_in_wafers_
private
std::unordered_map<short, short> HGCalTriggerGeometryHexImp2::number_trigger_cells_in_wafers_
private
std::multimap<std::pair<short,short>, short> HGCalTriggerGeometryHexImp2::trigger_cells_to_cells_
private

Definition at line 46 of file HGCalTriggerGeometryHexImp2.cc.

Referenced by fillMaps(), getCellsFromTriggerCell(), and reset().

std::unordered_map<short, short> HGCalTriggerGeometryHexImp2::wafer_to_module_ee_
private
std::unordered_map<short, short> HGCalTriggerGeometryHexImp2::wafer_to_module_fh_
private