CMS 3D CMS Logo

HcalCondObjectContainerBase.cc
Go to the documentation of this file.
10 
12  : packedIndexVersion_(0), topo_(topo) {
13  if (topo)
15 }
16 
19  edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (") << topo->topoVersion()
20  << ") and calibration object (" << packedIndexVersion_ << ")";
21  topo_ = topo;
22 }
23 
25  unsigned int retval = 0xFFFFFFFFu;
26  if (!topo()) {
27  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
28  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
29  return retval;
30  }
31 
32  if (fId.det() == DetId::Hcal) {
33  switch (HcalSubdetector(fId.subdetId())) {
34  case (HcalBarrel):
35  retval = topo()->detId2denseIdHB(fId);
36  break;
37  case (HcalEndcap):
38  retval = topo()->detId2denseIdHE(fId);
39  break;
40  case (HcalOuter):
41  retval = topo()->detId2denseIdHO(fId);
42  break;
43  case (HcalForward):
44  retval = topo()->detId2denseIdHF(fId);
45  break;
46  case (HcalTriggerTower):
47  retval = topo()->detId2denseIdHT(fId);
48  break;
49  case (HcalOther):
50  if (extractOther(fId) == HcalCalibration)
51  retval = topo()->detId2denseIdCALIB(fId);
52  break;
53  default:
54  break;
55  }
56  } else if (fId.det() == DetId::Calo) {
58  // the historical packing from HcalGeneric is different from HcalCastorDetId, so we clone the old packing here.
59  HcalCastorDetId tid(fId);
60  int zside = tid.zside();
61  int sector = tid.sector();
62  int module = tid.module();
63  static const int CASTORhalf = 224;
64 
65  int index = 14 * (sector - 1) + (module - 1);
66  if (zside == -1)
67  index += CASTORhalf;
68 
69  retval = (unsigned int)(index);
70  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
71  HcalZDCDetId direct(fId);
72  // THIS IS A HORRIBLE HACK because there were _two_ dense indices for ZDC differing in their handling of +/-z
73  HcalZDCDetId swapZ(direct.section(), direct.zside() < 0, direct.channel());
74  retval = swapZ.denseIndex();
75  }
76  }
77  return retval;
78 }
79 
81  unsigned int retval = 0;
82 
83  if (!topo()) {
84  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
85  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
86  return retval;
87  }
88 
89  if (fId.det() == DetId::Hcal) {
90  switch (HcalSubdetector(fId.subdetId())) {
91  case (HcalBarrel):
92  retval = topo()->getHBSize();
93  break;
94  case (HcalEndcap):
95  retval = topo()->getHESize();
96  break;
97  case (HcalOuter):
98  retval = topo()->getHOSize();
99  break;
100  case (HcalForward):
101  retval = topo()->getHFSize();
102  break;
103  case (HcalTriggerTower):
104  retval = topo()->getHTSize();
105  break;
106  case (HcalOther):
107  if (extractOther(fId) == HcalCalibration)
108  retval = topo()->getCALIBSize();
109  break;
110  default:
111  break;
112  }
113  } else if (fId.det() == DetId::Calo) {
116  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
118  }
119  }
120  return retval;
121 }
122 
124  std::ostringstream os;
125  os << std::hex << "(0x" << id.rawId() << ") " << std::dec;
126 
127  if (id.det() == DetId::Hcal) {
128  switch (HcalSubdetector(id.subdetId())) {
129  case (HcalBarrel):
130  case (HcalEndcap):
131  case (HcalOuter):
132  case (HcalForward):
133  os << HcalDetId(id);
134  break;
135  case (HcalTriggerTower):
136  os << HcalTrigTowerDetId(id);
137  break;
138  case (HcalOther):
139  if (extractOther(id) == HcalCalibration)
140  os << HcalCalibDetId(id);
141  break;
142  default:
143  break;
144  }
145  } else if (id.det() == DetId::Calo) {
146  if (id.subdetId() == HcalCastorDetId::SubdetectorId) {
147  os << HcalCastorDetId(id);
148  } else if (id.subdetId() == HcalZDCDetId::SubdetectorId) {
149  os << HcalZDCDetId(id);
150  }
151  }
152  return os.str();
153 }
HcalOther
Definition: HcalAssistant.h:38
HcalCondObjectContainerBase::HcalCondObjectContainerBase
HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
Definition: HcalCondObjectContainer.h:27
MessageLogger.h
HcalCondObjectContainerBase::setTopo
void setTopo(const HcalTopology *topo)
Definition: HcalCondObjectContainerBase.cc:17
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HcalCalibDetId
Definition: HcalCalibDetId.h:45
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HcalTopology::getHTSize
unsigned int getHTSize() const
Definition: HcalTopology.h:136
HcalTopology
Definition: HcalTopology.h:26
DetId::Hcal
Definition: DetId.h:28
HcalZDCDetId::channel
int channel() const
get the channel
Definition: HcalZDCDetId.cc:63
HcalTopology::detId2denseIdHB
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
Definition: HcalTopology.cc:1170
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
HcalCastorDetId::kSizeForDenseIndexing
Definition: HcalCastorDetId.h:71
CaloSubdetectorTopology::denseIdConsistent
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology
Definition: CaloSubdetectorTopology.h:34
HcalBarrel
Definition: HcalAssistant.h:33
HcalZDCDetId.h
HcalCondObjectContainerBase::packedIndexVersion_
int packedIndexVersion_
Definition: HcalCondObjectContainer.h:42
DetId::Calo
Definition: DetId.h:29
HcalCondObjectContainerBase::textForId
std::string textForId(const DetId &id) const
Definition: HcalCondObjectContainerBase.cc:123
HcalTopology::topoVersion
int topoVersion() const override
return a version which identifies the given topology
Definition: HcalTopology.cc:1689
HcalTopology::getHESize
unsigned int getHESize() const
Definition: HcalTopology.h:133
DetId
Definition: DetId.h:17
HcalZDCDetId
Definition: HcalZDCDetId.h:16
HcalCondObjectContainerBase::topo_
const HcalTopology * topo_
Definition: HcalCondObjectContainer.h:49
HcalTopology::detId2denseIdHT
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
Definition: HcalTopology.cc:1254
HcalOuter
Definition: HcalAssistant.h:35
HcalCalibDetId.h
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HcalTopology::detId2denseIdHF
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
Definition: HcalTopology.cc:1234
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalCastorDetId
Definition: HcalCastorDetId.h:23
HcalTrigTowerDetId.h
HcalTopology::getHFSize
unsigned int getHFSize() const
Definition: HcalTopology.h:135
HcalZDCDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
HcalTopology::detId2denseIdHE
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
Definition: HcalTopology.cc:1189
HcalCondObjectContainerBase::sizeFor
unsigned int sizeFor(DetId) const
Definition: HcalCondObjectContainerBase.cc:80
HcalCastorDetId::module
int module() const
get the module (1-2 for EM, 1-12 for HAD)
Definition: HcalCastorDetId.h:58
HcalTopology::getHOSize
unsigned int getHOSize() const
Definition: HcalTopology.h:134
HcalTopology::getHBSize
unsigned int getHBSize() const
Definition: HcalTopology.h:132
HcalDetId.h
HcalCondObjectContainerBase::topo
const HcalTopology * topo() const
Definition: HcalCondObjectContainer.h:22
HcalCastorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalCastorDetId.h:50
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
HcalCastorDetId::sector
int sector() const
get the sector (1-16)
Definition: HcalCastorDetId.h:62
HcalCondObjectContainerBase::indexFor
unsigned int indexFor(DetId) const
Definition: HcalCondObjectContainerBase.cc:24
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalCondObjectContainer.h
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
HcalTopology.h
HcalEndcap
Definition: HcalAssistant.h:34
HcalZDCDetId::kSizeForDenseIndexing
Definition: HcalZDCDetId.h:66
HcalTopology::getCALIBSize
unsigned int getCALIBSize() const
Definition: HcalTopology.h:137
Exception
Definition: hltDiff.cc:245
HcalTriggerTower
Definition: HcalAssistant.h:37
HcalTopology::detId2denseIdHO
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
Definition: HcalTopology.cc:1216
HcalTopology::detId2denseIdCALIB
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
Definition: HcalTopology.cc:1279
Exception.h
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HcalCastorDetId.h
HcalZDCDetId::denseIndex
uint32_t denseIndex() const
Definition: HcalZDCDetId.cc:71
HcalZDCDetId::section
Section section() const
get the section
Definition: HcalZDCDetId.cc:44
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HcalCondObjectContainerBase::extractOther
HcalOtherSubdetector extractOther(const DetId &id) const
Definition: HcalCondObjectContainer.h:43
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14