Public Member Functions | Public Attributes | Private Member Functions | List of all members
om::PlotOptions Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/OnlineMonitoring/viewer/PlotOptions.h"

Public Member Functions

 PlotOptions ()
 
 ~PlotOptions ()
 
void Reset ()
 
void Set (const std::vector< std::string > &opt)
 
void SetPad (TPad *p)
 
void MakeLabels (const TH1 *h, const HistoData *hd)
 
void MakeLabelText (const TH1 *h)
 
void MakeSpecialLabel (const TH1 *h)
 
void MakeSpillTimeLabel (const TH1 *h)
 
void AutoScale (TH1F *h)
 
void AutoScale (TH2F *h)
 

Public Attributes

bool fZoomHour
 A special zoom option for plots vs. UTC hour. More...
 
bool fAutoZoomX
 Auto zoom the horizontal scale. More...
 
bool fAutoZoomY
 Auto zoom the vertical scale. More...
 
bool fAutoZoomZ
 Auto zoom the z scale. More...
 
bool fHwLblDet
 Apply hardware label to detector-wide plot. More...
 
bool fHwLblDetNoFEB
 As above, suppres FEB boundaries. More...
 
bool fHwLblDCM
 Apply hardware label to DCM plot. More...
 
bool fHwLblPCX
 Apply hardware labels to plane/cell plot (X-view) More...
 
bool fHwLblPCY
 Apply hardware labels to plane/cell plot (Y-view) More...
 
bool fFEButc
 Draw lines for FEB vs. hour plots. More...
 
bool fDCMutc
 Draw lines for DCM vs. hour plots. More...
 
bool fAlert
 Draw histo in "alert" mode. More...
 
bool fSpecial
 Draw a special case histo label. More...
 
bool fSpillTlbl
 
bool fLogx
 Log X axis. More...
 
bool fLogy
 Log Y axis. More...
 
bool fLogz
 Log Z axis. More...
 
bool fGridx
 Grid x. More...
 
bool fGridy
 Grid y. More...
 
bool fHaveXscale
 User specified x-scale? More...
 
double fXlo
 Low end of user-specified x-scale. More...
 
double fXhi
 High end of user-specified x-scale. More...
 
bool fHaveYscale
 User specified y-scale? More...
 
double fYlo
 Low end of user-specified y-scale. More...
 
double fYhi
 High end of user-specified y-scale. More...
 
bool fHaveZscale
 User specified z-scale? More...
 
double fZlo
 Low end of user-specified z-scale. More...
 
double fZhi
 High end of user-specified z-scale. More...
 
std::string fDrawOpt
 
TPaveText * fLabelText
 
TPaveText * fSLText
 
TLine * fLineTmin
 
TLine * fLineTmax
 
UTCLabel fUTCLabel
 

Private Member Functions

void ParseXscale (const char *opt)
 
void ParseYscale (const char *opt)
 
void ParseZscale (const char *opt)
 

Detailed Description

Encapsulate all the plotting options

Definition at line 20 of file PlotOptions.h.

Constructor & Destructor Documentation

PlotOptions::PlotOptions ( )

Definition at line 26 of file PlotOptions.cxx.

References fLabelText, fSLText, and Reset().

27 {
28  fLabelText = new TPaveText(0.1, 0.0, 0.5, 0.055, "NDC");
29  fSLText = new TPaveText(0.0, 0.1, 0.09, 0.9, "NDC");
30 
31  fLabelText->SetLineColor(0);
32  fLabelText->SetFillColor(0);
33  fLabelText->SetBorderSize(1);
34  fLabelText->SetMargin(0.0);
35  fLabelText->SetTextAlign(11);
36 
37  fSLText->SetLineColor(0);
38  fSLText->SetFillColor(0);
39  fSLText->SetBorderSize(1);
40 
41  this->Reset();
42 }
TPaveText * fLabelText
Definition: PlotOptions.h:86
TPaveText * fSLText
Definition: PlotOptions.h:87
PlotOptions::~PlotOptions ( )

Definition at line 629 of file PlotOptions.cxx.

References fLabelText, and fSLText.

630 {
631  if(fLabelText) { delete fLabelText; fLabelText = 0; }
632  if(fSLText) { delete fSLText; fSLText = 0; }
633 }
TPaveText * fLabelText
Definition: PlotOptions.h:86
TPaveText * fSLText
Definition: PlotOptions.h:87

Member Function Documentation

void PlotOptions::AutoScale ( TH1F *  h)

Definition at line 252 of file PlotOptions.cxx.

References e, fAutoZoomX, fAutoZoomY, fHaveXscale, fHaveYscale, fLogx, fLogy, fXhi, fXlo, fYhi, fYlo, fZoomHour, hi(), MECModelEnuComparisons::i, lo(), recentWatchdog::now, xhi, make_syst_table_plots::xlo, submit_syst::y, yhi, and ylo.

Referenced by om::PlotViewer::Update(), and om::PlotViewer::UpdateCompare().

