CMS 3D CMS Logo

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

Public Member Functions

bool disconnectedModule (const unsigned) const final
 
geom_set getCellsFromModule (const unsigned) const final
 
geom_set getCellsFromTriggerCell (const unsigned) const final
 
unsigned getLinksInModule (const unsigned module_id) const final
 
geom_set getLpgbtsFromModule (const unsigned) const final
 
geom_set getLpgbtsFromStage1Fpga (const unsigned) const final
 
unsigned getModuleFromCell (const unsigned) const final
 
unsigned getModuleFromTriggerCell (const unsigned) const final
 
GlobalPoint getModulePosition (const unsigned) const final
 
geom_set getModulesFromLpgbt (const unsigned) const final
 
unsigned getModuleSize (const unsigned module_id) const final
 
geom_set getNeighborsFromTriggerCell (const unsigned) const final
 
geom_ordered_set getOrderedCellsFromModule (const unsigned) const final
 
geom_ordered_set getOrderedTriggerCellsFromModule (const unsigned) const final
 
unsigned getStage1FpgaFromLpgbt (const unsigned) const final
 
unsigned getStage1FpgaFromModule (const unsigned module_id) const final
 
unsigned getStage1FpgaFromStage1Link (const unsigned) const final
 
geom_set getStage1FpgasFromStage2Fpga (const unsigned) const final
 
geom_set getStage1LinksFromStage1Fpga (const unsigned) const final
 
geom_set getStage1LinksFromStage2Fpga (const unsigned) const final
 
unsigned getStage2FpgaFromStage1Link (const unsigned) const final
 
geom_set getStage2FpgasFromStage1Fpga (const unsigned) const final
 
unsigned getTriggerCellFromCell (const unsigned) const final
 
GlobalPoint getTriggerCellPosition (const unsigned) const final
 
geom_set getTriggerCellsFromModule (const unsigned) const final
 
 HGCalTriggerGeometryV9Imp2 (const edm::ParameterSet &conf)
 
void initialize (const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *) final
 
void initialize (const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *) final
 
unsigned lastTriggerLayer () const final
 
void reset () final
 
unsigned triggerLayer (const unsigned) const final
 
bool validCell (const unsigned) const final
 
bool validTriggerCell (const unsigned) const final
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const HGCalGeometryeeGeometry () const
 
const HGCalTopologyeeTopology () const
 
const HGCalGeometryfhGeometry () const
 
const HGCalTopologyfhTopology () const
 
 HGCalTriggerGeometryBase (const edm::ParameterSet &conf)
 
const HGCalGeometryhscGeometry () const
 
const HGCalTopologyhscTopology () const
 
const HGCalGeometryhsiGeometry () const
 
const HGCalTopologyhsiTopology () const
 
bool isWithNoseGeometry () const
 
const std::string & name () const
 
const HGCalGeometrynoseGeometry () const
 
const HGCalTopologynoseTopology () const
 
void setWithNoseGeometry (const bool isNose)
 
virtual ~HGCalTriggerGeometryBase ()
 

Private Member Functions

int detIdWaferType (unsigned det, unsigned layer, short waferU, short waferV) const
 
void fillMaps ()
 
unsigned layerWithOffset (unsigned) const
 
unsigned packLayerModuleId (unsigned layer, unsigned wafer) const
 
unsigned packLayerWaferId (unsigned layer, int waferU, int waferV) const
 
unsigned packWaferId (int waferU, int waferV) const
 
void unpackWaferId (unsigned wafer, int &waferU, int &waferV) const
 
bool validCellId (unsigned det, unsigned cell_id) const
 
bool validTriggerCellFromCells (const unsigned) const
 

Private Attributes

tbb::concurrent_unordered_set< unsigned > cache_missing_wafers_
 
std::unordered_set< unsigned > disconnected_layers_
 
std::unordered_set< unsigned > disconnected_modules_
 
unsigned heOffset_ = 0
 
unsigned hSc_links_per_module_ = 1
 
unsigned hSc_module_size_ = 12
 
unsigned hSc_triggercell_size_ = 2
 
unsigned hSc_wafers_per_module_ = 3
 
edm::FileInPath l1tLinksMapping_
 
edm::FileInPath l1tModulesMapping_
 
unsigned last_trigger_layer_ = 0
 
std::unordered_map< unsigned, unsigned > links_per_module_
 
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
 
unsigned noseLayers_ = 0
 
unsigned sector0_mask_ = 0x7f
 
unsigned totalLayers_ = 0
 
std::vector< unsigned > trigger_layers_
 
std::vector< unsigned > trigger_nose_layers_
 
std::unordered_map< unsigned, unsigned > wafer_to_module_
 

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
 
- Protected Member Functions inherited from HGCalTriggerGeometryBase
void setEEGeometry (const HGCalGeometry *geom)
 
void setHScGeometry (const HGCalGeometry *geom)
 
void setHSiGeometry (const HGCalGeometry *geom)
 
void setNoseGeometry (const HGCalGeometry *geom)
 

Detailed Description

Definition at line 17 of file HGCalTriggerGeometryV9Imp2.cc.

Constructor & Destructor Documentation

◆ HGCalTriggerGeometryV9Imp2()

HGCalTriggerGeometryV9Imp2::HGCalTriggerGeometryV9Imp2 ( const edm::ParameterSet conf)

Definition at line 106 of file HGCalTriggerGeometryV9Imp2.cc.

References disconnected_layers_, disconnected_modules_, edm::ParameterSet::getParameter(), hSc_module_size_, hSc_wafers_per_module_, and eostools::move().

107  : HGCalTriggerGeometryBase(conf),
108  hSc_triggercell_size_(conf.getParameter<unsigned>("ScintillatorTriggerCellSize")),
109  hSc_module_size_(conf.getParameter<unsigned>("ScintillatorModuleSize")),
110  hSc_links_per_module_(conf.getParameter<unsigned>("ScintillatorLinksPerModule")),
111  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
112  l1tLinksMapping_(conf.getParameter<edm::FileInPath>("L1TLinksMapping")) {
113  const unsigned ntc_per_wafer = 48;
114  hSc_wafers_per_module_ = std::round(hSc_module_size_ * hSc_module_size_ / float(ntc_per_wafer));
115  if (ntc_per_wafer * hSc_wafers_per_module_ < hSc_module_size_ * hSc_module_size_) {
117  }
118  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
119  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
120  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
121  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
122 }
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unordered_set< unsigned > disconnected_modules_
std::unordered_set< unsigned > disconnected_layers_
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ detIdWaferType()

int HGCalTriggerGeometryV9Imp2::detIdWaferType ( unsigned  det,
unsigned  layer,
short  waferU,
short  waferV 
) const
private

Definition at line 793 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTopology::dddConstants(), HGCalTriggerGeometryBase::eeTopology(), HGCalDDDConstants::getTypeHex(), DetId::HGCalEE, DetId::HGCalHSi, HGCalTriggerGeometryBase::hsiTopology(), pixelTopology::layer, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by getOrderedTriggerCellsFromModule(), and getTriggerCellsFromModule().

793  {
794  int wafer_type = 0;
795  switch (det) {
796  case DetId::HGCalEE:
797  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
798  break;
799  case DetId::HGCalHSi:
801  break;
802  default:
803  break;
804  };
805  return wafer_type;
806 }
int32_t waferU(const int32_t index)
const HGCalTopology & eeTopology() const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
int getTypeHex(int layer, int waferU, int waferV) const
int32_t waferV(const int32_t index)
const HGCalTopology & hsiTopology() const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98

◆ disconnectedModule()

bool HGCalTriggerGeometryV9Imp2::disconnectedModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 709 of file HGCalTriggerGeometryV9Imp2.cc.

References disconnected_layers_, disconnected_modules_, and layerWithOffset().

