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>

Public Types

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

Public Member Functions

bool addValues (const Item &myItem, bool h2mode_=false)
 
const bool exists (DetId fId) const
 
std::vector< DetIdgetAllChannels () const
 
const tAllContWithNames getAllContainers () const
 
const Item * getValues (DetId fId) const
 
 HcalCondObjectContainer ()
 
virtual std::string myname () const
 
virtual ~HcalCondObjectContainer ()
 

Private Member Functions

void initContainer (int container, bool h2mode_=false)
 

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
 

Detailed Description

template<class Item>
class HcalCondObjectContainer< Item >

Definition at line 13 of file HcalCondObjectContainer.h.

Member Typedef Documentation

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

Definition at line 38 of file HcalCondObjectContainer.h.

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

Definition at line 37 of file HcalCondObjectContainer.h.

Constructor & Destructor Documentation

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

Definition at line 70 of file HcalCondObjectContainer.h.

72 {
73 }
template<class Item >
HcalCondObjectContainer< Item >::~HcalCondObjectContainer ( )
virtual

Definition at line 76 of file HcalCondObjectContainer.h.

77 {
78 }

Member Function Documentation

template<class Item>
bool HcalCondObjectContainer< Item >::addValues ( const Item &  myItem,
bool  h2mode_ = false 
)

Definition at line 216 of file HcalCondObjectContainer.h.

