12 int det) : hdcons_(hdcons) {
51 << cells_ <<
" cells and total channels " 64 std::vector<DetId>
ids;
72 <<
id.iCell1 <<
":" <<
id.iCell2
73 <<
" CellType " << celltype;
82 id.iCell1+1,
id.iCell2);
84 id.iCell1,
id.iCell2-1);
86 id.iCell1-1,
id.iCell2-1);
88 id.iCell1-1,
id.iCell2);
90 id.iCell1,
id.iCell2+1);
92 id.iCell1+1,
id.iCell2+1);
97 int wu1(
id.iSec1), wv1(
id.iSec2-1);
103 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 106 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
107 id.iCell1+1,
id.iCell2);
108 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
109 id.iCell1,
id.iCell2-1);
110 addHGCSiliconId(ids,
id.det,
id.zSide,t1,
id.iLay,wu1,wv1,2*N1-1,v1+N1-1);
112 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
113 id.iCell1,
id.iCell2+1);
114 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
115 id.iCell1+1,
id.iCell2+1);
120 int wu1(
id.iSec1+1), wv1(
id.iSec2);
126 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 129 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
130 id.iCell1+1,
id.iCell2);
132 addHGCSiliconId(ids,
id.det,
id.zSide,t1,
id.iLay,wu1,wv1,u1+N1-1,2*N1-1);
133 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
134 id.iCell1-1,
id.iCell2);
135 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
136 id.iCell1,
id.iCell2+1);
137 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
138 id.iCell1+1,
id.iCell2+1);
143 int wu1(
id.iSec1+1), wv1(
id.iSec2+1);
149 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 154 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
155 id.iCell1-1,
id.iCell2-1);
156 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
157 id.iCell1-1,
id.iCell2);
158 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
159 id.iCell1,
id.iCell2+1);
160 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
161 id.iCell1+1,
id.iCell2+1);
166 int wu1(
id.iSec1), wv1(
id.iSec2+1);
172 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 176 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
177 id.iCell1,
id.iCell2-1);
178 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
179 id.iCell1-1,
id.iCell2-1);
180 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
181 id.iCell1-1,
id.iCell2);
182 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
183 id.iCell1,
id.iCell2+1);
189 int wu1(
id.iSec1-1), wv1(
id.iSec2);
195 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 198 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
199 id.iCell1+1,
id.iCell2);
200 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
201 id.iCell1,
id.iCell2-1);
202 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
203 id.iCell1-1,
id.iCell2-1);
204 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
205 id.iCell1-1,
id.iCell2);
212 int wu1(
id.iSec1-1), wv1(
id.iSec2-1);
218 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 221 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
222 id.iCell1+1,
id.iCell2);
223 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
224 id.iCell1,
id.iCell2-1);
225 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
226 id.iCell1-1,
id.iCell2-1);
229 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
230 id.iCell1+1,
id.iCell2+1);
235 int wu1(
id.iSec1), wv1(
id.iSec2-1);
239 int wu2(
id.iSec1-1), wv2(
id.iSec2-1);
245 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 246 << v1 <<
":" << t2 <<
":" << N2 <<
":" 249 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
250 id.iCell1+1,
id.iCell2);
251 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
252 id.iCell1,
id.iCell2-1);
253 addHGCSiliconId(ids,
id.det,
id.zSide,t1,
id.iLay,wu1,wv1,2*N1-1,v1+N1-1);
256 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
257 id.iCell1+1,
id.iCell2+1);
262 int wu1(
id.iSec1+1), wv1(
id.iSec2);
266 int wu2(
id.iSec1), wv2(
id.iSec2-1);
272 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 273 << u1 <<
":" << t2 <<
":" << N2 <<
":" 276 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
277 id.iCell1+1,
id.iCell2);
279 addHGCSiliconId(ids,
id.det,
id.zSide,t2,
id.iLay,wu2,wv2,2*N2-1,v2+N2-1);
281 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
282 id.iCell1,
id.iCell2+1);
283 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
284 id.iCell1+1,
id.iCell2+1);
289 int wu1(
id.iSec1+1), wv1(
id.iSec2+1);
293 int wu2(
id.iSec1+1), wv2(
id.iSec2);
299 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 300 << v1 <<
":" << t2 <<
":" << N2 <<
":" 305 addHGCSiliconId(ids,
id.det,
id.zSide,t2,
id.iLay,wu2,wv2,u2+N2-1,2*N2-1);
306 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
307 id.iCell1-1,
id.iCell2);
308 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
309 id.iCell1,
id.iCell2+1);
310 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
311 id.iCell1+1,
id.iCell2+1);
316 int wu1(
id.iSec1+1), wv1(
id.iSec2+1);
320 int wu2(
id.iSec1), wv2(
id.iSec2+1);
326 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 327 << v1 <<
":" << t2 <<
":" << N2 <<
":" 332 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
333 id.iCell1-1,
id.iCell2-1);
334 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
335 id.iCell1-1,
id.iCell2);
336 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
337 id.iCell1,
id.iCell2+1);
343 int wu1(
id.iSec1), wv1(
id.iSec2+1);
347 int wu2(
id.iSec1-1), wv2(
id.iSec2);
353 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 354 << v1 <<
":" << t2 <<
":" << N2 <<
":" 358 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
359 id.iCell1,
id.iCell2-1);
360 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
361 id.iCell1-1,
id.iCell2-1);
362 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
363 id.iCell1-1,
id.iCell2);
370 int wu1(
id.iSec1-1), wv1(
id.iSec2-1);
374 int wu2(
id.iSec1-1), wv2(
id.iSec2);
380 << wv1 <<
":" << t1 <<
":" << N1 <<
":" 381 << u1 <<
":" << t2 <<
":" << N2 <<
":" 384 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
385 id.iCell1+1,
id.iCell2);
386 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
387 id.iCell1,
id.iCell2-1);
388 addHGCSiliconId(ids,
id.det,
id.zSide,
id.iType,
id.iLay,
id.iSec1,
id.iSec2,
389 id.iCell1-1,
id.iCell2-1);
398 edm::LogWarning(
"HGCalGeom") <<
"u:v " <<
id.iCell1 <<
":" <<
id.iCell2
399 <<
" Tests " << (
id.iCell1 > 2*N-1) <<
":" 400 << (
id.iCell2 > 2*N-1) <<
":" 401 << (
id.iCell2 >= (
id.iCell1+
N)) <<
":" 402 << (
id.iCell1 > (
id.iCell2+
N)) <<
" ERROR";
405 int iphi1 = (
id.iCell1 > 1) ?
id.iCell1-1 :
hdcons_.
getUVMax(
id.iType);
406 int iphi2 = (
id.iCell1 <
hdcons_.
getUVMax(
id.iType)) ?
id.iCell1+1 : 1;
426 int type = (
id.iType > 0) ? 1 : 0;
427 idx = (uint32_t)(((
id.zSide > 0) ?
kHGhalf_ : 0) +
432 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
433 <<
":" <<
id.iType <<
" Constants " 439 idx = (uint32_t)(((
id.zSide > 0) ?
kHGhalf_ : 0) +
441 id.iSec1-1)*
types_+
id.iType));
443 edm::LogVerbatim(
"HGCalGeom") <<
"Input Trap " <<
id.zSide <<
":" <<
id.iLay
444 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1
445 <<
":" <<
id.iType <<
" Constants " 451 idx = (uint32_t)(((
id.zSide > 0) ?
kHGhalf_ : 0) +
456 edm::LogVerbatim(
"HGCalGeom") <<
"Input Hex8 " <<
id.zSide <<
":" <<
id.iLay
457 <<
":" <<
id.iSec1 <<
":" <<
id.iSec2 <<
":" 458 <<
id.iCell1 <<
":" <<
id.iCell2 <<
":" 477 id.iType = (type == 0 ? -1 : 1);
483 <<
":" <<
id.iLay <<
":" <<
id.iType
484 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
494 <<
":" <<
id.iLay <<
":" <<
id.iType
495 <<
":" <<
id.iSec1 <<
":" <<
id.iCell1;
508 id.iCell1 = (di-
id.iCell2)/
cellMax_;
511 <<
":" <<
id.iLay <<
":" <<
id.iType
512 <<
":" <<
id.iSec1 <<
":" <<
id.iSec2
513 <<
":" <<
id.iCell1 <<
":" <<
id.iCell2;
526 idx = (uint32_t)(((
id.zSide > 0) ?
kHGeomHalf_ : 0) +
530 <<
id.iLay <<
":" <<
id.iSec1 <<
":" 536 idx = (uint32_t)(((
id.zSide > 0) ?
kHGeomHalf_ : 0) +
541 <<
id.iLay <<
":" <<
id.iSec1 <<
":" 542 <<
id.iCell1 <<
":" <<
id.iType
549 idx = (uint32_t)(((
id.zSide > 0) ?
kHGeomHalf_ : 0) +
554 <<
id.iLay <<
":" <<
id.iSec1 <<
":" 555 <<
id.iSec2 <<
":" <<
id.iType
571 id.iCell1 >= 0 &&
id.iCell1 <
cells_ &&
id.iLay > 0 &&
575 flag = ((idin.
det() ==
det_) &&
578 flag = ((idin.
det() ==
det_) &&
585 int nrStepsY )
const {
600 else return DetId(0);
614 id.iType = ((di-
id.iLay+1)/
layers_ == 0) ? -1 : 1;
617 <<
id.zSide <<
":" <<
id.iType <<
":" 618 <<
id.iLay <<
":" <<
id.iSec1;
629 <<
id.zSide <<
":" <<
id.iType <<
":" 630 <<
id.iLay <<
":" <<
id.iSec1 <<
":" 639 id.iType = (di-
id.iLay+1)/
layers_;
642 <<
id.zSide <<
":" <<
id.iType <<
":" 643 <<
id.iLay <<
":" <<
id.iSec1 <<
":" 652 int type,
int lay,
int iradius,
656 << type <<
":" << lay <<
":" << iradius <<
":" 657 << iphi <<
" ==> Validity " 662 ids.emplace_back(
DetId(
id));
667 int type,
int lay,
int waferU,
int waferV,
668 int cellU,
int cellV)
const {
671 <<
":" << type <<
":" << lay <<
":" << waferU
672 <<
":" << waferV <<
":" << cellU <<
":" 673 << cellV <<
" ==> Validity " 679 ids.emplace_back(
DetId(
id));
691 idx.
iLay =
id.layer();
692 idx.
iSec1 =
id.wafer();
694 idx.
iType =
id.waferType();
695 idx.
zSide =
id.zside();
696 idx.
det =
id.subdetId();
701 idx.
iLay =
id.layer();
702 idx.
iSec1 =
id.ietaAbs();
704 idx.
iType =
id.type();
705 idx.
zSide =
id.zside();
706 idx.
det = (
int)(
id.subdet());
711 idx.
iLay =
id.layer();
712 idx.
iSec1 =
id.waferU();
713 idx.
iSec2 =
id.waferV();
714 idx.
iType =
id.type();
715 idx.
zSide =
id.zside();
716 idx.
det = (
int)(
id.subdet());
721 idx.
iLay =
id.layer();
722 idx.
iSec1 =
id.waferU();
723 idx.
iSec2 =
id.waferV();
724 idx.
iType =
id.type();
725 idx.
zSide =
id.zside();
726 idx.
det = (
int)(
id.subdet());
748 int nrStepsY )
const {
bool isValidTrap(int lay, int ieta, int iphi) const
bool validHashIndex(uint32_t ix) const
unsigned int allGeomModules() const
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
DetId changeZ(const DetId &id, int nrStepsZ) const
move the nagivator along z
HGCalGeometryMode::GeometryMode mode_
constexpr uint32_t rawId() const
get the raw id
int getTypeHex(int layer, int waferU, int waferV) const
DetId denseId2detId(uint32_t denseId) const override
bool isValidHex(int lay, int mod, int cell, bool reco) const
DetId offsetBy(const DetId startId, int nrStepsX, int nrStepsY) const
unsigned int totalGeomModules() const
unsigned int layers(bool reco) const
bool isValidHex8(int lay, int modU, int modV, int cellU, int cellV) const
virtual uint32_t detId2denseGeomId(const DetId &id) 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
DetId encode(const DecodedDetId &id_) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
CellType cellType(int type, int waferU, int waferV) const
uint32_t detId2denseId(const DetId &id) const override
Dense indexing.
HGCalGeometryMode::GeometryMode geomMode() const
DecodedDetId geomDenseId2decId(const uint32_t &hi) const
ForwardSubdetector subdet_
const HGCalDDDConstants & hdcons_
#define TYPELOOKUP_DATA_REG(_dataclass_)
DecodedDetId decode(const DetId &id) const
int numberCells(bool reco) const
DetId switchZSide(const DetId startId) const
void addHGCSiliconId(std::vector< DetId > &ids, int det, int zside, int type, int lay, int waferU, int waferV, int cellU, int cellV) const
std::vector< DetId > neighbors(const DetId &id) const
unsigned int kSizeForDenseIndexing
bool valid(const DetId &id) const override
Is this a valid cell id.
HGCalTopology(const HGCalDDDConstants &hdcons, int subdet)
create a new Topology
int maxCells(bool reco) const
int modifyUV(int uv, int type1, int type2) const
int getUVMax(int type) const
constexpr Detector det() const
get the detector field from this detid