test
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 24 of file SiPixelHistogramId.h.

Constructor & Destructor Documentation

SiPixelHistogramId::SiPixelHistogramId ( )

Constructor.

Definition at line 22 of file SiPixelHistogramId.cc.

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

Constructor.

Constructor with collection.

Definition at line 28 of file SiPixelHistogramId.cc.

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

Destructor.

Definition at line 35 of file SiPixelHistogramId.cc.

36 {
37 }

Member Function Documentation

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

Get data Collection.

get Data Collection

Definition at line 49 of file SiPixelHistogramId.cc.

References returnIdPart().

49  {
50  return returnIdPart(histoid,2);
51 }
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 53 of file SiPixelHistogramId.cc.

References input, and returnIdPart().

53  {
54  uint32_t local_component_id;
55  std::istringstream input(returnIdPart(histoid,3)); input >> local_component_id;
56  return local_component_id;
57 }
static std::string const input
Definition: EdmProvDump.cc:44
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 59 of file SiPixelHistogramId.cc.

References separator_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getDataCollection(), and getRawId().

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

Member Data Documentation

std::string SiPixelHistogramId::dataCollection_
private

Definition at line 44 of file SiPixelHistogramId.h.

Referenced by setHistoId().

std::string SiPixelHistogramId::separator_
private

Definition at line 45 of file SiPixelHistogramId.h.

Referenced by returnIdPart(), and setHistoId().