CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalTriggerGeometryV9Imp3 Class Reference
Inheritance diagram for HGCalTriggerGeometryV9Imp3:
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
 
 HGCalTriggerGeometryV9Imp3 (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 etaphiMappingFromSector0 (int &ieta, int &iphi, unsigned sector) const
 
unsigned etaphiMappingToSector0 (int &ieta, int &iphi) const
 
void fillMaps ()
 
unsigned getNextSector (const unsigned sector) const
 
unsigned getPreviousSector (const unsigned sector) const
 
HGCalGeomRotation::WaferCentring getWaferCentring (unsigned layer, int subdet) const
 
unsigned layerWithOffset (unsigned) const
 
void layerWithoutOffsetAndSubdetId (unsigned &layer, int &subdetId, bool isSilicon) const
 
unsigned packLayerSubdetWaferId (unsigned layer, int subdet, int waferU, int waferV) const
 
void unpackLayerSubdetWaferId (unsigned wafer, unsigned &layer, int &subdet, int &waferU, int &waferV) const
 
bool validCellId (unsigned det, unsigned cell_id) const
 
bool validTriggerCellFromCells (const unsigned) const
 

Private Attributes

std::unordered_set< unsigned > disconnected_layers_
 
HGCalGeomRotation geom_rotation_120_ = {HGCalGeomRotation::SectorType::Sector120Degrees}
 
unsigned heOffset_ = 0
 
unsigned hSc_module_size_ = 12
 
unsigned hSc_num_panels_per_sector_ = 8
 
unsigned hSc_triggercell_size_ = 2
 
unsigned hSc_wafers_per_module_ = 3
 
edm::FileInPath jsonMappingFile_
 
unsigned last_trigger_layer_ = 0
 
std::unordered_map< unsigned,
unsigned > 
links_per_module_
 
std::unordered_multimap
< unsigned, unsigned > 
lpgbt_to_modules_
 
std::unordered_map< unsigned,
unsigned > 
lpgbt_to_stage1_
 
std::unordered_multimap
< unsigned, unsigned > 
module_to_lpgbts_
 
std::unordered_map< unsigned,
unsigned > 
module_to_stage1_
 
unsigned noseLayers_ = 0
 
std::unordered_multimap
< unsigned, unsigned > 
stage1_to_lpgbts_
 
std::unordered_multimap
< unsigned, unsigned > 
stage1_to_stage1links_
 
std::unordered_map< unsigned,
unsigned > 
stage1link_to_stage1_
 
std::unordered_map< unsigned,
unsigned > 
stage1link_to_stage2_
 
std::unordered_multimap
< unsigned, unsigned > 
stage2_to_stage1links_
 
unsigned totalLayers_ = 0
 
std::vector< unsigned > trigger_layers_
 
std::vector< unsigned > trigger_nose_layers_
 

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 20 of file HGCalTriggerGeometryV9Imp3.cc.

Constructor & Destructor Documentation

HGCalTriggerGeometryV9Imp3::HGCalTriggerGeometryV9Imp3 ( const edm::ParameterSet conf)

Definition at line 120 of file HGCalTriggerGeometryV9Imp3.cc.

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

121  : HGCalTriggerGeometryBase(conf),
122  hSc_triggercell_size_(conf.getParameter<unsigned>("ScintillatorTriggerCellSize")),
123  hSc_module_size_(conf.getParameter<unsigned>("ScintillatorModuleSize")),
124  jsonMappingFile_(conf.getParameter<edm::FileInPath>("JsonMappingFile")) {
125  const unsigned ntc_per_wafer = 48;
126  hSc_wafers_per_module_ = std::round(hSc_module_size_ * hSc_module_size_ / float(ntc_per_wafer));
127  if (ntc_per_wafer * hSc_wafers_per_module_ < hSc_module_size_ * hSc_module_size_) {
129  }
130  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
131  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
132 }
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
def move
Definition: eostools.py:511
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unordered_set< unsigned > disconnected_layers_

Member Function Documentation

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

Definition at line 1033 of file HGCalTriggerGeometryV9Imp3.cc.

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

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

1033  {
1034  int wafer_type = 0;
1035  switch (det) {
1036  case DetId::HGCalEE:
1037  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1038  break;
1039  case DetId::HGCalHSi:
1040  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1041  break;
1042  case DetId::HGCalHSc:
1043  wafer_type = hscTopology().dddConstants().getTypeTrap(layer);
1044  break;
1045  default:
1046  break;
1047  };
1048  return wafer_type;
1049 }
int getTypeTrap(int layer) const
int32_t waferU(const int32_t index)
const HGCalTopology & eeTopology() const
int getTypeHex(int layer, int waferU, int waferV) const
const HGCalTopology & hsiTopology() const
constexpr std::array< uint8_t, layerIndexSize > layer
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
const HGCalTopology & hscTopology() const
int32_t waferV(const int32_t index)
bool HGCalTriggerGeometryV9Imp3::disconnectedModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 945 of file HGCalTriggerGeometryV9Imp3.cc.

References disconnected_layers_, gpuClustering::id, phase1PixelTopology::layer, layerWithOffset(), module_to_stage1_, and packLayerSubdetWaferId().

945  {
946  bool disconnected = false;
947  HGCalTriggerModuleDetId id(module_id);
948  if (module_to_stage1_.find(packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV())) ==
949  module_to_stage1_.end()) {
950  disconnected = true;
951  }
952  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end()) {
953  disconnected = true;
954  }
955  return disconnected;
956 }
uint16_t *__restrict__ id
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
unsigned layerWithOffset(unsigned) const
std::unordered_map< unsigned, unsigned > module_to_stage1_
std::unordered_set< unsigned > disconnected_layers_
void HGCalTriggerGeometryV9Imp3::etaphiMappingFromSector0 ( int &  ieta,
int &  iphi,
unsigned  sector 
) const
private

Definition at line 901 of file HGCalTriggerGeometryV9Imp3.cc.

References hSc_num_panels_per_sector_.

Referenced by getTriggerCellsFromModule().

901  {
902  if (sector == 0) {
903  return;
904  }
905  iphi = iphi + (sector * hSc_num_panels_per_sector_);
906 }
unsigned HGCalTriggerGeometryV9Imp3::etaphiMappingToSector0 ( int &  ieta,
int &  iphi 
) const
private

Definition at line 926 of file HGCalTriggerGeometryV9Imp3.cc.

References funct::abs(), and hSc_num_panels_per_sector_.

Referenced by getModuleFromTriggerCell().

