CMS 3D CMS Logo

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 }
personalPlayback.level
level
Definition: personalPlayback.py:22
EcalBaseNumber::getCopyNumber
int getCopyNumber(int level) const
Definition: EcalBaseNumber.cc:23
EcalBaseNumber::getLevelName
std::string const & getLevelName(int level) const
Definition: EcalBaseNumber.cc:34
edm::LogInfo
Definition: MessageLogger.h:254
EcalBaseNumber
Definition: EcalBaseNumber.h:12
EcalNumberingScheme
Definition: EcalNumberingScheme.h:14
EcalHodoscopeNumberingScheme::EcalHodoscopeNumberingScheme
EcalHodoscopeNumberingScheme()
Definition: EcalHodoscopeNumberingScheme.cc:11
EcalHodoscopeNumberingScheme::getUnitID
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
Definition: EcalHodoscopeNumberingScheme.cc:19
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
EcalHodoscopeNumberingScheme.h
EcalHodoscopeNumberingScheme::~EcalHodoscopeNumberingScheme
~EcalHodoscopeNumberingScheme() override
Definition: EcalHodoscopeNumberingScheme.cc:15
HodoscopeDetId.h
EcalBaseNumber::getLevels
int getLevels() const
Definition: EcalBaseNumber.cc:21
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HodoscopeDetId
Definition: HodoscopeDetId.h:20