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< HcalPFCut > 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 (HcalCondObjectContainerBase const &o)
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase &&)=default
 
 HcalCondObjectContainerBase (const HcalTopology *)
 
unsigned int indexFor (DetId) const
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase const &o)
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase &&)=default
 
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

uint32_t kSizeForDenseIndexing_
 
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.

◆ HcalCondObjectContainerBase() [2/3]

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( HcalCondObjectContainerBase &&  )
protecteddefault

◆ HcalCondObjectContainerBase() [3/3]

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( const HcalTopology topo)
protected

Definition at line 12 of file HcalCondObjectContainerBase.cc.

References kSizeForDenseIndexing_, HcalZDCDetId::kSizeForDenseIndexingRun1, HcalZDCDetId::kSizeForDenseIndexingRun3, HcalTopology::mode(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, packedIndexVersion_, HcalTopologyMode::Run3, HcalTopologyMode::Run4, topo(), and HcalTopology::topoVersion().

14  if (topo) {
20  }
21 }
int topoVersion() const override
return a version which identifies the given topology
static constexpr int32_t kSizeForDenseIndexingRun1
Definition: HcalZDCDetId.h:201
const HcalTopology * topo() const
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:30
static constexpr int32_t kSizeForDenseIndexingRun3
Definition: HcalZDCDetId.h:202

Member Function Documentation

◆ extractOther()

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

Definition at line 44 of file HcalCondObjectContainer.h.

References nano_mu_digi_cff::rawId.

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

44  {
45  return HcalOtherSubdetector((id.rawId() >> 20) & 0x1F);
46  }
HcalOtherSubdetector
Definition: HcalAssistant.h:40

◆ getCreatorPackedIndexVersion()

int HcalCondObjectContainerBase::getCreatorPackedIndexVersion ( ) const
inline

Definition at line 23 of file HcalCondObjectContainer.h.

References packedIndexVersion_.

◆ indexFor()

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

Definition at line 37 of file HcalCondObjectContainerBase.cc.

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(), nano_mu_digi_cff::sector, HcalCastorDetId::sector(), HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, DetId::subdetId(), topo(), HcalCastorDetId::zside(), HcalZDCDetId::zside(), and ecaldqm::zside().

37  {
38  unsigned int retval = 0xFFFFFFFFu;
39  if (!topo()) {
40  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
41  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
42  return retval;
43  }
44 
45  if (fId.det() == DetId::Hcal) {
46  switch (HcalSubdetector(fId.subdetId())) {
47  case (HcalBarrel):
48  retval = topo()->detId2denseIdHB(fId);
49  break;
50  case (HcalEndcap):
51  retval = topo()->detId2denseIdHE(fId);
52  break;
53  case (HcalOuter):
54  retval = topo()->detId2denseIdHO(fId);
55  break;
56  case (HcalForward):
57  retval = topo()->detId2denseIdHF(fId);
58  break;
59  case (HcalTriggerTower):
60  retval = topo()->detId2denseIdHT(fId);
61  break;
62  case (HcalOther):
63  if (extractOther(fId) == HcalCalibration)
64  retval = topo()->detId2denseIdCALIB(fId);
65  break;
66  default:
67  break;
68  }
69  } else if (fId.det() == DetId::Calo) {
71  // the historical packing from HcalGeneric is different from HcalCastorDetId, so we clone the old packing here.
72  HcalCastorDetId tid(fId);
73  int zside = tid.zside();
74  int sector = tid.sector();
75  int module = tid.module();
76  static const int CASTORhalf = 224;
77 
78  int index = 14 * (sector - 1) + (module - 1);
79  if (zside == -1)
80  index += CASTORhalf;
81 
82  retval = (unsigned int)(index);
83  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
84  HcalZDCDetId direct(fId);
85  // THIS IS A HORRIBLE HACK because there were _two_ dense indices for ZDC differing in their handling of +/-z
86  HcalZDCDetId swapZ(direct.section(), direct.zside() < 0, direct.channel());
87  retval = swapZ.denseIndex();
88  }
89  }
90  return retval;
91 }
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
constexpr uint32_t denseIndex() const
Definition: HcalZDCDetId.h:134
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
int zside(DetId const &)
Log< level::Error, false > LogError
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
const HcalTopology * topo() const
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
HcalSubdetector
Definition: HcalAssistant.h:31
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int SubdetectorId
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT

◆ operator=() [1/2]

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

Definition at line 29 of file HcalCondObjectContainer.h.

References kSizeForDenseIndexing_, EcalTangentSkim_cfg::o, packedIndexVersion_, and topo_.

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

◆ operator=() [2/2]

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

◆ serialize()

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

◆ setTopo()

void HcalCondObjectContainerBase::setTopo ( const HcalTopology topo)

Definition at line 23 of file HcalCondObjectContainerBase.cc.

References CaloSubdetectorTopology::denseIdConsistent(), kSizeForDenseIndexing_, HcalZDCDetId::kSizeForDenseIndexingRun1, HcalZDCDetId::kSizeForDenseIndexingRun3, packedIndexVersion_, AlCaHLTBitMon_QueryRunRegistry::string, topo(), topo_, and HcalTopology::topoVersion().