926  {
927  unsigned sector = 0;
928 
929  if (unsigned(std::abs(iphi)) > 2 * hSc_num_panels_per_sector_)
930  sector = 2;
931  else if (unsigned(std::abs(iphi)) > hSc_num_panels_per_sector_)
932  sector = 1;
933  else
934  sector = 0;
935 
936  iphi = iphi - (sector * hSc_num_panels_per_sector_);
937 
938  return sector;
939 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void HGCalTriggerGeometryV9Imp3::fillMaps ( )
private

Definition at line 772 of file HGCalTriggerGeometryV9Imp3.cc.

References alignCSCRings::e, cppFunctionSkipper::exception, Exception, edm::FileInPath::fullPath(), jsonMappingFile_, phase1PixelTopology::layer, layerWithoutOffsetAndSubdetId(), MainPageGenerator::link, links_per_module_, lpgbt_to_modules_, lpgbt_to_stage1_, callgraph::module, module_to_lpgbts_, module_to_stage1_, TrackingSourceConfig_Tier0_Cosmic_cff::modules, packLayerSubdetWaferId(), mps_fire::result, stage1_to_lpgbts_, stage1_to_stage1links_, stage1link_to_stage1_, stage1link_to_stage2_, and stage2_to_stage1links_.

Referenced by initialize().

772  {
773  // read json mapping file
774  json mapping_config;
775  std::ifstream json_input_file(jsonMappingFile_.fullPath());
776  if (!json_input_file.is_open()) {
777  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TMapping file\n";
778  }
779  json_input_file >> mapping_config;
780 
781  try {
782  //Stage 2 to Stage 1 links mapping
783  for (unsigned stage2_id = 0; stage2_id < mapping_config.at("Stage2").size(); stage2_id++) {
784  for (auto& link : mapping_config.at("Stage2").at(stage2_id).at("Stage1Links")) {
785  stage2_to_stage1links_.emplace(stage2_id, link.at("SameSector"));
786  }
787  }
788  } catch (const json::exception& e) {
789  edm::LogError("HGCalTriggerGeometryV9Imp3")
790  << "The mapping input json file does not have the expected structure for the Stage2 block";
791  }
792 
793  try {
794  for (unsigned link_id = 0; link_id < mapping_config.at("Stage1Links").size(); link_id++) {
795  //Stage 1 links to Stage 1 FPGAs mapping
796  stage1link_to_stage1_.emplace(link_id, mapping_config.at("Stage1Links").at(link_id).at("Stage1"));
797 
798  //Stage 1 links to Stage 2 mapping
799  stage1link_to_stage2_.emplace(link_id, mapping_config.at("Stage1Links").at(link_id).at("Stage2SameSector"));
800  }
801  } catch (const json::exception& e) {
802  edm::LogError("HGCalTriggerGeometryV9Imp3")
803  << "The mapping input json file does not have the expected structure for the Stage1Links block";
804  }
805 
806  try {
807  for (unsigned stage1_id = 0; stage1_id < mapping_config.at("Stage1").size(); stage1_id++) {
808  //Stage 1 to Stage 1 links mapping
809  for (auto& link_id : mapping_config.at("Stage1").at(stage1_id).at("Stage1Links")) {
810  stage1_to_stage1links_.emplace(stage1_id, link_id);
811  }
812 
813  //Stage 1 to lpgbt mapping
814  for (auto& lpgbt_id : mapping_config.at("Stage1").at(stage1_id).at("lpgbts")) {
815  stage1_to_lpgbts_.emplace(stage1_id, lpgbt_id);
816  }
817  }
818 
819  } catch (const json::exception& e) {
820  edm::LogError("HGCalTriggerGeometryV9Imp3")
821  << "The mapping input json file does not have the expected structure for the Stage1 block";
822  }
823 
824  try {
825  for (unsigned lpgbt_id = 0; lpgbt_id < mapping_config.at("lpgbt").size(); lpgbt_id++) {
826  //lpgbt to Stage 1 mapping
827  unsigned stage1_id = mapping_config.at("lpgbt").at(lpgbt_id).at("Stage1");
828  lpgbt_to_stage1_.emplace(lpgbt_id, stage1_id);
829 
830  //lpgbt to module mapping
831  for (auto& modules : mapping_config.at("lpgbt").at(lpgbt_id).at("Modules")) {
832  unsigned layer = modules.at("layer");
833  int subdetId = 0;
834  bool isSilicon = modules.at("isSilicon");
835  layerWithoutOffsetAndSubdetId(layer, subdetId, isSilicon);
836  unsigned packed_value = packLayerSubdetWaferId(layer, subdetId, modules.at("u"), modules.at("v"));
837  lpgbt_to_modules_.emplace(lpgbt_id, packed_value);
838 
839  //fill subsiduary module to stage 1 mapping
840  auto result = module_to_stage1_.emplace(packed_value, stage1_id);
841  if (result.second == false &&
842  stage1_id != result.first->second) { //check that the stage1_id is the same as in the existing map
843  edm::LogError("HGCalTriggerGeometryV9Imp3") << "One module is connected to two separate Stage1 FPGAs";
844  }
845  }
846  }
847 
848  } catch (const json::exception& e) {
849  edm::LogError("HGCalTriggerGeometryV9Imp3")
850  << "The mapping input json file does not have the expected structure for the lpGBT block";
851  }
852 
853  try {
854  //module to lpgbt mapping
855  for (unsigned module = 0; module < mapping_config.at("Module").size(); module++) {
856  unsigned num_elinks = 0; //Sum number of e-links in each module over lpGBTs
857  unsigned layer = mapping_config.at("Module").at(module).at("layer");
858  unsigned moduleU = mapping_config.at("Module").at(module).at("u");
859  unsigned moduleV = mapping_config.at("Module").at(module).at("v");
860  bool isSilicon = mapping_config.at("Module").at(module).at("isSilicon");
861  int subdetId = 0;
862  layerWithoutOffsetAndSubdetId(layer, subdetId, isSilicon);
863 
864  for (auto& lpgbt : mapping_config.at("Module").at(module).at("lpgbts")) {
865  module_to_lpgbts_.emplace(packLayerSubdetWaferId(layer, subdetId, moduleU, moduleV), lpgbt.at("id"));
866  num_elinks += unsigned(lpgbt.at("nElinks"));
867  }
868  int packed_module = packLayerSubdetWaferId(layer, subdetId, moduleU, moduleV);
869  links_per_module_.emplace(packed_module, num_elinks);
870  }
871  } catch (const json::exception& e) {
872  edm::LogError("HGCalTriggerGeometryV9Imp3")
873  << "The mapping input json file does not have the expected structure for the Module block";
874  }
875 
876  json_input_file.close();
877 }
std::unordered_map< unsigned, unsigned > links_per_module_
std::unordered_map< unsigned, unsigned > stage1link_to_stage1_
std::unordered_multimap< unsigned, unsigned > stage1_to_stage1links_
nlohmann::json json
std::unordered_multimap< unsigned, unsigned > lpgbt_to_modules_
void layerWithoutOffsetAndSubdetId(unsigned &layer, int &subdetId, bool isSilicon) const
std::unordered_map< unsigned, unsigned > lpgbt_to_stage1_
std::unordered_multimap< unsigned, unsigned > stage2_to_stage1links_
Log< level::Error, false > LogError
std::unordered_multimap< unsigned, unsigned > module_to_lpgbts_
constexpr std::array< uint8_t, layerIndexSize > layer
tuple result
Definition: mps_fire.py:311
std::unordered_multimap< unsigned, unsigned > stage1_to_lpgbts_
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
std::unordered_map< unsigned, unsigned > stage1link_to_stage2_
std::string fullPath() const
Definition: FileInPath.cc:161
std::unordered_map< unsigned, unsigned > module_to_stage1_
tuple module
Definition: callgraph.py:69
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 358 of file HGCalTriggerGeometryV9Imp3.cc.

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

Referenced by getModulePosition().

358  {
359  geom_set cell_det_ids;
360  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
361 
362  for (auto trigger_cell_id : trigger_cells) {
363  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
364  cell_det_ids.insert(cells.begin(), cells.end());
365  }
366  return cell_det_ids;
367 }
geom_set getTriggerCellsFromModule(const unsigned) const final
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getCellsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 301 of file HGCalTriggerGeometryV9Imp3.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_, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), phase1PixelTopology::layer, HGCalTriggerDetId::subdet(), HGCScintillatorDetId::type(), HFNoseTriggerDetId::type(), HGCalTriggerDetId::type(), validCellId(), HFNoseTriggerDetId::waferU(), HGCalTriggerDetId::waferU(), HFNoseTriggerDetId::waferV(), HGCalTriggerDetId::waferV(), HGCScintillatorDetId::zside(), HGCalTriggerDetId::zside(), HFNoseTriggerDetId::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 > layer
Definition: DetId.h:17
Detector
Definition: DetId.h:24
bool validCellId(unsigned det, unsigned cell_id) const
std::unordered_set< unsigned > geom_set
unsigned HGCalTriggerGeometryV9Imp3::getLinksInModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 510 of file HGCalTriggerGeometryV9Imp3.cc.

References HFNoseTrigger, HGCalTriggerModuleDetId::layer(), electronStore::links, links_per_module_, HGCalTriggerModuleDetId::moduleU(), HGCalTriggerModuleDetId::moduleV(), packLayerSubdetWaferId(), and HGCalTriggerModuleDetId::triggerSubdetId().