709  {
710  bool disconnected = false;
711  if (disconnected_modules_.find(HGCalDetId(module_id).wafer()) != disconnected_modules_.end())
712  disconnected = true;
713  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end())
714  disconnected = true;
715  return disconnected;
716 }
unsigned layerWithOffset(unsigned) const
std::unordered_set< unsigned > disconnected_modules_
std::unordered_set< unsigned > disconnected_layers_

◆ fillMaps()

void HGCalTriggerGeometryV9Imp2::fillMaps ( )
private

Definition at line 612 of file HGCalTriggerGeometryV9Imp2.cc.

References Exception, edm::FileInPath::fullPath(), l1tLinksMapping_, l1tModulesMapping_, pixelTopology::layer, electronStore::links, links_per_module_, callgraph::module, module_to_wafers_, packLayerModuleId(), packLayerWaferId(), packWaferId(), sector0_mask_, and wafer_to_module_.

Referenced by initialize().

612  {
613  // read module mapping file
614  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
615  if (!l1tModulesMappingStream.is_open()) {
616  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
617  }
618 
619  short waferu = 0;
620  short waferv = 0;
621  short module = 0;
622  short layer = 0;
623  for (; l1tModulesMappingStream >> layer >> waferu >> waferv >> module;) {
624  wafer_to_module_.emplace(packLayerWaferId(layer, waferu, waferv), module);
625  module_to_wafers_.emplace(packLayerModuleId(layer, module), packWaferId(waferu, waferv));
626  }
627  if (!l1tModulesMappingStream.eof()) {
628  throw cms::Exception("BadGeometryFile")
629  << "Error reading L1TModulesMapping '" << layer << " " << waferu << " " << waferv << " " << module << "' \n";
630  }
631  l1tModulesMappingStream.close();
632  // read links mapping file
633  std::ifstream l1tLinksMappingStream(l1tLinksMapping_.fullPath());
634  if (!l1tLinksMappingStream.is_open()) {
635  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TLinksMapping file\n";
636  }
637  short links = 0;
638  const short max_modules_60deg_sector = 127;
639  for (; l1tLinksMappingStream >> layer >> module >> links;) {
641  links = 0;
642  }
643  if (module > max_modules_60deg_sector)
644  sector0_mask_ = 0xff; // Use 8 bits to encode module number in 120deg sector
646  }
647  if (!l1tLinksMappingStream.eof()) {
648  throw cms::Exception("BadGeometryFile")
649  << "Error reading L1TLinksMapping '" << layer << " " << module << " " << links << "' \n";
650  }
651  l1tLinksMappingStream.close();
652 }
std::string fullPath() const
Definition: FileInPath.cc:161
std::unordered_map< unsigned, unsigned > links_per_module_
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
std::unordered_map< unsigned, unsigned > wafer_to_module_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned packWaferId(int waferU, int waferV) const
unsigned packLayerWaferId(unsigned layer, int waferU, int waferV) const
std::unordered_multimap< unsigned, unsigned > module_to_wafers_

◆ getCellsFromModule()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 358 of file HGCalTriggerGeometryV9Imp2.cc.

References hgcalTBTopologyTester_cfi::cells, getCellsFromTriggerCell(), and getTriggerCellsFromModule().

Referenced by getModulePosition().

358  {
359  geom_set cell_det_ids;
360  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
361  for (auto trigger_cell_id : trigger_cells) {
362  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
363  cell_det_ids.insert(cells.begin(), cells.end());
364  }
365  return cell_det_ids;
366 }
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final
geom_set getTriggerCellsFromModule(const unsigned) const final

◆ getCellsFromTriggerCell()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getCellsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 301 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTriggerDetId::cellU(), HFNoseTriggerDetId::cellU(), HGCalTriggerDetId::cellV(), HFNoseTriggerDetId::cellV(), DetId::det(), HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, DetId::HGCalTrigger, hSc_triggercell_size_, LEDCalibrationChannels::ieta, HGCScintillatorDetId::ietaAbs(), createfilelist::int, HGCScintillatorDetId::iphi(), LEDCalibrationChannels::iphi, HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), pixelTopology::layer, HGCalTriggerDetId::subdet(), HGCScintillatorDetId::type(), HFNoseTriggerDetId::type(), HGCalTriggerDetId::type(), validCellId(), HFNoseTriggerDetId::waferU(), HGCalTriggerDetId::waferU(), HFNoseTriggerDetId::waferV(), HGCalTriggerDetId::waferV(), HGCScintillatorDetId::zside(), HFNoseTriggerDetId::zside(), HGCalTriggerDetId::zside(), and ecaldqm::zside().

Referenced by getCellsFromModule(), getOrderedCellsFromModule(), getTriggerCellPosition(), and validTriggerCellFromCells().

302  {
303  DetId trigger_cell_det_id(trigger_cell_id);
304  unsigned det = trigger_cell_det_id.det();
305  geom_set cell_det_ids;
306  // Scintillator
307  if (det == DetId::HGCalHSc) {
308  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
309  int ieta0 = (trigger_cell_sc_id.ietaAbs() - 1) * hSc_triggercell_size_ + 1;
310  int iphi0 = (trigger_cell_sc_id.iphi() - 1) * hSc_triggercell_size_ + 1;
311  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_triggercell_size_; ietaAbs++) {
312  int ieta = ietaAbs * trigger_cell_sc_id.zside();
313  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_triggercell_size_; iphi++) {
314  unsigned cell_id = HGCScintillatorDetId(trigger_cell_sc_id.type(), trigger_cell_sc_id.layer(), ieta, iphi);
315  if (validCellId(DetId::HGCalHSc, cell_id))
316  cell_det_ids.emplace(cell_id);
317  }
318  }
319  }
320  // HFNose
321  else if (det == DetId::HGCalTrigger and
322  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
323  HFNoseTriggerDetId trigger_cell_nose_id(trigger_cell_id);
324  int layer = trigger_cell_nose_id.layer();
325  int zside = trigger_cell_nose_id.zside();
326  int type = trigger_cell_nose_id.type();
327  int waferu = trigger_cell_nose_id.waferU();
328  int waferv = trigger_cell_nose_id.waferV();
329  std::vector<int> cellus = trigger_cell_nose_id.cellU();
330  std::vector<int> cellvs = trigger_cell_nose_id.cellV();
331  for (unsigned ic = 0; ic < cellus.size(); ic++) {
332  HFNoseDetId cell_det_id(zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
333  cell_det_ids.emplace(cell_det_id);
334  }
335  }
336  // Silicon
337  else {
338  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
339  unsigned subdet = trigger_cell_trig_id.subdet();
342  int layer = trigger_cell_trig_id.layer();
343  int zside = trigger_cell_trig_id.zside();
344  int type = trigger_cell_trig_id.type();
345  int waferu = trigger_cell_trig_id.waferU();
346  int waferv = trigger_cell_trig_id.waferV();
347  std::vector<int> cellus = trigger_cell_trig_id.cellU();
348  std::vector<int> cellvs = trigger_cell_trig_id.cellV();
349  for (unsigned ic = 0; ic < cellus.size(); ic++) {
350  HGCSiliconDetId cell_det_id(cell_det, zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
351  cell_det_ids.emplace(cell_det_id);
352  }
353  }
354  }
355  return cell_det_ids;
356 }
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
Definition: DetId.h:17
Detector
Definition: DetId.h:24
bool validCellId(unsigned det, unsigned cell_id) const
std::unordered_set< unsigned > geom_set

◆ getLinksInModule()

unsigned HGCalTriggerGeometryV9Imp2::getLinksInModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 512 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), DetId::Forward, HFNose, DetId::HGCalHSc, hSc_links_per_module_, pixelTopology::layer, layerWithOffset(), electronStore::links, links_per_module_, callgraph::module, packLayerModuleId(), sector0_mask_, DetId::subdetId(), and HGCalDetId::wafer().

