CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ecaldqm::MESetEcal Class Reference

#include <MESetEcal.h>

Inheritance diagram for ecaldqm::MESetEcal:
ecaldqm::MESet ecaldqm::MESetDet0D ecaldqm::MESetDet1D ecaldqm::MESetDet2D ecaldqm::MESetTrend

Public Member Functions

void book ()
 
void fill (DetId const &, double _wx=1., double _wy=1., double _w=1.)
 
void fill (unsigned, double _wx=1., double _wy=1., double _w=1.)
 
void fill (double, double _wy=1., double _w=1.)
 
std::vector< std::string > generateNames () const
 
double getBinContent (DetId const &, int _bin=0) const
 
double getBinContent (unsigned, int _bin=0) const
 
double getBinEntries (DetId const &, int _bin=0) const
 
double getBinEntries (unsigned, int _bin=0) const
 
double getBinError (DetId const &, int _bin=0) const
 
double getBinError (unsigned, int _bin=0) const
 
 MESetEcal (std::string const &, MEData const &, int logicalDimensions_, bool _readOnly=false)
 
void reset (double _content=0., double _err=0., double _entries=0.)
 
bool retrieve () const
 
void setBinContent (DetId const &, double, double _err=0.)
 
void setBinContent (unsigned, double, double _err=0.)
 
void setBinEntries (DetId const &, double)
 
void setBinEntries (unsigned, double)
 
 ~MESetEcal ()
 
- Public Member Functions inherited from ecaldqm::MESet
virtual void clear () const
 
virtual void fill (EcalElectronicsId const &, double _wx=1., double _wy=1., double _w=1.)
 
virtual double getBinContent (EcalElectronicsId const &, int _bin=0) const
 
virtual double getBinEntries (EcalElectronicsId const &, int _bin=0) const
 
virtual double getBinError (EcalElectronicsId const &, int _bin=0) const
 
BinService::BinningType getBinType () const
 
std::string const & getDir () const
 
virtual MonitorElement const * getME (unsigned _offset) const
 
std::string const & getName () const
 
BinService::ObjectType getObjType () const
 
bool isActive () const
 
 MESet (std::string const &, MEData const &, bool _readOnly=false)
 
void name (std::map< std::string, std::string > const &) const
 
virtual void resetAll (double _content=0., double _err=0., double _entries=0.)
 
virtual void setAxisTitle (std::string const &, int _axis=1)
 
virtual void setBinContent (EcalElectronicsId const &, double, double _err=0.)
 
virtual void setBinEntries (EcalElectronicsId const &, double)
 
virtual void setBinLabel (unsigned, int, std::string const &, int _axis=1)
 
void setDir (std::string const &_dir)
 
void setName (std::string const &_name)
 
virtual ~MESet ()
 

Protected Member Functions

virtual void fill_ (double)
 
virtual void find_ (uint32_t) const
 
- Protected Member Functions inherited from ecaldqm::MESet
virtual void fill_ (unsigned, int, double)
 
virtual void fill_ (unsigned, double, double, double)
 
virtual double getBinContent_ (unsigned, int) const
 
virtual double getBinEntries_ (unsigned, int) const
 
virtual double getBinError_ (unsigned, int) const
 
virtual void setBinContent_ (unsigned, int, double, double)
 
virtual void setBinEntries_ (unsigned, int, double)
 

Protected Attributes

std::pair< unsigned,
std::vector< int > > 
cache_
 
uint32_t cacheId_
 
const unsigned logicalDimensions_
 
- Protected Attributes inherited from ecaldqm::MESet
bool active_
 
MEData const * data_
 
std::string dir_
 
std::vector< MonitorElement * > mes_
 
std::string name_
 
bool readOnly_
 

Additional Inherited Members

- Static Protected Attributes inherited from ecaldqm::MESet
static BinService const * binService_
 
static DQMStoredqmStore_
 

Detailed Description

Definition at line 9 of file MESetEcal.h.

Constructor & Destructor Documentation

ecaldqm::MESetEcal::MESetEcal ( std::string const &  _fullpath,
MEData const &  _data,
int  logicalDimensions_,
bool  _readOnly = false 
)

