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);
29 auto bareBaseName = [&](std::string_view
name) {
30 size_t ipos =
name.rfind(
'_');
31 return (isDD4hepOK) ?
name.substr(0, ipos) :
name;
47 if (baseNumber.
getLevelName(0).find(
"Timingactive") != std::string_view::npos) {
53 const std::string_view& modName(baseNumber.
getLevelName(2));
54 uint32_t
pos = modName.find(
"Positive");
56 zside = (
pos <= modName.size() ? 1 : 0);
57 std::string_view baseName = modName.substr(modName.find(
':') + 1);
59 modtyp = ::atoi(&baseName.at(7));
62 }
else if (modtyp == 33) {
68 if (1 > crystal || 64 < crystal) {
70 <<
"****************** Bad crystal number = " << crystal
75 if (1 > modtyp || 3 < modtyp) {
77 <<
"****************** Bad module name = " << modName
82 if (1 > modCopy || 54 < modCopy) {
84 <<
"****************** Bad module copy = " << modCopy
89 if (1 > rodCopy || 36 < rodCopy) {
91 <<
"****************** Bad rod copy = " << rodCopy
98 <<
"****************** Bad side = " <<
zside 102 }
else if (baseNumber.
getLevelName(0).find(
"BTLCrystal") != std::string_view::npos) {
110 const std::string_view& rodName(baseNumber.
getLevelName(3));
111 uint32_t
pos = rodName.find(
"Zpos");
112 zside = (
pos <= rodName.size() ? 1 : 0);
124 modtyp = ::atoi(&bareBaseName(baseNumber.
getLevelName(2)).back());
135 <<
"****************** Bad crystal number = " << crystal
140 if (1 > modtyp || 3 < modtyp) {
142 <<
"****************** Bad RU name, Volume Name = " 149 <<
"****************** Bad module copy = " << modCopy
156 <<
"****************** Bad readout unit copy = " << runitCopy
163 <<
"****************** Bad rod copy = " << rodCopy
170 <<
"****************** Bad side = " <<
zside 178 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, crystal);
179 intindex = thisBTLdetid.rawId();
197 const std::string_view& rodName(baseNumber.
getLevelName(2));
198 uint32_t
pos = rodName.find(
"Zpos");
199 zside = (
pos <= rodName.size() ? 1 : 0);
211 modtyp = ::atoi(&bareBaseName(baseNumber.
getLevelName(1)).back());
220 if (1 > modtyp || 3 < modtyp) {
222 <<
"****************** Bad RU name, Volume Name = " 229 <<
"****************** Bad module copy = " << modCopy
236 <<
"****************** Bad readout unit copy = " << runitCopy
243 <<
"****************** Bad rod copy = " << rodCopy
250 <<
"****************** Bad side = " <<
zside 257 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, 0);
262 <<
"Not enough levels found in MTDBaseNumber ( " << nLevels
263 <<
") or not correct path. Returning 0";
267 LogDebug(
"MTDGeom") <<
"BTL Numbering scheme: " 268 <<
" zside = " <<
zside <<
" rod = " << rodCopy <<
" modtyp = " << modtyp <<
" RU = " << runitCopy
269 <<
" 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