29 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : "
30 "String and layer level options can not be activated together"
68 constexpr
unsigned int kSLen = 128;
81 uint32_t requestedSide,
82 uint32_t requestedLayer) {
86 std::vector<uint32_t> requestedDetIds_;
87 requestedDetIds_.clear();
89 if (requestedSubDetector ==
"TIB") {
91 }
else if (requestedSubDetector ==
"TID") {
93 }
else if (requestedSubDetector ==
"TOB") {
95 }
else if (requestedSubDetector ==
"TEC") {
107 std::vector<uint32_t> vdetIdsOnDemand_;
108 vdetIdsOnDemand_.push_back(detIdOnDemand);
115 const std::vector<uint32_t> &detIdsOnDemand) {
124 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] input detIds_: " << detIds_.size()
128 std::vector<DetIdSelector> included_subdetsels;
129 std::vector<std::string> included_subdets =
131 for (std::vector<std::string>::const_iterator wsdps = included_subdets.begin(); wsdps != included_subdets.end();
136 std::vector<uint32_t> modulesToBeIncluded;
137 for (
const auto detid : detIds_) {
138 for (
const auto &detidsel : included_subdetsels) {
139 if (detidsel.isSelected(detid)) {
140 modulesToBeIncluded.push_back(detid);
150 std::vector<DetIdSelector> excluded_subdetsels;
151 std::vector<std::string> excluded_subdets =
153 excluded_subdetsels.reserve(excluded_subdets.size());
154 for (
const auto &wsdps : excluded_subdets) {
158 std::vector<uint32_t> modulesToBeExcluded;
159 for (
const auto detid : detIds_) {
160 for (
const auto &detidsel : excluded_subdetsels) {
161 if (detidsel.isSelected(detid)) {
162 modulesToBeExcluded.push_back(detid);
177 if (modulesToBeExcluded.empty() && modulesToBeIncluded.empty() &&
ModulesToBeExcluded_.empty() &&
179 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules "
180 "to be exclude/included in your cfg"
185 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeIncluded: " << modulesToBeIncluded.size() << std::endl;
188 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeExcluded: " << modulesToBeExcluded.size() << std::endl;
191 if (!modulesToBeIncluded.empty()) {
192 std::vector<uint32_t>
tmp;
195 set_intersection(detIds_.begin(),
197 modulesToBeIncluded.begin(),
198 modulesToBeIncluded.end(),
199 inserter(
tmp,
tmp.begin()));
203 std::sort(detIds_.begin(), detIds_.end());
204 if (!modulesToBeExcluded.empty()) {
205 for (
const auto mod : modulesToBeExcluded) {
207 if (detid != detIds_.end())
208 detIds_.erase(detid);
217 std::vector<uint32_t>
tmp;
224 }
else if (
mod ==
"TOB") {
226 }
else if (
mod ==
"TID") {
228 }
else if (
mod ==
"TEC") {
231 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no "
232 "correct (name) subdetector to be excluded in your cfg"
236 const auto iterBegin_ =
std::lower_bound(detIds_.begin(), detIds_.end(), *min_element(
tmp.begin(),
tmp.end()));
238 const auto iterEnd_ =
std::lower_bound(detIds_.begin(), detIds_.end(), *max_element(
tmp.begin(),
tmp.end()));
240 for (
auto detIter_ = iterEnd_; detIter_ != iterBegin_ - 1; detIter_--) {
241 detIds_.erase(detIter_);
247 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] output detIds_: " << detIds_.size()
254 std::vector<uint32_t>
tmp;
255 std::vector<uint32_t> layerDetIds;
257 for (
unsigned int i = 1;
i < 5;
i++) {
261 layerDetIds.push_back(*(
tmp.begin()));
264 for (
unsigned int i = 1;
i < 7;
i++) {
268 layerDetIds.push_back(*(
tmp.begin()));
271 for (
unsigned int i = 1;
i < 4;
i++) {
275 layerDetIds.push_back(*(
tmp.begin()));
279 layerDetIds.push_back(*(
tmp.begin()));
282 for (
unsigned int i = 1;
i < 10;
i++) {
286 layerDetIds.push_back(*(
tmp.begin()));
290 layerDetIds.push_back(*(
tmp.begin()));
295 detIds_ = layerDetIds;
302 const auto ModMEsMap_iter =
ModMEsMap_.find(detId_);
305 CondObj_ME = ModMEsMap_iter->second;
314 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId "
330 ModMEsMap_.insert(std::make_pair(detId_, CondObj_ME));
335 std::map<uint32_t, ModMEs>::const_iterator SummaryMEsMap_iter;
401 int hProfile_NchX = 0;
402 double hProfile_LowX = 0;
403 double hProfile_HighX = 0;
415 hProfile_NchX = nStrip;
417 hProfile_HighX = nStrip + 0.5;
421 hProfile_NchX = nApv;
423 hProfile_HighX = nApv + 0.5;
432 hProfile = hProfile_Name;
444 double hCumul_LowX = 0;
445 double hCumul_HighX = 0;
465 hCumul_title = hCumul_name;
477 std::vector<uint32_t> sameLayerDetIds_;
479 int hSummaryOfProfile_NchX = 0;
480 double hSummaryOfProfile_LowX = 0;
481 double hSummaryOfProfile_HighX = 0;
486 std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle;
490 int hSummaryOfProfile_NchY;
491 double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY;
496 int nStrip, nApv, layerId_;
509 if ((layerId_ > 610 && layerId_ < 620) ||
510 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
511 (layerId_ > 420 && layerId_ < 424)) {
517 hSummaryOfProfile_NchX = nStrip;
518 hSummaryOfProfile_LowX = 0.5;
519 hSummaryOfProfile_HighX = nStrip + 0.5;
527 sameLayerDetIds_.clear();
529 switch (
DetId(detId_).subdetId()) {
545 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
546 hSummaryOfProfile_LowX = 0.5;
547 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
555 sameLayerDetIds_.clear();
557 switch (
DetId(detId_).subdetId()) {
579 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
580 hSummaryOfProfile_LowX = 0.5;
581 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
584 if ((layerId_ > 610 && layerId_ < 620) ||
585 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
586 (layerId_ > 420 && layerId_ < 424)) {
592 hSummaryOfProfile_NchX = nApv;
593 hSummaryOfProfile_LowX = 0.5;
594 hSummaryOfProfile_HighX = nApv + 0.5;
597 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : "
598 "x-axis label in your cfg"
611 int subdetectorId_ = ((detId_ >> 25) & 0x7);
613 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
614 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no "
615 "such subdetector type : "
616 << subdetectorId_ <<
" no folder set!" << std::endl;
622 hSummaryOfProfile_name =
625 hSummaryOfProfile_name =
630 hSummaryOfProfile_title = hSummaryOfProfile_name;
633 hSummaryOfProfile_title,
634 hSummaryOfProfile_NchX,
635 hSummaryOfProfile_LowX,
636 hSummaryOfProfile_HighX,
637 hSummaryOfProfile_NchY,
650 unsigned int iBin = 0;
652 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
654 char sameLayerDetIds_Name[1024];
655 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
661 reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin() + sameLayerDetIds_.size() / 2);
663 unsigned int iBin = 0;
664 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
673 char sameLayerDetIds_Name[1024];
674 if (subdetectorId_ == 3) {
676 sprintf(sameLayerDetIds_Name,
"%i",
tTopo_->
tibModule(sameLayerDetIds_[
i]));
678 sprintf(sameLayerDetIds_Name,
"%i", -
tTopo_->
tibModule(sameLayerDetIds_[
i]));
681 }
else if (subdetectorId_ == 5) {
683 sprintf(sameLayerDetIds_Name,
"%i",
tTopo_->
tobModule(sameLayerDetIds_[
i]));
685 sprintf(sameLayerDetIds_Name,
"%i", -
tTopo_->
tobModule(sameLayerDetIds_[
i]));
698 int hSummaryOfCumul_NchX = 0;
699 double hSummaryOfCumul_LowX = 0;
700 double hSummaryOfCumul_HighX = 0;
705 std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle;
722 int subdetectorId_ = ((detId_ >> 25) & 0x7);
724 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
725 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such "
726 "subdetector type : "
727 << subdetectorId_ <<
" no folder set!" << std::endl;
734 hSummaryOfCumul_name =
737 hSummaryOfCumul_name =
742 hSummaryOfCumul_title = hSummaryOfCumul_name;
745 hSummaryOfCumul_name, hSummaryOfCumul_title, hSummaryOfCumul_NchX, hSummaryOfCumul_LowX, hSummaryOfCumul_HighX);
753 std::vector<uint32_t> sameLayerDetIds_;
755 int hSummary_NchX = 0;
756 double hSummary_LowX = 0;
757 double hSummary_HighX = 0;
767 double hSummary_LowY, hSummary_HighY;
775 sameLayerDetIds_.clear();
779 hSummary_NchX = sameLayerDetIds_.size();
781 hSummary_HighX = sameLayerDetIds_.size() + 0.5;
792 int subdetectorId_ = ((detId_ >> 25) & 0x7);
794 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
795 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such "
796 "subdetector type : "
797 << subdetectorId_ <<
" no folder set!" << std::endl;
805 hSummary_title = hSummary_name;
808 hSummary_name, hSummary_title, hSummary_NchX, hSummary_LowX, hSummary_HighX, hSummary_NchY, 0., 0.);
817 unsigned int iBin = 0;
819 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
821 char sameLayerDetIds_Name[1024];
822 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
829 int subdetectorId_ = ((detId_ >> 25) & 0x7);
834 if (subdetectorId_ == 3) {
836 for (
unsigned int i = 1;
i < 5;
i++) {
845 else if (subdetectorId_ == 4) {
849 for (
unsigned int i = 1;
i < 4;
i++) {
860 for (
unsigned int i = 1;
i < 4;
i++) {
870 else if (subdetectorId_ == 5) {
872 for (
unsigned int i = 1;
i < 7;
i++) {
881 else if (subdetectorId_ == 6) {
885 for (
unsigned int i = 1;
i < 10;
i++) {
896 for (
unsigned int i = 1;
i < 10;
i++) {
905 return std::make_pair(
layerName.str(), layerId_);
909 int subdetectorId_ = ((detId_ >> 25) & 0x7);
910 int layerStringId_ = 0;
912 std::stringstream layerStringName;
914 if (subdetectorId_ == 3) {
916 for (
unsigned int i = 1;
i < 27;
i++) {
918 layerStringName <<
"TIB_L1_Int_Str_" <<
i;
919 layerStringId_ = 30110 +
i;
923 for (
unsigned int i = 1;
i < 31;
i++) {
925 layerStringName <<
"TIB_L1_Ext_Str_" <<
i;
926 layerStringId_ = 301200 +
i;
930 for (
unsigned int i = 1;
i < 35;
i++) {
932 layerStringName <<
"TIB_L2_Int_Str_" <<
i;
933 layerStringId_ = 302100 +
i;
937 for (
unsigned int i = 1;
i < 39;
i++) {
939 layerStringName <<
"TIB_L2_Ext_Str_" <<
i;
940 layerStringId_ = 302200 +
i;
944 for (
unsigned int i = 1;
i < 45;
i++) {
946 layerStringName <<
"TIB_L3_Int_Str_" <<
i;
947 layerStringId_ = 303100 +
i;
951 for (
unsigned int i = 1;
i < 47;
i++) {
953 layerStringName <<
"TIB_L3_Ext_Str_" <<
i;
954 layerStringId_ = 303200 +
i;
958 for (
unsigned int i = 1;
i < 53;
i++) {
960 layerStringName <<
"TIB_L4_Int_Str_" <<
i;
961 layerStringId_ = 304100 +
i;
965 for (
unsigned int i = 1;
i < 57;
i++) {
967 layerStringName <<
"TIB_L4_Ext_Str_" <<
i;
968 layerStringId_ = 304200 +
i;
974 else if (subdetectorId_ == 5) {
976 for (
unsigned int i = 1;
i < 43;
i++) {
978 layerStringName <<
"TOB_L1_Rod_" <<
i;
979 layerStringId_ = 50100 +
i;
983 for (
unsigned int i = 1;
i < 49;
i++) {
985 layerStringName <<
"TOB_L2_Rod_" <<
i;
986 layerStringId_ = 50200 +
i;
990 for (
unsigned int i = 1;
i < 55;
i++) {
992 layerStringName <<
"TOB_L3_Rod_" <<
i;
993 layerStringId_ = 50300 +
i;
997 for (
unsigned int i = 1;
i < 61;
i++) {
999 layerStringName <<
"TOB_L4_Rod_" <<
i;
1000 layerStringId_ = 50400 +
i;
1004 for (
unsigned int i = 1;
i < 67;
i++) {
1006 layerStringName <<
"TOB_L5_Rod_" <<
i;
1007 layerStringId_ = 50500 +
i;
1011 for (
unsigned int i = 1;
i < 75;
i++) {
1013 layerStringName <<
"TOB_L6_Rod_" <<
i;
1014 layerStringId_ = 50600 +
i;
1020 return std::make_pair(layerStringName.str(), layerStringId_);
1024 uint32_t selDetId) {
1025 std::vector<uint32_t> sameLayerDetIds;
1026 sameLayerDetIds.clear();
1028 switch (
DetId(selDetId).subdetId()) {
1045 return sameLayerDetIds;
1058 size_t imin = 0, imax = 0;
1082 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap maxValue from " <<
maxValue <<
" to " << imax;
1087 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap minValue from " <<
minValue <<
" to " << imin;
1098 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"SiStripBaseCondObjDQM::end" << std::endl;
1103 for (
const auto det : selectedDetIds) {
1110 for (
const auto det : selectedDetIds) {