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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/OnlineMonitoring/viewer/HwDetLabel.h"

Public Member Functions

 HwDetLabel (bool show_feb_boundaries=true)
 
 ~HwDetLabel ()
 
void Config (const TH1 *h)
 
void Draw ()
 

Private Member Functions

void Clear ()
 
void MakeHorizontalLines ()
 
void MakeVerticalLines ()
 
void MakeDBLabels ()
 
void MakeDCMLabels ()
 

Private Attributes

bool fShowFEBBoundaries
 Should we mark off the FEB boundaries? More...
 
int fNdiblock
 
int fNdcm
 
std::list< TLine * > fLine
 Collection of line lables. More...
 
std::list< TText * > fText
 Collection of text labels. More...
 

Detailed Description

Draw labels on hardware detector view histograms

Definition at line 12 of file HwDetLabel.h.

Constructor & Destructor Documentation

HwDetLabel::HwDetLabel ( bool  show_feb_boundaries = true)

Definition at line 13 of file HwDetLabel.cxx.

13  :
14  fShowFEBBoundaries(show_feb_boundaries),
15  fNdiblock(0),
16  fNdcm(0)
17 { }
bool fShowFEBBoundaries
Should we mark off the FEB boundaries?
Definition: HwDetLabel.h:25
HwDetLabel::~HwDetLabel ( )

Definition at line 54 of file HwDetLabel.cxx.

References Clear().

55 {
56  this->Clear();
57 }

Member Function Documentation

void HwDetLabel::Clear ( )
private

Definition at line 39 of file HwDetLabel.cxx.

References fLine, fText, make_syst_table_plots::line, and MakeMiniprodValidationCuts::text.

Referenced by Config(), and ~HwDetLabel().

40 {
41  std::list<TLine*>::const_iterator line(fLine.begin());
42  std::list<TLine*>::const_iterator lineend(fLine.end());
43  for (; line!=lineend; ++line) delete *line;
44  fLine.clear();
45 
46  std::list<TText*>::const_iterator text(fText.begin());
47  std::list<TText*>::const_iterator textend(fText.end());
48  for (; text!=textend; ++text) delete *text;
49  fText.clear();
50 }
std::list< TLine * > fLine
Collection of line lables.
Definition: HwDetLabel.h:28
std::list< TText * > fText
Collection of text labels.
Definition: HwDetLabel.h:29
void HwDetLabel::Config ( const TH1 *  h)

Definition at line 21 of file HwDetLabel.cxx.

References Clear(), fNdcm, fNdiblock, gsNfebX, gsNfebY, gsNpixelX, gsNpixelY, MakeDBLabels(), MakeDCMLabels(), MakeHorizontalLines(), and MakeVerticalLines().

Referenced by makeHWwatchlist(), om::PlotOptions::MakeLabels(), OnMonPlotMaker(), and PlotOnMon().

22 {
23  int ndb = h->GetXaxis()->GetXmax()/gsNpixelX/gsNfebX;
24  int ndcm = h->GetYaxis()->GetXmax()/gsNpixelY/gsNfebY;
25 
26  if ( (ndb != fNdiblock) || (ndcm != fNdcm) ) {
27  fNdiblock = ndb;
28  fNdcm = ndcm;
29  this->Clear();
30  this->MakeVerticalLines();
31  this->MakeHorizontalLines();
32  this->MakeDBLabels();
33  this->MakeDCMLabels();
34  }
35 }
static const int gsNfebY
Definition: HwDetLabel.cxx:9
void MakeHorizontalLines()
Definition: HwDetLabel.cxx:74
void MakeDBLabels()
Definition: HwDetLabel.cxx:127
static const int gsNpixelY
Definition: HwDetLabel.cxx:11
void MakeVerticalLines()
Definition: HwDetLabel.cxx:101
static const int gsNfebX
Definition: HwDetLabel.cxx:8
void MakeDCMLabels()
Definition: HwDetLabel.cxx:146
static const int gsNpixelX
Definition: HwDetLabel.cxx:10
void HwDetLabel::Draw ( )

