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 //#define EDM_ML_DEBUG
21 
22 //
23 // constructors and destructor
24 //
25 
27 #ifdef EDM_ML_DEBUG
28  edm::LogVerbatim("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
29 #endif
30 }
31 
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
35 #endif
36 }
37 
38 //
39 // member functions
40 //
41 
42 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
43  int idx = 0, idl = 0;
44  if (baseNumber.getLevels() < 1) {
45  edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
46  << "No level found in EcalBaseNumber "
47  << "Returning 0";
48  } else {
49  idx = baseNumber.getCopyNumber(0);
50  if (baseNumber.getLevels() > 1)
51  idl = baseNumber.getCopyNumber(1);
52  }
53  int det = 10;
54  uint32_t idunit = HcalTestNumbering::packHcalIndex(det, 0, 1, idl, idx, 1);
55 
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx << " Layer " << idl << " UnitID = 0x"
58  << std::hex << idunit << std::dec;
59 #endif
60  return idunit;
61 }
Log< level::Info, true > LogVerbatim
int getCopyNumber(int level) const
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
int getLevels() const
Log< level::Warning, false > LogWarning