253 {
254  int i;
255  int ilox = 999;
256  int ihix = 0;
257  double y;
258  double ylo = 9e9;
259  double yhi = -9e9;
260  for (i=1; i<=h->GetNbinsX(); ++i) {
261  y = h->GetBinContent(i);
262  if (y!=0.0) {
263  if (y<ylo) ylo = y;
264  if (y>yhi) yhi = y;
265  if (i<ilox) ilox = i;
266  if (i>ihix) ihix = i;
267  }
268  }
269  if (fZoomHour) {
270 
271  // Get the current UTC hour.
272  time_t rawtime;
273  time(&rawtime);
274  struct tm* timestr;
275  timestr = gmtime(&rawtime);
276  double now = timestr->tm_hour + (timestr->tm_min)/60.0;
277 
278  h->GetXaxis()->SetRangeUser(now - 1.0, now);
279 
280  }
281  if (fAutoZoomX) {
282  double xlo = 0.9*h->GetXaxis()->GetBinLowEdge(ilox);
283  double xhi = 1.1*h->GetXaxis()->GetBinUpEdge(ihix);
284  //
285  // If we are on a logarithmic scale make sure we have at least 1
286  // order of magnitude. Otherwise no numbers will be shown on the
287  // scale
288  //
289  if (fLogx) {
290  if (xlo<=0.0) xlo = 1e-3;
291  if (xhi<=xlo) xhi = 10.0*xlo;
292  while (xhi/xlo<10.0) { xhi *= 1.1; xlo *= 0.9; }
293  }
294  h->GetXaxis()->SetRangeUser(xlo, xhi);
295  }
296  if (fAutoZoomY) {
297  ylo = 0.9*ylo;
298  yhi = 1.1*yhi;
299  if (fLogy) {
300  if (ylo<=0.0) ylo = 0.1;
301  if (yhi<=ylo) yhi = 10.0*ylo;
302  while (yhi/ylo<10.0) { yhi *= 1.1; ylo *= 0.9; }
303  }
304  h->GetYaxis()->SetRangeUser(ylo, yhi);
305  }
306 
307  if (fHaveXscale) {
308  double lo = fXlo;
309  double hi = fXhi;
310  h->GetXaxis()->SetRangeUser(lo,hi);
311  }
312  if (fHaveYscale) {
313  double lo = fYlo;
314  double hi = fYhi;
315  h->GetYaxis()->SetRangeUser(lo,hi);
316  }
317 }
double fYlo
Low end of user-specified y-scale.
Definition: PlotOptions.h:73
TSpline3 lo("lo", xlo, ylo, 12,"0")
double fYhi
High end of user-specified y-scale.
Definition: PlotOptions.h:74
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
bool fLogy
Log Y axis.
Definition: PlotOptions.h:65
TSpline3 hi("hi", xhi, yhi, 18,"0")
double fXhi
High end of user-specified x-scale.
Definition: PlotOptions.h:71
bool fAutoZoomY
Auto zoom the vertical scale.
Definition: PlotOptions.h:49
bool fHaveYscale
User specified y-scale?
Definition: PlotOptions.h:72
bool fAutoZoomX
Auto zoom the horizontal scale.
Definition: PlotOptions.h:48
bool fZoomHour
A special zoom option for plots vs. UTC hour.
Definition: PlotOptions.h:47
bool fHaveXscale
User specified x-scale?
Definition: PlotOptions.h:69
bool fLogx
Log X axis.
Definition: PlotOptions.h:64
Float_t e
Definition: plot.C:35
double fXlo
Low end of user-specified x-scale.
Definition: PlotOptions.h:70
void PlotOptions::AutoScale ( TH2F *  h)

Definition at line 321 of file PlotOptions.cxx.

References plot_validation_datamc::c, e, fAutoZoomX, fAutoZoomY, fAutoZoomZ, fHaveXscale, fHaveYscale, fHaveZscale, fLogx, fLogy, fLogz, fXhi, fXlo, fYhi, fYlo, fZhi, fZlo, fZoomHour, hi(), MECModelEnuComparisons::i, calib::j, lo(), recentWatchdog::now, xhi, make_syst_table_plots::xlo, yhi, and ylo.

322 {
323  //
324  // Check options - if none are set, just return now.
325  //
326  if (fZoomHour ==false &&
327  fAutoZoomX ==false &&
328  fAutoZoomY ==false &&
329  fAutoZoomZ ==false &&
330  fHaveXscale==false &&
331  fHaveYscale==false &&
332  fHaveZscale==false) {
333  return;
334  }
335 
336  int ilox = 999;
337  int ihix = 0;
338  int iloy = 999;
339  int ihiy = 0;
340  double c = 0;
341  double mx = 0;
342  double mn = 9e99;
343 
344  int i, j;
345  for (i=1; i<=h->GetNbinsX(); ++i) {
346  for (j=1; j<=h->GetNbinsY(); ++j) {
347  c = h->GetBinContent(i,j);
348  if (c!=0) {
349  if (c>mx) mx = c;
350  if (c<mn) mn = c;
351  if (i<ilox) ilox = i;
352  if (i>ihix) ihix = i;
353  if (j<iloy) iloy = j;
354  if (j>ihiy) ihiy = j;
355  }
356  }
357  }
358  if (fZoomHour) {
359 
360  // Get the current UTC hour.
361  time_t rawtime;
362  time(&rawtime);
363  struct tm* timestr;
364  timestr = gmtime(&rawtime);
365  double now = timestr->tm_hour + (timestr->tm_min)/60.0;
366 
367  h->GetXaxis()->SetRangeUser(now - 1.0, now);
368 
369  }
370  if (fAutoZoomX) {
371  double xlo = 0.95*h->GetXaxis()->GetBinLowEdge(ilox);
372  double xhi = 1.05*h->GetXaxis()->GetBinUpEdge(ihix);
373  if (fLogx) {
374  if (xlo<=0.0) xlo = 1e-3;
375  if (xhi<=xlo) xhi = 10.0*xlo;
376  while (xhi/xlo<10.0) { xhi *= 1.1; xlo *= 0.9; }
377  }
378  h->GetXaxis()->SetRangeUser(xlo, xhi);
379  }
380  if (fAutoZoomY) {
381  double ylo = 0.95*h->GetYaxis()->GetBinLowEdge(iloy);
382  double yhi = 1.05*h->GetYaxis()->GetBinUpEdge(ihiy);
383  if (fLogy) {
384  if (ylo<=0.0) ylo = 1e-3;
385  if (yhi<=ylo) yhi = 10.0*ylo;
386  while (yhi/ylo<10.0) { yhi *= 1.1; ylo *= 0.9; }
387  }
388  h->GetYaxis()->SetRangeUser(ylo, yhi);
389  }
390  if (fAutoZoomZ) {
391  if (fLogz) {
392  if (mn<=0.0) mn = 0.1;
393  if (mx<=mn) mx = 10.0*mn;
394  while (mx/mn<10.0) { mx *= 1.1; mn *= 0.9; }
395  }
396  h->GetZaxis()->SetRangeUser(0.95*mn, 1.05*mx);
397  }
398 
399  if (fHaveXscale) {
400  double lo = fXlo;
401  double hi = fXhi;
402  h->GetXaxis()->SetRangeUser(lo,hi);
403  }
404  if (fHaveYscale) {
405  double lo = fYlo;
406  double hi = fYhi;
407  h->GetYaxis()->SetRangeUser(lo,hi);
408  }
409  if (fHaveZscale) {
410  double lo = fZlo;
411  double hi = fZhi;
412  h->GetZaxis()->SetRangeUser(lo,hi);
413  }
414 }
double fYlo
Low end of user-specified y-scale.
Definition: PlotOptions.h:73
TSpline3 lo("lo", xlo, ylo, 12,"0")
double fYhi
High end of user-specified y-scale.
Definition: PlotOptions.h:74
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
bool fLogy
Log Y axis.
Definition: PlotOptions.h:65
TSpline3 hi("hi", xhi, yhi, 18,"0")
bool fLogz
Log Z axis.
Definition: PlotOptions.h:66
double fXhi
High end of user-specified x-scale.
Definition: PlotOptions.h:71
bool fAutoZoomY
Auto zoom the vertical scale.
Definition: PlotOptions.h:49
bool fHaveYscale
User specified y-scale?
Definition: PlotOptions.h:72
const double j
Definition: BetheBloch.cxx:29
bool fAutoZoomX
Auto zoom the horizontal scale.
Definition: PlotOptions.h:48
bool fZoomHour
A special zoom option for plots vs. UTC hour.
Definition: PlotOptions.h:47
bool fAutoZoomZ
Auto zoom the z scale.
Definition: PlotOptions.h:50
bool fHaveXscale
User specified x-scale?
Definition: PlotOptions.h:69
bool fHaveZscale
User specified z-scale?
Definition: PlotOptions.h:75
double fZlo
Low end of user-specified z-scale.
Definition: PlotOptions.h:76
bool fLogx
Log X axis.
Definition: PlotOptions.h:64
Float_t e
Definition: plot.C:35
double fZhi
High end of user-specified z-scale.
Definition: PlotOptions.h:77
double fXlo
Low end of user-specified x-scale.
Definition: PlotOptions.h:70
void PlotOptions::MakeLabels ( const TH1 *  h,
const HistoData hd 
)

