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

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

Public Member Functions

 HwDCMLabel ()
 
 ~HwDCMLabel ()
 
void Draw ()
 
void Config (const TH1 *h)
 

Private Member Functions

void Clear ()
 
void MakeHorizontalLines ()
 
void MakeVerticalLines ()
 
void MakeFEBLabels ()
 
void MakePixelKey ()
 

Private Attributes

std::list< TText * > fText
 
std::list< TLine * > fLine
 

Detailed Description

Draw a nicely formatted overlay on DCM plots

Definition at line 12 of file HwDCMLabel.h.

Constructor & Destructor Documentation

HwDCMLabel::HwDCMLabel ( )

Definition at line 14 of file HwDCMLabel.cxx.

14 { }
HwDCMLabel::~HwDCMLabel ( )

Definition at line 44 of file HwDCMLabel.cxx.

References Clear().

44 { this->Clear(); }

Member Function Documentation

void HwDCMLabel::Clear ( )
private

Definition at line 29 of file HwDCMLabel.cxx.

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

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

30 {
31  std::list<TText*>::const_iterator text (fText.begin());
32  std::list<TText*>::const_iterator textEnd(fText.end());
33  for (;text!=textEnd; ++text) delete *text;
34  fText.clear();
35 
36  std::list<TLine*>::const_iterator line (fLine.begin());
37  std::list<TLine*>::const_iterator lineEnd(fLine.end());
38  for (;line!=lineEnd; ++line) delete *line;
39  fLine.clear();
40 }
std::list< TLine * > fLine
Definition: HwDCMLabel.h:29
std::list< TText * > fText
Definition: HwDCMLabel.h:28
void HwDCMLabel::Config ( const TH1 *  h)

Definition at line 18 of file HwDCMLabel.cxx.

References Clear(), MakeFEBLabels(), MakeHorizontalLines(), MakePixelKey(), and MakeVerticalLines().

Referenced by om::PlotOptions::MakeLabels().

19 {
20  this->Clear();
21  this->MakeFEBLabels();
22  this->MakeVerticalLines();
23  this->MakeHorizontalLines();
24  this->MakePixelKey();
25 }
void MakePixelKey()
Definition: HwDCMLabel.cxx:131
void MakeFEBLabels()
Definition: HwDCMLabel.cxx:61
void MakeVerticalLines()
Definition: HwDCMLabel.cxx:90
void MakeHorizontalLines()
Definition: HwDCMLabel.cxx:111
void HwDCMLabel::Draw ( )

Definition at line 48 of file HwDCMLabel.cxx.

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

Referenced by om::PlotOptions::MakeLabels().

49 {
50  std::list<TText*>::const_iterator text (fText.begin());
51  std::list<TText*>::const_iterator textEnd(fText.end());
52  for (;text!=textEnd; ++text) (*text)->Draw();
53 
54  std::list<TLine*>::const_iterator line (fLine.begin());
55  std::list<TLine*>::const_iterator lineEnd(fLine.end());
56  for (;line!=lineEnd; ++line) (*line)->Draw();
57 }
std::list< TLine * > fLine
Definition: HwDCMLabel.h:29
std::list< TText * > fText
Definition: HwDCMLabel.h:28
void HwDCMLabel::MakeFEBLabels ( )
private

Definition at line 61 of file HwDCMLabel.cxx.

References check_time_usage::float, fText, gsNfebx, gsNfeby, gsNpixelx, gsNpixely, MECModelEnuComparisons::i, confusionMatrixTree::t, submit_syst::x, and submit_syst::y.

Referenced by Config().

62 {
63  unsigned int i;
64  static const char* feblabel[gsNfeby] = {
65  "FEB 48 - 63",
66  "FEB 32 - 47",
67  "FEB 16 - 31",
68  "FEB 00 - 15"
69  };
70 
71  TText* t;
72  float x, y;
73  for (i=0; i<gsNfeby; ++i) {
74 
75  x = -0.01*gsNfebx*gsNpixelx;
76  y = ((float)i+0.95)*gsNpixely;
77 
78  t = new TText(x, y, feblabel[i]);
79 
80  t->SetTextSize(0.022);
81  t->SetTextAlign(32);
82  t->SetBit(kCannotPick);
83 
84  fText.push_back(t);
85  }
86 }
static const unsigned int gsNfeby
Definition: HwDCMLabel.cxx:10
static const unsigned int gsNpixelx
Definition: HwDCMLabel.cxx:11
static const unsigned int gsNpixely
Definition: HwDCMLabel.cxx:12
static const unsigned int gsNfebx
Definition: HwDCMLabel.cxx:9
std::list< TText * > fText
Definition: HwDCMLabel.h:28
void HwDCMLabel::MakeHorizontalLines ( )
private

Definition at line 111 of file HwDCMLabel.cxx.

References fLine, gsNfebx, gsNfeby, gsNpixelx, gsNpixely, MECModelEnuComparisons::i, and submit_hadd::l.

Referenced by Config().

