CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTScalersClient.cc
Go to the documentation of this file.
1 // $Id: HLTScalersClient.cc,v 1.19 2010/07/20 02:58:27 wmtan Exp $
2 //
3 // $Log: HLTScalersClient.cc,v $
4 // Revision 1.19 2010/07/20 02:58:27 wmtan
5 // Add missing #include files
6 //
7 // Revision 1.18 2010/04/02 20:48:12 wittich
8 // updates to scale entries by received number of FU's
9 //
10 // Revision 1.17 2010/03/17 20:56:19 wittich
11 // Check for good updates based on mergeCount values
12 // add code for rates normalized per FU
13 //
14 // Revision 1.16 2010/03/16 22:19:19 wittich
15 // updates for per-LS normalization for variable
16 // number of FU's sending information back to the clients.
17 //
18 // Revision 1.15 2010/02/11 23:55:18 wittich
19 // - adapt to shorter Lumi Section length
20 // - fix bug in how history of counts was filled
21 //
22 // Revision 1.14 2010/02/02 11:44:20 wittich
23 // more diagnostics for online scalers
24 //
25 // Revision 1.13 2009/12/15 20:41:16 wittich
26 // better hlt scalers client
27 //
28 // Revision 1.12 2009/11/22 13:33:05 puigh
29 // clean beginJob
30 //
31 // Revision 1.11 2009/11/07 03:35:05 lorenzo
32 // fixed binning
33 //
34 // Revision 1.10 2009/11/04 06:00:05 lorenzo
35 // changed folders
36 //
37 
39 
40 #include <cassert>
41 #include <numeric>
42 
44 
51 
52 
55 
56 
57 using edm::LogInfo;
58 using edm::LogWarning;
59 
60 // I am not sure this is right at more than 10%
61 #define SECS_PER_LUMI_SECTION 23.31
62 const int kPerHisto = 20;
63 
64 
65 
66 
69  dbe_(0),
70  nLumi_(0),
71  currentRate_(0),
72  currentLumiBlockNumber_(0),
73  first_(true), missingPathNames_(true),
74  folderName_(ps.getUntrackedParameter<std::string>("dqmFolder",
75  "HLT/HLScalers_EvF")),
76  kRateIntegWindow_(ps.getUntrackedParameter<unsigned int>("rateIntegWindow",
77  3)),
78  processName_(ps.getParameter<std::string>("processName")),
79  ignores_(),
80  debug_(ps.getUntrackedParameter<bool>("debugDump", false)),
81  maxFU_(ps.getUntrackedParameter<unsigned int>("maxFU", false)),
82  recentOverallCountsPerLS_(kRateIntegWindow_),
83  recentNormedOverallCountsPerLS_(2)
84 {
85  LogDebug("HLTScalersClient") << "constructor" ;
86  if ( debug_ ) {
87  textfile_.open("debug.txt");
88  if ( ! textfile_ ) {
89  std::cout << "constructor: can't open text file" << std::endl;
90  }
91  }
92  // get back-end interface
94  dbe_->setVerbose(1);
96 
97 
98  std::string rawdir(folderName_ + "/raw");
99  dbe_->setCurrentFolder(rawdir);
100  hltRate_ = dbe_->book1D("hltRate", "Overall HLT Accept rate vs LS",
103  hltNormRate_ = dbe_->book1D("hltRateNorm",
104  "Overall HLT Accept rate vs LS, scaled",
106  hltCount_= dbe_->book1D("hltCount", "Overall HLT Counts vs LS",
108 // hltCountN_= dbe_->book1D("hltCountN", "Overall HLT Counts per LS vs LS",
109 // MAX_LUMI_SEG_HLT, -0.5, MAX_LUMI_SEG_HLT-0.5);
110  mergeCount_= dbe_->book1D("mergeCount", "Number of merge counts vs LS",
112 
113 
114 
115  updates_ = dbe_->book1D("updates", "Status of Updates", 2, 0, 2);
116  updates_->setBinLabel(1, "Good Updates");
117  updates_->setBinLabel(2, "Incomplete Updates");
118 
119 
120 } // end constructor
121 
122 
125 {
126  LogDebug("HLTScalersClient") << "beingJob" ;
127  if (dbe_) {
129  }
130  first_ = true;
131  missingPathNames_ = true;
132 }
133 
134 
137 {
138  missingPathNames_ = true;
139  first_ = true;
140  LogDebug("HLTScalersClient") << "beginRun, run " << run.id();
141 
142 } // beginRun
143 
146 {
147  missingPathNames_ = true;
148  first_ = true;
149 }
150 
151 
155  const edm::EventSetup& c)
156 {
157  nLumi_ = lumiSeg.id().luminosityBlock();
158  // PWDEBUG
159  if ( first_ && debug_)
161  // PWDEBUG END
162 
163  // get raw data
164  std::string scalHisto = folderName_ + "/raw/hltScalers";
165  MonitorElement *scalers = dbe_->get(scalHisto);
166  if ( scalers == 0 ) {
167  LogDebug("HLTScalersClient") << "cannot get hlt scalers histogram, "
168  << "bailing out.";
169  if ( debug_ )
170  std::cout << "No scalers ? Looking for "
171  << scalHisto
172  << std::endl;
173  return;
174  }
175 
176 
177  int npaths = scalers->getNbinsX();
178  if ( npaths > MAX_PATHS ) npaths = MAX_PATHS; // HARD CODE FOR NOW
179  LogDebug("HLTScalersClient") << "I see " << npaths << " paths. ";
180 
181  // set the bin labels on the first go-through
182  // I need to do this here because we don't have the paths yet
183  // on begin-run. I should do this in a less ugly way (see FV?)
184  if ( first_) {
185  std::string rawdir(folderName_ + "/raw");
186 
187  LogDebug("HLTScalersClient") << "Setting up paths on first endLumiBlock "
188  << npaths;
189  dbe_->setCurrentFolder(rawdir);
190  currentRate_ = dbe_->book1D("cur_rate",
191  "current lumi section rate per path",
192  npaths, -0.5, npaths-0.5);
193  currentNormRate_ = dbe_->book1D("cur_rate_norm",
194  "current norm. lumi section rate per path",
195  npaths, -0.5, npaths-0.5);
196  recentPathCountsPerLS_.reserve(npaths);
197  recentNormedPathCountsPerLS_.reserve(npaths);
198  char rates_subfolder[256]; snprintf(rates_subfolder, 256, "%s/RateHistory",
199  folderName_.c_str());
200  char counts_subfolder[256]; snprintf(counts_subfolder, 256,
201  "%s/CountHistory",
202  folderName_.c_str());
203 
204  hltCurrentRate_. reserve(npaths);
205  rateHistories_. reserve(npaths);
206  countHistories_. reserve(npaths);
207  hltCurrentNormRate_.reserve(npaths);
208  rateNormHistories_. reserve(npaths);
209 
210  dbe_->setCurrentFolder(folderName_); // these belong in top-level
211  for (int i = 0; i < npaths; ++i ) {
212  dbe_->setCurrentFolder(std::string(rates_subfolder)+"/raw");
213 
214  char name[256]; snprintf(name, 256, "raw_rate_p%03d", i);
215  // LogDebug("HLTScalersClient") << "name " << i << " is " << name ;
216  rateHistories_.push_back(dbe_->book1D(name, name, MAX_LUMI_SEG_HLT,
217  -0.5, MAX_LUMI_SEG_HLT-0.5));
218  snprintf(name, 256, "norm_rate_p%03d", i);
219  dbe_->setCurrentFolder(rates_subfolder);
220  rateNormHistories_.push_back(dbe_->book1D(name, name, MAX_LUMI_SEG_HLT,
221  -0.5, MAX_LUMI_SEG_HLT-0.5));
222  dbe_->setCurrentFolder(counts_subfolder);
223  snprintf(name, 256, "counts_p%03d", i);
224  countHistories_.push_back(dbe_->book1D(name, name, MAX_LUMI_SEG_HLT,
225  -0.5, MAX_LUMI_SEG_HLT-0.5));
226  // prefill the data structures
229  }
231 
232 
233  // split hlt scalers up into groups of 20
234  const int maxlen = 40;
235  char metitle[maxlen]; //histo name
236  char mename[maxlen]; //ME name
237  int numHistos = int(npaths/kPerHisto); // this hasta be w/o remainders
238 
239  int remainder = npaths%kPerHisto;
240  if ( remainder ) numHistos += 1;
241 
242  for( int k = 0; k < numHistos; k++ ) {
243  int npath_low = kPerHisto*k;
244  int npath_high = kPerHisto*(k+1)-1;
245  snprintf(mename, maxlen, "hltScalers_%0d", k);
246  snprintf(metitle, maxlen, "HLT scalers - Paths %d to %d", npath_low,
247  npath_high);
248  dbe_->setCurrentFolder(rawdir);
249  hltCurrentRate_.push_back(dbe_->book1D(mename, metitle, kPerHisto,
250  -0.5 + npath_low, npath_high+0.5));
251  dbe_->setCurrentFolder(folderName_); // these belong in top-level
252  snprintf(mename, maxlen, "hltScalersNorm_%0d", k);
253  snprintf(metitle, maxlen,
254  "HLT Rate (scaled) - Paths %d to %d", npath_low, npath_high);
255  hltCurrentNormRate_.push_back(dbe_->book1D(mename, metitle, kPerHisto,
256  -0.5 + npath_low,
257  npath_high+0.5));
258  }
259 
260  first_ = false;
261 
262 
263 
264  }
265 
266  if ( missingPathNames_) {
267  // first try the scalers histogram and see if the bin names are set
268  for ( int i = 0; i < npaths; ++i ) {
269  // needs to be i+1 since root bins start at 1
270  const char* name = scalers->getTH1()->GetXaxis()->GetBinLabel(i+1);
271  if ( name && (strlen(name) > 0)) {
272  if ( debug_ ) {
273  std::cout << "path " << i << " name is " << name << std::endl;
274  }
275  int whichHisto = i/kPerHisto;
276  int whichBin = i%kPerHisto + 1;
277  char pname[256];
278  hltCurrentRate_[whichHisto]->setBinLabel(whichBin, name);
279  hltCurrentNormRate_[whichHisto]->setBinLabel(whichBin, name);
280  snprintf(pname, 256, "Rate - path %s (Path # %03d)", name, i);
281  rateHistories_[i] ->setTitle(pname);
282  rateNormHistories_[i]->setTitle(pname);
283  snprintf(pname, 256, "Counts - path %s (Path # %03d)", name, i);
284  countHistories_[i]->setTitle(pname);
285 
286  currentRate_->setBinLabel(i+1, name);
287  currentNormRate_->setBinLabel(i+1, name);
288 
289  missingPathNames_ = false;
290  }
291  }
292 
293  }
294  // MEGA-HACK
295  if ( missingPathNames_) {
296  // if that didn't work we load 'em from a text file. damn straight.
297  int ipath = 1;
298  std::ifstream names("names.dat");
299  if ( ! names ) {
300  if ( debug_ ) {
301  std::ostringstream msg;
302  msg << "open of " << "names.dat";
303  perror(msg.str().c_str());
304  }
305  }
306  else { // open succeeded
307  missingPathNames_ = false;
308  std::string line;
309  while ( ! names.eof() ) {
310  getline(names, line);
311  std::istringstream fnames(line);
312  std::string label; int bin;
313  if ( fnames.str().find("#") == 0 ) // skip comment lines
314  continue;
315  if ( fnames >> bin >> label ) {
316  if ( debug_ ) {
317  std::cout << bin << "--" << label << "(" << ipath << ")"
318  << std::endl;
319  }
320  currentRate_->setBinLabel(ipath, label);
321  currentNormRate_->setBinLabel(ipath, label);
322  countHistories_[ipath-1]->setTitle(label);
323  rateHistories_[ipath-1]->setTitle(label);
324  rateNormHistories_[ipath-1]->setTitle(label);
325  int whichHisto = (ipath-1)/kPerHisto;
326  int whichBin = (ipath-1)%kPerHisto +1;
327  hltCurrentRate_[whichHisto]->setBinLabel(whichBin, label);
328  hltCurrentNormRate_[whichHisto]->setBinLabel(whichBin, label);
329  ++ipath;
330  if ( ipath > npaths )
331  break;
332  } //
333  } // loop lines
334  } // open ok
335  }
336 
337 
338  // END SETUP
339 
340  std::string nLumiHisto(folderName_ + "/nLumiBlock");
341  MonitorElement *nLumi = dbe_->get(nLumiHisto);
342  if ( nLumi == 0 ) {
343  nLumiHisto = folderName_ + "/raw/nLumiBlock";
344  nLumi = dbe_->get(nLumiHisto);
345  }
346  int testval = (nLumi!=0?nLumi->getIntValue():-1);
347  LogDebug("HLTScalersClient") << "Lumi Block from DQM: "
348  << testval
349  << ", local is " << nLumi_;
350  int nL = (nLumi!=0?nLumi->getIntValue():nLumi_);
351  if ( nL > MAX_LUMI_SEG_HLT ) {
352  LogDebug("HLTScalersClient") << "Too many Lumi segments, "
353  << nL << " is greater than MAX_LUMI_SEG_HLT,"
354  << " wrapping to "
355  << (nL%MAX_LUMI_SEG_HLT);
356  //nL = MAX_LUMI_SEG_HLT;
357  nL = nL%MAX_LUMI_SEG_HLT;
358  }
359 
360  // merging counts
361  double num_fu = -1.0;
362  std::string mergeName(folderName_ + "/raw/hltMerge");
363  MonitorElement *merge = dbe_->get(mergeName);
364  if ( merge != 0 ) {
365  num_fu = merge->getBinContent(1);
366  if ( debug_ ) {
367  std::cout << "Number of received entries: " << num_fu
368  << std::endl;
369  }
370  mergeCount_->Fill(nL,num_fu);
371  }
372  // end
373 
374 
375  // evaluate the data
376  // loop over current counts
377 
378  // this gets filled for all times. Mainly for debugging.
379  for ( int i = 1; i <= npaths; ++i ) { // bins start at 1
380  double current_count = scalers->getBinContent(i);
381  // nb that this will now _overwrite_ some settings
382  countHistories_[i-1]->setBinContent(nL, current_count); // good or bad
383  }
384 
385  std::string overallScalerName(folderName_ + "/raw/hltOverallScaler");
386  MonitorElement *hltScaler = dbe_->get(overallScalerName);
387  if ( hltScaler != 0 ) {
388  double current_count = hltScaler->getBinContent(1);
389  hltCount_->setBinContent(nL,current_count);
390  recentOverallCountsPerLS_.update(CountLS_t(nL,current_count));
391  std::pair<double,double> sl = getSlope_(recentOverallCountsPerLS_);
392  double slope = sl.first; double slope_err = sl.second;
393  if ( slope > 0 ) {
394  hltRate_->setBinContent(nL,slope);
395  if ( ! std::isnan(slope_err ) && (slope_err >= 0 ) )
396  hltRate_->setBinError(nL,slope_err);
397  }
398  } // found histo
399 
400 
401 
402  if ( num_fu >= 0.95*maxFU_ ) {
403  if ( num_fu > maxFU_ ) {
404  maxFU_ = num_fu;
405  if ( debug_ )
406  std::cout << "maxFU is now " << maxFU_ << std::endl;
407  }
408  // good data
409  for ( int i = 1; i <= npaths; ++i ) { // bins start at 1
410  double current_count = scalers->getBinContent(i);
411  // DEBUG
412  if ( ! recentPathCountsPerLS_[i-1].empty() && debug_ )
413  std::cout << i << "\t-> good one: new => cnt, ls = "
414  << current_count << ", " << nL
415  << ", old = "
416  << recentPathCountsPerLS_[i-1].back().second << "\t"
417  << recentPathCountsPerLS_[i-1].back().first
418  << std::endl;
419  // END DEBUG
420  recentPathCountsPerLS_[i-1].update(CountLS_t(nL,current_count));
421 
422  // NB: we do not fill a new entry in the rate histo if we can't
423  // calculate it
424  std::pair<double,double> sl = getSlope_(recentPathCountsPerLS_[i-1]);
425  double slope = sl.first; double slope_err = sl.second;
426  //rateHistories_[i-1]->Fill(nL,slope);
427  if ( slope > 0 ) {
428  rateHistories_[i-1]->setBinContent(nL,slope);
429  // set the current rate(s)
430  hltCurrentRate_[(i-1)/kPerHisto]->setBinContent(i%kPerHisto, slope);
431  currentRate_->setBinContent(i, slope);
432  if ( ! std::isnan(slope_err ) && (slope_err >= 0 ) ) {
433  currentRate_->setBinError(i, slope_err);
434  hltCurrentRate_[(i-1)/kPerHisto]->setBinError(i%kPerHisto, slope_err);
435  rateHistories_[i-1]->setBinError(nL,slope_err);
436  }
437  }
440 
441  } // loop over paths
442 
443  // ---------------------------- overall rate, absolute counts
444  std::string overallScalerName(folderName_ + "/raw/hltOverallScaler");
445  MonitorElement *hltScaler = dbe_->get(overallScalerName);
446  if ( hltScaler != 0 ) {
447  double current_count = hltScaler->getBinContent(1);
448  hltCount_->setBinContent(nL,current_count);
449  recentOverallCountsPerLS_.update(CountLS_t(nL,current_count));
450  std::pair<double,double> sl = getSlope_(recentOverallCountsPerLS_);
451  double slope = sl.first; double slope_err = sl.second;
452  if ( slope >= 0 ) {
453  hltRate_->setBinContent(nL,slope);
454  if ( ! std::isnan(slope_err ) && (slope_err >= 0 ) )
455  hltRate_->setBinError(nL,slope_err);
456  }
457  } // found histo
458  updates_->Fill(0); // good
459  } // check on number of FU's - good data
460  else {
461  updates_->Fill(1); // missing updates
462  }
463 
464  // PW DEBUG
465  if ( debug_ ) {
466  textfile_ << nL << "\t"
467  << npaths << "\t";
468  for ( int i = 0; i < npaths ; ++i ) {
469  textfile_ << scalers->getBinContent(i) << " ";
470  }
471  textfile_ << std::endl;
472  }
473  // end DEBUG
474 
475 
476 #ifdef LATER
477  // ------ overall rate normalized - all data
478  overallScalerName = std::string(folderName_ + "/raw/hltOverallScalerN");
479  hltScaler = dbe_->get(overallScalerName);
480  if ( hltScaler != 0 ) {
481  double cnt = hltScaler->getBinContent(1);
482 // hltCountN_->setBinContent(nL,cnt);
483  if ( debug_ ) {
484  std::cout << "Overall Norm: new => cnt, ls = "
485  << cnt << ", " << nL
486  << ", num_fu = " << num_fu
487  << std::endl;
488  }
490  cnt = recentNormedOverallCountsPerLS_.getCount(nL); // for dupes/partials
491  double slope = cnt / num_fu / SECS_PER_LUMI_SECTION;
492  if ( debug_ ) {
493  std::cout << "Normalized slope = " << slope << std::endl;
494  }
495  if ( slope > 0 )
496  hltNormRate_->setBinContent(nL,slope);
497  }
498  //
499  std::string scalHistoNorm = folderName_ + "/raw/hltScalersN";
500  MonitorElement *scalersN = dbe_->get(scalHistoNorm);
501  if ( scalersN ) {
502  for (int i = 0; i < npaths ; ++i ) {
503  double cnt = scalersN->getBinContent(i);
504  double slope = cnt / num_fu / SECS_PER_LUMI_SECTION;
505  if ( slope > 0 ) {
506  rateNormHistories_[i-1]->setBinContent(nL,slope);
507  // set the current rate(s)
508  hltCurrentNormRate_[(i-1)/kPerHisto]->setBinContent(i%kPerHisto, slope);
510  }
511  }
512  }
513 #else // NOT LATER
514  // ------ overall rate normalized - all data
515  overallScalerName = std::string(folderName_ + "/raw/hltOverallScaler");
516  hltScaler = dbe_->get(overallScalerName);
517  if ( hltScaler != 0 ) {
518  double cnt = hltScaler->getBinContent(1);
519 // hltCountN_->setBinContent(nL,cnt);
520  float sf = num_fu/maxFU_;
521  if ( debug_ ) {
522  std::cout << "Overall Norm: new => cnt, ls = "
523  << cnt << ", " << nL
524  << ", num_fu = " << num_fu << ", sf = " << sf
525  << std::endl;
526  }
528  cnt = recentNormedOverallCountsPerLS_.getCount(nL); // for dupes/partials
529  std::pair<double,double> sl = getSlope_(recentNormedOverallCountsPerLS_);
530  double slope = sl.first; double slope_err = sl.second;
531  if ( debug_ ) {
532  std::cout << "Normalized slope = " << slope << std::endl;
533  }
534  if ( slope > 0 ) {
535  hltNormRate_->setBinContent(nL,slope);
536  if ( cnt > 0 ) slope_err = slope*sqrt( 2./num_fu + 2./cnt);
537  if ( ! std::isnan(slope_err ) && (slope_err >= 0 ) )
538  hltNormRate_->setBinError(nL,slope_err);
539  }
540  }
541  //
542  std::string scalHistoNorm = folderName_ + "/raw/hltScalers";
543  MonitorElement *scalersN = dbe_->get(scalHistoNorm);
544  if ( scalersN ) {
545  double sf = num_fu /maxFU_;
546  for (int i = 1; i <= npaths ; ++i ) {
547  double cnt = scalersN->getBinContent(i);
548  recentNormedPathCountsPerLS_[i-1].update(CountLS_t(nL,cnt/sf));
549  std::pair<double,double> sl = getSlope_(recentNormedPathCountsPerLS_[i-1]);
550  double slope = sl.first; double slope_err = sl.second;
551  if ( slope >= 0 ) {
552  rateNormHistories_[i-1]->setBinContent(nL,slope);
553  // set the current rate(s)
554  hltCurrentNormRate_[(i-1)/kPerHisto]->setBinContent(i%kPerHisto, slope);
556  if ( slope_err <= 0 && cnt > 0) {
557  // ignores error on prev point, so scale by sqrt(2)
558  slope_err = slope*sqrt( 2./num_fu + 2./cnt);
559  if ( debug_ ) {
560  std::cout << "Slope err " << i << " = " << slope_err << std::endl;
561  }
562  }
563  if ( ! std::isnan(slope_err ) && (slope_err >= 0 ) ) {
564  rateNormHistories_[i-1]->setBinError(nL,slope_err);
565  // set the current rate(s)
566  hltCurrentNormRate_[(i-1)/kPerHisto]->setBinError(i%kPerHisto, slope_err);
567  currentNormRate_->setBinError(i, slope_err);
568 
569  }
570 
571  }
572  }
573  }
574 
575 #endif // LATER
576  //
577 
578 
579 
580 }
581 
582 // unused
584 {
585  // nothing to do here
586 }
587 
588 // this is probably overkill. Do a least-squares fit to get slope
589 // note that the data is in units of counts, ls number
590 // but we return a value in Hz...
591 std::pair<double,double>
593 {
594  double slope, sigma_m;
595  if ( points.size() < points.targetSize() ) {
596  return std::pair<double,double>(-1,-1);
597  }
598  // just do a delta if we just want two bins
599  else if ( points.size() == 2 ) {
600  // just do diff and be done with it
601  double delta_ls = points.front().first - points.back().first;
602  double delta_cnt = points.front().second - points.back().second;
603  slope = delta_cnt / delta_ls ;
604  sigma_m = -1;
605  }
606  else { // do a fit
607  double xy = 0;
608  double x = 0;
609  double xsq = 0;
610  double y = 0;
611  double n = double(points.size());
612  for ( CountLSFifo_t::iterator i(points.begin());
613  i != points.end(); ++i ) {
614  if ( debug_ )
615  std::cout << "x = " << i->first << ", y = " << i->second
616  << std::endl;
617  xy += i->first * i->second;
618  x += i->first;
619  xsq += i->first*i->first;
620  y += i->second;
621  }
622  slope = (n*xy - x*y)/(n*xsq - x*x);
623 
624  // now get the uncertainty on the slope. Need intercept for this.
625  double intercept = (xsq*y - xy*x)/(n*xsq-x*x);
626  double sigma_ysq = 0;
627  for ( CountLSFifo_t::iterator i(points.begin());
628  i != points.end(); ++i ) {
629  sigma_ysq += pow(( i->second - slope * i->first - intercept),2.);
630  }
631 // if ( debug_ )
632 // std::cout << "chi^2 = " << sigma_ysq << std::endl;
633  sigma_ysq *= 1./(n-2.);
634 
635  sigma_m = sqrt( n*sigma_ysq/(n*xsq - x*x));
636  }
637 
638  // std::cout << "Slope is " << slope << std::endl;
639  slope /= SECS_PER_LUMI_SECTION;
640  if ( sigma_m >0 )
641  sigma_m /= SECS_PER_LUMI_SECTION;
642 // if ( debug_ ) {
643 // std::cout << "Slope = " << slope << " +- " << sigma_m
644 // << std::endl;
645 // std::cout << "intercept is " << intercept
646 // << std::endl;
647 // }
648 
649 
650  return std::pair<double,double>(slope, sigma_m);
651 }
#define LogDebug(id)
std::pair< double, double > getSlope_(CountLSFifo_t points)
LuminosityBlockID id() const
std::ofstream textfile_
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
int i
Definition: DBlmapReader.cc:9
MonitorElement * updates_
void setBinContent(int binx, double content)
set content of bin (1-D)
RunID const & id() const
Definition: RunBase.h:41
static const HistoName names[]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::vector< MonitorElement * > rateHistories_
static const double slope[3]
MonitorElement * currentNormRate_
std::vector< CountLSFifo_t > recentNormedPathCountsPerLS_
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void beginJob(void)
BeginJob.
void Fill(long long x)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::vector< MonitorElement * > hltCurrentNormRate_
std::string folderName_
bool isnan(float x)
Definition: math.h:13
#define SECS_PER_LUMI_SECTION
MonitorElement * hltRate_
T sqrt(T t)
Definition: SSEVec.h:46
std::vector< MonitorElement * > countHistories_
void beginRun(const edm::Run &run, const edm::EventSetup &c)
BeginRun.
TH1 * getTH1(void) const
MonitorElement * mergeCount_
unsigned int kRateIntegWindow_
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
CountLSFifo_t recentOverallCountsPerLS_
DQMStore * dbe_
MonitorElement * currentRate_
int k[5][pyjets_maxn]
void update(const CountLS_t &T)
std::vector< CountLSFifo_t > recentPathCountsPerLS_
int64_t getIntValue(void) const
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * hltCount_
HLTScalersClient(const edm::ParameterSet &ps)
Constructors.
CountLSFifo_t recentNormedOverallCountsPerLS_
double getBinContent(int binx) const
get content of bin (1-D)
#define MAX_LUMI_SEG_HLT
std::vector< MonitorElement * > hltCurrentRate_
int getNbinsX(void) const
get # of bins in X-axis
const int kPerHisto
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hltNormRate_
void showDirStructure(void) const
Definition: DQMStore.cc:2761
x
Definition: VDTMath.h:216
#define MAX_PATHS
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33
std::vector< MonitorElement * > rateNormHistories_