CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ConcurrentMonitorElement Class Reference

#include <ConcurrentMonitorElement.h>

Public Member Functions

 ConcurrentMonitorElement (void)
 
 ConcurrentMonitorElement (MonitorElement *me)
 
 ConcurrentMonitorElement (ConcurrentMonitorElement const &)=delete
 
 ConcurrentMonitorElement (ConcurrentMonitorElement &&other)
 
void disableAlphanumeric ()
 
void enableSumw2 ()
 
template<typename... Args>
void fill (Args &&...args) const
 
 operator bool () const
 
ConcurrentMonitorElementoperator= (ConcurrentMonitorElement const &)=delete
 
ConcurrentMonitorElementoperator= (ConcurrentMonitorElement &&other)
 
void reset ()
 
void setAxisRange (double xmin, double xmax, int axis=1)
 
void setAxisTimeDisplay (int value, int axis=1)
 
void setAxisTimeFormat (const char *format="", int axis=1)
 
void setAxisTitle (std::string const &title, int axis=1)
 
void setBinLabel (int bin, std::string const &label, int axis=1)
 
void setOption (const char *option)
 
void setTitle (std::string const &title)
 
void setXTitle (std::string const &title)
 
void setXTitle (const char *title)
 
void setYTitle (std::string const &title)
 
void setYTitle (const char *title)
 
void shiftFillLast (double y, double ye=0., int32_t xscale=1) const
 
 ~ConcurrentMonitorElement (void)=default
 

Private Attributes

tbb::spin_mutex lock_
 
MonitorElementme_
 

Detailed Description

Definition at line 14 of file ConcurrentMonitorElement.h.

Constructor & Destructor Documentation

ConcurrentMonitorElement::ConcurrentMonitorElement ( void  )
inline

Definition at line 21 of file ConcurrentMonitorElement.h.

Referenced by ConcurrentMonitorElement().

21  :
22  me_(nullptr)
23  { }
ConcurrentMonitorElement::ConcurrentMonitorElement ( MonitorElement me)
inlineexplicit

Definition at line 25 of file ConcurrentMonitorElement.h.

References ConcurrentMonitorElement().

25  :
26  me_(me)
27  { }
ConcurrentMonitorElement::ConcurrentMonitorElement ( ConcurrentMonitorElement const &  )
delete
ConcurrentMonitorElement::ConcurrentMonitorElement ( ConcurrentMonitorElement &&  other)
inline

Definition at line 33 of file ConcurrentMonitorElement.h.

References operator=(), and trackingPlots::other.

34  {
35  std::lock_guard<tbb::spin_mutex> guard(other.lock_);
36  me_ = other.me_;
37  other.me_ = nullptr;
38  }
ConcurrentMonitorElement::~ConcurrentMonitorElement ( void  )
default

Referenced by operator=().

Member Function Documentation

void ConcurrentMonitorElement::disableAlphanumeric ( )
inline

Definition at line 144 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

145  {
146  me_->getTH1()->GetXaxis()->SetNoAlphanumeric(false);
147  me_->getTH1()->GetYaxis()->SetNoAlphanumeric(false);
148  }
TH1 * getTH1() const
void ConcurrentMonitorElement::enableSumw2 ( )
inline

Definition at line 139 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

140  {
141  me_->getTH1()->Sumw2();
142  }
TH1 * getTH1() const
template<typename... Args>
void ConcurrentMonitorElement::fill ( Args &&...  args) const
inline
ConcurrentMonitorElement::operator bool ( ) const
inline

Definition at line 80 of file ConcurrentMonitorElement.h.

81  {
82  std::lock_guard<tbb::spin_mutex> guard(lock_);
83  return (me_ != nullptr);
84  }
ConcurrentMonitorElement& ConcurrentMonitorElement::operator= ( ConcurrentMonitorElement const &  )
delete
ConcurrentMonitorElement& ConcurrentMonitorElement::operator= ( ConcurrentMonitorElement &&  other)
inline

Definition at line 44 of file ConcurrentMonitorElement.h.

References CommonMethods::lock(), trackingPlots::other, and ~ConcurrentMonitorElement().

45  {
46  // FIXME replace with std::scoped_lock once C++17 is available
47  std::lock(lock_, other.lock_);
48  std::lock_guard<tbb::spin_mutex> ours(lock_, std::adopt_lock);
49  std::lock_guard<tbb::spin_mutex> others(other.lock_, std::adopt_lock);
50  me_ = other.me_;
51  other.me_ = nullptr;
52  return *this;
53  }
void ConcurrentMonitorElement::reset ( void  )
inline

Definition at line 74 of file ConcurrentMonitorElement.h.

