CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
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)
 
const 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
 
void setTopo (const HcalTopology *topo)
 
const HcalTopologytopo () const
 

Private Member Functions

void initContainer (DetId container)
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from HcalCondObjectContainerBase
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 inherited from HcalCondObjectContainerBase
int packedIndexVersion_
 

Detailed Description

template<class Item>
class HcalCondObjectContainer< Item >

Definition at line 33 of file HcalCondObjectContainer.h.

Member Typedef Documentation

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

Definition at line 57 of file HcalCondObjectContainer.h.

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

Definition at line 56 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file HcalCondObjectContainer.h.

HcalCondObjectContainerBase(const HcalTopology *)
template<class Item >
HcalCondObjectContainer< Item >::~HcalCondObjectContainer ( )
virtual

Definition at line 91 of file HcalCondObjectContainer.h.

92 {
93 }

Member Function Documentation

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

Definition at line 182 of file HcalCondObjectContainer.h.

References DetId::Calo, edm::hlt::Exception, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, getHLTprescales::index, NULL, HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, and summarizeEdmComparisonLogfiles::success.

Referenced by HcalPedestalsCheck::analyze(), cms::HcalConstantsASCIIWriter::analyze(), HcalGainsCheck::analyze(), HcalDbOnline::getObject(), HcalPedestalAnalysis::GetPedConst(), HcalPedestalAnalysis::HcalPedVal(), main(), and HcalMonitorClient::writeChannelStatus().

183 {
184  bool success = false;
185  DetId fId(myItem.rawId());
186  unsigned int index=indexFor(fId);
187 
188  Item* cell = NULL;
189 
190  if (index<0xFFFFFFFu) {
191  if (fId.det()==DetId::Hcal) {
192  switch (HcalSubdetector(fId.subdetId())) {
193  case(HcalBarrel) : if (!HBcontainer.size() ) initContainer(fId);
194  if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break;
195  case(HcalEndcap) : if (!HEcontainer.size() ) initContainer(fId);
196  if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break;
197  case(HcalForward) : if (!HFcontainer.size() ) initContainer(fId);
198  if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break;
199  case(HcalOuter) : if (!HOcontainer.size() ) initContainer(fId);
200  if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break;
201  case(HcalTriggerTower) : if (!HTcontainer.size() ) initContainer(fId);
202  if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) ); break;
203  case(HcalOther) : if (extractOther(fId)==HcalCalibration) {
204  if (!CALIBcontainer.size() ) initContainer(fId);
205  if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) );
206  }
207  break;
208  default: break;
209  }
210  } else if (fId.det()==DetId::Calo) {
211  if (fId.subdetId()==HcalCastorDetId::SubdetectorId) {
212  if (!CASTORcontainer.size() ) initContainer(fId);
213  if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) );
214  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
215  if (!ZDCcontainer.size() ) initContainer(fId);
216  if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) );
217  }
218  }
219  }
220 
221  if (cell!=0) {
222  (*cell)=myItem;
223  success=true;
224  }
225 
226  if (!success)
227  throw cms::Exception ("Filling of conditions failed")
228  << " no valid filling possible for Conditions of type " << myname() << " for DetId " << textForId(fId);
229  return success;
230 }
unsigned int indexFor(DetId) const
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
#define NULL
Definition: scimark2.h:8
std::vector< Item > CASTORcontainer
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< Item > ZDCcontainer
static const int SubdetectorId
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
virtual std::string myname() const
std::string textForId(const DetId &id) const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
void initContainer(DetId container)
std::vector< Item > HFcontainer
template<class Item >
const bool HcalCondObjectContainer< Item >::exists ( DetId  fId) const

Definition at line 170 of file HcalCondObjectContainer.h.

Referenced by HcalDbOnline::getObject(), main(), and cms::HitReCalibrator::produce().

