1 #ifndef DQMSERVICES_CORE_MONITOR_ELEMENT_H 2 #define DQMSERVICES_CORE_MONITOR_ELEMENT_H 4 #if __GNUC__ && !defined DQM_DEPRECATED 25 #include "TProfile2D.h" 26 #include "TObjString.h" 37 #include <tbb/spin_mutex.h> 85 std::atomic<MonitorElementData const *>
frozen_;
86 std::atomic<MutableMonitorElementData *>
mutable_;
104 auto mut = mutable_.load();
107 return mut->access();
109 auto frozen = frozen_.load();
113 return Access{std::unique_lock<dqmmutex>(), frozen->key_, frozen->value_};
116 throw cms::Exception(
"LogicError") <<
"MonitorElement not backed by any data!";
124 auto mut = mutable_.load();
127 return mut->accessMut();
129 auto frozen = frozen_.load();
131 throw cms::Exception(
"LogicError") <<
"MonitorElement not backed by any data!";
138 if (frozen->value_.object_) {
140 clone->
data_.
value_.
object_ = std::unique_ptr<TH1>(
static_cast<TH1 *
>(frozen->value_.object_->Clone()));
146 bool ok = mutable_.compare_exchange_strong(existing, clone);
186 static bool CheckBinLabels(
const TAxis *a1,
const TAxis *
a2);
233 template <
typename T>
235 int checkArray[
sizeof(int64_t) -
sizeof(
T) + 1];
244 doFill(static_cast<int64_t>(x));
246 void Fill(
unsigned long long x) {
248 doFill(static_cast<int64_t>(x));
252 doFill(static_cast<int64_t>(x));
256 doFill(static_cast<int64_t>(x));
260 doFill(static_cast<int64_t>(x));
264 doFill(static_cast<int64_t>(x));
268 doFill(static_cast<int64_t>(x));
272 doFill(static_cast<int64_t>(x));
276 doFill(static_cast<int64_t>(x));
280 doFill(static_cast<int64_t>(x));
283 void Fill(
float x) {
Fill(static_cast<double>(x)); }
287 void Fill(
double x,
double yw);
288 void Fill(
double x,
double y,
double zw);
289 void Fill(
double x,
double y,
double z,
double w);
291 void ShiftFillLast(
double y,
double ye = 0., int32_t xscale = 1);
293 virtual void Reset();
318 std::vector<QReport *> getQReports()
const;
320 std::vector<QReport *> getQWarnings()
const;
322 std::vector<QReport *> getQErrors()
const;
324 std::vector<QReport *> getQOthers()
const;
330 virtual int getNbinsX()
const;
331 virtual int getNbinsY()
const;
332 virtual int getNbinsZ()
const;
333 virtual std::string getAxisTitle(
int axis = 1)
const;
337 virtual double getMean(
int axis = 1)
const;
338 virtual double getMeanError(
int axis = 1)
const;
339 virtual double getRMS(
int axis = 1)
const;
340 virtual double getRMSError(
int axis = 1)
const;
341 virtual double getBinContent(
int binx)
const;
342 virtual double getBinContent(
int binx,
int biny)
const;
343 virtual double getBinContent(
int binx,
int biny,
int binz)
const;
344 virtual double getBinError(
int binx)
const;
345 virtual double getBinError(
int binx,
int biny)
const;
346 virtual double getBinError(
int binx,
int biny,
int binz)
const;
347 virtual double getEntries()
const;
348 virtual double getBinEntries(
int bin)
const;
351 virtual void setBinContent(
int binx,
double content);
352 virtual void setBinContent(
int binx,
int biny,
double content);
353 virtual void setBinContent(
int binx,
int biny,
int binz,
double content);
354 virtual void setBinError(
int binx,
double error);
355 virtual void setBinError(
int binx,
int biny,
double error);
356 virtual void setBinError(
int binx,
int biny,
int binz,
double error);
357 virtual void setBinEntries(
int bin,
double nentries);
358 virtual void setEntries(
double nentries);
360 virtual void setAxisRange(
double xmin,
double xmax,
int axis = 1);
362 virtual void setAxisTimeDisplay(
int value,
int axis = 1);
363 virtual void setAxisTimeFormat(
const char *
format =
"",
int axis = 1);
368 virtual void enableSumw2();
369 virtual void disableAlphanumeric();
370 virtual void setOption(
const char *
option);
373 virtual double getAxisMin(
int axis = 1)
const;
374 virtual double getAxisMax(
int axis = 1)
const;
379 virtual void setCanExtend(
unsigned int value);
382 virtual void setStatOverflows(
unsigned int value);
385 virtual TObject
const *getRootObject()
const;
386 virtual TH1 *getTH1();
387 virtual TH1F *getTH1F();
388 virtual TH1S *getTH1S();
389 virtual TH1D *getTH1D();
390 virtual TH2F *getTH2F();
391 virtual TH2S *getTH2S();
392 virtual TH2D *getTH2D();
393 virtual TH3F *getTH3F();
394 virtual TProfile *getTProfile();
395 virtual TProfile2D *getTProfile2D();
398 virtual int64_t getIntValue()
const;
399 virtual double getFloatValue()
const;
405 void incompatible(
const char *
func)
const;
406 TH1
const *accessRootObject(
Access const &access,
const char *func,
int reqdim)
const;
407 TH1 *accessRootObject(
AccessMut const &,
const char *func,
int reqdim)
const;
409 void setAxisTimeOffset(
double toffset,
const char *option =
"local",
int axis = 1);
424 TAxis
const *getAxis(
Access const &access,
const char *func,
int axis)
const;
425 TAxis *getAxis(
AccessMut const &access,
const char *func,
int axis)
const;
427 void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum,
float c1,
float c2);
428 void addProfiles(TProfile2D *h1, TProfile2D *h2, TProfile2D *sum,
float c1,
float c2);
429 void copyFunctions(TH1 *from, TH1 *
to);
430 void copyFrom(TH1 *from);
436 void updateQReportStats();
439 const uint32_t
run()
const {
return data_.
run; }
458 return const_cast<TObject *
>(
508 #endif // DQMSERVICES_CORE_MONITOR_ELEMENT_H virtual TH2D * getTH2D() const
static const uint32_t DQM_PROP_REPORT_WARN
std::vector< QReport > qreports_
virtual TH2F * getTH2F() const
std::atomic< MonitorElementData const * > frozen_
def create(alignables, pedeDump, additionalData, outputFile, config)
MonitorElementData::Key const & key
dqm::legacy::MonitorElement MonitorElement
std::atomic< MutableMonitorElementData * > mutable_
virtual TH1F * getTH1F() const
const std::string & getPathname() const
get pathname of parent folder
edm::propagate_const< std::unique_ptr< TH1 > > object_
void setLumiFlag()
this ME is meant to be stored for each luminosity section
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
static const uint32_t DQM_PROP_RESET
const std::string * dirname
bool hasOtherReport() const
true if at least of one of the tests returned some other (non-ok) status
static const uint32_t DQM_PROP_MARKTODELETE
virtual TH1S * getTH1S() const
const std::string getFullname() const
get full name of ME including Pathname
dqm::dqmstoreimpl::DQMStore DQMStore
class DQMOldReceiver DQM_DEPRECATED
void setLumi(uint32_t ls)
bool hasWarning() const
true if at least of one of the quality tests returned a warning
virtual TProfile2D * getTProfile2D()
bool operator<(const MonitorElement &x) const
Compare monitor elements, for ordering in sets.
const uint32_t run() const
bool markedToDelete() const
true if ME is marked for deletion
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::unique_lock< dqmmutex > guard_
const uint32_t lumi() const
void Fill(unsigned int x)
static const uint32_t DQM_PROP_REPORT_ERROR
const uint32_t moduleId() const
std::unique_lock< dqmmutex > guard_
static const uint32_t DQM_PROP_REPORT_OTHER
void Fill(unsigned short x)
void Fill(unsigned long x)
virtual TProfile2D * getTProfile2D() const
virtual TProfile * getTProfile()
MonitorElementData::Value & value
virtual TH2S * getTH2S() const
void Fill(unsigned char x)
MonitorElementData::Value const & value
void update()
Mark the object updated.
bool isEfficiency() const
bool hasError() const
true if at least of one of the quality tests returned an error
virtual TProfile * getTProfile() const
virtual TH1D * getTH1D() const
MonitorElementData::Key const & key
uint32_t flags() const
Get the object flags.
bool getLumiFlag() const
true if ME is meant to be stored for each luminosity section
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
bool resetMe() const
true if ME should be reset at end of monitoring cycle
bool wasUpdated() const
true if ME was updated in last monitoring cycle
void Fill(unsigned long long x)
static bool setOrder(const CoreObject &a, const CoreObject &b)
const Access access() const
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
TObject * getRootObject() const override
void Reset(std::vector< TH2F > &depth)
static const uint32_t DQM_PROP_NEW
static const uint32_t DQM_PROP_TYPE_MASK
void resetUpdate()
reset "was updated" flag
virtual TObject const * getRootObject() const
static const uint32_t DQM_PROP_LUMI
virtual TH1 * getTH1() const
virtual TH3F * getTH3F() const