35 size_t pos1 = description.find(
"__", 0 );
36 size_t pos2 = description.find(
"__", 0 );
38 std::ostringstream compid;
41 if ( pos1 == std::string::npos && pos2 == std::string::npos ){
42 if(id_type==
"fed" || id_type==
"det" || id_type==
"fec"){
43 local_histo_id = description +
"__" + id_type +
"__" + compid.str();
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.";
51 local_histo_id = description +
"_dummy___" + id_type +
"__" + compid.str();
52 edm::LogError(
"SiStripHistoId") <<
" SiStripHistoId::WrongInput "
53 <<
" histogram description cannot contain: __ or: __"
56 return local_histo_id;
60 size_t pos1 = description.find(
"__", 0 );
61 size_t pos2 = description.find(
"__", 0 );
63 if ( pos1 == std::string::npos && pos2 == std::string::npos ){
64 if(id_type==
"fed" || id_type==
"det" || id_type==
"fec" || id_type==
"layer"){
66 local_histo_id = description +
"__" + flag +
"__" + path;
68 local_histo_id = description +
"__" +
path;
69 LogTrace(
"SiStripHistoId") <<
"Local_histo_ID " << local_histo_id << std::endl;
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 ";
77 local_histo_id = description +
"_dummy___" +
path;
79 <<
" histogram description cannot contain: __ or: __"
82 return local_histo_id;
88 const int buf_len = 50;
89 char temp_str[buf_len];
95 snprintf(temp_str, buf_len,
"TIB__layer__%i", tTopo->
tibLayer(
id));
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));
104 snprintf(temp_str, buf_len,
"TOB__layer__%i",tTopo->
tobLayer(
id));
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));
112 edm::LogError(
"SiStripTkDQM|WrongInput")<<
"no such subdetector type :"<<subdet.
subdetId()<<
" no folder set!"<<std::endl;
113 snprintf(temp_str,0,
"%s",
"");
120 uint32_t local_component_id;
122 return local_component_id;
132 size_t length1=histoid.find(
"__",0);
133 if(length1==std::string::npos){
134 edm::LogWarning(
"SiStripTkDQM|UnregularInput")<<
"no regular histoid. Returning 0";
138 if(whichpart==1)
return part1;
140 size_t length2=remain1.find(
"__",0);
141 if(length2==std::string::npos){
142 edm::LogWarning(
"SiStripTkDQM|UnregularInput")<<
"no regular histoid. Returning 0";
146 if(whichpart==2)
return part2;
148 if(whichpart==3)
return part3;
149 edm::LogWarning(
"SiStripTkDQM|UnregularInput")<<
"no such whichpart="<<whichpart<<
" returning 0";
std::string getComponentType(std::string histoid)
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
std::string returnIdPart(std::string histoid, uint32_t whichpart)
unsigned int tidWheel(const DetId &id) const
uint32_t getComponentId(std::string histoid)
unsigned int tidSide(const DetId &id) const
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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)
unsigned int tecWheel(const DetId &id) const
virtual ~SiStripHistoId()
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const