510  {
511  HGCalTriggerModuleDetId module_det_id(module_id);
512  unsigned subdet = module_det_id.triggerSubdetId();
513 
514  unsigned links = 0;
515  // HF Nose
517  links = 1;
518  }
519  // TO ADD HFNOSE : getLinksInModule
520  // Silicon and Scintillator
521  else {
522  int packed_module =
523  packLayerSubdetWaferId(module_det_id.layer(), subdet, module_det_id.moduleU(), module_det_id.moduleV());
524  links = links_per_module_.at(packed_module);
525  }
526  return links;
527 }
std::unordered_map< unsigned, unsigned > links_per_module_
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
HGCalTriggerGeometryV9Imp3::geom_set HGCalTriggerGeometryV9Imp3::getLpgbtsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 686 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, phase1PixelTopology::layer, module_to_lpgbts_, packLayerSubdetWaferId(), and ecaldqm::zside().

686  {
687  geom_set lpgbt_ids;
688  HGCalTriggerModuleDetId id(module_id);
689 
690  auto module_itrs = module_to_lpgbts_.equal_range(
691  packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV()));
692  for (auto module_itr = module_itrs.first; module_itr != module_itrs.second; module_itr++) {
693  lpgbt_ids.emplace(HGCalTriggerBackendDetId(
694  id.zside(), HGCalTriggerBackendDetId::BackendType::LpGBT, id.sector(), module_itr->second));
695  }
696 
697  return lpgbt_ids;
698 }
uint16_t *__restrict__ id
int zside(DetId const &)
std::unordered_multimap< unsigned, unsigned > module_to_lpgbts_
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getLpgbtsFromStage1Fpga ( const unsigned  stage1_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 630 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, label, stage1_to_lpgbts_, and ecaldqm::zside().

630  {
631  geom_set lpgbt_ids;
632  HGCalTriggerBackendDetId id(stage1_id);
633 
634  auto stage1_itrs = stage1_to_lpgbts_.equal_range(id.label());
635  for (auto stage1_itr = stage1_itrs.first; stage1_itr != stage1_itrs.second; stage1_itr++) {
636  lpgbt_ids.emplace(HGCalTriggerBackendDetId(
637  id.zside(), HGCalTriggerBackendDetId::BackendType::LpGBT, id.sector(), stage1_itr->second));
638  }
639 
640  return lpgbt_ids;
641 }
uint16_t *__restrict__ id
int zside(DetId const &)
char const * label
std::unordered_multimap< unsigned, unsigned > stage1_to_lpgbts_
std::unordered_set< unsigned > geom_set
unsigned HGCalTriggerGeometryV9Imp3::getModuleFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 247 of file HGCalTriggerGeometryV9Imp3.cc.

References getModuleFromTriggerCell(), and getTriggerCellFromCell().

247  {
249 }
unsigned getTriggerCellFromCell(const unsigned) const final
unsigned getModuleFromTriggerCell(const unsigned) const final
unsigned HGCalTriggerGeometryV9Imp3::getModuleFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 251 of file HGCalTriggerGeometryV9Imp3.cc.

References HGCalTopology::dddConstants(), DetId::det(), etaphiMappingToSector0(), geom_rotation_120_, HGCalDDDConstants::getREtaRange(), getWaferCentring(), HFNoseTrigger, DetId::HGCalHSc, HGCalHScTrigger, DetId::HGCalTrigger, hSc_module_size_, hSc_triggercell_size_, HGCalTriggerGeometryBase::hscTopology(), HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), HGCScintillatorDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerDetId::layer(), phase1PixelTopology::layer, HGCalTriggerDetId::subdet(), HGCScintillatorDetId::type(), HGCalTriggerDetId::type(), HFNoseTriggerDetId::type(), HGCalGeomRotation::uvMappingToSector0(), HFNoseTriggerDetId::waferU(), HGCalTriggerDetId::waferU(), HFNoseTriggerDetId::waferV(), HGCalTriggerDetId::waferV(), HGCScintillatorDetId::zside(), HGCalTriggerDetId::zside(), HFNoseTriggerDetId::zside(), and ecaldqm::zside().

Referenced by getModuleFromCell().

