CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
HcalCondObjectContainer< Item > Class Template Reference

#include <HcalCondObjectContainer.h>

Inheritance diagram for HcalCondObjectContainer< Item >:
HcalCondObjectContainerBase

Public Types

typedef std::vector< tHcalConttAllContWithNames
 
typedef std::pair< std::string, std::vector< Item > > tHcalCont
 

Public Member Functions

bool addValues (const Item &myItem)
 
bool exists (DetId fId) const
 
std::vector< DetIdgetAllChannels () const
 
const tAllContWithNames getAllContainers () const
 
const Item * getValues (DetId fId, bool throwOnFail=true) const
 
 HcalCondObjectContainer (const HcalTopology *topo)
 
virtual std::string myname () const
 
virtual ~HcalCondObjectContainer ()
 
- Public Member Functions inherited from HcalCondObjectContainerBase
int getCreatorPackedIndexVersion () const
 
void setTopo (const HcalTopology *topo)
 
const HcalTopologytopo () const
 

Private Member Functions

void initContainer (DetId container)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< Item > CALIBcontainer
 
std::vector< Item > CASTORcontainer
 
std::vector< Item > HBcontainer
 
std::vector< Item > HEcontainer
 
std::vector< Item > HFcontainer
 
std::vector< Item > HOcontainer
 
std::vector< Item > HTcontainer
 
std::vector< Item > ZDCcontainer
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from HcalCondObjectContainerBase
HcalOtherSubdetector extractOther (const DetId &id) const
 
 HcalCondObjectContainerBase (const HcalTopology *)
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase &&)=default
 
 HcalCondObjectContainerBase (HcalCondObjectContainerBase const &o)
 
unsigned int indexFor (DetId) const
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase &&)=default
 
HcalCondObjectContainerBaseoperator= (HcalCondObjectContainerBase const &o)
 
unsigned int sizeFor (DetId) const
 
std::string textForId (const DetId &id) const
 
- Protected Attributes inherited from HcalCondObjectContainerBase
int packedIndexVersion_
 

Detailed Description

template<class Item>
class HcalCondObjectContainer< Item >

Definition at line 55 of file HcalCondObjectContainer.h.

Member Typedef Documentation

◆ tAllContWithNames

template<class Item>
typedef std::vector<tHcalCont> HcalCondObjectContainer< Item >::tAllContWithNames

Definition at line 79 of file HcalCondObjectContainer.h.

◆ tHcalCont

template<class Item>
typedef std::pair<std::string, std::vector<Item> > HcalCondObjectContainer< Item >::tHcalCont

Definition at line 78 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

◆ HcalCondObjectContainer()

template<class Item>
HcalCondObjectContainer< Item >::HcalCondObjectContainer ( const HcalTopology topo)
inline

Definition at line 58 of file HcalCondObjectContainer.h.

◆ ~HcalCondObjectContainer()

template<class Item >
HcalCondObjectContainer< Item >::~HcalCondObjectContainer ( )
virtual

Definition at line 110 of file HcalCondObjectContainer.h.

110 {}

Member Function Documentation

◆ addValues()

template<class Item>
bool HcalCondObjectContainer< Item >::addValues ( const Item &  myItem)

Definition at line 234 of file HcalCondObjectContainer.h.