Definition at line 197 of file PlotOptions.cxx.

References om::HwDetLabel::Config(), om::HwPCLabel::Config(), om::HwDCMLabel::Config(), om::UTCLabel::DCMLabels(), om::HwDetLabel::Draw(), om::HwPCLabel::Draw(), om::HwDCMLabel::Draw(), om::UTCLabel::Draw(), om::HwPCLabel::DrawNDOS(), fDCMutc, om::HistoData::fDetector, om::UTCLabel::FEBLabels(), fFEButc, fHwLblDCM, fHwLblDet, fHwLblDetNoFEB, fHwLblPCX, fHwLblPCY, fLabelText, fLineTmax, fLineTmin, fSLText, fSpecial, fSpillTlbl, fUTCLabel, gsHwDetLabel, gsHwDetLabelNoFEB, om::kNDOS, MakeLabelText(), MakeSpecialLabel(), and MakeSpillTimeLabel().

Referenced by om::PlotViewer::Update(), and om::PlotViewer::UpdateCompare().

198 {
199  if (fHwLblDCM) {
201  gsHwDCMLabel.Draw();
202  }
203  if (fHwLblDet) {
205  gsHwDetLabel.Draw();
206  }
207  if (fHwLblDetNoFEB) {
210  }
211  if (fHwLblPCX || fHwLblPCY) {
212  if(hd->fDetector == om::kNDOS) {
214  gsHwPCLabel.Draw();
215  }
216  else {
218  gsHwPCLabel.Draw();
219  }
220  }
221  if(fFEButc) {
223  fUTCLabel.Draw();
224  }
225  if(fDCMutc) {
227  fUTCLabel.Draw();
228  }
229 
230  fLabelText->Clear();
231  this->MakeLabelText(h);
232  fLabelText->Draw();
233 
234  fSLText->Clear();
235  if (fSpecial) {
236  this->MakeSpecialLabel(h);
237  fSLText->Draw();
238  }
239 
240  if (fSpillTlbl) {
241  this->MakeSpillTimeLabel(h);
242  // draw lines
243  fLineTmin->Draw();
244  fLineTmax->Draw();
245 
246  }
247 
248 }
void MakeLabelText(const TH1 *h)
void DrawNDOS(bool isXview)
Definition: HwPCLabel.cxx:297
bool fFEButc
Draw lines for FEB vs. hour plots.
Definition: PlotOptions.h:56
TPaveText * fLabelText
Definition: PlotOptions.h:86
void FEBLabels()
Definition: UTCLabel.cxx:51
UTCLabel fUTCLabel
Definition: PlotOptions.h:93
static HwDetLabel gsHwDetLabelNoFEB(false)
TPaveText * fSLText
Definition: PlotOptions.h:87
void Config(const TH1 *h)
Definition: HwDCMLabel.cxx:18
TLine * fLineTmin
Definition: PlotOptions.h:88
void Config(const TH1 *h, bool isXview)
Definition: HwPCLabel.cxx:27
static HwDetLabel gsHwDetLabel(true)
bool fHwLblDet
Apply hardware label to detector-wide plot.
Definition: PlotOptions.h:51
static HwDCMLabel gsHwDCMLabel
Definition: PlotOptions.cxx:21
bool fHwLblDetNoFEB
As above, suppres FEB boundaries.
Definition: PlotOptions.h:52
bool fHwLblPCX
Apply hardware labels to plane/cell plot (X-view)
Definition: PlotOptions.h:54
static HwPCLabel gsHwPCLabel
Definition: PlotOptions.cxx:24
bool fHwLblPCY
Apply hardware labels to plane/cell plot (Y-view)
Definition: PlotOptions.h:55
void Draw()
Definition: UTCLabel.cxx:38
void DCMLabels()
Definition: UTCLabel.cxx:87
void MakeSpillTimeLabel(const TH1 *h)
bool fHwLblDCM
Apply hardware label to DCM plot.
Definition: PlotOptions.h:53
TLine * fLineTmax
Definition: PlotOptions.h:89
bool fDCMutc
Draw lines for DCM vs. hour plots.
Definition: PlotOptions.h:57
bool fSpecial
Draw a special case histo label.
Definition: PlotOptions.h:59
void Config(const TH1 *h)
Definition: HwDetLabel.cxx:21
Detector_t fDetector
Detector these settings apply to.
Definition: HistoData.h:44
void MakeSpecialLabel(const TH1 *h)
void PlotOptions::MakeLabelText ( const TH1 *  h)

