CMS 3D CMS Logo

HcalTB04XtalNumberingScheme.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTestBeam
4 // Class : HcalTB04XtalNumberingScheme
5 //
6 // Implementation:
7 // Numbering scheme for crystal calorimeter in 2004 test beam
8 //
9 // Original Author:
10 // Created: Tue 16 10:14:34 CEST 2006
11 //
12 
13 // system include files
14 
15 // user include files
19 
20 //
21 // constructors and destructor
22 //
23 
25  edm::LogVerbatim("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
26 }
27 
29  edm::LogVerbatim("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
30 }
31 
32 //
33 // member functions
34 //
35 
36 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
37  int idx = 0, idl = 0;
38  if (baseNumber.getLevels() < 1) {
39  edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
40  << "No level found in EcalBaseNumber "
41  << "Returning 0";
42  } else {
43  idx = baseNumber.getCopyNumber(0);
44  if (baseNumber.getLevels() > 1)
45  idl = baseNumber.getCopyNumber(1);
46  }
47  int det = 10;
48  uint32_t idunit = HcalTestNumbering::packHcalIndex(det, 0, 1, idl, idx, 1);
49 
50  edm::LogVerbatim("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx << " Layer " << idl
51  << " UnitID = 0x" << std::hex << idunit << std::dec;
52 
53  return idunit;
54 }
int getCopyNumber(int level) const
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
int getLevels() const