251  {
252  unsigned det = DetId(trigger_cell_id).det();
253  int zside = 0;
254  unsigned tc_type = 1;
255  unsigned layer = 0;
256  unsigned module_id = 0;
257 
258  // Scintillator
259  if (det == DetId::HGCalHSc) {
260  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
261  tc_type = trigger_cell_sc_id.type();
262  layer = trigger_cell_sc_id.layer();
263  zside = trigger_cell_sc_id.zside();
264  int ietamin = hscTopology().dddConstants().getREtaRange(layer).first;
265  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
266  int ieta = ((trigger_cell_sc_id.ietaAbs() - ietamin_tc) / hSc_module_size_ + 1);
267  int iphi = (trigger_cell_sc_id.iphi() - 1) / hSc_module_size_ + 1;
268  unsigned sector = etaphiMappingToSector0(ieta, iphi);
269  module_id =
270  HGCalTriggerModuleDetId(HGCalTriggerSubdetector::HGCalHScTrigger, zside, tc_type, layer, sector, ieta, iphi);
271  }
272  // HFNose
273  else if (det == DetId::HGCalTrigger and
274  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
275  HFNoseTriggerDetId trigger_cell_trig_id(trigger_cell_id);
276  tc_type = trigger_cell_trig_id.type();
277  layer = trigger_cell_trig_id.layer();
278  zside = trigger_cell_trig_id.zside();
279  int waferu = trigger_cell_trig_id.waferU();
280  int waferv = trigger_cell_trig_id.waferV();
281  unsigned sector = geom_rotation_120_.uvMappingToSector0(
283  module_id =
284  HGCalTriggerModuleDetId(HGCalTriggerSubdetector::HFNoseTrigger, zside, tc_type, layer, sector, waferu, waferv);
285  }
286  // Silicon
287  else {
288  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
289  unsigned subdet = trigger_cell_trig_id.subdet();
290  tc_type = trigger_cell_trig_id.type();
291  layer = trigger_cell_trig_id.layer();
292  zside = trigger_cell_trig_id.zside();
293  int waferu = trigger_cell_trig_id.waferU();
294  int waferv = trigger_cell_trig_id.waferV();
295  unsigned sector = geom_rotation_120_.uvMappingToSector0(getWaferCentring(layer, subdet), waferu, waferv);
296  module_id = HGCalTriggerModuleDetId(HGCalTriggerSubdetector(subdet), zside, tc_type, layer, sector, waferu, waferv);
297  }
298  return module_id;
299 }
HGCalTriggerSubdetector
HGCalGeomRotation::WaferCentring getWaferCentring(unsigned layer, int subdet) const
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned etaphiMappingToSector0(int &ieta, int &iphi) const
std::pair< int, int > getREtaRange(int lay) const
Definition: DetId.h:17
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
const HGCalTopology & hscTopology() const
unsigned uvMappingToSector0(WaferCentring waferCentring, int &moduleU, int &moduleV) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
GlobalPoint HGCalTriggerGeometryV9Imp3::getModulePosition ( const unsigned  module_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 742 of file HGCalTriggerGeometryV9Imp3.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), DetId::det(), HGCalTriggerGeometryBase::eeGeometry(), getCellsFromModule(), HGCalGeometry::getPosition(), HFNoseTrigger, DetId::HGCalEE, HGCalHScTrigger, HGCalTriggerGeometryBase::hscGeometry(), HGCalTriggerGeometryBase::hsiGeometry(), HGCalTriggerGeometryBase::noseGeometry(), and HGCalTriggerModuleDetId::triggerSubdetId().

742  {
743  unsigned subdet = HGCalTriggerModuleDetId(module_det_id).triggerSubdetId();
744  // Position: barycenter of the module.
745  Basic3DVector<float> moduleVector(0., 0., 0.);
746  const auto cell_ids = getCellsFromModule(module_det_id);
747  // Scintillator
749  for (const auto& cell : cell_ids) {
750  moduleVector += hscGeometry()->getPosition(cell).basicVector();
751  }
752  }
753  // HFNose
754  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
755  for (const auto& cell : cell_ids) {
756  HFNoseDetId cellDetId(cell);
757  moduleVector += noseGeometry()->getPosition(cellDetId).basicVector();
758  }
759  } // Silicon
760  else {
761  for (const auto& cell : cell_ids) {
762  HGCSiliconDetId cellDetId(cell);
763  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
764  : hsiGeometry()->getPosition(cellDetId))
765  .basicVector();
766  }
767  }
768 
769  return GlobalPoint(moduleVector / cell_ids.size());
770 }
const HGCalGeometry * eeGeometry() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
const HGCalGeometry * noseGeometry() const
const HGCalGeometry * hsiGeometry() const
const HGCalGeometry * hscGeometry() const
int triggerSubdetId() const
get the trigger sub-detector
geom_set getCellsFromModule(const unsigned) const final
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getModulesFromLpgbt ( const unsigned  lpgbt_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 651 of file HGCalTriggerGeometryV9Imp3.cc.

References detIdWaferType(), DetId::HGCalEE, HGCalEETrigger, DetId::HGCalHSc, HGCalHScTrigger, DetId::HGCalHSi, HGCalHSiTrigger, gpuClustering::id, label, phase1PixelTopology::layer, lpgbt_to_modules_, TrackingSourceConfig_Tier0_Cosmic_cff::modules, unpackLayerSubdetWaferId(), and ecaldqm::zside().

651  {
653  HGCalTriggerBackendDetId id(lpgbt_id);
654 
655  auto lpgbt_itrs = lpgbt_to_modules_.equal_range(id.label());
656  for (auto lpgbt_itr = lpgbt_itrs.first; lpgbt_itr != lpgbt_itrs.second; lpgbt_itr++) {
657  unsigned layer = 0;
658  int moduleU = 0;
659  int moduleV = 0;
660  int subdet = 0;
661  unpackLayerSubdetWaferId(lpgbt_itr->second, layer, subdet, moduleU, moduleV);
662  unsigned det = 0;
663  switch (subdet) {
665  det = DetId::HGCalEE;
666  break;
668  det = DetId::HGCalHSi;
669  break;
671  det = DetId::HGCalHSc;
672  break;
673  default:
674  det = DetId::HGCalEE;
675  break;
676  }
677 
678  int type = detIdWaferType(det, layer, moduleU, moduleV);
679  modules.emplace(HGCalTriggerModuleDetId(
680  HGCalTriggerSubdetector(subdet), id.zside(), type, layer, id.sector(), moduleU, moduleV));
681  }
682 
683  return modules;
684 }
HGCalTriggerSubdetector
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
uint16_t *__restrict__ id
std::unordered_multimap< unsigned, unsigned > lpgbt_to_modules_
void unpackLayerSubdetWaferId(unsigned wafer, unsigned &layer, int &subdet, int &waferU, int &waferV) const
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize > layer
char const * label
std::unordered_set< unsigned > geom_set
unsigned HGCalTriggerGeometryV9Imp3::getModuleSize ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 529 of file HGCalTriggerGeometryV9Imp3.cc.

529  {
530  unsigned nWafers = 1;
531  return nWafers;
532 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getNeighborsFromTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 505 of file HGCalTriggerGeometryV9Imp3.cc.

References Exception.

506  {
507  throw cms::Exception("FeatureNotImplemented") << "Neighbor search is not implemented in HGCalTriggerGeometryV9Imp3";
508 }
unsigned HGCalTriggerGeometryV9Imp3::getNextSector ( const unsigned  sector) const
private

Definition at line 534 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by getStage1LinksFromStage2Fpga().

534  {
535  unsigned next_sector = 0;
536  if (sector < 2) {
537  next_sector = sector + 1;
538  }
539  return next_sector;
540 }
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp3::getOrderedCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 369 of file HGCalTriggerGeometryV9Imp3.cc.

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

370  {
371  geom_ordered_set cell_det_ids;
372  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
373  for (auto trigger_cell_id : trigger_cells) {
374  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
375  cell_det_ids.insert(cells.begin(), cells.end());
376  }
377  return cell_det_ids;
378 }
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
std::set< unsigned > geom_ordered_set
std::unordered_set< unsigned > geom_set
geom_set getCellsFromTriggerCell(const unsigned) const final
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryV9Imp3::getOrderedTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 443 of file HGCalTriggerGeometryV9Imp3.cc.

References detIdWaferType(), HGCalTriggerModuleDetId::eta(), geom_rotation_120_, HFNoseDetIdToModule::getTriggerDetIds(), HGCSiliconDetIdToROC::getTriggerId(), getWaferCentring(), HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, HGCSiliconDetId::HGCalFine, HGCalHScTrigger, DetId::HGCalHSi, hSc_module_size_, HGCalTriggerModuleDetId::layer(), phase1PixelTopology::layer, HGCalTriggerModuleDetId::moduleU(), HGCalTriggerModuleDetId::moduleV(), HGCalTriggerModuleDetId::phi(), PixelMapPlotter::roc, HGCalTriggerModuleDetId::sector(), HGCalTriggerModuleDetId::triggerSubdetId(), HGCalTriggerModuleDetId::type(), HGCalGeomRotation::uvMappingFromSector0(), validTriggerCellFromCells(), and HGCalTriggerModuleDetId::zside().

Referenced by getOrderedCellsFromModule().

444  {
445  HGCalTriggerModuleDetId hgc_module_id(module_id);
446  unsigned subdet = hgc_module_id.triggerSubdetId();
447 
448  geom_ordered_set trigger_cell_det_ids;
449 
450  // Scintillator
452  int ieta0 = hgc_module_id.eta() * hSc_module_size_;
453  int iphi0 = (hgc_module_id.phi() * (hgc_module_id.sector() + 1)) * hSc_module_size_;
454 
455  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
456  int ieta = ietaAbs * hgc_module_id.zside();
457  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
458  unsigned trigger_cell_id = HGCScintillatorDetId(hgc_module_id.type(), hgc_module_id.layer(), ieta, iphi);
459  if (validTriggerCellFromCells(trigger_cell_id))
460  trigger_cell_det_ids.emplace(trigger_cell_id);
461  }
462  }
463  }
464 
465  // HFNose
466  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
467  HFNoseDetId module_nose_id(module_id);
469  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
470  for (auto const& idx : ids) {
471  if (validTriggerCellFromCells(idx.rawId()))
472  trigger_cell_det_ids.emplace(idx);
473  }
474  }
475  // Silicon
476  else {
477  HGCSiliconDetIdToROC tc2roc;
478  int moduleU = hgc_module_id.moduleU();
479  int moduleV = hgc_module_id.moduleV();
480  unsigned layer = hgc_module_id.layer();
481 
482  //Rotate to sector
483  geom_rotation_120_.uvMappingFromSector0(getWaferCentring(layer, subdet), moduleU, moduleV, hgc_module_id.sector());
484 
486 
487  unsigned wafer_type = detIdWaferType(det, layer, moduleU, moduleV);
488  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
489  // Loop on ROCs in wafer
490  for (int roc = 1; roc <= nroc; roc++) {
491  // loop on TCs in ROC
492  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
493  for (const auto& tc_uv : tc_uvs) {
494  HGCalTriggerDetId trigger_cell_id(
495  subdet, hgc_module_id.zside(), wafer_type, layer, moduleU, moduleV, tc_uv.first, tc_uv.second);
496  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
497  trigger_cell_det_ids.emplace(trigger_cell_id);
498  }
499  }
500  }
501 
502  return trigger_cell_det_ids;
503 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
HGCalGeomRotation::WaferCentring getWaferCentring(unsigned layer, int subdet) const
void uvMappingFromSector0(WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
Detector
Definition: DetId.h:24
std::set< unsigned > geom_ordered_set
bool validTriggerCellFromCells(const unsigned) const
unsigned HGCalTriggerGeometryV9Imp3::getPreviousSector ( const unsigned  sector) const
private

Definition at line 542 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by getStage2FpgaFromStage1Link().

542  {
543  unsigned previous_sector = 2;
544  if (sector > 0) {
545  previous_sector = sector - 1;
546  }
547  return previous_sector;
548 }
unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromLpgbt ( const unsigned  lpgbt_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 643 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, label, lpgbt_to_stage1_, and ecaldqm::zside().

643  {
644  HGCalTriggerBackendDetId id(lpgbt_id);
645  unsigned stage1_label = lpgbt_to_stage1_.at(id.label());
646 
648  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
649 }
uint16_t *__restrict__ id
std::unordered_map< unsigned, unsigned > lpgbt_to_stage1_
int zside(DetId const &)
char const * label
unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 700 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, phase1PixelTopology::layer, module_to_stage1_, packLayerSubdetWaferId(), and ecaldqm::zside().

700  {
701  HGCalTriggerModuleDetId id(module_id);
702 
703  unsigned stage1_label =
704  module_to_stage1_.at(packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV()));
705 
707  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
708 }
uint16_t *__restrict__ id
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
std::unordered_map< unsigned, unsigned > module_to_stage1_
unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromStage1Link ( const unsigned  link_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 595 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, label, stage1link_to_stage1_, and ecaldqm::zside().

Referenced by getStage1FpgasFromStage2Fpga().

595  {
596  HGCalTriggerBackendDetId id(link_id);
597  unsigned stage1_label = stage1link_to_stage1_.at(id.label());
598 
600  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
601 }
std::unordered_map< unsigned, unsigned > stage1link_to_stage1_
uint16_t *__restrict__ id
int zside(DetId const &)
char const * label
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getStage1FpgasFromStage2Fpga ( const unsigned  stage2_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 550 of file HGCalTriggerGeometryV9Imp3.cc.

References getStage1FpgaFromStage1Link(), and getStage1LinksFromStage2Fpga().

551  {
552  geom_set stage1_ids;
553 
554  geom_set stage1_links = getStage1LinksFromStage2Fpga(stage2_id);
555  for (const auto& stage1_link : stage1_links) {
556  stage1_ids.emplace(getStage1FpgaFromStage1Link(stage1_link));
557  }
558 
559  return stage1_ids;
560 }
std::unordered_set< unsigned > geom_set
geom_set getStage1LinksFromStage2Fpga(const unsigned) const final
unsigned getStage1FpgaFromStage1Link(const unsigned) const final
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getStage1LinksFromStage1Fpga ( const unsigned  stage1_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 615 of file HGCalTriggerGeometryV9Imp3.cc.

References gpuClustering::id, label, stage1_to_stage1links_, and ecaldqm::zside().

Referenced by getStage2FpgasFromStage1Fpga().

616  {
617  geom_set stage1link_ids;
618 
619  HGCalTriggerBackendDetId id(stage1_id);
620 
621  auto stage1_itrs = stage1_to_stage1links_.equal_range(id.label());
622  for (auto stage1_itr = stage1_itrs.first; stage1_itr != stage1_itrs.second; stage1_itr++) {
623  stage1link_ids.emplace(HGCalTriggerBackendDetId(
624  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1Link, id.sector(), stage1_itr->second));
625  }
626 
627  return stage1link_ids;
628 }
std::unordered_multimap< unsigned, unsigned > stage1_to_stage1links_
uint16_t *__restrict__ id
int zside(DetId const &)
char const * label
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getStage1LinksFromStage2Fpga ( const unsigned  stage2_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 574 of file HGCalTriggerGeometryV9Imp3.cc.

References getNextSector(), gpuClustering::id, label, stage2_to_stage1links_, and ecaldqm::zside().

Referenced by getStage1FpgasFromStage2Fpga().

575  {
576  geom_set stage1link_ids;
577  HGCalTriggerBackendDetId id(stage2_id);
578 
579  auto stage2_itrs = stage2_to_stage1links_.equal_range(id.label());
580  for (auto stage2_itr = stage2_itrs.first; stage2_itr != stage2_itrs.second; stage2_itr++) {
581  if (stage2_itr->second == true) { //link and stage2 FPGA are the same sector
582  stage1link_ids.emplace(HGCalTriggerBackendDetId(
583  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1Link, id.sector(), stage2_itr->second));
584  } else { //link is from the next sector (anti-clockwise)
585  stage1link_ids.emplace(HGCalTriggerBackendDetId(id.zside(),
586  HGCalTriggerBackendDetId::BackendType::Stage1Link,
587  getNextSector(id.sector()),
588  stage2_itr->second));
589  }
590  }
591 
592  return stage1link_ids;
593 }
uint16_t *__restrict__ id
unsigned getNextSector(const unsigned sector) const
std::unordered_multimap< unsigned, unsigned > stage2_to_stage1links_
int zside(DetId const &)
char const * label
std::unordered_set< unsigned > geom_set
unsigned HGCalTriggerGeometryV9Imp3::getStage2FpgaFromStage1Link ( const unsigned  link_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 603 of file HGCalTriggerGeometryV9Imp3.cc.

References getPreviousSector(), gpuClustering::id, label, stage1link_to_stage2_, and ecaldqm::zside().

Referenced by getStage2FpgasFromStage1Fpga().

603  {
604  HGCalTriggerBackendDetId id(link_id);
605  bool same_sector = stage1link_to_stage2_.at(id.label());
606  unsigned sector = id.sector();
607 
608  if (!same_sector) {
609  sector = getPreviousSector(sector);
610  }
611 
612  return HGCalTriggerBackendDetId(id.zside(), HGCalTriggerBackendDetId::BackendType::Stage2FPGA, sector, 0);
613 }
uint16_t *__restrict__ id
int zside(DetId const &)
char const * label
unsigned getPreviousSector(const unsigned sector) const
std::unordered_map< unsigned, unsigned > stage1link_to_stage2_
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getStage2FpgasFromStage1Fpga ( const unsigned  stage1_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 562 of file HGCalTriggerGeometryV9Imp3.cc.

References getStage1LinksFromStage1Fpga(), and getStage2FpgaFromStage1Link().

563  {
564  geom_set stage2_ids;
565 
566  geom_set stage1_links = getStage1LinksFromStage1Fpga(stage1_id);
567  for (const auto& stage1_link : stage1_links) {
568  stage2_ids.emplace(getStage2FpgaFromStage1Link(stage1_link));
569  }
570 
571  return stage2_ids;
572 }
unsigned getStage2FpgaFromStage1Link(const unsigned) const final
std::unordered_set< unsigned > geom_set
geom_set getStage1LinksFromStage1Fpga(const unsigned) const final
unsigned HGCalTriggerGeometryV9Imp3::getTriggerCellFromCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 208 of file HGCalTriggerGeometryV9Imp3.cc.

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

Referenced by getModuleFromCell().

208  {
209  unsigned det = DetId(cell_id).det();
210  unsigned trigger_cell_id = 0;
211  // Scintillator
212  if (det == DetId::HGCalHSc) {
213  // Very rough mapping from cells to TC
214  HGCScintillatorDetId cell_sc_id(cell_id);
215  int ieta = ((cell_sc_id.ietaAbs() - 1) / hSc_triggercell_size_ + 1) * cell_sc_id.zside();
216  int iphi = (cell_sc_id.iphi() - 1) / hSc_triggercell_size_ + 1;
217  trigger_cell_id = HGCScintillatorDetId(cell_sc_id.type(), cell_sc_id.layer(), ieta, iphi);
218  }
219  // HFNose
220  else if (det == DetId::Forward && DetId(cell_id).subdetId() == ForwardSubdetector::HFNose) {
221  HFNoseDetId cell_nose_id(cell_id);
223  cell_nose_id.zside(),
224  cell_nose_id.type(),
225  cell_nose_id.layer(),
226  cell_nose_id.waferU(),
227  cell_nose_id.waferV(),
228  cell_nose_id.triggerCellU(),
229  cell_nose_id.triggerCellV());
230  }
231  // Silicon
232  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
233  HGCSiliconDetId cell_si_id(cell_id);
234  trigger_cell_id = HGCalTriggerDetId(
236  cell_si_id.zside(),
237  cell_si_id.type(),
238  cell_si_id.layer(),
239  cell_si_id.waferU(),
240  cell_si_id.waferV(),
241  cell_si_id.triggerCellU(),
242  cell_si_id.triggerCellV());
243  }
244  return trigger_cell_id;
245 }
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
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
GlobalPoint HGCalTriggerGeometryV9Imp3::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 710 of file HGCalTriggerGeometryV9Imp3.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().

710  {
711  unsigned det = DetId(trigger_cell_det_id).det();
712 
713  // Position: barycenter of the trigger cell.
714  Basic3DVector<float> triggerCellVector(0., 0., 0.);
715  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
716  // Scintillator
717  if (det == DetId::HGCalHSc) {
718  for (const auto& cell : cell_ids) {
719  triggerCellVector += hscGeometry()->getPosition(cell).basicVector();
720  }
721  }
722  // HFNose
723  else if (det == DetId::HGCalTrigger and
724  HGCalTriggerDetId(trigger_cell_det_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
725  for (const auto& cell : cell_ids) {
726  HFNoseDetId cellDetId(cell);
727  triggerCellVector += noseGeometry()->getPosition(cellDetId).basicVector();
728  }
729  }
730  // Silicon
731  else {
732  for (const auto& cell : cell_ids) {
733  HGCSiliconDetId cellDetId(cell);
734  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
735  : hsiGeometry()->getPosition(cellDetId))
736  .basicVector();
737  }
738  }
739  return GlobalPoint(triggerCellVector / cell_ids.size());
740 }
const HGCalGeometry * eeGeometry() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
const HGCalGeometry * noseGeometry() const
const HGCalGeometry * hsiGeometry() const
Definition: DetId.h:17
const HGCalGeometry * hscGeometry() const
geom_set getCellsFromTriggerCell(const unsigned) const final
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryV9Imp3::getTriggerCellsFromModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 380 of file HGCalTriggerGeometryV9Imp3.cc.

References HGCalTopology::dddConstants(), detIdWaferType(), HGCalTriggerModuleDetId::eta(), etaphiMappingFromSector0(), first, geom_rotation_120_, HGCalDDDConstants::getREtaRange(), HFNoseDetIdToModule::getTriggerDetIds(), HGCSiliconDetIdToROC::getTriggerId(), getWaferCentring(), HFNoseTrigger, DetId::HGCalEE, HGCalEETrigger, HGCSiliconDetId::HGCalFine, HGCalHScTrigger, DetId::HGCalHSi, hSc_module_size_, hSc_triggercell_size_, HGCalTriggerGeometryBase::hscTopology(), HGCalTriggerModuleDetId::layer(), phase1PixelTopology::layer, HGCalTriggerModuleDetId::moduleU(), HGCalTriggerModuleDetId::moduleV(), HGCalTriggerModuleDetId::phi(), PixelMapPlotter::roc, HGCalTriggerModuleDetId::sector(), HGCalTriggerModuleDetId::triggerSubdetId(), HGCalTriggerModuleDetId::type(), HGCalGeomRotation::uvMappingFromSector0(), validTriggerCellFromCells(), and HGCalTriggerModuleDetId::zside().

Referenced by getCellsFromModule().

381  {
382  HGCalTriggerModuleDetId hgc_module_id(module_id);
383  unsigned subdet = hgc_module_id.triggerSubdetId();
384 
385  geom_set trigger_cell_det_ids;
386  // Scintillator
388  int ietamin = hscTopology().dddConstants().getREtaRange(hgc_module_id.layer()).first;
389  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
390  int ieta0 = (hgc_module_id.eta() - 1) * hSc_module_size_ + ietamin_tc;
391  int iphi0 = hgc_module_id.phi();
392  etaphiMappingFromSector0(ieta0, iphi0, hgc_module_id.sector());
393  iphi0 = (iphi0 - 1) * hSc_module_size_ + 1;
394  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
395  int ieta = ietaAbs * hgc_module_id.zside();
396  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
397  unsigned trigger_cell_id = HGCScintillatorDetId(hgc_module_id.type(), hgc_module_id.layer(), ieta, iphi);
398  if (validTriggerCellFromCells(trigger_cell_id))
399  trigger_cell_det_ids.emplace(trigger_cell_id);
400  }
401  }
402  }
403  // HFNose
404  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
405  HFNoseDetId module_nose_id(module_id);
407  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
408  for (auto const& idx : ids) {
409  if (validTriggerCellFromCells(idx.rawId()))
410  trigger_cell_det_ids.emplace(idx);
411  }
412  }
413  // Silicon
414  else {
415  HGCSiliconDetIdToROC tc2roc;
416  int moduleU = hgc_module_id.moduleU();
417  int moduleV = hgc_module_id.moduleV();
418  unsigned layer = hgc_module_id.layer();
419 
420  //Rotate to sector
421  geom_rotation_120_.uvMappingFromSector0(getWaferCentring(layer, subdet), moduleU, moduleV, hgc_module_id.sector());
422 
424 
425  unsigned wafer_type = detIdWaferType(det, layer, moduleU, moduleV);
426  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
427  // Loop on ROCs in wafer
428  for (int roc = 1; roc <= nroc; roc++) {
429  // loop on TCs in ROC
430  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
431  for (const auto& tc_uv : tc_uvs) {
432  HGCalTriggerDetId trigger_cell_id(
433  subdet, hgc_module_id.zside(), wafer_type, layer, moduleU, moduleV, tc_uv.first, tc_uv.second);
434  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
435  trigger_cell_det_ids.emplace(trigger_cell_id);
436  }
437  }
438  }
439 
440  return trigger_cell_det_ids;
441 }
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
HGCalGeomRotation::WaferCentring getWaferCentring(unsigned layer, int subdet) const
void uvMappingFromSector0(WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
void etaphiMappingFromSector0(int &ieta, int &iphi, unsigned sector) const
std::pair< int, int > getREtaRange(int lay) const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
const HGCalTopology & hscTopology() const
Detector
Definition: DetId.h:24
std::unordered_set< unsigned > geom_set
bool validTriggerCellFromCells(const unsigned) const
HGCalGeomRotation::WaferCentring HGCalTriggerGeometryV9Imp3::getWaferCentring ( unsigned  layer,
int  subdet 
) const
private

Definition at line 908 of file HGCalTriggerGeometryV9Imp3.cc.

References HGCalGeomRotation::CornerCentredMercedes, HGCalGeomRotation::CornerCentredY, HFNoseTrigger, HGCalEETrigger, HGCalHSiTrigger, and HGCalGeomRotation::WaferCentred.

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

908  {
909  if (subdet == HGCalTriggerSubdetector::HGCalEETrigger) { // CE-E
911  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
912  if ((layer % 2) == 1) { // CE-H Odd
914  } else { // CE-H Even
916  }
917  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) { //HFNose
919  } else {
920  edm::LogError("HGCalTriggerGeometryV9Imp3")
921  << "HGCalTriggerGeometryV9Imp3: trigger sub-detector expected to be silicon";
923  }
924 }
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize > layer
void HGCalTriggerGeometryV9Imp3::initialize ( const HGCalGeometry hgc_ee_geometry,
const HGCalGeometry hgc_hsi_geometry,
const HGCalGeometry hgc_hsc_geometry 
)
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 146 of file HGCalTriggerGeometryV9Imp3.cc.

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

148  {
149  setEEGeometry(hgc_ee_geometry);
150  setHSiGeometry(hgc_hsi_geometry);
151  setHScGeometry(hgc_hsc_geometry);
154  trigger_layers_.resize(totalLayers_ + 1);
155  trigger_layers_[0] = 0; // layer number 0 doesn't exist
156  unsigned trigger_layer = 1;
157  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
158  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
159  // Increase trigger layer number if the layer is not disconnected
160  trigger_layers_[layer] = trigger_layer;
161  trigger_layer++;
162  } else {
163  trigger_layers_[layer] = 0;
164  }
165  }
166  last_trigger_layer_ = trigger_layer - 1;
167  fillMaps();
168 }
void setEEGeometry(const HGCalGeometry *geom)
const HGCalTopology & eeTopology() const
const HGCalTopology & hsiTopology() const
void setHSiGeometry(const HGCalGeometry *geom)
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int layers(bool reco) const
void setHScGeometry(const HGCalGeometry *geom)
std::vector< unsigned > trigger_layers_
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
std::unordered_set< unsigned > disconnected_layers_
void HGCalTriggerGeometryV9Imp3::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 170 of file HGCalTriggerGeometryV9Imp3.cc.

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