Definition at line 418 of file PlotOptions.cxx.

References om::GUIModel::Data(), e, MakeMiniprodValidationCuts::f, om::GUIModelData::fHistogramSource, fLabelText, om::HistoSource::GetStatus(), om::GUIModel::Instance(), BlessedPlots::pid, r(), source, fetchNoiseMap::stime, submit_syst::str, and string.

Referenced by MakeLabels().

419 {
420 
421  //
422  // Add event numbers and histogram source name
423  //
424  // Check to see that the histosource is SHM or ROOT and make the
425  // appropriate label.
426  //
427  const char* source = GUIModel::Instance().Data().fHistogramSource.c_str();
428  std::string str(source);
429  bool is_root = str.find(".root")<str.length();
430  bool is_shm = str.find(".shm")< str.length();
431 
432  if ( is_root && is_shm) abort();
433  if (!is_root && !is_shm) abort();
434 
435  char buff[256];
436  if(is_shm) {
437  sprintf(buff, "%s : source = %s", h->GetName(), source);
438  fLabelText->AddText(buff);
439 
440  HistoSource f(source);
441 
442  std::string snm;
443  unsigned int r, s, e;
444  pid_t pid;
445  long stime, utime, cpu, rsize;
446  time_t tp;
447  f.GetStatus(snm, &r, &s, &e, &pid, &stime, &utime, &cpu, &rsize, &tp);
448 
449  char evtext[256];
450  sprintf(evtext, "EventID: %d / %d / %d", r, s, e);
451  fLabelText->AddText(evtext);
452  }
453  else {
454  sprintf(buff, "%s :", h->GetName());
455  fLabelText->AddText(buff);
456  fLabelText->AddText(source);
457  }
458 
459  //
460  // Add date and time stamp
461  //
462  time_t rawtime;
463  time(&rawtime);
464  struct tm* timestr;
465  timestr = gmtime(&rawtime);
466  sprintf(buff, "%s (UTC)",asctime(timestr));
467 
468  fLabelText->AddText(buff);
469 }
TPaveText * fLabelText
Definition: PlotOptions.h:86
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
const XML_Char * s
Definition: expat.h:262
static GUIModel & Instance()
Definition: GUIModel.cxx:11
const char * source
Definition: lz4.h:436
std::string fHistogramSource
Definition: GUIModelData.h:35
TRandom3 r(0)
Float_t e
Definition: plot.C:35
const GUIModelData & Data() const
Definition: GUIModel.h:15
enum BeamMode string
void PlotOptions::MakeSpecialLabel ( const TH1 *  h)

Definition at line 473 of file PlotOptions.cxx.

References fSLText, om::GUIModel::Instance(), om::kTESTBEAM, and string.

Referenced by MakeLabels().

474 {
475  //
476  // Make the special labels for the triggers vs. hour plot.
477  //
478  const std::string TriggerVsHour ("TriggerVsHour");
479  const std::string AEVsHour ("AEVsHour");
480  const std::string AAVsHour ("AAVsHour");
481 
482  if(TriggerVsHour == h->GetName()) {
483 
484  fSLText->AddText("Cosmic");
485  fSLText->AddText("");
486  if(GUIModel::Instance().Data().fDetector == kTESTBEAM)
487  fSLText->AddText("Beamline");
488  else
489  fSLText->AddText("BnB");
490  fSLText->AddText("");
491  fSLText->AddText("NuMI");
492 
493  }
494 
495  //
496  // Make the special labels for the errors vs. hour plot.
497  //
498  if(AEVsHour == h->GetName()) {
499 
500  fSLText->AddText("FEB Data");
501  fSLText->AddText("Present");
502  fSLText->AddText("");
503  fSLText->AddText("");
504  fSLText->AddText("Link");
505  fSLText->AddText("Status");
506  fSLText->AddText("");
507  fSLText->AddText("");
508  fSLText->AddText("Data Drop");
509  fSLText->AddText("");
510  fSLText->AddText("");
511  fSLText->AddText("");
512  fSLText->AddText("TECC");
513  fSLText->AddText("");
514  fSLText->AddText("");
515  fSLText->AddText("");
516  fSLText->AddText("ADC");
517  fSLText->AddText("");
518  fSLText->AddText("");
519  fSLText->AddText("");
520  fSLText->AddText("Comm.");
521  fSLText->AddText("");
522  fSLText->AddText("");
523  fSLText->AddText("");
524  fSLText->AddText("DCM Data");
525  fSLText->AddText("Present");
526  fSLText->AddText("");
527  fSLText->AddText("");
528  fSLText->AddText("Millislice");
529  fSLText->AddText("Incomplete");
530  fSLText->AddText("");
531  fSLText->AddText("");
532  fSLText->AddText("Data");
533  fSLText->AddText("Missing");
534  fSLText->AddText("");
535  fSLText->AddText("");
536  fSLText->AddText("Event");
537  fSLText->AddText("Incomplete");
538  }
539 
540  //
541  // Make the special labels for the alerts vs. hour plot.
542  //
543  if(AAVsHour == h->GetName()) {
544 
545  fSLText->AddText("Debug");
546  fSLText->AddText("Mode");
547  fSLText->AddText("");
548  fSLText->AddText("");
549  fSLText->AddText("");
550  fSLText->AddText("");
551  fSLText->AddText("FIFO");
552  fSLText->AddText("Full");
553  fSLText->AddText("");
554  fSLText->AddText("");
555  fSLText->AddText("");
556  fSLText->AddText("");
557  fSLText->AddText("TECC");
558  fSLText->AddText("Enabled");
559  fSLText->AddText("");
560  fSLText->AddText("");
561  fSLText->AddText("");
562  fSLText->AddText("");
563  fSLText->AddText("DAQ");
564  fSLText->AddText("Enabled");
565  fSLText->AddText("");
566  fSLText->AddText("");
567  fSLText->AddText("");
568  fSLText->AddText("");
569  fSLText->AddText("Simulations");
570  fSLText->AddText("Flag");
571 
572  }
573 
574  fSLText->Draw();
575 
576 }
TPaveText * fSLText
Definition: PlotOptions.h:87
static GUIModel & Instance()
Definition: GUIModel.cxx:11
enum BeamMode string
void PlotOptions::MakeSpillTimeLabel ( const TH1 *  h)

