CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
HGCalTriggerGeometryV9Imp1 Class Reference
Inheritance diagram for HGCalTriggerGeometryV9Imp1:
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 getModuleFromCell (const unsigned) const final
 
unsigned getModuleFromTriggerCell (const unsigned) const final
 
GlobalPoint getModulePosition (const unsigned) 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 getTriggerCellFromCell (const unsigned) const final
 
GlobalPoint getTriggerCellPosition (const unsigned) const final
 
geom_set getTriggerCellsFromModule (const unsigned) const final
 
 HGCalTriggerGeometryV9Imp1 (const edm::ParameterSet &conf)
 
void initialize (const edm::ESHandle< CaloGeometry > &) final
 
void initialize (const edm::ESHandle< HGCalGeometry > &, const edm::ESHandle< HGCalGeometry > &, const edm::ESHandle< HGCalGeometry > &) final
 
void reset () final
 
unsigned triggerLayer (const unsigned) const final
 
bool validTriggerCell (const unsigned) const final
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const HcalGeometrybhGeometry () const
 
const HcalTopologybhTopology () const
 
const edm::ESHandle< CaloGeometry > & caloGeometry () const
 
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 isV9Geometry () const
 
const std::string & name () const
 
virtual ~HGCalTriggerGeometryBase ()
 

Private Types

typedef std::unordered_map< int, std::set< std::pair< short, short > > > neighbor_map
 

Private Member Functions

int detIdWaferType (unsigned det, unsigned layer, short waferU, short waferV) const
 
void fillInvalidTriggerCells ()
 
void fillMaps ()
 
void fillNeighborMap (const edm::FileInPath &, neighbor_map &, bool)
 
unsigned layerWithOffset (unsigned) const
 
unsigned packCellId (unsigned type, unsigned cellU, unsigned cellV) const
 
unsigned packCellId (unsigned type, unsigned cell) const
 
unsigned packIetaIphi (unsigned ieta, unsigned iphi) const
 
unsigned packTriggerCell (unsigned, unsigned) const
 
unsigned packTriggerCellWithType (unsigned, unsigned, unsigned) const
 
unsigned packWaferCellId (unsigned subdet, unsigned wafer, unsigned cell) const
 
unsigned packWaferId (int waferU, int waferV) const
 
void unpackCellId (unsigned cell, unsigned &cellU, unsigned &cellV) const
 
void unpackIetaIphi (unsigned ieta_iphi, unsigned &ieta, unsigned &iphi) const
 
void unpackWaferCellId (unsigned wafer_cell, unsigned &wafer, unsigned &cell) 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

std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
 
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_sci_
 
std::unordered_set< unsigned > disconnected_layers_
 
std::unordered_set< unsigned > disconnected_modules_
 
unsigned heOffset_
 
std::unordered_set< unsigned > invalid_triggercells_
 
edm::FileInPath l1tCellNeighborsMapping_
 
edm::FileInPath l1tCellNeighborsSciMapping_
 
edm::FileInPath l1tCellsMapping_
 
edm::FileInPath l1tCellsSciMapping_
 
edm::FileInPath l1tModulesMapping_
 
edm::FileInPath l1tWafersMapping_
 
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
 
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
 
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
 
unsigned totalLayers_
 
neighbor_map trigger_cell_neighbors_
 
neighbor_map trigger_cell_neighbors_sci_
 
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
 
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_sci_
 
std::vector< unsigned > trigger_layers_
 
std::unordered_map< unsigned, unsigned > wafer_to_module_
 
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
 
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
 

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 setCaloGeometry (const edm::ESHandle< CaloGeometry > &geom)
 
void setEEGeometry (const edm::ESHandle< HGCalGeometry > &geom)
 
void setHScGeometry (const edm::ESHandle< HGCalGeometry > &geom)
 
void setHSiGeometry (const edm::ESHandle< HGCalGeometry > &geom)
 

Detailed Description

Definition at line 13 of file HGCalTriggerGeometryV9Imp1.cc.

Member Typedef Documentation

typedef std::unordered_map<int, std::set<std::pair<short, short> > > HGCalTriggerGeometryV9Imp1::neighbor_map
private

Definition at line 70 of file HGCalTriggerGeometryV9Imp1.cc.

Constructor & Destructor Documentation

HGCalTriggerGeometryV9Imp1::HGCalTriggerGeometryV9Imp1 ( const edm::ParameterSet conf)

Definition at line 105 of file HGCalTriggerGeometryV9Imp1.cc.

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

106  : HGCalTriggerGeometryBase(conf),
107  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
108  l1tCellsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellsSciMapping")),
109  l1tWafersMapping_(conf.getParameter<edm::FileInPath>("L1TWafersMapping")),
110  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
111  l1tCellNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsMapping")),
112  l1tCellNeighborsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsSciMapping")) {
113  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
114  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
115  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
116  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
117 }
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
T getParameter(std::string const &) const
std::unordered_set< unsigned > disconnected_layers_
std::unordered_set< unsigned > disconnected_modules_
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

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

Definition at line 878 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalTopology::dddConstants(), HGCalTriggerGeometryBase::eeTopology(), HGCalDDDConstants::getTypeHex(), DetId::HGCalEE, DetId::HGCalHSi, and HGCalTriggerGeometryBase::hsiTopology().

Referenced by fillInvalidTriggerCells(), getCellsFromTriggerCell(), getOrderedTriggerCellsFromModule(), and getTriggerCellsFromModule().

878  {
879  int wafer_type = 0;
880  switch (det) {
881  case DetId::HGCalEE:
882  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
883  break;
884  case DetId::HGCalHSi:
885  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
886  break;
887  default:
888  break;
889  };
890  return wafer_type;
891 }
const HGCalTopology & eeTopology() const
int getTypeHex(int layer, int waferU, int waferV) const
const HGCalTopology & hsiTopology() const
const HGCalDDDConstants & dddConstants() const
bool HGCalTriggerGeometryV9Imp1::disconnectedModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 809 of file HGCalTriggerGeometryV9Imp1.cc.

References disconnected_layers_, disconnected_modules_, and layerWithOffset().

809  {
810  bool disconnected = false;
811  if (disconnected_modules_.find(HGCalDetId(module_id).wafer()) != disconnected_modules_.end())
812  disconnected = true;
813  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end())
814  disconnected = true;
815  return disconnected;
816 }
std::unordered_set< unsigned > disconnected_layers_
std::unordered_set< unsigned > disconnected_modules_
unsigned layerWithOffset(unsigned) const
void HGCalTriggerGeometryV9Imp1::fillInvalidTriggerCells ( )
private