234  {
235  bool success = false;
236  DetId fId(myItem.rawId());
237  unsigned int index = indexFor(fId);
238 
239  Item* cell = nullptr;
240 
241  if (index < 0xFFFFFFFu) {
242  if (fId.det() == DetId::Hcal) {
243  switch (HcalSubdetector(fId.subdetId())) {
244  case HcalBarrel:
245  if (HBcontainer.empty())
246  initContainer(fId);
247  if (index < HBcontainer.size())
248  cell = &(HBcontainer.at(index));
249  break;
250  case HcalEndcap:
251  if (HEcontainer.empty())
252  initContainer(fId);
253  if (index < HEcontainer.size())
254  cell = &(HEcontainer.at(index));
255  break;
256  case HcalForward:
257  if (HFcontainer.empty())
258  initContainer(fId);
259  if (index < HFcontainer.size())
260  cell = &(HFcontainer.at(index));
261  break;
262  case HcalOuter:
263  if (HOcontainer.empty())
264  initContainer(fId);
265  if (index < HOcontainer.size())
266  cell = &(HOcontainer.at(index));
267  break;
268  case HcalTriggerTower:
269  if (HTcontainer.empty())
270  initContainer(fId);
271  if (index < HTcontainer.size())
272  cell = &(HTcontainer.at(index));
273  break;
274  case HcalOther:
275  if (extractOther(fId) == HcalCalibration) {
276  if (CALIBcontainer.empty())
277  initContainer(fId);
278  if (index < CALIBcontainer.size())
279  cell = &(CALIBcontainer.at(index));
280  }
281  break;
282  default:
283  break;
284  }
285  } else if (fId.det() == DetId::Calo) {
286  if (fId.subdetId() == HcalCastorDetId::SubdetectorId) {
287  if (CASTORcontainer.empty())
288  initContainer(fId);
289  if (index < CASTORcontainer.size())
290  cell = &(CASTORcontainer.at(index));
291  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
292  if (ZDCcontainer.empty())
293  initContainer(fId);
294  if (index < ZDCcontainer.size())
295  cell = &(ZDCcontainer.at(index));
296  }
297  }
298  }
299 
300  if (cell != nullptr) {
301  (*cell) = myItem;
302  success = true;
303  }
304 
305  if (!success)
306  throw cms::Exception("Filling of conditions failed")
307  << " no valid filling possible for Conditions of type " << myname() << " for DetId " << textForId(fId);
308  return success;
309 }

Referenced by corrResps::analyze(), scaleGains::analyze(), corrGains::analyze(), modGains::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HcalGainsCheck::analyze(), HcalPedestalAnalysis::GetPedConst(), and HcalPedestalAnalysis::HcalPedVal().

◆ exists()

template<class Item >
bool HcalCondObjectContainer< Item >::exists ( DetId  fId) const

Definition at line 223 of file HcalCondObjectContainer.h.

223  {
224  const Item* cell = getValues(fId, false);
225 
226  if (cell) {
227  if (hcalEqualDetId(cell, fId))
228  return true;
229  }
230  return false;
231 }

Referenced by corrResps::analyze(), corrGains::analyze(), modGains::analyze(), and cms::HitReCalibrator::produce().

◆ getAllChannels()

template<class Item >
std::vector< DetId > HcalCondObjectContainer< Item >::getAllChannels ( ) const

Definition at line 312 of file HcalCondObjectContainer.h.

312  {
313  std::vector<DetId> channels;
314  Item emptyItem;
315  for (unsigned int i = 0; i < HBcontainer.size(); i++) {
316  if (emptyItem.rawId() != HBcontainer.at(i).rawId())
317  channels.push_back(DetId(HBcontainer.at(i).rawId()));
318  }
319  for (unsigned int i = 0; i < HEcontainer.size(); i++) {
320  if (emptyItem.rawId() != HEcontainer.at(i).rawId())
321  channels.push_back(DetId(HEcontainer.at(i).rawId()));
322  }
323  for (unsigned int i = 0; i < HOcontainer.size(); i++) {
324  if (emptyItem.rawId() != HOcontainer.at(i).rawId())
325  channels.push_back(DetId(HOcontainer.at(i).rawId()));
326  }
327  for (unsigned int i = 0; i < HFcontainer.size(); i++) {
328  if (emptyItem.rawId() != HFcontainer.at(i).rawId())
329  channels.push_back(DetId(HFcontainer.at(i).rawId()));
330  }
331  for (unsigned int i = 0; i < HTcontainer.size(); i++) {
332  if (emptyItem.rawId() != HTcontainer.at(i).rawId())
333  channels.push_back(DetId(HTcontainer.at(i).rawId()));
334  }
335  for (unsigned int i = 0; i < ZDCcontainer.size(); i++) {
336  if (emptyItem.rawId() != ZDCcontainer.at(i).rawId())
337  channels.push_back(DetId(ZDCcontainer.at(i).rawId()));
338  }
339  for (unsigned int i = 0; i < CALIBcontainer.size(); i++) {
340  if (emptyItem.rawId() != CALIBcontainer.at(i).rawId())
341  channels.push_back(DetId(CALIBcontainer.at(i).rawId()));
342  }
343  for (unsigned int i = 0; i < CASTORcontainer.size(); i++) {
344  if (emptyItem.rawId() != CASTORcontainer.at(i).rawId())
345  channels.push_back(DetId(CASTORcontainer.at(i).rawId()));
346  }
347 
348  return channels;
349 }