Definition at line 579 of file PlotOptions.cxx.

References fLineTmax, fLineTmin, and string.

Referenced by MakeLabels().

580 {
581  //
582  // Make lines and label for TPlots on appropriate ranges for each
583  //
584  const std::string TPlotALL ("TPlotALL");
585  const std::string TPlotZOOM ("TPlotZOOM");
586  const std::string TimingALLvsHour ("TimingALLvsHour");
587  const std::string TimingZOOMvsHour ("TimingZOOMvsHour");
588 
589  if ( TPlotZOOM == h->GetName() ) {
590  fLineTmin = new TLine( 218-0.05, h->GetBinContent(h->GetMinimumBin()), 218-0.05, 1.1*(h->GetBinContent(h->GetMaximumBin())));
591  fLineTmax = new TLine( 228+0.1, h->GetBinContent(h->GetMinimumBin()), 228+0.1, 1.1*(h->GetBinContent(h->GetMaximumBin())));
592  fLineTmin->SetLineColor(kPink+2);
593  fLineTmax->SetLineColor(kPink+2);
594  }
595 
596  if ( TPlotALL == h->GetName() ) {
597  fLineTmin = new TLine( 218-3, h->GetBinContent(h->GetMinimumBin()), 218-3, 1.1*(h->GetBinContent(h->GetMaximumBin())));
598  fLineTmax = new TLine( 228+4, h->GetBinContent(h->GetMinimumBin()), 228+4, 1.1*(h->GetBinContent(h->GetMaximumBin())));
599  fLineTmin->SetLineColor(kPink+2);
600  fLineTmax->SetLineColor(kPink+2);
601  }
602 
603  if ( TimingZOOMvsHour == h->GetName() ) {
604  fLineTmin = new TLine( 0, 218-0.05, 24, 218-0.05);
605  fLineTmax = new TLine( 0, 228+0.1, 24, 228+0.1);
606  fLineTmin->SetLineColor(kWhite);
607  fLineTmax->SetLineColor(kWhite);
608  }
609 
610  if ( TimingALLvsHour == h->GetName() ) {
611  fLineTmin = new TLine( 0, 218-3, 24, 218-3);
612  fLineTmax = new TLine( 0, 228+4, 24, 228+4);
613  fLineTmin->SetLineColor(kWhite);
614  fLineTmax->SetLineColor(kWhite);
615  }
616 
617  fLineTmin->SetLineStyle(2);
618  fLineTmin->SetLineWidth(2);
619  fLineTmax->SetLineStyle(2);
620  fLineTmax->SetLineWidth(2);
621 
622  fLineTmin->Draw();
623  fLineTmax->Draw();
624 
625 
626 }
TLine * fLineTmin
Definition: PlotOptions.h:88
TLine * fLineTmax
Definition: PlotOptions.h:89
enum BeamMode string
void PlotOptions::ParseXscale ( const char *  opt)
private

Definition at line 83 of file PlotOptions.cxx.

References om::cerr, allTimeWatchdog::endl, fHaveXscale, fXhi, fXlo, getGoodRuns4SAM::n, x1, and submit_syst::x2.

Referenced by Set().

84 {
85  int n;
86  float x1, x2;
87  n = sscanf(opt,"xscale[%f|%f]",&x1,&x2);
88  if (n==2) {
89  fHaveXscale = true;
90  fXlo = x1;
91  fXhi = x2;
92  }
93  else {
94  std::cerr << __FILE__ << ":" << __LINE__
95  << " Can't parse " << opt
96  << std::endl;
97  }
98 }
Float_t x1[n_points_granero]
Definition: compare.C:5
OStream cerr
Definition: OStream.cxx:7
double fXhi
High end of user-specified x-scale.
Definition: PlotOptions.h:71
bool fHaveXscale
User specified x-scale?
Definition: PlotOptions.h:69
double fXlo
Low end of user-specified x-scale.
Definition: PlotOptions.h:70
void PlotOptions::ParseYscale ( const char *  opt)
private

Definition at line 104 of file PlotOptions.cxx.

References om::cerr, allTimeWatchdog::endl, fHaveYscale, fYhi, fYlo, getGoodRuns4SAM::n, y1, and submit_syst::y2.

Referenced by Set().