Definition at line 674 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalTopology::dddConstants(), detIdWaferType(), HGCalTriggerGeometryBase::eeTopology(), HGCalDDDConstants::firstLayer(), getNeighborsFromTriggerCell(), HGCalDDDConstants::getTypeTrap(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, HGCalTriggerGeometryBase::hscTopology(), invalid_triggercells_, HGCalDDDConstants::layers(), number_trigger_cells_in_wafers_, number_trigger_cells_in_wafers_sci_, unpackWaferId(), validTriggerCellFromCells(), wafers_old_to_wafers_, wafers_to_wafers_old_, and ecaldqm::zside().

Referenced by initialize().

674  {
675  unsigned n_layers_ee = eeTopology().dddConstants().layers(true);
676  for (unsigned layer = 1; layer <= n_layers_ee; layer++) {
677  for (const auto& waferuv_wafer : wafers_to_wafers_old_) {
678  int waferu = 0;
679  int waferv = 0;
680  unpackWaferId(waferuv_wafer.first, waferu, waferv);
681  unsigned waferee_type = detIdWaferType(DetId::HGCalEE, layer, waferu, waferv);
682  unsigned waferfh_type = detIdWaferType(DetId::HGCalHSi, layer, waferu, waferv);
683  unsigned trigger_wafer = waferuv_wafer.second;
684  // loop on the trigger cells in each wafer
685  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(waferee_type); trigger_cell++) {
686  for (int zside : {-1, 1}) {
687  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCEE, zside, layer, 1, trigger_wafer, trigger_cell);
688  if (!validTriggerCellFromCells(trigger_cell_id))
689  invalid_triggercells_.emplace(trigger_cell_id);
690  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
691  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
692  if (wafer_itr == wafers_old_to_wafers_.end())
693  invalid_triggercells_.emplace(neighbor);
694  else if (!validTriggerCellFromCells(neighbor))
695  invalid_triggercells_.emplace(neighbor);
696  }
697  }
698  }
699  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(waferfh_type); trigger_cell++) {
700  for (int zside : {-1, 1}) {
701  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEF, zside, layer, 1, trigger_wafer, trigger_cell);
702  if (!validTriggerCellFromCells(trigger_cell_id))
703  invalid_triggercells_.emplace(trigger_cell_id);
704  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
705  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
706  if (wafer_itr == wafers_old_to_wafers_.end())
707  invalid_triggercells_.emplace(neighbor);
708  else if (!validTriggerCellFromCells(neighbor))
709  invalid_triggercells_.emplace(neighbor);
710  }
711  }
712  }
713  }
714  }
715  unsigned n_layers_hsc = hscTopology().dddConstants().layers(true);
716  unsigned first_layer_hsc = hscTopology().dddConstants().firstLayer();
717  for (unsigned layer = first_layer_hsc; layer <= first_layer_hsc + n_layers_hsc; layer++) {
718  int type = hscTopology().dddConstants().getTypeTrap(layer);
719  for (const auto& module_ncells : number_trigger_cells_in_wafers_sci_) {
720  unsigned trigger_wafer = module_ncells.first;
721  // loop on the trigger cells in each wafer
722  for (int trigger_cell = 1; trigger_cell < module_ncells.second; trigger_cell++) {
723  for (int zside : {-1, 1}) {
724  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEB, zside, layer, type, trigger_wafer, trigger_cell);
725  if (!validTriggerCellFromCells(trigger_cell_id))
726  invalid_triggercells_.emplace(trigger_cell_id);
727  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
728  if (!validTriggerCellFromCells(neighbor))
729  invalid_triggercells_.emplace(neighbor);
730  }
731  }
732  }
733  }
734  }
735 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
type
Definition: HCALResponse.h:21
int getTypeTrap(int layer) const
const HGCalTopology & eeTopology() const
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
int zside(DetId const &)
unsigned int layers(bool reco) const
const HGCalDDDConstants & dddConstants() const
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
const HGCalTopology & hscTopology() const
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
bool validTriggerCellFromCells(const unsigned) const
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
int firstLayer() const
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
geom_set getNeighborsFromTriggerCell(const unsigned) const final
std::unordered_set< unsigned > invalid_triggercells_
void HGCalTriggerGeometryV9Imp1::fillMaps ( )
private

Definition at line 515 of file HGCalTriggerGeometryV9Imp1.cc.

References cells_to_trigger_cells_, cells_to_trigger_cells_sci_, Exception, edm::FileInPath::fullPath(), HGCHEB, l1tCellsMapping_, l1tCellsSciMapping_, l1tModulesMapping_, l1tWafersMapping_, module_to_wafers_, number_trigger_cells_in_wafers_, number_trigger_cells_in_wafers_sci_, packCellId(), packIetaIphi(), packWaferCellId(), packWaferId(), trigger_cells_to_cells_, trigger_cells_to_cells_sci_, wafer_to_module_, wafers_old_to_wafers_, and wafers_to_wafers_old_.

Referenced by initialize().

515  {
516  //
517  // read module mapping file
518  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
519  if (!l1tModulesMappingStream.is_open()) {
520  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
521  }
522  short trigger_wafer = 0;
523  short module = 0;
524  for (; l1tModulesMappingStream >> trigger_wafer >> module;) {
525  wafer_to_module_.emplace(trigger_wafer, module);
526  module_to_wafers_.emplace(module, trigger_wafer);
527  }
528  if (!l1tModulesMappingStream.eof()) {
529  throw cms::Exception("BadGeometryFile")
530  << "Error reading L1TModulesMapping '" << trigger_wafer << " " << module << "' \n";
531  }
532  l1tModulesMappingStream.close();
533  // read trigger cell mapping file
534  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
535  if (!l1tCellsMappingStream.is_open()) {
536  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsMapping file\n";
537  }
538  short type = 0;
539  short cellu = 0;
540  short cellv = 0;
541  short trigger_cell = 0;
542  for (; l1tCellsMappingStream >> type >> cellu >> cellv >> trigger_cell;) {
543  unsigned cell_key = packCellId(type, cellu, cellv);
544  unsigned trigger_cell_key = packCellId(type, trigger_cell);
545  // fill cell <-> trigger cell mappings
546  cells_to_trigger_cells_.emplace(cell_key, trigger_cell);
547  trigger_cells_to_cells_.emplace(trigger_cell_key, cell_key);
548  // fill number of trigger cells in wafers
549  auto itr_insert = number_trigger_cells_in_wafers_.emplace(type, 0);
550  if (trigger_cell + 1 > itr_insert.first->second)
551  itr_insert.first->second = trigger_cell + 1;
552  }
553  if (!l1tCellsMappingStream.eof()) {
554  throw cms::Exception("BadGeometryFile")
555  << "Error reading L1TCellsMapping '" << type << " " << cellu << " " << cellv << " " << trigger_cell << "' \n";
556  }
557  l1tCellsMappingStream.close();
558  // read scintillator trigger cell mapping file
559  std::ifstream l1tCellsSciMappingStream(l1tCellsSciMapping_.fullPath());
560  if (!l1tCellsSciMappingStream.is_open()) {
561  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsSciMapping file\n";
562  }
563  short ieta = 0;
564  short iphi = 0;
565  trigger_wafer = 0;
566  trigger_cell = 0;
567  for (; l1tCellsSciMappingStream >> ieta >> iphi >> trigger_wafer >> trigger_cell;) {
568  unsigned cell_key = packIetaIphi(ieta, iphi);
569  unsigned trigger_cell_key = packWaferCellId(ForwardSubdetector::HGCHEB, trigger_wafer, trigger_cell);
570  // fill cell <-> trigger cell mappings
571  cells_to_trigger_cells_sci_.emplace(cell_key, trigger_cell_key);
572  trigger_cells_to_cells_sci_.emplace(trigger_cell_key, cell_key);
573  // fill number of trigger cells in wafers
574  auto itr_insert = number_trigger_cells_in_wafers_sci_.emplace(trigger_wafer, 0);
575  if (trigger_cell + 1 > itr_insert.first->second)
576  itr_insert.first->second = trigger_cell + 1;
577  }
578  if (!l1tCellsSciMappingStream.eof()) {
579  throw cms::Exception("BadGeometryFile") << "Error reading L1TCellsSciMapping '" << ieta << " " << iphi << " "
580  << trigger_wafer << " " << trigger_cell << "' \n";
581  }
582  l1tCellsSciMappingStream.close();
583  // read wafer mapping file
584  std::ifstream l1tWafersMappingStream(l1tWafersMapping_.fullPath());
585  if (!l1tWafersMappingStream.is_open()) {
586  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TWafersMapping file\n";
587  }
588  short waferu = 0;
589  short waferv = 0;
590  trigger_wafer = 0;
591  for (; l1tWafersMappingStream >> waferu >> waferv >> trigger_wafer;) {
592  unsigned wafer_key = packWaferId(waferu, waferv);
593  // fill wafer u,v <-> old wafer ID mappings
594  wafers_to_wafers_old_.emplace(wafer_key, trigger_wafer);
595  wafers_old_to_wafers_.emplace(trigger_wafer, wafer_key);
596  }
597  if (!l1tWafersMappingStream.eof()) {
598  throw cms::Exception("BadGeometryFile")
599  << "Error reading L1TWafersMapping '" << waferu << " " << waferv << " " << trigger_wafer << "' \n";
600  }
601  l1tWafersMappingStream.close();
602 }
type
Definition: HCALResponse.h:21
unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_sci_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
unsigned packWaferId(int waferU, int waferV) const
std::unordered_map< unsigned, unsigned > wafer_to_module_
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
unsigned packIetaIphi(unsigned ieta, unsigned iphi) const
unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_sci_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
std::string fullPath() const
Definition: FileInPath.cc:163
Definition: vlib.h:208
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
void HGCalTriggerGeometryV9Imp1::fillNeighborMap ( const edm::FileInPath file,
neighbor_map neighbors_map,
bool  scintillator 
)
private

