9 filename(iConfig.getUntrackedParameter<std::
string>(
"rootFilename",
"CondDB_TKCC_20X_v3_hlt_50822.root")),
10 dirpath(iConfig.getUntrackedParameter<std::
string>(
"rootDirPath",
"")),
11 TkMapFileName_(iConfig.getUntrackedParameter<std::
string>(
"TkMapFileName",
""))
13 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" ctor ";
16 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" before opening file " <<
filename.c_str();
21 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" after opening file ";
26 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" dtor";
41 std::vector<uint32_t> activeDets;
43 tkmechstruct->addActiveDetectorsRawIds(activeDets);
46 std::vector<uint32_t> SelectedDetIds[34];
50 for(
size_t j=1;
j<5;
j++)
54 for(
size_t j=1;
j<7;
j++)
58 for(
size_t j=1;
j<4;
j++)
62 for(
size_t j=1;
j<4;
j++)
66 for(
size_t j=1;
j<10;
j++)
70 for(
size_t j=1;
j<10;
j++)
79 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" [SiStripDQMProfileToTkMapConverter] dirpath " <<
dirpath << std::endl;
83 edm::LogInfo(
"SiStripQualityHotStripIdentifierRoot") <<
" [SiStripQualityHotStripIdentifierRoot::bookHistos] vector size " << MEs.size()<< std::endl;
85 std::vector<MonitorElement*>::const_iterator iter=MEs.begin();
86 std::vector<MonitorElement*>::const_iterator iterEnd=MEs.end();
88 std::stringstream ssFull, ssReport;
90 const TProfile*
histo;
92 for (; iter!=iterEnd;++iter) {
95 if (strstr(me_name.c_str(),
"NumberOfDigiProfile__")==
NULL)
98 ssFull << me_name.c_str() << std::endl;
101 std::stringstream ss;
102 if(strstr(me_name.c_str(),
"TIB")!=
NULL){
103 ss<<strstr(me_name.c_str(),
"layer__")[7];
104 ssReport <<
"\nTIB Layer " << ss.str() <<
"\n";
105 layerIdx=atoi(ss.str().c_str());
106 }
else if(strstr(me_name.c_str(),
"TOB")!=
NULL){
107 ss<<strstr(me_name.c_str(),
"layer__")[7];
108 layerIdx=atoi(ss.str().c_str())+4;
109 ssReport <<
"\nTOB Layer " << ss.str() <<
"\n";
110 }
else if(strstr(me_name.c_str(),
"TID")!=
NULL){
111 ss<<strstr(me_name.c_str(),
"wheel__")[7];
112 layerIdx=atoi(ss.str().c_str())+10;
113 if(strstr(me_name.c_str(),
"side__2")!=
NULL){
116 ssReport <<
"\nTID Disk " << ss.str() <<
"\n";
117 }
else if(strstr(me_name.c_str(),
"TEC")!=
NULL){
118 ss<<strstr(me_name.c_str(),
"wheel__")[7];
119 layerIdx=atoi(ss.str().c_str())+16;
120 if(strstr(me_name.c_str(),
"side__2")!=
NULL){
123 ssReport <<
"\nTEC Wheel " << ss.str() <<
"\n";
126 std::cout << ss.str() <<
" " << layerIdx <<
" selected dets size " << SelectedDetIds[layerIdx-1].size()<< std::endl;
130 for(
int ibin=1;ibin<histo->GetNbinsX();++ibin){
131 ssFull << layerIdx <<
" " << ibin <<
" " << SelectedDetIds[layerIdx-1][ibin-1] <<
" " << histo->GetBinContent(ibin) << std::endl;
132 tkMap->
fill(SelectedDetIds[layerIdx-1][ibin-1],1/(histo->GetBinContent(ibin)+0.0000001));
133 tkhisto->
fill(SelectedDetIds[layerIdx-1][ibin-1],1/(histo->GetBinContent(ibin)+0.0000001));
135 if(histo->GetBinContent(ibin)==0)
136 ssReport <<
"\t" << layerIdx <<
" \t " << ibin <<
" \t " << SelectedDetIds[layerIdx-1][ibin-1] << std::endl;
140 LogDebug(
"SiStripDQMProfileToTkMapConverter") <<
" [SiStripDQMProfileToTkMapConverter] fullPrint " << ssFull.str() << std::endl;
141 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" [SiStripDQMProfileToTkMapConverter] fullPrint " << ssReport.str() << std::endl;
148 edm::LogInfo(
"SiStripDQMProfileToTkMapConverter") <<
" [SiStripDQMProfileToTkMapConverter] endJob Saving.........." << std::endl;
150 filename.erase(filename.begin()+filename.find(
"."),filename.end());
SiStripDQMProfileToTkMapConverter(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
void saveAsCanvas(std::string filename, std::string options="", std::string mode="RECREATE")
~SiStripDQMProfileToTkMapConverter()
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
void save(std::string filename)
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
void fill(uint32_t &detid, float value)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
SiStripDetInfoFileReader * reader
void beginRun(const edm::Run &, const edm::EventSetup &)
void setVerbose(unsigned level)
std::string TkMapFileName_
tuple SiStripDetInfoFileReader
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
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
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
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
std::string fullPath() const
const edm::ParameterSet conf_
void fill(int layer, int ring, int nmod, float x)