CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: HcalTB04XtalNumberingScheme.cc,v 1.3 2006/11/13 10:32:15 sunanda Exp $
12 //
13 
14 // system include files
15 
16 // user include files
20 
21 using namespace std;
22 
23 //
24 // constructors and destructor
25 //
26 
29  edm::LogInfo("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
30 }
31 
33  edm::LogInfo("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
34 }
35 
36 //
37 // member functions
38 //
39 
40 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
41 
42  int idx=0, idl=0;
43  if (baseNumber.getLevels()<1) {
44  edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
45  << "No level found in EcalBaseNumber "
46  << "Returning 0";
47  } else {
48  idx = baseNumber.getCopyNumber(0);
49  if (baseNumber.getLevels() > 1) idl = baseNumber.getCopyNumber(1);
50  }
51  int det = 10;
52  uint32_t idunit = HcalTestNumbering::packHcalIndex(det,0,1,idl,idx,1);
53 
54  LogDebug("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx
55  << " Layer " << idl << " UnitID = 0x" << std::hex
56  << idunit << std::dec;
57 
58  return idunit;
59 
60 }
#define LogDebug(id)
int getCopyNumber(int level) const
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const
int getLevels() const