173  {
174  setEEGeometry(hgc_ee_geometry);
175  setHSiGeometry(hgc_hsi_geometry);
176  setHScGeometry(hgc_hsc_geometry);
177  setNoseGeometry(hgc_nose_geometry);
178 
181 
182  trigger_layers_.resize(totalLayers_ + 1);
183  trigger_layers_[0] = 0; // layer number 0 doesn't exist
184  unsigned trigger_layer = 1;
185  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
186  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
187  // Increase trigger layer number if the layer is not disconnected
188  trigger_layers_[layer] = trigger_layer;
189  trigger_layer++;
190  } else {
191  trigger_layers_[layer] = 0;
192  }
193  }
194  last_trigger_layer_ = trigger_layer - 1;
195  fillMaps();
196 
198 
199  trigger_nose_layers_.resize(noseLayers_ + 1);
200  trigger_nose_layers_[0] = 0; // layer number 0 doesn't exist
201  unsigned trigger_nose_layer = 1;
202  for (unsigned layer = 1; layer < trigger_nose_layers_.size(); layer++) {
203  trigger_nose_layers_[layer] = trigger_nose_layer;
204  trigger_nose_layer++;
205  }
206 }
void setEEGeometry(const HGCalGeometry *geom)
const HGCalTopology & eeTopology() const
const HGCalTopology & hsiTopology() const
void setHSiGeometry(const HGCalGeometry *geom)
void setNoseGeometry(const HGCalGeometry *geom)
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int layers(bool reco) const
void setHScGeometry(const HGCalGeometry *geom)
std::vector< unsigned > trigger_layers_
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
const HGCalTopology & noseTopology() const
std::vector< unsigned > trigger_nose_layers_
std::unordered_set< unsigned > disconnected_layers_
unsigned HGCalTriggerGeometryV9Imp3::lastTriggerLayer ( ) const
inlinefinalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 63 of file HGCalTriggerGeometryV9Imp3.cc.

