CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
MonitorElement.cc File Reference
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/QTest.h"
#include "DQMServices/Core/src/DQMError.h"
#include "TClass.h"
#include "TMath.h"
#include "TList.h"
#include <iostream>
#include <cassert>
#include <cfloat>
#include <inttypes.h>

Go to the source code of this file.

Macros

#define __STDC_FORMAT_MACROS   1
 
#define DQM_ROOT_METHODS   1
 

Functions

static TH1 * checkRootObject (const std::string &name, TObject *tobj, const char *func, int reqdim)
 

Macro Definition Documentation

#define __STDC_FORMAT_MACROS   1

Definition at line 1 of file MonitorElement.cc.

#define DQM_ROOT_METHODS   1

Definition at line 2 of file MonitorElement.cc.

Function Documentation

static TH1* checkRootObject ( const std::string &  name,
TObject *  tobj,
const char *  func,
int  reqdim 
)
static

Definition at line 15 of file MonitorElement.cc.

References h, and raiseDQMError().

Referenced by MonitorElement::accessRootObject(), MonitorElement::getRefTH1(), MonitorElement::getRefTH1D(), MonitorElement::getRefTH1F(), MonitorElement::getRefTH1S(), MonitorElement::getRefTH2D(), MonitorElement::getRefTH2F(), MonitorElement::getRefTH2S(), MonitorElement::getRefTH3F(), MonitorElement::getRefTProfile(), and MonitorElement::getRefTProfile2D().

16 {
17  if (! tobj)
18  raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
19  " element '%s' because it is not a ROOT object.",
20  func, name.c_str());
21 
22  TH1 *h = static_cast<TH1 *>(tobj);
23  int ndim = h->GetDimension();
24  if (reqdim < 0 || reqdim > ndim)
25  raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
26  " element '%s' because it requires %d dimensions; this"
27  " object of type '%s' has %d dimensions",
28  func, name.c_str(), reqdim, typeid(*h).name(), ndim);
29 
30  return h;
31 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
string func
Definition: statics.py:48
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11