105 {
106  int n;
107  float y1, y2;
108  n = sscanf(opt,"yscale[%f|%f]",&y1,&y2);
109  if (n==2) {
110  fHaveYscale = true;
111  fYlo = y1;
112  fYhi = y2;
113  }
114  else {
115  std::cerr << __FILE__ << ":" << __LINE__
116  << " Can't parse " << opt
117  << std::endl;
118  }
119 }
double fYlo
Low end of user-specified y-scale.
Definition: PlotOptions.h:73
Float_t y1[n_points_granero]
Definition: compare.C:5
OStream cerr
Definition: OStream.cxx:7
double fYhi
High end of user-specified y-scale.
Definition: PlotOptions.h:74
bool fHaveYscale
User specified y-scale?
Definition: PlotOptions.h:72
void PlotOptions::ParseZscale ( const char *  opt)
private

Definition at line 125 of file PlotOptions.cxx.

References om::cerr, allTimeWatchdog::endl, fHaveZscale, fZhi, fZlo, and getGoodRuns4SAM::n.

Referenced by Set().

126 {
127  int n;
128  float z1, z2;
129  n = sscanf(opt,"zscale[%f|%f]",&z1,&z2);
130  if (n==2) {
131  fHaveZscale = true;
132  fZlo = z1;
133  fZhi = z2;
134  }
135  else {
136  std::cerr << __FILE__ << ":" << __LINE__
137  << " Can't parse " << opt
138  << std::endl;
139  }
140 }
OStream cerr
Definition: OStream.cxx:7
bool fHaveZscale
User specified z-scale?
Definition: PlotOptions.h:75
double fZlo
Low end of user-specified z-scale.
Definition: PlotOptions.h:76
double fZhi
High end of user-specified z-scale.
Definition: PlotOptions.h:77
void PlotOptions::Reset ( )

Definition at line 46 of file PlotOptions.cxx.

References fAlert, fAutoZoomX, fAutoZoomY, fAutoZoomZ, fDCMutc, fDrawOpt, fFEButc, fGridx, fGridy, fHaveXscale, fHaveYscale, fHaveZscale, fHwLblDCM, fHwLblDet, fHwLblDetNoFEB, fHwLblPCX, fHwLblPCY, fLogx, fLogy, fLogz, fSpecial, fSpillTlbl, fXhi, fXlo, fYhi, fYlo, fZhi, fZlo, and fZoomHour.

Referenced by PlotOptions(), and Set().

47 {
48  fDrawOpt = "";
49  fZoomHour = false;
50  fAutoZoomX = false;
51  fAutoZoomY = false;
52  fAutoZoomZ = false;
53  fHwLblDet = false;
54  fHwLblDetNoFEB = false;
55  fHwLblDCM = false;
56  fHwLblPCX = false;
57  fHwLblPCY = false;
58  fFEButc = false;
59  fDCMutc = false;
60  fAlert = false;
61  fSpecial = false;
62  fSpillTlbl = false;
63  fLogx = false;
64  fLogy = false;
65  fLogz = false;
66  fGridx = false;
67  fGridy = false;
68  fHaveXscale = false;
69  fXlo = 0;
70  fXhi = 0;
71  fHaveYscale = false;
72  fYlo = 0;
73  fYhi = 0;
74  fHaveZscale = false;
75  fZlo = 0;
76  fZhi = 0;
77 }
double fYlo
Low end of user-specified y-scale.
Definition: PlotOptions.h:73
bool fFEButc
Draw lines for FEB vs. hour plots.
Definition: PlotOptions.h:56
bool fGridx
Grid x.
Definition: PlotOptions.h:67
double fYhi
High end of user-specified y-scale.
Definition: PlotOptions.h:74
bool fGridy
Grid y.
Definition: PlotOptions.h:68
std::string fDrawOpt
Definition: PlotOptions.h:82
bool fLogy
Log Y axis.
Definition: PlotOptions.h:65
bool fLogz
Log Z axis.
Definition: PlotOptions.h:66
bool fHwLblDet
Apply hardware label to detector-wide plot.
Definition: PlotOptions.h:51
double fXhi
High end of user-specified x-scale.
Definition: PlotOptions.h:71
bool fHwLblDetNoFEB
As above, suppres FEB boundaries.
Definition: PlotOptions.h:52
bool fAutoZoomY
Auto zoom the vertical scale.
Definition: PlotOptions.h:49
bool fHwLblPCX
Apply hardware labels to plane/cell plot (X-view)
Definition: PlotOptions.h:54
bool fHaveYscale
User specified y-scale?
Definition: PlotOptions.h:72
bool fAutoZoomX
Auto zoom the horizontal scale.
Definition: PlotOptions.h:48
bool fZoomHour
A special zoom option for plots vs. UTC hour.
Definition: PlotOptions.h:47
bool fHwLblPCY
Apply hardware labels to plane/cell plot (Y-view)
Definition: PlotOptions.h:55
bool fAutoZoomZ
Auto zoom the z scale.
Definition: PlotOptions.h:50
bool fHaveXscale
User specified x-scale?
Definition: PlotOptions.h:69
bool fAlert
Draw histo in "alert" mode.
Definition: PlotOptions.h:58
bool fHwLblDCM
Apply hardware label to DCM plot.
Definition: PlotOptions.h:53
bool fDCMutc
Draw lines for DCM vs. hour plots.
Definition: PlotOptions.h:57
bool fSpecial
Draw a special case histo label.
Definition: PlotOptions.h:59
bool fHaveZscale
User specified z-scale?
Definition: PlotOptions.h:75
double fZlo
Low end of user-specified z-scale.
Definition: PlotOptions.h:76
bool fLogx
Log X axis.
Definition: PlotOptions.h:64
double fZhi
High end of user-specified z-scale.
Definition: PlotOptions.h:77
double fXlo
Low end of user-specified x-scale.
Definition: PlotOptions.h:70
void PlotOptions::Set ( const std::vector< std::string > &  opt)