512  {
513  DetId module_det_id(module_id);
514  unsigned links = 0;
515  // Scintillator
516  if (module_det_id.det() == DetId::HGCalHSc) {
518  } else if (module_det_id.det() == DetId::Forward && module_det_id.subdetId() == ForwardSubdetector::HFNose) {
519  links = 1;
520  }
521  // TO ADD HFNOSE : getLinksInModule
522  // Silicon
523  else {
524  HGCalDetId module_det_id_si(module_id);
525  unsigned module = module_det_id_si.wafer();
526  unsigned layer = layerWithOffset(module_id);
529  }
530  return links;
531 }
std::unordered_map< unsigned, unsigned > links_per_module_
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned layerWithOffset(unsigned) const
Definition: DetId.h:17

◆ getLpgbtsFromModule()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getLpgbtsFromModule ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 881 of file HGCalTriggerGeometryV9Imp2.cc.

881  {
882  geom_set lpgbt_ids;
883  return lpgbt_ids;
884 }
std::unordered_set< unsigned > geom_set

◆ getLpgbtsFromStage1Fpga()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getLpgbtsFromStage1Fpga ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 866 of file HGCalTriggerGeometryV9Imp2.cc.

866  {
867  geom_set lpgbt_ids;
868  return lpgbt_ids;
869 }
std::unordered_set< unsigned > geom_set

◆ getModuleFromCell()

unsigned HGCalTriggerGeometryV9Imp2::getModuleFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 231 of file HGCalTriggerGeometryV9Imp2.cc.

References getModuleFromTriggerCell(), and getTriggerCellFromCell().

231  {
233 }
unsigned getModuleFromTriggerCell(const unsigned) const final
unsigned getTriggerCellFromCell(const unsigned) const final

◆ getModuleFromTriggerCell()

unsigned HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 235 of file HGCalTriggerGeometryV9Imp2.cc.

References cache_missing_wafers_, HGCalTopology::dddConstants(), DetId::det(), HFNoseDetIdToModule::getModule(), HGCalDDDConstants::getREtaRange(), HFNoseTrigger, HGCalEETrigger, DetId::HGCalHSc, HGCalHSiTrigger, DetId::HGCalTrigger, HGCEE, HGCHEF, hSc_module_size_, hSc_triggercell_size_, HGCalTriggerGeometryBase::hscTopology(), LEDCalibrationChannels::ieta, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), LEDCalibrationChannels::iphi, HGCalDetId::kHGCalCellMask, HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), pixelTopology::layer, layerWithOffset(), callgraph::module, packLayerWaferId(), DetId::rawId(), HGCalTriggerDetId::subdet(), HGCScintillatorDetId::type(), HFNoseTriggerDetId::type(), wafer_to_module_, HFNoseTriggerDetId::waferU(), HGCalTriggerDetId::waferU(), HFNoseTriggerDetId::waferV(), HGCalTriggerDetId::waferV(), HGCScintillatorDetId::zside(), HFNoseTriggerDetId::zside(), HGCalTriggerDetId::zside(), and ecaldqm::zside().

Referenced by getModuleFromCell().

235  {
236  unsigned det = DetId(trigger_cell_id).det();
237  unsigned module = 0;
238  unsigned subdet_old = 0;
239  int zside = 0;
240  unsigned tc_type = 1;
241  unsigned layer = 0;
242  unsigned module_id = 0;
243  // Scintillator
244  if (det == DetId::HGCalHSc) {
245  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
246  tc_type = trigger_cell_sc_id.type();
247  layer = trigger_cell_sc_id.layer();
248  zside = trigger_cell_sc_id.zside();
249  int ietamin = hscTopology().dddConstants().getREtaRange(layer).first;
250  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
251  int ieta = ((trigger_cell_sc_id.ietaAbs() - ietamin_tc) / hSc_module_size_ + 1) * zside;
252  int iphi = (trigger_cell_sc_id.iphi() - 1) / hSc_module_size_ + 1;
253  module_id = HGCScintillatorDetId(tc_type, layer, ieta, iphi);
254  }
255  // HFNose
256  else if (det == DetId::HGCalTrigger and
257  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
258  HFNoseTriggerDetId trigger_cell_trig_id(trigger_cell_id);
259  tc_type = trigger_cell_trig_id.type();
260  layer = trigger_cell_trig_id.layer();
261  zside = trigger_cell_trig_id.zside();
262  int waferu = trigger_cell_trig_id.waferU();
263  int waferv = trigger_cell_trig_id.waferV();
264 
266  module_id = hfn.getModule(HFNoseDetId(zside, layer, tc_type, waferu, waferv, 0, 0)).rawId();
267  }
268  // Silicon
269  else {
270  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
271  unsigned subdet = trigger_cell_trig_id.subdet();
272  subdet_old =
274  layer = trigger_cell_trig_id.layer();
275  zside = trigger_cell_trig_id.zside();
277  int waferu = trigger_cell_trig_id.waferU();
278  int waferv = trigger_cell_trig_id.waferV();
279  unsigned layer_with_offset = layerWithOffset(trigger_cell_id);
280  unsigned packed_wafer = packLayerWaferId(layer_with_offset, waferu, waferv);
281  auto module_itr = wafer_to_module_.find(packed_wafer);
282  if (module_itr == wafer_to_module_.end()) {
283  // return missing modules as disconnected (id=0)
284  module = 0;
285  auto insert_itr = cache_missing_wafers_.emplace(packed_wafer);
286  if (insert_itr.second) {
287  edm::LogWarning("HGCalTriggerGeometry")
288  << "Found missing wafer (layer=" << layer_with_offset << " u=" << waferu << " v=" << waferv
289  << ") in trigger modules mapping";
290  }
291  } else {
292  module = module_itr->second;
293  }
294  }
295  module_id =
297  }
298  return module_id;
299 }
tbb::concurrent_unordered_set< unsigned > cache_missing_wafers_
std::pair< int, int > getREtaRange(int lay) const
std::unordered_map< unsigned, unsigned > wafer_to_module_
static const HFNoseDetId getModule(HFNoseDetId const &id)
int zside(DetId const &)
ForwardSubdetector
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
static const int kHGCalCellMask
Definition: HGCalDetId.h:11
unsigned layerWithOffset(unsigned) const
unsigned packLayerWaferId(unsigned layer, int waferU, int waferV) const
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const HGCalTopology & hscTopology() const
Log< level::Warning, false > LogWarning
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98

◆ getModulePosition()

GlobalPoint HGCalTriggerGeometryV9Imp2::getModulePosition ( const unsigned  module_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 582 of file HGCalTriggerGeometryV9Imp2.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), DetId::det(), HGCalTriggerGeometryBase::eeGeometry(), DetId::Forward, getCellsFromModule(), HGCalGeometry::getPosition(), HFNose, DetId::HGCalEE, DetId::HGCalHSc, HGCalTriggerGeometryBase::hscGeometry(), HGCalTriggerGeometryBase::hsiGeometry(), and HGCalTriggerGeometryBase::noseGeometry().

