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 
13 
14  edm::LogInfo("EcalTBGeom") << "Creating EcalHodoscopeNumberingScheme";
15 }
16 
18  edm::LogInfo("EcalTBGeom") << "Deleting EcalHodoscopeNumberingScheme";
19 }
20 
21 uint32_t
23 {
24 
25  int level = baseNumber.getLevels();
26  uint32_t intIndex = 0;
27  if (level > 0)
28  {
29  // depth index - plans and fibers
30  if(baseNumber.getLevelName(0) == "FIBR")
31  {
32  uint32_t iFibr;
33 
34  if (baseNumber.getCopyNumber(0) > 32)
35  iFibr = 2 * (baseNumber.getCopyNumber(0)-33);
36  else
37  iFibr = 2*baseNumber.getCopyNumber(0) - 1;
38 
39  const uint32_t iPlane = baseNumber.getCopyNumber(1)-1;
40 
41  LogDebug("EcalTBGeom") << "Fibr/plane " << iFibr << " " << iPlane;
42 
43  intIndex = HodoscopeDetId( iPlane, iFibr ).rawId() ;
44 
45  LogDebug("EcalTBGeom") << "Index for fiber volume "
46  << baseNumber.getLevelName(0)
47  << " in plane "
48  << baseNumber.getLevelName(1)
49  << " = " << intIndex;
50  }
51  }
52  return intIndex;
53 }
54 
#define LogDebug(id)
std::string const & getLevelName(int level) const
int getCopyNumber(int level) const
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int getLevels() const