Referenced by corrResps::analyze(), scaleGains::analyze(), corrGains::analyze(), HcalQIEDataCheck::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalWidthsCheck::analyze(), HcalPedestalsCheck::analyze(), HcalGainsCheck::analyze(), hcaldqm::DQClient::beginLuminosityBlock(), HcalDbService::buildCalibrations(), HcalDbService::buildCalibWidths(), hcaldqm::DQHarvester::dqmBeginLuminosityBlock(), HcalDbXml::dumpObject(), hcaldqm::DQTask::globalBeginLuminosityBlock(), HcalPedestalAnalysis::HcalPedVal(), PFBadHcalPseudoClusterProducer::init(), CaloTPGTranscoderULUT::loadHCALCompress(), CaloTowersCreationAlgo::makeHcalDropChMap(), and CaloTPGTranscoderULUT::setup().

◆ getAllContainers()

template<class Item>
const tAllContWithNames HcalCondObjectContainer< Item >::getAllContainers ( ) const
inline

Definition at line 81 of file HcalCondObjectContainer.h.

81  {
82  tAllContWithNames allContainers;
83  allContainers.push_back(tHcalCont("HB", HBcontainer));
84  allContainers.push_back(tHcalCont("HE", HEcontainer));
85  allContainers.push_back(tHcalCont("HO", HOcontainer));
86  allContainers.push_back(tHcalCont("HF", HFcontainer));
87  allContainers.push_back(tHcalCont("HT", HTcontainer));
88  allContainers.push_back(tHcalCont("ZDC", ZDCcontainer));
89  allContainers.push_back(tHcalCont("CALIB", CALIBcontainer));
90  allContainers.push_back(tHcalCont("CASTOR", CASTORcontainer));
91  return allContainers;
92  }

◆ getValues()

template<class Item >
const Item * HcalCondObjectContainer< Item >::getValues ( DetId  fId,
bool  throwOnFail = true 
) const

Definition at line 159 of file HcalCondObjectContainer.h.

159  {
160  unsigned int index = indexFor(fId);
161 
162  const Item* cell = nullptr;
163 
164  if (index < 0xFFFFFFFu) {
165  if (fId.det() == DetId::Hcal) {
166  switch (HcalSubdetector(fId.subdetId())) {
167  case HcalBarrel:
168  if (index < HBcontainer.size())
169  cell = &(HBcontainer.at(index));
170  break;
171  case HcalEndcap:
172  if (index < HEcontainer.size())
173  cell = &(HEcontainer.at(index));
174  break;
175  case HcalForward:
176  if (index < HFcontainer.size())
177  cell = &(HFcontainer.at(index));
178  break;
179  case HcalOuter:
180  if (index < HOcontainer.size())
181  cell = &(HOcontainer.at(index));
182  break;
183  case HcalTriggerTower:
184  if (index < HTcontainer.size())
185  cell = &(HTcontainer.at(index));
186  break;
187  case HcalOther:
188  if (extractOther(fId) == HcalCalibration && index < CALIBcontainer.size())
189  cell = &(CALIBcontainer.at(index));
190  break;
191  default:
192  break;
193  }
194  } else if (fId.det() == DetId::Calo) {
196  if (index < CASTORcontainer.size())
197  cell = &(CASTORcontainer.at(index));
198  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
199  if (index < ZDCcontainer.size())
200  cell = &(ZDCcontainer.at(index));
201  }
202  }
203  }
204 
205  if ((!cell)) {
206  if (throwOnFail) {
207  throw cms::Exception("Conditions not found")
208  << "Unavailable Conditions of type " << myname() << " for cell " << textForId(fId);
209  }
210  } else if (!hcalEqualDetId(cell, fId)) {
211  if (throwOnFail) {
212  throw cms::Exception("Conditions mismatch")
213  << "Requested conditions of type " << myname() << " for cell " << textForId(fId)
214  << " got conditions for cell " << textForId(DetId(cell->rawId()));
215  }
216  cell = nullptr;
217  }
218 
219  return cell;
220 }