75  {
76  std::lock_guard<tbb::spin_mutex> guard(lock_);
77  me_ = nullptr;
78  }
void ConcurrentMonitorElement::setAxisRange ( double  xmin,
double  xmax,
int  axis = 1 
)
inline

Definition at line 114 of file ConcurrentMonitorElement.h.

References MonitorElement::setAxisRange().

115  {
116  me_->setAxisRange(xmin, xmax, axis);
117  }
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
void ConcurrentMonitorElement::setAxisTimeDisplay ( int  value,
int  axis = 1 
)
inline

Definition at line 124 of file ConcurrentMonitorElement.h.

References MonitorElement::setAxisTimeDisplay().

125  {
126  me_->setAxisTimeDisplay(value, axis);
127  }
void setAxisTimeDisplay(int value, int axis=1)
set x-, y-, or z-axis to display time values
Definition: value.py:1
void ConcurrentMonitorElement::setAxisTimeFormat ( const char *  format = "",
int  axis = 1 
)
inline

Definition at line 129 of file ConcurrentMonitorElement.h.

References MonitorElement::setAxisTimeFormat().

130  {
131  me_->setAxisTimeFormat(format, axis);
132  }
void setAxisTimeFormat(const char *format="", int axis=1)
set the format of the time values that are displayed on an axis
void ConcurrentMonitorElement::setAxisTitle ( std::string const &  title,
int  axis = 1 
)
inline

Definition at line 119 of file ConcurrentMonitorElement.h.

References MonitorElement::setAxisTitle().

Referenced by BeamConditionsMonitor::bookHistograms().

120  {
121  me_->setAxisTitle(title, axis);
122  }
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ConcurrentMonitorElement::setBinLabel ( int  bin,
std::string const &  label,
int  axis = 1 
)
inline

Definition at line 134 of file ConcurrentMonitorElement.h.

References MonitorElement::setBinLabel().

135  {
136  me_->setBinLabel(bin, label, axis);
137  }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
char const * label
bin
set the eta bin as selection string.
void ConcurrentMonitorElement::setOption ( const char *  option)
inline

Definition at line 150 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

Referenced by BeamConditionsMonitor::bookHistograms().

150  {
151  me_->getTH1()->SetOption(option);
152  }
TH1 * getTH1() const
void ConcurrentMonitorElement::setTitle ( std::string const &  title)
inline

Definition at line 89 of file ConcurrentMonitorElement.h.

References MonitorElement::setTitle().

Referenced by Vispa.Gui.PortWidget.PortWidget::setName(), and Vispa.Views.LineDecayView.LineDecayContainer::setPxlObject().

90  {
91  me_->setTitle(title);
92  }
void setTitle(const std::string &title)
set (ie. change) histogram/profile title
void ConcurrentMonitorElement::setXTitle ( std::string const &  title)
inline

Definition at line 94 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

Referenced by FastTimerService::PlotsPerElement::book(), and ThroughputService::preGlobalBeginRun().

95  {
96  me_->getTH1()->SetXTitle(title.c_str());
97  }
TH1 * getTH1() const
void ConcurrentMonitorElement::setXTitle ( const char *  title)
inline

Definition at line 99 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

100  {
101  me_->getTH1()->SetXTitle(title);
102  }
TH1 * getTH1() const
void ConcurrentMonitorElement::setYTitle ( std::string const &  title)
inline

Definition at line 104 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

Referenced by FastTimerService::PlotsPerPath::book(), and ThroughputService::preGlobalBeginRun().

105  {
106  me_->getTH1()->SetYTitle(title.c_str());
107  }
TH1 * getTH1() const
void ConcurrentMonitorElement::setYTitle ( const char *  title)
inline

Definition at line 109 of file ConcurrentMonitorElement.h.

References MonitorElement::getTH1().

110  {
111  me_->getTH1()->SetYTitle(title);
112  }
TH1 * getTH1() const
void ConcurrentMonitorElement::shiftFillLast ( double  y,
double  ye = 0.,
int32_t  xscale = 1 
) const
inline

Definition at line 67 of file ConcurrentMonitorElement.h.

References MonitorElement::ShiftFillLast().

68  {
69  std::lock_guard<tbb::spin_mutex> guard(lock_);
70  me_->ShiftFillLast(y, ye, xscale);
71  }
void ShiftFillLast(double y, double ye=0., int32_t xscale=1)

Member Data Documentation

tbb::spin_mutex ConcurrentMonitorElement::lock_
mutableprivate

Definition at line 18 of file ConcurrentMonitorElement.h.

MonitorElement* ConcurrentMonitorElement::me_
mutableprivate

Definition at line 17 of file ConcurrentMonitorElement.h.