34 if ( d==
"TIB" )
return 3;
35 if ( d==
"TID" )
return 4;
36 if ( d==
"TOB" )
return 5;
37 if ( d==
"TEC" )
return 6;
48 return topo->
side( det_id );
62 std::size_t
m = tag.find(
"minus");
63 std::size_t
p = tag.find(
"plus");
64 if (m!=std::string::npos)
return 1;
65 if (p!=std::string::npos)
return 2;
93 std::size_t
p = (tag.find(
"layer")!=std::string::npos)? tag.find(
"layer") : tag.find(
"wheel");
94 if (p!=std::string::npos) {
95 std::size_t
start = tag.find(
"_",p+1) + 1;
96 std::size_t stop = tag.find(
'_',start);
98 return atoi( plane.c_str());
109 std::vector<MonitorElement*>
found = std::vector<MonitorElement*>();
113 auto it = histos.begin();
115 LogDebug(
"APVGainHelpers")<<
"sId: "<<sId<<
" sPlane: "<<sPlane<<
" sSide: "<<sSide<<std::endl;
117 while (it!=histos.end()) {
123 bool match = (subdetectorId==0 || subdetectorId==sId) && (subdetectorPlane==0 || subdetectorPlane==sPlane) && (subdetectorSide==0 || subdetectorSide==sSide);
126 found.emplace_back((*it).getMonitor());
127 LogDebug(
"APVGainHelpers")<<det_id<<
" found: "<< tag << std::endl;
139 std::vector<unsigned int> found_indices = std::vector<unsigned int>();
145 for(
auto &element : theMap){
151 bool match = (subdetectorId==0 || subdetectorId==sId) && (subdetectorPlane==0 || subdetectorPlane==sPlane) && (subdetectorSide==0 || subdetectorSide==sSide);
154 found_indices.push_back(element.first);
157 return found_indices;
160 std::vector<std::pair<std::string,std::string>>
163 std::vector<std::pair<std::string,std::string>>
out;
169 int re = (allPlanes)? countOfPlanes + VH.size() : VH.size();
173 if (Tag.length()) Tag =
"__" + Tag;
181 for(
int i=1;
i<=TIBlayers;
i++) {
182 h_tag =
"TIB_layer_" + std::to_string(
i) + Tag;
183 h_tit = h_tag;
std::replace(h_tit.begin(),h_tit.end(),
'_',
' ');
184 out.push_back(std::pair<std::string,std::string>(h_tag,h_tit));
188 for(
int i=1;
i<=TOBlayers;
i++) {
189 h_tag =
"TOB_layer_" + std::to_string(
i) + Tag;
190 h_tit = h_tag;
std::replace(h_tit.begin(),h_tit.end(),
'_',
' ');
191 out.push_back(std::pair<std::string,std::string>(h_tag,h_tit));
195 for(
int i=-TIDwheels;
i<=TIDwheels;
i++) {
197 if (
i<0) h_tag =
"TIDminus_wheel_" + std::to_string(
i) + Tag;
198 else h_tag =
"TIDplus_wheel_" + std::to_string(
i) + Tag;
199 h_tit = h_tag;
std::replace(h_tit.begin(),h_tit.end(),
'_',
' ');
200 out.push_back(std::pair<std::string,std::string>(h_tag,h_tit));
204 for(
int i=-TECwheels;
i<=TECwheels;
i++) {
206 if (
i<0) h_tag =
"TECminus_wheel_" + std::to_string(
i) + Tag;
207 else h_tag =
"TECplus_wheel_" + std::to_string(
i) + Tag;
208 h_tit = h_tag;
std::replace(h_tit.begin(),h_tit.end(),
'_',
' ');
209 out.push_back(std::pair<std::string,std::string>(h_tag,h_tit));
213 for(
unsigned int i=0;
i<VH.size();
i++) {
215 h_tit = h_tag;
std::replace(h_tit.begin(),h_tit.end(),
'_',
' ');
216 out.push_back(std::pair<std::string,std::string>(h_tag,h_tit));
unsigned int tibLayer(const DetId &id) const
unsigned int side(const DetId &id) const
int subdetectorPlane(uint32_t, const TrackerTopology *)
def replace(string, replacements)
unsigned int tidWheel(const DetId &id) const
std::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=0)
unsigned int tidSide(const DetId &id) const
std::vector< unsigned int > FetchIndices(std::map< unsigned int, APVloc >, uint32_t, const TrackerTopology *topo=0)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int subdetectorSide(uint32_t, const TrackerTopology *)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
unsigned int tecWheel(const DetId &id) const
int subdetectorId(uint32_t)
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const