References abs, edm::hlt::Exception, HcalGenericDetId::genericSubdet(), HcalGenericDetId::hashedId(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenCastor, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenTriggerTower, HcalGenericDetId::HcalGenZDC, getHLTprescales::index, and summarizeEdmComparisonLogfiles::success.

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

217 {
218  unsigned long myRawId = myItem.rawId();
219  HcalGenericDetId myId(myRawId);
220  int index = myId.hashedId(h2mode_);
221  bool success = false;
222  if (index < 0) success = false;
223  unsigned int index1 = abs(index); // b/c I'm fed up with compiler warnings about comparison betw. signed and unsigned int
224 
225  switch (myId.genericSubdet() ) {
227  if (!HBcontainer.size() ) initContainer(myId.genericSubdet() );
228  if (index1 < HBcontainer.size())
229  {
230  HBcontainer.at(index1) = myItem;
231  success = true;
232  }
233  break;
235  if (!HEcontainer.size() ) initContainer(myId.genericSubdet(), h2mode_ );
236  if (index1 < HEcontainer.size())
237  {
238  HEcontainer.at(index1) = myItem;
239  success = true;
240  }
241  break;
243  if (!HOcontainer.size() ) initContainer(myId.genericSubdet() );
244  if (index1 < HOcontainer.size())
245  {
246  HOcontainer.at(index1) = myItem;
247  success = true;
248  }
249  break;
251  if (!HFcontainer.size() ) initContainer(myId.genericSubdet() );
252  if (index1 < HFcontainer.size())
253  {
254  HFcontainer.at(index1) = myItem;
255  success = true;
256  }
257  break;
259  if (!HTcontainer.size() ) initContainer(myId.genericSubdet() );
260  if (index1 < HTcontainer.size())
261  {
262  HTcontainer.at(index1) = myItem;
263  success = true;
264  }
265  break;
267  if (!ZDCcontainer.size() ) initContainer(myId.genericSubdet() );
268  if (index1 < ZDCcontainer.size())
269  {
270  ZDCcontainer.at(index1) = myItem;
271  success = true;
272  }
273  break;
275  if (!CASTORcontainer.size() ) initContainer(myId.genericSubdet() );
276  if (index1 < CASTORcontainer.size())
277  {
278  CASTORcontainer.at(index1) = myItem;
279  success = true;
280  }
281  break;
283  if (!CALIBcontainer.size() ) initContainer(myId.genericSubdet() );
284  if (index1 < CALIBcontainer.size())
285  {
286  CALIBcontainer.at(index1) = myItem;
287  success = true;
288  }
289  break;
290  default: break;
291  }
292 
293  if (!success)
294  throw cms::Exception ("Filling of conditions failed")
295  << " no valid filling possible for Conditions of type " << myname() << " for DetId " << myId;
296  return success;
297 }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< Item > CASTORcontainer
void initContainer(int container, bool h2mode_=false)
std::vector< Item > ZDCcontainer
virtual std::string myname() const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
template<class Item >
const bool HcalCondObjectContainer< Item >::exists ( DetId  fId) const

Definition at line 169 of file HcalCondObjectContainer.h.

References abs, HcalGenericDetId::genericSubdet(), HcalGenericDetId::hashedId(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenCastor, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenTriggerTower, HcalGenericDetId::HcalGenZDC, HcalGenericDetId::HEhalfh2mode, getHLTprescales::index, and NULL.

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

170 {
171  HcalGenericDetId myId(fId);
172  bool h2mode_ = (HEcontainer.size()==(2*HcalGenericDetId::HEhalfh2mode));
173 
174  int index = myId.hashedId(h2mode_);
175  if (index < 0) return false;
176  unsigned int index1 = abs(index); // b/c I'm fed up with compiler warnings about comparison betw. signed and unsigned int
177  const Item* cell = NULL;
178  switch (myId.genericSubdet() ) {
180  if (index1 < HBcontainer.size()) cell = &(HBcontainer.at(index1) );
181  break;
183  if (index1 < HEcontainer.size()) cell = &(HEcontainer.at(index1) );
184  break;
186  if (index1 < HOcontainer.size()) cell = &(HOcontainer.at(index1) );
187  break;
189  if (index1 < HFcontainer.size()) cell = &(HFcontainer.at(index1) );
190  break;
192  if (index1 < HTcontainer.size()) cell = &(HTcontainer.at(index1) );
193  break;
195  if (index1 < ZDCcontainer.size()) cell = &(ZDCcontainer.at(index1) );
196  break;
198  if (index1 < CASTORcontainer.size()) cell = &(CASTORcontainer.at(index1) );
199  break;
201  if (index1 < CALIBcontainer.size()) cell = &(CALIBcontainer.at(index1) );
202  break;
203  default: return false; break;
204  }
205 
206  // Item emptyItem;
207  if (cell)
208  // if (cell->rawId() != emptyItem.rawId() )
209  if (cell->rawId() == fId )
210  return true;
211 
212  return false;
213 }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
#define abs(x)
Definition: mlp_lapack.h:159
#define NULL
Definition: scimark2.h:8
std::vector< Item > CASTORcontainer
std::vector< Item > ZDCcontainer
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
template<class Item >
std::vector< DetId > HcalCondObjectContainer< Item >::getAllChannels ( ) const

Definition at line 300 of file HcalCondObjectContainer.h.

References i.

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

301 {
302  std::vector<DetId> channels;
303  Item emptyItem;
304  for (unsigned int i=0; i<HBcontainer.size(); i++)
305  {
306  if (emptyItem.rawId() != HBcontainer.at(i).rawId() )
307  channels.push_back( DetId(HBcontainer.at(i).rawId()) );
308  }
309  for (unsigned int i=0; i<HEcontainer.size(); i++)
310  {
311  if (emptyItem.rawId() != HEcontainer.at(i).rawId() )
312  channels.push_back( DetId(HEcontainer.at(i).rawId()) );
313  }
314  for (unsigned int i=0; i<HOcontainer.size(); i++)
315  {
316  if (emptyItem.rawId() != HOcontainer.at(i).rawId() )
317  channels.push_back( DetId(HOcontainer.at(i).rawId()) );
318  }
319  for (unsigned int i=0; i<HFcontainer.size(); i++)
320  {
321  if (emptyItem.rawId() != HFcontainer.at(i).rawId() )
322  channels.push_back( DetId(HFcontainer.at(i).rawId()) );
323  }
324  for (unsigned int i=0; i<HTcontainer.size(); i++)
325  {
326  if (emptyItem.rawId() != HTcontainer.at(i).rawId() )
327  channels.push_back( DetId(HTcontainer.at(i).rawId()) );
328  }
329  for (unsigned int i=0; i<ZDCcontainer.size(); i++)
330  {
331  if (emptyItem.rawId() != ZDCcontainer.at(i).rawId() )
332  channels.push_back( DetId(ZDCcontainer.at(i).rawId()) );
333  }
334  for (unsigned int i=0; i<CALIBcontainer.size(); i++)
335  {
336  if (emptyItem.rawId() != CALIBcontainer.at(i).rawId() )
337  channels.push_back( DetId(CALIBcontainer.at(i).rawId()) );
338  }
339  for (unsigned int i=0; i<CASTORcontainer.size(); i++)
340  {
341  if (emptyItem.rawId() != CASTORcontainer.at(i).rawId() )
342  channels.push_back( DetId(CASTORcontainer.at(i).rawId()) );
343  }
344 
345  return channels;
346 }
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:20
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 40 of file HcalCondObjectContainer.h.

40  {
41  tAllContWithNames allContainers;
42  allContainers.push_back(tHcalCont("HB",HBcontainer));
43  allContainers.push_back(tHcalCont("HE",HEcontainer));
44  allContainers.push_back(tHcalCont("HO",HOcontainer));
45  allContainers.push_back(tHcalCont("HF",HFcontainer));
46  allContainers.push_back(tHcalCont("HT",HTcontainer));
47  allContainers.push_back(tHcalCont("ZDC",ZDCcontainer));
48  allContainers.push_back(tHcalCont("CALIB",CALIBcontainer));
49  allContainers.push_back(tHcalCont("CASTOR",CASTORcontainer));
50  return allContainers;
51  }
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) const

Definition at line 113 of file HcalCondObjectContainer.h.

References abs, edm::hlt::Exception, HcalGenericDetId::genericSubdet(), HcalGenericDetId::hashedId(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenCastor, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenTriggerTower, HcalGenericDetId::HcalGenZDC, HcalGenericDetId::HEhalfh2mode, getHLTprescales::index, and NULL.

Referenced by HcalAmplifier::addPedestals(), cms::HcalConstantsASCIIWriter::analyze(), HcalBeamMonitor::beginRun(), HcalDetDiagLEDMonitor::beginRun(), HcalDeadCellMonitor::beginRun(), HcalMonitorClient::beginRun(), HcalDigiMonitor::beginRun(), HcalDetDiagPedestalMonitor::beginRun(), HcalDetDiagLaserMonitor::beginRun(), PFRecHitProducerHCAL::createRecHits(), PFRecHitProducerHO::createRecHits(), HcalCondXML::dumpObject(), 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(), ZdcSimpleReconstructor::produce(), ZdcHitReconstructor::produce(), cms::HitReCalibrator::produce(), HcalHitReconstructor::produce(), HcalShapes::shape(), HcalPulseShapes::shape(), HcalPulseShapes::shapeForReco(), HcaluLUTTPGCoder::update(), ObjectValidator::validHit(), and HcalMonitorClient::writeChannelStatus().

114 {
115  HcalGenericDetId myId(fId);
116  bool h2mode_ = (HEcontainer.size()==(2*HcalGenericDetId::HEhalfh2mode));
117 
118  int index = myId.hashedId(h2mode_);
119  // std::cout << "::::: getting values at index " << index << ", DetId " << myId << std::endl;
120  unsigned int index1 = abs(index); // b/c I'm fed up with compiler warnings about comparison betw. signed and unsigned int
121 
122  const Item* cell = NULL;
123  if (index >= 0)
124  switch (myId.genericSubdet() ) {
126  if (index1 < HBcontainer.size())
127  cell = &(HBcontainer.at(index1) );
128  break;
130  if (index1 < HEcontainer.size())
131  cell = &(HEcontainer.at(index1) );
132  break;
134  if (index1 < HOcontainer.size())
135  cell = &(HOcontainer.at(index1) );
136  break;
138  if (index1 < HFcontainer.size())
139  cell = &(HFcontainer.at(index1) );
140  break;
142  if (index1 < HTcontainer.size())
143  cell = &(HTcontainer.at(index1) );
144  break;
146  if (index1 < ZDCcontainer.size())
147  cell = &(ZDCcontainer.at(index1) );
148  break;
150  if (index1 < CASTORcontainer.size())
151  cell = &(CASTORcontainer.at(index1) );
152  break;
154  if (index1 < CALIBcontainer.size())
155  cell = &(CALIBcontainer.at(index1) );
156  break;
157  default: break;
158  }
159 
160  // Item emptyItem;
161  // if (cell->rawId() == emptyItem.rawId() )
162  if ((!cell) || (cell->rawId() != fId ) )
163  throw cms::Exception ("Conditions not found")
164  << "Unavailable Conditions of type " << myname() << " for cell " << myId;
165  return cell;
166 }
std::vector< Item > HEcontainer
std::vector< Item > HBcontainer
#define abs(x)
Definition: mlp_lapack.h:159
#define NULL
Definition: scimark2.h:8
std::vector< Item > CASTORcontainer
std::vector< Item > ZDCcontainer
virtual std::string myname() const
std::vector< Item > HTcontainer
std::vector< Item > HOcontainer
std::vector< Item > CALIBcontainer
std::vector< Item > HFcontainer
template<class Item >
void HcalCondObjectContainer< Item >::initContainer ( int  container,
bool  h2mode_ = false 
)
private

Definition at line 81 of file HcalCondObjectContainer.h.

References HcalGenericDetId::CALIBhalf, HcalGenericDetId::CASTORhalf, HcalGenericDetId::HBhalf, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenCastor, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenTriggerTower, HcalGenericDetId::HcalGenZDC, HcalGenericDetId::HEhalf, HcalGenericDetId::HEhalfh2mode, HcalGenericDetId::HFhalf, HcalGenericDetId::HOhalf, HcalGenericDetId::HThalf, i, and HcalGenericDetId::ZDChalf.

82 {
83  // if (!m_h2mode) m_h2mode = h2mode_;
84 
85  Item emptyItem;
86 
87  switch (container)
88  {
90  for (int i=0; i<(2*HcalGenericDetId::HBhalf); i++) HBcontainer.push_back(emptyItem); break;
92  if (!h2mode_) for (int i=0; i<(2*HcalGenericDetId::HEhalf); i++) HEcontainer.push_back(emptyItem);
93  else for (int i=0; i<(2*HcalGenericDetId::HEhalfh2mode); i++) HEcontainer.push_back(emptyItem);
94  break;
96  for (int i=0; i<(2*HcalGenericDetId::HOhalf); i++) HOcontainer.push_back(emptyItem); break;
98  for (int i=0; i<(2*HcalGenericDetId::HFhalf); i++) HFcontainer.push_back(emptyItem); break;
100  for (int i=0; i<(2*HcalGenericDetId::HThalf); i++) HTcontainer.push_back(emptyItem); break;
102  for (int i=0; i<(2*HcalGenericDetId::ZDChalf); i++) ZDCcontainer.push_back(emptyItem); break;
104  for (int i=0; i<(2*HcalGenericDetId::CALIBhalf); i++) CALIBcontainer.push_back(emptyItem); break;
106  for (int i=0; i<(2*HcalGenericDetId::CASTORhalf); i++) CASTORcontainer.push_back(emptyItem); break;
107  default: break;
108  }
109 }
int i
Definition: DBlmapReader.cc:9
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
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