Definition at line 61 of file HwDetLabel.cxx.

References fLine, fText, make_syst_table_plots::line, and MakeMiniprodValidationCuts::text.

Referenced by makeHWwatchlist(), om::PlotOptions::MakeLabels(), OnMonPlotMaker(), and PlotOnMon().

62 {
63  std::list<TLine*>::const_iterator line(fLine.begin());
64  std::list<TLine*>::const_iterator lineend(fLine.end());
65  for (; line!=lineend; ++line) (*line)->Draw();
66 
67  std::list<TText*>::const_iterator text(fText.begin());
68  std::list<TText*>::const_iterator textend(fText.end());
69  for (; text!=textend; ++text) (*text)->Draw();
70 }
std::list< TLine * > fLine
Collection of line lables.
Definition: HwDetLabel.h:28
std::list< TText * > fText
Collection of text labels.
Definition: HwDetLabel.h:29
void HwDetLabel::MakeDBLabels ( )
private

Definition at line 127 of file HwDetLabel.cxx.

References fNdcm, fNdiblock, fText, gsNfebX, gsNfebY, gsNpixelX, gsNpixelY, MECModelEnuComparisons::i, and confusionMatrixTree::t.

Referenced by Config().

128 {
129  int i;
130  TText* t;
131  char buff[16];
132  for (i=0; i<fNdiblock; ++i) {
133  sprintf(buff,"DB%.2d",fNdiblock-i);
134  t = new TText((i+0.5)*gsNpixelX*gsNfebX,
135  1.02*gsNpixelY*gsNfebY*fNdcm,
136  buff);
137  t->SetTextAlign(22);
138  t->SetTextSize(0.03);
139  t->SetBit(kCannotPick);
140  fText.push_back(t);
141  }
142 }
static const int gsNfebY
Definition: HwDetLabel.cxx:9
std::list< TText * > fText
Collection of text labels.
Definition: HwDetLabel.h:29
static const int gsNpixelY
Definition: HwDetLabel.cxx:11
static const int gsNfebX
Definition: HwDetLabel.cxx:8
static const int gsNpixelX
Definition: HwDetLabel.cxx:10
void HwDetLabel::MakeDCMLabels ( )
private

Definition at line 146 of file HwDetLabel.cxx.

References fNdcm, fNdiblock, fText, gsNfebX, gsNfebY, gsNpixelX, gsNpixelY, MECModelEnuComparisons::i, and confusionMatrixTree::t.

Referenced by Config().

147 {
148  int i;
149  TText* t;
150  char buff[16];
151  for (i=0; i<fNdcm; ++i) {
152  sprintf(buff,"DCM%.2d",fNdcm-i);
153  t = new TText(-0.005*gsNpixelX*gsNfebX*fNdiblock,
154  gsNpixelY*gsNfebY*(i+0.5),
155  buff);
156  t->SetTextAlign(32);
157  t->SetTextSize(0.03);
158  // t->SetTextAngle(90);
159  t->SetBit(kCannotPick);
160  fText.push_back(t);
161  }
162 }
static const int gsNfebY
Definition: HwDetLabel.cxx:9
std::list< TText * > fText
Collection of text labels.
Definition: HwDetLabel.h:29
static const int gsNpixelY
Definition: HwDetLabel.cxx:11
static const int gsNfebX
Definition: HwDetLabel.cxx:8
static const int gsNpixelX
Definition: HwDetLabel.cxx:10
void HwDetLabel::MakeHorizontalLines ( )
private

Definition at line 74 of file HwDetLabel.cxx.

References fLine, fNdcm, fNdiblock, fShowFEBBoundaries, gsNfebX, gsNfebY, gsNpixelX, gsNpixelY, MECModelEnuComparisons::i, and submit_hadd::l.

