20 const uint32_t nLevels(baseNumber.
getLevels());
23 std::ostringstream st1;
24 for (uint32_t
k = 0;
k < nLevels; ++
k)
26 edm::LogVerbatim(
"EcalGeom") <<
"ECalBarrelNumberingScheme geometry levels = " << nLevels << st1.str();
29 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
30 <<
"Not enough levels found in EcalBaseNumber ( " << nLevels <<
") Returning 0";
36 const int cryType(::atoi(cryName.c_str() + 5));
38 uint32_t wallCopy(0), hawCopy(0), fawCopy(0), supmCopy(0);
39 const int off(13 < nLevels ? 3 : 0);
41 if ((nLevels != 11) && (nLevels != 14)) {
48 wallCopy = num1.second;
51 fawCopy = num2.second;
52 supmCopy = num2.first;
55 edm::LogVerbatim(
"EcalGeom") << nLevels <<
" off: " << off <<
" cryType: " << cryType <<
" wallCopy: " << wallCopy
56 <<
" hawCopy: " << hawCopy <<
" fawCopy: " << fawCopy <<
" supmCopy: " << supmCopy;
60 if (1 > cryType || 17 < cryType) {
61 edm::LogWarning(
"EdalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
62 <<
"****************** Bad crystal name = " << cryName
67 if (1 > wallCopy || 5 < wallCopy) {
68 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
69 <<
"****************** Bad wall copy = " << wallCopy
74 if (1 > hawCopy || 2 < hawCopy) {
75 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
76 <<
"****************** Bad haw copy = " << hawCopy
81 if (1 > fawCopy || 10 < fawCopy) {
82 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
83 <<
"****************** Bad faw copy = " << fawCopy
88 if (1 > supmCopy || 36 < supmCopy) {
89 edm::LogWarning(
"EcalGeom") <<
"ECalBarrelNumberingScheme::getUnitID(): "
90 <<
"****************** Bad supermodule copy = " << supmCopy
97 const int32_t zsign(18 < supmCopy ? -1 : 1);
99 const int32_t
eta(5 * (cryType - 1) + wallCopy);
101 const int32_t
phi(18 < supmCopy ? 20 * (supmCopy - 19) + 2 * (10 - fawCopy) + 3 - hawCopy
102 : 20 * (supmCopy - 1) + 2 * (fawCopy - 1) + hawCopy);
104 const int32_t intindex(
EBDetId(zsign * eta, phi).rawId());
117 <<
"supmCopy = " << supmCopy <<
", fawCopy = " << fawCopy <<
", hawCopy = " << hawCopy
118 <<
", wallCopy = " << wallCopy <<
", cryType = " << cryType
119 <<
"\n zsign = " << zsign <<
", eta = " << eta <<
", phi = " << phi
120 <<
", packed index = 0x" << std::hex << intindex <<
std::dec;
126 int num1(-1), num2(-1);
127 if (name.find(
'#') != std::string::npos) {
128 uint32_t ip1 = name.find(
'#');
129 if (name.find(
'!') != std::string::npos) {
130 uint32_t ip2 = name.find(
'!');
131 num1 = ::atoi(name.substr(ip1 + 1, ip2 - ip1 - 1).c_str());
132 if (name.find(
'#', ip2) != std::string::npos) {
133 uint32_t ip3 = name.find(
'#', ip2);
134 num2 = ::atoi(name.substr(ip3 + 1, name.size() - ip3 - 1).c_str());
139 edm::LogVerbatim(
"EcalGeom") <<
"EcalBarrelNumberingScheme::Numbers from " << name <<
" are " << num1 <<
" and "
142 return std::make_pair(num1, num2);
Log< level::Info, true > LogVerbatim
std::string const & getLevelName(int level) const
~EcalBarrelNumberingScheme() override
int getCopyNumber(int level) const
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
EcalBarrelNumberingScheme()
std::pair< int, int > numbers(const std::string &) const
Log< level::Warning, false > LogWarning