CMS 3D CMS Logo

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 &)=delete
 
std::string returnIdPart (std::string histoid, uint32_t whichpart)
 
 SiStripHistoId (const SiStripHistoId &)=delete
 

Detailed Description

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

Usage: <usage>

Definition at line 25 of file SiStripHistoId.h.

Constructor & Destructor Documentation

◆ SiStripHistoId() [1/2]

SiStripHistoId::SiStripHistoId ( )

Definition at line 22 of file SiStripHistoId.cc.

22 {}

◆ ~SiStripHistoId()

SiStripHistoId::~SiStripHistoId ( )
virtual

Definition at line 24 of file SiStripHistoId.cc.

24 {}

◆ SiStripHistoId() [2/2]

SiStripHistoId::SiStripHistoId ( const SiStripHistoId )
privatedelete

Member Function Documentation

◆ createHistoId()

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

Definition at line 26 of file SiStripHistoId.cc.

26  {
27  size_t pos1 = description.find("__", 0); // check if std::string 'description' contains by mistake the 'separator1'
28  size_t pos2 = description.find("__", 0); // check if std::string 'description' contains by mistake the 'separator2'
29  std::string local_histo_id;
30  std::ostringstream compid;
31  compid << component_id; // use std::ostringstream for casting integer to std::string
32 
33  if (pos1 == std::string::npos && pos2 == std::string::npos) { // ok, not found either separator
34  if (id_type == "fed" || id_type == "det" || id_type == "fec") { // ok! is one of the accepted id_type-s
35  local_histo_id = description + "__" + id_type + "__" + compid.str();
36  } else {
37  local_histo_id = description + "__dummy__" + compid.str();
38  edm::LogError("SiStripHistoId") << " SiStripHistoId::WrongInput "
39  << " no such type of component accepted: " << id_type
40  << " id_type can be: fed, det, or fec.";
41  }
42  } else {
43  local_histo_id = description + "_dummy___" + id_type + "__" + compid.str();
44  edm::LogError("SiStripHistoId") << " SiStripHistoId::WrongInput "
45  << " histogram description cannot contain: __ or: __"
46  << " histogram description = " << description;
47  }
48  return local_histo_id;
49 }

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

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

◆ createHistoLayer()

std::string SiStripHistoId::createHistoLayer ( std::string  description,
std::string  id_type,
std::string  path,
std::string  flag 
)

Definition at line 51 of file SiStripHistoId.cc.

54  {
55  size_t pos1 = description.find("__", 0); // check if std::string 'description' contains by mistake the 'separator1'
56  size_t pos2 = description.find("__", 0); // check if std::string 'description' contains by mistake the 'separator2'
57  std::string local_histo_id;
58  if (pos1 == std::string::npos && pos2 == std::string::npos) { // ok, not found either separator
59  if (id_type == "fed" || id_type == "det" || id_type == "fec" || id_type == "layer" ||
60  id_type == "ring") { // ok! is one of the accepted id_type-s
61  if (!flag.empty())
62  local_histo_id = description + "__" + flag + "__" + path;
63  else
64  local_histo_id = description + "__" + path;
65  LogTrace("SiStripHistoId") << "Local_histo_ID " << local_histo_id << std::endl;
66  } else {
67  local_histo_id = description + "___dummy___" + path;
68  edm::LogError("SiStripHistoId") << " SiStripHistoId::WrongInput "
69  << " no such type of component accepted: " << id_type
70  << " id_type can be: fed, det, fec or layer ";
71  }
72  } else {
73  local_histo_id = description + "_dummy___" + path;
74  edm::LogWarning("SiStripHistoId") << " SiStripHistoId::WrongInput "
75  << " histogram description cannot contain: __ or: __"
76  << " histogram description = " << description;
77  }
78  return local_histo_id;
79 }

References edmLumisInFiles::description, RemoveAddSevLevel::flag, LogTrace, castor_dqm_sourceclient_file_cfg::path, and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ getComponentId()

uint32_t SiStripHistoId::getComponentId ( std::string  histoid)

Definition at line 143 of file SiStripHistoId.cc.

143  {
144  uint32_t local_component_id;
145  std::istringstream input(returnIdPart(histoid, 3));
146  input >> local_component_id; // use std::istringstream for casting from std::string to uint32_t
147  return local_component_id;
148 }

References input, and returnIdPart().

Referenced by SiStripCalibLorentzAngle::algoBeginJob().

◆ getComponentType()

std::string SiStripHistoId::getComponentType ( std::string  histoid)

Definition at line 150 of file SiStripHistoId.cc.

150 { return returnIdPart(histoid, 2); }

References returnIdPart().

◆ getSubdetid()

std::string SiStripHistoId::getSubdetid ( uint32_t  id,
const TrackerTopology tTopo,
bool  flag_ring 
)

