11 LogDebug(
"MTDGeom") <<
"Creating BTLNumberingScheme";
18 const uint32_t nLevels(baseNumber.
getLevels());
20 LogDebug(
"MTDGeom") <<
"BTLNumberingScheme geometry levels = " << nLevels;
22 uint32_t
zside(999), rodCopy(0), runitCopy(0), modCopy(0), modtyp(0), crystal(0);
24 bool isDD4hepOK(
false);
40 if (baseNumber.
getLevelName(0).find(
"Timingactive") != std::string_view::npos) {
46 const std::string_view& modName(baseNumber.
getLevelName(2));
47 uint32_t
pos = modName.find(
"Positive");
49 zside = (
pos <= modName.size() ? 1 : 0);
50 std::string_view baseName = modName.substr(modName.find(
':') + 1);
52 modtyp = ::atoi(&baseName.at(7));
55 }
else if (modtyp == 33) {
61 if (1 > crystal || 64 < crystal) {
63 <<
"****************** Bad crystal number = " << crystal
68 if (1 > modtyp || 3 < modtyp) {
70 <<
"****************** Bad module name = " << modName
75 if (1 > modCopy || 54 < modCopy) {
77 <<
"****************** Bad module copy = " << modCopy
82 if (1 > rodCopy || 36 < rodCopy) {
84 <<
"****************** Bad rod copy = " << rodCopy
91 <<
"****************** Bad side = " <<
zside 95 }
else if (baseNumber.
getLevelName(0).find(
"BTLCrystal") != std::string_view::npos) {
103 const std::string_view& rodName(baseNumber.
getLevelName(3));
104 uint32_t
pos = rodName.find(
"Zpos");
105 zside = (
pos <= rodName.size() ? 1 : 0);
119 <<
"****************** Bad crystal number = " << crystal
124 if (1 > modtyp || 3 < modtyp) {
126 <<
"****************** Bad RU name, Volume Name = " << baseNumber.
getLevelName(2);
132 <<
"****************** Bad module copy = " << modCopy
139 <<
"****************** Bad readout unit copy = " << runitCopy
146 <<
"****************** Bad rod copy = " << rodCopy
153 <<
"****************** Bad side = " <<
zside 161 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, crystal);
162 intindex = thisBTLdetid.
rawId();
176 const std::string_view& rodName(baseNumber.
getLevelName(2));
177 uint32_t
pos = rodName.find(
"Zpos");
178 zside = (
pos <= rodName.size() ? 1 : 0);
190 if (1 > modtyp || 3 < modtyp) {
192 <<
"****************** Bad RU name, Volume Name = " << baseNumber.
getLevelName(1);
198 <<
"****************** Bad module copy = " << modCopy
205 <<
"****************** Bad readout unit copy = " << runitCopy
212 <<
"****************** Bad rod copy = " << rodCopy
219 <<
"****************** Bad side = " <<
zside 226 BTLDetId thisBTLdetid(
zside, rodCopy, runitCopy, modCopy, modtyp, 0);
231 <<
"Not enough levels found in MTDBaseNumber ( " << nLevels
232 <<
") or not correct path. Returning 0";
236 LogDebug(
"MTDGeom") <<
"BTL Numbering scheme: " 237 <<
" zside = " <<
zside <<
" rod = " << rodCopy <<
" modtyp = " << modtyp <<
" RU = " << runitCopy
238 <<
" module = " << modCopy <<
" crystal = " << crystal <<
" Raw Id = " << intindex <<
"\n" int getCopyNumber(int level) const
~BTLNumberingScheme() override
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
uint32_t getUnitID(const MTDBaseNumber &baseNumber) const override
constexpr uint32_t rawId() const
get the raw id
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
BTLDetId geographicalId(CrysLayout lay) const