References last_trigger_layer_.

unsigned HGCalTriggerGeometryV9Imp3::layerWithOffset ( unsigned  id) const
private

Definition at line 1065 of file HGCalTriggerGeometryV9Imp3.cc.

References DetId::det(), DetId::Forward, heOffset_, HFNoseTrigger, HGCalEETrigger, DetId::HGCalHSc, HGCalHScTrigger, HGCalHSiTrigger, DetId::HGCalTrigger, HGCalDetId::layer(), HGCScintillatorDetId::layer(), HGCalTriggerDetId::layer(), HFNoseTriggerDetId::layer(), HGCalTriggerModuleDetId::layer(), phase1PixelTopology::layer, HGCalTriggerDetId::subdet(), and HGCalTriggerModuleDetId::triggerSubdetId().

Referenced by disconnectedModule(), and triggerLayer().

1065  {
1066  unsigned det = DetId(id).det();
1067  unsigned layer = 0;
1068 
1069  if (det == DetId::HGCalTrigger) {
1070  unsigned subdet = HGCalTriggerDetId(id).subdet();
1072  layer = HGCalTriggerDetId(id).layer();
1073  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
1074  layer = heOffset_ + HGCalTriggerDetId(id).layer();
1075  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
1076  layer = HFNoseTriggerDetId(id).layer();
1077  }
1078  } else if (det == DetId::HGCalHSc) {
1079  layer = heOffset_ + HGCScintillatorDetId(id).layer();
1080  } else if (det == DetId::Forward) {
1081  unsigned subdet = HGCalTriggerModuleDetId(id).triggerSubdetId();
1083  layer = HGCalTriggerModuleDetId(id).layer();
1084  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger ||
1086  layer = heOffset_ + HGCalDetId(id).layer();
1087  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
1088  layer = HGCalTriggerModuleDetId(id).layer();
1089  }
1090  }
1091  return layer;
1092 }
HGCalTriggerSubdetector subdet() const
get the subdetector
constexpr std::array< uint8_t, layerIndexSize > layer
int layer() const
get the layer #
int layer() const
get the layer #
Definition: DetId.h:17
int triggerSubdetId() const
get the trigger sub-detector
int layer() const
get the layer #
int layer() const
get the layer #
int layer() const
get the layer #
Definition: HGCalDetId.h:46
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
void HGCalTriggerGeometryV9Imp3::layerWithoutOffsetAndSubdetId ( unsigned &  layer,
int &  subdetId,
bool  isSilicon 
) const
private

