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 using namespace std;
21 
22 //
23 // constructors and destructor
24 //
25 
28  edm::LogInfo("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
29 }
30 
32  edm::LogInfo("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
33 }
34 
35 //
36 // member functions
37 //
38 
39 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
40 
41  int idx=0, idl=0;
42  if (baseNumber.getLevels()<1) {
43  edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
44  << "No level found in EcalBaseNumber "
45  << "Returning 0";
46  } else {
47  idx = baseNumber.getCopyNumber(0);
48  if (baseNumber.getLevels() > 1) idl = baseNumber.getCopyNumber(1);
49  }
50  int det = 10;
51  uint32_t idunit = HcalTestNumbering::packHcalIndex(det,0,1,idl,idx,1);
52 
53  LogDebug("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx
54  << " Layer " << idl << " UnitID = 0x" << std::hex
55  << idunit << std::dec;
56 
57  return idunit;
58 
59 }
#define LogDebug(id)
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