CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
HcalCondObjectContainerBase Class Reference

#include <HcalCondObjectContainer.h>

Inheritance diagram for HcalCondObjectContainerBase:
HcalCondObjectContainer< Item > HcalCondObjectContainer< HcalCalibrationQIECoder > HcalCondObjectContainer< HcalChannelStatus > HcalCondObjectContainer< HcalFlagHFDigiTimeParam > HcalCondObjectContainer< HcalGain > HcalCondObjectContainer< HcalGainWidth > HcalCondObjectContainer< HcalL1TriggerObject > HcalCondObjectContainer< HcalLongRecoParam > HcalCondObjectContainer< HcalLUTCorr > HcalCondObjectContainer< HcalLutMetadatum > HcalCondObjectContainer< HcalMCParam > HcalCondObjectContainer< HcalPedestal > HcalCondObjectContainer< HcalPedestalWidth > HcalCondObjectContainer< HcalPFCorr > HcalCondObjectContainer< HcalQIECoder > HcalCondObjectContainer< HcalQIEType > HcalCondObjectContainer< HcalRecoParam > HcalCondObjectContainer< HcalRespCorr > HcalCondObjectContainer< HcalSiPMParameter > HcalCondObjectContainer< HcalTimeCorr > HcalCondObjectContainer< HcalTimingParam > HcalCondObjectContainer< HcalTPChannelParameter > HcalCondObjectContainer< HcalValidationCorr > HcalCondObjectContainer< HcalZDCLowGainFraction > HcalCondObjectContainer< HcalZSThreshold >

Public Member Functions

int getCreatorPackedIndexVersion () const
 
void setTopo (const HcalTopology *topo)
 
const HcalTopologytopo () const
 

Protected Member Functions

HcalOtherSubdetector extractOther (const DetId &id) const
 
 HcalCondObjectContainerBase (const HcalTopology *)
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase &&)=default
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase const &o)
 
unsigned int indexFor (DetId) const
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase &&)=default
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase const &o)
 
unsigned int sizeFor (DetId) const
 
std::string textForId (const DetId &id) const
 

Protected Attributes

int packedIndexVersion_
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

const HcalTopologytopo_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 20 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

◆ HcalCondObjectContainerBase() [1/3]

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( HcalCondObjectContainerBase const &  o)
inlineprotected

Definition at line 27 of file HcalCondObjectContainer.h.

28  : packedIndexVersion_(o.packedIndexVersion_), topo_(o.topo()) {}

◆ HcalCondObjectContainerBase() [2/3]

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( HcalCondObjectContainerBase &&  )
protecteddefault

◆ HcalCondObjectContainerBase() [3/3]

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( const HcalTopology topo)
protected

Definition at line 11 of file HcalCondObjectContainerBase.cc.

13  if (topo)
15 }

References packedIndexVersion_, topo(), and HcalTopology::topoVersion().

Member Function Documentation

◆ extractOther()

HcalOtherSubdetector HcalCondObjectContainerBase::extractOther ( const DetId id) const
inlineprotected

Definition at line 43 of file HcalCondObjectContainer.h.

43  {
44  return HcalOtherSubdetector((id.rawId() >> 20) & 0x1F);
45  }

Referenced by indexFor(), sizeFor(), and textForId().

◆ getCreatorPackedIndexVersion()

int HcalCondObjectContainerBase::getCreatorPackedIndexVersion ( ) const
inline

Definition at line 23 of file HcalCondObjectContainer.h.

23 { return packedIndexVersion_; }

References packedIndexVersion_.

◆ indexFor()

unsigned int HcalCondObjectContainerBase::indexFor ( DetId  fId) const
protected

Definition at line 24 of file HcalCondObjectContainerBase.cc.

24  {
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 }

