11#include <tracking/dqmUtils/DQMHistoModuleBase.h>
13namespace Belle2::HistogramFactory {
20 template <
typename AType>
31 void Set(
const AType& value);
58 template <
class AType>
66 template <
class AType>
69 if (parameter.m_isSet)
70 Set(parameter.m_value);
74 template <
class AType>
77 m_temporaryValue = value;
78 m_isSetTemporarily =
true;
82 template <
class AType>
85 if (parameter.m_isSet)
86 SetTemporarily(parameter.m_value);
91 template <
class AType>
94 if (m_isSetTemporarily) {
95 m_isSetTemporarily =
false;
96 return m_temporaryValue;
206 TH1F*
CreateTH1F(std::string name, std::string title);
208 TH2F*
CreateTH2F(std::string name, std::string title);
211 TH1F**
CreateLayersTH1F(boost::format nameTemplate, boost::format titleTemplate);
213 TH2F**
CreateLayersTH2F(boost::format nameTemplate, boost::format titleTemplate);
215 TH1F**
CreateSensorsTH1F(boost::format nameTemplate, boost::format titleTemplate);
217 TH2F**
CreateSensorsTH2F(boost::format nameTemplate, boost::format titleTemplate);
This class serves as a base for the TrackDQMModule and AlignDQMModule (and possibly other DQM histogr...
This class unites some parameters for Factory which describe one axis of histogram.
Parameter< double > m_low
lower boundary of axis range
Parameter< std::string > m_title
title of axis
Axis & nbins(int nbins)
Set value of nbins.
Axis & up(double up)
Set value of up.
Axis(int nbins, double low, double up, std::string title)
Constructor.
Parameter< double > m_up
upper boundary of axis range
Axis & low(double low)
Set value of low.
Axis & title(std::string title)
Set value of title.
Parameter< int > m_nbins
number of bins in the axis
This class is used for creating TH1F and TH2F objects.
TH2F * CreateTH2F(std::string name, std::string title)
Create TH2F with given name and title.
TH1F ** CreateLayersTH1F(boost::format nameTemplate, boost::format titleTemplate)
Create TH1F array for layers from given name template and title template.
Factory & ylowDefault(double ylow)
Sets ylow permanently.
Factory & xTitleDefault(std::string xTitle)
Sets xTitle permanently.
Parameter< std::string > m_zTitle
title of the z axis
Factory & xupDefault(double xup)
Sets xup permanently.
TH2F ** CreateLayersTH2F(boost::format nameTemplate, boost::format titleTemplate)
Create TH2F array for layers from given name template and title template.
Factory & ylow(double ylow)
Sets ylow temporarily.
Factory & zTitle(std::string zTitle)
Sets zTitle temporarily.
Factory & yupDefault(double yup)
Sets yup permanently.
Factory & xlowDefault(double xlow)
Sets xlow permanently.
Factory & yAxisDefault(const Axis &axis)
Permanently copies parameters for y axis from given Axis.
Factory & xlow(double xlow)
Sets xlow temporarily.
Factory & nbinsyDefault(int nbinsy)
Sets nbinsy permanently.
Parameter< double > m_xup
upper boundary of x axis range
Factory & nbinsy(int nbinsy)
Sets nbinsy temporarily.
Factory & nbinsx(int nbinsx)
Sets nbinsx temporarily.
Parameter< std::string > m_yTitle
title of the y axis
Factory & yTitleDefault(std::string yTitle)
Sets yTitle permanently.
Factory & yAxis(const Axis &axis)
Temporarily copies parameters for y axis from given Axis.
Parameter< int > m_nbinsy
number of bins along the y axis
Factory & yTitle(std::string yTitle)
Sets yTitle temporarily.
TH1F * CreateTH1F(std::string name, std::string title)
Create TH1F with given name and title.
Factory & nbinsxDefault(int nbinsx)
Sets nbinsx permanently.
TH2F ** CreateSensorsTH2F(boost::format nameTemplate, boost::format titleTemplate)
Create TH2F array for sensors from given name template and title template.
Parameter< double > m_ylow
lower boundary of y axis range
Factory & xAxisDefault(const Axis &axis)
Permanently copies parameters for x axis from given Axis.
Factory & zTitleDefault(std::string zTitle)
Sets zTitle permanently.
Factory(DQMHistoModuleBase *histoModule)
Constructor.
Parameter< int > m_nbinsx
number of bins along the x axis
Parameter< std::string > m_xTitle
title of the x axis
Parameter< double > m_yup
upper boundary of y axis range
Factory & xAxis(const Axis &axis)
Temporarily copies parameters for x axis from given Axis.
Parameter< double > m_xlow
lower boundary of x axis range
TH1F ** CreateSensorsTH1F(boost::format nameTemplate, boost::format titleTemplate)
Create TH1F array for sensors from given name template and title template.
Factory & yup(double yup)
Sets yup temporarily.
Factory & xup(double xup)
Sets xup temporarily.
DQMHistoModuleBase * m_histoModule
DQM histogram module on which the Create- functions are called to create histograms.
Factory & xTitle(std::string xTitle)
Sets xTitle temporarily.
This class represents a quantity which value can be set both permanently and temporarily.
void Set(const Parameter< AType > ¶meter)
Copy permanent value from another parameter but only if its permanent value is set.
AType m_temporaryValue
temporary value
AType Get()
Returns value of the inner quantity.
void SetTemporarily(const Parameter< AType > ¶meter)
Copy temporary value from another parameter but only if its temporary value is set.
Parameter(const AType &defaultValue)
Constructor.
bool m_isSet
determines if the permanent value is set
bool m_isSetTemporarily
determines if the temporary value is set
void Set(const AType &value)
Permanently sets inner quantity to given value.
AType m_value
permanent value
void SetTemporarily(const AType &value)
Temporarily sets inner quantity to given value.