Definition at line 604 of file HGCalTriggerGeometryV9Imp1.cc.

References begin, edmScanValgrind::buffer, end, Exception, edm::FileInPath::fullPath(), mps_fire::i, mps_splice::line, packTriggerCell(), packTriggerCellWithType(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by initialize().

606  {
607  // Fill trigger neighbor map
608  std::ifstream l1tCellNeighborsMappingStream(file.fullPath());
609  if (!l1tCellNeighborsMappingStream.is_open()) {
610  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellNeighborsMapping file\n";
611  }
612  const unsigned line_size = 512;
613  for (std::array<char, line_size> buffer; l1tCellNeighborsMappingStream.getline(&buffer[0], line_size);) {
614  std::string line(&buffer[0]);
615  // Extract keys consisting of the module id
616  // and of the trigger cell id
617  // Match patterns (X,Y)
618  // where X is a number with less than 4 digis
619  // and Y is a number with less than 4 digits
620  // For the scintillator case, match instead (X,Y,Z) patterns
621  std::regex key_regex(scintillator ? "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)"
622  : "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
623  std::vector<std::string> key_tokens{std::sregex_token_iterator(line.begin(), line.end(), key_regex), {}};
624  if (key_tokens.empty()) {
625  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
626  << " Cannot find the trigger cell key in line:\n"
627  << " '" << &buffer[0] << "'\n";
628  }
629  std::regex digits_regex("\\d{1,3}");
630  std::vector<std::string> module_tc{
631  std::sregex_token_iterator(key_tokens[0].begin(), key_tokens[0].end(), digits_regex), {}};
632  // get module and cell id
633  unsigned map_key = 0;
634  if (scintillator) {
635  int type = std::stoi(module_tc[0]);
636  int module = std::stoi(module_tc[1]);
637  int trigger_cell = std::stoi(module_tc[2]);
638  map_key = packTriggerCellWithType(type, module, trigger_cell);
639  } else {
640  int module = std::stoi(module_tc[0]);
641  int trigger_cell = std::stoi(module_tc[1]);
642  map_key = packTriggerCell(module, trigger_cell);
643  }
644  // Extract neighbors
645  // Match patterns (X,Y)
646  // where X is a number with less than 4 digits
647  // and Y is a number with less than 4 digits
648  std::regex neighbors_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
649  std::vector<std::string> neighbors_tokens{std::sregex_token_iterator(line.begin(), line.end(), neighbors_regex),
650  {}};
651  if ((scintillator && neighbors_tokens.empty()) || (!scintillator && neighbors_tokens.size() < 2)) {
652  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
653  << " Cannot find any neighbor in line:\n"
654  << " '" << &buffer[0] << "'\n";
655  }
656  auto itr_insert = neighbors_map.emplace(map_key, std::set<std::pair<short, short>>());
657  // The first element for silicon neighbors is the key, so start at index 1
658  unsigned first_element = (scintillator ? 0 : 1);
659  for (unsigned i = first_element; i < neighbors_tokens.size(); i++) {
660  const auto& neighbor = neighbors_tokens[i];
661  std::vector<std::string> pair_neighbor{std::sregex_token_iterator(neighbor.begin(), neighbor.end(), digits_regex),
662  {}};
663  short neighbor_module(std::stoi(pair_neighbor[0]));
664  short neighbor_cell(std::stoi(pair_neighbor[1]));
665  itr_insert.first->second.emplace(neighbor_module, neighbor_cell);
666  }
667  }
668  if (!l1tCellNeighborsMappingStream.eof()) {
669  throw cms::Exception("BadGeometryFile") << "Error reading L1TCellNeighborsMapping'\n";
670  }
671  l1tCellNeighborsMappingStream.close();
672 }
type
Definition: HCALResponse.h:21
unsigned packTriggerCellWithType(unsigned, unsigned, unsigned) const
#define end
Definition: vmac.h:39
unsigned packTriggerCell(unsigned, unsigned) const
#define begin
Definition: vmac.h:32
std::string fullPath() const
Definition: FileInPath.cc:163
Definition: vlib.h:208
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp1::getCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 305 of file HGCalTriggerGeometryV9Imp1.cc.

References postprocess-scan-build::cells, getCellsFromTriggerCell(), and getTriggerCellsFromModule().

Referenced by getModulePosition().

305  {
306  geom_set cell_det_ids;
307  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
308  for (auto trigger_cell_id : trigger_cells) {
309  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
310  cell_det_ids.insert(cells.begin(), cells.end());
311  }
312  return cell_det_ids;
313 }
std::unordered_set< unsigned > geom_set
geom_set getTriggerCellsFromModule(const unsigned) const final
geom_set getCellsFromTriggerCell(const unsigned) const final
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp1::getCellsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 256 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::cell(), HGCalTopology::dddConstants(), detIdWaferType(), Exception, HGCalDDDConstants::getTypeTrap(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEB, HGCalTriggerGeometryBase::hscTopology(), HGCalDetId::layer(), packCellId(), packWaferCellId(), DetId::subdetId(), trigger_cells_to_cells_, trigger_cells_to_cells_sci_, unpackCellId(), unpackIetaIphi(), unpackWaferId(), validCellId(), HGCalDetId::wafer(), wafers_old_to_wafers_, and HGCalDetId::zside().

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

257  {
258  HGCalDetId trigger_cell_det_id(trigger_cell_id);
259  geom_set cell_det_ids;
260  unsigned subdet = trigger_cell_det_id.subdetId();
261  unsigned trigger_wafer = trigger_cell_det_id.wafer();
262  unsigned trigger_cell = trigger_cell_det_id.cell();
263  unsigned layer = trigger_cell_det_id.layer();
264  // Scintillator
265  if (subdet == ForwardSubdetector::HGCHEB) {
266  int type = hscTopology().dddConstants().getTypeTrap(layer);
267  const auto& cell_range =
268  trigger_cells_to_cells_sci_.equal_range(packWaferCellId(subdet, trigger_wafer, trigger_cell));
269  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
270  unsigned ieta = 0;
271  unsigned iphi = 0;
272  unpackIetaIphi(tc_c_itr->second, ieta, iphi);
273  unsigned cell_det_id = HGCScintillatorDetId(type, layer, trigger_cell_det_id.zside() * ieta, iphi).rawId();
274  if (validCellId(subdet, cell_det_id))
275  cell_det_ids.emplace(cell_det_id);
276  }
277  }
278  // Silicon
279  else {
280  int waferu = 0;
281  int waferv = 0;
282  auto wafer_itr = wafers_old_to_wafers_.find(trigger_wafer);
283  if (wafer_itr == wafers_old_to_wafers_.end()) {
284  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Trigger wafer ID " << trigger_wafer
285  << " is not mapped to any wafer. The wafer mapping should be modified.\n";
286  }
287  unpackWaferId(wafer_itr->second, waferu, waferv);
288  DetId::Detector det =
289  (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
290  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
291  const auto& cell_range = trigger_cells_to_cells_.equal_range(packCellId(wafer_type, trigger_cell));
292  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
293  unsigned cellu = 0;
294  unsigned cellv = 0;
295  unpackCellId(tc_c_itr->second, cellu, cellv);
296  unsigned cell_det_id =
297  HGCSiliconDetId(det, trigger_cell_det_id.zside(), wafer_type, layer, waferu, waferv, cellu, cellv).rawId();
298  if (validCellId(subdet, cell_det_id))
299  cell_det_ids.emplace(cell_det_id);
300  }
301  }
302  return cell_det_ids;
303 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
type
Definition: HCALResponse.h:21
unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const
int getTypeTrap(int layer) const
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
bool validCellId(unsigned det, unsigned cell_id) const
void unpackIetaIphi(unsigned ieta_iphi, unsigned &ieta, unsigned &iphi) const
void unpackCellId(unsigned cell, unsigned &cellU, unsigned &cellV) const
unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_sci_
const HGCalDDDConstants & dddConstants() const
const HGCalTopology & hscTopology() const
Detector
Definition: DetId.h:26
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::unordered_set< unsigned > geom_set
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
unsigned HGCalTriggerGeometryV9Imp1::getModuleFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 223 of file HGCalTriggerGeometryV9Imp1.cc.

References getModuleFromTriggerCell(), and getTriggerCellFromCell().

223  {
225 }
unsigned getModuleFromTriggerCell(const unsigned) const final
unsigned getTriggerCellFromCell(const unsigned) const final
unsigned HGCalTriggerGeometryV9Imp1::getModuleFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 227 of file HGCalTriggerGeometryV9Imp1.cc.

References Exception, HGCHEB, HGCalDetId::kHGCalCellMask, HGCalDetId::layer(), DetId::subdetId(), HGCalDetId::wafer(), wafer_to_module_, HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getModuleFromCell().

227  {
228  HGCalDetId trigger_cell_det_id(trigger_cell_id);
229  unsigned module = 0;
230  // Scintillator
231  if (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
232  // For scintillator, the module ID is currently encoded as the wafer in HGCalDetId
233  module = trigger_cell_det_id.wafer();
234  }
235  // Silicon
236  else {
237  auto module_itr = wafer_to_module_.find(trigger_cell_det_id.wafer());
238  if (module_itr == wafer_to_module_.end()) {
239  throw cms::Exception("BadGeometry")
240  << trigger_cell_det_id << "HGCalTriggerGeometry: Wafer " << trigger_cell_det_id.wafer()
241  << " is not mapped to any trigger module. The module mapping should be modified. See "
242  "https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for "
243  "details.\n";
244  }
245  module = module_itr->second;
246  }
247  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
248  trigger_cell_det_id.zside(),
249  trigger_cell_det_id.layer(),
250  trigger_cell_det_id.waferType(),
251  module,
253  .rawId();
254 }
std::unordered_map< unsigned, unsigned > wafer_to_module_
ForwardSubdetector
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
Definition: vlib.h:208
GlobalPoint HGCalTriggerGeometryV9Imp1::getModulePosition ( const unsigned  module_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 491 of file HGCalTriggerGeometryV9Imp1.cc.

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

491  {
492  unsigned subdet = HGCalDetId(module_det_id).subdetId();
493  // Position: barycenter of the module.
494  Basic3DVector<float> moduleVector(0., 0., 0.);
495  const auto cell_ids = getCellsFromModule(module_det_id);
496  // Scintillator
497  if (subdet == ForwardSubdetector::HGCHEB) {
498  for (const auto& cell : cell_ids) {
499  HGCScintillatorDetId cellDetId(cell);
500  moduleVector += hscGeometry()->getPosition(cellDetId).basicVector();
501  }
502  }
503  // Silicon
504  else {
505  for (const auto& cell : cell_ids) {
506  HGCSiliconDetId cellDetId(cell);
507  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
508  : hsiGeometry()->getPosition(cellDetId))
509  .basicVector();
510  }
511  }
512  return GlobalPoint(moduleVector / cell_ids.size());
513 }
const HGCalGeometry * eeGeometry() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
geom_set getCellsFromModule(const unsigned) const final
GlobalPoint getPosition(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
const HGCalGeometry * hsiGeometry() const
const HGCalGeometry * hscGeometry() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp1::getNeighborsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 426 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::cell(), HGCalTopology::dddConstants(), Exception, HGCalDDDConstants::getTypeTrap(), HGCHEB, HGCalTriggerGeometryBase::hscTopology(), HGCalDetId::layer(), packTriggerCell(), packTriggerCellWithType(), DetId::subdetId(), trigger_cell_neighbors_, trigger_cell_neighbors_sci_, validTriggerCell(), HGCalDetId::wafer(), and HGCalDetId::zside().

Referenced by fillInvalidTriggerCells().

427  {
428  HGCalDetId trigger_cell_det_id(trigger_cell_id);
429  // Choose scintillator or silicon map
430  const auto& neighbors_map =
431  (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB ? trigger_cell_neighbors_sci_
433  unsigned layer = trigger_cell_det_id.layer();
434  unsigned type =
435  (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB ? hscTopology().dddConstants().getTypeTrap(layer)
436  : 1);
437  unsigned module = trigger_cell_det_id.wafer();
438  unsigned trigger_cell = trigger_cell_det_id.cell();
439  // retrieve neighbors
440  unsigned trigger_cell_key = (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB
441  ? packTriggerCellWithType(type, module, trigger_cell)
442  : packTriggerCell(module, trigger_cell));
443  geom_set neighbor_detids;
444  auto neighbors_itr = neighbors_map.find(trigger_cell_key);
445  if (neighbors_itr == neighbors_map.end()) {
446  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Neighbors are not defined for trigger cell "
447  << trigger_cell << " in module " << module
448  << ". The trigger cell neighbor mapping should be modified. \n";
449  }
450  const auto& neighbors = neighbors_itr->second;
451  // create HGCalDetId of neighbors and check their validity
452  neighbor_detids.reserve(neighbors.size());
453  for (const auto& module_tc : neighbors) {
454  HGCalDetId neighbor_det_id((ForwardSubdetector)trigger_cell_det_id.subdetId(),
455  trigger_cell_det_id.zside(),
456  layer,
457  type,
458  module_tc.first,
459  module_tc.second);
460  if (validTriggerCell(neighbor_det_id.rawId())) {
461  neighbor_detids.emplace(neighbor_det_id.rawId());
462  }
463  }
464  return neighbor_detids;
465 }
type
Definition: HCALResponse.h:21
int getTypeTrap(int layer) const
bool validTriggerCell(const unsigned) const final
ForwardSubdetector
unsigned packTriggerCellWithType(unsigned, unsigned, unsigned) const
const HGCalDDDConstants & dddConstants() const
const HGCalTopology & hscTopology() const
unsigned packTriggerCell(unsigned, unsigned) const
std::unordered_set< unsigned > geom_set
Definition: vlib.h:208
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp1::getOrderedCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 315 of file HGCalTriggerGeometryV9Imp1.cc.

References postprocess-scan-build::cells, getCellsFromTriggerCell(), and getOrderedTriggerCellsFromModule().

316  {
317  geom_ordered_set cell_det_ids;
318  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
319  for (auto trigger_cell_id : trigger_cells) {
320  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
321  cell_det_ids.insert(cells.begin(), cells.end());
322  }
323  return cell_det_ids;
324 }
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
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp1::getOrderedTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 376 of file HGCalTriggerGeometryV9Imp1.cc.

References detIdWaferType(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEB, HGCalDetId::layer(), module_to_wafers_, number_trigger_cells_in_wafers_, number_trigger_cells_in_wafers_sci_, DetId::subdetId(), unpackWaferId(), validTriggerCell(), HGCalDetId::wafer(), wafers_old_to_wafers_, HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getOrderedCellsFromModule().

377  {
378  HGCalDetId module_det_id(module_id);
379  geom_ordered_set trigger_cell_det_ids;
380  unsigned module = module_det_id.wafer();
381  // Scintillator
382  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
383  // loop on the trigger cells in each module
384  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++) {
385  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
386  module_det_id.zside(),
387  module_det_id.layer(),
388  module_det_id.waferType(),
389  module,
390  trigger_cell);
391  if (validTriggerCell(trigger_cell_id))
392  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
393  }
394  }
395  // EE or FH
396  else {
397  auto wafer_itrs = module_to_wafers_.equal_range(module);
398  // loop on the wafers included in the module
399  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
400  unsigned wafer = wafer_itr->second;
401  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
402  if (waferuv_itr == wafers_old_to_wafers_.end())
403  continue;
404  int waferu = 0;
405  int waferv = 0;
406  unpackWaferId(waferuv_itr->second, waferu, waferv);
407  DetId::Detector det = (module_det_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
408  unsigned layer = module_det_id.layer();
409  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
410  // loop on the trigger cells in each wafer
411  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
412  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
413  module_det_id.zside(),
414  module_det_id.layer(),
415  module_det_id.waferType(),
416  wafer,
417  trigger_cell);
418  if (validTriggerCell(trigger_cell_id))
419  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
420  }
421  }
422  }
423  return trigger_cell_det_ids;
424 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
bool validTriggerCell(const unsigned) const final
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
ForwardSubdetector
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
Detector
Definition: DetId.h:26
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::set< unsigned > geom_ordered_set
Definition: vlib.h:208
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
unsigned HGCalTriggerGeometryV9Imp1::getTriggerCellFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 165 of file HGCalTriggerGeometryV9Imp1.cc.

References cells_to_trigger_cells_, cells_to_trigger_cells_sci_, HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), DetId::det(), Exception, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), HGCScintillatorDetId::layer(), HGCSiliconDetId::layer(), packCellId(), packIetaIphi(), packWaferId(), DetId::rawId(), HGCScintillatorDetId::type(), HGCSiliconDetId::type(), unpackWaferCellId(), wafers_to_wafers_old_, HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), HGCScintillatorDetId::zside(), HGCSiliconDetId::zside(), and ecaldqm::zside().

