CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelHistogramId Class Reference

#include <DQM/SiPixelCommon/interface/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

Description: Creates and returns DQM Histogram Id's

Usage: <usage>

Definition at line 25 of file SiPixelHistogramId.h.

Constructor & Destructor Documentation

SiPixelHistogramId::SiPixelHistogramId ( )

Constructor.

Definition at line 23 of file SiPixelHistogramId.cc.

23  :
24  dataCollection_("defaultData"),
25  separator_("_")
26 {
27 }
std::string dataCollection_
SiPixelHistogramId::SiPixelHistogramId ( std::string  dataCollection)

Constructor.

Constructor with collection.

Definition at line 29 of file SiPixelHistogramId.cc.

29  :
30  dataCollection_(dataCollection),
31  separator_("_")
32 {
33 }
std::string dataCollection_
SiPixelHistogramId::~SiPixelHistogramId ( )
virtual

Destructor.

Definition at line 36 of file SiPixelHistogramId.cc.

37 {
38 }

Member Function Documentation

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

Get data Collection.

get Data Collection

Definition at line 50 of file SiPixelHistogramId.cc.

References returnIdPart().

50  {
51  return returnIdPart(histoid,2);
52 }
std::string returnIdPart(std::string histoid, uint32_t whichpart)
get Part
uint32_t SiPixelHistogramId::getRawId ( std::string  histogramId)

Get Detector Raw Id.

get Raw Id

Definition at line 54 of file SiPixelHistogramId.cc.

References LaserDQM_cfg::input, and returnIdPart().

54  {
55  uint32_t local_component_id;
56  std::istringstream input(returnIdPart(histoid,3)); input >> local_component_id;
57  return local_component_id;
58 }
std::string returnIdPart(std::string histoid, uint32_t whichpart)
get Part
std::string SiPixelHistogramId::returnIdPart ( std::string  histoid,
uint32_t  whichpart 
)
private

get Part

Definition at line 60 of file SiPixelHistogramId.cc.

References separator_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getDataCollection(), and getRawId().

60  {
61 
62  size_t length1=histoid.find(separator_,0);
63  if(length1==std::string::npos){ // no separator1 found
64  LogWarning("PixelDQM")<<"SiPixelHistogramId::returnIdPart - no regular histoid. Returning 0";
65  return "0";
66  }
67  std::string part1 = histoid.substr(0,length1); // part of 'histoid' up to 'separator1'
68  if(whichpart==1) return part1;
69  std::string remain1 = histoid.substr(length1+separator_.size()); // rest of 'histoid' starting at end of 'separator1'
70  size_t length2=remain1.find(separator_,0);
71  if(length2==std::string::npos){ // no separator2 found
72  LogWarning("PixelDQM")<<"SiPixelHistogramId::returnIdPart - no regular histoid. Returning 0";
73  return "0";
74  }
75  std::string part2 = remain1.substr(0,length2); // part of 'remain1' up to 'separator2'
76  if(whichpart==2) return part2;
77  std::string part3 = remain1.substr(length2+separator_.size()); // rest of remain1 starting at end of 'separator2'
78  if(whichpart==3) return part3;
79  LogWarning("PixelDQM")<<"SiPixelHistogramId::returnIdPart - no such whichpart="<<whichpart<<" returning 0";
80  return "0";
81 }
std::string SiPixelHistogramId::setHistoId ( std::string  variable,
uint32_t &  rawId 
)

Member Data Documentation

std::string SiPixelHistogramId::dataCollection_
private

Definition at line 45 of file SiPixelHistogramId.h.

Referenced by setHistoId().

std::string SiPixelHistogramId::separator_
private

Definition at line 46 of file SiPixelHistogramId.h.

Referenced by returnIdPart(), and setHistoId().