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 (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 18 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( HcalCondObjectContainerBase const &  o)
inlineprotected

Definition at line 24 of file HcalCondObjectContainer.h.

Referenced by operator=().

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( HcalCondObjectContainerBase &&  )
protecteddefault
HcalCondObjectContainerBase::HcalCondObjectContainerBase ( const HcalTopology topo)
protected

Definition at line 11 of file HcalCondObjectContainerBase.cc.

References packedIndexVersion_, and HcalTopology::topoVersion().

11  : packedIndexVersion_(0), topo_(topo) {
12  if (topo) packedIndexVersion_=topo->topoVersion();
13 }
virtual int topoVersion() const
return a version which identifies the given topology

Member Function Documentation

HcalOtherSubdetector HcalCondObjectContainerBase::extractOther ( const DetId id) const
inlineprotected
int HcalCondObjectContainerBase::getCreatorPackedIndexVersion ( ) const
inline

Definition at line 21 of file HcalCondObjectContainer.h.

References packedIndexVersion_, setTopo(), and topo().

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

Definition at line 22 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, diffTreeTool::index, createfilelist::int, HcalCastorDetId::module(), HcalZDCDetId::section(), HcalCastorDetId::sector(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, DetId::subdetId(), topo(), HcalDigiParam_cfi::zside, HcalZDCDetId::zside(), and HcalCastorDetId::zside().

Referenced by HcalCondObjectContainer< Item >::addValues(), HcalCondObjectContainer< Item >::getValues(), and operator=().

22  {
23  unsigned int retval=0xFFFFFFFFu;
24  if (!topo()) {
25  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
26  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
27  return retval;
28  }
29 
30  if (fId.det()==DetId::Hcal) {
31  switch (HcalSubdetector(fId.subdetId())) {
32  case(HcalBarrel) : retval=topo()->detId2denseIdHB(fId); break;
33  case(HcalEndcap) : retval=topo()->detId2denseIdHE(fId); break;
34  case(HcalOuter) : retval=topo()->detId2denseIdHO(fId); break;
35  case(HcalForward) : retval=topo()->detId2denseIdHF(fId); break;
36  case(HcalTriggerTower) : retval=topo()->detId2denseIdHT(fId); break;
37  case(HcalOther) : if (extractOther(fId)==HcalCalibration)
38  retval=topo()->detId2denseIdCALIB(fId);
39  break;
40  default: break;
41  }
42  } else if (fId.det()==DetId::Calo) {
44  // the historical packing from HcalGeneric is different from HcalCastorDetId, so we clone the old packing here.
45  HcalCastorDetId tid(fId);
46  int zside = tid.zside();
47  int sector = tid.sector();
48  int module = tid.module();
49  static const int CASTORhalf=224;
50 
51  int index = 14*(sector-1) + (module-1);
52  if (zside == -1) index += CASTORhalf;
53 
54  retval=(unsigned int)(index);
55  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
56  HcalZDCDetId direct(fId);
57  // THIS IS A HORRIBLE HACK because there were _two_ dense indices for ZDC differing in their handling of +/-z
58  HcalZDCDetId swapZ(direct.section(),direct.zside()<0,direct.channel());
59  retval=swapZ.denseIndex();
60  }
61  }
62  return retval;
63 }
module()
Definition: vlib.cc:994
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
Definition: vlib.h:208
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
uint32_t denseIndex() const
Definition: HcalZDCDetId.cc:68
const HcalTopology * topo() const
HcalCondObjectContainerBase& HcalCondObjectContainerBase::operator= ( HcalCondObjectContainerBase const &  o)
inlineprotected
HcalCondObjectContainerBase& HcalCondObjectContainerBase::operator= ( HcalCondObjectContainerBase &&  )
protecteddefault
template<class Archive >
void HcalCondObjectContainerBase::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HcalCondObjectContainerBase::setTopo ( const HcalTopology topo)

Definition at line 15 of file HcalCondObjectContainerBase.cc.

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

Referenced by HcalShapes::beginRun(), HcalPulseShapes::beginRun(), HcalSimpleReconstructor::beginRun(), ZdcHitReconstructor::beginRun(), HcalHitReconstructor::beginRun(), HcalDigitizer::buildHBHEQIECells(), HcalDigitizer::buildHFQIECells(), HcalDigitizer::buildHOSiPMCells(), and getCreatorPackedIndexVersion().

15  {
16  if ((topo) && (packedIndexVersion_ != 0) &&
18  edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (") << topo->topoVersion() << ") and calibration object (" << packedIndexVersion_ << ")";
19  topo_=topo;
20 }
virtual int topoVersion() const
return a version which identifies the given topology
virtual bool denseIdConsistent(int topoVer) const
return whether this topology is consistent with the numbering in the given topology ...
const HcalTopology * topo() const
unsigned int HcalCondObjectContainerBase::sizeFor ( DetId  fId) const
protected

Definition at line 65 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().

Referenced by HcalCondObjectContainer< Item >::initContainer(), and operator=().

65  {
66  unsigned int retval=0;
67 
68  if (!topo()) {
69  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
70  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
71  return retval;
72  }
73 
74  if (fId.det()==DetId::Hcal) {
75  switch (HcalSubdetector(fId.subdetId())) {
76  case(HcalBarrel) : retval=topo()->getHBSize(); break;
77  case(HcalEndcap) : retval=topo()->getHESize(); break;
78  case(HcalOuter) : retval=topo()->getHOSize(); break;
79  case(HcalForward) : retval=topo()->getHFSize(); break;
80  case(HcalTriggerTower) : retval=topo()->getHTSize(); break;
81  case(HcalOther) : if (extractOther(fId)==HcalCalibration) retval=topo()->getCALIBSize();
82  break;
83  default: break;
84  }
85  } else if (fId.det()==DetId::Calo) {
88  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
90  }
91  }
92  return retval;
93 }
unsigned int getCALIBSize() const
Definition: HcalTopology.h:137
unsigned int getHFSize() const
Definition: HcalTopology.h:135
unsigned int getHOSize() const
Definition: HcalTopology.h:134
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int getHTSize() const
Definition: HcalTopology.h:136
HcalSubdetector
Definition: HcalAssistant.h:31
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
unsigned int getHESize() const
Definition: HcalTopology.h:133
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
unsigned int getHBSize() const
Definition: HcalTopology.h:132
const HcalTopology * topo() const
std::string HcalCondObjectContainerBase::textForId ( const DetId id) const
protected

Definition at line 95 of file HcalCondObjectContainerBase.cc.

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

Referenced by HcalCondObjectContainer< Item >::addValues(), extractOther(), and HcalCondObjectContainer< Item >::getValues().

95  {
96  std::ostringstream os;
97  os << std::hex << "(0x" << id.rawId() << ") " << std::dec;
98 
99  if (id.det()==DetId::Hcal) {
100  switch (HcalSubdetector(id.subdetId())) {
101  case(HcalBarrel) :
102  case(HcalEndcap) :
103  case(HcalOuter) :
104  case(HcalForward) : os << HcalDetId(id); break;
105  case(HcalTriggerTower) : os << HcalTrigTowerDetId(id); break;
106  case(HcalOther) :
107  if (extractOther(id)==HcalCalibration) os << HcalCalibDetId(id);
108  break;
109  default: break;
110  }
111  } else if (id.det()==DetId::Calo) {
112  if (id.subdetId()==HcalCastorDetId::SubdetectorId) {
113  os << HcalCastorDetId(id);
114  } else if (id.subdetId()==HcalZDCDetId::SubdetectorId) {
115  os << HcalZDCDetId(id);
116  }
117  }
118  return os.str();
119 }
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
const HcalTopology* HcalCondObjectContainerBase::topo ( ) const
inline

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 40 of file HcalCondObjectContainer.h.

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

Definition at line 40 of file HcalCondObjectContainer.h.

Member Data Documentation

int HcalCondObjectContainerBase::packedIndexVersion_
protected
const HcalTopology* HcalCondObjectContainerBase::topo_
private

Definition at line 38 of file HcalCondObjectContainer.h.

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