43 std::set<unsigned int> pclbadmods;
45 std::ifstream pclfile(pclfilename);
48 unsigned int pcldetid;
49 char sixapvs[] =
"1 1 1 1 1 1";
50 char fourapvs[] =
"1 1 x x 1 1";
52 while (pclfile.getline(
line, 400)) {
53 if (strstr(
line, sixapvs) || strstr(
line, fourapvs)) {
54 std::stringstream linestream;
56 linestream >> pcldetid;
58 pclbadmods.insert(pcldetid);
62 std::vector<std::string> subdet;
63 subdet.push_back(
"TIB");
64 subdet.push_back(
"TID/MINUS");
65 subdet.push_back(
"TID/PLUS");
66 subdet.push_back(
"TOB");
67 subdet.push_back(
"TEC/MINUS");
68 subdet.push_back(
"TEC/PLUS");
71 int fileNum = atoi(nrun.c_str());
72 std::cout <<
" ------ Run " << fileNum << std::endl;
76 namefile =
"QualityTestOBSOLETE_run" + nrun +
".txt";
79 TFile *myfile = TFile::Open(
filename.c_str());
83 std::string topdir =
"DQMData/Run " + nrun +
"/SiStrip/Run summary/MechanicalView";
84 gDirectory->cd(topdir.c_str());
85 TDirectory *mec1 = gDirectory;
88 std::vector<int> nbadmod;
89 for (
unsigned int i = 0;
i < subdet.size();
i++) {
91 std::string badmodule_dir = subdet[
i] +
"/BadModuleList";
92 if (gDirectory->cd(badmodule_dir.c_str())) {
93 TIter
next(gDirectory->GetListOfKeys());
95 while ((
key = dynamic_cast<TKey *>(
next()))) {
102 nbadmod.push_back(nbad);
106 outfile <<
"Number of bad modules in total excluding PCL-only bad modules:" << std::endl;
107 outfile <<
"--------------------------------------------------------------" << std::endl;
108 outfile << subdet.at(0) <<
": " << nbadmod.at(0) << std::endl;
109 outfile << subdet.at(1) <<
": " << nbadmod.at(1) << std::endl;
110 outfile << subdet.at(2) <<
": " << nbadmod.at(2) << std::endl;
111 outfile << subdet.at(3) <<
": " << nbadmod.at(3) << std::endl;
112 outfile << subdet.at(4) <<
": " << nbadmod.at(4) << std::endl;
113 outfile << subdet.at(5) <<
": " << nbadmod.at(5) << std::endl;
114 outfile <<
"-------------------------------" << std::endl;
116 outfile << std::endl <<
"List of bad modules per partition:" << std::endl;
117 outfile <<
"----------------------------------" << std::endl;
119 std::set<unsigned int>::const_iterator pclbadmod = pclbadmods.begin();
121 for (
unsigned int i = 0;
i < subdet.size();
i++) {
122 std::string badmodule_dir = subdet[
i] +
"/BadModuleList";
124 outfile <<
"SubDetector " << subdet[
i] << std::endl;
126 std::cout << badmodule_dir.c_str() << std::endl;
127 if (gDirectory->cd(badmodule_dir.c_str())) {
131 TIter
next(gDirectory->GetListOfKeys());
134 while ((
key = dynamic_cast<TKey *>(
next()))) {
138 std::string detid = sflag.substr(sflag.find(
'<') + 1, 9);
139 size_t pos1 = sflag.find(
'/');
140 sflag = sflag.substr(sflag.find(
'<') + 13, pos1 - 2);
141 int flag = atoi(sflag.c_str());
142 sscanf(detid.c_str(),
"%u", &pcldetid);
145 while (pclbadmod != pclbadmods.end() && pcldetid > *pclbadmod) {
146 outfile <<
"Module " << *pclbadmod <<
" PCLBadModule " << std::endl;
150 message =
"Module " + detid;
151 if (((
flag >> 0) & 0
x1) > 0)
152 message +=
" Fed BadChannel : ";
153 if (((
flag >> 1) & 0
x1) > 0)
154 message +=
" # of Digi : ";
155 if (((
flag >> 2) & 0
x1) > 0)
156 message +=
" # of Clusters :";
157 if (((
flag >> 3) & 0
x1) > 0)
158 message +=
" Excluded FED Channel ";
159 if (((
flag >> 4) & 0
x1) > 0)
160 message +=
" DCSError ";
161 if (pclbadmods.find(pcldetid) != pclbadmods.end()) {
162 message +=
" PCLBadModule ";
163 pclbadmod = pclbadmods.find(pcldetid);
166 outfile << message.c_str() << std::endl;