Definition at line 12 of file MESetEcal.cc.

References ecaldqm::MEData::btype, ecaldqm::MESet::data_, edm::hlt::Exception, EcalDQMBinningService::kUser, logicalDimensions_, ecaldqm::MEData::xaxis, and ecaldqm::MEData::yaxis.

12  :
13  MESet(_fullpath, _data, _readOnly),
14  logicalDimensions_(_logicalDimensions),
15  cacheId_(0),
16  cache_(std::make_pair(-1, std::vector<int>(0)))
17  {
19  throw cms::Exception("InvalidCall") << "Need axis specifications" << std::endl;
20  }
const unsigned logicalDimensions_
Definition: MESetEcal.h:45
uint32_t cacheId_
Definition: MESetEcal.h:47
BinService::AxisSpecs * yaxis
Definition: MESet.h:26
BinService::AxisSpecs * xaxis
Definition: MESet.h:25
BinService::BinningType btype
Definition: MESet.h:23
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
MESet(std::string const &, MEData const &, bool _readOnly=false)
Definition: MESet.cc:16
MEData const * data_
Definition: MESet.h:133
ecaldqm::MESetEcal::~MESetEcal ( )

Definition at line 22 of file MESetEcal.cc.

23  {
24  }

Member Function Documentation

void ecaldqm::MESetEcal::book ( )
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 27 of file MESetEcal.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::binService_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), ecaldqm::MEData::btype, EcalDQMBinningService::channelName(), ecaldqm::MESet::clear(), ecaldqm::MESet::data_, ecaldqm::MESet::dir_, MonitorElement::DQM_KIND_REAL, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::dqmStore_, prof2calltree::edges, EcalDQMBinningService::AxisSpecs::edges, edm::hlt::Exception, generateNames(), EcalDQMBinningService::getBinning(), MonitorElement::getNbinsX(), MonitorElement::getTH1(), EcalDQMBinningService::AxisSpecs::high, i, EcalDQMBinningService::kDCC, EcalDQMBinningService::kEB, ecaldqm::kEBmLow, EcalDQMBinningService::kEE, EcalDQMBinningService::kEEm, EcalDQMBinningService::kEEp, ecaldqm::MEData::kind, EcalDQMBinningService::kReport, logicalDimensions_, EcalDQMBinningService::AxisSpecs::low, max(), ecaldqm::MESet::mes_, ecaldqm::MESet::name_, EcalDQMBinningService::AxisSpecs::nbins, pileupCalc::nbins, EcalDQMBinningService::objectFromOffset(), ecaldqm::MEData::otype, ecaldqm::MESet::resetAll(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), EcalDQMBinningService::AxisSpecs::title, ecaldqm::MEData::xaxis, ecaldqm::MEData::yaxis, and ecaldqm::MEData::zaxis.

Referenced by ecaldqm::MESetTrend::book().

