28 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : "
29 "String and layer level options can not be activated together"
67 constexpr
unsigned int kSLen = 128;
80 uint32_t requestedSide,
81 uint32_t requestedLayer) {
85 std::vector<uint32_t> requestedDetIds_;
86 requestedDetIds_.clear();
88 if (requestedSubDetector ==
"TIB") {
90 }
else if (requestedSubDetector ==
"TID") {
92 }
else if (requestedSubDetector ==
"TOB") {
94 }
else if (requestedSubDetector ==
"TEC") {
106 std::vector<uint32_t> vdetIdsOnDemand_;
107 vdetIdsOnDemand_.push_back(detIdOnDemand);
114 const std::vector<uint32_t> &detIdsOnDemand) {
123 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] input detIds_: " << detIds_.size()
127 std::vector<DetIdSelector> included_subdetsels;
128 std::vector<std::string> included_subdets =
130 for (std::vector<std::string>::const_iterator wsdps = included_subdets.begin(); wsdps != included_subdets.end();
135 std::vector<uint32_t> modulesToBeIncluded;
136 for (
const auto detid : detIds_) {
137 for (
const auto &detidsel : included_subdetsels) {
138 if (detidsel.isSelected(detid)) {
139 modulesToBeIncluded.push_back(detid);
149 std::vector<DetIdSelector> excluded_subdetsels;
150 std::vector<std::string> excluded_subdets =
152 excluded_subdetsels.reserve(excluded_subdets.size());
153 for (
const auto &wsdps : excluded_subdets) {
157 std::vector<uint32_t> modulesToBeExcluded;
158 for (
const auto detid : detIds_) {
159 for (
const auto &detidsel : excluded_subdetsels) {
160 if (detidsel.isSelected(detid)) {
161 modulesToBeExcluded.push_back(detid);
176 if (modulesToBeExcluded.empty() && modulesToBeIncluded.empty() &&
ModulesToBeExcluded_.empty() &&
178 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules "
179 "to be exclude/included in your cfg"
184 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeIncluded: " << modulesToBeIncluded.size() << std::endl;
187 <<
"[SiStripBaseCondObjDQM::selectModules] modulesToBeExcluded: " << modulesToBeExcluded.size() << std::endl;
190 if (!modulesToBeIncluded.empty()) {
191 std::vector<uint32_t>
tmp;
194 set_intersection(detIds_.begin(),
196 modulesToBeIncluded.begin(),
197 modulesToBeIncluded.end(),
198 inserter(
tmp,
tmp.begin()));
202 std::sort(detIds_.begin(), detIds_.end());
203 if (!modulesToBeExcluded.empty()) {
204 for (
const auto mod : modulesToBeExcluded) {
206 if (detid != detIds_.end())
207 detIds_.erase(detid);
216 std::vector<uint32_t>
tmp;
223 }
else if (
mod ==
"TOB") {
225 }
else if (
mod ==
"TID") {
227 }
else if (
mod ==
"TEC") {
230 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no "
231 "correct (name) subdetector to be excluded in your cfg"
235 const auto iterBegin_ =
std::lower_bound(detIds_.begin(), detIds_.end(), *min_element(
tmp.begin(),
tmp.end()));
237 const auto iterEnd_ =
std::lower_bound(detIds_.begin(), detIds_.end(), *max_element(
tmp.begin(),
tmp.end()));
239 for (
auto detIter_ = iterEnd_; detIter_ != iterBegin_ - 1; detIter_--) {
240 detIds_.erase(detIter_);
246 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::selectModules] output detIds_: " << detIds_.size()
253 std::vector<uint32_t>
tmp;
254 std::vector<uint32_t> layerDetIds;
256 for (
unsigned int i = 1;
i < 5;
i++) {
260 layerDetIds.push_back(*(
tmp.begin()));
263 for (
unsigned int i = 1;
i < 7;
i++) {
267 layerDetIds.push_back(*(
tmp.begin()));
270 for (
unsigned int i = 1;
i < 4;
i++) {
274 layerDetIds.push_back(*(
tmp.begin()));
278 layerDetIds.push_back(*(
tmp.begin()));
281 for (
unsigned int i = 1;
i < 10;
i++) {
285 layerDetIds.push_back(*(
tmp.begin()));
289 layerDetIds.push_back(*(
tmp.begin()));
294 detIds_ = layerDetIds;
301 const auto ModMEsMap_iter =
ModMEsMap_.find(detId_);
304 CondObj_ME = ModMEsMap_iter->second;
313 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId "
329 ModMEsMap_.insert(std::make_pair(detId_, CondObj_ME));
334 std::map<uint32_t, ModMEs>::const_iterator SummaryMEsMap_iter;
400 int hProfile_NchX = 0;
401 double hProfile_LowX = 0;
402 double hProfile_HighX = 0;
414 hProfile_NchX = nStrip;
416 hProfile_HighX = nStrip + 0.5;
420 hProfile_NchX = nApv;
422 hProfile_HighX = nApv + 0.5;
431 hProfile = hProfile_Name;
443 double hCumul_LowX = 0;
444 double hCumul_HighX = 0;
464 hCumul_title = hCumul_name;
476 std::vector<uint32_t> sameLayerDetIds_;
478 int hSummaryOfProfile_NchX = 0;
479 double hSummaryOfProfile_LowX = 0;
480 double hSummaryOfProfile_HighX = 0;
485 std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle;
489 int hSummaryOfProfile_NchY;
490 double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY;
495 int nStrip, nApv, layerId_;
508 if ((layerId_ > 610 && layerId_ < 620) ||
509 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
510 (layerId_ > 420 && layerId_ < 424)) {
516 hSummaryOfProfile_NchX = nStrip;
517 hSummaryOfProfile_LowX = 0.5;
518 hSummaryOfProfile_HighX = nStrip + 0.5;
526 sameLayerDetIds_.clear();
528 switch (
DetId(detId_).subdetId()) {
544 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
545 hSummaryOfProfile_LowX = 0.5;
546 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
554 sameLayerDetIds_.clear();
556 switch (
DetId(detId_).subdetId()) {
578 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
579 hSummaryOfProfile_LowX = 0.5;
580 hSummaryOfProfile_HighX = sameLayerDetIds_.size() + 0.5;
583 if ((layerId_ > 610 && layerId_ < 620) ||
584 (layerId_ > 620 && layerId_ < 630) || (layerId_ > 410 && layerId_ < 414) ||
585 (layerId_ > 420 && layerId_ < 424)) {
591 hSummaryOfProfile_NchX = nApv;
592 hSummaryOfProfile_LowX = 0.5;
593 hSummaryOfProfile_HighX = nApv + 0.5;
596 edm::LogWarning(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : "
597 "x-axis label in your cfg"
610 int subdetectorId_ = ((detId_ >> 25) & 0x7);
612 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
613 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no "
614 "such subdetector type : "
615 << subdetectorId_ <<
" no folder set!" << std::endl;
621 hSummaryOfProfile_name =
624 hSummaryOfProfile_name =
629 hSummaryOfProfile_title = hSummaryOfProfile_name;
632 hSummaryOfProfile_title,
633 hSummaryOfProfile_NchX,
634 hSummaryOfProfile_LowX,
635 hSummaryOfProfile_HighX,
636 hSummaryOfProfile_NchY,
649 unsigned int iBin = 0;
651 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
653 char sameLayerDetIds_Name[1024];
654 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
660 reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin() + sameLayerDetIds_.size() / 2);
662 unsigned int iBin = 0;
663 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
672 char sameLayerDetIds_Name[1024];
673 if (subdetectorId_ == 3) {
675 sprintf(sameLayerDetIds_Name,
"%i",
tTopo_->
tibModule(sameLayerDetIds_[
i]));
677 sprintf(sameLayerDetIds_Name,
"%i", -
tTopo_->
tibModule(sameLayerDetIds_[
i]));
680 }
else if (subdetectorId_ == 5) {
682 sprintf(sameLayerDetIds_Name,
"%i",
tTopo_->
tobModule(sameLayerDetIds_[
i]));
684 sprintf(sameLayerDetIds_Name,
"%i", -
tTopo_->
tobModule(sameLayerDetIds_[
i]));
697 int hSummaryOfCumul_NchX = 0;
698 double hSummaryOfCumul_LowX = 0;
699 double hSummaryOfCumul_HighX = 0;
704 std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle;
721 int subdetectorId_ = ((detId_ >> 25) & 0x7);
723 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
724 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such "
725 "subdetector type : "
726 << subdetectorId_ <<
" no folder set!" << std::endl;
733 hSummaryOfCumul_name =
736 hSummaryOfCumul_name =
741 hSummaryOfCumul_title = hSummaryOfCumul_name;
744 hSummaryOfCumul_name, hSummaryOfCumul_title, hSummaryOfCumul_NchX, hSummaryOfCumul_LowX, hSummaryOfCumul_HighX);
752 std::vector<uint32_t> sameLayerDetIds_;
754 int hSummary_NchX = 0;
755 double hSummary_LowX = 0;
756 double hSummary_HighX = 0;
766 double hSummary_LowY, hSummary_HighY;
774 sameLayerDetIds_.clear();
778 hSummary_NchX = sameLayerDetIds_.size();
780 hSummary_HighX = sameLayerDetIds_.size() + 0.5;
791 int subdetectorId_ = ((detId_ >> 25) & 0x7);
793 if (subdetectorId_ < 3 || subdetectorId_ > 6) {
794 edm::LogError(
"SiStripBaseCondObjDQM") <<
"[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such "
795 "subdetector type : "
796 << subdetectorId_ <<
" no folder set!" << std::endl;
804 hSummary_title = hSummary_name;
807 hSummary_name, hSummary_title, hSummary_NchX, hSummary_LowX, hSummary_HighX, hSummary_NchY, 0., 0.);
816 unsigned int iBin = 0;
818 for (
unsigned int i = 0;
i < sameLayerDetIds_.size();
i++) {
820 char sameLayerDetIds_Name[1024];
821 sprintf(sameLayerDetIds_Name,
"%u", sameLayerDetIds_[
i]);
828 int subdetectorId_ = ((detId_ >> 25) & 0x7);
833 if (subdetectorId_ == 3) {
835 for (
unsigned int i = 1;
i < 5;
i++) {
844 else if (subdetectorId_ == 4) {
848 for (
unsigned int i = 1;
i < 4;
i++) {
859 for (
unsigned int i = 1;
i < 4;
i++) {
869 else if (subdetectorId_ == 5) {
871 for (
unsigned int i = 1;
i < 7;
i++) {
880 else if (subdetectorId_ == 6) {
884 for (
unsigned int i = 1;
i < 10;
i++) {
895 for (
unsigned int i = 1;
i < 10;
i++) {
904 return std::make_pair(
layerName.str(), layerId_);
908 int subdetectorId_ = ((detId_ >> 25) & 0x7);
909 int layerStringId_ = 0;
911 std::stringstream layerStringName;
913 if (subdetectorId_ == 3) {
915 for (
unsigned int i = 1;
i < 27;
i++) {
917 layerStringName <<
"TIB_L1_Int_Str_" <<
i;
918 layerStringId_ = 30110 +
i;
922 for (
unsigned int i = 1;
i < 31;
i++) {
924 layerStringName <<
"TIB_L1_Ext_Str_" <<
i;
925 layerStringId_ = 301200 +
i;
929 for (
unsigned int i = 1;
i < 35;
i++) {
931 layerStringName <<
"TIB_L2_Int_Str_" <<
i;
932 layerStringId_ = 302100 +
i;
936 for (
unsigned int i = 1;
i < 39;
i++) {
938 layerStringName <<
"TIB_L2_Ext_Str_" <<
i;
939 layerStringId_ = 302200 +
i;
943 for (
unsigned int i = 1;
i < 45;
i++) {
945 layerStringName <<
"TIB_L3_Int_Str_" <<
i;
946 layerStringId_ = 303100 +
i;
950 for (
unsigned int i = 1;
i < 47;
i++) {
952 layerStringName <<
"TIB_L3_Ext_Str_" <<
i;
953 layerStringId_ = 303200 +
i;
957 for (
unsigned int i = 1;
i < 53;
i++) {
959 layerStringName <<
"TIB_L4_Int_Str_" <<
i;
960 layerStringId_ = 304100 +
i;
964 for (
unsigned int i = 1;
i < 57;
i++) {
966 layerStringName <<
"TIB_L4_Ext_Str_" <<
i;
967 layerStringId_ = 304200 +
i;
973 else if (subdetectorId_ == 5) {
975 for (
unsigned int i = 1;
i < 43;
i++) {
977 layerStringName <<
"TOB_L1_Rod_" <<
i;
978 layerStringId_ = 50100 +
i;
982 for (
unsigned int i = 1;
i < 49;
i++) {
984 layerStringName <<
"TOB_L2_Rod_" <<
i;
985 layerStringId_ = 50200 +
i;
989 for (
unsigned int i = 1;
i < 55;
i++) {
991 layerStringName <<
"TOB_L3_Rod_" <<
i;
992 layerStringId_ = 50300 +
i;
996 for (
unsigned int i = 1;
i < 61;
i++) {
998 layerStringName <<
"TOB_L4_Rod_" <<
i;
999 layerStringId_ = 50400 +
i;
1003 for (
unsigned int i = 1;
i < 67;
i++) {
1005 layerStringName <<
"TOB_L5_Rod_" <<
i;
1006 layerStringId_ = 50500 +
i;
1010 for (
unsigned int i = 1;
i < 75;
i++) {
1012 layerStringName <<
"TOB_L6_Rod_" <<
i;
1013 layerStringId_ = 50600 +
i;
1019 return std::make_pair(layerStringName.str(), layerStringId_);
1023 uint32_t selDetId) {
1024 std::vector<uint32_t> sameLayerDetIds;
1025 sameLayerDetIds.clear();
1027 switch (
DetId(selDetId).subdetId()) {
1044 return sameLayerDetIds;
1057 size_t imin = 0, imax = 0;
1081 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap maxValue from " <<
maxValue <<
" to " << imax;
1086 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"Resetting TkMap minValue from " <<
minValue <<
" to " << imin;
1097 edm::LogInfo(
"SiStripBaseCondObjDQM") <<
"SiStripBaseCondObjDQM::end" << std::endl;
1102 for (
const auto det : selectedDetIds) {
1109 for (
const auto det : selectedDetIds) {