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 "THashList.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 16 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().

17 {
18  if (! tobj)
19  raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
20  " element '%s' because it is not a ROOT object.",
21  func, name.c_str());
22 
23  TH1 *h = static_cast<TH1 *>(tobj);
24  int ndim = h->GetDimension();
25  if (reqdim < 0 || reqdim > ndim)
26  raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
27  " element '%s' because it requires %d dimensions; this"
28  " object of type '%s' has %d dimensions",
29  func, name.c_str(), reqdim, typeid(*h).name(), ndim);
30 
31  return h;
32 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11