Referenced by getModuleFromCell().

165  {
166  unsigned det = DetId(cell_id).det();
167  unsigned subdet = 0;
168  int zside = 0;
169  unsigned tc_type = 1;
170  unsigned layer = 0;
171  unsigned wafer_trigger_cell = 0;
172  unsigned trigger_cell = 0;
173  // Scintillator
174  if (det == DetId::HGCalHSc) {
175  HGCScintillatorDetId cell_det_id(cell_id);
176  unsigned ieta = cell_det_id.ietaAbs();
177  unsigned iphi = cell_det_id.iphi();
178  tc_type = cell_det_id.type();
179  layer = cell_det_id.layer();
181  zside = cell_det_id.zside();
182  auto trigger_cell_itr = cells_to_trigger_cells_sci_.find(packIetaIphi(ieta, iphi));
183  if (trigger_cell_itr == cells_to_trigger_cells_sci_.end()) {
184  throw cms::Exception("BadGeometry")
185  << "HGCalTriggerGeometry: scintillator cell ieta=" << ieta << ", iphi=" << iphi
186  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
187  }
188  trigger_cell = 0;
189  wafer_trigger_cell = 0;
190  unpackWaferCellId(trigger_cell_itr->second, wafer_trigger_cell, trigger_cell);
191  }
192  // Silicon
193  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
194  HGCSiliconDetId cell_det_id(cell_id);
196  layer = cell_det_id.layer();
197  zside = cell_det_id.zside();
198  int type = cell_det_id.type();
199  int waferu = cell_det_id.waferU();
200  int waferv = cell_det_id.waferV();
201  unsigned cellu = cell_det_id.cellU();
202  unsigned cellv = cell_det_id.cellV();
203  auto trigger_cell_itr = cells_to_trigger_cells_.find(packCellId(type, cellu, cellv));
204  if (trigger_cell_itr == cells_to_trigger_cells_.end()) {
205  throw cms::Exception("BadGeometry")
206  << "HGCalTriggerGeometry: HGCal cell " << cellu << "," << cellv << " in wafer type " << type
207  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
208  }
209  auto wafer_trigger_cell_itr = wafers_to_wafers_old_.find(packWaferId(waferu, waferv));
210  if (wafer_trigger_cell_itr == wafers_to_wafers_old_.end()) {
211  throw cms::Exception("BadGeometry")
212  << "HGCalTriggerGeometry: Wafer " << waferu << "," << waferv
213  << " is not mapped to any trigger wafer ID. The wafer mapping should be modified.\n";
214  }
215  trigger_cell = trigger_cell_itr->second;
216  wafer_trigger_cell = wafer_trigger_cell_itr->second;
217  }
218  // Using the old HGCalDetId for trigger cells is temporary
219  // For easy switch between V8 and V9 geometries
220  return HGCalDetId((ForwardSubdetector)subdet, zside, layer, tc_type, wafer_trigger_cell, trigger_cell).rawId();
221 }
type
Definition: HCALResponse.h:21
unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_sci_
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
unsigned packWaferId(int waferU, int waferV) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int zside(DetId const &)
ForwardSubdetector
void unpackWaferCellId(unsigned wafer_cell, unsigned &wafer, unsigned &cell) const
unsigned packIetaIphi(unsigned ieta, unsigned iphi) const
Definition: DetId.h:18
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
GlobalPoint HGCalTriggerGeometryV9Imp1::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 467 of file HGCalTriggerGeometryV9Imp1.cc.

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