Definition at line 144 of file PlotOptions.cxx.

References fAlert, fAutoZoomX, fAutoZoomY, fAutoZoomZ, fDCMutc, fDrawOpt, fFEButc, fGridx, fGridy, fHwLblDCM, fHwLblDet, fHwLblPCX, fHwLblPCY, fLogx, fLogy, fLogz, fSpecial, fSpillTlbl, fZoomHour, MECModelEnuComparisons::i, ParseXscale(), ParseYscale(), ParseZscale(), and Reset().

Referenced by om::PlotViewer::Update(), and om::PlotViewer::UpdateCompare().

145 {
146  this->Reset();
147  unsigned int i;
148  for (i=0; i<opt.size(); ++i) {
149  bool xscale = (strncmp(opt[i].c_str(),"xscale",6)==0);
150  bool yscale = (strncmp(opt[i].c_str(),"yscale",6)==0);
151  bool zscale = (strncmp(opt[i].c_str(),"zscale",6)==0);
152 
153  if (opt[i]=="zoomhour") { fZoomHour = true; }
154  else if (opt[i]=="autozoomx") { fAutoZoomX = true; }
155  else if (opt[i]=="autozoomy") { fAutoZoomY = true; }
156  else if (opt[i]=="autozoomz") { fAutoZoomZ = true; }
157  else if (opt[i]=="hwlbl_det") { fHwLblDet = true; fDrawOpt += "a"; }
158  else if (opt[i]=="hwlbl_dcm") { fHwLblDCM = true; fDrawOpt += "a"; }
159  else if (opt[i]=="hwlbl_pcx") { fHwLblPCX = true; fDrawOpt += "a"; }
160  else if (opt[i]=="hwlbl_pcy") { fHwLblPCY = true; fDrawOpt += "a"; }
161  else if (opt[i]=="febutc") { fFEButc = true; }
162  else if (opt[i]=="dcmutc") { fDCMutc = true; }
163  else if (opt[i]=="alert") { fAlert = true; }
164  else if (opt[i]=="special") { fSpecial = true; }
165  else if (opt[i]=="spilltlbl") { fSpillTlbl = true; }
166  else if (opt[i]=="logx") { fLogx = true; }
167  else if (opt[i]=="logy") { fLogy = true; }
168  else if (opt[i]=="logz") { fLogz = true; }
169  else if (opt[i]=="gridx") { fGridx = true; }
170  else if (opt[i]=="gridy") { fGridy = true; }
171  else if (xscale) { this->ParseXscale(opt[i].c_str()); }
172  else if (yscale) { this->ParseYscale(opt[i].c_str()); }
173  else if (zscale) { this->ParseZscale(opt[i].c_str()); }
174  else {
175  //
176  // If the options haven't been handled yet, assume they are
177  // histogram drawing options
178  //
179  fDrawOpt += opt[i];
180  }
181  }
182 }
bool fFEButc
Draw lines for FEB vs. hour plots.
Definition: PlotOptions.h:56
bool fGridx
Grid x.
Definition: PlotOptions.h:67
void ParseZscale(const char *opt)
bool fGridy
Grid y.
Definition: PlotOptions.h:68
std::string fDrawOpt
Definition: PlotOptions.h:82
void ParseYscale(const char *opt)
bool fLogy
Log Y axis.
Definition: PlotOptions.h:65
bool fLogz
Log Z axis.
Definition: PlotOptions.h:66
bool fHwLblDet
Apply hardware label to detector-wide plot.
Definition: PlotOptions.h:51
bool fAutoZoomY
Auto zoom the vertical scale.
Definition: PlotOptions.h:49
bool fHwLblPCX
Apply hardware labels to plane/cell plot (X-view)
Definition: PlotOptions.h:54
bool fAutoZoomX
Auto zoom the horizontal scale.
Definition: PlotOptions.h:48
bool fZoomHour
A special zoom option for plots vs. UTC hour.
Definition: PlotOptions.h:47
bool fHwLblPCY
Apply hardware labels to plane/cell plot (Y-view)
Definition: PlotOptions.h:55
bool fAutoZoomZ
Auto zoom the z scale.
Definition: PlotOptions.h:50
bool fAlert
Draw histo in "alert" mode.
Definition: PlotOptions.h:58
bool fHwLblDCM
Apply hardware label to DCM plot.
Definition: PlotOptions.h:53
bool fDCMutc
Draw lines for DCM vs. hour plots.
Definition: PlotOptions.h:57
bool fSpecial
Draw a special case histo label.
Definition: PlotOptions.h:59
bool fLogx
Log X axis.
Definition: PlotOptions.h:64
void ParseXscale(const char *opt)
Definition: PlotOptions.cxx:83
void PlotOptions::SetPad ( TPad *  p)

Definition at line 186 of file PlotOptions.cxx.

References fGridx, fGridy, fLogx, fLogy, and fLogz.

Referenced by om::PlotViewer::Update(), and om::PlotViewer::UpdateCompare().

187 {
188  p->SetLogx(fLogx);
189  p->SetLogy(fLogy);
190  p->SetLogz(fLogz);
191  p->SetGridx(fGridx);
192  p->SetGridy(fGridy);
193 }
bool fGridx
Grid x.
Definition: PlotOptions.h:67
const char * p
Definition: xmltok.h:285
bool fGridy
Grid y.
Definition: PlotOptions.h:68
bool fLogy
Log Y axis.
Definition: PlotOptions.h:65
bool fLogz
Log Z axis.
Definition: PlotOptions.h:66
bool fLogx
Log X axis.
Definition: PlotOptions.h:64

Member Data Documentation

bool om::PlotOptions::fAlert

Draw histo in "alert" mode.

Definition at line 58 of file PlotOptions.h.

Referenced by Reset(), Set(), and om::PlotViewer::Update().

