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