467  {
468  unsigned subdet = HGCalDetId(trigger_cell_det_id).subdetId();
469  // Position: barycenter of the trigger cell.
470  Basic3DVector<float> triggerCellVector(0., 0., 0.);
471  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
472  // Scintillator
473  if (subdet == ForwardSubdetector::HGCHEB) {
474  for (const auto& cell : cell_ids) {
475  HcalDetId cellDetId(cell);
476  triggerCellVector += hscGeometry()->getPosition(cellDetId).basicVector();
477  }
478  }
479  // Silicon
480  else {
481  for (const auto& cell : cell_ids) {
482  HGCSiliconDetId cellDetId(cell);
483  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
484  : hsiGeometry()->getPosition(cellDetId))
485  .basicVector();
486  }
487  }
488  return GlobalPoint(triggerCellVector / cell_ids.size());
489 }
const HGCalGeometry * eeGeometry() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
const HGCalGeometry * hsiGeometry() const
const HGCalGeometry * hscGeometry() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
geom_set getCellsFromTriggerCell(const unsigned) const final
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp1::getTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 326 of file HGCalTriggerGeometryV9Imp1.cc.

References detIdWaferType(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEB, HGCalDetId::layer(), module_to_wafers_, number_trigger_cells_in_wafers_, number_trigger_cells_in_wafers_sci_, DetId::subdetId(), unpackWaferId(), validTriggerCell(), HGCalDetId::wafer(), wafers_old_to_wafers_, HGCalDetId::waferType(), and HGCalDetId::zside().

Referenced by getCellsFromModule().

327  {
328  HGCalDetId module_det_id(module_id);
329  geom_set trigger_cell_det_ids;
330  unsigned module = module_det_id.wafer();
331  // Scintillator
332  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
333  // loop on the trigger cells in each module
334  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++) {
335  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
336  module_det_id.zside(),
337  module_det_id.layer(),
338  module_det_id.waferType(),
339  module,
340  trigger_cell);
341  if (validTriggerCell(trigger_cell_id))
342  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
343  }
344  }
345  // Silicon
346  else {
347  auto wafer_itrs = module_to_wafers_.equal_range(module);
348  // loop on the wafers included in the module
349  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
350  unsigned wafer = wafer_itr->second;
351  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
352  if (waferuv_itr == wafers_old_to_wafers_.end())
353  continue;
354  int waferu = 0;
355  int waferv = 0;
356  unpackWaferId(waferuv_itr->second, waferu, waferv);
357  DetId::Detector det = (module_det_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
358  unsigned layer = module_det_id.layer();
359  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
360  // loop on the trigger cells in each wafer
361  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
362  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
363  module_det_id.zside(),
364  module_det_id.layer(),
365  module_det_id.waferType(),
366  wafer,
367  trigger_cell);
368  if (validTriggerCell(trigger_cell_id))
369  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
370  }
371  }
372  }
373  return trigger_cell_det_ids;
374 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
bool validTriggerCell(const unsigned) const final
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
ForwardSubdetector
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
Detector
Definition: DetId.h:26
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::unordered_set< unsigned > geom_set
Definition: vlib.h:208
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
void HGCalTriggerGeometryV9Imp1::initialize ( const edm::ESHandle< CaloGeometry > &  calo_geometry)
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 134 of file HGCalTriggerGeometryV9Imp1.cc.