582  {
583  unsigned det = DetId(module_det_id).det();
584  // Position: barycenter of the module.
585  Basic3DVector<float> moduleVector(0., 0., 0.);
586  const auto cell_ids = getCellsFromModule(module_det_id);
587  // Scintillator
588  if (det == DetId::HGCalHSc) {
589  for (const auto& cell : cell_ids) {
590  moduleVector += hscGeometry()->getPosition(cell).basicVector();
591  }
592  }
593  // HFNose
594  else if (det == DetId::Forward && DetId(module_det_id).subdetId() == ForwardSubdetector::HFNose) {
595  for (const auto& cell : cell_ids) {
596  HFNoseDetId cellDetId(cell);
597  moduleVector += noseGeometry()->getPosition(cellDetId).basicVector();
598  }
599  } // Silicon
600  else {
601  for (const auto& cell : cell_ids) {
602  HGCSiliconDetId cellDetId(cell);
603  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
604  : hsiGeometry()->getPosition(cellDetId))
605  .basicVector();
606  }
607  }
608 
609  return GlobalPoint(moduleVector / cell_ids.size());
610 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Definition: DetId.h:17
const HGCalGeometry * hscGeometry() const
GlobalPoint getPosition(const DetId &id, bool debug=false) const
const HGCalGeometry * noseGeometry() const
const HGCalGeometry * hsiGeometry() const
const HGCalGeometry * eeGeometry() const
geom_set getCellsFromModule(const unsigned) const final

◆ getModulesFromLpgbt()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getModulesFromLpgbt ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 876 of file HGCalTriggerGeometryV9Imp2.cc.

References LogMessageMonitor_cff::modules.

876  {
878  return modules;
879 }
std::unordered_set< unsigned > geom_set

◆ getModuleSize()

unsigned HGCalTriggerGeometryV9Imp2::getModuleSize ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 533 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), DetId::HGCalHSc, hSc_wafers_per_module_, pixelTopology::layer, layerWithOffset(), callgraph::module, module_to_wafers_, packLayerModuleId(), and HGCalDetId::wafer().

533  {
534  DetId module_det_id(module_id);
535  unsigned nWafers = 1;
536  // Scintillator
537  if (module_det_id.det() == DetId::HGCalHSc) {
538  nWafers = hSc_wafers_per_module_;
539  }
540  // Check for HFNOSE : getModuleSize
541  // Silicon
542  else {
543  HGCalDetId module_det_id_si(module_id);
544  unsigned module = module_det_id_si.wafer();
545  unsigned layer = layerWithOffset(module_id);
546  nWafers = module_to_wafers_.count(packLayerModuleId(layer, module));
547  }
548  return nWafers;
549 }
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned layerWithOffset(unsigned) const
Definition: DetId.h:17
std::unordered_multimap< unsigned, unsigned > module_to_wafers_

◆ getNeighborsFromTriggerCell()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getNeighborsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 507 of file HGCalTriggerGeometryV9Imp2.cc.

References Exception.

508  {
509  throw cms::Exception("FeatureNotImplemented") << "Neighbor search is not implemented in HGCalTriggerGeometryV9Imp2";
510 }

◆ getOrderedCellsFromModule()

HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp2::getOrderedCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 368 of file HGCalTriggerGeometryV9Imp2.cc.

References hgcalTBTopologyTester_cfi::cells, getCellsFromTriggerCell(), and getOrderedTriggerCellsFromModule().

369  {
370  geom_ordered_set cell_det_ids;
371  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
372  for (auto trigger_cell_id : trigger_cells) {
373  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
374  cell_det_ids.insert(cells.begin(), cells.end());
375  }
376  return cell_det_ids;
377 }
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
std::set< unsigned > geom_ordered_set
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final

◆ getOrderedTriggerCellsFromModule()

HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp2::getOrderedTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 445 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), detIdWaferType(), DetId::Forward, HFNoseDetIdToModule::getTriggerDetIds(), HGCSiliconDetIdToROC::getTriggerId(), HFNose, DetId::HGCalEE, HGCalEETrigger, HGCSiliconDetId::HGCalFine, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, HGCEE, hSc_module_size_, heavyIonCSV_trainingSettings::idx, LEDCalibrationChannels::ieta, HGCScintillatorDetId::ietaAbs(), createfilelist::int, HGCScintillatorDetId::iphi(), LEDCalibrationChannels::iphi, HGCalDetId::layer(), HGCScintillatorDetId::layer(), pixelTopology::layer, layerWithOffset(), callgraph::module, module_to_wafers_, packLayerModuleId(), PixelMapPlotter::roc, DetId::subdetId(), HGCScintillatorDetId::type(), unpackWaferId(), validTriggerCellFromCells(), HGCalDetId::wafer(), HGCScintillatorDetId::zside(), and HGCalDetId::zside().

Referenced by getOrderedCellsFromModule().

446  {
447  DetId module_det_id(module_id);
448  unsigned det = module_det_id.det();
449  geom_ordered_set trigger_cell_det_ids;
450  // Scintillator
451  if (det == DetId::HGCalHSc) {
452  HGCScintillatorDetId module_sc_id(module_id);
453  int ieta0 = (module_sc_id.ietaAbs() - 1) * hSc_module_size_ + 1;
454  int iphi0 = (module_sc_id.iphi() - 1) * hSc_module_size_ + 1;
455  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
456  int ieta = ietaAbs * module_sc_id.zside();
457  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
458  unsigned trigger_cell_id = HGCScintillatorDetId(module_sc_id.type(), module_sc_id.layer(), ieta, iphi);
459  if (validTriggerCellFromCells(trigger_cell_id))
460  trigger_cell_det_ids.emplace(trigger_cell_id);
461  }
462  }
463  }
464  // HFNose
465  else if (det == DetId::Forward && DetId(module_det_id).subdetId() == ForwardSubdetector::HFNose) {
466  HFNoseDetId module_nose_id(module_id);
468  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
469  for (auto const& idx : ids) {
470  if (validTriggerCellFromCells(idx.rawId()))
471  trigger_cell_det_ids.emplace(idx);
472  }
473  }
474  // EE or FH
475  else {
476  HGCalDetId module_si_id(module_id);
477  unsigned module = module_si_id.wafer();
478  HGCSiliconDetIdToROC tc2roc;
479  auto wafer_itrs = module_to_wafers_.equal_range(packLayerModuleId(layerWithOffset(module_id), module));
480  // loop on the wafers included in the module
481  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
482  int waferu = 0;
483  int waferv = 0;
484  unpackWaferId(wafer_itr->second, waferu, waferv);
485  DetId::Detector det = (module_si_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
486  HGCalTriggerSubdetector subdet =
489  unsigned layer = module_si_id.layer();
490  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
491  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
492  // Loop on ROCs in wafer
493  for (int roc = 1; roc <= nroc; roc++) {
494  // loop on TCs in ROC
495  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
496  for (const auto& tc_uv : tc_uvs) {
497  HGCalTriggerDetId trigger_cell_id(
498  subdet, module_si_id.zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
499  trigger_cell_det_ids.emplace(trigger_cell_id);
500  }
501  }
502  }
503  }
504  return trigger_cell_det_ids;
505 }
HGCalTriggerSubdetector
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
bool validTriggerCellFromCells(const unsigned) const
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
unsigned layerWithOffset(unsigned) const
Definition: DetId.h:17
Detector
Definition: DetId.h:24
std::set< unsigned > geom_ordered_set
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const

◆ getStage1FpgaFromLpgbt()

unsigned HGCalTriggerGeometryV9Imp2::getStage1FpgaFromLpgbt ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 871 of file HGCalTriggerGeometryV9Imp2.cc.

871  {
872  unsigned stage1_id = 0;
873  return stage1_id;
874 }

◆ getStage1FpgaFromModule()

unsigned HGCalTriggerGeometryV9Imp2::getStage1FpgaFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 886 of file HGCalTriggerGeometryV9Imp2.cc.

886  {
887  unsigned stage1_id = 0;
888  return stage1_id;
889 }

◆ getStage1FpgaFromStage1Link()

unsigned HGCalTriggerGeometryV9Imp2::getStage1FpgaFromStage1Link ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 851 of file HGCalTriggerGeometryV9Imp2.cc.

851  {
852  unsigned stage1_id = 0;
853  return stage1_id;
854 }

