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< HcalZDCLowGainFraction > HcalCondObjectContainer< HcalZSThreshold > HcalCovarianceMatrices

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.

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

Definition at line 35 of file HcalCondObjectContainer.h.

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

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

Definition at line 21 of file HcalCondObjectContainer.h.

References packedIndexVersion_.

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

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
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
const HcalTopology * topo() const
HcalCondObjectContainerBase& HcalCondObjectContainerBase::operator= ( HcalCondObjectContainerBase const &  o)
inlineprotected

Definition at line 25 of file HcalCondObjectContainer.h.

References packedIndexVersion_, topo(), and topo_.

25 { topo_=o.topo(); packedIndexVersion_=o.packedIndexVersion_; return *this;}
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 HcalPulseShapes::beginRun(), HcalShapes::beginRun(), HcalSimpleReconstructor::beginRun(), ZdcHitReconstructor::beginRun(), HcalHitReconstructor::beginRun(), HcalDigitizer::buildHOSiPMCells(), and CaloTPGTranscoderULUTs::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
unsigned int HcalCondObjectContainerBase::sizeFor ( DetId  fId) const
protected

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

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: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
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.

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:20
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().