60 std::vector<DetId> ids;
64 id.iType,
id.iCell1,
id.iCell2,
id.zSide, 1, -1);
66 edm::LogVerbatim(
"HGCalGeom") <<
"Type:WaferU:WaferV " <<
id.iType <<
":" <<
id.iCell1 <<
":" <<
id.iCell2
67 <<
" CellType " << celltype;
75 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
76 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
77 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
78 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
79 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
80 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
85 int wu1(
id.iSec1), wv1(
id.iSec2 - 1);
91 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
93 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
94 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
95 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1 - 1);
96 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1);
97 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
98 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
103 int wu1(
id.iSec1 + 1), wv1(
id.iSec2);
109 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
111 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 - 1,
id.iCell2);
115 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
116 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
121 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
127 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
131 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
132 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
133 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
134 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
139 int wu1(
id.iSec1), wv1(
id.iSec2 + 1);
145 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1;
148 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
149 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
150 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
151 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
157 int wu1(
id.iSec1 - 1), wv1(
id.iSec2);
163 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
165 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
166 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
167 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
168 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
175 int wu1(
id.iSec1 - 1), wv1(
id.iSec2 - 1);
181 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1;
183 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
184 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
185 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
188 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
193 int wu1(
id.iSec1), wv1(
id.iSec2 - 1);
197 int wu2(
id.iSec1 - 1), wv2(
id.iSec2 - 1);
203 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 204 <<
":" << N2 <<
":" <<
u2;
206 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
207 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
208 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1 - 1);
209 addHGCSiliconId(ids,
id.det,
id.zSide,
t1,
id.iLay, wu1, wv1, 2 * N1 - 1, v1 + N1);
211 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
216 int wu1(
id.iSec1 + 1), wv1(
id.iSec2);
220 int wu2(
id.iSec1), wv2(
id.iSec2 - 1);
226 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1 <<
":" <<
t2 227 <<
":" << N2 <<
":" << v2;
229 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
231 addHGCSiliconId(ids,
id.det,
id.zSide,
t2,
id.iLay, wu2, wv2, 2 * N2 - 1, v2 + N2 - 1);
232 addHGCSiliconId(ids,
id.det,
id.zSide,
t2,
id.iLay, wu2, wv2, 2 * N2 - 1, v2 + N2);
233 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
234 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
239 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
243 int wu2(
id.iSec1 + 1), wv2(
id.iSec2);
249 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 250 <<
":" << N2 <<
":" <<
u2;
255 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
256 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
257 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2 + 1);
262 int wu1(
id.iSec1 + 1), wv1(
id.iSec2 + 1);
266 int wu2(
id.iSec1), wv2(
id.iSec2 + 1);
272 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 273 <<
":" << N2 <<
":" << v2;
277 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
278 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
279 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 + 1);
285 int wu1(
id.iSec1), wv1(
id.iSec2 + 1);
289 int wu2(
id.iSec1 - 1), wv2(
id.iSec2);
295 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" << v1 <<
":" <<
t2 296 <<
":" << N2 <<
":" <<
u2;
299 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
300 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
301 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2);
308 int wu1(
id.iSec1 - 1), wv1(
id.iSec2 - 1);
312 int wu2(
id.iSec1 - 1), wv2(
id.iSec2);
318 <<
":" << wu1 <<
":" << wv1 <<
":" <<
t1 <<
":" << N1 <<
":" <<
u1 <<
":" <<
t2 319 <<
":" << N2 <<
":" <<
u2;
321 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 + 1,
id.iCell2);
322 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1,
id.iCell2 - 1);
323 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
id.iCell1 - 1,
id.iCell2 - 1);
332 edm::LogWarning(
"HGCalGeom") <<
"u:v " <<
id.iCell1 <<
":" <<
id.iCell2 <<
" Tests " << (
id.iCell1 > 2 *
N - 1)
333 <<
":" << (
id.iCell2 > 2 *
N - 1) <<
":" << (
id.iCell2 >= (
id.iCell1 +
N)) <<
":" 334 << (
id.iCell1 > (
id.iCell2 +
N)) <<
" ERROR";
337 int iphi1 = (
id.iCell1 > 1) ?
id.iCell1 - 1 :
hdcons_.
getUVMax(
id.iType);
338 int iphi2 = (
id.iCell1 <
hdcons_.
getUVMax(
id.iType)) ?
id.iCell1 + 1 : 1;
355 int type = (
id.iType > 0) ? 1 : 0;
359 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
368 edm::LogVerbatim(
"HGCalGeom") <<
"Input Trap " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
381 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex8 " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iSec2
382 <<
":" <<
id.iCell1 <<
":" <<
id.iCell2 <<
":" <<
id.iType <<
" Constants " 397 id.iType = (
type == 0 ? -1 : 1);
402 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
403 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
412 edm::LogVerbatim(
"HGCalGeom") <<
"Input Trap " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
413 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
424 di = (di -
id.iLay + 1) /
layers_;
426 id.iCell1 = (di -
id.iCell2) /
cellMax_;
428 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex8 " <<
hi <<
" o/p " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iType
429 <<
":" <<
id.iSec1 <<
":" <<
id.iSec2 <<
":" <<
id.iCell1 <<
":" <<
id.iCell2;
442 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iType
450 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Trap I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" 458 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex8 I/P " <<
id.zSide <<
":" <<
id.iLay <<
":" <<
id.iSec1 <<
":" 471 id.iCell1 < cells_ && id.iLay > 0 &&
id.iLay <= layers_ && id.iSec1 >= 0 &&
id.iSec1 <=
sectors_);
534 id.iType = ((di -
id.iLay + 1) /
layers_ == 0) ? -1 : 1;
536 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" <<
id.iLay
541 di = (di -
id.iCell1 + 1) /
cellMax_;
543 di = (di -
id.iSec1 + 1) /
sectors_;
547 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Trap I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" 548 <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
556 id.iType = (di -
id.iLay + 1) /
layers_;
558 edm::LogVerbatim(
"HGCalGeom") <<
"Geom Hex8 I/P " <<
hi <<
" O/P " <<
id.zSide <<
":" <<
id.iType <<
":" 559 <<
id.iLay <<
":" <<
id.iSec1 <<
":" <<
id.iSec2;
567 std::vector<DetId>& ids,
int zside,
int type,
int lay,
int iradius,
int iphi)
const {
574 ids.emplace_back(
DetId(
id));
579 std::vector<DetId>& ids,
int det,
int zside,
int type,
int lay,
int waferU,
int waferV,
int cellU,
int cellV)
const {
582 <<
waferU <<
":" <<
waferV <<
":" << cellU <<
":" << cellV <<
" ==> Validity " 588 ids.emplace_back(
DetId(
id));
591 ids.emplace_back(
DetId(
id));
600 idx.iCell1 =
id.cell();
602 idx.iLay =
id.layer();
603 idx.iSec1 =
id.wafer();
605 idx.iType =
id.waferType();
606 idx.zSide =
id.zside();
607 idx.det =
id.subdetId();
610 idx.iCell1 =
id.iphi();
612 idx.iLay =
id.layer();
613 idx.iSec1 =
id.ietaAbs();
615 idx.iType =
id.type();
616 idx.zSide =
id.zside();
617 idx.det =
static_cast<int>(
id.subdet());
620 idx.iCell1 =
id.cellU();
621 idx.iCell2 =
id.cellV();
622 idx.iLay =
id.layer();
623 idx.iSec1 =
id.waferU();
624 idx.iSec2 =
id.waferV();
625 idx.iType =
id.type();
626 idx.zSide =
id.zside();
627 idx.det =
static_cast<int>(
id.subdet());
630 idx.iCell1 =
id.cellU();
631 idx.iCell2 =
id.cellV();
632 idx.iLay =
id.layer();
633 idx.iSec1 =
id.waferU();
634 idx.iSec2 =
id.waferV();
635 idx.iType =
id.type();
636 idx.zSide =
id.zside();
637 idx.det =
static_cast<int>(
id.subdet());
646 <<
":" <<
idx.iSec1 <<
":" <<
idx.iSec2 <<
":" <<
idx.iCell1 <<
":" <<
idx.iCell2;
655 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 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
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart) const
constexpr Detector det() const
get the detector field from this detid
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 getUVMax(int type) const
DecodedDetId decode(const DetId &id) const
static constexpr int32_t topRightCorner
bool isValidTrap(int zside, int lay, int ieta, int iphi) const
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.
std::pair< int, int > tileType(int layer, int ring, int phi) const
ForwardSubdetector subdet_
const HGCalDDDConstants & hdcons_
static constexpr int32_t bottomLeftEdge
DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY) const
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
constexpr void setType(int type)
#define TYPELOOKUP_DATA_REG(_dataclass_)
constexpr int layer() const
get the layer #
int32_t waferV(const int32_t index)
static constexpr int32_t rightEdge
static constexpr int32_t bottomCorner
unsigned int kSizeForDenseIndexing
constexpr void setSiPM(int sipm)
constexpr int ring() const
get the eta index
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