◆ getStage1FpgasFromStage2Fpga()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getStage1FpgasFromStage2Fpga ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 836 of file HGCalTriggerGeometryV9Imp2.cc.

836  {
837  geom_set stage1_ids;
838  return stage1_ids;
839 }
std::unordered_set< unsigned > geom_set

◆ getStage1LinksFromStage1Fpga()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getStage1LinksFromStage1Fpga ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 861 of file HGCalTriggerGeometryV9Imp2.cc.

861  {
862  geom_set stage1link_ids;
863  return stage1link_ids;
864 }
std::unordered_set< unsigned > geom_set

◆ getStage1LinksFromStage2Fpga()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getStage1LinksFromStage2Fpga ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 846 of file HGCalTriggerGeometryV9Imp2.cc.

846  {
847  geom_set stage1link_ids;
848  return stage1link_ids;
849 }
std::unordered_set< unsigned > geom_set

◆ getStage2FpgaFromStage1Link()

unsigned HGCalTriggerGeometryV9Imp2::getStage2FpgaFromStage1Link ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 856 of file HGCalTriggerGeometryV9Imp2.cc.

856  {
857  unsigned stage2_id = 0;
858  return stage2_id;
859 }

◆ getStage2FpgasFromStage1Fpga()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getStage2FpgasFromStage1Fpga ( const unsigned  ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 841 of file HGCalTriggerGeometryV9Imp2.cc.

841  {
842  geom_set stage2_ids;
843  return stage2_ids;
844 }
std::unordered_set< unsigned > geom_set

◆ getTriggerCellFromCell()

unsigned HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 192 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), DetId::Forward, HFNose, HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, hSc_triggercell_size_, LEDCalibrationChannels::ieta, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), LEDCalibrationChannels::iphi, HGCScintillatorDetId::layer(), HFNoseDetId::layer(), HGCSiliconDetId::layer(), DetId::subdetId(), HGCSiliconDetId::triggerCellU(), HFNoseDetId::triggerCellU(), HGCSiliconDetId::triggerCellV(), HFNoseDetId::triggerCellV(), HGCScintillatorDetId::type(), HGCSiliconDetId::type(), HFNoseDetId::type(), HGCSiliconDetId::waferU(), HFNoseDetId::waferU(), HGCSiliconDetId::waferV(), HFNoseDetId::waferV(), HGCScintillatorDetId::zside(), HGCSiliconDetId::zside(), and HFNoseDetId::zside().

Referenced by getModuleFromCell().

192  {
193  unsigned det = DetId(cell_id).det();
194  unsigned trigger_cell_id = 0;
195  // Scintillator
196  if (det == DetId::HGCalHSc) {
197  // Very rough mapping from cells to TC
198  HGCScintillatorDetId cell_sc_id(cell_id);
199  int ieta = ((cell_sc_id.ietaAbs() - 1) / hSc_triggercell_size_ + 1) * cell_sc_id.zside();
200  int iphi = (cell_sc_id.iphi() - 1) / hSc_triggercell_size_ + 1;
201  trigger_cell_id = HGCScintillatorDetId(cell_sc_id.type(), cell_sc_id.layer(), ieta, iphi);
202  }
203  // HFNose
204  else if (det == DetId::Forward && DetId(cell_id).subdetId() == ForwardSubdetector::HFNose) {
205  HFNoseDetId cell_nose_id(cell_id);
207  cell_nose_id.zside(),
208  cell_nose_id.type(),
209  cell_nose_id.layer(),
210  cell_nose_id.waferU(),
211  cell_nose_id.waferV(),
212  cell_nose_id.triggerCellU(),
213  cell_nose_id.triggerCellV());
214  }
215  // Silicon
216  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
217  HGCSiliconDetId cell_si_id(cell_id);
218  trigger_cell_id = HGCalTriggerDetId(
220  cell_si_id.zside(),
221  cell_si_id.type(),
222  cell_si_id.layer(),
223  cell_si_id.waferU(),
224  cell_si_id.waferV(),
225  cell_si_id.triggerCellU(),
226  cell_si_id.triggerCellV());
227  }
228  return trigger_cell_id;
229 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17

◆ getTriggerCellPosition()

GlobalPoint HGCalTriggerGeometryV9Imp2::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 551 of file HGCalTriggerGeometryV9Imp2.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), DetId::det(), HGCalTriggerGeometryBase::eeGeometry(), getCellsFromTriggerCell(), HGCalGeometry::getPosition(), HFNoseTrigger, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalTrigger, HGCalTriggerGeometryBase::hscGeometry(), HGCalTriggerGeometryBase::hsiGeometry(), and HGCalTriggerGeometryBase::noseGeometry().

551  {
552  unsigned det = DetId(trigger_cell_det_id).det();
553  // Position: barycenter of the trigger cell.
554  Basic3DVector<float> triggerCellVector(0., 0., 0.);
555  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
556  // Scintillator
557  if (det == DetId::HGCalHSc) {
558  for (const auto& cell : cell_ids) {
559  triggerCellVector += hscGeometry()->getPosition(cell).basicVector();
560  }
561  }
562  // HFNose
563  else if (det == DetId::HGCalTrigger and
564  HGCalTriggerDetId(trigger_cell_det_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
565  for (const auto& cell : cell_ids) {
566  HFNoseDetId cellDetId(cell);
567  triggerCellVector += noseGeometry()->getPosition(cellDetId).basicVector();
568  }
569  }
570  // Silicon
571  else {
572  for (const auto& cell : cell_ids) {
573  HGCSiliconDetId cellDetId(cell);
574  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
575  : hsiGeometry()->getPosition(cellDetId))
576  .basicVector();
577  }
578  }
579  return GlobalPoint(triggerCellVector / cell_ids.size());
580 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Definition: DetId.h:17
const HGCalGeometry * hscGeometry() const
GlobalPoint getPosition(const DetId &id, bool debug=false) const
const HGCalGeometry * noseGeometry() const
const HGCalGeometry * hsiGeometry() const
geom_set getCellsFromTriggerCell(const unsigned) const final
const HGCalGeometry * eeGeometry() const

◆ getTriggerCellsFromModule()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 379 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTopology::dddConstants(), DetId::det(), detIdWaferType(), dqmdumpme::first, DetId::Forward, HGCalDDDConstants::getREtaRange(), HFNoseDetIdToModule::getTriggerDetIds(), HGCSiliconDetIdToROC::getTriggerId(), HFNose, DetId::HGCalEE, HGCalEETrigger, HGCSiliconDetId::HGCalFine, DetId::HGCalHSc, DetId::HGCalHSi, HGCalHSiTrigger, HGCEE, hSc_module_size_, hSc_triggercell_size_, HGCalTriggerGeometryBase::hscTopology(), heavyIonCSV_trainingSettings::idx, LEDCalibrationChannels::ieta, HGCScintillatorDetId::ietaAbs(), createfilelist::int, HGCScintillatorDetId::iphi(), LEDCalibrationChannels::iphi, HGCalDetId::layer(), HGCScintillatorDetId::layer(), pixelTopology::layer, layerWithOffset(), callgraph::module, module_to_wafers_, packLayerModuleId(), PixelMapPlotter::roc, DetId::subdetId(), HGCScintillatorDetId::type(), unpackWaferId(), validTriggerCellFromCells(), HGCalDetId::wafer(), HGCScintillatorDetId::zside(), and HGCalDetId::zside().

Referenced by getCellsFromModule().

380  {
381  DetId module_det_id(module_id);
382  unsigned det = module_det_id.det();
383  geom_set trigger_cell_det_ids;
384  // Scintillator
385  if (det == DetId::HGCalHSc) {
386  HGCScintillatorDetId module_sc_id(module_id);
387  int ietamin = hscTopology().dddConstants().getREtaRange(module_sc_id.layer()).first;
388  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
389  int ieta0 = (module_sc_id.ietaAbs() - 1) * hSc_module_size_ + ietamin_tc;
390  int iphi0 = (module_sc_id.iphi() - 1) * hSc_module_size_ + 1;
391  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
392  int ieta = ietaAbs * module_sc_id.zside();
393  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
394  unsigned trigger_cell_id = HGCScintillatorDetId(module_sc_id.type(), module_sc_id.layer(), ieta, iphi);
395  if (validTriggerCellFromCells(trigger_cell_id))
396  trigger_cell_det_ids.emplace(trigger_cell_id);
397  }
398  }
399  }
400  // HFNose
401  else if (det == DetId::Forward && module_det_id.subdetId() == ForwardSubdetector::HFNose) {
402  HFNoseDetId module_nose_id(module_id);
404  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
405  for (auto const& idx : ids) {
406  if (validTriggerCellFromCells(idx.rawId()))
407  trigger_cell_det_ids.emplace(idx);
408  }
409  }
410  // Silicon
411  else {
412  HGCalDetId module_si_id(module_id);
413  unsigned module = module_si_id.wafer();
414  HGCSiliconDetIdToROC tc2roc;
415  auto wafer_itrs = module_to_wafers_.equal_range(packLayerModuleId(layerWithOffset(module_id), module));
416  // loop on the wafers included in the module
417  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
418  int waferu = 0;
419  int waferv = 0;
420  unpackWaferId(wafer_itr->second, waferu, waferv);
421  DetId::Detector det = (module_si_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
422  HGCalTriggerSubdetector subdet =
425  unsigned layer = module_si_id.layer();
426  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
427  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
428  // Loop on ROCs in wafer
429  for (int roc = 1; roc <= nroc; roc++) {
430  // loop on TCs in ROC
431  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
432  for (const auto& tc_uv : tc_uvs) {
433  HGCalTriggerDetId trigger_cell_id(
434  subdet, module_si_id.zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
435  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
436  trigger_cell_det_ids.emplace(trigger_cell_id);
437  }
438  }
439  }
440  }
441 
442  return trigger_cell_det_ids;
443 }
HGCalTriggerSubdetector
std::pair< int, int > getREtaRange(int lay) const
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
bool validTriggerCellFromCells(const unsigned) const
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
unsigned layerWithOffset(unsigned) const
Definition: DetId.h:17
Detector
Definition: DetId.h:24
const HGCalTopology & hscTopology() const
std::unordered_set< unsigned > geom_set
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98