Referenced by Config().

75 {
76  int i;
77  TLine* l;
78  for (i=0; i<=fNdcm*gsNfebY; ++i) {
79  //
80  // If the index is an FEB boundary and we've been asked not to
81  // show the FEB boundaries, skip to the next iteration
82  //
83  if ((i%gsNfebY)!=0 && fShowFEBBoundaries==false) continue;
84 
85  //
86  // Make the line. Make the DCM boundaries thicker
87  //
88  l = new TLine(0, i*gsNpixelY,
89  fNdiblock*gsNpixelX*gsNfebX, i*gsNpixelY);
90  if ((i%gsNfebY)==0) l->SetLineWidth(3);
91  else l->SetLineWidth(1);
92 
93  l->SetLineColor(kBlack);
94  l->SetBit(kCannotPick);
95  fLine.push_back(l);
96  }
97 }
static const int gsNfebY
Definition: HwDetLabel.cxx:9
std::list< TLine * > fLine
Collection of line lables.
Definition: HwDetLabel.h:28
bool fShowFEBBoundaries
Should we mark off the FEB boundaries?
Definition: HwDetLabel.h:25
static const int gsNpixelY
Definition: HwDetLabel.cxx:11
static const int gsNfebX
Definition: HwDetLabel.cxx:8
static const int gsNpixelX
Definition: HwDetLabel.cxx:10
void HwDetLabel::MakeVerticalLines ( )
private

Definition at line 101 of file HwDetLabel.cxx.

References fLine, fNdcm, fNdiblock, fShowFEBBoundaries, gsNfebX, gsNfebY, gsNpixelX, gsNpixelY, MECModelEnuComparisons::i, and submit_hadd::l.

Referenced by Config().

102 {
103  int i;
104  TLine* l;
105  for (i=0; i<=fNdiblock*gsNfebX; ++i) {
106  //
107  // If we are on an FEB boundary and we've been asked not to draw
108  // them, skip to the next iteration
109  //
110  if ((i%gsNfebX)==1 && fShowFEBBoundaries==false) continue;
111 
112  //
113  // Draw the line. Make the DCM boundary thicker.
114  //
115  l = new TLine(i*gsNpixelX, 0,
116  i*gsNpixelX, fNdcm*gsNpixelY*gsNfebY);
117  if ((i%gsNfebX)==0) l->SetLineWidth(3);
118  else l->SetLineWidth(1);
119  l->SetLineColor(kBlack);
120  l->SetBit(kCannotPick);
121  fLine.push_back(l);
122  }
123 }
static const int gsNfebY
Definition: HwDetLabel.cxx:9
std::list< TLine * > fLine
Collection of line lables.
Definition: HwDetLabel.h:28
bool fShowFEBBoundaries
Should we mark off the FEB boundaries?
Definition: HwDetLabel.h:25
static const int gsNpixelY
Definition: HwDetLabel.cxx:11
static const int gsNfebX
Definition: HwDetLabel.cxx:8
static const int gsNpixelX
Definition: HwDetLabel.cxx:10

Member Data Documentation

std::list<TLine*> om::HwDetLabel::fLine
private

Collection of line lables.

Definition at line 28 of file HwDetLabel.h.

Referenced by Clear(), Draw(), MakeHorizontalLines(), and MakeVerticalLines().

int om::HwDetLabel::fNdcm
private
int om::HwDetLabel::fNdiblock
private
bool om::HwDetLabel::fShowFEBBoundaries
private

Should we mark off the FEB boundaries?

Definition at line 25 of file HwDetLabel.h.

Referenced by MakeHorizontalLines(), and MakeVerticalLines().

std::list<TText*> om::HwDetLabel::fText
private

Collection of text labels.

Definition at line 29 of file HwDetLabel.h.

Referenced by Clear(), Draw(), MakeDBLabels(), and MakeDCMLabels().


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