Referenced by HcalIsoTrkSimAnalyzer::analyze(), HcalIsoTrackAnalyzer::beginRun(), PFCandidateRecalibrator::beginRun(), HcalHBHEMuonAnalyzer::beginRun(), HcalHBHEMuonHighEtaAnalyzer::beginRun(), AlCaHcalHBHEMuonProducer::beginRun(), HcalIsoTrkAnalyzer::beginRun(), HcalDigitizer::buildHBHEQIECells(), HcalDigitizer::buildHFQIECells(), HcalDigitizer::buildHOSiPMCells(), CaloTPGTranscoderULUTs::produce(), and AlCaHcalHBHEMuonProducer::produce().

23  {
24  if (topo) {
26  edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (")
27  << topo->topoVersion() << ") and calibration object (" << packedIndexVersion_ << ")";
28  topo_ = topo;
32  } else {
33  edm::LogError("HCAL") << "Illegal call to HcalCondObjectContainerBase with a null pointer";
34  }
35 }
int topoVersion() const override
return a version which identifies the given topology
Log< level::Error, false > LogError
static constexpr int32_t kSizeForDenseIndexingRun1
Definition: HcalZDCDetId.h:201
const HcalTopology * topo() const
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology ...
static constexpr int32_t kSizeForDenseIndexingRun3
Definition: HcalZDCDetId.h:202

◆ sizeFor()

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

Definition at line 93 of file HcalCondObjectContainerBase.cc.

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, HcalCastorDetId::kSizeForDenseIndexing, kSizeForDenseIndexing_, HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, DetId::subdetId(), and topo().

93  {
94  unsigned int retval = 0;
95 
96  if (!topo()) {
97  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
98  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
99  return retval;
100  }
101 
102  if (fId.det() == DetId::Hcal) {
103  switch (HcalSubdetector(fId.subdetId())) {
104  case (HcalBarrel):
105  retval = topo()->getHBSize();
106  break;
107  case (HcalEndcap):
108  retval = topo()->getHESize();
109  break;
110  case (HcalOuter):
111  retval = topo()->getHOSize();
112  break;
113  case (HcalForward):
114  retval = topo()->getHFSize();
115  break;
116  case (HcalTriggerTower):
117  retval = topo()->getHTSize();
118  break;
119  case (HcalOther):
120  if (extractOther(fId) == HcalCalibration)
121  retval = topo()->getCALIBSize();
122  break;
123  default:
124  break;
125  }
126  } else if (fId.det() == DetId::Calo) {
129  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
130  retval = kSizeForDenseIndexing_;
131  }
132  }
133  return retval;
134 }
unsigned int getHESize() const
Definition: HcalTopology.h:130
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int getHBSize() const
Definition: HcalTopology.h:129
Log< level::Error, false > LogError
unsigned int getHOSize() const
Definition: HcalTopology.h:131
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
const HcalTopology * topo() const
HcalSubdetector
Definition: HcalAssistant.h:31
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int getHFSize() const
Definition: HcalTopology.h:132
unsigned int getHTSize() const
Definition: HcalTopology.h:133
static const int SubdetectorId
static constexpr int kSizeForDenseIndexing
unsigned int getCALIBSize() const
Definition: HcalTopology.h:134
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35

◆ textForId()

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

Definition at line 136 of file HcalCondObjectContainerBase.cc.

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

136  {
137  std::ostringstream os;
138  os << std::hex << "(0x" << id.rawId() << ") " << std::dec;
139 
140  if (id.det() == DetId::Hcal) {
141  switch (HcalSubdetector(id.subdetId())) {
142  case (HcalBarrel):
143  case (HcalEndcap):
144  case (HcalOuter):
145  case (HcalForward):
146  os << HcalDetId(id);
147  break;
148  case (HcalTriggerTower):
149  os << HcalTrigTowerDetId(id);
150  break;
151  case (HcalOther):
152  if (extractOther(id) == HcalCalibration)
153  os << HcalCalibDetId(id);
154  break;
155  default:
156  break;
157  }
158  } else if (id.det() == DetId::Calo) {
159  if (id.subdetId() == HcalCastorDetId::SubdetectorId) {
160  os << HcalCastorDetId(id);
161  } else if (id.subdetId() == HcalZDCDetId::SubdetectorId) {
162  os << HcalZDCDetId(id);
163  }
164  }
165  return os.str();
166 }
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
static const int SubdetectorId
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35

◆ topo()

const HcalTopology* HcalCondObjectContainerBase::topo ( ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 53 of file HcalCondObjectContainer.h.

◆ cond::serialization::access

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

Definition at line 53 of file HcalCondObjectContainer.h.

Member Data Documentation

◆ kSizeForDenseIndexing_

uint32_t HcalCondObjectContainerBase::kSizeForDenseIndexing_
private

Definition at line 51 of file HcalCondObjectContainer.h.

Referenced by HcalCondObjectContainerBase(), operator=(), setTopo(), and sizeFor().

◆ packedIndexVersion_

int HcalCondObjectContainerBase::packedIndexVersion_
protected

◆ topo_

const HcalTopology* HcalCondObjectContainerBase::topo_
private

Definition at line 50 of file HcalCondObjectContainer.h.

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