◆ initialize() [1/2]

void HGCalTriggerGeometryV9Imp2::initialize ( const HGCalGeometry hgc_ee_geometry,
const HGCalGeometry hgc_hsi_geometry,
const HGCalGeometry hgc_hsc_geometry 
)
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 130 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTopology::dddConstants(), disconnected_layers_, HGCalTriggerGeometryBase::eeTopology(), fillMaps(), heOffset_, HGCalTriggerGeometryBase::hsiTopology(), last_trigger_layer_, pixelTopology::layer, HGCalDDDConstants::layers(), HGCalTriggerGeometryBase::setEEGeometry(), HGCalTriggerGeometryBase::setHScGeometry(), HGCalTriggerGeometryBase::setHSiGeometry(), totalLayers_, and trigger_layers_.

132  {
133  setEEGeometry(hgc_ee_geometry);
134  setHSiGeometry(hgc_hsi_geometry);
135  setHScGeometry(hgc_hsc_geometry);
138  trigger_layers_.resize(totalLayers_ + 1);
139  trigger_layers_[0] = 0; // layer number 0 doesn't exist
140  unsigned trigger_layer = 1;
141  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
142  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
143  // Increase trigger layer number if the layer is not disconnected
144  trigger_layers_[layer] = trigger_layer;
145  trigger_layer++;
146  } else {
147  trigger_layers_[layer] = 0;
148  }
149  }
150  last_trigger_layer_ = trigger_layer - 1;
151  fillMaps();
152 }
void setEEGeometry(const HGCalGeometry *geom)
std::vector< unsigned > trigger_layers_
const HGCalTopology & eeTopology() const
void setHSiGeometry(const HGCalGeometry *geom)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void setHScGeometry(const HGCalGeometry *geom)
unsigned int layers(bool reco) const
std::unordered_set< unsigned > disconnected_layers_
const HGCalTopology & hsiTopology() const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98

◆ initialize() [2/2]

void HGCalTriggerGeometryV9Imp2::initialize ( const HGCalGeometry hgc_ee_geometry,
const HGCalGeometry hgc_hsi_geometry,
const HGCalGeometry hgc_hsc_geometry,
const HGCalGeometry hgc_nose_geometry 
)
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 154 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTopology::dddConstants(), disconnected_layers_, HGCalTriggerGeometryBase::eeTopology(), fillMaps(), heOffset_, HGCalTriggerGeometryBase::hsiTopology(), last_trigger_layer_, pixelTopology::layer, HGCalDDDConstants::layers(), noseLayers_, HGCalTriggerGeometryBase::noseTopology(), HGCalTriggerGeometryBase::setEEGeometry(), HGCalTriggerGeometryBase::setHScGeometry(), HGCalTriggerGeometryBase::setHSiGeometry(), HGCalTriggerGeometryBase::setNoseGeometry(), totalLayers_, trigger_layers_, and trigger_nose_layers_.

157  {
158  setEEGeometry(hgc_ee_geometry);
159  setHSiGeometry(hgc_hsi_geometry);
160  setHScGeometry(hgc_hsc_geometry);
161  setNoseGeometry(hgc_nose_geometry);
162 
165 
166  trigger_layers_.resize(totalLayers_ + 1);
167  trigger_layers_[0] = 0; // layer number 0 doesn't exist
168  unsigned trigger_layer = 1;
169  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
170  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
171  // Increase trigger layer number if the layer is not disconnected
172  trigger_layers_[layer] = trigger_layer;
173  trigger_layer++;
174  } else {
175  trigger_layers_[layer] = 0;
176  }
177  }
178  last_trigger_layer_ = trigger_layer - 1;
179  fillMaps();
180 
182 
183  trigger_nose_layers_.resize(noseLayers_ + 1);
184  trigger_nose_layers_[0] = 0; // layer number 0 doesn't exist
185  unsigned trigger_nose_layer = 1;
186  for (unsigned layer = 1; layer < trigger_nose_layers_.size(); layer++) {
187  trigger_nose_layers_[layer] = trigger_nose_layer;
188  trigger_nose_layer++;
189  }
190 }
void setEEGeometry(const HGCalGeometry *geom)
std::vector< unsigned > trigger_layers_
const HGCalTopology & eeTopology() const
void setHSiGeometry(const HGCalGeometry *geom)
void setNoseGeometry(const HGCalGeometry *geom)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void setHScGeometry(const HGCalGeometry *geom)
unsigned int layers(bool reco) const
std::vector< unsigned > trigger_nose_layers_
const HGCalTopology & noseTopology() const
std::unordered_set< unsigned > disconnected_layers_
const HGCalTopology & hsiTopology() const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98

◆ lastTriggerLayer()

unsigned HGCalTriggerGeometryV9Imp2::lastTriggerLayer ( ) const
inlinefinalvirtual

◆ layerWithOffset()

unsigned HGCalTriggerGeometryV9Imp2::layerWithOffset ( unsigned  id) const
private

Definition at line 808 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), DetId::Forward, heOffset_, HFNose, HFNoseTrigger, HGCalEETrigger, DetId::HGCalHSc, HGCalHSiTrigger, DetId::HGCalTrigger, HGCEE, HGCHEB, HGCHEF, HGCalDetId::layer(), HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), HFNoseDetId::layer(), pixelTopology::layer, HGCalTriggerDetId::subdet(), and DetId::subdetId().

