24 const uint32_t nLevels(baseNumber.
getLevels());
27 std::ostringstream st1;
28 for (uint32_t
k = 0;
k < nLevels; ++
k)
30 edm::LogVerbatim(
"EcalGeom") <<
"ECalBarrelNumberingScheme geometry levels = " << nLevels << st1.str();
33 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 34 <<
"Not enough levels found in EcalBaseNumber ( " << nLevels <<
") Returning 0";
40 const int cryType(::atoi(cryName.c_str() + 5));
42 uint32_t wallCopy(0), hawCopy(0), fawCopy(0), supmCopy(0);
43 const int off(13 < nLevels ? 3 : 0);
45 if ((nLevels != 11) && (nLevels != 14)) {
52 wallCopy = num1.second;
55 fawCopy = num2.second;
56 supmCopy = num2.first;
59 edm::LogVerbatim(
"EcalGeom") << nLevels <<
" off: " << off <<
" cryType: " << cryType <<
" wallCopy: " << wallCopy
60 <<
" hawCopy: " << hawCopy <<
" fawCopy: " << fawCopy <<
" supmCopy: " << supmCopy;
64 if (1 > cryType || 17 < cryType) {
65 edm::LogWarning(
"EdalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 66 <<
"****************** Bad crystal name = " << cryName
71 if (1 > wallCopy || 5 < wallCopy) {
72 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 73 <<
"****************** Bad wall copy = " << wallCopy
78 if (1 > hawCopy || 2 < hawCopy) {
79 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 80 <<
"****************** Bad haw copy = " << hawCopy
85 if (1 > fawCopy || 10 < fawCopy) {
86 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 87 <<
"****************** Bad faw copy = " << fawCopy
92 if (1 > supmCopy || 36 < supmCopy) {
93 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): " 94 <<
"****************** Bad supermodule copy = " << supmCopy
101 const int32_t zsign(18 < supmCopy ? -1 : 1);
103 const int32_t
eta(5 * (cryType - 1) + wallCopy);
105 const int32_t
phi(18 < supmCopy ? 20 * (supmCopy - 19) + 2 * (10 - fawCopy) + 3 - hawCopy
106 : 20 * (supmCopy - 1) + 2 * (fawCopy - 1) + hawCopy);
121 <<
"supmCopy = " << supmCopy <<
", fawCopy = " << fawCopy <<
", hawCopy = " << hawCopy
122 <<
", wallCopy = " << wallCopy <<
", cryType = " << cryType
123 <<
"\n zsign = " << zsign <<
", eta = " <<
eta <<
", phi = " <<
phi 124 <<
", packed index = 0x" << std::hex << intindex <<
std::dec;
130 int num1(-1), num2(-1);
131 if (
name.find(
'#') != std::string::npos) {
132 uint32_t ip1 =
name.find(
'#');
133 if (
name.find(
'!') != std::string::npos) {
134 uint32_t ip2 =
name.find(
'!');
135 num1 = ::atoi(
name.substr(ip1 + 1, ip2 - ip1 - 1).c_str());
136 if (
name.find(
'#', ip2) != std::string::npos) {
137 uint32_t ip3 =
name.find(
'#', ip2);
138 num2 = ::atoi(
name.substr(ip3 + 1,
name.size() - ip3 - 1).c_str());
143 edm::LogVerbatim(
"EcalGeom") <<
"EcalBarrelNumberingScheme::Numbers from " <<
name <<
" are " << num1 <<
" and " 146 return std::make_pair(num1, num2);
Log< level::Info, true > LogVerbatim
std::string const & getLevelName(int level) const
int getCopyNumber(int level) const
~EcalBarrelNumberingScheme() override
std::pair< int, int > numbers(const std::string &) const
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
EcalBarrelNumberingScheme()
Log< level::Warning, false > LogWarning