CMS 3D CMS Logo

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

#include <MESetNonObject.h>

Inheritance diagram for ecaldqm::MESetNonObject:
ecaldqm::MESet

Public Member Functions

void book ()
 
void fill (double, double _wy=1., double _w=1.)
 
 MESetNonObject (std::string const &, MEData const &, bool _readOnly=false)
 
bool retrieve () const
 
 ~MESetNonObject ()
 
- Public Member Functions inherited from ecaldqm::MESet
virtual void clear () const
 
virtual void fill (DetId const &, double _wx=1., double _wy=1., double _w=1.)
 
virtual void fill (EcalElectronicsId const &, double _wx=1., double _wy=1., double _w=1.)
 
virtual void fill (unsigned, double _wx=1., double _wy=1., double _w=1.)
 
virtual double getBinContent (DetId const &, int _bin=0) const
 
virtual double getBinContent (EcalElectronicsId const &, int _bin=0) const
 
virtual double getBinContent (unsigned, int _bin=0) const
 
virtual double getBinEntries (DetId const &, int _bin=0) const
 
virtual double getBinEntries (EcalElectronicsId const &, int _bin=0) const
 
virtual double getBinEntries (unsigned, int _bin=0) const
 
virtual double getBinError (DetId const &, int _bin=0) const
 
virtual double getBinError (EcalElectronicsId const &, int _bin=0) const
 
