32 if(SummaryOnLayerLevel_On_ && SummaryOnStringLevel_On_){
34 <<
"[SiStripBaseCondObjDQM::SiStripBaseCondObjDQMs] PLEASE CHECK : String and layer level options can not be activated together"
74 filename.insert(filename.find(
"."),sRun);
85 std::string requestedSubDetector,
86 uint32_t requestedSide,
87 uint32_t requestedLayer){
92 std::vector<uint32_t> requestedDetIds_;
93 requestedDetIds_.clear();
97 if(requestedSubDetector==
"TIB"){
100 else if(requestedSubDetector==
"TID"){
103 else if(requestedSubDetector==
"TOB"){
106 else if(requestedSubDetector==
"TEC"){
125 std::vector<uint32_t> vdetIdsOnDemand_;
126 vdetIdsOnDemand_.push_back(detIdOnDemand);
151 std::vector<uint32_t> cabledDetIds_;
155 return cabledDetIds_;
175 std::sort(ModulesToBeIncluded_.begin(),ModulesToBeIncluded_.end());
179 && ModulesToBeIncluded_.size()==0 ){
181 <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules to be exclude/included in your cfg"
192 if( ModulesToBeIncluded_.size()>0 ){
193 std::vector<uint32_t>
tmp;
195 set_intersection( detIds_.begin(), detIds_.end(),
196 ModulesToBeIncluded_.begin(), ModulesToBeIncluded_.end(),
197 inserter(tmp,tmp.begin()));
210 std::sort(detIds_.begin(),detIds_.end());
215 std::vector<uint32_t>::iterator detIter_=std::lower_bound(detIds_.begin(),detIds_.end(),*modIter_);
216 detIds_.erase(detIter_);
229 if( *(SubDetectorsToBeExcluded_.begin()) !=
"none" ){
231 std::vector<uint32_t>
tmp;
235 for( std::vector<std::string>::const_iterator modIter_ = SubDetectorsToBeExcluded_.begin();
236 modIter_ != SubDetectorsToBeExcluded_.end(); modIter_++){
239 if (*modIter_==
"TIB") { substructure_.
getTIBDetectors(detIds_, tmp, 0,0,0,0);}
240 else if (*modIter_==
"TOB") { substructure_.
getTOBDetectors(detIds_, tmp, 0,0,0);}
241 else if (*modIter_==
"TID") { substructure_.
getTIDDetectors(detIds_, tmp, 0,0,0,0);}
242 else if (*modIter_==
"TEC") { substructure_.
getTECDetectors(detIds_, tmp, 0,0,0,0,0,0);}
245 <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no correct (name) subdetector to be excluded in your cfg"
249 std::vector<uint32_t>::iterator iterBegin_=std::lower_bound(detIds_.begin(),
251 *min_element(tmp.begin(), tmp.end()));
253 std::vector<uint32_t>::iterator iterEnd_=std::lower_bound(detIds_.begin(),
255 *max_element(tmp.begin(), tmp.end()));
257 for(std::vector<uint32_t>::iterator detIter_ = iterEnd_;
258 detIter_!= iterBegin_-1;detIter_--){
259 detIds_.erase(detIter_);
271 std::vector<uint32_t>
tmp;
272 std::vector<uint32_t> layerDetIds;
276 for(
unsigned int i=1;
i<5 ;
i++){
279 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
281 for(
unsigned int i=1;
i<7 ;
i++){
284 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
286 for(
unsigned int i=1;
i<4 ;
i++){
289 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
291 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
293 for(
unsigned int i=1;
i<10 ;
i++){
296 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
298 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
316 std::map< uint32_t, ModMEs >::const_iterator ModMEsMap_iter =
ModMEsMap_.find(detId_);
320 CondObj_ME=ModMEsMap_iter->second;
331 <<
"[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId option mispelled";
347 ModMEsMap_.insert( std::make_pair(detId_,CondObj_ME) );
357 std::map<uint32_t, ModMEs>::const_iterator SummaryMEsMap_iter;
419 int hProfile_NchX = 0;
420 double hProfile_LowX = 0;
421 double hProfile_HighX = 0;
423 std::string hProfile_description;
426 std::string hProfile_xTitle, hProfile_yTitle;
434 hProfile_NchX = nStrip;
436 hProfile_HighX = nStrip+0.5;
442 hProfile_NchX = nApv;
444 hProfile_HighX = nApv+0.5;
449 std::string hProfile_Name;
452 std::string hProfile;
453 hProfile = hProfile_Name ;
469 double hCumul_LowX = 0;
470 double hCumul_HighX = 0;
472 std::string hCumul_description;
475 std::string hCumul_xTitle, hCumul_yTitle;
485 std::string hCumul_name;
488 std::string hCumul_title;
489 hCumul_title = hCumul_name ;
509 std::vector<uint32_t> sameLayerDetIds_;
511 int hSummaryOfProfile_NchX = 0;
512 double hSummaryOfProfile_LowX = 0;
513 double hSummaryOfProfile_HighX = 0;
515 std::string hSummaryOfProfile_description;
516 hSummaryOfProfile_description =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_description");
518 std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle;
519 hSummaryOfProfile_xTitle =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_xTitle");
520 hSummaryOfProfile_yTitle =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_yTitle");
522 int hSummaryOfProfile_NchY;
523 double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY;
528 int nStrip, nApv, layerId_;
536 if( (layerId_ > 610 && layerId_ < 620) ||
537 (layerId_ > 620 && layerId_ < 630) ||
538 (layerId_ > 410 && layerId_ < 414) ||
539 (layerId_ > 420 && layerId_ < 424) ){ nStrip =768;}
542 hSummaryOfProfile_NchX = nStrip;
543 hSummaryOfProfile_LowX = 0.5;
544 hSummaryOfProfile_HighX = nStrip+0.5;
552 uint32_t subDetId_ = ((detId_>>25)&0x7);
555 sameLayerDetIds_.clear();
560 else if(subDetId_==4){
563 else if(subDetId_==5){
566 else if(subDetId_==6){
570 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
571 hSummaryOfProfile_LowX = 0.5;
572 hSummaryOfProfile_HighX = sameLayerDetIds_.size()+0.5;
580 uint32_t subDetId_ = ((detId_>>25)&0x7);
583 sameLayerDetIds_.clear();
586 if(
TIBDetId(detId_).isInternalString()){
588 else if(
TIBDetId(detId_).isExternalString()){
591 else if(subDetId_==4){
594 else if(subDetId_==5){
597 else if(subDetId_==6){
602 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
603 hSummaryOfProfile_LowX = 0.5;
604 hSummaryOfProfile_HighX = sameLayerDetIds_.size()+0.5;
609 if( (layerId_ > 610 && layerId_ < 620) ||
610 (layerId_ > 620 && layerId_ < 630) ||
611 (layerId_ > 410 && layerId_ < 414) ||
612 (layerId_ > 420 && layerId_ < 424) ){ nApv =6;}
615 hSummaryOfProfile_NchX = nApv;
616 hSummaryOfProfile_LowX = 0.5;
617 hSummaryOfProfile_HighX = nApv+0.5;
622 <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : x-axis label in your cfg"
632 std::string hSummaryOfProfile_name;
635 int subdetectorId_ = ((detId_>>25)&0x7);
638 if( subdetectorId_<3 ||subdetectorId_>6 ){
640 <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no such subdetector type : "
641 << subdetectorId_ <<
" no folder set!"
654 std::string hSummaryOfProfile_title;
655 hSummaryOfProfile_title = hSummaryOfProfile_name ;
658 hSummaryOfProfile_title,
659 hSummaryOfProfile_NchX,
660 hSummaryOfProfile_LowX,
661 hSummaryOfProfile_HighX,
662 hSummaryOfProfile_NchY,
678 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
681 char sameLayerDetIds_Name[1024];
682 sprintf(sameLayerDetIds_Name,
"%u",sameLayerDetIds_[
i]);
690 reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin()+sameLayerDetIds_.size()/2);
693 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
702 char sameLayerDetIds_Name[1024];
703 if(subdetectorId_==3){
704 if(
TIBDetId(sameLayerDetIds_[
i]).isZPlusSide()){
705 sprintf(sameLayerDetIds_Name,
"%i",
TIBDetId(sameLayerDetIds_[i]).
module());}
706 else if(
TIBDetId(sameLayerDetIds_[i]).isZMinusSide()){
707 sprintf(sameLayerDetIds_Name,
"%i",-
TIBDetId(sameLayerDetIds_[i]).
module());}
710 else if(subdetectorId_==5){
711 if(
TOBDetId(sameLayerDetIds_[
i]).isZPlusSide()) { sprintf(sameLayerDetIds_Name,
"%i",
TOBDetId(sameLayerDetIds_[i]).
module());}
712 else if(
TOBDetId(sameLayerDetIds_[i]).isZMinusSide()) { sprintf(sameLayerDetIds_Name,
"%i",-
TOBDetId(sameLayerDetIds_[i]).
module());}
735 int hSummaryOfCumul_NchX = 0;
736 double hSummaryOfCumul_LowX = 0;
737 double hSummaryOfCumul_HighX = 0;
739 std::string hSummaryOfCumul_description;
740 hSummaryOfCumul_description =
hPSet_.
getParameter<std::string>(
"SummaryOfCumul_description");
742 std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle;
756 std::string hSummaryOfCumul_name;
759 int subdetectorId_ = ((detId_>>25)&0x7);
761 if( subdetectorId_<3 || subdetectorId_>6 ){
763 <<
"[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such subdetector type : "
764 << subdetectorId_ <<
" no folder set!"
779 std::string hSummaryOfCumul_title;
780 hSummaryOfCumul_title = hSummaryOfCumul_name ;
783 hSummaryOfCumul_title,
784 hSummaryOfCumul_NchX,
785 hSummaryOfCumul_LowX,
786 hSummaryOfCumul_HighX);
801 std::vector<uint32_t> sameLayerDetIds_;
803 int hSummary_NchX = 0;
804 double hSummary_LowX = 0;
805 double hSummary_HighX = 0;
807 std::string hSummary_description;
810 std::string hSummary_xTitle, hSummary_yTitle;
815 double hSummary_LowY, hSummary_HighY;
825 sameLayerDetIds_.clear();
829 hSummary_NchX = sameLayerDetIds_.size();
831 hSummary_HighX = sameLayerDetIds_.size()+0.5;
839 std::string hSummary_name;
842 int subdetectorId_ = ((detId_>>25)&0x7);
845 if( subdetectorId_<3 ||subdetectorId_>6 ){
847 <<
"[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such subdetector type : "
848 << subdetectorId_ <<
" no folder set!"
859 std::string hSummary_title;
860 hSummary_title = hSummary_name ;
880 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
883 char sameLayerDetIds_Name[1024];
884 sprintf(sameLayerDetIds_Name,
"%u",sameLayerDetIds_[
i]);
900 int subdetectorId_ = ((detId_>>25)&0x7);
903 std::stringstream layerName;
905 if( subdetectorId_ == 3 ){
907 for(
unsigned int i = 1;
i < 5;
i++ ){
909 layerName <<
"TIB__layer__" <<
i;
916 else if( subdetectorId_ == 4 ){
920 for(
unsigned int i = 1;
i < 4;
i++ ){
922 layerName <<
"TID__side__1__wheel__" <<
i;
931 for(
unsigned int i = 1;
i < 4;
i++ ) {
933 layerName <<
"TID__side__2__wheel__" <<
i;
943 else if( subdetectorId_ == 5 ){
945 for(
unsigned int i = 1;
i < 7;
i++ ) {
947 layerName <<
"TOB__layer__" <<
i;
954 else if( subdetectorId_ == 6 ){
958 for(
unsigned int i = 1;
i < 10;
i++ ) {
960 layerName <<
"TEC__side__1__wheel__" <<
i;
969 for(
unsigned int i = 1;
i < 10;
i++ ) {
971 layerName <<
"TEC__side__2__wheel__" <<
i;
979 return std::make_pair( layerName.str(), layerId_ );
989 int subdetectorId_ = ((detId_>>25)&0x7);
990 int layerStringId_=0;
992 std::stringstream layerStringName;
994 if( subdetectorId_==3 ){
996 for(
unsigned int i=1;
i < 27 ;
i++){
998 layerStringName <<
"TIB_L1_Int_Str_" <<
i;
999 layerStringId_ = 30110+
i;
1004 for(
unsigned int i=1;
i < 31 ;
i++){
1006 layerStringName <<
"TIB_L1_Ext_Str_" <<
i;
1007 layerStringId_ = 301200+
i;
1012 for(
unsigned int i=1;
i < 35 ;
i++){
1014 layerStringName <<
"TIB_L2_Int_Str_" <<
i;
1015 layerStringId_ = 302100+
i;
1020 for(
unsigned int i=1;
i < 39 ;
i++){
1022 layerStringName <<
"TIB_L2_Ext_Str_" <<
i;
1023 layerStringId_ = 302200+
i;
1028 for(
unsigned int i=1;
i < 45 ;
i++){
1030 layerStringName <<
"TIB_L3_Int_Str_" <<
i;
1031 layerStringId_ = 303100+
i;
1036 for(
unsigned int i=1;
i < 47 ;
i++){
1038 layerStringName <<
"TIB_L3_Ext_Str_" <<
i;
1039 layerStringId_ = 303200+
i;
1044 for(
unsigned int i=1;
i < 53 ;
i++){
1046 layerStringName <<
"TIB_L4_Int_Str_" <<
i;
1047 layerStringId_ = 304100+
i;
1052 for(
unsigned int i=1;
i < 57 ;
i++){
1054 layerStringName <<
"TIB_L4_Ext_Str_" <<
i;
1055 layerStringId_ = 304200+
i;
1062 else if( subdetectorId_==5 ){
1064 for(
unsigned int i=1;
i < 43 ;
i++){
1066 layerStringName <<
"TOB_L1_Rod_" <<
i;
1067 layerStringId_ = 50100+
i;
1072 for(
unsigned int i=1;
i < 49 ;
i++){
1074 layerStringName <<
"TOB_L2_Rod_" <<
i;
1075 layerStringId_ = 50200+
i;
1080 for(
unsigned int i=1;
i < 55 ;
i++){
1082 layerStringName <<
"TOB_L3_Rod_" <<
i;
1083 layerStringId_ = 50300+
i;
1088 for(
unsigned int i=1;
i < 61 ;
i++){
1090 layerStringName <<
"TOB_L4_Rod_" <<
i;
1091 layerStringId_ = 50400+
i;
1096 for(
unsigned int i=1;
i < 67 ;
i++){
1098 layerStringName <<
"TOB_L5_Rod_" <<
i;
1099 layerStringId_ = 50500+
i;
1104 for(
unsigned int i=1;
i < 75 ;
i++){
1106 layerStringName <<
"TOB_L6_Rod_" <<
i;
1107 layerStringId_ = 50600+
i;
1113 return std::make_pair( layerStringName.str(), layerStringId_ );
1123 std::vector<uint32_t> sameLayerDetIds;
1124 sameLayerDetIds.clear();
1128 uint32_t subselDetId_ = ((selDetId>>25)&0x7);
1130 if(subselDetId_==3){
1133 else if(subselDetId_==4){
1136 else if(subselDetId_==5){
1139 else if(subselDetId_==6){
1143 return sameLayerDetIds;
1164 size_t imin=0,imax=0;
1188 edm::LogInfo(
"")<<
"Resetting TkMap maxValue from " << maxValue <<
" to " << imax;
1193 edm::LogInfo(
"")<<
"Resetting TkMap minValue from " << minValue <<
" to " << imin;
1198 tkMap->
save(
false, minValue, maxValue, TkMapname.c_str(),4500,2400);
1207 <<
"SiStripBase::end"
1215 for(std::vector<uint32_t>::const_iterator detIter_=selectedDetIds.begin();
1216 detIter_!=selectedDetIds.end();++detIter_){
1224 for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
1225 detIter_!= selectedDetIds.end();detIter_++){
1232 selME = iter->second;
1242 c1.Print(name.c_str());
1251 c1.Print(name.c_str());
1261 c1.Print(name.c_str());
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
std::map< uint32_t, ModMEs > ModMEsMap_
void swap(ora::Record &rh, ora::Record &lh)
unsigned int rodNumber() const
T getParameter(std::string const &) const
static const char layer_[]
std::vector< uint32_t > ModulesToBeExcluded_
unsigned int stringNumber() const
void selectModules(std::vector< uint32_t > &detIds_)
unsigned int layer() const
layer id
std::string CondObj_name_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
const EventID & eventID() const
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
unsigned int rodNumber(align::ID)
Rod number increases with phi.
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
virtual void fillSummaryMEs(const std::vector< uint32_t > &selectedDetIds)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void bookTkMap(const std::string &TkMapname)
std::vector< uint32_t > GetSameLayerDetId(std::vector< uint32_t > activeDetIds, uint32_t selDetId)
bool SummaryOnLayerLevel_On_
edm::ESHandle< SiStripDetCabling > detCablingHandle_
unsigned int layerNumber(align::ID)
Layer number increases with rho from 1 to 8.
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)
bool SummaryOnStringLevel_On_
SiStripFolderOrganizer folder_organizer
std::vector< int > tkMapScaler
void saveTkMap(const std::string &TkMapname, double minValue, double maxValue)
void fillTkMap(const uint32_t &detid, const float &value)
unsigned int side() const
positive or negative id
virtual void fillMEsForDet(ModMEs selModME_, uint32_t selDetId_)=0
void tag(MonitorElement *me, unsigned int myTag)
U second(std::pair< T, U > const &p)
bool isExternalString() const
std::map< uint32_t, ModMEs > SummaryMEsMap_
void bookCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
std::vector< uint32_t > getCabledModules()
void showPalette(bool printflag1)
const std::vector< uint32_t > & getAllDetIds() const
SiStripDetInfoFileReader * reader
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
const T & max(const T &a, const T &b)
unsigned long long cacheID_memory
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_
MonitorElement * ProfileDistr
virtual void fillMEsForLayer(uint32_t selDetId_)=0
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setDetectorFolder(uint32_t rawdetid=0)
MonitorElement * SummaryOfProfileDistr
MonitorElement * CumulDistr
virtual void getConditionObject(const edm::EventSetup &eSetup_)=0
tuple SiStripDetInfoFileReader
virtual void getActiveDetIds(const edm::EventSetup &eSetup)=0
void analysis(const edm::EventSetup &eSetup_)
std::vector< uint32_t > ModulesToBeIncluded_
virtual unsigned long long getCache(const edm::EventSetup &eSetup_)=0
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
unsigned int stringNumber(align::ID)
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
unsigned int side() const
positive or negative id
bool isInternalString() const
unsigned int wheel() const
wheel id
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
unsigned int layer() const
layer id
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, 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) const
const IOVSyncValue & iovSyncValue() const
std::vector< std::vector< double > > tmp
virtual void fillModMEs(const std::vector< uint32_t > &selectedDetIds)
TProfile * getTProfile(void) const
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
MonitorElement * SummaryDistr
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, bool ring_flag=0)
std::vector< uint32_t > activeDetIds
void bookSummaryCumulMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
unsigned long long cacheID_current
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * SummaryOfCumulDistr
void bookSummaryProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
void setLayerFolder(uint32_t rawdetid=0, int32_t layer=0, bool ring_flag=0)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
std::vector< std::string > SubDetectorsToBeExcluded_
SiStripHistoId hidmanager
void fill(int layer, int ring, int nmod, float x)
const edm::EventSetup & eSetup_
void bookProfileMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)
unsigned int wheel() const
wheel id
void bookSummaryMEs(SiStripBaseCondObjDQM::ModMEs &CondObj_ME, const uint32_t &detId_)