Referenced by disconnectedModule(), getLinksInModule(), getModuleFromTriggerCell(), getModuleSize(), getOrderedTriggerCellsFromModule(), getTriggerCellsFromModule(), and triggerLayer().

808  {
809  unsigned det = DetId(id).det();
810  unsigned layer = 0;
811 
812  if (det == DetId::HGCalTrigger) {
813  unsigned subdet = HGCalTriggerDetId(id).subdet();
815  layer = HGCalTriggerDetId(id).layer();
816  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
818  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
820  }
821  } else if (det == DetId::HGCalHSc) {
823  } else if (det == DetId::Forward) {
824  unsigned subdet = HGCalDetId(id).subdetId();
825  if (subdet == ForwardSubdetector::HGCEE) {
826  layer = HGCalDetId(id).layer();
827  } else if (subdet == ForwardSubdetector::HGCHEF || subdet == ForwardSubdetector::HGCHEB) {
828  layer = heOffset_ + HGCalDetId(id).layer();
829  } else if (subdet == ForwardSubdetector::HFNose) {
830  layer = HFNoseDetId(id).layer();
831  }
832  }
833  return layer;
834 }
int layer() const
get the layer #
Definition: HFNoseDetId.h:57
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int layer() const
get the layer #
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
int layer() const
get the layer #
HGCalTriggerSubdetector subdet() const
get the subdetector
int layer() const
get the layer #
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
int layer() const
get the layer #
Definition: HGCalDetId.h:46

◆ packLayerModuleId()

unsigned HGCalTriggerGeometryV9Imp2::packLayerModuleId ( unsigned  layer,
unsigned  wafer 
) const
private

Definition at line 683 of file HGCalTriggerGeometryV9Imp2.cc.

References heOffset_, HGCEE, HGCHEF, HGCalDetId::kHGCalLayerMask, HGCalDetId::kHGCalLayerOffset, HGCalDetId::kHGCalWaferMask, HGCalDetId::kHGCalWaferOffset, DetId::kSubdetMask, DetId::kSubdetOffset, pixelTopology::layer, and callgraph::module.

Referenced by fillMaps(), getLinksInModule(), getModuleSize(), getOrderedTriggerCellsFromModule(), and getTriggerCellsFromModule().

683  {
684  unsigned packed_value = 0;
685  unsigned subdet = ForwardSubdetector::HGCEE;
686  if (layer > heOffset_) {
687  layer -= heOffset_;
689  }
692  packed_value |= ((subdet & DetId::kSubdetMask) << DetId::kSubdetOffset);
693  return packed_value;
694 }
static const int kHGCalLayerOffset
Definition: HGCalDetId.h:16
static const int kHGCalLayerMask
Definition: HGCalDetId.h:17
static const int kSubdetOffset
Definition: DetId.h:22
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
static const int kSubdetMask
Definition: DetId.h:20
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:12
static const int kHGCalWaferMask
Definition: HGCalDetId.h:13

◆ packLayerWaferId()

unsigned HGCalTriggerGeometryV9Imp2::packLayerWaferId ( unsigned  layer,
int  waferU,
int  waferV 
) const
private

Definition at line 665 of file HGCalTriggerGeometryV9Imp2.cc.

References funct::abs(), heOffset_, HGCEE, HGCHEF, HGCSiliconDetId::kHGCalLayerMask, HGCSiliconDetId::kHGCalLayerOffset, HGCSiliconDetId::kHGCalWaferUMask, HGCSiliconDetId::kHGCalWaferUOffset, HGCSiliconDetId::kHGCalWaferUSignMask, HGCSiliconDetId::kHGCalWaferUSignOffset, HGCSiliconDetId::kHGCalWaferVMask, HGCSiliconDetId::kHGCalWaferVOffset, HGCSiliconDetId::kHGCalWaferVSignMask, HGCSiliconDetId::kHGCalWaferVSignOffset, DetId::kSubdetMask, DetId::kSubdetOffset, pixelTopology::layer, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by fillMaps(), and getModuleFromTriggerCell().

665  {
666  unsigned packed_value = 0;
667  unsigned subdet = ForwardSubdetector::HGCEE;
668  if (layer > heOffset_) {
669  layer -= heOffset_;
671  }
672  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
673  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
679  packed_value |= ((subdet & DetId::kSubdetMask) << DetId::kSubdetOffset);
680  return packed_value;
681 }
static const int kHGCalWaferVOffset
int32_t waferU(const int32_t index)
static const int kHGCalWaferVSignOffset
static const int kSubdetOffset
Definition: DetId.h:22
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
static const int kSubdetMask
Definition: DetId.h:20
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalLayerMask
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
static const int kHGCalWaferVSignMask
static const int kHGCalLayerOffset
int32_t waferV(const int32_t index)
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset

◆ packWaferId()

unsigned HGCalTriggerGeometryV9Imp2::packWaferId ( int  waferU,
int  waferV 
) const
private

Definition at line 654 of file HGCalTriggerGeometryV9Imp2.cc.

References funct::abs(), HGCSiliconDetId::kHGCalWaferUMask, HGCSiliconDetId::kHGCalWaferUOffset, HGCSiliconDetId::kHGCalWaferUSignMask, HGCSiliconDetId::kHGCalWaferUSignOffset, HGCSiliconDetId::kHGCalWaferVMask, HGCSiliconDetId::kHGCalWaferVOffset, HGCSiliconDetId::kHGCalWaferVSignMask, HGCSiliconDetId::kHGCalWaferVSignOffset, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by fillMaps().

654  {
655  unsigned packed_value = 0;
656  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
657  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
662  return packed_value;
663 }
static const int kHGCalWaferVOffset
int32_t waferU(const int32_t index)
static const int kHGCalWaferVSignOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
static const int kHGCalWaferVSignMask
int32_t waferV(const int32_t index)
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset

◆ reset()

void HGCalTriggerGeometryV9Imp2::reset ( void  )
finalvirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 124 of file HGCalTriggerGeometryV9Imp2.cc.

References cache_missing_wafers_, module_to_wafers_, and wafer_to_module_.

124  {
125  wafer_to_module_.clear();
126  module_to_wafers_.clear();
127  cache_missing_wafers_.clear();
128 }
tbb::concurrent_unordered_set< unsigned > cache_missing_wafers_
std::unordered_map< unsigned, unsigned > wafer_to_module_
std::unordered_multimap< unsigned, unsigned > module_to_wafers_

◆ triggerLayer()

unsigned HGCalTriggerGeometryV9Imp2::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 718 of file HGCalTriggerGeometryV9Imp2.cc.

References HFNoseTrigger, DetId::HGCalTrigger, pixelTopology::layer, layerWithOffset(), trigger_layers_, and trigger_nose_layers_.

718  {
719  unsigned layer = layerWithOffset(id);
720 
721  if (DetId(id).det() == DetId::HGCalTrigger and
723  if (layer >= trigger_nose_layers_.size())
724  return 0;
725  return trigger_nose_layers_[layer];
726  }
727  if (layer >= trigger_layers_.size())
728  return 0;
729  return trigger_layers_[layer];
730 }
std::vector< unsigned > trigger_layers_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned layerWithOffset(unsigned) const
std::vector< unsigned > trigger_nose_layers_
Definition: DetId.h:17

◆ unpackWaferId()

void HGCalTriggerGeometryV9Imp2::unpackWaferId ( unsigned  wafer,
int &  waferU,
int &  waferV 
) const
private

