18 dir_(_fullpath.substr(0, _fullpath.find_last_of(
'/'))),
19 name_(_fullpath.substr(_fullpath.find_last_of(
'/') + 1)),
27 throw cms::Exception(
"Service") <<
"EcalDQMBinningService not found" << std::endl;
33 throw cms::Exception(
"Service") <<
"DQMStore not found" << std::endl;
37 if(_fullpath.size() == 0)
38 throw cms::Exception(
"InvalidConfiguration") <<
"MonitorElement path empty";
68 for(std::vector<MonitorElement*>::iterator meItr(
mes_.begin()); meItr !=
mes_.end(); ++meItr)
69 (*meItr)->setAxisTitle(_title, _axis);
75 if(_offset ==
unsigned(-1)){
76 for(std::vector<MonitorElement*>::iterator meItr(
mes_.begin()); meItr !=
mes_.end(); ++meItr)
77 (*meItr)->setBinLabel(_bin, _label, _axis);
82 if(_offset >=
mes_.size() || !
mes_[_offset])
return;
83 mes_[_offset]->setBinLabel(_bin, _label, _axis);
96 for(std::vector<MonitorElement*>::iterator meItr(
mes_.begin()); meItr !=
mes_.end(); ++meItr)
97 (*meItr)->Fill(_content);
102 if(_content != 0. || _err != 0. || _entries != 0.) simple =
false;
104 for(std::vector<MonitorElement*>::iterator meItr(
mes_.begin()); meItr !=
mes_.end(); ++meItr){
105 TH1*
h((*meItr)->getTH1());
109 int nbinsX(
h->GetNbinsX());
110 int nbinsY(
h->GetNbinsY());
112 for(
int ix(1); ix <= nbinsX; ix++){
113 for(
int iy(1); iy <= nbinsY; iy++){
114 int bin(
h->GetBin(ix, iy));
115 h->SetBinContent(
bin, _content);
116 h->SetBinError(
bin, _err);
118 static_cast<TProfile*
>(
h)->SetBinEntries(
bin, _entries);
122 static_cast<TProfile2D*
>(
h)->SetBinEntries(
bin, _entries);
127 if(entries == 0.) entries = _entries;
128 h->SetEntries(_entries);
144 MESet::fill(
unsigned _dcctccid,
double _wx,
double _wy,
double _w)
240 MESet::name(std::map<std::string, std::string>
const& _replacements)
const
245 for(std::map<std::string, std::string>::const_iterator repItr(_replacements.begin()); repItr != _replacements.end(); ++repItr){
248 pattern += repItr->first;
251 TPRegexp re(pattern);
253 re.Substitute(dir, repItr->second,
"g");
254 re.Substitute(name, repItr->second,
"g");
266 TH1*
h(me->getTH1());
268 int nbinsX(
h->GetNbinsX());
270 double x(
h->GetXaxis()->GetBinCenter((_bin - 1) % nbinsX + 1));
277 double y(
h->GetYaxis()->GetBinCenter((_bin - 1) / nbinsX + 1));
286 mes_.at(_offset)->Fill(_x);
288 mes_.at(_offset)->Fill(_x, _wy);
290 mes_.at(_offset)->Fill(_x, _wy, _w);
300 me->setBinError(_bin, _err);
303 TH1*
h(me->getTH1());
304 int nbinsX(
h->GetNbinsX());
305 int ix((_bin - 1) % nbinsX + 1);
306 int iy((_bin - 1) / nbinsX + 1);
307 me->setBinContent(ix, iy, _content);
308 me->setBinError(ix, iy, _err);
321 TH1*
h(me->getTH1());
322 int nbinsX(
h->GetNbinsX());
323 int ix((_bin - 1) % nbinsX + 1);
324 int iy((_bin - 1) / nbinsX + 1);
325 me->setBinEntries(
h->GetBin(ix, iy), _entries);
337 TH1*
h(me->getTH1());
338 int nbinsX(
h->GetNbinsX());
339 int ix((_bin - 1) % nbinsX + 1);
340 int iy((_bin - 1) / nbinsX + 1);
341 return h->GetBinContent(ix, iy);
353 TH1*
h(me->getTH1());
354 int nbinsX(
h->GetNbinsX());
355 int ix((_bin - 1) % nbinsX + 1);
356 int iy((_bin - 1) / nbinsX + 1);
357 return h->GetBinError(ix, iy);
368 return me->getBinContent(_bin);
370 return me->getBinEntries(_bin);
373 TH1*
h(me->getTH1());
374 int nbinsX(
h->GetNbinsX());
375 int ix((_bin - 1) % nbinsX + 1);
376 int iy((_bin - 1) / nbinsX + 1);
377 int bin(
h->GetBin(ix, iy));
378 return me->getBinContent(
bin);
382 TH1*
h(me->getTH1());
383 int nbinsX(
h->GetNbinsX());
384 int ix((_bin - 1) % nbinsX + 1);
385 int iy((_bin - 1) / nbinsX + 1);
386 int bin(
h->GetBin(ix, iy));
387 return me->getBinEntries(
bin);
void setBinContent(int binx, double content)
set content of bin (1-D)
const EcalElectronicsMapping * getElectronicsMap()
virtual void reset(double _content=0., double _err=0., double _entries=0.)
virtual void clear() const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
MonitorElement::Kind kind
virtual void setBinContent(DetId const &, double, double _err=0.)
virtual double getBinContent(DetId const &, int _bin=0) const
std::vector< MonitorElement * > mes_
virtual void setBinEntries(DetId const &, double)
virtual bool retrieve() const
static DQMStore * dqmStore_
virtual void setBinEntries_(unsigned, int, double)
virtual void setBinContent_(unsigned, int, double, double)
virtual void fill_(unsigned, int, double)
virtual void setBinLabel(unsigned, int, std::string const &, int _axis=1)
MESet(std::string const &, MEData const &, bool _readOnly=false)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual double getBinContent_(unsigned, int) const
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
virtual double getBinError_(unsigned, int) const
static BinService const * binService_
virtual void setAxisTitle(std::string const &, int _axis=1)
virtual void fill(DetId const &, double _wx=1., double _wy=1., double _w=1.)
double getBinContent(int binx) const
get content of bin (1-D)
virtual double getBinError(DetId const &, int _bin=0) const
virtual double getBinEntries_(unsigned, int) const
void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
virtual void resetAll(double _content=0., double _err=0., double _entries=0.)
void name(std::map< std::string, std::string > const &) const
virtual double getBinEntries(DetId const &, int _bin=0) const