Definition at line 1051 of file HGCalTriggerGeometryV9Imp3.cc.

References heOffset_, HGCalEETrigger, HGCalHScTrigger, and HGCalHSiTrigger.

Referenced by fillMaps().

1051  {
1052  if (!isSilicon) {
1053  layer = layer - heOffset_;
1055  } else {
1056  if (layer > heOffset_) {
1058  layer = layer - heOffset_;
1059  } else {
1061  }
1062  }
1063 }
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned HGCalTriggerGeometryV9Imp3::packLayerSubdetWaferId ( unsigned  layer,
int  subdet,
int  waferU,
int  waferV 
) const
private

Definition at line 879 of file HGCalTriggerGeometryV9Imp3.cc.

References HGCalTriggerModuleDetId::kHGCalLayerMask, HGCalTriggerModuleDetId::kHGCalLayerOffset, HGCalTriggerModuleDetId::kHGCalModuleUMask, HGCalTriggerModuleDetId::kHGCalModuleUOffset, HGCalTriggerModuleDetId::kHGCalModuleVMask, HGCalTriggerModuleDetId::kHGCalModuleVOffset, HGCalTriggerModuleDetId::kHGCalTriggerSubdetMask, and HGCalTriggerModuleDetId::kHGCalTriggerSubdetOffset.

Referenced by disconnectedModule(), fillMaps(), getLinksInModule(), getLpgbtsFromModule(), and getStage1FpgaFromModule().