References DetId::Calo, HcalZDCDetId::channel(), HcalZDCDetId::denseIndex(), DetId::det(), HcalTopology::detId2denseIdCALIB(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalTopology::detId2denseIdHT(), Exception, extractOther(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, createfilelist::int, HcalCastorDetId::module(), HcalZDCDetId::section(), HcalCastorDetId::sector(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, DetId::subdetId(), topo(), HcalZDCDetId::zside(), HcalCastorDetId::zside(), and ecaldqm::zside().

◆ operator=() [1/2]

HcalCondObjectContainerBase& HcalCondObjectContainerBase::operator= ( HcalCondObjectContainerBase &&  )
protecteddefault

◆ operator=() [2/2]

HcalCondObjectContainerBase& HcalCondObjectContainerBase::operator= ( HcalCondObjectContainerBase const &  o)
inlineprotected

Definition at line 29 of file HcalCondObjectContainer.h.

29  {
30  topo_ = o.topo();
31  packedIndexVersion_ = o.packedIndexVersion_;
32  return *this;
33  }

References EcalTangentSkim_cfg::o, packedIndexVersion_, and topo_.

◆ serialize()

template<class Archive >
void HcalCondObjectContainerBase::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setTopo()

void HcalCondObjectContainerBase::setTopo ( const HcalTopology topo)

◆ sizeFor()

unsigned int HcalCondObjectContainerBase::sizeFor ( DetId  fId) const
protected

Definition at line 80 of file HcalCondObjectContainerBase.cc.

80  {
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 }

References DetId::Calo, DetId::det(), Exception, extractOther(), HcalTopology::getCALIBSize(), HcalTopology::getHBSize(), HcalTopology::getHESize(), HcalTopology::getHFSize(), HcalTopology::getHOSize(), HcalTopology::getHTSize(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, HcalZDCDetId::kSizeForDenseIndexing, HcalCastorDetId::kSizeForDenseIndexing, HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, DetId::subdetId(), and topo().

◆ textForId()

std::string HcalCondObjectContainerBase::textForId ( const DetId id) const
protected

Definition at line 123 of file HcalCondObjectContainerBase.cc.

123  {
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 }

References DetId::Calo, TauDecayModes::dec, extractOther(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, HcalZDCDetId::SubdetectorId, and HcalCastorDetId::SubdetectorId.

◆ topo()

const HcalTopology* HcalCondObjectContainerBase::topo ( ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 51 of file HcalCondObjectContainer.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 51 of file HcalCondObjectContainer.h.

Member Data Documentation

◆ packedIndexVersion_

int HcalCondObjectContainerBase::packedIndexVersion_
protected

◆ topo_

const HcalTopology* HcalCondObjectContainerBase::topo_
private

Definition at line 49 of file HcalCondObjectContainer.h.

Referenced by operator=(), setTopo(), and topo().

HcalOther
Definition: HcalAssistant.h:38
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
DetId::Hcal
Definition: DetId.h:28
HcalTopology::detId2denseIdHB
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
Definition: HcalTopology.cc:1169
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
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
HcalCondObjectContainerBase::packedIndexVersion_
int packedIndexVersion_
Definition: HcalCondObjectContainer.h:42
DetId::Calo
Definition: DetId.h:29
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
HcalTopology::topoVersion
int topoVersion() const override
return a version which identifies the given topology
Definition: HcalTopology.cc:1688
HcalTopology::getHESize
unsigned int getHESize() const
Definition: HcalTopology.h:133
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:1253
HcalOuter
Definition: HcalAssistant.h:35
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:1233
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalCastorDetId
Definition: HcalCastorDetId.h:23
HcalTopology::getHFSize
unsigned int getHFSize() const
Definition: HcalTopology.h:135
HcalTopology::detId2denseIdHE
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
Definition: HcalTopology.cc:1188
HcalOtherSubdetector
HcalOtherSubdetector
Definition: HcalAssistant.h:40
HcalTopology::getHOSize
unsigned int getHOSize() const
Definition: HcalTopology.h:134
HcalTopology::getHBSize
unsigned int getHBSize() const
Definition: HcalTopology.h:132
HcalZDCDetId::kSizeForDenseIndexing
Definition: HcalZDCDetId.h:66
HcalCondObjectContainerBase::topo
const HcalTopology * topo() const
Definition: HcalCondObjectContainer.h:22
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
HcalCastorDetId::kSizeForDenseIndexing
Definition: HcalCastorDetId.h:71
HcalEndcap
Definition: HcalAssistant.h:34
HcalTopology::getCALIBSize
unsigned int getCALIBSize() const
Definition: HcalTopology.h:137
Exception
Definition: hltDiff.cc:246
HcalTriggerTower
Definition: HcalAssistant.h:37
HcalTopology::detId2denseIdHO
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
Definition: HcalTopology.cc:1215
HcalTopology::detId2denseIdCALIB
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
Definition: HcalTopology.cc:1278
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HcalZDCDetId::denseIndex
uint32_t denseIndex() const
Definition: HcalZDCDetId.cc:71
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HcalCondObjectContainerBase::extractOther
HcalOtherSubdetector extractOther(const DetId &id) const
Definition: HcalCondObjectContainer.h:43
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14