CMS 3D CMS Logo

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

#include <SiPixelHistogramId.h>

Public Member Functions

std::string getDataCollection (std::string histogramId)
 Get data Collection. More...
 
uint32_t getRawId (std::string histogramId)
 Get Detector Raw Id. More...
 
std::string setHistoId (std::string variable, uint32_t &rawId)
 Set Histogram Id. More...
 
 SiPixelHistogramId ()
 Constructor. More...
 
 SiPixelHistogramId (std::string dataCollection)
 Constructor. More...
 
virtual ~SiPixelHistogramId ()
 Destructor. More...
 

Private Member Functions

std::string returnIdPart (std::string histoid, uint32_t whichpart)
 get Part More...
 

Private Attributes

std::string dataCollection_
 
std::string separator_
 

Detailed Description

DQM/SiPixelCommon/interface/SiPixelHistogramId.h

Description: Creates and returns DQM Histogram Id's

Usage: <usage>

Definition at line 25 of file SiPixelHistogramId.h.

Constructor & Destructor Documentation

◆ SiPixelHistogramId() [1/2]

SiPixelHistogramId::SiPixelHistogramId ( )

Constructor.

Definition at line 22 of file SiPixelHistogramId.cc.

22 : dataCollection_("defaultData"), separator_("_") {}
std::string dataCollection_

◆ SiPixelHistogramId() [2/2]

SiPixelHistogramId::SiPixelHistogramId ( std::string  dataCollection)

Constructor.

Constructor with collection.

Definition at line 24 of file SiPixelHistogramId.cc.

24 : dataCollection_(dataCollection), separator_("_") {}
std::string dataCollection_

◆ ~SiPixelHistogramId()

SiPixelHistogramId::~SiPixelHistogramId ( )
virtual

Destructor.

Definition at line 27 of file SiPixelHistogramId.cc.

27 {}

Member Function Documentation

◆ getDataCollection()

std::string SiPixelHistogramId::getDataCollection ( std::string  histogramId)

Get data Collection.

get Data Collection

Definition at line 38 of file SiPixelHistogramId.cc.

References returnIdPart().

38 { return returnIdPart(histoid, 2); }
std::string returnIdPart(std::string histoid, uint32_t whichpart)
get Part

◆ getRawId()

uint32_t SiPixelHistogramId::getRawId ( std::string  histogramId)

Get Detector Raw Id.

get Raw Id

Definition at line 40 of file SiPixelHistogramId.cc.

References input, and returnIdPart().

40  {
41  uint32_t local_component_id;
42  std::istringstream input(returnIdPart(histoid, 3));
43  input >> local_component_id;
44  return local_component_id;
45 }
static std::string const input
Definition: EdmProvDump.cc:47
std::string returnIdPart(std::string histoid, uint32_t whichpart)
get Part

◆ returnIdPart()

std::string SiPixelHistogramId::returnIdPart ( std::string  histoid,
uint32_t  whichpart 
)
private

get Part

Definition at line 47 of file SiPixelHistogramId.cc.

References separator_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getDataCollection(), and getRawId().

47  {
48  size_t length1 = histoid.find(separator_, 0);
49  if (length1 == std::string::npos) { // no separator1 found
50  LogWarning("PixelDQM") << "SiPixelHistogramId::returnIdPart - no regular histoid. Returning 0";
51  return "0";
52  }
53  std::string part1 = histoid.substr(0, length1); // part of 'histoid' up to 'separator1'
54  if (whichpart == 1)
55  return part1;
56  std::string remain1 =
57  histoid.substr(length1 + separator_.size()); // rest of 'histoid' starting at end of 'separator1'
58  size_t length2 = remain1.find(separator_, 0);
59  if (length2 == std::string::npos) { // no separator2 found
60  LogWarning("PixelDQM") << "SiPixelHistogramId::returnIdPart - no regular histoid. Returning 0";
61  return "0";
62  }
63  std::string part2 = remain1.substr(0, length2); // part of 'remain1' up to 'separator2'
64  if (whichpart == 2)
65  return part2;
66  std::string part3 = remain1.substr(length2 + separator_.size()); // rest of remain1 starting at end of 'separator2'
67  if (whichpart == 3)
68  return part3;
69  LogWarning("PixelDQM") << "SiPixelHistogramId::returnIdPart - no such whichpart=" << whichpart << " returning 0";
70  return "0";
71 }
Log< level::Warning, false > LogWarning

◆ setHistoId()

std::string SiPixelHistogramId::setHistoId ( std::string  variable,
uint32_t &  rawId 
)

Member Data Documentation

◆ dataCollection_

std::string SiPixelHistogramId::dataCollection_
private

Definition at line 42 of file SiPixelHistogramId.h.

Referenced by setHistoId().

◆ separator_

std::string SiPixelHistogramId::separator_
private

Definition at line 43 of file SiPixelHistogramId.h.

Referenced by returnIdPart(), and setHistoId().