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_;
174 && ModulesToBeIncluded_.size()==0 ){
176 <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no modules to be exclude/included in your cfg"
187 if( ModulesToBeIncluded_.size()>0 ){
188 std::vector<uint32_t>
tmp;
190 set_intersection( detIds_.begin(), detIds_.end(),
191 ModulesToBeIncluded_.begin(), ModulesToBeIncluded_.end(),
192 inserter(tmp,tmp.begin()));
205 std::sort(detIds_.begin(),detIds_.end());
210 std::vector<uint32_t>::iterator detIter_=std::lower_bound(detIds_.begin(),detIds_.end(),*modIter_);
211 detIds_.erase(detIter_);
224 if( *(SubDetectorsToBeExcluded_.begin()) !=
"none" ){
226 std::vector<uint32_t>
tmp;
230 for( std::vector<std::string>::const_iterator modIter_ = SubDetectorsToBeExcluded_.begin();
231 modIter_ != SubDetectorsToBeExcluded_.end(); modIter_++){
234 if (*modIter_==
"TIB") { substructure_.
getTIBDetectors(detIds_, tmp, 0,0,0,0);}
235 else if (*modIter_==
"TOB") { substructure_.
getTOBDetectors(detIds_, tmp, 0,0,0);}
236 else if (*modIter_==
"TID") { substructure_.
getTIDDetectors(detIds_, tmp, 0,0,0,0);}
237 else if (*modIter_==
"TEC") { substructure_.
getTECDetectors(detIds_, tmp, 0,0,0,0,0,0);}
240 <<
"[SiStripBaseCondObjDQM::selectModules] PLEASE CHECK : no correct (name) subdetector to be excluded in your cfg"
244 std::vector<uint32_t>::iterator iterBegin_=std::lower_bound(detIds_.begin(),
246 *min_element(tmp.begin(), tmp.end()));
248 std::vector<uint32_t>::iterator iterEnd_=std::lower_bound(detIds_.begin(),
250 *max_element(tmp.begin(), tmp.end()));
252 for(std::vector<uint32_t>::iterator detIter_ = iterEnd_;
253 detIter_!= iterBegin_-1;detIter_--){
254 detIds_.erase(detIter_);
266 std::vector<uint32_t>
tmp;
267 std::vector<uint32_t> layerDetIds;
271 for(
unsigned int i=1;
i<5 ;
i++){
274 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
276 for(
unsigned int i=1;
i<7 ;
i++){
279 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
281 for(
unsigned int i=1;
i<4 ;
i++){
284 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
286 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
288 for(
unsigned int i=1;
i<10 ;
i++){
291 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
293 if(tmp.size() !=0) { layerDetIds.push_back(*(tmp.begin()));}
311 std::map< uint32_t, ModMEs >::const_iterator ModMEsMap_iter =
ModMEsMap_.find(detId_);
315 CondObj_ME=ModMEsMap_iter->second;
326 <<
"[SiStripBaseCondObjDQM::getModMEs] PLEASE CHECK : CondObj_fillId option mispelled";
342 ModMEsMap_.insert( std::make_pair(detId_,CondObj_ME) );
352 std::map<uint32_t, ModMEs>::const_iterator SummaryMEsMap_iter;
414 int hProfile_NchX = 0;
415 double hProfile_LowX = 0;
416 double hProfile_HighX = 0;
418 std::string hProfile_description;
421 std::string hProfile_xTitle, hProfile_yTitle;
429 hProfile_NchX = nStrip;
431 hProfile_HighX = nStrip+0.5;
437 hProfile_NchX = nApv;
439 hProfile_HighX = nApv+0.5;
444 std::string hProfile_Name;
447 std::string hProfile;
448 hProfile = hProfile_Name ;
464 double hCumul_LowX = 0;
465 double hCumul_HighX = 0;
467 std::string hCumul_description;
470 std::string hCumul_xTitle, hCumul_yTitle;
480 std::string hCumul_name;
483 std::string hCumul_title;
484 hCumul_title = hCumul_name ;
504 std::vector<uint32_t> sameLayerDetIds_;
506 int hSummaryOfProfile_NchX = 0;
507 double hSummaryOfProfile_LowX = 0;
508 double hSummaryOfProfile_HighX = 0;
510 std::string hSummaryOfProfile_description;
511 hSummaryOfProfile_description =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_description");
513 std::string hSummaryOfProfile_xTitle, hSummaryOfProfile_yTitle;
514 hSummaryOfProfile_xTitle =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_xTitle");
515 hSummaryOfProfile_yTitle =
hPSet_.
getParameter<std::string>(
"SummaryOfProfile_yTitle");
517 int hSummaryOfProfile_NchY;
518 double hSummaryOfProfile_LowY, hSummaryOfProfile_HighY;
523 int nStrip, nApv, layerId_;
532 if( (layerId_ > 610 && layerId_ < 620) ||
533 (layerId_ > 620 && layerId_ < 630) ||
534 (layerId_ > 410 && layerId_ < 414) ||
535 (layerId_ > 420 && layerId_ < 424) ){ nStrip =768;}
538 hSummaryOfProfile_NchX = nStrip;
539 hSummaryOfProfile_LowX = 0.5;
540 hSummaryOfProfile_HighX = nStrip+0.5;
548 uint32_t subDetId_ = ((detId_>>25)&0x7);
551 sameLayerDetIds_.clear();
556 else if(subDetId_==4){
559 else if(subDetId_==5){
562 else if(subDetId_==6){
566 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
567 hSummaryOfProfile_LowX = 0.5;
568 hSummaryOfProfile_HighX = sameLayerDetIds_.size()+0.5;
576 uint32_t subDetId_ = ((detId_>>25)&0x7);
579 sameLayerDetIds_.clear();
582 if(
TIBDetId(detId_).isInternalString()){
584 else if(
TIBDetId(detId_).isExternalString()){
587 else if(subDetId_==4){
590 else if(subDetId_==5){
593 else if(subDetId_==6){
598 hSummaryOfProfile_NchX = sameLayerDetIds_.size();
599 hSummaryOfProfile_LowX = 0.5;
600 hSummaryOfProfile_HighX = sameLayerDetIds_.size()+0.5;
605 if( (layerId_ > 610 && layerId_ < 620) ||
606 (layerId_ > 620 && layerId_ < 630) ||
607 (layerId_ > 410 && layerId_ < 414) ||
608 (layerId_ > 420 && layerId_ < 424) ){ nApv =6;}
611 hSummaryOfProfile_NchX = nApv;
612 hSummaryOfProfile_LowX = 0.5;
613 hSummaryOfProfile_HighX = nApv+0.5;
618 <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] PLEASE CHECK : x-axis label in your cfg"
628 std::string hSummaryOfProfile_name;
631 int subdetectorId_ = ((detId_>>25)&0x7);
634 if( subdetectorId_<3 ||subdetectorId_>6 ){
636 <<
"[SiStripBaseCondObjDQM::bookSummaryProfileMEs] WRONG INPUT : no such subdetector type : "
637 << subdetectorId_ <<
" no folder set!"
650 std::string hSummaryOfProfile_title;
651 hSummaryOfProfile_title = hSummaryOfProfile_name ;
654 hSummaryOfProfile_title,
655 hSummaryOfProfile_NchX,
656 hSummaryOfProfile_LowX,
657 hSummaryOfProfile_HighX,
658 hSummaryOfProfile_NchY,
659 hSummaryOfProfile_LowY,
660 hSummaryOfProfile_HighY);
672 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
675 char sameLayerDetIds_Name[1024];
676 sprintf(sameLayerDetIds_Name,
"%u",sameLayerDetIds_[
i]);
684 reverse(sameLayerDetIds_.begin(), sameLayerDetIds_.begin()+sameLayerDetIds_.size()/2);
687 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
696 char sameLayerDetIds_Name[1024];
697 if(subdetectorId_==3){
698 if(
TIBDetId(sameLayerDetIds_[
i]).isZPlusSide()){
699 sprintf(sameLayerDetIds_Name,
"%i",
TIBDetId(sameLayerDetIds_[i]).
module());}
700 else if(
TIBDetId(sameLayerDetIds_[i]).isZMinusSide()){
701 sprintf(sameLayerDetIds_Name,
"%i",-
TIBDetId(sameLayerDetIds_[i]).
module());}
704 else if(subdetectorId_==5){
705 if(
TOBDetId(sameLayerDetIds_[
i]).isZPlusSide()) { sprintf(sameLayerDetIds_Name,
"%i",
TOBDetId(sameLayerDetIds_[i]).
module());}
706 else if(
TOBDetId(sameLayerDetIds_[i]).isZMinusSide()) { sprintf(sameLayerDetIds_Name,
"%i",-
TOBDetId(sameLayerDetIds_[i]).
module());}
729 int hSummaryOfCumul_NchX = 0;
730 double hSummaryOfCumul_LowX = 0;
731 double hSummaryOfCumul_HighX = 0;
733 std::string hSummaryOfCumul_description;
734 hSummaryOfCumul_description =
hPSet_.
getParameter<std::string>(
"SummaryOfCumul_description");
736 std::string hSummaryOfCumul_xTitle, hSummaryOfCumul_yTitle;
750 std::string hSummaryOfCumul_name;
753 int subdetectorId_ = ((detId_>>25)&0x7);
755 if( subdetectorId_<3 || subdetectorId_>6 ){
757 <<
"[SiStripBaseCondObjDQM::bookSummaryCumulMEs] WRONG INPUT : no such subdetector type : "
758 << subdetectorId_ <<
" no folder set!"
773 std::string hSummaryOfCumul_title;
774 hSummaryOfCumul_title = hSummaryOfCumul_name ;
777 hSummaryOfCumul_title,
778 hSummaryOfCumul_NchX,
779 hSummaryOfCumul_LowX,
780 hSummaryOfCumul_HighX);
795 std::vector<uint32_t> sameLayerDetIds_;
797 int hSummary_NchX = 0;
798 double hSummary_LowX = 0;
799 double hSummary_HighX = 0;
801 std::string hSummary_description;
804 std::string hSummary_xTitle, hSummary_yTitle;
809 double hSummary_LowY, hSummary_HighY;
819 sameLayerDetIds_.clear();
823 hSummary_NchX = sameLayerDetIds_.size();
825 hSummary_HighX = sameLayerDetIds_.size()+0.5;
833 std::string hSummary_name;
836 int subdetectorId_ = ((detId_>>25)&0x7);
839 if( subdetectorId_<3 ||subdetectorId_>6 ){
841 <<
"[SiStripBaseCondObjDQM::bookSummaryMEs] WRONG INPUT : no such subdetector type : "
842 << subdetectorId_ <<
" no folder set!"
853 std::string hSummary_title;
854 hSummary_title = hSummary_name ;
872 for(
unsigned int i=0;
i< sameLayerDetIds_.size();
i++){
875 char sameLayerDetIds_Name[1024];
876 sprintf(sameLayerDetIds_Name,
"%u",sameLayerDetIds_[
i]);
892 int subdetectorId_ = ((detId_>>25)&0x7);
895 std::stringstream layerName;
897 if( subdetectorId_ == 3 ){
899 for(
unsigned int i = 1;
i < 5;
i++ ){
901 layerName <<
"TIB__layer__" <<
i;
908 else if( subdetectorId_ == 4 ){
912 for(
unsigned int i = 1;
i < 4;
i++ ){
914 layerName <<
"TID__side__1__wheel__" <<
i;
923 for(
unsigned int i = 1;
i < 4;
i++ ) {
925 layerName <<
"TID__side__2__wheel__" <<
i;
935 else if( subdetectorId_ == 5 ){
937 for(
unsigned int i = 1;
i < 7;
i++ ) {
939 layerName <<
"TOB__layer__" <<
i;
946 else if( subdetectorId_ == 6 ){
950 for(
unsigned int i = 1;
i < 10;
i++ ) {
952 layerName <<
"TEC__side__1__wheel__" <<
i;
961 for(
unsigned int i = 1;
i < 10;
i++ ) {
963 layerName <<
"TEC__side__2__wheel__" <<
i;
971 return std::make_pair( layerName.str(), layerId_ );
981 int subdetectorId_ = ((detId_>>25)&0x7);
982 int layerStringId_=0;
984 std::stringstream layerStringName;
986 if( subdetectorId_==3 ){
988 for(
unsigned int i=1;
i < 27 ;
i++){
990 layerStringName <<
"TIB_L1_Int_Str_" <<
i;
991 layerStringId_ = 30110+
i;
996 for(
unsigned int i=1;
i < 31 ;
i++){
998 layerStringName <<
"TIB_L1_Ext_Str_" <<
i;
999 layerStringId_ = 301200+
i;
1004 for(
unsigned int i=1;
i < 35 ;
i++){
1006 layerStringName <<
"TIB_L2_Int_Str_" <<
i;
1007 layerStringId_ = 302100+
i;
1012 for(
unsigned int i=1;
i < 39 ;
i++){
1014 layerStringName <<
"TIB_L2_Ext_Str_" <<
i;
1015 layerStringId_ = 302200+
i;
1020 for(
unsigned int i=1;
i < 45 ;
i++){
1022 layerStringName <<
"TIB_L3_Int_Str_" <<
i;
1023 layerStringId_ = 303100+
i;
1028 for(
unsigned int i=1;
i < 47 ;
i++){
1030 layerStringName <<
"TIB_L3_Ext_Str_" <<
i;
1031 layerStringId_ = 303200+
i;
1036 for(
unsigned int i=1;
i < 53 ;
i++){
1038 layerStringName <<
"TIB_L4_Int_Str_" <<
i;
1039 layerStringId_ = 304100+
i;
1044 for(
unsigned int i=1;
i < 57 ;
i++){
1046 layerStringName <<
"TIB_L4_Ext_Str_" <<
i;
1047 layerStringId_ = 304200+
i;
1054 else if( subdetectorId_==5 ){
1056 for(
unsigned int i=1;
i < 43 ;
i++){
1058 layerStringName <<
"TOB_L1_Rod_" <<
i;
1059 layerStringId_ = 50100+
i;
1064 for(
unsigned int i=1;
i < 49 ;
i++){
1066 layerStringName <<
"TOB_L2_Rod_" <<
i;
1067 layerStringId_ = 50200+
i;
1072 for(
unsigned int i=1;
i < 55 ;
i++){
1074 layerStringName <<
"TOB_L3_Rod_" <<
i;
1075 layerStringId_ = 50300+
i;
1080 for(
unsigned int i=1;
i < 61 ;
i++){
1082 layerStringName <<
"TOB_L4_Rod_" <<
i;
1083 layerStringId_ = 50400+
i;
1088 for(
unsigned int i=1;
i < 67 ;
i++){
1090 layerStringName <<
"TOB_L5_Rod_" <<
i;
1091 layerStringId_ = 50500+
i;
1096 for(
unsigned int i=1;
i < 75 ;
i++){
1098 layerStringName <<
"TOB_L6_Rod_" <<
i;
1099 layerStringId_ = 50600+
i;
1105 return std::make_pair( layerStringName.str(), layerStringId_ );
1115 std::vector<uint32_t> sameLayerDetIds;
1116 sameLayerDetIds.clear();
1120 uint32_t subselDetId_ = ((selDetId>>25)&0x7);
1122 if(subselDetId_==3){
1125 else if(subselDetId_==4){
1128 else if(subselDetId_==5){
1131 else if(subselDetId_==6){
1135 return sameLayerDetIds;
1156 size_t imin=0,imax=0;
1180 edm::LogInfo(
"")<<
"Resetting TkMap maxValue from " << maxValue <<
" to " << imax;
1185 edm::LogInfo(
"")<<
"Resetting TkMap minValue from " << minValue <<
" to " << imin;
1190 tkMap->
save(
false, minValue, maxValue, TkMapname.c_str());
1199 <<
"SiStripBase::end"
1207 for(std::vector<uint32_t>::const_iterator detIter_=selectedDetIds.begin();
1208 detIter_!=selectedDetIds.end();++detIter_){
1216 for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
1217 detIter_!= selectedDetIds.end();detIter_++){
1224 selME = iter->second;
1234 c1.Print(name.c_str());
1243 c1.Print(name.c_str());
1253 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
tuple SiStripDetInfoFileReader
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
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
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
virtual void fillMEsForLayer(std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)=0
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_)