References Exception.

134  {
135  throw cms::Exception("BadGeometry")
136  << "HGCalTriggerGeometryV9Imp1 geometry cannot be initialized with the V7/V8 HGCAL geometry";
137 }
void HGCalTriggerGeometryV9Imp1::initialize ( const edm::ESHandle< HGCalGeometry > &  hgc_ee_geometry,
const edm::ESHandle< HGCalGeometry > &  hgc_hsi_geometry,
const edm::ESHandle< HGCalGeometry > &  hgc_hsc_geometry 
)
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 139 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalTopology::dddConstants(), disconnected_layers_, HGCalTriggerGeometryBase::eeTopology(), fillInvalidTriggerCells(), fillMaps(), fillNeighborMap(), heOffset_, HGCalTriggerGeometryBase::hsiTopology(), l1tCellNeighborsMapping_, l1tCellNeighborsSciMapping_, HGCalDDDConstants::layers(), HGCalTriggerGeometryBase::setEEGeometry(), HGCalTriggerGeometryBase::setHScGeometry(), HGCalTriggerGeometryBase::setHSiGeometry(), totalLayers_, trigger_cell_neighbors_, trigger_cell_neighbors_sci_, and trigger_layers_.

141  {
142  setEEGeometry(hgc_ee_geometry);
143  setHSiGeometry(hgc_hsi_geometry);
144  setHScGeometry(hgc_hsc_geometry);
147  trigger_layers_.resize(totalLayers_ + 1);
148  trigger_layers_[0] = 0; // layer number 0 doesn't exist
149  unsigned trigger_layer = 1;
150  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
151  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
152  // Increase trigger layer number if the layer is not disconnected
153  trigger_layers_[layer] = trigger_layer;
154  trigger_layer++;
155  } else {
156  trigger_layers_[layer] = 0;
157  }
158  }
159  fillMaps();
163 }
std::unordered_set< unsigned > disconnected_layers_
const HGCalTopology & eeTopology() const
std::vector< unsigned > trigger_layers_
const HGCalTopology & hsiTopology() const
void setEEGeometry(const edm::ESHandle< HGCalGeometry > &geom)
unsigned int layers(bool reco) const
const HGCalDDDConstants & dddConstants() const
void fillNeighborMap(const edm::FileInPath &, neighbor_map &, bool)
void setHScGeometry(const edm::ESHandle< HGCalGeometry > &geom)
void setHSiGeometry(const edm::ESHandle< HGCalGeometry > &geom)
unsigned HGCalTriggerGeometryV9Imp1::layerWithOffset ( unsigned  id) const
private

