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 (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 inherited from HcalCondObjectContainerBase
int packedIndexVersion_
 

Detailed Description

template<class Item>
class HcalCondObjectContainer< Item >

Definition at line 57 of file HcalCondObjectContainer.h.

Member Typedef Documentation

◆ tAllContWithNames

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

Definition at line 81 of file HcalCondObjectContainer.h.

◆ tHcalCont

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

Definition at line 80 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

◆ HcalCondObjectContainer()

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

Definition at line 60 of file HcalCondObjectContainer.h.

HcalCondObjectContainerBase(HcalCondObjectContainerBase const &o)
const HcalTopology * topo() const

◆ ~HcalCondObjectContainer()

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

Definition at line 112 of file HcalCondObjectContainer.h.

112 {}

Member Function Documentation

◆ addValues()

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

Definition at line 236 of file HcalCondObjectContainer.h.

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

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

◆ exists()

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

Definition at line 225 of file HcalCondObjectContainer.h.

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

225  {
226  const Item* cell = getValues(fId, false);
227 
228  if (cell) {
229  if (hcalEqualDetId(cell, fId))
230  return true;
231  }
232  return false;
233 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
const Item * getValues(DetId fId, bool throwOnFail=true) const

◆ getAllChannels()

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

Definition at line 314 of file HcalCondObjectContainer.h.

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

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

◆ getAllContainers()

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

Definition at line 83 of file HcalCondObjectContainer.h.

Referenced by HcalConvertedPedestalsGPU::HcalConvertedPedestalsGPU(), HcalConvertedPedestalWidthsGPU::HcalConvertedPedestalWidthsGPU(), HcalLUTCorrsGPU::HcalLUTCorrsGPU(), HcalQIECodersGPU::HcalQIECodersGPU(), HcalRecoParamsGPU::HcalRecoParamsGPU(), HcalRecoParamsWithPulseShapesGPU::HcalRecoParamsWithPulseShapesGPU(), HcalRespCorrsGPU::HcalRespCorrsGPU(), and HcalTimeCorrsGPU::HcalTimeCorrsGPU().

83  {
84  tAllContWithNames allContainers;
85  allContainers.push_back(tHcalCont("HB", HBcontainer));
86  allContainers.push_back(tHcalCont("HE", HEcontainer));
87  allContainers.push_back(tHcalCont("HO", HOcontainer));
88  allContainers.push_back(tHcalCont("HF", HFcontainer));
89  allContainers.push_back(tHcalCont("HT", HTcontainer));
90  allContainers.push_back(tHcalCont("ZDC", ZDCcontainer));
91  allContainers.push_back(tHcalCont("CALIB", CALIBcontainer));
92  allContainers.push_back(tHcalCont("CASTOR", CASTORcontainer));
93  return allContainers;
94  }
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
std::vector< tHcalCont > tAllContWithNames
std::vector< Item > ZDCcontainer
std::vector< Item > CALIBcontainer
std::pair< std::string, std::vector< Item > > tHcalCont

◆ getValues()

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

Definition at line 161 of file HcalCondObjectContainer.h.

Referenced by corrResps::analyze(), scaleGains::analyze(), corrGains::analyze(), modGains::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HcalGainsCheck::analyze(), ValidIsoTrkCalib::analyze(), cms::Analyzer_minbias::analyze(), AnalyzerMinbias::analyzeHcal(), hcaldqm::DQClient::beginLuminosityBlock(), PFCandidateRecalibrator::beginRun(), HcalHBHEMuonAnalyzer::beginRun(), HcalHBHEMuonHighEtaAnalyzer::beginRun(), AlCaHcalHBHEMuonProducer::beginRun(), HcalDigitizer::buildHBHEQIECells(), HcalDigitizer::buildHFQIECells(), HcalDigitizer::buildHOSiPMCells(), Basic2DGenericTopoClusterizer::buildTopoCluster(), Basic2DGenericPFlowPositionCalc::calculateAndSetPositionActual(), muonisolation::CaloExtractorByAssociator::deposits(), hcaldqm::DQHarvester::dqmBeginLuminosityBlock(), HcalDbXml::dumpObject(), reco::HcalNoiseInfoProducer::filldigis(), AlCaHOCalibProducer::fillHOStore(), reco::HcalNoiseInfoProducer::fillrechits(), LocalMaximumSeedFinder::findSeeds(), 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(), CaloTowersCreationAlgo::getThresholdAndWeight(), hcaldqm::DQTask::globalBeginLuminosityBlock(), EgammaHcalIsolation::goodHitEnergy(), Basic2DGenericPFlowClusterizer::growPFClusters(), PFlow2DClusterizerWithTime::growPFClusters(), egamma::hasActiveHcal(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), HcalPedestalAnalysis::HcalPedVal(), HcalRecHitsAnalyzer::hcalSevLvl(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), PFBadHcalPseudoClusterProducer::init(), CaloTPGTranscoderULUT::loadHCALCompress(), CaloTowersCreationAlgo::makeHcalDropChMap(), FixedGridRhoProducerFastjetFromRecHit::passedHcalNoiseCut(), pat::PATIsolatedTrackProducer::produce(), ZdcHitReconstructor::produce(), ZdcHitReconstructor_Run3::produce(), HcalHitReconstructor::produce(), HFPhase1Reconstructor::produce(), HcalChannelPropertiesEP::produce2(), HcalIsoTrackAnalyzer::respCorr(), HcalHBHEMuonAnalyzer::respCorr(), HcalHBHEMuonHighEtaAnalyzer::respCorr(), AlCaHcalHBHEMuonProducer::respCorr(), HcalHitSelection::skim(), HcalIsoTrkSimAnalyzer::storeEnergy(), HcalIsoTrkAnalyzer::storeEnergy(), AlCaHcalIsotrkProducer::storeEnergy(), PFRecHitQTestHCALChannel::test(), PFRecHitQTestHCALThresholdVsDepth::test(), and ObjectValidator::validHit().

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

◆ initContainer()

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

Definition at line 115 of file HcalCondObjectContainer.h.

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

◆ 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 108 of file HcalCondObjectContainer.h.

◆ cond::serialization::access

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

Definition at line 108 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