Referenced by corrResps::analyze(), scaleGains::analyze(), corrGains::analyze(), modGains::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HcalGainsCheck::analyze(), cms::Analyzer_minbias::analyze(), ValidIsoTrkCalib::analyze(), AnalyzerMinbias::analyzeHcal(), hcaldqm::DQClient::beginLuminosityBlock(), HcalHBHEMuonAnalyzer::beginRun(), HcalHBHEMuonHighEtaAnalyzer::beginRun(), hcaldqm::DQHarvester::dqmBeginLuminosityBlock(), HcalDbXml::dumpObject(), reco::HcalNoiseInfoProducer::filldigis(), AlCaHOCalibProducer::fillHOStore(), reco::HcalNoiseInfoProducer::fillrechits(), HcalDbService::getEffectivePedestal(), HcalDbService::getEffectivePedestalWidth(), HcalDbService::getGain(), HcalDbService::getGainWidth(), HcalDbService::getHcalChannelStatus(), HcalDbService::getHcalL1TriggerObject(), HcalDbService::getHcalLUTCorr(), HcalDbService::getHcalMCParam(), HcalDbService::getHcalPFCorr(), HcalDbService::getHcalQIEType(), HcalDbService::getHcalRecoParam(), HcalDbService::getHcalRespCorr(), HcalDbService::getHcalShape(), HcalDbService::getHcalSiPMParameter(), HcalDbService::getHcalTimeCorr(), HcalDbService::getHcalTPChannelParameter(), HcalDbService::getHcalZSThreshold(), HcalDbService::getPedestal(), HcalDbService::getPedestalWidth(), hcaldqm::DQTask::globalBeginLuminosityBlock(), egamma::hasActiveHcal(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), HcalPedestalAnalysis::HcalPedVal(), HcalRecHitsAnalyzer::hcalSevLvl(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), PFBadHcalPseudoClusterProducer::init(), CaloTPGTranscoderULUT::loadHCALCompress(), CaloTowersCreationAlgo::makeHcalDropChMap(), cms::HitReCalibrator::produce(), ZdcHitReconstructor::produce(), pat::PATIsolatedTrackProducer::produce(), HcalHitReconstructor::produce(), HFPhase1Reconstructor::produce(), HcalChannelPropertiesEP::produce2(), HcalHBHEMuonAnalyzer::respCorr(), HcalHBHEMuonHighEtaAnalyzer::respCorr(), HcalHitSelection::skim(), HcalIsoTrkAnalyzer::storeEnergy(), PFRecHitQTestHCALChannel::test(), and ObjectValidator::validHit().

◆ initContainer()

template<class Item >
void HcalCondObjectContainer< Item >::initContainer ( DetId  container)
private

Definition at line 113 of file HcalCondObjectContainer.h.

113  {
114  Item emptyItem;
115 
116  if (fId.det() == DetId::Hcal) {
117  switch (HcalSubdetector(fId.subdetId())) {
118  case HcalBarrel:
119  for (unsigned int i = 0; i < sizeFor(fId); i++)
120  HBcontainer.push_back(emptyItem);
121  break;
122  case HcalEndcap:
123  for (unsigned int i = 0; i < sizeFor(fId); i++)
124  HEcontainer.push_back(emptyItem);
125  break;
126  case HcalOuter:
127  for (unsigned int i = 0; i < sizeFor(fId); i++)
128  HOcontainer.push_back(emptyItem);
129  break;
130  case HcalForward:
131  for (unsigned int i = 0; i < sizeFor(fId); i++)
132  HFcontainer.push_back(emptyItem);
133  break;
134  case HcalTriggerTower:
135  for (unsigned int i = 0; i < sizeFor(fId); i++)
136  HTcontainer.push_back(emptyItem);
137  break;
138  case HcalOther:
139  if (extractOther(fId) == HcalCalibration) {
140  for (unsigned int i = 0; i < sizeFor(fId); i++)
141  CALIBcontainer.push_back(emptyItem);
142  }
143  break;
144  default:
145  break;
146  }
147  } else if (fId.det() == DetId::Calo) {
148  if (fId.subdetId() == HcalCastorDetId::SubdetectorId) {
149  for (unsigned int i = 0; i < sizeFor(fId); i++)
150  CASTORcontainer.push_back(emptyItem);
151  } else if (fId.subdetId() == HcalZDCDetId::SubdetectorId) {
152  for (unsigned int i = 0; i < sizeFor(fId); i++)
153  ZDCcontainer.push_back(emptyItem);
154  }
155  }
156 }

