CMS 3D CMS Logo

Defines | Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DQMServices/Core/src/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.

Defines

#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)

Define 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().

{
  if (! tobj)
    raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
                  " element '%s' because it is not a ROOT object.",
                  func, name.c_str());

  TH1 *h = static_cast<TH1 *>(tobj);
  int ndim = h->GetDimension();
  if (reqdim < 0 || reqdim > ndim)
    raiseDQMError("MonitorElement", "Method '%s' cannot be invoked on monitor"
                  " element '%s' because it requires %d dimensions; this"
                  " object of type '%s' has %d dimensions",
                  func, name.c_str(), reqdim, typeid(*h).name(), ndim);

  return h;
}