74 bool validCellId(
unsigned det,
unsigned cell_id)
const;
77 int detIdWaferType(
unsigned det,
unsigned layer,
short waferU,
short waferV)
const;
81 void unpackWaferId(
unsigned wafer,
int& waferU,
int& waferV)
const;
93 const unsigned ntc_per_wafer = 48;
98 std::vector<unsigned> tmp_vector = conf.
getParameter<std::vector<unsigned>>(
"DisconnectedModules");
100 tmp_vector = conf.
getParameter<std::vector<unsigned>>(
"DisconnectedLayers");
111 <<
"HGCalTriggerGeometryV9Imp2 geometry cannot be initialized with the V7/V8 HGCAL geometry";
124 unsigned trigger_layer = 1;
139 unsigned det =
DetId(cell_id).
det();
140 unsigned trigger_cell_id = 0;
162 return trigger_cell_id;
170 unsigned det =
DetId(trigger_cell_id).
det();
172 unsigned subdet_old = 0;
174 unsigned tc_type = 1;
176 unsigned module_id = 0;
180 tc_type = trigger_cell_sc_id.
type();
181 layer = trigger_cell_sc_id.
layer();
182 zside = trigger_cell_sc_id.
zside();
192 unsigned subdet = trigger_cell_trig_id.
subdet();
195 layer = trigger_cell_trig_id.
layer();
196 zside = trigger_cell_trig_id.
zside();
198 int waferu = trigger_cell_trig_id.
waferU();
199 int waferv = trigger_cell_trig_id.
waferV();
204 << trigger_cell_trig_id <<
"HGCalTriggerGeometry: Wafer (" << waferu <<
"," << waferv
205 <<
") is not mapped to any trigger module. The module mapping should be modified. \n";
207 module = module_itr->second;
216 const unsigned trigger_cell_id)
const {
217 DetId trigger_cell_det_id(trigger_cell_id);
218 unsigned det = trigger_cell_det_id.
det();
226 int ieta = ietaAbs * trigger_cell_sc_id.
zside();
230 cell_det_ids.emplace(cell_id);
237 unsigned subdet = trigger_cell_trig_id.
subdet();
240 int layer = trigger_cell_trig_id.
layer();
242 int type = trigger_cell_trig_id.
type();
243 int waferu = trigger_cell_trig_id.
waferU();
244 int waferv = trigger_cell_trig_id.
waferV();
245 std::vector<int> cellus = trigger_cell_trig_id.
cellU();
246 std::vector<int> cellvs = trigger_cell_trig_id.
cellV();
247 for (
unsigned ic = 0; ic < cellus.size(); ic++) {
248 HGCSiliconDetId cell_det_id(cell_det, zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
249 cell_det_ids.emplace(cell_det_id.
rawId());
259 for (
auto trigger_cell_id : trigger_cells) {
261 cell_det_ids.insert(cells.begin(), cells.end());
267 const unsigned module_id)
const {
270 for (
auto trigger_cell_id : trigger_cells) {
272 cell_det_ids.insert(cells.begin(), cells.end());
278 const unsigned module_id)
const {
279 DetId module_det_id(module_id);
280 unsigned det = module_det_id.
det();
290 int ieta = ietaAbs * module_sc_id.
zside();
294 trigger_cell_det_ids.emplace(trigger_cell_id);
305 for (
auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
313 unsigned layer = module_si_id.
layer();
320 for (
const auto& tc_uv : tc_uvs) {
322 subdet, module_si_id.
zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
324 trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
329 return trigger_cell_det_ids;
333 const unsigned module_id)
const {
334 DetId module_det_id(module_id);
335 unsigned det = module_det_id.
det();
343 int ieta = ietaAbs * module_sc_id.
zside();
347 trigger_cell_det_ids.emplace(trigger_cell_id);
358 for (
auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
366 unsigned layer = module_si_id.
layer();
373 for (
const auto& tc_uv : tc_uvs) {
375 subdet, module_si_id.
zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
376 trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
381 return trigger_cell_det_ids;
385 const unsigned trigger_cell_id)
const {
386 throw cms::Exception(
"FeatureNotImplemented") <<
"Neighbor search is not implemented in HGCalTriggerGeometryV9Imp2";
390 DetId module_det_id(module_id);
401 const unsigned sector0_mask = 0x7F;
402 module = (module & sector0_mask);
409 DetId module_det_id(module_id);
410 unsigned nWafers = 1;
426 unsigned det =
DetId(trigger_cell_det_id).
det();
432 for (
const auto& cell : cell_ids) {
438 for (
const auto& cell : cell_ids) {
445 return GlobalPoint(triggerCellVector / cell_ids.size());
449 unsigned det =
DetId(module_det_id).
det();
455 for (
const auto& cell : cell_ids) {
461 for (
const auto& cell : cell_ids) {
468 return GlobalPoint(moduleVector / cell_ids.size());
474 if (!l1tModulesMappingStream.is_open()) {
475 throw cms::Exception(
"MissingDataFile") <<
"Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
481 for (; l1tModulesMappingStream >> layer >> waferu >> waferv >> module;) {
485 if (!l1tModulesMappingStream.eof()) {
487 <<
"Error reading L1TModulesMapping '" << layer <<
" " << waferu <<
" " << waferv <<
" " << module <<
"' \n";
489 l1tModulesMappingStream.close();
492 if (!l1tLinksMappingStream.is_open()) {
493 throw cms::Exception(
"MissingDataFile") <<
"Cannot open HGCalTriggerGeometry L1TLinksMapping file\n";
496 for (; l1tLinksMappingStream >> layer >> module >>
links;) {
502 if (!l1tLinksMappingStream.eof()) {
504 <<
"Error reading L1TLinksMapping '" << layer <<
" " << module <<
" " << links <<
"' \n";
506 l1tLinksMappingStream.close();
510 unsigned packed_value = 0;
511 unsigned waferUsign = (waferU >= 0) ? 0 : 1;
512 unsigned waferVsign = (waferV >= 0) ? 0 : 1;
521 unsigned packed_value = 0;
527 unsigned waferUsign = (waferU >= 0) ? 0 : 1;
528 unsigned waferVsign = (waferV >= 0) ? 0 : 1;
539 unsigned packed_value = 0;
565 bool disconnected =
false;
587 for (
const auto cell_id : cells) {
588 unsigned det =
DetId(cell_id).
det();
unsigned getModuleFromCell(const unsigned) const final
T getParameter(std::string const &) const
static const int kHGCalWaferVOffset
bool validCellId(unsigned det, unsigned cell_id) const
geom_set getNeighborsFromTriggerCell(const unsigned) const final
unsigned lastTriggerLayer() const final
static const int kHGCalLayerOffset
unsigned packWaferId(int waferU, int waferV) const
HGCalTriggerSubdetector subdet() const
get the subdetector
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
unsigned hSc_wafers_per_module_
static const int kHGCalLayerMask
void setEEGeometry(const HGCalGeometry *geom)
unsigned triggerLayer(const unsigned) const final
bool is_valid(const Digi &d)
GlobalPoint getTriggerCellPosition(const unsigned) const final
std::vector< unsigned > trigger_layers_
const HGCalGeometry * eeGeometry() const
const HGCalTopology & eeTopology() const
static const int kHGCalWaferVSignOffset
unsigned hSc_triggercell_size_
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
int getTypeHex(int layer, int waferU, int waferV) const
std::unordered_map< unsigned, unsigned > links_per_module_
int type() const
get the type
GlobalPoint getPosition(const DetId &id) const
int zside() const
get the z-side of the cell (1/-1)
std::unordered_map< unsigned, unsigned > wafer_to_module_
int zside() const
get the z-side of the cell (1/-1)
unsigned getModuleSize(const unsigned module_id) const final
static const int kSubdetOffset
const HGCalTopology & hsiTopology() const
void setHSiGeometry(const HGCalGeometry *geom)
int type() const
get the type
unsigned getTriggerCellFromCell(const unsigned) const final
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
int layer() const
get the layer #
static const int kHGCalCellMask
void initialize(const CaloGeometry *) final
unsigned int layers(bool reco) const
int zside() const
get the z-side of the cell (1/-1)
static const int kSubdetMask
int type() const
get the type
geom_set getCellsFromModule(const unsigned) const final
int layer() const
get the layer #
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
std::unordered_set< unsigned > disconnected_modules_
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
geom_set getCellsFromTriggerCell(const unsigned) const final
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
HGCalTriggerGeometryV9Imp2(const edm::ParameterSet &conf)
std::vector< int > cellV() const
void setHScGeometry(const HGCalGeometry *geom)
geom_set getTriggerCellsFromModule(const unsigned) const final
int iphi() const
get the phi index
unsigned getLinksInModule(const unsigned module_id) const final
int wafer() const
get the wafer #
edm::FileInPath l1tLinksMapping_
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
std::pair< int, int > getREtaRange(int lay) const
unsigned getModuleFromTriggerCell(const unsigned) const final
unsigned hSc_links_per_module_
bool disconnectedModule(const unsigned) const final
static const int kHGCalLayerMask
const HGCalGeometry * hsiGeometry() const
GlobalPoint getModulePosition(const unsigned) const final
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
static const int kHGCalWaferUMask
const HGCalDDDConstants & dddConstants() const
const HGCalGeometry * hscGeometry() const
const HGCalTopology & hscTopology() const
static const int kHGCalWaferVSignMask
unsigned last_trigger_layer_
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
static const int kHGCalWaferOffset
std::set< unsigned > geom_ordered_set
static const int kHGCalLayerOffset
int layer() const
get the layer #
std::unordered_set< unsigned > disconnected_layers_
bool validTriggerCell(const unsigned) const final
std::vector< int > cellU() const
int zside() const
get the z-side of the cell (1/-1)
std::unordered_set< unsigned > geom_set
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
edm::FileInPath l1tModulesMapping_
std::string fullPath() const
unsigned layerWithOffset(unsigned) const
#define DEFINE_EDM_PLUGIN(factory, type, name)
unsigned packLayerWaferId(unsigned layer, int waferU, int waferV) const
static const int kHGCalWaferUOffset
bool valid(const DetId &id) const override
Is this a valid cell id.
const BasicVectorType & basicVector() const
static const int kHGCalWaferUSignOffset
bool validTriggerCellFromCells(const unsigned) const
int layer() const
get the layer #
unsigned hSc_module_size_
static const int kHGCalWaferMask
constexpr Detector det() const
get the detector field from this detid