9 #include "boost/cstdint.hpp" 10 #include "boost/lexical_cast.hpp" 17 fp_(iConfig.getUntrackedParameter<
edm::
FileInPath>(
"file",
edm::
FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
21 edm::LogInfo(
"SiStripBadComponentsDQMService") <<
"[SiStripBadComponentsDQMService::SiStripBadComponentsDQMService]";
26 edm::LogInfo(
"SiStripBadComponentsDQMService") <<
"[SiStripBadComponentsDQMService::~SiStripBadComponentsDQMService]";
38 std::stringstream localString;
40 if( ss == localString.str() )
return false;
53 std::cout <<
"[readBadComponents]: opened requested file" << std::endl;
65 std::vector<std::string> subdet_folder;
66 subdet_folder.push_back(
"TIB");
67 subdet_folder.push_back(
"TOB");
68 subdet_folder.push_back(
"TEC/side_1");
69 subdet_folder.push_back(
"TEC/side_2");
70 subdet_folder.push_back(
"TID/side_1");
71 subdet_folder.push_back(
"TID/side_2");
74 int nDetsWithErrorTotal = 0;
75 for( std::vector<std::string>::const_iterator im = subdet_folder.begin(); im != subdet_folder.end(); ++im ) {
77 if (!
dqmStore_->dirExists(dname))
continue;
80 std::vector<std::string> module_folders;
82 int nDets = module_folders.size();
84 int nDetsWithError = 0;
85 std::string bad_module_folder = dname +
"/" +
"BadModuleList";
86 if (
dqmStore_->dirExists(bad_module_folder)) {
87 std::vector<MonitorElement *> meVec =
dqmStore_->getContents(bad_module_folder);
88 for( std::vector<MonitorElement *>::const_iterator it = meVec.begin(); it != meVec.end(); ++it ) {
90 std::cout << (*it)->getName() <<
" " << (*it)->getIntValue() << std::endl;
91 uint32_t detId = boost::lexical_cast<uint32_t>((*it)->getName());
92 short flag = (*it)->getIntValue();
94 std::vector<unsigned int> theSiStripVector;
96 unsigned short firstBadStrip=0, NconsecutiveBadStrips=0;
97 unsigned int theBadStripRange;
102 NconsecutiveBadStrips=
reader.getNumberOfApvsAndStripLength(detId).first*128;
104 theBadStripRange =
obj_->
encode(firstBadStrip,NconsecutiveBadStrips,flag);
106 LogDebug(
"SiStripBadComponentsDQMService") <<
"detid " << detId <<
" \t" 110 theSiStripVector.push_back(theBadStripRange);
114 if ( !
obj_->
put(detId,range) ) {
115 edm::LogError(
"SiStripBadFiberBuilder")<<
"[SiStripBadFiberBuilder::analyze] detid already exists"<<std::endl;
120 nDetsWithErrorTotal += nDetsWithError;
137 edm::LogInfo(
"SiStripBadComponentsDQMService") <<
"[SiStripBadComponentsDQMService::openRequestedFile] Accessing root File" <<
fileName;
141 edm::LogInfo(
"SiStripBadComponentsDQMService") <<
"[SiStripBadComponentsDQMService::openRequestedFile] Accessing dqmStore stream in Online Operation";
154 if (dirName.find(name) == 0) {
157 std::vector<std::string> subDirVec = dqm_store->getSubdirs();
158 for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
159 ic != subDirVec.end(); ic++) {
161 if (!
goToDir(dqm_store, name)) dqm_store->goUp();
170 if (currDir.find(
"module_") != std::string::npos) {
172 mfolders.push_back(currDir);
174 std::vector<std::string> subdirs = dqm_store->getSubdirs();
175 for( std::vector<std::string>::const_iterator it = subdirs.begin();
176 it != subdirs.end(); ++it) {
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void getMetaDataString(std::stringstream &ss)
Used to fill the logDB.
void printSummary(std::stringstream &ss) const
edm::ParameterSet iConfig_
void getModuleFolderList(DQMStore *dqm_store, std::vector< std::string > &mfolders)
virtual bool checkForCompatibility(std::string ss)
Check is the transfer is needed.
SiStripBadComponentsDQMService(const edm::ParameterSet &, const edm::ActivityRegistry &)
bool goToDir(DQMStore *dqm_store, std::string name)
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
uint32_t getRunNumber() const
~SiStripBadComponentsDQMService()