CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
cscdqm::HistoDef Class Reference

Abstract Base Histogram Definition. More...

#include <CSCDQM_HistoDef.h>

Inheritance diagram for cscdqm::HistoDef:
cscdqm::CSCHistoDef cscdqm::DDUHistoDef cscdqm::EMUHistoDef cscdqm::FEDHistoDef cscdqm::ParHistoDef

Public Member Functions

virtual const HwId getAddId () const
 Get CSC Additional ID (used to store Layer, CLCT, ALCT and other identifiers. More...
 
virtual const HwId getCrateId () const
 Get CSC Crate ID. More...
 
virtual const HwId getDDUId () const
 Get DDU ID. More...
 
virtual const HwId getDMBId () const
 Get CSC DMB ID. More...
 
virtual const HwId getFEDId () const
 Get FED ID. More...
 
const std::string getFullPath () const
 Get full path of the histogram. It is being constructed by appending path and histogam name. More...
 
const HistoNamegetHistoName () const
 Get raw histogram name. More...
 
const HistoId getId () const
 Get Histogram ID. More...
 
virtual const std::string getName () const
 Get processed histogram name. It can include additional parameter in formated name. This Name is being constructed from raw name and additional parameter. More...
 
virtual const std::string getPath () const
 Get path part of the histogram (used only for DDUs and CSCs) More...
 
 HistoDef (const HistoId p_id)
 Base constructor. More...
 
 HistoDef (const HistoDef &)=default
 Copy constructor. More...
 
const bool operator< (const HistoDef &t) const
 Less (<) operator. More...
 
const HistoDefoperator= (const HistoDef &t)
 Assignment (=) operator. More...
 
const bool operator== (const HistoDef &t) const
 Comparison (==) operator. More...
 
virtual const std::string processTitle (const std::string &p_title) const
 Process Title by Adding appropriate ID. More...
 
virtual ~HistoDef ()
 Base virtual destructor. More...
 

Static Public Member Functions

static const bool getHistoIdByName (const std::string &p_name, HistoId &p_id)
 Get Histogram ID by name. More...
 
static const std::string getHistoKeyById (const HistoId &p_id)
 Get Histogram key name by id. More...
 
static const std::string processName (const HistoName &p_name, const HwId p_id)
 Process name by applying ID to d pattern (pattern is stored in REGEXP_ONDEMAND) More...
 

Private Attributes

HistoId id
 

Friends

std::ostream & operator<< (std::ostream &out, const HistoDef &t)
 Printing (<<) operator that prints hisotgram full path. More...
 

Detailed Description

Abstract Base Histogram Definition.

Definition at line 62 of file CSCDQM_HistoDef.h.

Constructor & Destructor Documentation

◆ HistoDef() [1/2]

cscdqm::HistoDef::HistoDef ( const HistoId  p_id)
inline

Base constructor.

Parameters
p_hnameRaw histogram name by HistoName
Returns

Definition at line 73 of file CSCDQM_HistoDef.h.

73 : id(p_id) {}

◆ HistoDef() [2/2]

cscdqm::HistoDef::HistoDef ( const HistoDef )
default

Copy constructor.

◆ ~HistoDef()

virtual cscdqm::HistoDef::~HistoDef ( )
inlinevirtual

Base virtual destructor.

Definition at line 83 of file CSCDQM_HistoDef.h.

83 {}

Member Function Documentation

◆ getAddId()

virtual const HwId cscdqm::HistoDef::getAddId ( ) const
inlinevirtual

Get CSC Additional ID (used to store Layer, CLCT, ALCT and other identifiers.

Returns
CSC Additional ID

Reimplemented in cscdqm::CSCHistoDef.

Definition at line 201 of file CSCDQM_HistoDef.h.

Referenced by cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

201 { return 0; }

◆ getCrateId()

virtual const HwId cscdqm::HistoDef::getCrateId ( ) const
inlinevirtual

Get CSC Crate ID.

Returns
CSC Crate ID

Reimplemented in cscdqm::CSCHistoDef.

Definition at line 188 of file CSCDQM_HistoDef.h.

Referenced by cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

188 { return 0; }

◆ getDDUId()

virtual const HwId cscdqm::HistoDef::getDDUId ( ) const
inlinevirtual

Get DDU ID.

Returns
DDU ID

Reimplemented in cscdqm::DDUHistoDef.

Definition at line 213 of file CSCDQM_HistoDef.h.

Referenced by cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

213 { return 0; }

◆ getDMBId()

virtual const HwId cscdqm::HistoDef::getDMBId ( ) const
inlinevirtual

Get CSC DMB ID.

Returns
CSC DMB ID

Reimplemented in cscdqm::CSCHistoDef.

Definition at line 194 of file CSCDQM_HistoDef.h.

Referenced by cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

194 { return 0; }

◆ getFEDId()

virtual const HwId cscdqm::HistoDef::getFEDId ( ) const
inlinevirtual

Get FED ID.

Returns
FED ID

Reimplemented in cscdqm::FEDHistoDef.

Definition at line 207 of file CSCDQM_HistoDef.h.

Referenced by cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

207 { return 0; }

◆ getFullPath()

const std::string cscdqm::HistoDef::getFullPath ( ) const
inline

Get full path of the histogram. It is being constructed by appending path and histogam name.

Returns
full path name of the histogram (processed)

Definition at line 110 of file CSCDQM_HistoDef.h.

References getName(), getPath(), castor_dqm_sourceclient_file_cfg::path, and AlCaHLTBitMon_QueryRunRegistry::string.

110  {
112  if (!path.empty())
113  path.append("/");
114  path.append(getName());
115  return path;
116  }
virtual const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
virtual const std::string getName() const
Get processed histogram name. It can include additional parameter in formated name. This Name is being constructed from raw name and additional parameter.

◆ getHistoIdByName()

static const bool cscdqm::HistoDef::getHistoIdByName ( const std::string &  p_name,
HistoId p_id 
)
inlinestatic

Get Histogram ID by name.

Parameters
p_nameHistogram name
p_idId to be filled in (return value)
Returns
true if ID was found, false - otherwise

Definition at line 228 of file CSCDQM_HistoDef.h.

References mps_fire::i, cscdqm::h::names, and cscdqm::h::namesSize.

Referenced by cscdqm::Collection::bookCSCHistos(), cscdqm::Collection::bookDDUHistos(), cscdqm::Collection::bookEMUHistos(), cscdqm::Collection::bookFEDHistos(), and CSCOfflineClient::dqmEndJob().

228  {
229  for (HistoId i = 0; i < h::namesSize; i++) {
230  if (p_name == h::names[i]) {
231  p_id = i;
232  return true;
233  }
234  }
235  return false;
236  }
static const HistoName names[]
static const unsigned int namesSize
unsigned int HistoId

◆ getHistoKeyById()

static const std::string cscdqm::HistoDef::getHistoKeyById ( const HistoId p_id)
inlinestatic

Get Histogram key name by id.

Parameters
p_idHistogram id
Returns
Histogram key name

Definition at line 243 of file CSCDQM_HistoDef.h.

References cscdqm::h::keys.

243 { return h::keys[p_id]; }
static const HistoName keys[]

◆ getHistoName()

const HistoName& cscdqm::HistoDef::getHistoName ( ) const
inline

Get raw histogram name.

Returns
Raw histogram name

Definition at line 95 of file CSCDQM_HistoDef.h.

References id, and cscdqm::h::names.

Referenced by cscdqm::Dispatcher::getHisto(), getName(), cscdqm::CSCHistoDef::getName(), cscdqm::HistoBookRequest::HistoBookRequest(), and cscdqm::ParHistoDef::ParHistoDef().

95 { return h::names[id]; }
static const HistoName names[]

◆ getId()

const HistoId cscdqm::HistoDef::getId ( ) const
inline

Get Histogram ID.

Returns
Histogram ID

Definition at line 89 of file CSCDQM_HistoDef.h.

References id.

Referenced by CSCOfflineClient::bookMonitorObject(), CSCMonitorModule::bookMonitorObject(), cscdqm::Dispatcher::getHisto(), operator<(), and operator==().

89 { return id; }

◆ getName()

virtual const std::string cscdqm::HistoDef::getName ( ) const
inlinevirtual

Get processed histogram name. It can include additional parameter in formated name. This Name is being constructed from raw name and additional parameter.

Returns
processed full name of the histogram

Reimplemented in cscdqm::CSCHistoDef.

Definition at line 103 of file CSCDQM_HistoDef.h.

References getHistoName().

Referenced by CSCOfflineClient::bookMonitorObject(), CSCMonitorModule::bookMonitorObject(), plotting.Plot::draw(), and getFullPath().

103 { return getHistoName(); }
const HistoName & getHistoName() const
Get raw histogram name.

◆ getPath()

virtual const std::string cscdqm::HistoDef::getPath ( ) const
inlinevirtual

Get path part of the histogram (used only for DDUs and CSCs)

Returns
path part of the histogram

Reimplemented in cscdqm::CSCHistoDef, cscdqm::DDUHistoDef, and cscdqm::FEDHistoDef.

Definition at line 182 of file CSCDQM_HistoDef.h.

Referenced by CSCOfflineClient::bookMonitorObject(), CSCMonitorModule::bookMonitorObject(), getFullPath(), and cscdqm::LookupKeyType::LookupKeyType().

182 { return ""; }

◆ operator<()

const bool cscdqm::HistoDef::operator< ( const HistoDef t) const
inline

Less (<) operator.

Parameters
tHistogram to be compared to
Returns
true if t is "more" than this

Definition at line 154 of file CSCDQM_HistoDef.h.

References getAddId(), getCrateId(), getDDUId(), getDMBId(), getFEDId(), getId(), and submitPVValidationJobs::t.

154  {
155  if (getId() < t.getId())
156  return true;
157  if (getFEDId() < t.getFEDId())
158  return true;
159  if (getDDUId() < t.getDDUId())
160  return true;
161  if (getCrateId() < t.getCrateId())
162  return true;
163  if (getDMBId() < t.getDMBId())
164  return true;
165  if (getAddId() < t.getAddId())
166  return true;
167  return false;
168  }
virtual const HwId getAddId() const
Get CSC Additional ID (used to store Layer, CLCT, ALCT and other identifiers.
virtual const HwId getFEDId() const
Get FED ID.
virtual const HwId getDMBId() const
Get CSC DMB ID.
const HistoId getId() const
Get Histogram ID.
virtual const HwId getCrateId() const
Get CSC Crate ID.
virtual const HwId getDDUId() const
Get DDU ID.

◆ operator=()

const HistoDef& cscdqm::HistoDef::operator= ( const HistoDef t)
inline

Assignment (=) operator.

Parameters
tHistogram to be taken data from
Returns
resulting histogram (this)

Definition at line 144 of file CSCDQM_HistoDef.h.

References submitPVValidationJobs::t.

144  {
145  id = t.getId();
146  return *this;
147  }

◆ operator==()

const bool cscdqm::HistoDef::operator== ( const HistoDef t) const
inline

Comparison (==) operator.

Parameters
tHistogram to be compared to
Returns
true if HistoDefs match, false - otherwise

Definition at line 123 of file CSCDQM_HistoDef.h.

References getAddId(), getCrateId(), getDDUId(), getDMBId(), getFEDId(), getId(), and submitPVValidationJobs::t.

123  {
124  if (getId() != t.getId())
125  return false;
126  if (getFEDId() != t.getFEDId())
127  return false;
128  if (getDDUId() != t.getDDUId())
129  return false;
130  if (getCrateId() != t.getCrateId())
131  return false;
132  if (getDMBId() != t.getDMBId())
133  return false;
134  if (getAddId() != t.getAddId())
135  return false;
136  return true;
137  }
virtual const HwId getAddId() const
Get CSC Additional ID (used to store Layer, CLCT, ALCT and other identifiers.
virtual const HwId getFEDId() const
Get FED ID.
virtual const HwId getDMBId() const
Get CSC DMB ID.
const HistoId getId() const
Get Histogram ID.
virtual const HwId getCrateId() const
Get CSC Crate ID.
virtual const HwId getDDUId() const
Get DDU ID.

◆ processName()

static const std::string cscdqm::HistoDef::processName ( const HistoName p_name,
const HwId  p_id 
)
inlinestatic

Process name by applying ID to d pattern (pattern is stored in REGEXP_ONDEMAND)

Parameters
p_nameString value to process
p_idID to include
Returns
processed value

Definition at line 251 of file CSCDQM_HistoDef.h.

References cscdqm::Utility::regexMatch(), and cscdqm::REGEXP_ONDEMAND().

Referenced by cscdqm::CSCHistoDef::getName(), cscdqm::FEDHistoDef::processTitle(), cscdqm::DDUHistoDef::processTitle(), and cscdqm::CSCHistoDef::processTitle().

251  {
252  if (Utility::regexMatch(REGEXP_ONDEMAND, p_name)) {
253  return Form(p_name.c_str(), p_id);
254  }
255  return p_name;
256  }
static bool regexMatch(const std::string &expression, const std::string &message)
Match RegExp expression string against string message and return result.
static const TPRegexp REGEXP_ONDEMAND("^.*%d.*$")

◆ processTitle()

virtual const std::string cscdqm::HistoDef::processTitle ( const std::string &  p_title) const
inlinevirtual

Process Title by Adding appropriate ID.

Parameters
p_titleTitle to process
Returns
processed title

Reimplemented in cscdqm::CSCHistoDef, cscdqm::DDUHistoDef, and cscdqm::FEDHistoDef.

Definition at line 220 of file CSCDQM_HistoDef.h.

220 { return p_title; }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const HistoDef t 
)
friend

Printing (<<) operator that prints hisotgram full path.

Parameters
outoutput stream
tHistogram type to be printed
Returns
output stream

Definition at line 176 of file CSCDQM_HistoDef.h.

Member Data Documentation

◆ id

HistoId cscdqm::HistoDef::id
private

Histogram Id

Definition at line 65 of file CSCDQM_HistoDef.h.

Referenced by getHistoName(), and getId().