30 std::ostringstream compid;
31 compid << component_id;
33 if (pos1 == std::string::npos && pos2 == std::string::npos) {
34 if (id_type ==
"fed" || id_type ==
"det" || id_type ==
"fec") {
35 local_histo_id =
description +
"__" + id_type +
"__" + compid.str();
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.";
43 local_histo_id =
description +
"_dummy___" + id_type +
"__" + compid.str();
44 edm::LogError(
"SiStripHistoId") <<
" SiStripHistoId::WrongInput " 45 <<
" histogram description cannot contain: __ or: __" 48 return local_histo_id;
58 if (pos1 == std::string::npos && pos2 == std::string::npos) {
59 if (id_type ==
"fed" || id_type ==
"det" || id_type ==
"fec" || id_type ==
"layer" ||
65 LogTrace(
"SiStripHistoId") <<
"Local_histo_ID " << local_histo_id << std::endl;
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 ";
75 <<
" histogram description cannot contain: __ or: __" 78 return local_histo_id;
83 const int buf_len = 50;
84 char temp_str[buf_len];
90 snprintf(temp_str, buf_len,
"TIB__layer__%i", tTopo->
tibLayer(
id));
94 const char *
side =
"";
97 else if (tTopo->
tidSide(
id) == 2)
101 snprintf(temp_str, buf_len,
"TID__%s__ring__%i",
side, tTopo->
tidRing(
id));
103 snprintf(temp_str, buf_len,
"TID__%s__wheel__%i",
side, tTopo->
tidWheel(
id));
108 snprintf(temp_str, buf_len,
"TOB__layer__%i", tTopo->
tobLayer(
id));
112 const char *
side =
"";
115 else if (tTopo->
tecSide(
id) == 2)
119 snprintf(temp_str, buf_len,
"TEC__%s__ring__%i",
side, tTopo->
tecRing(
id));
131 snprintf(temp_str, buf_len,
"TEC__%s__wheel__%i",
side, tTopo->
tecWheel(
id));
136 <<
"no such subdetector type :" << subdet.
subdetId() <<
" no folder set!" << std::endl;
137 snprintf(temp_str, 0,
"%s",
"");
144 uint32_t local_component_id;
146 input >> local_component_id;
147 return local_component_id;
153 size_t length1 = histoid.find(
"__", 0);
154 if (length1 == std::string::npos) {
155 edm::LogWarning(
"SiStripTkDQM|UnregularInput") <<
"no regular histoid. Returning 0";
162 size_t length2 = remain1.find(
"__", 0);
163 if (length2 == std::string::npos) {
164 edm::LogWarning(
"SiStripTkDQM|UnregularInput") <<
"no regular histoid. Returning 0";
173 edm::LogWarning(
"SiStripTkDQM|UnregularInput") <<
"no such whichpart=" << whichpart <<
" returning 0";
static constexpr auto TEC
std::string getComponentType(std::string histoid)
unsigned int tobLayer(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
ALPAKA_FN_ACC int side(int ieta, int iphi)
std::string returnIdPart(std::string histoid, uint32_t whichpart)
Log< level::Error, false > LogError
unsigned int tecRing(const DetId &id) const
ring id
static std::string const input
uint32_t getComponentId(std::string histoid)
unsigned int tecSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
static constexpr auto TIB
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
unsigned int tidRing(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
Log< level::Warning, false > LogWarning
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
static constexpr auto TID
virtual ~SiStripHistoId()