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

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

◆ ~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.

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

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 }
virtual std::string myname() const
std::vector< Item > HEcontainer
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
std::vector< Item > HOcontainer
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 223 of file HcalCondObjectContainer.h.

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

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

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 }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
std::vector< Item > ZDCcontainer
Definition: DetId.h:17
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer

◆ getAllContainers()

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

Definition at line 81 of file HcalCondObjectContainer.h.

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

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  }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
std::vector< tHcalCont > tAllContWithNames
std::vector< Item > ZDCcontainer
std::vector< Item > HOcontainer
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 159 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(), 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(), HcalHitReconstructor::produce(), HFPhase1Reconstructor::produce(), HcalHBHEMuonAnalyzer::respCorr(), HcalHBHEMuonHighEtaAnalyzer::respCorr(), AlCaHcalHBHEMuonProducer::respCorr(), HcalHitSelection::skim(), HcalIsoTrkSimAnalyzer::storeEnergy(), HcalIsoTrkAnalyzer::storeEnergy(), AlCaHcalIsotrkProducer::storeEnergy(), PFRecHitQTestHCALChannel::test(), PFRecHitQTestHCALThresholdVsDepth::test(), and ObjectValidator::validHit().

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 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
virtual std::string myname() const
std::vector< Item > HEcontainer
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
std::vector< Item > HOcontainer
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 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 }
std::vector< Item > HEcontainer
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
std::vector< Item > HOcontainer
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 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