CMS 3D CMS Logo

HcalNumberingScheme.cc
Go to the documentation of this file.
1 // File: HcalNumberingScheme.cc
3 // Description: Numbering scheme for barrel electromagnetic calorimeter
8 
9 #include <iostream>
10 
11 //#define EDM_ML_DEBUG
12 
14  edm::LogVerbatim("HcalSim") << "Creating HcalNumberingScheme";
15 }
16 
17 HcalNumberingScheme::~HcalNumberingScheme() { edm::LogVerbatim("HcalSim") << "Deleting HcalNumberingScheme"; }
18 
20  int zside = 2 * (id.zside) - 1;
21  int etaR = zside * (id.etaR);
22  HcalSubdetector subdet = (HcalSubdetector)(id.subdet);
23 
24  //pack it into an integer
25  // to be consistent with HcalDetId convention
26  HcalDetId hid(subdet, etaR, id.phis, id.depth);
27  uint32_t index = hid.rawId();
28 
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("HcalSim") << "HcalNumberingScheme det = " << id.subdet << " depth/lay = " << id.depth << "/"
31  << id.lay << " zside = " << id.zside << " eta/R = " << id.etaR << " phi = " << id.phis
32  << " oldphi = " << id.phi << " packed index = 0x" << std::hex << index << std::dec << " "
33  << hid << " " << HcalDetId(index);
34 #endif
35  return index;
36 }
Log< level::Info, true > LogVerbatim
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
int zside(DetId const &)
HcalSubdetector
Definition: HcalAssistant.h:31
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57