14 int vL2ax[3] = {4, 6, 10};
15 int vL2ay[3] = {29, 31, 35};
20 int vL3ax[3] = {30, 34, 36};
21 int vL3ay[3] = {35, 31, 29};
26 int vL1ax[26] = {2, 4, 4, 8, 8, 8, 8, 10, 12, 12, 14, 14, 20, 20, 26, 26, 28, 28, 30, 32, 32, 32, 32, 36, 36, 38};
27 int vL1ay[26] = {21, 25, 21, 33, 29, 25, 21, 21, 25, 21, 31, 27, 32,
28 28, 31, 27, 25, 21, 21, 33, 29, 25, 21, 25, 21, 21};
42 int vL0ax[23] = {6, 6, 10, 10, 12, 12, 14, 16, 16, 18, 18, 20, 22, 22, 24, 24, 26, 28, 28, 30, 30, 34, 34};
43 int vL0ay[23] = {26, 21, 30, 25, 34, 29, 35, 36, 31, 36, 31, 36, 36, 31, 36, 31, 35, 34, 29, 30, 25, 26, 21};
51 for (
int i = 0;
i < 1; ++
i) {
70 for (
int i = 0;
i < 3; ++
i) {
77 for (
int i = 0;
i < 23; ++
i) {
82 for (
int i = 0;
i < 26; ++
i) {
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)
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) {
424 x = (
zside > 0) ? iy : 41 - iy;
434 else if (zside < 0 && y > 20)
436 }
else if (
layer == 2) {
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++)
461 int num1(-1), num2(-1);
462 if (
name.find(
'#') != std::string::npos) {
463 uint32_t ip1 =
name.find(
'#');
464 if (
name.find(
'!') != std::string::npos) {
465 uint32_t ip2 =
name.find(
'!');
466 num1 = ::atoi(
name.substr(ip1 + 1, ip2 - ip1 - 1).c_str());
467 if (
name.find(
'#', ip2) != std::string::npos) {
468 uint32_t ip3 =
name.find(
'#', ip2);
469 num2 = ::atoi(
name.substr(ip3 + 1,
name.size() - ip3 - 1).c_str());
474 edm::LogVerbatim(
"EcalGeom") <<
"EcalPreshowerNumberingScheme::Numbers from " <<
name <<
" are " << num1 <<
" and " 477 return std::make_pair(num1, num2);
~EcalPreshowerNumberingScheme() override
Log< level::Info, true > LogVerbatim
std::string const & getLevelName(int level) const
int getCopyNumber(int level) const
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
constexpr uint32_t rawId() const
get the raw id
EcalPreshowerNumberingScheme()
Log< level::Warning, false > LogWarning
std::pair< int, int > numbers(const std::string &) const