112 {
113  unsigned int i;
114 
115  TLine* l;
116  for (i=0; i<=gsNfeby*gsNpixely; ++i) {
117  l = new TLine(0, i,
118  gsNfebx*gsNpixelx, i);
119  l->SetLineColor(kBlack);
120  if (i%8==0) l->SetLineWidth(3);
121  else l->SetLineWidth(1);
122 
123  l->SetBit(kCannotPick);
124 
125  fLine.push_back(l);
126  }
127 }
static const unsigned int gsNfeby
Definition: HwDCMLabel.cxx:10
std::list< TLine * > fLine
Definition: HwDCMLabel.h:29
static const unsigned int gsNpixelx
Definition: HwDCMLabel.cxx:11
static const unsigned int gsNpixely
Definition: HwDCMLabel.cxx:12
static const unsigned int gsNfebx
Definition: HwDCMLabel.cxx:9
void HwDCMLabel::MakePixelKey ( )
private

Definition at line 131 of file HwDCMLabel.cxx.

References fLine, fText, gsNfebx, gsNfeby, gsNpixelx, gsNpixely, MECModelEnuComparisons::i, submit_hadd::l, and confusionMatrixTree::t.

Referenced by Config().

132 {
133  unsigned int i;
134  TLine* l;
135  TText* t;
136 
137  float sf = 1.15;
138  float x0, y0; // Center of key
139  float xll, yll; // Lower left corner
140  float xur, yur; // Uppwer right corner
141 
142  x0 = -0.06*gsNfebx*gsNpixelx;
143  y0 = 0.04*gsNfeby*gsNpixely;
144 
145  xll = x0-sf*(gsNpixelx/2);
146  yll = y0-sf*(gsNpixely/2);
147 
148  xur = x0+sf*(gsNpixelx/2);
149  yur = y0+sf*(gsNpixely/2);
150 
151  for (i=0; i<=gsNpixelx; ++i) {
152  l = new TLine(xll+i*sf, yll, xll+i*sf, yur);
153  l->SetLineColor(kBlack);
154  if (i%4==0) l->SetLineWidth(2);
155  else l->SetLineWidth(1);
156  l->SetBit(kCannotPick);
157  fLine.push_back(l);
158  }
159 
160  for (i=0; i<=gsNpixely; ++i) {
161  l = new TLine(xll, yll+i*sf, xur, yll+i*sf);
162  l->SetLineColor(kBlack);
163  if (i%8==0) l->SetLineWidth(2);
164  else l->SetLineWidth(1);
165  l->SetBit(kCannotPick);
166  fLine.push_back(l);
167  }
168 
169  t = new TText(xll-1.1*sf,y0,"APD pixels");
170  t->SetTextSize(0.02);
171  t->SetTextAngle(90);
172  t->SetTextAlign(22);
173  t->SetBit(kCannotPick);
174  fText.push_back(t);
175 
176  static const char* pixel[32] = {
177  "30","31","28","29","26","27","24","25",
178  "22","23","20","21","18","19","17","16",
179  "09","08","11","10","13","12","14","15",
180  "01","00","03","02","05","04","07","06"
181  };
182  for (i=0; i<32; ++i) {
183  unsigned int ii;
184  unsigned int jj;
185  ii = i/8;
186  jj = i%8;
187  t = new TText(xll + sf*(ii+0.5),
188  yll + sf*(jj+0.5),
189  pixel[i]);
190  t->SetTextColor(kGray+2);
191  t->SetTextAlign(22);
192  t->SetTextSize(0.014);
193  t->SetBit(kCannotPick);
194  fText.push_back(t);
195  }
196 }
static const unsigned int gsNfeby
Definition: HwDCMLabel.cxx:10
std::list< TLine * > fLine
Definition: HwDCMLabel.h:29
static const unsigned int gsNpixelx
Definition: HwDCMLabel.cxx:11
static const unsigned int gsNpixely
Definition: HwDCMLabel.cxx:12
static const unsigned int gsNfebx
Definition: HwDCMLabel.cxx:9
std::list< TText * > fText
Definition: HwDCMLabel.h:28
void HwDCMLabel::MakeVerticalLines ( )
private

Definition at line 90 of file HwDCMLabel.cxx.

References fLine, gsNfebx, gsNfeby, gsNpixelx, gsNpixely, MECModelEnuComparisons::i, and submit_hadd::l.

Referenced by Config().

91 {
92  unsigned int i;
93 
94  TLine* l;
95  for (i=0; i<=gsNfebx*gsNpixelx; ++i) {
96  l = new TLine(i, 0,
97  i, gsNfeby*gsNpixely);
98 
99  l->SetLineColor(kBlack);
100  if (i%4==0) l->SetLineWidth(3);
101  else l->SetLineWidth(1);
102 
103  l->SetBit(kCannotPick);
104 
105  fLine.push_back(l);
106  }
107 }
static const unsigned int gsNfeby
Definition: HwDCMLabel.cxx:10
std::list< TLine * > fLine
Definition: HwDCMLabel.h:29
static const unsigned int gsNpixelx
Definition: HwDCMLabel.cxx:11
static const unsigned int gsNpixely
Definition: HwDCMLabel.cxx:12
static const unsigned int gsNfebx
Definition: HwDCMLabel.cxx:9

Member Data Documentation

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

Definition at line 29 of file HwDCMLabel.h.

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

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

Definition at line 28 of file HwDCMLabel.h.

Referenced by Clear(), Draw(), MakeFEBLabels(), and MakePixelKey().


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