16 const uint32_t nLevels(baseNumber.
getLevels());
18 LogDebug(
"MTDGeom") <<
"BTLNumberingScheme geometry levels = " << nLevels;
20 uint32_t
zside(999), rodCopy(0), runitCopy(0), modCopy(0), modtyp(0), crystal(0);
22 bool isDD4hepOK(
false);
30 LogDebug(
"MTDGeom") <<
"BTLNumberingScheme::getUnitID(): isDD4hep " << isDD4hepOK;
33 auto bareBaseName = [&](std::string_view
name) {
34 size_t ipos =
name.rfind(
'_');
35 return (isDD4hepOK) ?
name.substr(0, ipos) :
name;
51 if (baseNumber.
getLevelName(0).find(
"Timingactive") != std::string_view::npos) {
57 const std::string_view& modName(baseNumber.
getLevelName(2));
58 uint32_t
pos = modName.find(
"Positive");
60 zside = (
pos <= modName.size() ? 1 : 0);
61 std::string_view baseName = modName.substr(modName.find(
':') + 1);
63 modtyp = ::atoi(&baseName.at(7));
66 }
else if (modtyp == 33) {
72 if (1 > crystal || 64 < crystal) {
74 <<
"****************** Bad crystal number = " << crystal
79 if (1 > modtyp || 3 < modtyp) {
81 <<
"****************** Bad module name = " << modName
86 if (1 > modCopy || 54 < modCopy) {
88 <<
"****************** Bad module copy = " << modCopy
93 if (1 > rodCopy || 36 < rodCopy) {
95 <<
"****************** Bad rod copy = " << rodCopy
102 <<
"****************** Bad side = " <<
zside 106 }
else if (baseNumber.
getLevelName(0).find(
"BTLCrystal") != std::string_view::npos) {
114 const std::string_view& rodName(baseNumber.
getLevelName(3));
115 uint32_t
pos = rodName.find(
"Zpos");
116 zside = (
pos <= rodName.size() ? 1 : 0);
124 bool isV2(bareBaseName(baseNumber.
getLevelName(0)).back() !=
'l');
127 LogDebug(
"MTDGeom") <<
"BTLNumberingScheme::getUnitID(): isV2 " << isV2;
132 modtyp = ::atoi(&bareBaseName(baseNumber.
getLevelName(2)).back());
143 <<
"****************** Bad crystal number = " << crystal
148 if (1 > modtyp || 3 < modtyp) {
150 <<
"****************** Bad RU name, Volume Name = " 157 <<
"****************** Bad module copy = " << modCopy
164 <<
"****************** Bad readout unit copy = " << runitCopy
171 <<
"****************** Bad rod copy = " << rodCopy
178 <<
"****************** Bad side = " <<
zside 186 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, crystal);
187 intindex = thisBTLdetid.rawId();
205 const std::string_view& rodName(baseNumber.
getLevelName(2));
206 uint32_t
pos = rodName.find(
"Zpos");
207 zside = (
pos <= rodName.size() ? 1 : 0);
215 bool isV2(bareBaseName(baseNumber.
getLevelName(0)).back() !=
'e');
218 LogDebug(
"MTDGeom") <<
"BTLNumberingScheme::getUnitID(): isV2 " << isV2;
223 modtyp = ::atoi(&bareBaseName(baseNumber.
getLevelName(1)).back());
232 if (1 > modtyp || 3 < modtyp) {
234 <<
"****************** Bad RU name, Volume Name = " 241 <<
"****************** Bad module copy = " << modCopy
248 <<
"****************** Bad readout unit copy = " << runitCopy
255 <<
"****************** Bad rod copy = " << rodCopy
262 <<
"****************** Bad side = " <<
zside 269 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, 0);
274 <<
"Not enough levels found in MTDBaseNumber ( " << nLevels
275 <<
") or not correct path. Returning 0";
279 LogDebug(
"MTDGeom") <<
"BTL Numbering scheme: " 280 <<
" zside = " <<
zside <<
" rod = " << rodCopy <<
" modtyp = " << modtyp <<
" RU = " << runitCopy
281 <<
" module = " << modCopy <<
" crystal = " << crystal <<
" Raw Id = " << intindex <<
"\n" int getCopyNumber(int level) const
static constexpr std::array< uint32_t, BTLDetId::kRUPerTypeV2 *BTLDetId::kCrystalTypes > globalru2ru
static constexpr std::array< uint32_t, BTLDetId::kModulesPerRUV2 > negModCopy
std::string_view const & getLevelName(int level) const
static constexpr uint32_t HALF_ROD
range constants, need two sets for the time being (one for tiles and one for bars) ...
static constexpr uint32_t kModulesPerRUV2
static constexpr uint32_t kBTLcrystalLevel
static constexpr uint32_t kRUPerTypeV2
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
static constexpr uint32_t kCrystalsPerModuleV2
static constexpr uint32_t kBTLmoduleLevel
Log< level::Warning, false > LogWarning
static constexpr std::array< uint32_t, BTLDetId::kRUPerTypeV2 *BTLDetId::kCrystalTypes > globalru2type