Definition at line 893 of file HGCalTriggerGeometryV9Imp1.cc.

References DEFINE_EDM_PLUGIN, heOffset_, HGCEE, HGCHEB, HGCHEF, HGCalDetId::layer(), and DetId::subdetId().

Referenced by disconnectedModule(), and triggerLayer().

893  {
894  HGCalDetId detid(id);
895  unsigned layer = 0;
896  switch (detid.subdetId()) {
898  layer = detid.layer();
899  break;
901  layer = heOffset_ + detid.layer();
902  break;
904  layer = heOffset_ + detid.layer();
905  break;
906  };
907  return layer;
908 }
unsigned HGCalTriggerGeometryV9Imp1::packCellId ( unsigned  type,
unsigned  cellU,
unsigned  cellV 
) const
private

Definition at line 753 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCSiliconDetId::kHGCalCellUMask, HGCSiliconDetId::kHGCalCellUOffset, HGCSiliconDetId::kHGCalCellVMask, HGCSiliconDetId::kHGCalCellVOffset, HGCSiliconDetId::kHGCalTypeMask, and HGCSiliconDetId::kHGCalTypeOffset.

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

753  {
754  unsigned packed_value = 0;
758  return packed_value;
759 }
type
Definition: HCALResponse.h:21
static const int kHGCalTypeMask
static const int kHGCalCellUMask
static const int kHGCalCellVOffset
static const int kHGCalTypeOffset
static const int kHGCalCellVMask
static const int kHGCalCellUOffset
unsigned HGCalTriggerGeometryV9Imp1::packCellId ( unsigned  type,
unsigned  cell 
) const
private

Definition at line 746 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::kHGCalCellMask, HGCalDetId::kHGCalCellOffset, HGCSiliconDetId::kHGCalTypeMask, and HGCSiliconDetId::kHGCalTypeOffset.

746  {
747  unsigned packed_value = 0;
748  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
750  return packed_value;
751 }
type
Definition: HCALResponse.h:21
static const int kHGCalTypeMask
static const int kHGCalTypeOffset
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
unsigned HGCalTriggerGeometryV9Imp1::packIetaIphi ( unsigned  ieta,
unsigned  iphi 
) const
private
unsigned HGCalTriggerGeometryV9Imp1::packTriggerCell ( unsigned  module,
unsigned  trigger_cell 
) const
private

Definition at line 861 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::kHGCalCellMask, HGCalDetId::kHGCalCellOffset, HGCalDetId::kHGCalWaferMask, and HGCalDetId::kHGCalWaferOffset.

Referenced by fillNeighborMap(), and getNeighborsFromTriggerCell().

861  {
862  unsigned packed_value = 0;
863  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
865  return packed_value;
866 }
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
Definition: vlib.h:208
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15
unsigned HGCalTriggerGeometryV9Imp1::packTriggerCellWithType ( unsigned  type,
unsigned  module,
unsigned  trigger_cell 
) const
private

Definition at line 868 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::kHGCalCellMask, HGCalDetId::kHGCalCellOffset, HGCalDetId::kHGCalWaferMask, HGCalDetId::kHGCalWaferOffset, HGCalDetId::kHGCalWaferTypeMask, and HGCalDetId::kHGCalWaferTypeOffset.

Referenced by fillNeighborMap(), and getNeighborsFromTriggerCell().

870  {
871  unsigned packed_value = 0;
872  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
875  return packed_value;
876 }
type
Definition: HCALResponse.h:21
static const int kHGCalWaferTypeOffset
Definition: HGCalDetId.h:16
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
static const int kHGCalWaferTypeMask
Definition: HGCalDetId.h:17
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
Definition: vlib.h:208
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15
unsigned HGCalTriggerGeometryV9Imp1::packWaferCellId ( unsigned  subdet,
unsigned  wafer,
unsigned  cell 
) const
private

Definition at line 737 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::kHGCalCellMask, HGCalDetId::kHGCalCellOffset, HGCalDetId::kHGCalWaferMask, HGCalDetId::kHGCalWaferOffset, and HGCalDetId::kHGCalWaferTypeOffset.

Referenced by fillMaps(), and getCellsFromTriggerCell().

737  {
738  unsigned packed_value = 0;
739  const int kSubdetMask = 0x7;
740  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
741  packed_value |= ((wafer & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
742  packed_value |= ((subdet & kSubdetMask) << (HGCalDetId::kHGCalWaferTypeOffset));
743  return packed_value;
744 }
static const int kHGCalWaferTypeOffset
Definition: HGCalDetId.h:16
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15
unsigned HGCalTriggerGeometryV9Imp1::packWaferId ( int  waferU,
int  waferV 
) const
private

Definition at line 761 of file HGCalTriggerGeometryV9Imp1.cc.

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

Referenced by fillMaps(), and getTriggerCellFromCell().

761  {
762  unsigned packed_value = 0;
763  unsigned waferUabs = std::abs(waferU);
764  unsigned waferVabs = std::abs(waferV);
765  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
766  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
771  return packed_value;
772 }
static const int kHGCalWaferVOffset
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
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset
void HGCalTriggerGeometryV9Imp1::reset ( void  )
finalvirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 119 of file HGCalTriggerGeometryV9Imp1.cc.

References cells_to_trigger_cells_, cells_to_trigger_cells_sci_, module_to_wafers_, number_trigger_cells_in_wafers_, number_trigger_cells_in_wafers_sci_, trigger_cell_neighbors_, trigger_cell_neighbors_sci_, trigger_cells_to_cells_, trigger_cells_to_cells_sci_, wafer_to_module_, wafers_old_to_wafers_, and wafers_to_wafers_old_.

119  {
120  cells_to_trigger_cells_.clear();
121  trigger_cells_to_cells_.clear();
124  wafers_to_wafers_old_.clear();
125  wafers_old_to_wafers_.clear();
126  wafer_to_module_.clear();
127  module_to_wafers_.clear();
130  trigger_cell_neighbors_.clear();
132 }
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_sci_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
std::unordered_map< unsigned, unsigned > wafer_to_module_
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_sci_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
unsigned HGCalTriggerGeometryV9Imp1::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 818 of file HGCalTriggerGeometryV9Imp1.cc.

References layerWithOffset(), and trigger_layers_.

818  {
819  unsigned layer = layerWithOffset(id);
820  if (layer >= trigger_layers_.size())
821  return 0;
822  return trigger_layers_[layer];
823 }
std::vector< unsigned > trigger_layers_
unsigned layerWithOffset(unsigned) const
void HGCalTriggerGeometryV9Imp1::unpackCellId ( unsigned  cell,
unsigned &  cellU,
unsigned &  cellV 
) const
private
void HGCalTriggerGeometryV9Imp1::unpackIetaIphi ( unsigned  ieta_iphi,
unsigned &  ieta,
unsigned &  iphi 
) const
private
void HGCalTriggerGeometryV9Imp1::unpackWaferCellId ( unsigned  wafer_cell,
unsigned &  wafer,
unsigned &  cell 
) const
private

Definition at line 781 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalDetId::kHGCalCellMask, HGCalDetId::kHGCalWaferMask, and HGCalDetId::kHGCalWaferOffset.

Referenced by getTriggerCellFromCell().

781  {
782  cell = wafer_cell & HGCalDetId::kHGCalCellMask;
784 }
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15
void HGCalTriggerGeometryV9Imp1::unpackWaferId ( unsigned  wafer,
int &  waferU,
int &  waferV 
) const
private

Definition at line 791 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCSiliconDetId::kHGCalWaferUMask, HGCSiliconDetId::kHGCalWaferUOffset, HGCSiliconDetId::kHGCalWaferUSignMask, HGCSiliconDetId::kHGCalWaferUSignOffset, HGCSiliconDetId::kHGCalWaferVMask, HGCSiliconDetId::kHGCalWaferVOffset, HGCSiliconDetId::kHGCalWaferVSignMask, and HGCSiliconDetId::kHGCalWaferVSignOffset.

Referenced by fillInvalidTriggerCells(), getCellsFromTriggerCell(), getOrderedTriggerCellsFromModule(), and getTriggerCellsFromModule().

791  {
795  : waferUAbs);
797  : waferVAbs);
798 }
static const int kHGCalWaferVOffset
static const int kHGCalWaferVSignOffset
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
static const int kHGCalWaferVSignMask
static const int kHGCalWaferUOffset
static const int kHGCalWaferUSignOffset
bool HGCalTriggerGeometryV9Imp1::validCellId ( unsigned  det,
unsigned  cell_id 
) const
private

