35 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : "
36 "String and layer level options can not be activated together"
85 constexpr
unsigned int kSLen = 128;
100 uint32_t requestedSide,
101 uint32_t requestedLayer) {
105 std::vector<uint32_t> requestedDetIds_;
106 requestedDetIds_.clear();
112 if (requestedSubDetector ==
"TIB") {
114 }
else if (requestedSubDetector ==
"TID") {
116 }
else if (requestedSubDetector ==
"TOB") {
118 }
else if (requestedSubDetector ==
"TEC") {
120 activeDetIds, requestedDetIds_, tTopo, requestedSide, requestedLayer, 0, 0, 0, 0);
137 std::vector<uint32_t> vdetIdsOnDemand_;
138 vdetIdsOnDemand_.push_back(detIdOnDemand);
146 const std::vector<uint32_t> &detIdsOnDemand) {
160 std::vector<uint32_t> cabledDetIds_;
164 return cabledDetIds_;
174 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] input detIds_: " << detIds_.size()
178 std::vector<DetIdSelector> included_subdetsels;
179 std::vector<std::string> included_subdets =
181 for (std::vector<std::string>::const_iterator wsdps = included_subdets.begin(); wsdps != included_subdets.end();
186 std::vector<uint32_t> modulesToBeIncluded;
187 for (std::vector<uint32_t>::const_iterator detid = detIds_.begin(); detid != detIds_.end(); ++detid) {
188 for (std::vector<DetIdSelector>::const_iterator detidsel = included_subdetsels.begin();
189 detidsel != included_subdetsels.end();
191 if (detidsel->isSelected(*detid)) {
192 modulesToBeIncluded.push_back(*detid);
202 std::vector<DetIdSelector> excluded_subdetsels;
203 std::vector<std::string> excluded_subdets =
205 for (std::vector<std::string>::const_iterator wsdps = excluded_subdets.begin(); wsdps != excluded_subdets.end();
210 std::vector<uint32_t> modulesToBeExcluded;
211 for (std::vector<uint32_t>::const_iterator detid = detIds_.begin(); detid != detIds_.end(); ++detid) {
212 for (std::vector<DetIdSelector>::const_iterator detidsel = excluded_subdetsels.begin();
213 detidsel != excluded_subdetsels.end();
215 if (detidsel->isSelected(*detid)) {
216 modulesToBeExcluded.push_back(*detid);
231 if (modulesToBeExcluded.empty() && modulesToBeIncluded.empty() &&
ModulesToBeExcluded_.empty() &&
233 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules "
234 "to be exclude/included in your cfg"
239 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeIncluded: " << modulesToBeIncluded.size() << std::endl;
242 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeExcluded: " << modulesToBeExcluded.size() << std::endl;
245 if (!modulesToBeIncluded.empty()) {
246 std::vector<uint32_t>
tmp;
249 set_intersection(detIds_.begin(),
251 modulesToBeIncluded.begin(),
252 modulesToBeIncluded.end(),
253 inserter(
tmp,
tmp.begin()));
257 std::sort(detIds_.begin(), detIds_.end());
258 if (!modulesToBeExcluded.empty()) {
259 for (std::vector<uint32_t>::const_iterator
mod = modulesToBeExcluded.begin();
mod != modulesToBeExcluded.end();
261 std::vector<uint32_t>::iterator detid =
std::lower_bound(detIds_.begin(), detIds_.end(), *
mod);
262 if (detid != detIds_.end())
263 detIds_.erase(detid);
272 std::vector<uint32_t>
tmp;
279 if (*modIter_ ==
"TIB") {
281 }
else if (*modIter_ ==
"TOB") {
283 }
else if (*modIter_ ==
"TID") {
285 }
else if (*modIter_ ==
"TEC") {
288 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no "
289 "correct (name) subdetector to be excluded in your cfg"
293 std::vector<uint32_t>::iterator iterBegin_ =
296 std::vector<uint32_t>::iterator iterEnd_ =
299 for (std::vector<uint32_t>::iterator detIter_ = iterEnd_; detIter_ != iterBegin_ - 1; detIter_--) {
300 detIds_.erase(detIter_);
306 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] output detIds_: " << detIds_.size()
313 std::vector<uint32_t>
tmp;
314 std::vector<uint32_t> layerDetIds;
316 for (
unsigned int i = 1;
i < 5;
i++) {
320 layerDetIds.push_back(*(
tmp.begin()));
323 for (
unsigned int i = 1;
i < 7;
i++) {
327 layerDetIds.push_back(*(
tmp.begin()));
330 for (
unsigned int i = 1;
i < 4;
i++) {
334 layerDetIds.push_back(*(
tmp.begin()));
338 layerDetIds.push_back(*(
tmp.begin()));
341 for (
unsigned int i = 1;
i < 10;
i++) {
345 layerDetIds.push_back(*(
tmp.begin()));
349 layerDetIds.push_back(*(
tmp.begin()));
354 detIds_ = layerDetIds;
364 std::map<uint32_t, ModMEs>::const_iterator ModMEsMap_iter =
ModMEsMap_.find(detId_);
367 CondObj_ME = ModMEsMap_iter->second;
376 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId "
392 ModMEsMap_.insert(std::make_pair(detId_, CondObj_ME));
400 std::map<uint32_t, ModMEs>::const_iterator SummaryMEsMap_iter;
466 const uint32_t &detId_,
468 int hProfile_NchX = 0;
469 double hProfile_LowX = 0;
470 double hProfile_HighX = 0;
482 hProfile_NchX = nStrip;
484 hProfile_HighX = nStrip + 0.5;
488 hProfile_NchX = nApv;
490 hProfile_HighX = nApv + 0.5;
499 hProfile = hProfile_Name;
510 const uint32_t &detId_,
513 double hCumul_LowX = 0;
514 double hCumul_HighX = 0;
534 hCumul_title = hCumul_name;
546 const uint32_t &detId_,
548 std::vector<uint32_t> sameLayerDetIds_;
550 int hSummaryOfProfile_NchX = 0;
551 double hSummaryOfProfile_LowX = 0;
552 double hSummaryOfProfile_HighX = 0;
557 std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle;
561 int hSummaryOfProfile_NchY;
562 double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY;
567 int nStrip, nApv, layerId_;
580 if ((layerId_ > 610 && layerId_ < 620) ||
581 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
582 (layerId_ > 420 && layerId_ < 424)) {
588 hSummaryOfProfile_NchX = nStrip;
589 hSummaryOfProfile_LowX = 0.5;
590 hSummaryOfProfile_HighX = nStrip + 0.5;
598 sameLayerDetIds_.clear();
600 switch (
DetId(detId_).subdetId()) {
616 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
617 hSummaryOfProfile_LowX = 0.5;
618 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
626 sameLayerDetIds_.clear();
628 switch (
DetId(detId_).subdetId()) {
650 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
651 hSummaryOfProfile_LowX = 0.5;
652 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
655 if ((layerId_ > 610 && layerId_ < 620) ||
656 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
657 (layerId_ > 420 && layerId_ < 424)) {
663 hSummaryOfProfile_NchX = nApv;
664 hSummaryOfProfile_LowX = 0.5;
665 hSummaryOfProfile_HighX = nApv + 0.5;
668 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : "
669 "x-axis label in your cfg"
682 int subdetectorId_ = ((detId_ >> 25) & 0x7);
684 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
685 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no "
686 "such subdetector type : "
687 << subdetectorId_ <<
" no folder set!" << std::endl;
696 hSummaryOfProfile_name =
701 hSummaryOfProfile_title = hSummaryOfProfile_name;
704 hSummaryOfProfile_title,
705 hSummaryOfProfile_NchX,
706 hSummaryOfProfile_LowX,
707 hSummaryOfProfile_HighX,
708 hSummaryOfProfile_NchY,
721 unsigned int iBin = 0;
723 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
725 char sameLayerDetIds_Name[1024];
726 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
732 reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin() + sameLayerDetIds_.size() / 2);
734 unsigned int iBin = 0;
735 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
744 char sameLayerDetIds_Name[1024];
745 if (subdetectorId_ == 3) {
747 sprintf(sameLayerDetIds_Name,
"%i", tTopo->
tibModule(sameLayerDetIds_[
i]));
749 sprintf(sameLayerDetIds_Name,
"%i", -tTopo->
tibModule(sameLayerDetIds_[
i]));
752 }
else if (subdetectorId_ == 5) {
754 sprintf(sameLayerDetIds_Name,
"%i", tTopo->
tobModule(sameLayerDetIds_[
i]));
756 sprintf(sameLayerDetIds_Name,
"%i", -tTopo->
tobModule(sameLayerDetIds_[
i]));
772 const uint32_t &detId_,
774 int hSummaryOfCumul_NchX = 0;
775 double hSummaryOfCumul_LowX = 0;
776 double hSummaryOfCumul_HighX = 0;
781 std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle;
798 int subdetectorId_ = ((detId_ >> 25) & 0x7);
800 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
801 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such "
802 "subdetector type : "
803 << subdetectorId_ <<
" no folder set!" << std::endl;
810 hSummaryOfCumul_name =
813 hSummaryOfCumul_name =
818 hSummaryOfCumul_title = hSummaryOfCumul_name;
821 hSummaryOfCumul_name, hSummaryOfCumul_title, hSummaryOfCumul_NchX, hSummaryOfCumul_LowX, hSummaryOfCumul_HighX);
832 const uint32_t &detId_,
834 std::vector<uint32_t> sameLayerDetIds_;
836 int hSummary_NchX = 0;
837 double hSummary_LowX = 0;
838 double hSummary_HighX = 0;
848 double hSummary_LowY, hSummary_HighY;
856 sameLayerDetIds_.clear();
860 hSummary_NchX = sameLayerDetIds_.size();
862 hSummary_HighX = sameLayerDetIds_.size() + 0.5;
873 int subdetectorId_ = ((detId_ >> 25) & 0x7);
875 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
876 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such "
877 "subdetector type : "
878 << subdetectorId_ <<
" no folder set!" << std::endl;
887 hSummary_title = hSummary_name;
890 hSummary_name, hSummary_title, hSummary_NchX, hSummary_LowX, hSummary_HighX, hSummary_NchY, 0., 0.);
899 unsigned int iBin = 0;
901 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
903 char sameLayerDetIds_Name[1024];
904 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
915 int subdetectorId_ = ((detId_ >> 25) & 0x7);
918 std::stringstream layerName;
920 if (subdetectorId_ == 3) {
922 for (
unsigned int i = 1;
i < 5;
i++) {
924 layerName <<
"TIB__layer__" <<
i;
931 else if (subdetectorId_ == 4) {
933 if (tTopo->
tidSide(detId_) == 1) {
935 for (
unsigned int i = 1;
i < 4;
i++) {
937 layerName <<
"TID__side__1__wheel__" <<
i;
944 else if (tTopo->
tidSide(detId_) == 2) {
946 for (
unsigned int i = 1;
i < 4;
i++) {
948 layerName <<
"TID__side__2__wheel__" <<
i;
956 else if (subdetectorId_ == 5) {
958 for (
unsigned int i = 1;
i < 7;
i++) {
960 layerName <<
"TOB__layer__" <<
i;
967 else if (subdetectorId_ == 6) {
969 if (tTopo->
tecSide(detId_) == 1) {
971 for (
unsigned int i = 1;
i < 10;
i++) {
973 layerName <<
"TEC__side__1__wheel__" <<
i;
980 else if (tTopo->
tecSide(detId_) == 2) {
982 for (
unsigned int i = 1;
i < 10;
i++) {
984 layerName <<
"TEC__side__2__wheel__" <<
i;
991 return std::make_pair(layerName.str(), layerId_);
999 int subdetectorId_ = ((detId_ >> 25) & 0x7);
1000 int layerStringId_ = 0;
1002 std::stringstream layerStringName;
1004 if (subdetectorId_ == 3) {
1006 for (
unsigned int i = 1;
i < 27;
i++) {
1008 layerStringName <<
"TIB_L1_Int_Str_" <<
i;
1009 layerStringId_ = 30110 +
i;
1013 for (
unsigned int i = 1;
i < 31;
i++) {
1015 layerStringName <<
"TIB_L1_Ext_Str_" <<
i;
1016 layerStringId_ = 301200 +
i;
1020 for (
unsigned int i = 1;
i < 35;
i++) {
1022 layerStringName <<
"TIB_L2_Int_Str_" <<
i;
1023 layerStringId_ = 302100 +
i;
1027 for (
unsigned int i = 1;
i < 39;
i++) {
1029 layerStringName <<
"TIB_L2_Ext_Str_" <<
i;
1030 layerStringId_ = 302200 +
i;
1034 for (
unsigned int i = 1;
i < 45;
i++) {
1036 layerStringName <<
"TIB_L3_Int_Str_" <<
i;
1037 layerStringId_ = 303100 +
i;
1041 for (
unsigned int i = 1;
i < 47;
i++) {
1043 layerStringName <<
"TIB_L3_Ext_Str_" <<
i;
1044 layerStringId_ = 303200 +
i;
1048 for (
unsigned int i = 1;
i < 53;
i++) {
1050 layerStringName <<
"TIB_L4_Int_Str_" <<
i;
1051 layerStringId_ = 304100 +
i;
1055 for (
unsigned int i = 1;
i < 57;
i++) {
1057 layerStringName <<
"TIB_L4_Ext_Str_" <<
i;
1058 layerStringId_ = 304200 +
i;
1064 else if (subdetectorId_ == 5) {
1065 if (tTopo->
tobLayer(detId_) == 1) {
1066 for (
unsigned int i = 1;
i < 43;
i++) {
1067 if (tTopo->
tobRod(detId_) ==
i) {
1068 layerStringName <<
"TOB_L1_Rod_" <<
i;
1069 layerStringId_ = 50100 +
i;
1072 }
else if (tTopo->
tobLayer(detId_) == 2) {
1073 for (
unsigned int i = 1;
i < 49;
i++) {
1074 if (tTopo->
tobRod(detId_) ==
i) {
1075 layerStringName <<
"TOB_L2_Rod_" <<
i;
1076 layerStringId_ = 50200 +
i;
1079 }
else if (tTopo->
tobLayer(detId_) == 3) {
1080 for (
unsigned int i = 1;
i < 55;
i++) {
1081 if (tTopo->
tobRod(detId_) ==
i) {
1082 layerStringName <<
"TOB_L3_Rod_" <<
i;
1083 layerStringId_ = 50300 +
i;
1086 }
else if (tTopo->
tobLayer(detId_) == 4) {
1087 for (
unsigned int i = 1;
i < 61;
i++) {
1088 if (tTopo->
tobRod(detId_) ==
i) {
1089 layerStringName <<
"TOB_L4_Rod_" <<
i;
1090 layerStringId_ = 50400 +
i;
1093 }
else if (tTopo->
tobLayer(detId_) == 5) {
1094 for (
unsigned int i = 1;
i < 67;
i++) {
1095 if (tTopo->
tobRod(detId_) ==
i) {
1096 layerStringName <<
"TOB_L5_Rod_" <<
i;
1097 layerStringId_ = 50500 +
i;
1100 }
else if (tTopo->
tobLayer(detId_) == 6) {
1101 for (
unsigned int i = 1;
i < 75;
i++) {
1102 if (tTopo->
tobRod(detId_) ==
i) {
1103 layerStringName <<
"TOB_L6_Rod_" <<
i;
1104 layerStringId_ = 50600 +
i;
1110 return std::make_pair(layerStringName.str(), layerStringId_);
1117 std::vector<uint32_t> sameLayerDetIds;
1118 sameLayerDetIds.clear();
1120 switch (
DetId(selDetId).subdetId()) {
1137 return sameLayerDetIds;
1153 size_t imin = 0, imax = 0;
1177 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap maxValue from " <<
maxValue <<
" to " << imax;
1182 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap minValue from " <<
minValue <<
" to " << imin;
1194 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"SiStripBaseCondObjDQM::end" << std::endl;
1206 for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
1219 for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
1226 selME = iter->second;