28  {
29  using namespace std;
30 
31  clear();
32 
34 
35  if(data_->btype == BinService::kReport && name_ == "")
36  name_ = dir_.substr(0, dir_.find_first_of('/'));
37 
38  std::vector<std::string> meNames(generateNames());
39 
40  for(unsigned iME(0); iME < meNames.size(); iME++){
41  unsigned iObj(iME);
42 
44 
45  BinService::AxisSpecs xaxis, yaxis, zaxis;
46 
47  if(logicalDimensions_ > 0){
48  if(data_->xaxis){
49  xaxis = *data_->xaxis;
50  }
51  else{ // uses preset
52  bool isMap(logicalDimensions_ > 1);
53  vector<BinService::AxisSpecs> presetAxes(binService_->getBinning(actualObject, data_->btype, isMap, iObj));
54  if(presetAxes.size() != logicalDimensions_)
55  throw cms::Exception("InvalidCall") << "Dimensionality mismatch " << data_->otype << " " << data_->btype << " " << iObj << std::endl;
56 
57  xaxis = presetAxes[0];
58  if(isMap) yaxis = presetAxes[1];
59  }
60 
61  if(data_->yaxis){
62  yaxis = *data_->yaxis;
63  }
64  if(logicalDimensions_ == 1 && yaxis.high - yaxis.low < 0.0001){
67  }
68 
69  if(data_->zaxis){
70  zaxis = *data_->zaxis;
71  }
72  if(logicalDimensions_ > 1 && zaxis.high - zaxis.low < 0.0001){
75  }
76  }
77 
78  MonitorElement* me(0);
79 
80  switch(data_->kind) {
82  me = dqmStore_->bookFloat(meNames[iME]);
83 
84  break;
85 
87  if(xaxis.edges){
88  float* edges(new float[xaxis.nbins + 1]);
89  for(int i(0); i < xaxis.nbins + 1; i++)
90  edges[i] = xaxis.edges[i];
91  me = dqmStore_->book1D(meNames[iME], meNames[iME], xaxis.nbins, edges);
92  delete [] edges;
93  }
94  else
95  me = dqmStore_->book1D(meNames[iME], meNames[iME], xaxis.nbins, xaxis.low, xaxis.high);
96 
97  break;
98 
100  if(xaxis.edges) {
101  me = dqmStore_->bookProfile(meNames[iME], meNames[iME], xaxis.nbins, xaxis.edges, yaxis.low, yaxis.high, "");
102  }
103  else
104  me = dqmStore_->bookProfile(meNames[iME], meNames[iME], xaxis.nbins, xaxis.low, xaxis.high, yaxis.low, yaxis.high, "");
105 
106  break;
107 
109  if(xaxis.edges || yaxis.edges) {
110  BinService::AxisSpecs* specs[] = {&xaxis, &yaxis};
111  float* edges[] = {new float[xaxis.nbins + 1], new float[yaxis.nbins + 1]};
112  for(int iSpec(0); iSpec < 2; iSpec++){
113  if(specs[iSpec]->edges){
114  for(int i(0); i < specs[iSpec]->nbins + 1; i++)
115  edges[iSpec][i] = specs[iSpec]->edges[i];
116  }
117  else{
118  int nbins(specs[iSpec]->nbins);
119  double low(specs[iSpec]->low), high(specs[iSpec]->high);
120  for(int i(0); i < nbins + 1; i++)
121  edges[iSpec][i] = low + (high - low) / nbins * i;
122  }
123  }
124  me = dqmStore_->book2D(meNames[iME], meNames[iME], xaxis.nbins, edges[0], yaxis.nbins, edges[1]);
125  for(int iSpec(0); iSpec < 2; iSpec++)
126  delete [] edges[iSpec];
127  }
128  else
129  me = dqmStore_->book2D(meNames[iME], meNames[iME], xaxis.nbins, xaxis.low, xaxis.high, yaxis.nbins, yaxis.low, yaxis.high);
130 
131  break;
132 
134  if(zaxis.edges) {
135  zaxis.low = zaxis.edges[0];
136  zaxis.high = zaxis.edges[zaxis.nbins];
137  }
138  if(xaxis.edges || yaxis.edges)
139  throw cms::Exception("InvalidCall") << "Variable bin size for 2D profile not implemented" << std::endl;
140  me = dqmStore_->bookProfile2D(meNames[iME], meNames[iME], xaxis.nbins, xaxis.low, xaxis.high, yaxis.nbins, yaxis.low, yaxis.high, zaxis.low, zaxis.high, "");
141 
142  break;
143 
144  default :
145  break;
146  }
147 
148  if(!me)
149  throw cms::Exception("InvalidCall") << "ME could not be booked" << std::endl;
150 
151  if(logicalDimensions_ > 0){
152  me->setAxisTitle(xaxis.title, 1);
153  me->setAxisTitle(yaxis.title, 2);
154  // For plot tagging in RenderPlugin; default values are 1 for both
155  me->getTH1()->SetMarkerStyle(actualObject + 2);
156  me->getTH1()->SetMarkerStyle(data_->btype + 2);
157  }
158 
160  if(actualObject == BinService::kEB){
161  for(int iBin(1); iBin <= me->getNbinsX(); iBin++)
162  me->setBinLabel(iBin, binService_->channelName(iBin + kEBmLow));
163  }
164  else if(actualObject == BinService::kEE){
165  for(int iBin(1); iBin <= me->getNbinsX() / 2; iBin++){
166  unsigned dccid((iBin + 2) % 9 + 1);
167  me->setBinLabel(iBin, binService_->channelName(dccid));
168  }
169  for(int iBin(1); iBin <= me->getNbinsX() / 2; iBin++){
170  unsigned dccid((iBin + 2) % 9 + 46);
171  me->setBinLabel(iBin + me->getNbinsX() / 2, binService_->channelName(dccid));
172  }
173  }
174  else if(actualObject == BinService::kEEm){
175  for(int iBin(1); iBin <= me->getNbinsX(); iBin++){
176  unsigned dccid((iBin + 2) % 9 + 1);
177  me->setBinLabel(iBin, binService_->channelName(dccid));
178  }
179  }
180  else if(actualObject == BinService::kEEp){
181  for(int iBin(1); iBin <= me->getNbinsX(); iBin++){
182  unsigned dccid((iBin + 2) % 9 + 46);
183  me->setBinLabel(iBin, binService_->channelName(dccid));
184  }
185  }
186  }
187 
188  mes_.push_back(me);
189  }
190 
191  // To avoid the ambiguity between "content == 0 because the mean is 0" and "content == 0 because the entry is 0"
192  // RenderPlugin must be configured accordingly
195 
196  active_ = true;
197  }
const unsigned logicalDimensions_
Definition: MESetEcal.h:45
int i
Definition: DBlmapReader.cc:9
std::string channelName(uint32_t, BinningType _btype=kDCC) const
BinService::ObjectType otype
Definition: MESet.h:22
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
virtual void clear() const
Definition: MESet.cc:59
std::vector< std::string > generateNames() const
Definition: MESetEcal.cc:402
BinService::AxisSpecs * yaxis
Definition: MESet.h:26
MonitorElement::Kind kind
Definition: MESet.h:24
std::vector< AxisSpecs > getBinning(ObjectType, BinningType, bool _isMap=true, unsigned _objOffset=0) const
dictionary edges
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
ObjectType objectFromOffset(ObjectType, unsigned) const
BinService::AxisSpecs * xaxis
Definition: MESet.h:25
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
static DQMStore * dqmStore_
Definition: MESet.h:127
const T & max(const T &a, const T &b)
std::string dir_
Definition: MESet.h:131
BinService::BinningType btype
Definition: MESet.h:23
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
std::string name_
Definition: MESet.h:132
static BinService const * binService_
Definition: MESet.h:126
BinService::AxisSpecs * zaxis
Definition: MESet.h:27
bool active_
Definition: MESet.h:135
MEData const * data_
Definition: MESet.h:133
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
virtual void resetAll(double _content=0., double _err=0., double _entries=0.)
Definition: MESet.cc:93
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1330
void ecaldqm::MESetEcal::fill ( DetId const &  _id,
double  _wx = 1.,
double  _wy = 1.,
double  _w = 1. 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 221 of file MESetEcal.cc.

References ecaldqm::MESet::binService_, ecaldqm::MESet::data_, ecaldqm::MESet::fill_(), EcalDQMBinningService::findOffset(), ecaldqm::MESet::mes_, evf::evtn::offset(), and ecaldqm::MEData::otype.

222  {
223  unsigned offset(binService_->findOffset(data_->otype, _id));
224  if(offset >= mes_.size() || !mes_[offset])
225  throw cms::Exception("InvalidCall") << "ME array index overflow" << std::endl;
226 
227  MESet::fill_(offset, _x, _wy, _w);
228  }
BinService::ObjectType otype
Definition: MESet.h:22
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findOffset(ObjectType, const DetId &) const
unsigned int offset(bool)
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:262
static BinService const * binService_
Definition: MESet.h:126
MEData const * data_
Definition: MESet.h:133
void ecaldqm::MESetEcal::fill ( unsigned  _dcctccid,
double  _wx = 1.,
double  _wy = 1.,
double  _w = 1. 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 231 of file MESetEcal.cc.

References ecaldqm::MESet::binService_, ecaldqm::MEData::btype, ecaldqm::MESet::data_, ecaldqm::MESet::fill_(), EcalDQMBinningService::findOffset(), ecaldqm::MESet::mes_, evf::evtn::offset(), and ecaldqm::MEData::otype.

232  {
233  unsigned offset(binService_->findOffset(data_->otype, data_->btype, _dcctccid));
234 
235  if(offset >= mes_.size() || !mes_[offset])
236  throw cms::Exception("InvalidCall") << "ME array index overflow" << offset << std::endl;
237 
238  MESet::fill_(offset, _x, _wy, _w);
239  }
BinService::ObjectType otype
Definition: MESet.h:22
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findOffset(ObjectType, const DetId &) const
BinService::BinningType btype
Definition: MESet.h:23
unsigned int offset(bool)
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:262
static BinService const * binService_
Definition: MESet.h:126
MEData const * data_
Definition: MESet.h:133
void ecaldqm::MESetEcal::fill ( double  _x,
double  _wy = 1.,
double  _w = 1. 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 242 of file MESetEcal.cc.

References ecaldqm::MESet::fill_(), and ecaldqm::MESet::mes_.

243  {
244  if(mes_.size() != 1)
245  throw cms::Exception("InvalidCall") << "MESet type incompatible" << std::endl;
246 
247  MESet::fill_(0, _x, _wy, _w);
248  }
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:262
void ecaldqm::MESetEcal::fill_ ( double  _w)
protectedvirtual

Definition at line 491 of file MESetEcal.cc.

References cache_, and ecaldqm::MESet::fill_().

Referenced by ecaldqm::MESetDet2D::fill(), and ecaldqm::MESetDet1D::fill_().

492  {
493  for(unsigned iBin(0); iBin < cache_.second.size(); iBin++)
494  MESet::fill_(cache_.first, cache_.second[iBin], _w);
495  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:262
void ecaldqm::MESetEcal::find_ ( uint32_t  _id) const
protectedvirtual

Reimplemented in ecaldqm::MESetDet1D.

Definition at line 470 of file MESetEcal.cc.

References ecaldqm::MESet::binService_, ecaldqm::MEData::btype, cache_, cacheId_, ecaldqm::MESet::data_, DetId::Ecal, EcalDQMBinningService::findBins(), ecaldqm::MESet::mes_, and ecaldqm::MEData::otype.

Referenced by ecaldqm::MESetDet2D::fill(), getBinContent(), getBinEntries(), getBinError(), setBinContent(), and setBinEntries().

471  {
472  if(_id == cacheId_) return;
473 
474  DetId id(_id);
475  if(id.det() == DetId::Ecal)
477  else
478  cache_ = binService_->findBins(data_->otype, data_->btype, unsigned(_id));
479 
480  if(cache_.first >= mes_.size() || !mes_[cache_.first])
481  throw cms::Exception("InvalidCall") << "ME array index overflow" << std::endl;
482 
483  // some TTs are apparently empty..!
484 // if(cache_.second.size() == 0)
485 // throw cms::Exception("InvalidCall") << "No bins to get content from" << std::endl;
486 
487  cacheId_ = _id;
488  }
BinService::ObjectType otype
Definition: MESet.h:22
uint32_t cacheId_
Definition: MESetEcal.h:47
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
BinService::BinningType btype
Definition: MESet.h:23
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
Definition: DetId.h:18
static BinService const * binService_
Definition: MESet.h:126
std::pair< unsigned, std::vector< int > > findBins(ObjectType, BinningType, const DetId &) const
MEData const * data_
Definition: MESet.h:133
std::vector< std::string > ecaldqm::MESetEcal::generateNames ( ) const

Definition at line 402 of file MESetEcal.cc.

References ecaldqm::MESet::binService_, ecaldqm::MEData::btype, EcalDQMBinningService::channelName(), ecaldqm::MESet::data_, ecaldqm::dccId(), EcalDQMBinningService::kEB, EcalDQMBinningService::kEBMEM, EcalDQMBinningService::kEcal2P, EcalDQMBinningService::kEcal3P, EcalDQMBinningService::kEcalMEM2P, EcalDQMBinningService::kEE, EcalDQMBinningService::kEEm, EcalDQMBinningService::kEEMEM, EcalDQMBinningService::kEEp, EcalDQMBinningService::kProjEta, EcalDQMBinningService::kProjPhi, EcalDQMBinningService::kReport, EcalDQMBinningService::kSM, EcalDQMBinningService::kSMMEM, ecaldqm::MESet::name(), ecaldqm::MESet::name_, cscdqm::h::names, EcalDQMBinningService::nDCC, EcalDQMBinningService::nDCCMEM, EcalDQMBinningService::objectFromOffset(), and ecaldqm::MEData::otype.

Referenced by book(), and retrieve().

403  {
404  using namespace std;
405 
406  unsigned nME(1);
407  switch(data_->otype){
408  case BinService::kSM:
409  nME = BinService::nDCC;
410  break;
411  case BinService::kSMMEM:
412  nME = BinService::nDCCMEM;
413  break;
414  case BinService::kEcal2P:
415  nME = 2;
416  break;
417  case BinService::kEcal3P:
418  nME = 3;
419  break;
421  nME = 2;
422  break;
423  default:
424  break;
425  }
426 
427  std::vector<std::string> names(0);
428 
429  for(unsigned iME(0); iME < nME; iME++) {
430 
431  unsigned iObj(iME);
432 
434 
435  string name(name_);
436  string spacer(" ");
437 
438  if(data_->btype == BinService::kProjEta) name += " eta";
439  else if(data_->btype == BinService::kProjPhi) name += " phi";
440  else if(data_->btype == BinService::kReport) spacer = "_";
441 
442  switch(actualObject){
443  case BinService::kEB:
444  case BinService::kEBMEM:
445  name += spacer + "EB"; break;
446  case BinService::kEE:
447  case BinService::kEEMEM:
448  name += spacer + "EE"; break;
449  case BinService::kEEm:
450  name += spacer + "EE-"; break;
451  case BinService::kEEp:
452  name += spacer + "EE+"; break;
453  case BinService::kSM:
454  name += spacer + binService_->channelName(iObj + 1); break;
455  case BinService::kSMMEM:
456  //dccId(unsigned) skips DCCs without MEM
457  iObj = dccId(iME) - 1;
458  name += spacer + binService_->channelName(iObj + 1); break;
459  default:
460  break;
461  }
462 
463  names.push_back(name);
464  }
465 
466  return names;
467  }
std::string channelName(uint32_t, BinningType _btype=kDCC) const
BinService::ObjectType otype
Definition: MESet.h:22
static const HistoName names[]
unsigned dccId(const DetId &)
ObjectType objectFromOffset(ObjectType, unsigned) const
BinService::BinningType btype
Definition: MESet.h:23
std::string name_
Definition: MESet.h:132
static BinService const * binService_
Definition: MESet.h:126
MEData const * data_
Definition: MESet.h:133
void name(std::map< std::string, std::string > const &) const
Definition: MESet.cc:240
double ecaldqm::MESetEcal::getBinContent ( DetId const &  _id,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 291 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinContent_().

292  {
293  find_(_id);
294 
295  if(cache_.second.size() == 0) return 0.;
296 
297  return getBinContent_(cache_.first, cache_.second[0]);
298  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinContent_(unsigned, int) const
Definition: MESet.cc:330
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
double ecaldqm::MESetEcal::getBinContent ( unsigned  _dcctccid,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 301 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinContent_().

302  {
303  find_(_dcctccid);
304 
305  if(cache_.second.size() == 0) return 0.;
306 
307  return getBinContent_(cache_.first, cache_.second[0]);
308  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinContent_(unsigned, int) const
Definition: MESet.cc:330
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
double ecaldqm::MESetEcal::getBinEntries ( DetId const &  _id,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 331 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinEntries_().

Referenced by ecaldqm::MESetDet2D::fill().

332  {
333  find_(_id);
334 
335  if(cache_.second.size() == 0) return 0.;
336 
337  return getBinEntries_(cache_.first, cache_.second[0]);
338  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinEntries_(unsigned, int) const
Definition: MESet.cc:362
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
double ecaldqm::MESetEcal::getBinEntries ( unsigned  _dcctccid,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 341 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinEntries_().

342  {
343  find_(_dcctccid);
344 
345  if(cache_.second.size() == 0) return 0.;
346 
347  return getBinEntries_(cache_.first, cache_.second[0]);
348  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinEntries_(unsigned, int) const
Definition: MESet.cc:362
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
double ecaldqm::MESetEcal::getBinError ( DetId const &  _id,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 311 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinError_().

312  {
313  find_(_id);
314 
315  if(cache_.second.size() == 0) return 0.;
316 
317  return getBinError_(cache_.first, cache_.second[0]);
318  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinError_(unsigned, int) const
Definition: MESet.cc:346
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
double ecaldqm::MESetEcal::getBinError ( unsigned  _dcctccid,
int  _bin = 0 
) const
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 321 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::getBinError_().

322  {
323  find_(_dcctccid);
324 
325  if(cache_.second.size() == 0) return 0.;
326 
327  return getBinError_(cache_.first, cache_.second[0]);
328  }
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual double getBinError_(unsigned, int) const
Definition: MESet.cc:346
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
void ecaldqm::MESetEcal::reset ( double  _content = 0.,
double  _err = 0.,
double  _entries = 0. 
)
virtual

Reimplemented from ecaldqm::MESet.

Definition at line 351 of file MESetEcal.cc.

References newFWLiteAna::bin, ecaldqm::MESet::binService_, ecaldqm::MEData::btype, ecaldqm::MESet::data_, edm::hlt::Exception, EcalDQMBinningService::getBinMap(), EcalDQMBinningService::kEcal2P, EcalDQMBinningService::kEcal3P, EcalDQMBinningService::kEcalMEM2P, EcalDQMBinningService::kSM, EcalDQMBinningService::kSMMEM, EcalDQMBinningService::nDCC, EcalDQMBinningService::nDCCMEM, EcalDQMBinningService::nObjType, EcalDQMBinningService::nPresetBinnings, EcalDQMBinningService::objectFromOffset(), ecaldqm::MEData::otype, ecaldqm::MESet::reset(), ecaldqm::MESet::setBinContent_(), ecaldqm::MESet::setBinEntries_(), and EcalDQMBinningService::smOffsetBins().

352  {
353  using namespace std;
354 
355  if(data_->btype >= unsigned(BinService::nPresetBinnings)){
356  MESet::reset(_content, _err, _entries);
357  return;
358  }
359 
360  unsigned nME(1);
361  switch(data_->otype){
362  case BinService::kSM:
363  nME = BinService::nDCC;
364  break;
365  case BinService::kSMMEM:
366  nME = BinService::nDCCMEM;
367  break;
368  case BinService::kEcal2P:
369  nME = 2;
370  break;
371  case BinService::kEcal3P:
372  nME = 3;
373  break;
375  nME = 2;
376  break;
377  default:
378  break;
379  }
380 
381  for(unsigned iME(0); iME < nME; iME++) {
382  unsigned iObj(iME);
383 
386  if(okey == BinService::nObjType)
387  throw cms::Exception("InvalidCall") << "Undefined object & bin type";
388 
389  std::vector<int> const* binMap(binService_->getBinMap(okey, bkey));
390  if(!binMap)
391  throw cms::Exception("InvalidCall") << "Cannot retrieve bin map";
392 
393  for(std::vector<int>::const_iterator binItr(binMap->begin()); binItr != binMap->end(); ++binItr){
394  int bin(*binItr - binService_->smOffsetBins(okey, bkey, iObj));
395  setBinContent_(iME, bin, _content, _err);
396  setBinEntries_(iME, bin, 0.);
397  }
398  }
399  }
BinService::ObjectType otype
Definition: MESet.h:22
virtual void reset(double _content=0., double _err=0., double _entries=0.)
Definition: MESet.cc:87
const std::vector< int > * getBinMap(ObjectType &, BinningType &) const
ObjectType objectFromOffset(ObjectType, unsigned) const
BinService::BinningType btype
Definition: MESet.h:23
virtual void setBinEntries_(unsigned, int, double)
Definition: MESet.cc:313
virtual void setBinContent_(unsigned, int, double, double)
Definition: MESet.cc:294
static BinService const * binService_
Definition: MESet.h:126
MEData const * data_
Definition: MESet.h:133
int smOffsetBins(ObjectType, BinningType, unsigned) const
bool ecaldqm::MESetEcal::retrieve ( ) const
virtual

Reimplemented from ecaldqm::MESet.

Definition at line 200 of file MESetEcal.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::clear(), ecaldqm::MESet::dir_, ecaldqm::MESet::dqmStore_, generateNames(), DQMStore::get(), and ecaldqm::MESet::mes_.

201  {
202  clear();
203 
204  std::vector<std::string> meNames(generateNames());
205  if(meNames.size() == 0) return false;
206 
207  for(unsigned iME(0); iME < meNames.size(); iME++){
208  MonitorElement* me(dqmStore_->get(dir_ + "/" + meNames[iME]));
209  if(me) mes_.push_back(me);
210  else{
211  clear();
212  return false;
213  }
214  }
215 
216  active_ = true;
217  return true;
218  }
virtual void clear() const
Definition: MESet.cc:59
std::vector< std::string > generateNames() const
Definition: MESetEcal.cc:402
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
static DQMStore * dqmStore_
Definition: MESet.h:127
std::string dir_
Definition: MESet.h:131
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
bool active_
Definition: MESet.h:135
void ecaldqm::MESetEcal::setBinContent ( DetId const &  _id,
double  _content,
double  _err = 0. 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 251 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::setBinContent_().

Referenced by ecaldqm::MESetDet2D::fill().

252  {
253  find_(_id);
254 
255  std::vector<int>& bins(cache_.second);
256  for(std::vector<int>::iterator binItr(bins.begin()); binItr != bins.end(); ++binItr)
257  setBinContent_(cache_.first, *binItr, _content, _err);
258  }
virtual void setBinContent_(unsigned, int, double, double)
Definition: MESet.cc:294
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
void ecaldqm::MESetEcal::setBinContent ( unsigned  _dcctccid,
double  _content,
double  _err = 0. 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 261 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::setBinContent_().

262  {
263  find_(_dcctccid);
264 
265  std::vector<int>& bins(cache_.second);
266  for(std::vector<int>::iterator binItr(bins.begin()); binItr != bins.end(); ++binItr)
267  setBinContent_(cache_.first, *binItr, _content, _err);
268  }
virtual void setBinContent_(unsigned, int, double, double)
Definition: MESet.cc:294
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
void ecaldqm::MESetEcal::setBinEntries ( DetId const &  _id,
double  _entries 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 271 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::setBinEntries_().

Referenced by ecaldqm::MESetDet2D::fill().

272  {
273  find_(_id);
274 
275  std::vector<int>& bins(cache_.second);
276  for(std::vector<int>::iterator binItr(bins.begin()); binItr != bins.end(); ++binItr)
277  setBinEntries_(cache_.first, *binItr, _entries);
278  }
virtual void setBinEntries_(unsigned, int, double)
Definition: MESet.cc:313
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470
void ecaldqm::MESetEcal::setBinEntries ( unsigned  _dcctccid,
double  _entries 
)
virtual

Reimplemented from ecaldqm::MESet.

Reimplemented in ecaldqm::MESetTrend.

Definition at line 281 of file MESetEcal.cc.

References cache_, find_(), and ecaldqm::MESet::setBinEntries_().

282  {
283  find_(_dcctccid);
284 
285  std::vector<int>& bins(cache_.second);
286  for(std::vector<int>::iterator binItr(bins.begin()); binItr != bins.end(); ++binItr)
287  setBinEntries_(cache_.first, *binItr, _entries);
288  }
virtual void setBinEntries_(unsigned, int, double)
Definition: MESet.cc:313
std::pair< unsigned, std::vector< int > > cache_
Definition: MESetEcal.h:48
virtual void find_(uint32_t) const
Definition: MESetEcal.cc:470

Member Data Documentation

std::pair<unsigned, std::vector<int> > ecaldqm::MESetEcal::cache_
mutableprotected
uint32_t ecaldqm::MESetEcal::cacheId_
mutableprotected

Definition at line 47 of file MESetEcal.h.

Referenced by ecaldqm::MESetDet1D::find_(), and find_().

const unsigned ecaldqm::MESetEcal::logicalDimensions_
protected

Definition at line 45 of file MESetEcal.h.

Referenced by book(), and MESetEcal().