879  {
880  unsigned packed_value = 0;
881 
882  packed_value |=
884  packed_value |=
886  packed_value |= ((subdet & HGCalTriggerModuleDetId::kHGCalTriggerSubdetMask)
889  return packed_value;
890 }
static const int kHGCalTriggerSubdetMask
int32_t waferU(const int32_t index)
static const int kHGCalModuleVOffset
static const int kHGCalModuleUOffset
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t waferV(const int32_t index)
static const int kHGCalTriggerSubdetOffset
void HGCalTriggerGeometryV9Imp3::reset ( void  )
finalvirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 134 of file HGCalTriggerGeometryV9Imp3.cc.

References lpgbt_to_modules_, lpgbt_to_stage1_, module_to_lpgbts_, module_to_stage1_, stage1_to_lpgbts_, stage1_to_stage1links_, stage1link_to_stage1_, stage1link_to_stage2_, and stage2_to_stage1links_.

134  {
135  stage2_to_stage1links_.clear();
136  stage1link_to_stage2_.clear();
137  stage1link_to_stage1_.clear();
138  stage1_to_stage1links_.clear();
139  stage1_to_lpgbts_.clear();
140  lpgbt_to_stage1_.clear();
141  lpgbt_to_modules_.clear();
142  module_to_lpgbts_.clear();
143  module_to_stage1_.clear();
144 }
std::unordered_map< unsigned, unsigned > stage1link_to_stage1_
std::unordered_multimap< unsigned, unsigned > stage1_to_stage1links_
std::unordered_multimap< unsigned, unsigned > lpgbt_to_modules_
std::unordered_map< unsigned, unsigned > lpgbt_to_stage1_
std::unordered_multimap< unsigned, unsigned > stage2_to_stage1links_
std::unordered_multimap< unsigned, unsigned > module_to_lpgbts_
std::unordered_multimap< unsigned, unsigned > stage1_to_lpgbts_
std::unordered_map< unsigned, unsigned > stage1link_to_stage2_
std::unordered_map< unsigned, unsigned > module_to_stage1_
unsigned HGCalTriggerGeometryV9Imp3::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 958 of file HGCalTriggerGeometryV9Imp3.cc.

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

958  {
959  unsigned layer = layerWithOffset(id);
960 
961  if (DetId(id).det() == DetId::HGCalTrigger and
963  if (layer >= trigger_nose_layers_.size())
964  return 0;
965  return trigger_nose_layers_[layer];
966  }
967  if (layer >= trigger_layers_.size())
968  return 0;
969  return trigger_layers_[layer];
970 }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< unsigned > trigger_layers_
Definition: DetId.h:17
std::vector< unsigned > trigger_nose_layers_
unsigned layerWithOffset(unsigned) const
void HGCalTriggerGeometryV9Imp3::unpackLayerSubdetWaferId ( unsigned  wafer,
unsigned &  layer,
int &  subdet,
int &  waferU,
int &  waferV 
) const
private

Definition at line 892 of file HGCalTriggerGeometryV9Imp3.cc.

References HGCalTriggerModuleDetId::kHGCalLayerMask, HGCalTriggerModuleDetId::kHGCalLayerOffset, HGCalTriggerModuleDetId::kHGCalModuleUMask, HGCalTriggerModuleDetId::kHGCalModuleUOffset, HGCalTriggerModuleDetId::kHGCalModuleVMask, HGCalTriggerModuleDetId::kHGCalModuleVOffset, HGCalTriggerModuleDetId::kHGCalTriggerSubdetMask, and HGCalTriggerModuleDetId::kHGCalTriggerSubdetOffset.

Referenced by getModulesFromLpgbt().

893  {
896  subdet =
899 }
static const int kHGCalTriggerSubdetMask
int32_t waferU(const int32_t index)
static const int kHGCalModuleVOffset
static const int kHGCalModuleUOffset
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t waferV(const int32_t index)
static const int kHGCalTriggerSubdetOffset
bool HGCalTriggerGeometryV9Imp3::validCell ( const unsigned  cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 972 of file HGCalTriggerGeometryV9Imp3.cc.

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

972  {
973  bool is_valid = false;
974  unsigned det = DetId(cell_id).det();
975  switch (det) {
976  case DetId::HGCalEE:
977  is_valid = eeTopology().valid(cell_id);
978  break;
979  case DetId::HGCalHSi:
980  is_valid = hsiTopology().valid(cell_id);
981  break;
982  case DetId::HGCalHSc:
983  is_valid = hscTopology().valid(cell_id);
984  break;
985  case DetId::Forward:
986  is_valid = noseTopology().valid(cell_id);
987  break;
988  default:
989  is_valid = false;
990  break;
991  }
992  return is_valid;
993 }
const HGCalTopology & eeTopology() const
bool valid(const DetId &id) const override
Is this a valid cell id.
const HGCalTopology & hsiTopology() const
Definition: DetId.h:17
const HGCalTopology & hscTopology() const
const HGCalTopology & noseTopology() const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
bool HGCalTriggerGeometryV9Imp3::validCellId ( unsigned  det,
unsigned  cell_id 
) const
private

Definition at line 1011 of file HGCalTriggerGeometryV9Imp3.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().

1011  {
1012  bool is_valid = false;
1013  switch (subdet) {
1014  case DetId::HGCalEE:
1015  is_valid = eeTopology().valid(cell_id);
1016  break;
1017  case DetId::HGCalHSi:
1018  is_valid = hsiTopology().valid(cell_id);
1019  break;
1020  case DetId::HGCalHSc:
1021  is_valid = hscTopology().valid(cell_id);
1022  break;
1023  case DetId::Forward:
1024  is_valid = noseTopology().valid(cell_id);
1025  break;
1026  default:
1027  is_valid = false;
1028  break;
1029  }
1030  return is_valid;
1031 }
const HGCalTopology & eeTopology() const
bool valid(const DetId &id) const override
Is this a valid cell id.
const HGCalTopology & hsiTopology() const
const HGCalTopology & hscTopology() const
const HGCalTopology & noseTopology() const
bool HGCalTriggerGeometryV9Imp3::validTriggerCell ( const unsigned  trigger_cell_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 941 of file HGCalTriggerGeometryV9Imp3.cc.

References validTriggerCellFromCells().

941  {
942  return validTriggerCellFromCells(trigger_cell_id);
943 }
bool validTriggerCellFromCells(const unsigned) const
bool HGCalTriggerGeometryV9Imp3::validTriggerCellFromCells ( const unsigned  trigger_cell_id) const
private

Definition at line 995 of file HGCalTriggerGeometryV9Imp3.cc.

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

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

995  {
996  // Check the validity of a trigger cell with the
997  // validity of the cells. One valid cell in the
998  // trigger cell is enough to make the trigger cell
999  // valid.
1000  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
1001  bool is_valid = false;
1002  for (const auto cell_id : cells) {
1003  unsigned det = DetId(cell_id).det();
1004  is_valid |= validCellId(det, cell_id);
1005  if (is_valid)
1006  break;
1007  }
1008  return is_valid;
1009 }
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
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
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46

Member Data Documentation

std::unordered_set<unsigned> HGCalTriggerGeometryV9Imp3::disconnected_layers_
private
HGCalGeomRotation HGCalTriggerGeometryV9Imp3::geom_rotation_120_ = {HGCalGeomRotation::SectorType::Sector120Degrees}
private
unsigned HGCalTriggerGeometryV9Imp3::heOffset_ = 0
private
unsigned HGCalTriggerGeometryV9Imp3::hSc_module_size_ = 12
private
unsigned HGCalTriggerGeometryV9Imp3::hSc_num_panels_per_sector_ = 8
private
unsigned HGCalTriggerGeometryV9Imp3::hSc_triggercell_size_ = 2
private
unsigned HGCalTriggerGeometryV9Imp3::hSc_wafers_per_module_ = 3
private

Definition at line 70 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by HGCalTriggerGeometryV9Imp3().

edm::FileInPath HGCalTriggerGeometryV9Imp3::jsonMappingFile_
private

Definition at line 72 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by fillMaps().

unsigned HGCalTriggerGeometryV9Imp3::last_trigger_layer_ = 0
private

Definition at line 94 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by initialize(), and lastTriggerLayer().

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

Definition at line 78 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by fillMaps(), and getLinksInModule().

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::lpgbt_to_modules_
private

Definition at line 86 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::lpgbt_to_stage1_
private

Definition at line 85 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::module_to_lpgbts_
private

Definition at line 87 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::module_to_stage1_
private
unsigned HGCalTriggerGeometryV9Imp3::noseLayers_ = 0
private

Definition at line 101 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by initialize().

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::stage1_to_lpgbts_
private

Definition at line 84 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::stage1_to_stage1links_
private

Definition at line 83 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::stage1link_to_stage1_
private

Definition at line 82 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_map<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::stage1link_to_stage2_
private

Definition at line 81 of file HGCalTriggerGeometryV9Imp3.cc.

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

std::unordered_multimap<unsigned, unsigned> HGCalTriggerGeometryV9Imp3::stage2_to_stage1links_
private

Definition at line 80 of file HGCalTriggerGeometryV9Imp3.cc.

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

unsigned HGCalTriggerGeometryV9Imp3::totalLayers_ = 0
private

Definition at line 102 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by initialize().

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

Definition at line 92 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by initialize(), and triggerLayer().

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

Definition at line 93 of file HGCalTriggerGeometryV9Imp3.cc.

Referenced by initialize(), and triggerLayer().