Definition at line 696 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCSiliconDetId::kHGCalWaferUMask, HGCSiliconDetId::kHGCalWaferUOffset, HGCSiliconDetId::kHGCalWaferUSignMask, HGCSiliconDetId::kHGCalWaferUSignOffset, HGCSiliconDetId::kHGCalWaferVMask, HGCSiliconDetId::kHGCalWaferVOffset, HGCSiliconDetId::kHGCalWaferVSignMask, HGCSiliconDetId::kHGCalWaferVSignOffset, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by getOrderedTriggerCellsFromModule(), and getTriggerCellsFromModule().

696  {
700  : waferUAbs);
702  : waferVAbs);
703 }
static const int kHGCalWaferVOffset
int32_t waferU(const int32_t index)
static const int kHGCalWaferVSignOffset
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
static const int kHGCalWaferVSignMask
int32_t waferV(const int32_t index)
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset

◆ validCell()

bool HGCalTriggerGeometryV9Imp2::validCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 732 of file HGCalTriggerGeometryV9Imp2.cc.

References DetId::det(), HGCalTriggerGeometryBase::eeTopology(), DetId::Forward, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerGeometryBase::hsiTopology(), HGCalTriggerGeometryBase::noseTopology(), and HGCalTopology::valid().

732  {
733  bool is_valid = false;
734  unsigned det = DetId(cell_id).det();
735  switch (det) {
736  case DetId::HGCalEE:
737  is_valid = eeTopology().valid(cell_id);
738  break;
739  case DetId::HGCalHSi:
740  is_valid = hsiTopology().valid(cell_id);
741  break;
742  case DetId::HGCalHSc:
743  is_valid = hscTopology().valid(cell_id);
744  break;
745  case DetId::Forward:
746  is_valid = noseTopology().valid(cell_id);
747  break;
748  default:
749  is_valid = false;
750  break;
751  }
752  return is_valid;
753 }
bool valid(const DetId &id) const override
Is this a valid cell id.
const HGCalTopology & eeTopology() const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
Definition: DetId.h:17
const HGCalTopology & noseTopology() const
const HGCalTopology & hscTopology() const
const HGCalTopology & hsiTopology() const

◆ validCellId()

bool HGCalTriggerGeometryV9Imp2::validCellId ( unsigned  det,
unsigned  cell_id 
) const
private

Definition at line 771 of file HGCalTriggerGeometryV9Imp2.cc.

References HGCalTriggerGeometryBase::eeTopology(), DetId::Forward, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerGeometryBase::hsiTopology(), HGCalTriggerGeometryBase::noseTopology(), and HGCalTopology::valid().

Referenced by getCellsFromTriggerCell(), and validTriggerCellFromCells().

771  {
772  bool is_valid = false;
773  switch (subdet) {
774  case DetId::HGCalEE:
775  is_valid = eeTopology().valid(cell_id);
776  break;
777  case DetId::HGCalHSi:
778  is_valid = hsiTopology().valid(cell_id);
779  break;
780  case DetId::HGCalHSc:
781  is_valid = hscTopology().valid(cell_id);
782  break;
783  case DetId::Forward:
784  is_valid = noseTopology().valid(cell_id);
785  break;
786  default:
787  is_valid = false;
788  break;
789  }
790  return is_valid;
791 }
bool valid(const DetId &id) const override
Is this a valid cell id.
const HGCalTopology & eeTopology() const
const HGCalTopology & noseTopology() const
const HGCalTopology & hscTopology() const
const HGCalTopology & hsiTopology() const

◆ validTriggerCell()

bool HGCalTriggerGeometryV9Imp2::validTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 705 of file HGCalTriggerGeometryV9Imp2.cc.

References validTriggerCellFromCells().

705  {
706  return validTriggerCellFromCells(trigger_cell_id);
707 }
bool validTriggerCellFromCells(const unsigned) const

◆ validTriggerCellFromCells()

bool HGCalTriggerGeometryV9Imp2::validTriggerCellFromCells ( const unsigned  trigger_cell_id) const
private

Definition at line 755 of file HGCalTriggerGeometryV9Imp2.cc.

References hgcalTBTopologyTester_cfi::cells, DetId::det(), getCellsFromTriggerCell(), and validCellId().

Referenced by getOrderedTriggerCellsFromModule(), getTriggerCellsFromModule(), and validTriggerCell().

755  {
756  // Check the validity of a trigger cell with the
757  // validity of the cells. One valid cell in the
758  // trigger cell is enough to make the trigger cell
759  // valid.
760  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
761  bool is_valid = false;
762  for (const auto cell_id : cells) {
763  unsigned det = DetId(cell_id).det();
764  is_valid |= validCellId(det, cell_id);
765  if (is_valid)
766  break;
767  }
768  return is_valid;
769 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
Definition: DetId.h:17
bool validCellId(unsigned det, unsigned cell_id) const
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final

Member Data Documentation

◆ cache_missing_wafers_

tbb::concurrent_unordered_set<unsigned> HGCalTriggerGeometryV9Imp2::cache_missing_wafers_
mutableprivate

Definition at line 79 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by getModuleFromTriggerCell(), and reset().

◆ disconnected_layers_

std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp2::disconnected_layers_
private

◆ disconnected_modules_

std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp2::disconnected_modules_
private

Definition at line 82 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by disconnectedModule(), and HGCalTriggerGeometryV9Imp2().

◆ heOffset_

unsigned HGCalTriggerGeometryV9Imp2::heOffset_ = 0
private

◆ hSc_links_per_module_

unsigned HGCalTriggerGeometryV9Imp2::hSc_links_per_module_ = 1
private

Definition at line 67 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by getLinksInModule().

◆ hSc_module_size_

unsigned HGCalTriggerGeometryV9Imp2::hSc_module_size_ = 12
private

◆ hSc_triggercell_size_

unsigned HGCalTriggerGeometryV9Imp2::hSc_triggercell_size_ = 2
private

◆ hSc_wafers_per_module_

unsigned HGCalTriggerGeometryV9Imp2::hSc_wafers_per_module_ = 3
private

Definition at line 68 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by getModuleSize(), and HGCalTriggerGeometryV9Imp2().

◆ l1tLinksMapping_

edm::FileInPath HGCalTriggerGeometryV9Imp2::l1tLinksMapping_
private

Definition at line 73 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by fillMaps().

◆ l1tModulesMapping_

edm::FileInPath HGCalTriggerGeometryV9Imp2::l1tModulesMapping_
private

Definition at line 72 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by fillMaps().

◆ last_trigger_layer_

unsigned HGCalTriggerGeometryV9Imp2::last_trigger_layer_ = 0
private

Definition at line 86 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by initialize(), and lastTriggerLayer().

◆ links_per_module_

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp2::links_per_module_
private

Definition at line 78 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by fillMaps(), and getLinksInModule().

◆ module_to_wafers_

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp2::module_to_wafers_
private

◆ noseLayers_

unsigned HGCalTriggerGeometryV9Imp2::noseLayers_ = 0
private

Definition at line 90 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by initialize().

◆ sector0_mask_

unsigned HGCalTriggerGeometryV9Imp2::sector0_mask_ = 0x7f
private

Definition at line 70 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by fillMaps(), and getLinksInModule().

◆ totalLayers_

unsigned HGCalTriggerGeometryV9Imp2::totalLayers_ = 0
private

Definition at line 91 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by initialize().

◆ trigger_layers_

std::vector<unsigned> HGCalTriggerGeometryV9Imp2::trigger_layers_
private

Definition at line 84 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by initialize(), and triggerLayer().

◆ trigger_nose_layers_

std::vector<unsigned> HGCalTriggerGeometryV9Imp2::trigger_nose_layers_
private

Definition at line 85 of file HGCalTriggerGeometryV9Imp2.cc.

Referenced by initialize(), and triggerLayer().

◆ wafer_to_module_

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp2::wafer_to_module_
private

Definition at line 76 of file HGCalTriggerGeometryV9Imp2.cc.

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