test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTestNumberingScheme.cc
Go to the documentation of this file.
1 // File: HcalTestNumberingScheme.cc
3 // Description: Numbering scheme for barrel electromagnetic calorimeter
8 
9 #include <iostream>
10 
12  HcalNumberingScheme(), forTBH2(forTB) {
13  edm::LogInfo("HcalSim") << "Creating HcalTestNumberingScheme with TB Flag "
14  << forTBH2;
15 }
16 
18  edm::LogInfo("HcalSim") << "Deleting HcalTestNumberingScheme";
19 }
20 
22  id) {
23 
24  //pack it into an integer
25  uint32_t index = 0;
26  if (forTBH2) {
27  // TB H2 Case
28  int etaR = id.etaR;
29  int phi = id.phis;
30  HcalSubdetector subdet = (HcalSubdetector)(id.subdet);
31  if (subdet == HcalBarrel && phi > 4) { // HB2
32  if (etaR > 4 && etaR < 10)
33  index = HcalDetId(subdet,id.lay,id.phis,1).rawId();
34  } else { // HB1
35  index = HcalDetId(subdet,etaR,id.phis,id.depth).rawId();
36  }
37  } else {
38  // Test case
39  index = HcalTestNumbering::packHcalIndex(id.subdet, id.zside, id.depth,
40  id.etaR, id.phis, id.lay);
41  }
42 
43  LogDebug("HcalSim") << "HcalTestNumberingScheme det = " << id.subdet
44  << " depth/lay = " << id.depth << "/" << id.lay
45  << " zside = " << id.zside << " eta/R = " << id.etaR
46  << " phi = " << id.phis << " packed index = 0x"
47  << std::hex << index << std::dec;
48 
49  return index;
50 
51 }
52 
53 uint32_t HcalTestNumberingScheme::packHcalIndex(int det, int z, int depth,
54  int eta, int phi, int lay) {
55 
56  return HcalTestNumbering::packHcalIndex(det, z, depth, eta, phi, lay);
57 }
58 
60  int& det, int& z,
61  int& depth, int& eta,
62  int& phi, int& lay) {
63 
64  HcalTestNumbering::unpackHcalIndex(idx, det, z, depth, eta, phi, lay);
65 }
#define LogDebug(id)
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
int zside(DetId const &)
T eta() const
float float float z
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
HcalSubdetector
Definition: HcalAssistant.h:31
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
Definition: DDAxes.h:10