59 std::vector<DetId> ids;
63 id.iType,
id.iCell1,
id.iCell2,
id.zSide, 1, -1);
65 edm::LogVerbatim(
"HGCalGeom") <<
"Type:WaferU:WaferV " <<
id.iType <<
":" <<
id.iCell1 <<
":" <<
id.iCell2
66 <<
" CellType " << celltype;
74 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
75 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
76 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
77 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
78 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
79 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
84 int wu1(
id.iSec1), wv1(
id.iSec2 - 1);
90 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
92 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
93 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
94 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1 - 1);
95 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1);
96 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
97 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
102 int wu1(
id.iSec1 + 1), wv1(
id.iSec2);
108 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
110 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
113 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
114 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
115 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
120 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
126 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
130 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
131 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
132 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
133 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
138 int wu1(
id.iSec1), wv1(
id.iSec2 + 1);
144 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
147 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
148 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
149 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
150 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
156 int wu1(
id.iSec1 - 1), wv1(
id.iSec2);
162 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
164 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
165 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
166 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
167 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
174 int wu1(
id.iSec1 - 1), wv1(
id.iSec2 - 1);
180 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
182 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
183 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
184 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
187 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
192 int wu1(
id.iSec1), wv1(
id.iSec2 - 1);
196 int wu2(
id.iSec1 - 1), wv2(
id.iSec2 - 1);
202 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 203 <<
":" << N2 <<
":" <<
u2;
205 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
206 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
207 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1 - 1);
208 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1);
210 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
215 int wu1(
id.iSec1 + 1), wv1(
id.iSec2);
219 int wu2(
id.iSec1), wv2(
id.iSec2 - 1);
225 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1 <<
":" <<
t2 226 <<
":" << N2 <<
":" << v2;
228 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
230 addHGCSiliconId(ids,
id.det,
id.zSide,
t2,
id.iLay, wu2, wv2, 2 * N2 - 1, v2 + N2 - 1);
231 addHGCSiliconId(ids,
id.det,
id.zSide,
t2,
id.iLay, wu2, wv2, 2 * N2 - 1, v2 + N2);
232 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
233 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
238 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
242 int wu2(
id.iSec1 + 1), wv2(
id.iSec2);
248 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 249 <<
":" << N2 <<
":" <<
u2;
254 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
255 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
256 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
261 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
265 int wu2(
id.iSec1), wv2(
id.iSec2 + 1);
271 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 272 <<
":" << N2 <<
":" << v2;
276 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
277 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
278 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
284 int wu1(
id.iSec1), wv1(
id.iSec2 + 1);
288 int wu2(
id.iSec1 - 1), wv2(
id.iSec2);
294 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 295 <<
":" << N2 <<
":" <<
u2;
298 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
299 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
300 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
307 int wu1(
id.iSec1 - 1), wv1(
id.iSec2 - 1);
311 int wu2(
id.iSec1 - 1), wv2(
id.iSec2);
317 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1 <<
":" <<
t2 318 <<
":" << N2 <<
":" <<
u2;
320 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
321 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
322 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
331 edm::LogWarning(
"HGCalGeom") <<
"u:v " <<
id.iCell1 <<
":" <<
id.iCell2 <<
" Tests " << (
id.iCell1 > 2 *
N - 1)
332 <<
":" << (
id.iCell2 > 2 *
N - 1) <<
":" << (
id.iCell2 >= (
id.iCell1 +
N)) <<
":" 333 << (
id.iCell1 > (
id.iCell2 +
N)) <<
" ERROR";
336 int iphi1 = (
id.iCell1 > 1) ?
id.iCell1 - 1 :
hdcons_.
getUVMax(
id.iType);
337 int iphi2 = (
id.iCell1 <
hdcons_.
getUVMax(
id.iType)) ?
id.iCell1 + 1 : 1;
354 int type = (
id.iType > 0) ? 1 : 0;
358 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
367 edm::LogVerbatim(
"HGCalGeom") <<
"Input Trap " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
380 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex8 " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iSec2
381 <<
":" <<
id.iCell1 <<
":" <<
id.iCell2 <<
":" <<
id.iType <<
" Constants " 396 id.iType = (
type == 0 ? -1 : 1);
401 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
402 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
411 edm::LogVerbatim(
"HGCalGeom") <<
"Input Trap " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
412 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
423 di = (di -
id.iLay + 1) /
layers_;
425 id.iCell1 = (di -
id.iCell2) /
cellMax_;
427 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex8 " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
428 <<
":" <<
id.iSec1 <<
":" <<
id.iSec2 <<
":" <<
id.iCell1 <<
":" <<
id.iCell2;
441 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iType
449 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Trap I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" 457 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex8 I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" 470 id.iLay > 0 &&
id.iLay <=
layers_ &&
id.iSec1 >= 0 &&
id.iSec1 <=
sectors_);
533 id.iType = ((di -
id.iLay + 1) /
layers_ == 0) ? -1 : 1;
535 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" <<
id.iLay
540 di = (di -
id.iCell1 + 1) /
cellMax_;
542 di = (di -
id.iSec1 + 1) /
sectors_;
546 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Trap I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" 547 <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
555 id.iType = (di -
id.iLay + 1) /
layers_;
557 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex8 I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" 558 <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iSec2;
566 std::vector<DetId>& ids,
int zside,
int type,
int lay,
int iradius,
int iphi)
const {
573 ids.emplace_back(
DetId(
id));
578 std::vector<DetId>& ids,
int det,
int zside,
int type,
int lay,
int waferU,
int waferV,
int cellU,
int cellV)
const {
581 <<
waferU <<
":" <<
waferV <<
":" << cellU <<
":" << cellV <<
" ==> Validity " 586 ids.emplace_back(
DetId(
id));
594 idx.iCell1 =
id.cell();
596 idx.iLay =
id.layer();
597 idx.iSec1 =
id.wafer();
599 idx.iType =
id.waferType();
600 idx.zSide =
id.zside();
601 idx.det =
id.subdetId();
604 idx.iCell1 =
id.iphi();
606 idx.iLay =
id.layer();
607 idx.iSec1 =
id.ietaAbs();
609 idx.iType =
id.type();
610 idx.zSide =
id.zside();
611 idx.det = (
int)(
id.subdet());
614 idx.iCell1 =
id.cellU();
615 idx.iCell2 =
id.cellV();
616 idx.iLay =
id.layer();
617 idx.iSec1 =
id.waferU();
618 idx.iSec2 =
id.waferV();
619 idx.iType =
id.type();
620 idx.zSide =
id.zside();
621 idx.det = (
int)(
id.subdet());
624 idx.iCell1 =
id.cellU();
625 idx.iCell2 =
id.cellV();
626 idx.iLay =
id.layer();
627 idx.iSec1 =
id.waferU();
628 idx.iSec2 =
id.waferV();
629 idx.iType =
id.type();
630 idx.zSide =
id.zside();
631 idx.det = (
int)(
id.subdet());
640 <<
":" <<
idx.iSec1 <<
":" <<
idx.iSec2 <<
":" <<
idx.iCell1 <<
":" <<
idx.iCell2;
649 if (typm.first >= 0) {
bool maskCell(const DetId &id, int corners) const
Log< level::Info, true > LogVerbatim
unsigned int totalGeomModules() const
HGCalGeometryMode::GeometryMode mode_
static constexpr int32_t topCorner
bool tileTrapezoid() const
int32_t waferU(const int32_t index)
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
bool isValidHex(int lay, int mod, int cell, bool reco) const
bool valid(const DetId &id) const override
Is this a valid cell id.
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
bool waferHexagon6() const
static constexpr int32_t leftEdge
HGCalGeometryMode::GeometryMode geomMode() const
int32_t cellType(int type, int waferU, int waferV, int iz, int fwdBack, int orient) const
constexpr Detector det() const
get the detector field from this detid
std::pair< int, int > tileType(int layer, int ring, int phi) const
static constexpr int32_t topLeftCorner
int getTypeHex(int layer, int waferU, int waferV) const
int maxCells(bool reco) const
bool validHashIndex(uint32_t ix) const
static constexpr int32_t bottomLeftCorner
virtual uint32_t detId2denseGeomId(const DetId &id) const
int layer() const
get the layer #
bool isValidTrap(int lay, int ieta, int iphi) const
int getUVMax(int type) const
DecodedDetId decode(const DetId &id) const
static constexpr int32_t topRightCorner
static constexpr int32_t bottomRightEdge
bool validModule(const DetId &id, int cornerMin) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int layers(bool reco) const
uint32_t detId2denseId(const DetId &id) const override
Dense indexing.
ForwardSubdetector subdet_
const HGCalDDDConstants & hdcons_
static constexpr int32_t bottomLeftEdge
DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY) const
#define TYPELOOKUP_DATA_REG(_dataclass_)
int ring() const
get the eta index
void addHGCSCintillatorId(std::vector< DetId > &ids, int zside, int type, int lay, int iradius, int iphi) const
add DetId of Scintillator and Silicon type if valid
static constexpr int32_t bottomRightCorner
DetId switchZSide(const DetId startId) const
static constexpr int32_t centralCell
constexpr uint32_t rawId() const
get the raw id
int numberCells(bool reco) const
DetId encode(const DecodedDetId &id_) const
DetId changeZ(const DetId &id, int nrStepsZ) const
move the nagivator along z
std::vector< DetId > neighbors(const DetId &id) const
static constexpr int32_t topRightEdge
bool waferHexagon8() const
void addHGCSiliconId(std::vector< DetId > &ids, int det, int zside, int type, int lay, int waferU, int waferV, int cellU, int cellV) const
int32_t waferV(const int32_t index)
static constexpr int32_t rightEdge
static constexpr int32_t bottomCorner
unsigned int kSizeForDenseIndexing
DetId denseId2detId(uint32_t denseId) const override
static constexpr int32_t WaferCornerMin
int modifyUV(int uv, int type1, int type2) const
Log< level::Warning, false > LogWarning
unsigned int allGeomModules() const
HGCalTopology(const HGCalDDDConstants &hdcons, int subdet)
create a new Topology
DecodedDetId geomDenseId2decId(const uint32_t &hi) const
static constexpr int32_t topLeftEdge