CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
HcalCholeskyMatrices 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< HcalRecoParam > HcalCondObjectContainer< HcalRespCorr > HcalCondObjectContainer< HcalTimeCorr > HcalCondObjectContainer< HcalTimingParam > HcalCondObjectContainer< HcalValidationCorr > HcalCondObjectContainer< HcalZSThreshold > HcalCovarianceMatrices

Public Member Functions

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

Protected Member Functions

HcalOtherSubdetector extractOther (const DetId &id) const
 
 HcalCondObjectContainerBase (const HcalTopology *)
 
unsigned int indexFor (DetId) const
 
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 17 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

HcalCondObjectContainerBase::HcalCondObjectContainerBase ( const HcalTopology topo)
protected

Definition at line 11 of file HcalCondObjectContainerBase.cc.

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

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

Member Function Documentation

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

Definition at line 28 of file HcalCondObjectContainer.h.

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

28 { return HcalOtherSubdetector((id.rawId()>>20)&0x1F); }
HcalOtherSubdetector
Definition: HcalAssistant.h:32
int HcalCondObjectContainerBase::getCreatorPackedIndexVersion ( ) const
inline

Definition at line 20 of file HcalCondObjectContainer.h.

References packedIndexVersion_.

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

Definition at line 28 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(), edm::hlt::Exception, extractOther(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, cmsHarvester::index, HcalCastorDetId::module(), HcalZDCDetId::section(), HcalCastorDetId::sector(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, DetId::subdetId(), topo_, HcalZDCDetId::zside(), HcalCastorDetId::zside(), and ecaldqm::zside().

Referenced by HcalCholeskyMatrices::addValues(), HcalCovarianceMatrices::getValues(), and HcalCholeskyMatrices::getValues().

28  {
29  unsigned int retval=0xFFFFFFFFu;
30  if (!topo_) {
31  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
32  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
33  return retval;
34  }
35 
36  if (fId.det()==DetId::Hcal) {
37  switch (HcalSubdetector(fId.subdetId())) {
38  case(HcalBarrel) : retval=topo_->detId2denseIdHB(fId); break;
39  case(HcalEndcap) : retval=topo_->detId2denseIdHE(fId); break;
40  case(HcalOuter) : retval=topo_->detId2denseIdHO(fId); break;
41  case(HcalForward) : retval=topo_->detId2denseIdHF(fId); break;
42  case(HcalTriggerTower) : retval=topo_->detId2denseIdHT(fId); break;
43  case(HcalOther) : if (extractOther(fId)==HcalCalibration)
44  retval=topo_->detId2denseIdCALIB(fId);
45  break;
46  default: break;
47  }
48  } else if (fId.det()==DetId::Calo) {
50  // the historical packing from HcalGeneric is different from HcalCastorDetId, so we clone the old packing here.
51  HcalCastorDetId tid(fId);
52  int zside = tid.zside();
53  int sector = tid.sector();
54  int module = tid.module();
55  static const int CASTORhalf=224;
56 
57  int index = 14*(sector-1) + (module-1);
58  if (zside == -1) index += CASTORhalf;
59 
60  retval=(unsigned int)(index);
61  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
62  HcalZDCDetId direct(fId);
63  // THIS IS A HORRIBLE HACK because there were _two_ dense indices for ZDC differing in their handling of +/-z
64  HcalZDCDetId swapZ(direct.section(),direct.zside()<0,direct.channel());
65  retval=swapZ.denseIndex();
66  }
67  }
68  return retval;
69 }
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
int zside(DetId const &)
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:20
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:33
template<class Archive >
void HcalCondObjectContainerBase::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HcalCondObjectContainerBase::setTopo ( const HcalTopology topo) const

Definition at line 15 of file HcalCondObjectContainerBase.cc.

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

Referenced by PFRecHitQTestHCALChannel::beginEvent(), HcalPulseShapes::beginRun(), HcalShapes::beginRun(), HcalSimpleReconstructor::beginRun(), ZdcHitReconstructor::beginRun(), HcalMonitorClient::beginRun(), HcalHitReconstructor::beginRun(), HcalDigitizer::buildHOSiPMCells(), CaloTowersCreator::produce(), and HcalHitReconstructor::produce().

15  {
16  if (topo && !topo->denseIdConsistent(packedIndexVersion_)) {
17  edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (") << topo->topoVersion() << ") and calibration object (" << packedIndexVersion_ << ")";
18  }
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
void HcalCondObjectContainerBase::setTopo ( const HcalTopology topo)

Definition at line 21 of file HcalCondObjectContainerBase.cc.

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

21  {
22  if (topo && !topo->denseIdConsistent(packedIndexVersion_)) {
23  edm::LogError("HCAL") << "Inconsistent dense packing between current topology (" << topo->topoVersion() << ") and calibration object (" << packedIndexVersion_ << ")";
24  }
25  topo_=topo;
26 }
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 71 of file HcalCondObjectContainerBase.cc.

References DetId::Calo, DetId::det(), edm::hlt::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 HcalCovarianceMatrices::initContainer(), and HcalCholeskyMatrices::initContainer().

71  {
72  unsigned int retval=0;
73 
74  if (!topo_) {
75  edm::LogError("HCAL") << "Topology pointer not set, HCAL conditions non-functional";
76  throw cms::Exception("Topology pointer not set, HCAL conditions non-functional");
77  return retval;
78  }
79 
80  if (fId.det()==DetId::Hcal) {
81  switch (HcalSubdetector(fId.subdetId())) {
82  case(HcalBarrel) : retval=topo_->getHBSize(); break;
83  case(HcalEndcap) : retval=topo_->getHESize(); break;
84  case(HcalOuter) : retval=topo_->getHOSize(); break;
85  case(HcalForward) : retval=topo_->getHFSize(); break;
86  case(HcalTriggerTower) : retval=topo_->getHTSize(); break;
87  case(HcalOther) : if (extractOther(fId)==HcalCalibration) retval=topo_->getCALIBSize();
88  break;
89  default: break;
90  }
91  } else if (fId.det()==DetId::Calo) {
94  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
96  }
97  }
98  return retval;
99 }
unsigned int getCALIBSize() const
Definition: HcalTopology.h:116
unsigned int getHFSize() const
Definition: HcalTopology.h:114
unsigned int getHOSize() const
Definition: HcalTopology.h:113
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int getHTSize() const
Definition: HcalTopology.h:115
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:20
unsigned int getHESize() const
Definition: HcalTopology.h:112
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
unsigned int getHBSize() const
Definition: HcalTopology.h:111
std::string HcalCondObjectContainerBase::textForId ( const DetId id) const
protected

Definition at line 101 of file HcalCondObjectContainerBase.cc.

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

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 33 of file HcalCondObjectContainer.h.

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

Definition at line 33 of file HcalCondObjectContainer.h.

Member Data Documentation

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