100 const int numberOfHierarchyLevels = baseNumber.
getLevels();
101 bool dd4hep = ((numberOfHierarchyLevels == 10) && (baseNumber.
getCopyNumber(numberOfHierarchyLevels - 1) == 1) &&
102 (baseNumber.
getLevelName(numberOfHierarchyLevels - 1) !=
"OCMS"));
104 std::ostringstream st1;
105 for (
int k = 0;
k < numberOfHierarchyLevels; ++
k)
107 edm::LogVerbatim(
"EcalGeom") <<
"EcalPreshowerNumberingScheme: dd4hep " << dd4hep
108 <<
" witg geometry levels = " << numberOfHierarchyLevels << st1.str();
110 uint32_t intIndex = 0;
111 if (numberOfHierarchyLevels > 0) {
114 if (baseNumber.
getLevelName(0).find(
"SFSX") != std::string::npos) {
116 }
else if (baseNumber.
getLevelName(0).find(
"SFSY") != std::string::npos) {
119 edm::LogWarning(
"EcalGeom") <<
"EcalPreshowerNumberingScheme: Wrong name"
120 <<
" of Presh. Si. Strip : " << baseNumber.
getLevelName(0);
126 int zside = 2 * (1 - zs) + 1;
129 int box(0), ladd_copy(0);
134 ladd_copy = num1.first;
142 edm::LogVerbatim(
"EcalGeom") <<
"EcalPreshowerNumberingScheme::Box " << box <<
" Ladder " << ladd <<
":"
146 int x = 0,
y = 0, ix, iy,
id;
147 int mapX[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
148 int mapY[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
150 if (ladd ==
"SFLX0a" || ladd ==
"SFLY0a") {
151 mapX[5] = mapX[6] = mapX[7] = mapX[8] = mapX[9] = 1;
163 id = (int)((
float)ladd_copy / 2 + 0.5);
165 x =
L0ax[
id - 1] + mapX[box - 1000 - 1];
166 y =
L0ay[
id - 1] + mapY[box - 1000 - 1];
168 if ((ladd_copy % 2) == 0) {
169 if (mapX[box - 1000 - 1] == 0)
171 else if (mapX[box - 1000 - 1] == 1)
176 if (ladd ==
"SFLX0b" || ladd ==
"SFLY0b") {
177 mapX[4] = mapX[5] = mapX[6] = mapX[7] = mapX[8] = 1;
189 x =
L0bx[0] + mapX[box - 2000 - 1];
190 y =
L0by[0] + mapY[box - 2000 - 1];
192 if (ladd_copy == 1) {
197 if (ladd ==
"SFLX0c" || ladd ==
"SFLY0c") {
198 mapX[5] = mapX[6] = mapX[7] = mapX[8] = 1;
210 x =
L0cx[0] + mapX[box - 3000 - 1];
211 y =
L0cy[0] + mapY[box - 3000 - 1];
213 if (ladd_copy == 2) {
218 if (ladd ==
"SFLX1a" || ladd ==
"SFLY1a") {
219 mapX[4] = mapX[5] = mapX[6] = mapX[7] = 1;
231 id = (int)((
float)ladd_copy / 2 + 0.5);
233 x =
L1ax[
id - 1] + mapX[box - 4000 - 1];
234 y =
L1ay[
id - 1] + mapY[box - 4000 - 1];
236 if ((ladd_copy % 2) == 0) {
237 if (mapX[box - 4000 - 1] == 0)
239 else if (mapX[box - 4000 - 1] == 1)
244 if (ladd ==
"SFLX1b" || ladd ==
"SFLY1b") {
245 mapX[3] = mapX[4] = mapX[5] = mapX[6] = 1;
257 x =
L1bx[0] + mapX[box - 5000 - 1];
258 y =
L1by[0] + mapY[box - 5000 - 1];
260 if (ladd_copy == 1) {
265 if (ladd ==
"SFLX1c" || ladd ==
"SFLY1c") {
266 mapX[4] = mapX[5] = mapX[6] = 1;
278 x =
L1cx[0] + mapX[box - 6000 - 1];
279 y =
L1cy[0] + mapY[box - 6000 - 1];
281 if (ladd_copy == 2) {
286 if (ladd ==
"SFLX1d" || ladd ==
"SFLY1d") {
287 mapX[2] = mapX[3] = mapX[4] = mapX[5] = 1;
299 x =
L1dx[0] + mapX[box - 7000 - 1];
300 y =
L1dy[0] + mapY[box - 7000 - 1];
302 if (ladd_copy == 1) {
307 if (ladd ==
"SFLX1e" || ladd ==
"SFLY1e") {
308 mapX[4] = mapX[5] = 1;
320 x =
L1ex[0] + mapX[box - 8000 - 1];
321 y =
L1ey[0] + mapY[box - 8000 - 1];
323 if (ladd_copy == 2) {
328 if (ladd ==
"SFLX3a" || ladd ==
"SFLY3a") {
329 mapX[4] = mapX[5] = mapX[6] = 1;
341 id = (ladd_copy > 3) ? ladd_copy - 3 : 4 - ladd_copy;
343 x =
L3ax[
id - 1] + mapX[box - 9000 - 1];
344 y =
L3ay[
id - 1] + mapY[box - 9000 - 1];
351 if (ladd ==
"SFLX3b" || ladd ==
"SFLY3b") {
352 mapX[4] = mapX[5] = 1;
364 x =
L3bx[0] + mapX[box - 11000 - 1];
365 y =
L3by[0] + mapY[box - 11000 - 1];
367 if (ladd_copy == 1) {
372 if (ladd ==
"SFLX2a" || ladd ==
"SFLY2a") {
373 mapX[3] = mapX[4] = mapX[5] = mapX[6] = 1;
385 id = (ladd_copy > 3) ? 7 - ladd_copy : ladd_copy;
387 x =
L2ax[
id - 1] + mapX[box - 10000 - 1];
388 y =
L2ay[
id - 1] + mapY[box - 10000 - 1];
395 if (ladd ==
"SFLX2b" || ladd ==
"SFLY2b") {
396 mapX[2] = mapX[3] = mapX[4] = mapX[5] = 1;
408 x =
L2bx[0] + mapX[box - 12000 - 1];
409 y =
L2by[0] + mapY[box - 12000 - 1];
411 if (ladd_copy == 2) {
417 if (zside < 0 && layer == 1)
424 x = (zside > 0) ? iy : 41 - iy;
432 if (zside > 0 &&
y <= 20)
434 else if (zside < 0 && y > 20)
436 }
else if (layer == 2) {
437 if (zside > 0 && x <= 20)
439 else if (zside < 0 && x > 20)
446 edm::LogVerbatim(
"EcalGeom") <<
"EcalPreshowerNumberingScheme : zside " << zs <<
":" << zside <<
" Ladd " << ladd
447 <<
" ladd_copy: " << ladd_copy <<
" box " << box <<
" x " << x <<
" y " <<
y
448 <<
" layer " << layer <<
" strip " << strip <<
" UnitID 0x" << std::hex << intIndex
451 for (
int ich = 0; ich < numberOfHierarchyLevels; ich++)
Log< level::Info, true > LogVerbatim
uint16_t *__restrict__ id
std::string const & getLevelName(int level) const
constexpr uint32_t rawId() const
get the raw id
int getCopyNumber(int level) const
constexpr std::array< uint8_t, layerIndexSize > layer
std::pair< int, int > numbers(const std::string &) const
Log< level::Warning, false > LogWarning