◆ myname()

template<class Item>
virtual std::string HcalCondObjectContainer< Item >::myname ( ) const
inlinevirtual

◆ serialize()

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

Friends And Related Function Documentation

◆ boost::serialization::access

template<class Item>
friend class boost::serialization::access
friend

Definition at line 106 of file HcalCondObjectContainer.h.

◆ cond::serialization::access

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

Definition at line 106 of file HcalCondObjectContainer.h.

Member Data Documentation

◆ CALIBcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::CALIBcontainer
private

◆ CASTORcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::CASTORcontainer
private

◆ HBcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HBcontainer
private

◆ HEcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HEcontainer
private

◆ HFcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HFcontainer
private

◆ HOcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HOcontainer
private

◆ HTcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HTcontainer
private

◆ ZDCcontainer

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::ZDCcontainer
private
HcalOther
Definition: HcalAssistant.h:38
HcalCondObjectContainerBase::HcalCondObjectContainerBase
HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
Definition: HcalCondObjectContainer.h:27
HcalCondObjectContainer::CALIBcontainer
std::vector< Item > CALIBcontainer
Definition: HcalCondObjectContainer.h:103
mps_fire.i
i
Definition: mps_fire.py:428
HcalCondObjectContainer::tHcalCont
std::pair< std::string, std::vector< Item > > tHcalCont
Definition: HcalCondObjectContainer.h:78
HcalCondObjectContainer::HEcontainer
std::vector< Item > HEcontainer
Definition: HcalCondObjectContainer.h:98
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HcalCondObjectContainer::tAllContWithNames
std::vector< tHcalCont > tAllContWithNames
Definition: HcalCondObjectContainer.h:79
DetId::Hcal
Definition: DetId.h:28
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
HcalBarrel
Definition: HcalAssistant.h:33
HcalCondObjectContainer::HBcontainer
std::vector< Item > HBcontainer
Definition: HcalCondObjectContainer.h:97
DetId::Calo
Definition: DetId.h:29
HcalCondObjectContainerBase::textForId
std::string textForId(const DetId &id) const
Definition: HcalCondObjectContainerBase.cc:123
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
HcalCondObjectContainer::CASTORcontainer
std::vector< Item > CASTORcontainer
Definition: HcalCondObjectContainer.h:104
DetId
Definition: DetId.h:17
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
HcalOuter
Definition: HcalAssistant.h:35
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalCondObjectContainer::ZDCcontainer
std::vector< Item > ZDCcontainer
Definition: HcalCondObjectContainer.h:102
HcalCondObjectContainerBase::sizeFor
unsigned int sizeFor(DetId) const
Definition: HcalCondObjectContainerBase.cc:80
HcalCondObjectContainerBase::topo
const HcalTopology * topo() const
Definition: HcalCondObjectContainer.h:22
HcalCondObjectContainerBase::indexFor
unsigned int indexFor(DetId) const
Definition: HcalCondObjectContainerBase.cc:24
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
HcalCondObjectContainer::HTcontainer
std::vector< Item > HTcontainer
Definition: HcalCondObjectContainer.h:101
hcalEqualDetId
bool hcalEqualDetId(Item *cell, const DetId &fId)
Definition: HcalDetIdRelationship.h:11
HcalCondObjectContainer::HOcontainer
std::vector< Item > HOcontainer
Definition: HcalCondObjectContainer.h:99
HcalEndcap
Definition: HcalAssistant.h:34
HcalCondObjectContainer::HFcontainer
std::vector< Item > HFcontainer
Definition: HcalCondObjectContainer.h:100
Exception
Definition: hltDiff.cc:246
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
HcalTriggerTower
Definition: HcalAssistant.h:37
HcalCondObjectContainer::initContainer
void initContainer(DetId container)
Definition: HcalCondObjectContainer.h:113
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HcalCondObjectContainerBase::extractOther
HcalOtherSubdetector extractOther(const DetId &id) const
Definition: HcalCondObjectContainer.h:43
HcalCondObjectContainer::myname
virtual std::string myname() const
Definition: HcalCondObjectContainer.h:75