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

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 11 of file HcalCondObjectContainerBase.cc.

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

13  if (topo)
15 }
int topoVersion() const override
return a version which identifies the given topology
const HcalTopology * topo() const

Member Function Documentation

◆ extractOther()

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

Definition at line 43 of file HcalCondObjectContainer.h.

References nano_mu_digi_cff::rawId.

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

43  {
44  return HcalOtherSubdetector((id.rawId() >> 20) & 0x1F);
45  }
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 24 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(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, DetId::subdetId(), topo(), HcalZDCDetId::zside(), HcalCastorDetId::zside(), and ecaldqm::zside().

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 }
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
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
uint32_t denseIndex() const
Definition: HcalZDCDetId.cc:71
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 const int SubdetectorId
Definition: HcalZDCDetId.h:25
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 EcalTangentSkim_cfg::o, packedIndexVersion_, and topo_.

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

◆ 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 17 of file HcalCondObjectContainerBase.cc.

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

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

17  {
19  edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (") << topo->topoVersion()
20  << ") and calibration object (" << packedIndexVersion_ << ")";
21  topo_ = topo;
22 }
int topoVersion() const override
return a version which identifies the given topology
Log< level::Error, false > LogError
const HcalTopology * topo() const
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology ...

◆ sizeFor()

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

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

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 }
unsigned int getHESize() const
Definition: HcalTopology.h:133
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int getHBSize() const
Definition: HcalTopology.h:132
Log< level::Error, false > LogError
unsigned int getHOSize() const
Definition: HcalTopology.h:134
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:135
unsigned int getHTSize() const
Definition: HcalTopology.h:136
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
unsigned int getCALIBSize() const
Definition: HcalTopology.h:137

◆ textForId()

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

Definition at line 123 of file HcalCondObjectContainerBase.cc.

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

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 }
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25

◆ 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().