CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalNumberingScheme.cc
Go to the documentation of this file.
1 // File: HcalNumberingScheme.cc
3 // Description: Numbering scheme for barrel electromagnetic calorimeter
8 
9 #include "CLHEP/Units/GlobalSystemOfUnits.h"
10 #include <iostream>
11 
12 //#define DebugLog
13 
15  edm::LogInfo("HcalSim") << "Creating HcalNumberingScheme";
16 }
17 
19  edm::LogInfo("HcalSim") << "Deleting HcalNumberingScheme";
20 }
21 
23 
24  int zside = 2*(id.zside) - 1;
25  int etaR = zside*(id.etaR);
26  HcalSubdetector subdet = (HcalSubdetector)(id.subdet);
27 
28  //pack it into an integer
29  // to be consistent with HcalDetId convention
30  uint32_t index = HcalDetId(subdet,etaR,id.phis,id.depth).rawId();
31 
32 #ifdef DebugLog
33  LogDebug("HcalSim") << "HcalNumberingScheme det = " << id.subdet
34  << " depth/lay = " << id.depth << "/" << id.lay
35  << " zside = " << id.zside << " eta/R = " << id.etaR
36  << " phi = " << id.phis << " oldphi = " << id.phi
37  << " packed index = 0x" << std::hex << index << std::dec;
38 #endif
39  return index;
40 
41 }
#define LogDebug(id)
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID id)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
HcalSubdetector
Definition: HcalAssistant.h:32