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;
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);
832 std::stringstream layerName;
834 if (subdetectorId_ == 3) {
836 for (
unsigned int i = 1;
i < 5;
i++) {
838 layerName <<
"TIB__layer__" <<
i;
845 else if (subdetectorId_ == 4) {
849 for (
unsigned int i = 1;
i < 4;
i++) {
851 layerName <<
"TID__side__1__wheel__" <<
i;
860 for (
unsigned int i = 1;
i < 4;
i++) {
862 layerName <<
"TID__side__2__wheel__" <<
i;
870 else if (subdetectorId_ == 5) {
872 for (
unsigned int i = 1;
i < 7;
i++) {
874 layerName <<
"TOB__layer__" <<
i;
881 else if (subdetectorId_ == 6) {
885 for (
unsigned int i = 1;
i < 10;
i++) {
887 layerName <<
"TEC__side__1__wheel__" <<
i;
896 for (
unsigned int i = 1;
i < 10;
i++) {
898 layerName <<
"TEC__side__2__wheel__" <<
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) {
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
std::map< uint32_t, ModMEs > ModMEsMap_
static const char runNumber_[]
static constexpr auto TEC
T getParameter(std::string const &) const
static const char layer_[]
unsigned int tobLayer(const DetId &id) const
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0)
std::vector< uint32_t > ModulesToBeExcluded_
virtual TProfile * getTProfile() const
bool tibIsZPlusSide(const DetId &id) const
void selectModules(std::vector< uint32_t > &detIds_)
const TrackerTopology * tTopo_
std::string CondObj_name_
bool tobIsZMinusSide(const DetId &id) const
virtual void fillSummaryMEs(const std::vector< uint32_t > &selectedDetIds)
void bookTkMap(const std::string &TkMapname)
unsigned int tibModule(const DetId &id) const
unsigned int tidSide(const DetId &id) const
bool tibIsExternalString(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
bool SummaryOnLayerLevel_On_
bool tibIsZMinusSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tibString(const DetId &id) const
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0)
bool SummaryOnStringLevel_On_
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
SiStripFolderOrganizer folder_organizer
std::vector< int > tkMapScaler
void saveTkMap(const std::string &TkMapname, double minValue, double maxValue)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0)
Log< level::Error, false > LogError
void swap(Association< C > &lhs, Association< C > &rhs)
void fillTkMap(const uint32_t &detid, const float &value)
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
U second(std::pair< T, U > const &p)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
std::map< uint32_t, ModMEs > SummaryMEsMap_
void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void showPalette(bool printflag1)
unsigned int tecSide(const DetId &id) const
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void analysisOnDemand(const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
void setPalette(int numpalette)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
std::string CondObj_fillId_
virtual void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_)=0
MonitorElement * ProfileDistr
virtual void fillMEsForLayer(uint32_t selDetId_)=0
SiStripDetInfo read(std::string filePath)
static constexpr auto TOB
bool tobIsZPlusSide(const DetId &id) const
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * SummaryOfProfileDistr
MonitorElement * CumulDistr
virtual std::string getTitle() const
get MonitorElement title
virtual void getConditionObject(const edm::EventSetup &eSetup_)=0
virtual void getActiveDetIds(const edm::EventSetup &eSetup)=0
Log< level::Info, false > LogInfo
void analysis(const edm::EventSetup &eSetup_)
std::vector< uint32_t > ModulesToBeIncluded_
SiStripBaseCondObjDQM(edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
static constexpr auto TIB
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool tibIsInternalString(const DetId &id) const
unsigned int tobRod(const DetId &id) const
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
virtual TH1 * getTH1() const
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
virtual void fillModMEs(const std::vector< uint32_t > &selectedDetIds)
MonitorElement * SummaryDistr
std::vector< uint32_t > activeDetIds
static constexpr char const *const kDefaultFile
void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
unsigned int tibLayer(const DetId &id) const
unsigned int tobModule(const DetId &id) const
Log< level::Warning, false > LogWarning
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0)
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * SummaryOfCumulDistr
virtual bool checkChanged(const edm::EventSetup &eSetup)=0
void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
T mod(const T &a, const T &b)
static constexpr auto TID
const std::vector< uint32_t > & getAllDetIds() const noexcept
std::vector< std::string > SubDetectorsToBeExcluded_
SiStripHistoId hidmanager
void fill(int layer, int ring, int nmod, float x)
edm::RunNumber_t runNumber_
void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)