CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalPreshowerMonitorClient.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <iostream>
3 #include <fstream>
4 #include <string>
5 #include <vector>
6 
12 
15 
20 
21 using namespace cms;
22 using namespace edm;
23 using namespace std;
24 
26 
27  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
28  outputFile_ = ps.getUntrackedParameter<string>("OutputFile","");
29  inputFile_ = ps.getUntrackedParameter<string>("InputFile","");
30  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "EcalPreshower");
31  debug_ = ps.getUntrackedParameter<bool>("debug", false);
32 
33  prescaleFactor_ = ps.getUntrackedParameter<int>("prescaleFactor", 1);
34 
35  //Initial enabledClients
36  enabledClients_.push_back("Integrity");
37  enabledClients_.push_back("Pedestal");
38  enabledClients_.push_back("Summary");
39 
40  enabledClients_ = ps.getUntrackedParameter<vector<string> >("enabledClients", enabledClients_);
41 
42  if ( verbose_ ) {
43  cout << " Enabled Clients:";
44  for ( unsigned int i = 0; i < enabledClients_.size(); i++ ) {
45  cout << " " << enabledClients_[i];
46  }
47  cout << endl;
48  }
49 
50  //Setup Clients
51  if ( find(enabledClients_.begin(), enabledClients_.end(), "Integrity" ) != enabledClients_.end() ){
52  clients_.push_back( new ESIntegrityClient(ps) );
53  }
54 
55  if ( find(enabledClients_.begin(), enabledClients_.end(), "Pedestal" ) != enabledClients_.end() ){
56  clients_.push_back( new ESPedestalClient(ps) );
57  }
58 
59  if ( find(enabledClients_.begin(), enabledClients_.end(), "Summary" ) != enabledClients_.end() ){
60  clients_.push_back( new ESSummaryClient(ps) );
61  }
62 
63  if(debug_){
64  cout<<"PrescaleFactor = "<<prescaleFactor_<<endl;
65  }
66 }
67 
69 
70  if ( verbose_ ) cout << "Finish EcalPreshowerMonitorClient" << endl;
71 
72  for ( unsigned int i=0; i<clients_.size(); i++ ) {
73  delete clients_[i];
74  }
75 
76 }
77 
79 
80  if(debug_){
81  cout<<"EcalPreshowerMonitorClient: beginJob"<<endl;
82  }
83 
84  ievt_ = 0;
85  jevt_ = 0;
86 
87  // get hold of back-end interface
88 
89  dqmStore_ = Service<DQMStore>().operator->();
90 
91  if ( inputFile_.size() != 0 ) {
92  if ( dqmStore_ ) {
93  dqmStore_->open(inputFile_);
94  }
95  }
96 
97  for ( unsigned int i=0; i<clients_.size(); i++ ) {
98  clients_[i]->beginJob(dqmStore_);
99  clients_[i]->setup();
100  }
101 }
102 
104 
105  if (debug_) {
106  cout << "EcalPreshowerMonitorClient: beginRun" << endl;
107  }
108 
109  jevt_ = 0;
110 
111  begin_run_ = true;
112  end_run_ = false;
113 
114  for ( unsigned int i=0; i<clients_.size(); i++ ) {
115  clients_[i]->beginRun();
116  }
117 }
118 
120 
121  if (debug_) {
122  cout << "EcalPreshowerMonitorClient: beginRun" << endl;
123  }
124 
125  jevt_ = 0;
126 
127  begin_run_ = true;
128  end_run_ = false;
129 
130  for ( unsigned int i=0; i<clients_.size(); i++ ) {
131  clients_[i]->beginRun();
132  }
133 }
134 
136 
137  if (debug_) {
138  cout << "EcalPreshowerMonitorClient: endJob, ievt = " << ievt_ << endl;
139  }
140 
141  if ( ! end_run_ ) {
142  this->analyze();
143  this->endRun();
144  }
145 
146  if ( outputFile_.size() != 0 ) {
147  cout<<"Store Result in "<<outputFile_<<endl;
148  dqmStore_->save(outputFile_);
149  }
150 
151  for ( unsigned int i=0; i<clients_.size(); i++ ) {
152  clients_[i]->endJob();
153  }
154 
155 }
156 
158 
159  if(debug_){
160  cout << "EcalPreshowerMonitorClient: endRun, jevt = " << jevt_ << endl;
161  }
162 
163  begin_run_ = false;
164  end_run_ = true;
165 
166  for ( unsigned int i=0; i<clients_.size(); i++ ) {
167  clients_[i]->analyze();
168  clients_[i]->endRun();
169  }
170 
171 }
172 
174 
175  if(debug_){
176  cout << "EcalPreshowerMonitorClient: endRun, jevt = " << jevt_ << endl;
177  }
178 
179  begin_run_ = false;
180  end_run_ = true;
181 
182  for ( unsigned int i=0; i<clients_.size(); i++ ) {
183  clients_[i]->analyze();
184  clients_[i]->endRun();
185  }
186 
187 }
188 
190 
191  if(debug_){
192  cout << "EcalPreshowerMonitorClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
193  }
194 
195  for ( unsigned int i=0; i<clients_.size(); i++ ) {
196  clients_[i]->analyze();
197  }
198 }
199 
201 
202  ievt_++;
203  jevt_++;
204 
205  if(debug_) cout<<" analyze(const Event & e, const EventSetup & c) is called"<<endl;
206 
207  if ( prescaleFactor_ > 0 ) {
208  if ( jevt_ % prescaleFactor_ == 0 ) this->analyze();
209  }
210 
211 }
212 
214 }
215 
217 
218  for ( unsigned int i=0; i<clients_.size(); i++ ) {
219  clients_[i]->endLumiAnalyze();
220  }
221 
222 }
223 
225 
226  //Change runNum_ into run by Yeong-jyi
227 
228  string border[2][10] = {
229  {"style=\"border-top:solid white; border-left:solid white; border-bottom:solid white; border-right:solid white; border-width:1\"",
230  "style=\"border-top:solid black; border-left:solid black; border-bottom:solid white; border-right:solid white; border-width:1\"",
231  "style=\"border-top:solid black; border-left:solid white; border-bottom:solid white; border-right:solid black; border-width:1\"",
232  "style=\"border-top:solid white; border-left:solid black; border-bottom:solid white; border-right:solid white; border-width:1\"",
233  "style=\"border-top:solid white; border-left:solid white; border-bottom:solid white; border-right:solid black; border-width:1\"",
234  "style=\"border-top:solid black; border-left:solid black; border-bottom:solid white; border-right:solid black; border-width:1\"",
235  "style=\"border-top:solid white; border-left:solid black; border-bottom:solid black; border-right:solid black; border-width:1\"",
236  "style=\"border-top:solid white; border-left:solid black; border-bottom:solid black; border-right:solid white; border-width:1\"",
237  "style=\"border-top:solid white; border-left:solid white; border-bottom:solid black; border-right:solid black; border-width:1\"",
238  "style=\"border-top:solid white; border-left:solid black; border-bottom:solid white; border-right:solid black; border-width:1\""},
239 
240  {"style=\"border-top:solid white; border-left:solid white; border-bottom:solid white; border-right:solid white; border-width:1\"",
241  "style=\"border-top:solid black; border-left:solid black; border-bottom:solid white; border-right:solid white; border-width:1\"",
242  "style=\"border-top:solid black; border-left:solid white; border-bottom:solid white; border-right:solid black; border-width:1\"",
243  "style=\"border-top:solid black; border-left:solid white; border-bottom:solid white; border-right:solid white; border-width:1\"",
244  "style=\"border-top:solid white; border-left:solid white; border-bottom:solid black; border-right:solid white; border-width:1\"",
245  "style=\"border-top:solid black; border-left:solid black; border-bottom:solid black; border-right:solid white; border-width:1\"",
246  "style=\"border-top:solid black; border-left:solid white; border-bottom:solid black; border-right:solid black; border-width:1\"",
247  "style=\"border-top:solid white; border-left:solid black; border-bottom:solid black; border-right:solid white; border-width:1\"",
248  "style=\"border-top:solid white; border-left:solid white; border-bottom:solid black; border-right:solid black; border-width:1\"",
249  "style=\"border-top:solid black; border-left:solid white; border-bottom:solid black; border-right:solid white; border-width:1\""}
250  };
251 
252  int iborder[2][40][40] = {
253  {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
254  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
255  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 1, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
256  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
257  {0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 3, 4, 3, 4, 7, 8, 7, 8, 7, 8, 7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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
334  }
335  };
336 
337  // Make HTML
338  if (runtype_ ==3) {
339 
340  Char_t run_s[50];
341  sprintf(run_s, "/var/www/html/DQM/%08d", run);
342  string htmlDir = run_s;
343  system(("/bin/mkdir -m 777 -p " + htmlDir).c_str());
344  sprintf(run_s, "/var/www/html/DQM/%08d/gif", run);
345  string gifDir = run_s;
346  system(("/bin/mkdir -m 777 -p " + gifDir).c_str());
347  ofstream htmlFile;
348  htmlFile.open((htmlDir+"/index.html").c_str(), ios::app);
349 
350  // Start to display ES planes
351  int iquad_M[2][40] = {{ 5, 7, 10, 11, 13, 13, 14, 15, 16, 17,
352  17, 17, 18, 18, 19, 19, 19, 19, 19, 19,
353  19, 19, 19, 19, 19, 19, 18, 18, 17, 17,
354  17, 16, 15, 14, 13, 13, 11, 10, 7, 5},
355  { 0, 6, 8, 11, 12, 13, 14, 16, 16, 17,
356  18, 18, 18, 19, 19, 20, 20, 20, 20, 20,
357  20, 20, 20, 20, 20, 19, 19, 18, 18, 18,
358  17, 16, 16, 14, 13, 12, 11, 8, 6, 0}
359  };
360  int iquad_m[2][40] = {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361  1, 1, 1, 3, 5, 6, 7, 7, 8, 8,
362  8, 8, 7, 7, 6, 5, 3, 1, 1, 1,
363  1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
364  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365  1, 1, 1, 3, 5, 6, 7, 7, 8, 8,
366  8, 8, 7, 7, 6, 5, 3, 1, 1, 1,
367  1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
368  };
369 
370  htmlFile << "<table border=\"0\" bordercolor=\"white\" cellspacing=\"0\" style=\"float: left;\">" << endl;
371  htmlFile << "<tr align=\"center\">" << endl;
372  if (layer_==1) htmlFile << "<td colspan=\"40\"> ES- F <a href=\"../plotAll.php?run="<<run<<"&type="<<runtype_<<"\">(summary plots)</a></td>" << endl;
373  else if (layer_==1) htmlFile << "<td colspan=\"40\"> ES- R <a href=\"../plotAll.php?run="<<run<<"&type="<<runtype_<<"\">(summary plots)</a></td>" << endl;
374 
375  //string color[6] = {"#C0C0C0", "#00FF00", "#FFFF00", "#F87217", "#FF0000", "#0000FF"};
376  for (int i=0; i<40; ++i) {
377  htmlFile << "<tr>" << endl;
378  for (int j=0; j<40; ++j) {
379  if ((iquad_m[layer_-1][i]-1) == 0) {
380  if (j<=(19-iquad_M[layer_-1][i]) || j>(19+iquad_M[layer_-1][i]))
381  htmlFile << "<td "<<border[layer_-1][iborder[layer_-1][i][j]]<<" > <img src=\"../0.png\" width=12 height=12 border=0> </img></td>" << endl;
382  else {
383  htmlFile << "<td "<<border[layer_-1][iborder[layer_-1][i][j]]<<" ><a href=\"../plot.php?run="<<run<<"&type="<<runtype_<<"&iz="<<senZ_[0]<<"&ip="<<senP_[0]<<"&ix="<<j+1<<"&iy="<<39-i+1<<"&gain="<<gain_<<"&prec="<<precision_<<"\" STYLE=\"text-decoration:none\" target=_blank><img src=\"../"<< qt[j][39-i]<<".png\" width=12 height=12 border=0></img></a></td>" << endl;
384  }
385  } else {
386  if (j>=(19-iquad_m[layer_-1][i]+2) && j<=(19+iquad_m[layer_-1][i]-1))
387  htmlFile << "<td "<<border[layer_-1][iborder[layer_-1][i][j]]<<" > <img src=\"../0.png\" width=12 height=12 border=0> </img></td>" << endl;
388  else if (j<=(19-iquad_M[layer_-1][i]) || j>(19+iquad_M[layer_-1][i]))
389  htmlFile << "<td "<<border[layer_-1][iborder[layer_-1][i][j]]<<" > <img src=\"../0.png\" width=12 height=12 border=0> </img></td>" << endl;
390  else {
391  htmlFile << "<td "<<border[layer_-1][iborder[layer_-1][i][j]]<<" ><a href=\"../plot.php?run="<<run<<"&type="<<runtype_<<"&iz="<<senZ_[0]<<"&ip="<<senP_[0]<<"&ix="<<j+1<<"&iy="<<39-i+1<<"&gain="<<gain_<<"&prec="<<precision_<<"\" STYLE=\"text-decoration:none\" target=_blank><img src=\"../"<< qt[j][39-i]<<".png\" width=12 height=12 border=0></img></a></td>" << endl;
392  }
393  }
394  }
395  htmlFile << "</tr>" <<endl;
396  }
397  htmlFile << "</table>" <<endl;
398  htmlFile << "<table border=\"1\">" <<endl;
399  if (runtype_==3) {
400  htmlFile << "<tr><td><img src=\"../2.png\" width=20 height=20 border=0> this sensor is not used for injection </img></td></tr>" << endl;
401  htmlFile << "<tr><td><img src=\"../1.png\" width=20 height=20 border=0> the injection result for this sensor is OK </img></td></tr>" << endl;
402  htmlFile << "<tr><td><img src=\"../4.png\" width=20 height=20 border=0> at least one strip has signal 10% higher than average </img></td></tr>" <<endl;
403  htmlFile << "<tr><td><img src=\"../3.png\" width=20 height=20 border=0> at least one strip has signal 10% lower than average </img></td></tr>" <<endl;
404  htmlFile << "<tr><td><img src=\"../7.png\" width=20 height=20 border=0> all strips have signal lower than "<< qtCriteria<<" ADC </img></td></tr>" <<endl;
405  htmlFile << "<tr><td><img src=\"../6.png\" width=20 height=20 border=0> the order of time sample is wrong </img></td></tr>" <<endl;
406  htmlFile << "<tr><td><img src=\"../5.png\" width=20 height=20 border=0> this sensor is used for data-taking, but does not deliver data </img></td></tr>" <<endl;
407  }
408  htmlFile << "</table>" <<endl;
409  htmlFile << "</body> " << endl;
410  htmlFile << "</html> " << endl;
411 
412  htmlFile.close();
413  }
414 }
415 
416 
417 //define this as a plug-in
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
static const char layer_[]
void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
EcalPreshowerMonitorClient(const edm::ParameterSet &ps)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int j
Definition: DBlmapReader.cc:9
static const char gain_[]
tuple cout
Definition: gather_cfg.py:121
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
Definition: Run.h:33