virtual double getBinError (unsigned, 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 reset (double _content=0., double _err=0., double _entries=0.)
 
virtual void resetAll (double _content=0., double _err=0., double _entries=0.)
 
virtual void setAxisTitle (std::string const &, int _axis=1)
 
virtual void setBinContent (DetId const &, double, double _err=0.)
 
virtual void setBinContent (EcalElectronicsId const &, double, double _err=0.)
 
virtual void setBinContent (unsigned, double, double _err=0.)
 
virtual void setBinEntries (DetId const &, double)
 
virtual void setBinEntries (EcalElectronicsId const &, double)
 
virtual void setBinEntries (unsigned, 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 ()
 

Additional Inherited Members

- 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 inherited from ecaldqm::MESet
bool active_
 
MEData const * data_
 
std::string dir_
 
std::vector< MonitorElement * > mes_
 
std::string name_
 
bool readOnly_
 
- Static Protected Attributes inherited from ecaldqm::MESet
static BinService const * binService_
 
static DQMStoredqmStore_
 

Detailed Description

Definition at line 8 of file MESetNonObject.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file MESetNonObject.cc.

7  :
8  MESet(_fullpath, _data, _readOnly)
9  {
10  }
MESet(std::string const &, MEData const &, bool _readOnly=false)
Definition: MESet.cc:16
ecaldqm::MESetNonObject::~MESetNonObject ( )

Definition at line 131 of file MESetNonObject.cc.

132  {
133  }

Member Function Documentation

void ecaldqm::MESetNonObject::book ( )
virtual

Reimplemented from ecaldqm::MESet.

Definition at line 13 of file MESetNonObject.cc.

References ecaldqm::MESet::active_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), 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, EcalDQMBinningService::AxisSpecs::high, i, ecaldqm::MEData::kind, EcalDQMBinningService::AxisSpecs::low, max(), ecaldqm::MESet::mes_, ecaldqm::MESet::name_, EcalDQMBinningService::AxisSpecs::nbins, DQMStore::setCurrentFolder(), ecaldqm::MEData::xaxis, ecaldqm::MEData::yaxis, and ecaldqm::MEData::zaxis.

14  {
16 
17  mes_.clear();
18 
19  MonitorElement* me(0);
20 
24 
25  switch(data_->kind) {
27  me = dqmStore_->bookFloat(name_);
28  break;
29 
31  {
32  if(!xaxis)
33  throw cms::Exception("InvalidCall") << "No xaxis found for MESetNonObject" << std::endl;
34 
35  if(!xaxis->edges)
36  me = dqmStore_->book1D(name_, name_, xaxis->nbins, xaxis->low, xaxis->high);
37  else{
38  float* edges(new float[xaxis->nbins + 1]);
39  for(int i(0); i < xaxis->nbins + 1; i++)
40  edges[i] = xaxis->edges[i];
41  me = dqmStore_->book1D(name_, name_, xaxis->nbins, edges);
42  delete [] edges;
43  }
44  }
45  break;
46 
48  {
49  if(!xaxis)
50  throw cms::Exception("InvalidCall") << "No xaxis found for MESetNonObject" << std::endl;
51 
52  double ylow, yhigh;
53  if(!yaxis){
56  }
57  else{
58  ylow = yaxis->low;
59  yhigh = yaxis->high;
60  }
61  if(xaxis->edges)
62  me = dqmStore_->bookProfile(name_, name_, xaxis->nbins, xaxis->edges, ylow, yhigh, "");
63  else
64  me = dqmStore_->bookProfile(name_, name_, xaxis->nbins, xaxis->low, xaxis->high, ylow, yhigh, "");
65 
66  }
67  break;
68 
70  {
71  if(!xaxis || !yaxis)
72  throw cms::Exception("InvalidCall") << "No x/yaxis found for MESetNonObject" << std::endl;
73 
74  if(!xaxis->edges || !yaxis->edges)
75  me = dqmStore_->book2D(name_, name_, xaxis->nbins, xaxis->low, xaxis->high, yaxis->nbins, yaxis->low, yaxis->high);
76  else{
77  float* xedges(new float[xaxis->nbins + 1]);
78  for(int i(0); i < xaxis->nbins + 1; i++)
79  xedges[i] = xaxis->edges[i];
80  float* yedges(new float[yaxis->nbins + 1]);
81  for(int i(0); i < yaxis->nbins + 1; i++)
82  yedges[i] = yaxis->edges[i];
83  me = dqmStore_->book2D(name_, name_, xaxis->nbins, xedges, yaxis->nbins, yedges);
84  delete [] xedges;
85  delete [] yedges;
86  }
87  }
88  break;
89 
91  {
92  if(!xaxis || !yaxis)
93  throw cms::Exception("InvalidCall") << "No x/yaxis found for MESetNonObject" << std::endl;
94  double high(0.), low(0.);
95  if(zaxis){
96  low = zaxis->low;
97  high = zaxis->high;
98  }
99  else{
102  }
103 
104  me = dqmStore_->bookProfile2D(name_, name_, xaxis->nbins, xaxis->low, xaxis->high, yaxis->nbins, yaxis->low, yaxis->high, low, high, "");
105  }
106  break;
107 
108  default :
109  throw cms::Exception("InvalidCall") << "MESetNonObject of type " << data_->kind << " not implemented" << std::endl;
110  }
111 
112  mes_.push_back(me);
113 
114  active_ = true;
115  }
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
BinService::AxisSpecs * yaxis
Definition: MESet.h:26
MonitorElement::Kind kind
Definition: MESet.h:24
dictionary edges
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
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
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:1036
std::string name_
Definition: MESet.h:132
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:850
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
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:1180
void ecaldqm::MESetNonObject::fill ( double  _x,
double  _wy = 1.,
double  _w = 1. 
)
virtual

Reimplemented from ecaldqm::MESet.

Definition at line 136 of file MESetNonObject.cc.

References ecaldqm::MESet::data_, MonitorElement::DQM_KIND_REAL, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MEData::kind, and ecaldqm::MESet::mes_.

137  {
138  if(mes_.size() == 0 || !mes_[0]) return;
139 
140  switch(data_->kind) {
142  mes_[0]->Fill(_x);
143  break;
146  mes_[0]->Fill(_x, _wy);
147  break;
150  mes_[0]->Fill(_x, _wy, _w);
151  break;
152  default :
153  break;
154  }
155  }
MonitorElement::Kind kind
Definition: MESet.h:24
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
MEData const * data_
Definition: MESet.h:133
bool ecaldqm::MESetNonObject::retrieve ( ) const
virtual

Reimplemented from ecaldqm::MESet.

Definition at line 118 of file MESetNonObject.cc.

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

119  {
120  mes_.clear();
121 
122  MonitorElement* me(dqmStore_->get(dir_ + "/" + name_));
123  if(!me) return false;
124 
125  mes_.push_back(me);
126 
127  active_ = true;
128  return true;
129  }
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
static DQMStore * dqmStore_
Definition: MESet.h:127
std::string dir_
Definition: MESet.h:131
std::string name_
Definition: MESet.h:132
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
bool active_
Definition: MESet.h:135