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
SiStripHistoId Class Reference

#include <DQM/SiStripCommon/interface/SiStripHistoId.h>

Public Member Functions

std::string createHistoId (std::string description, std::string id_type, uint32_t component_id)
 
std::string createHistoLayer (std::string description, std::string id_type, std::string path, std::string flag)
 
uint32_t getComponentId (std::string histoid)
 
std::string getComponentType (std::string histoid)
 
std::string getSubdetid (uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
 
 SiStripHistoId ()
 
virtual ~SiStripHistoId ()
 

Private Member Functions

const SiStripHistoIdoperator= (const SiStripHistoId &)
 
std::string returnIdPart (std::string histoid, uint32_t whichpart)
 
 SiStripHistoId (const SiStripHistoId &)
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 27 of file SiStripHistoId.h.

Constructor & Destructor Documentation

SiStripHistoId::SiStripHistoId ( )

Definition at line 24 of file SiStripHistoId.cc.

25 {
26 }
SiStripHistoId::~SiStripHistoId ( )
virtual

Definition at line 29 of file SiStripHistoId.cc.

30 {
31 }
SiStripHistoId::SiStripHistoId ( const SiStripHistoId )
private

Member Function Documentation

std::string SiStripHistoId::createHistoId ( std::string  description,
std::string  id_type,
uint32_t  component_id 
)

Definition at line 34 of file SiStripHistoId.cc.

References idDealer::description, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripLAProfileBooker::beginRun(), SiStripBaseCondObjDQM::bookCumulMEs(), SiStripMonitorTrack::bookModMEs(), SiStripBaseCondObjDQM::bookProfileMEs(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorPedestals::createMEs(), SiStripMonitorCluster::createModuleMEs(), SiStripMonitorDigi::createModuleMEs(), and SiStripMonitorQuality::getQualityME().

34  {
35  size_t pos1 = description.find("__", 0 ); // check if std::string 'description' contains by mistake the 'separator1'
36  size_t pos2 = description.find("__", 0 ); // check if std::string 'description' contains by mistake the 'separator2'
37  std::string local_histo_id;
38  std::ostringstream compid;
39  compid<<component_id; // use std::ostringstream for casting integer to std::string
40 
41  if ( pos1 == std::string::npos && pos2 == std::string::npos ){ // ok, not found either separator
42  if(id_type=="fed" || id_type=="det" || id_type=="fec"){ // ok! is one of the accepted id_type-s
43  local_histo_id = description + "__" + id_type + "__" + compid.str();
44  }else{
45  local_histo_id = description + "__dummy__" + compid.str();
46  edm::LogError("SiStripHistoId") <<" SiStripHistoId::WrongInput "
47  <<" no such type of component accepted: "<<id_type
48  <<" id_type can be: fed, det, or fec.";
49  }
50  }else{
51  local_histo_id = description + "_dummy___" + id_type + "__" + compid.str();
52  edm::LogError("SiStripHistoId") <<" SiStripHistoId::WrongInput "
53  <<" histogram description cannot contain: __ or: __"
54  <<" histogram description = "<<description;
55  }
56  return local_histo_id;
57 }
tuple description
Definition: idDealer.py:66
std::string SiStripHistoId::createHistoLayer ( std::string  description,
std::string  id_type,
std::string  path,
std::string  flag 
)

Definition at line 59 of file SiStripHistoId.cc.

References idDealer::description, LogTrace, getHLTPrescaleColumns::path, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripMonitorTrack::bookLayerMEs(), SiStripBaseCondObjDQM::bookSummaryCumulMEs(), SiStripBaseCondObjDQM::bookSummaryMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), SiStripMonitorCluster::createLayerMEs(), SiStripMonitorDigi::createLayerMEs(), SiStripNoisesDQM::fillMEsForLayer(), SiStripLorentzAngleDQM::fillMEsForLayer(), SiStripPedestalsDQM::fillMEsForLayer(), SiStripThresholdDQM::fillMEsForLayer(), SiStripApvGainsDQM::fillMEsForLayer(), and SiStripQualityDQM::fillMEsForLayer().

59  {
60  size_t pos1 = description.find( "__", 0 ); // check if std::string 'description' contains by mistake the 'separator1'
61  size_t pos2 = description.find( "__", 0 ); // check if std::string 'description' contains by mistake the 'separator2'
62  std::string local_histo_id;
63  if ( pos1 == std::string::npos && pos2 == std::string::npos ){ // ok, not found either separator
64  if(id_type=="fed" || id_type=="det" || id_type=="fec" || id_type=="layer"){ // ok! is one of the accepted id_type-s
65  if(flag.size() > 0)
66  local_histo_id = description + "__" + flag + "__" + path;
67  else
68  local_histo_id = description + "__" + path;
69  LogTrace("SiStripHistoId") << "Local_histo_ID " << local_histo_id << std::endl;
70  }else{
71  local_histo_id = description + "___dummy___" + path;
72  edm::LogError("SiStripHistoId") <<" SiStripHistoId::WrongInput "
73  <<" no such type of component accepted: "<<id_type
74  <<" id_type can be: fed, det, fec or layer ";
75  }
76  }else{
77  local_histo_id = description + "_dummy___" + path;
78  edm::LogWarning("SiStripHistoId") <<" SiStripHistoId::WrongInput "
79  <<" histogram description cannot contain: __ or: __"
80  <<" histogram description = "<<description;
81  }
82  return local_histo_id;
83 }
long int flag
Definition: mlp_lapack.h:47
#define LogTrace(id)
tuple description
Definition: idDealer.py:66
uint32_t SiStripHistoId::getComponentId ( std::string  histoid)

Definition at line 119 of file SiStripHistoId.cc.

References LaserDQM_cfg::input, and returnIdPart().

Referenced by SiStripCalibLorentzAngle::algoBeginJob().

119  {
120  uint32_t local_component_id;
121  std::istringstream input(returnIdPart(histoid,3)); input >> local_component_id; // use std::istringstream for casting from std::string to uint32_t
122  return local_component_id;
123 }
std::string returnIdPart(std::string histoid, uint32_t whichpart)
std::string SiStripHistoId::getComponentType ( std::string  histoid)

Definition at line 126 of file SiStripHistoId.cc.

References returnIdPart().

126  {
127  return returnIdPart(histoid,2);
128 }
std::string returnIdPart(std::string histoid, uint32_t whichpart)
std::string SiStripHistoId::getSubdetid ( uint32_t  id,
const TrackerTopology tTopo,
bool  flag_ring 
)

Definition at line 85 of file SiStripHistoId.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecRing(), TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidRing(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by SiStripMonitorTrack::book(), SiStripMonitorDigi::createMEs(), SiStripMonitorCluster::createMEs(), and SiStripMonitorTrack::fillMEs().

85  {
86  std::string rest1;
87 
88  const int buf_len = 50;
89  char temp_str[buf_len];
90 
91  StripSubdetector subdet(id);
92  if( subdet.subdetId() == StripSubdetector::TIB){
93  // --------------------------- TIB --------------------------- //
94 
95  snprintf(temp_str, buf_len, "TIB__layer__%i", tTopo->tibLayer(id));
96  }else if( subdet.subdetId() == StripSubdetector::TID){
97  // --------------------------- TID --------------------------- //
98 
99  if (flag_ring) snprintf(temp_str, buf_len, "TID__side__%i__ring__%i", tTopo->tidSide(id), tTopo->tidRing(id));
100  else snprintf(temp_str, buf_len, "TID__side__%i__wheel__%i", tTopo->tidSide(id), tTopo->tidWheel(id));
101  }else if(subdet.subdetId() == StripSubdetector::TOB){
102  // --------------------------- TOB --------------------------- //
103 
104  snprintf(temp_str, buf_len, "TOB__layer__%i",tTopo->tobLayer(id));
105  }else if(subdet.subdetId() == StripSubdetector::TEC){
106  // --------------------------- TEC --------------------------- //
107 
108  if (flag_ring) snprintf(temp_str, buf_len, "TEC__side__%i__ring__%i", tTopo->tecSide(id), tTopo->tecRing(id));
109  else snprintf(temp_str, buf_len, "TEC__side__%i__wheel__%i", tTopo->tecSide(id), tTopo->tecWheel(id));
110  }else{
111  // --------------------------- ??? --------------------------- //
112  edm::LogError("SiStripTkDQM|WrongInput")<<"no such subdetector type :"<<subdet.subdetId()<<" no folder set!"<<std::endl;
113  snprintf(temp_str,0,"%s","");
114  }
115 
116  return std::string(temp_str);
117 }
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int tidWheel(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
const SiStripHistoId& SiStripHistoId::operator= ( const SiStripHistoId )
private
std::string SiStripHistoId::returnIdPart ( std::string  histoid,
uint32_t  whichpart 
)
private

Definition at line 131 of file SiStripHistoId.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getComponentId(), and getComponentType().

131  {
132  size_t length1=histoid.find("__",0);
133  if(length1==std::string::npos){ // no separator1 found
134  edm::LogWarning("SiStripTkDQM|UnregularInput")<<"no regular histoid. Returning 0";
135  return "0";
136  }
137  std::string part1 = histoid.substr(0,length1); // part of 'histoid' up to 'separator1'
138  if(whichpart==1) return part1;
139  std::string remain1 = histoid.substr(length1+2); // rest of 'histoid' starting at end of 'separator1'
140  size_t length2=remain1.find("__",0);
141  if(length2==std::string::npos){ // no separator2 found
142  edm::LogWarning("SiStripTkDQM|UnregularInput")<<"no regular histoid. Returning 0";
143  return "0";
144  }
145  std::string part2 = remain1.substr(0,length2); // part of 'remain1' up to 'separator2'
146  if(whichpart==2) return part2;
147  std::string part3 = remain1.substr(length2+2); // rest of remain1 starting at end of 'separator2'
148  if(whichpart==3) return part3;
149  edm::LogWarning("SiStripTkDQM|UnregularInput")<<"no such whichpart="<<whichpart<<" returning 0";
150  return "0";
151 }