34 size_t pos1 = description.find(
"__", 0 );
35 size_t pos2 = description.find(
"__", 0 );
37 std::ostringstream compid;
40 if ( pos1 == std::string::npos && pos2 == std::string::npos ){
41 if(id_type==
"fed" || id_type==
"det" || id_type==
"fec"){
42 local_histo_id = description +
"__" + id_type +
"__" + compid.str();
44 local_histo_id = description +
"__dummy__" + compid.str();
45 edm::LogError(
"SiStripHistoId") <<
" SiStripHistoId::WrongInput "
46 <<
" no such type of component accepted: "<<id_type
47 <<
" id_type can be: fed, det, or fec.";
50 local_histo_id = description +
"_dummy___" + id_type +
"__" + compid.str();
51 edm::LogError(
"SiStripHistoId") <<
" SiStripHistoId::WrongInput "
52 <<
" histogram description cannot contain: __ or: __"
55 return local_histo_id;
59 size_t pos1 = description.find(
"__", 0 );
60 size_t pos2 = description.find(
"__", 0 );
62 if ( pos1 == std::string::npos && pos2 == std::string::npos ){
63 if(id_type==
"fed" || id_type==
"det" || id_type==
"fec" || id_type==
"layer" || id_type==
"ring"){
65 local_histo_id = description +
"__" + flag +
"__" + path;
67 local_histo_id = description +
"__" +
path;
68 LogTrace(
"SiStripHistoId") <<
"Local_histo_ID " << local_histo_id << std::endl;
70 local_histo_id = description +
"___dummy___" +
path;
71 edm::LogError(
"SiStripHistoId") <<
" SiStripHistoId::WrongInput "
72 <<
" no such type of component accepted: "<<id_type
73 <<
" id_type can be: fed, det, fec or layer ";
76 local_histo_id = description +
"_dummy___" +
path;
78 <<
" histogram description cannot contain: __ or: __"
81 return local_histo_id;
86 const int buf_len = 50;
87 char temp_str[buf_len];
93 snprintf(temp_str, buf_len,
"TIB__layer__%i", tTopo->
tibLayer(
id));
97 const char *side =
"";
100 else if (tTopo->
tidSide(
id) == 2)
104 snprintf(temp_str, buf_len,
"TID__%s__ring__%i", side, tTopo->
tidRing(
id) );
106 snprintf(temp_str, buf_len,
"TID__%s__wheel__%i", side, tTopo->
tidWheel(
id));
111 snprintf(temp_str, buf_len,
"TOB__layer__%i",tTopo->
tobLayer(
id));
115 const char *side =
"";
118 else if (tTopo->
tecSide(
id) == 2)
122 snprintf(temp_str, buf_len,
"TEC__%s__ring__%i", side, tTopo->
tecRing(
id) );
134 snprintf(temp_str, buf_len,
"TEC__%s__wheel__%i", side, tTopo->
tecWheel(
id));
138 edm::LogError(
"SiStripTkDQM|WrongInput")<<
"no such subdetector type :"<<subdet.
subdetId()<<
" no folder set!"<<std::endl;
139 snprintf(temp_str,0,
"%s",
"");
146 uint32_t local_component_id;
148 return local_component_id;
158 size_t length1=histoid.find(
"__",0);
159 if(length1==std::string::npos){
160 edm::LogWarning(
"SiStripTkDQM|UnregularInput")<<
"no regular histoid. Returning 0";
164 if(whichpart==1)
return part1;
166 size_t length2=remain1.find(
"__",0);
167 if(length2==std::string::npos){
168 edm::LogWarning(
"SiStripTkDQM|UnregularInput")<<
"no regular histoid. Returning 0";
172 if(whichpart==2)
return part2;
174 if(whichpart==3)
return part3;
175 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
static std::string const input
uint32_t getComponentId(std::string histoid)
unsigned int tidSide(const DetId &id) const
tuple path
else: Piece not in the list, fine.
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