Definition at line 82 of file SiStripHistoId.cc.

82  {
83  const int buf_len = 50;
84  char temp_str[buf_len];
85 
86  StripSubdetector subdet(id);
87  if (subdet.subdetId() == StripSubdetector::TIB) {
88  // --------------------------- TIB --------------------------- //
89 
90  snprintf(temp_str, buf_len, "TIB__layer__%i", tTopo->tibLayer(id));
91  } else if (subdet.subdetId() == StripSubdetector::TID) {
92  // --------------------------- TID --------------------------- //
93 
94  const char *side = "";
95  if (tTopo->tidSide(id) == 1)
96  side = "MINUS";
97  else if (tTopo->tidSide(id) == 2)
98  side = "PLUS";
99 
100  if (flag_ring)
101  snprintf(temp_str, buf_len, "TID__%s__ring__%i", side, tTopo->tidRing(id));
102  else
103  snprintf(temp_str, buf_len, "TID__%s__wheel__%i", side, tTopo->tidWheel(id));
104 
105  } else if (subdet.subdetId() == StripSubdetector::TOB) {
106  // --------------------------- TOB --------------------------- //
107 
108  snprintf(temp_str, buf_len, "TOB__layer__%i", tTopo->tobLayer(id));
109  } else if (subdet.subdetId() == StripSubdetector::TEC) {
110  // --------------------------- TEC --------------------------- //
111 
112  const char *side = "";
113  if (tTopo->tecSide(id) == 1)
114  side = "MINUS";
115  else if (tTopo->tecSide(id) == 2)
116  side = "PLUS";
117 
118  if (flag_ring)
119  snprintf(temp_str, buf_len, "TEC__%s__ring__%i", side, tTopo->tecRing(id));
120  else {
121  /*
122  if (flag_thickness) {
123  uint32_t ring = tTopo->tecRing(id);
124  if ( ring >= 1 && ring <= 4 )
125  snprintf(temp_str, buf_len, "TEC__%s__wheel__%i__THIN", side.c_str(), tTopo->tecWheel(id));
126  else
127  snprintf(temp_str, buf_len, "TEC__%s__wheel__%i__THICK", side.c_str(), tTopo->tecWheel(id));
128  }
129  else
130 */
131  snprintf(temp_str, buf_len, "TEC__%s__wheel__%i", side, tTopo->tecWheel(id));
132  }
133  } else {
134  // --------------------------- ??? --------------------------- //
135  edm::LogError("SiStripTkDQM|WrongInput")
136  << "no such subdetector type :" << subdet.subdetId() << " no folder set!" << std::endl;
137  snprintf(temp_str, 0, "%s", "");
138  }
139 
140  return std::string(temp_str);
141 }

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 SiStripRecHitsValid::analyze(), SiStripTrackingRecHitsValid::analyze(), SiStripMonitorTrack::book(), SiStripMonitorDigi::createMEs(), SiStripMonitorCluster::createMEs(), SiStripRecHitsValid::createMEs(), SiStripTrackingRecHitsValid::createMEs(), and SiStripMonitorTrack::findMEs().

◆ operator=()

const SiStripHistoId& SiStripHistoId::operator= ( const SiStripHistoId )
privatedelete

◆ returnIdPart()

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

Definition at line 152 of file SiStripHistoId.cc.

152  {
153  size_t length1 = histoid.find("__", 0);
154  if (length1 == std::string::npos) { // no separator1 found
155  edm::LogWarning("SiStripTkDQM|UnregularInput") << "no regular histoid. Returning 0";
156  return "0";
157  }
158  std::string part1 = histoid.substr(0, length1); // part of 'histoid' up to 'separator1'
159  if (whichpart == 1)
160  return part1;
161  std::string remain1 = histoid.substr(length1 + 2); // rest of 'histoid' starting at end of 'separator1'
162  size_t length2 = remain1.find("__", 0);
163  if (length2 == std::string::npos) { // no separator2 found
164  edm::LogWarning("SiStripTkDQM|UnregularInput") << "no regular histoid. Returning 0";
165  return "0";
166  }
167  std::string part2 = remain1.substr(0, length2); // part of 'remain1' up to 'separator2'
168  if (whichpart == 2)
169  return part2;
170  std::string part3 = remain1.substr(length2 + 2); // rest of remain1 starting at end of 'separator2'
171  if (whichpart == 3)
172  return part3;
173  edm::LogWarning("SiStripTkDQM|UnregularInput") << "no such whichpart=" << whichpart << " returning 0";
174  return "0";
175 }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getComponentId(), and getComponentType().

input
static const std::string input
Definition: EdmProvDump.cc:48
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
StripSubdetector
Definition: StripSubdetector.h:12
SiStripHistoId::returnIdPart
std::string returnIdPart(std::string histoid, uint32_t whichpart)
Definition: SiStripHistoId.cc:152
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184