171 {
172  const Item* cell = getValues(fId,false);
173 
174  if (cell)
175  if (cell->rawId() == fId )
176  return true;
177 
178  return false;
179 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
template<class Item >
std::vector< DetId > HcalCondObjectContainer< Item >::getAllChannels ( ) const

Definition at line 233 of file HcalCondObjectContainer.h.

References i.

Referenced by HcalQIEDataCheck::analyze(), HcalAutoPedestalValidator::analyze(), HcalPedestalWidthsCheck::analyze(), HcalPedestalsCheck::analyze(), HcalGainsCheck::analyze(), HcalBeamMonitor::beginRun(), HcalDeadCellMonitor::beginRun(), HcalMonitorClient::beginRun(), HcalDigiMonitor::beginRun(), HcalDetDiagLEDMonitor::beginRun(), HcalDetDiagPedestalMonitor::beginRun(), HcalDetDiagLaserMonitor::beginRun(), HcalDbService::buildCalibrations(), HcalDbService::buildCalibWidths(), HcalDbXml::dumpObject(), HcalPedestalAnalysis::HcalPedVal(), main(), CaloTowersCreationAlgo::makeHcalDropChMap(), and HcalMonitorClient::writeChannelStatus().

234 {
235  std::vector<DetId> channels;
236  Item emptyItem;
237  for (unsigned int i=0; i<HBcontainer.size(); i++)
238  {
239  if (emptyItem.rawId() != HBcontainer.at(i).rawId() )
240  channels.push_back( DetId(HBcontainer.at(i).rawId()) );
241  }
242  for (unsigned int i=0; i<HEcontainer.size(); i++)
243  {
244  if (emptyItem.rawId() != HEcontainer.at(i).rawId() )
245  channels.push_back( DetId(HEcontainer.at(i).rawId()) );
246  }
247  for (unsigned int i=0; i<HOcontainer.size(); i++)
248  {
249  if (emptyItem.rawId() != HOcontainer.at(i).rawId() )
250  channels.push_back( DetId(HOcontainer.at(i).rawId()) );
251  }
252  for (unsigned int i=0; i<HFcontainer.size(); i++)
253  {
254  if (emptyItem.rawId() != HFcontainer.at(i).rawId() )
255  channels.push_back( DetId(HFcontainer.at(i).rawId()) );
256  }
257  for (unsigned int i=0; i<HTcontainer.size(); i++)
258  {
259  if (emptyItem.rawId() != HTcontainer.at(i).rawId() )
260  channels.push_back( DetId(HTcontainer.at(i).rawId()) );
261  }
262  for (unsigned int i=0; i<ZDCcontainer.size(); i++)
263  {
264  if (emptyItem.rawId() != ZDCcontainer.at(i).rawId() )
265  channels.push_back( DetId(ZDCcontainer.at(i).rawId()) );
266  }
267  for (unsigned int i=0; i<CALIBcontainer.size(); i++)
268  {
269  if (emptyItem.rawId() != CALIBcontainer.at(i).rawId() )
270  channels.push_back( DetId(CALIBcontainer.at(i).rawId()) );
271  }
272  for (unsigned int i=0; i<CASTORcontainer.size(); i++)
273  {
274  if (emptyItem.rawId() != CASTORcontainer.at(i).rawId() )
275  channels.push_back( DetId(CASTORcontainer.at(i).rawId()) );
276  }
277 
278  return channels;
279 }
int i
Definition: DBlmapReader.cc:9
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
std::vector< Item > ZDCcontainer
Definition: DetId.h:18
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
template<class Item>
const tAllContWithNames HcalCondObjectContainer< Item >::getAllContainers ( ) const
inline

Definition at line 59 of file HcalCondObjectContainer.h.

59  {
60  tAllContWithNames allContainers;
61  allContainers.push_back(tHcalCont("HB",HBcontainer));
62  allContainers.push_back(tHcalCont("HE",HEcontainer));
63  allContainers.push_back(tHcalCont("HO",HOcontainer));
64  allContainers.push_back(tHcalCont("HF",HFcontainer));
65  allContainers.push_back(tHcalCont("HT",HTcontainer));
66  allContainers.push_back(tHcalCont("ZDC",ZDCcontainer));
67  allContainers.push_back(tHcalCont("CALIB",CALIBcontainer));
68  allContainers.push_back(tHcalCont("CASTOR",CASTORcontainer));
69  return allContainers;
70  }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
std::vector< Item > ZDCcontainer
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
std::pair< std::string, std::vector< Item > > tHcalCont
std::vector< tHcalCont > tAllContWithNames
template<class Item >
const Item * HcalCondObjectContainer< Item >::getValues ( DetId  fId,
bool  throwOnFail = true 
) const

Definition at line 123 of file HcalCondObjectContainer.h.

References DetId::Calo, DetId::det(), edm::hlt::Exception, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, getHLTprescales::index, NULL, HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, and DetId::subdetId().

Referenced by HcalAmplifier::addPedestals(), cms::HcalConstantsASCIIWriter::analyze(), HcalBeamMonitor::beginRun(), HcalDeadCellMonitor::beginRun(), HcalMonitorClient::beginRun(), HcalDigiMonitor::beginRun(), HcalDetDiagLEDMonitor::beginRun(), HcalDetDiagPedestalMonitor::beginRun(), HcalDetDiagLaserMonitor::beginRun(), PFHCALDualTimeRecHitProducer::createRecHits(), PFRecHitProducerHCAL::createRecHits(), PFRecHitProducerHO::createRecHits(), HcalDbXml::dumpObject(), reco::HcalNoiseInfoProducer::filldigis(), reco::HcalNoiseInfoProducer::fillrechits(), HcalDbService::getGain(), HcalDbService::getGainWidth(), HcalDbService::getHcalChannelStatus(), HcalDbService::getHcalL1TriggerObject(), HcalDbService::getHcalLUTCorr(), HcalDbService::getHcalPFCorr(), HcalDbService::getHcalRespCorr(), HcalDbService::getHcalTimeCorr(), HcalDbService::getHcalZSThreshold(), HcalDbService::getPedestal(), HcalDbService::getPedestalWidth(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), HcalPedestalAnalysis::HcalPedVal(), HcalRecHitsAnalyzer::hcalSevLvl(), HcalRecHitsValidation::hcalSevLvl(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), MuonHOAcceptance::initIds(), HcalRecHitsMaker::loadHcalRecHits(), main(), CaloTowersCreationAlgo::makeHcalDropChMap(), EgammaHLTHcalIsolation::passCleaning_(), HcalSimpleReconstructor::process(), HcalSimpleReconstructor::processUpgrade(), ZdcSimpleReconstructor::produce(), ZdcHitReconstructor::produce(), cms::HitReCalibrator::produce(), HcalHitReconstructor::produce(), HcalShapes::shape(), HcalPulseShapes::shape(), HcalPulseShapes::shapeForReco(), HcaluLUTTPGCoder::update(), ObjectValidator::validHit(), and HcalMonitorClient::writeChannelStatus().

124 {
125  unsigned int index=indexFor(fId);
126 
127  const Item* cell = NULL;
128 
129  if (index<0xFFFFFFFu) {
130  if (fId.det()==DetId::Hcal) {
131  switch (HcalSubdetector(fId.subdetId())) {
132  case(HcalBarrel) : if (index < HBcontainer.size()) cell = &(HBcontainer.at(index) ); break;
133  case(HcalEndcap) : if (index < HEcontainer.size()) cell = &(HEcontainer.at(index) ); break;
134  case(HcalForward) : if (index < HFcontainer.size()) cell = &(HFcontainer.at(index) ); break;
135  case(HcalOuter) : if (index < HOcontainer.size()) cell = &(HOcontainer.at(index) ); break;
136  case(HcalTriggerTower) : if (index < HTcontainer.size()) cell = &(HTcontainer.at(index) ); break;
137  case(HcalOther) : if (extractOther(fId)==HcalCalibration)
138  if (index < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index) );
139  break;
140  default: break;
141  }
142  } else if (fId.det()==DetId::Calo) {
144  if (index < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index) );
145  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
146  if (index < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index) );
147  }
148  }
149  }
150 
151  // Item emptyItem;
152  // if (cell->rawId() == emptyItem.rawId() )
153  if ((!cell)) {
154  if (throwOnFail) {
155  throw cms::Exception ("Conditions not found")
156  << "Unavailable Conditions of type " << myname() << " for cell " << textForId(fId);
157  }
158  } else if (cell->rawId() != fId) {
159  if (throwOnFail) {
160  throw cms::Exception ("Conditions mismatch")
161  << "Requested conditions of type " << myname() << " for cell " << textForId(fId) << " got conditions for cell " << textForId(DetId(cell->rawId()));
162  }
163  cell=0;
164  }
165 
166  return cell;
167 }
unsigned int indexFor(DetId) const
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
#define NULL
Definition: scimark2.h:8
std::vector< Item > CASTORcontainer
HcalOtherSubdetector extractOther(const DetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< Item > ZDCcontainer
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
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
virtual std::string myname() const
std::string textForId(const DetId &id) const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::vector< Item > HFcontainer
template<class Item >
void HcalCondObjectContainer< Item >::initContainer ( DetId  container)
private

Definition at line 96 of file HcalCondObjectContainer.h.

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

97 {
98  Item emptyItem;
99 
100  if (fId.det()==DetId::Hcal) {
101  switch (HcalSubdetector(fId.subdetId())) {
102  case(HcalBarrel) : for (unsigned int i=0; i<sizeFor(fId); i++) HBcontainer.push_back(emptyItem); break;
103  case(HcalEndcap) : for (unsigned int i=0; i<sizeFor(fId); i++) HEcontainer.push_back(emptyItem); break;
104  case(HcalOuter) : for (unsigned int i=0; i<sizeFor(fId); i++) HOcontainer.push_back(emptyItem); break;
105  case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break;
106  case(HcalTriggerTower) : for (unsigned int i=0; i<sizeFor(fId); i++) HTcontainer.push_back(emptyItem); break;
107  case(HcalOther) : if (extractOther(fId)==HcalCalibration)
108  for (unsigned int i=0; i<sizeFor(fId); i++) CALIBcontainer.push_back(emptyItem); break;
109  break;
110  default: break;
111  }
112  } else if (fId.det()==DetId::Calo) {
113  if (fId.subdetId()==HcalCastorDetId::SubdetectorId) {
114  for (unsigned int i=0; i<sizeFor(fId); i++) CASTORcontainer.push_back(emptyItem);
115  } else if (fId.subdetId()==HcalZDCDetId::SubdetectorId) {
116  for (unsigned int i=0; i<sizeFor(fId); i++) ZDCcontainer.push_back(emptyItem);
117  }
118  }
119 }
int i
Definition: DBlmapReader.cc:9
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
std::vector< Item > CASTORcontainer
HcalOtherSubdetector extractOther(const DetId &id) const
unsigned int sizeFor(DetId) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< Item > ZDCcontainer
static const int SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
template<class Item>
virtual std::string HcalCondObjectContainer< Item >::myname ( ) const
inlinevirtual

Member Data Documentation

template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::CALIBcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::CASTORcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HBcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HEcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HFcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HOcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::HTcontainer
private
template<class Item>
std::vector<Item> HcalCondObjectContainer< Item >::ZDCcontainer
private