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;
61 std::string mdir =
"MechanicalView";
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 ) {
76 std::string
dname = mechanicalview_dir +
"/" + (*im);
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";
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";
152 std::string currDir = dqm_store->
pwd();
153 std::string
dirName = currDir.substr(currDir.find_last_of(
"/")+1);
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++) {
169 std::string currDir = dqm_store->
pwd();
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.
std::vector< std::string > getSubdirs(void) const
void printSummary(std::stringstream &ss) const
edm::ParameterSet iConfig_
void cd(void)
go to top directory (ie. root)
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)
void setVerbose(unsigned level)
std::vector< MonitorElement * > getContents(const std::string &path) const
bool dirExists(const std::string &path) const
true if directory exists
std::pair< ContainerIterator, ContainerIterator > Range
void goUp(void)
equivalent to "cd .."
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
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()
const std::string & pwd(void) const