Definition at line 842 of file HGCalTriggerGeometryV9Imp1.cc.

References HGCalTriggerGeometryBase::eeTopology(), HGCEE, HGCHEB, HGCHEF, HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerGeometryBase::hsiTopology(), matching::is_valid(), and HGCalTopology::valid().

Referenced by getCellsFromTriggerCell(), and validTriggerCellFromCells().

842  {
843  bool is_valid = false;
844  switch (subdet) {
846  is_valid = eeTopology().valid(cell_id);
847  break;
849  is_valid = hsiTopology().valid(cell_id);
850  break;
852  is_valid = hscTopology().valid(cell_id);
853  break;
854  default:
855  is_valid = false;
856  break;
857  }
858  return is_valid;
859 }
bool is_valid(const Digi &d)
Definition: GenericDigi.h:64
const HGCalTopology & eeTopology() const
const HGCalTopology & hsiTopology() const
const HGCalTopology & hscTopology() const
bool valid(const DetId &id) const override
Is this a valid cell id.
bool HGCalTriggerGeometryV9Imp1::validTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 805 of file HGCalTriggerGeometryV9Imp1.cc.

References invalid_triggercells_.

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

805  {
806  return invalid_triggercells_.find(trigger_cell_id) == invalid_triggercells_.end();
807 }
std::unordered_set< unsigned > invalid_triggercells_
bool HGCalTriggerGeometryV9Imp1::validTriggerCellFromCells ( const unsigned  trigger_cell_id) const
private

Definition at line 825 of file HGCalTriggerGeometryV9Imp1.cc.

References postprocess-scan-build::cells, getCellsFromTriggerCell(), matching::is_valid(), DetId::subdetId(), and validCellId().

Referenced by fillInvalidTriggerCells().

825  {
826  // Check the validity of a trigger cell with the
827  // validity of the cells. One valid cell in the
828  // trigger cell is enough to make the trigger cell
829  // valid.
830  HGCalDetId trigger_cell_det_id(trigger_cell_id);
831  unsigned subdet = trigger_cell_det_id.subdetId();
832  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
833  bool is_valid = false;
834  for (const auto cell_id : cells) {
835  is_valid |= validCellId(subdet, cell_id);
836  if (is_valid)
837  break;
838  }
839  return is_valid;
840 }
bool is_valid(const Digi &d)
Definition: GenericDigi.h:64
bool validCellId(unsigned det, unsigned cell_id) const
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final

Member Data Documentation

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::cells_to_trigger_cells_
private

Definition at line 56 of file HGCalTriggerGeometryV9Imp1.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::cells_to_trigger_cells_sci_
private

Definition at line 58 of file HGCalTriggerGeometryV9Imp1.cc.

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

std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp1::disconnected_layers_
private
std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp1::disconnected_modules_
private

Definition at line 75 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by disconnectedModule(), and HGCalTriggerGeometryV9Imp1().

unsigned HGCalTriggerGeometryV9Imp1::heOffset_
private

Definition at line 80 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by initialize(), and layerWithOffset().

std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp1::invalid_triggercells_
private

Definition at line 64 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by fillInvalidTriggerCells(), and validTriggerCell().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tCellNeighborsMapping_
private

Definition at line 48 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by initialize().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tCellNeighborsSciMapping_
private

Definition at line 49 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by initialize().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tCellsMapping_
private

Definition at line 44 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by fillMaps().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tCellsSciMapping_
private

Definition at line 45 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by fillMaps().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tModulesMapping_
private

Definition at line 47 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by fillMaps().

edm::FileInPath HGCalTriggerGeometryV9Imp1::l1tWafersMapping_
private

Definition at line 46 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by fillMaps().

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::module_to_wafers_
private
std::unordered_map<unsigned, unsigned short> HGCalTriggerGeometryV9Imp1::number_trigger_cells_in_wafers_
private
std::unordered_map<unsigned, unsigned short> HGCalTriggerGeometryV9Imp1::number_trigger_cells_in_wafers_sci_
private
unsigned HGCalTriggerGeometryV9Imp1::totalLayers_
private

Definition at line 81 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by initialize().

neighbor_map HGCalTriggerGeometryV9Imp1::trigger_cell_neighbors_
private

Definition at line 71 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by getNeighborsFromTriggerCell(), initialize(), and reset().

neighbor_map HGCalTriggerGeometryV9Imp1::trigger_cell_neighbors_sci_
private

Definition at line 72 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by getNeighborsFromTriggerCell(), initialize(), and reset().

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::trigger_cells_to_cells_
private

Definition at line 57 of file HGCalTriggerGeometryV9Imp1.cc.

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

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::trigger_cells_to_cells_sci_
private

Definition at line 59 of file HGCalTriggerGeometryV9Imp1.cc.

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

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

Definition at line 77 of file HGCalTriggerGeometryV9Imp1.cc.

Referenced by initialize(), and triggerLayer().

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

Definition at line 52 of file HGCalTriggerGeometryV9Imp1.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::wafers_old_to_wafers_
private
std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp1::wafers_to_wafers_old_
private