bool om::PlotOptions::fAutoZoomX

Auto zoom the horizontal scale.

Definition at line 48 of file PlotOptions.h.

Referenced by AutoScale(), Reset(), and Set().

bool om::PlotOptions::fAutoZoomY

Auto zoom the vertical scale.

Definition at line 49 of file PlotOptions.h.

Referenced by AutoScale(), Reset(), and Set().

bool om::PlotOptions::fAutoZoomZ

Auto zoom the z scale.

Definition at line 50 of file PlotOptions.h.

Referenced by AutoScale(), Reset(), and Set().

bool om::PlotOptions::fDCMutc

Draw lines for DCM vs. hour plots.

Definition at line 57 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotViewer::Update().

std::string om::PlotOptions::fDrawOpt

Histogram drawing options accumulate here

Definition at line 82 of file PlotOptions.h.

Referenced by Reset(), Set(), om::PlotViewer::Update(), and om::PlotViewer::UpdateCompare().

bool om::PlotOptions::fFEButc

Draw lines for FEB vs. hour plots.

Definition at line 56 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotViewer::Update().

bool om::PlotOptions::fGridx

Grid x.

Definition at line 67 of file PlotOptions.h.

Referenced by Reset(), Set(), and SetPad().

bool om::PlotOptions::fGridy

Grid y.

Definition at line 68 of file PlotOptions.h.

Referenced by Reset(), Set(), and SetPad().

bool om::PlotOptions::fHaveXscale

User specified x-scale?

Definition at line 69 of file PlotOptions.h.

Referenced by AutoScale(), ParseXscale(), and Reset().

bool om::PlotOptions::fHaveYscale

User specified y-scale?

Definition at line 72 of file PlotOptions.h.

Referenced by AutoScale(), ParseYscale(), and Reset().

bool om::PlotOptions::fHaveZscale

User specified z-scale?

Definition at line 75 of file PlotOptions.h.

Referenced by AutoScale(), ParseZscale(), and Reset().

bool om::PlotOptions::fHwLblDCM

Apply hardware label to DCM plot.

Definition at line 53 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotClickHandler::SingleClick().

bool om::PlotOptions::fHwLblDet

Apply hardware label to detector-wide plot.

Definition at line 51 of file PlotOptions.h.

Referenced by om::PlotClickHandler::DoubleClick(), MakeLabels(), Reset(), Set(), and om::PlotClickHandler::SingleClick().

bool om::PlotOptions::fHwLblDetNoFEB

As above, suppres FEB boundaries.

Definition at line 52 of file PlotOptions.h.

Referenced by MakeLabels(), and Reset().

bool om::PlotOptions::fHwLblPCX

Apply hardware labels to plane/cell plot (X-view)

Definition at line 54 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotClickHandler::SingleClick().

bool om::PlotOptions::fHwLblPCY

Apply hardware labels to plane/cell plot (Y-view)

Definition at line 55 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotClickHandler::SingleClick().

TPaveText* om::PlotOptions::fLabelText

Some label objects

Definition at line 86 of file PlotOptions.h.

Referenced by MakeLabels(), MakeLabelText(), PlotOptions(), and ~PlotOptions().

TLine* om::PlotOptions::fLineTmax

Definition at line 89 of file PlotOptions.h.

Referenced by MakeLabels(), and MakeSpillTimeLabel().

TLine* om::PlotOptions::fLineTmin

Definition at line 88 of file PlotOptions.h.

Referenced by MakeLabels(), and MakeSpillTimeLabel().

bool om::PlotOptions::fLogx

Log X axis.

Pad plotting options

Definition at line 64 of file PlotOptions.h.

Referenced by AutoScale(), Reset(), Set(), and SetPad().

bool om::PlotOptions::fLogy
bool om::PlotOptions::fLogz
TPaveText* om::PlotOptions::fSLText

Definition at line 87 of file PlotOptions.h.

Referenced by MakeLabels(), MakeSpecialLabel(), PlotOptions(), and ~PlotOptions().

bool om::PlotOptions::fSpecial

Draw a special case histo label.

Definition at line 59 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), Set(), and om::PlotViewer::Update().

bool om::PlotOptions::fSpillTlbl

Draw lines and label around spill time

Definition at line 60 of file PlotOptions.h.

Referenced by MakeLabels(), Reset(), and Set().

UTCLabel om::PlotOptions::fUTCLabel

Label Maker for UTC plots

Definition at line 93 of file PlotOptions.h.

Referenced by MakeLabels().

double om::PlotOptions::fXhi

High end of user-specified x-scale.

Definition at line 71 of file PlotOptions.h.

Referenced by AutoScale(), ParseXscale(), and Reset().

double om::PlotOptions::fXlo

Low end of user-specified x-scale.

Definition at line 70 of file PlotOptions.h.

Referenced by AutoScale(), ParseXscale(), and Reset().

double om::PlotOptions::fYhi

High end of user-specified y-scale.

Definition at line 74 of file PlotOptions.h.

Referenced by AutoScale(), ParseYscale(), and Reset().

double om::PlotOptions::fYlo

Low end of user-specified y-scale.

Definition at line 73 of file PlotOptions.h.

Referenced by AutoScale(), ParseYscale(), and Reset().

double om::PlotOptions::fZhi

High end of user-specified z-scale.

Definition at line 77 of file PlotOptions.h.

Referenced by AutoScale(), ParseZscale(), and Reset().

double om::PlotOptions::fZlo

Low end of user-specified z-scale.

Definition at line 76 of file PlotOptions.h.

Referenced by AutoScale(), ParseZscale(), and Reset().

bool om::PlotOptions::fZoomHour

A special zoom option for plots vs. UTC hour.

The list of custom plotting options

Definition at line 47 of file PlotOptions.h.

Referenced by AutoScale(), Reset(), and Set().


The documentation for this class was generated from the following files: