CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalHodoscopeNumberingScheme.cc
Go to the documentation of this file.
1 // File: EcalHodoscopeNumberingScheme.cc
3 // Description: Numbering scheme for TB H4 hodoscope detector
5 
8 
9 #include <iostream>
10 
12  edm::LogInfo("EcalTBGeom") << "Creating EcalHodoscopeNumberingScheme";
13 }
14 
16  edm::LogInfo("EcalTBGeom") << "Deleting EcalHodoscopeNumberingScheme";
17 }
18 
19 uint32_t EcalHodoscopeNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
20  int level = baseNumber.getLevels();
21  uint32_t intIndex = 0;
22  if (level > 0) {
23  // depth index - plans and fibers
24  if (baseNumber.getLevelName(0) == "FIBR") {
25  uint32_t iFibr;
26 
27  if (baseNumber.getCopyNumber(0) > 32)
28  iFibr = 2 * (baseNumber.getCopyNumber(0) - 33);
29  else
30  iFibr = 2 * baseNumber.getCopyNumber(0) - 1;
31 
32  const uint32_t iPlane = baseNumber.getCopyNumber(1) - 1;
33 
34  LogDebug("EcalTBGeom") << "Fibr/plane " << iFibr << " " << iPlane;
35 
36  intIndex = HodoscopeDetId(iPlane, iFibr).rawId();
37 
38  LogDebug("EcalTBGeom") << "Index for fiber volume " << baseNumber.getLevelName(0) << " in plane "
39  << baseNumber.getLevelName(1) << " = " << intIndex;
40  }
41  }
42  return intIndex;
43 }
std::string const & getLevelName(int level) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int getCopyNumber(int level) const
Log< level::Info, false > LogInfo
tuple level
Definition: testEve_cfg.py:47
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
int getLevels() const
#define LogDebug(id)