CMS 3D CMS Logo

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 <cinttypes>
#include "FWCore/MessageLogger/interface/MessageLogger.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 20 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().

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