UTCLabel.cxx
Go to the documentation of this file.
1 #include "DAQChannelMap/HardwareDisplay.h"
4 #include <cstdio>
5 #include <iostream>
6 #include "TText.h"
7 #include "TLine.h"
8 using namespace om;
9 
11  fHwMap(new daqchannelmap::HardwareDisplay)
12 { }
13 
14 //......................................................................
15 
17 {
18  std::list<TText*>::const_iterator text (fText.begin());
19  std::list<TText*>::const_iterator textEnd(fText.end());
20  for (;text!=textEnd; ++text) delete *text;
21  fText.clear();
22 
23  std::list<TLine*>::const_iterator line (fLine.begin());
24  std::list<TLine*>::const_iterator lineEnd(fLine.end());
25  for (;line!=lineEnd; ++line) delete *line;
26  fLine.clear();
27 }
28 
29 //......................................................................
30 
32  this->Clear();
33  if(fHwMap) {delete fHwMap; fHwMap = 0;}
34 }
35 
36 //......................................................................
37 
39 {
40  std::list<TText*>::const_iterator text (fText.begin());
41  std::list<TText*>::const_iterator textEnd(fText.end());
42  for (;text!=textEnd; ++text) (*text)->Draw();
43 
44  std::list<TLine*>::const_iterator line (fLine.begin());
45  std::list<TLine*>::const_iterator lineEnd(fLine.end());
46  for (;line!=lineEnd; ++line) (*line)->Draw();
47 }
48 
49 //......................................................................
50 
52 {
53  this->Clear();
54 
55  fHwMap->SetupDet(GUIModel::Instance().Data().fDetector);
56 
57  unsigned int i;
58 
59  unsigned int Ndcm = fHwMap->fNdcmTop+fHwMap->fNdcmSide;
60 
61  TLine* l;
62  for (i=0; i<=Ndcm; ++i) {
63  l = new TLine(0, i*64, 24.0, i*64);
64  l->SetLineColor(kBlack);
65  l->SetLineWidth(1);
66 
67  l->SetBit(kCannotPick);
68 
69  fLine.push_back(l);
70  }
71 
72  TText* t;
73  char buff[16];
74 
75  for (i=0; i<Ndcm; ++i) {
76  sprintf(buff,"DCM%.2d",i+1);
77  t = new TText(-0.04*24,64*(i+0.5),buff);
78  t->SetTextAlign(22);
79  t->SetTextSize(0.03);
80  t->SetBit(kCannotPick);
81  fText.push_back(t);
82  }
83 }
84 
85 //......................................................................
86 
88 {
89  this->Clear();
90 
91  fHwMap->SetupDet(GUIModel::Instance().Data().fDetector);
92 
93  unsigned int i;
94 
95  unsigned int Ndb = fHwMap->fNdiblocks;
96  unsigned int NdcmPERdb = fHwMap->fNdcmTop+fHwMap->fNdcmSide;
97 
98  TLine* l;
99  for (i=0; i<=Ndb; ++i) {
100  l = new TLine(0, i*NdcmPERdb+1, 24.0, i*NdcmPERdb+1);
101  l->SetLineColor(kBlack);
102  l->SetLineWidth(1);
103 
104  l->SetBit(kCannotPick);
105 
106  fLine.push_back(l);
107  }
108 
109  TText* t;
110  char buff[16];
111 
112  for (i=0; i<Ndb; ++i) {
113  sprintf(buff,"DB%.2d",i+1);
114  t = new TText(-0.03*24,NdcmPERdb*(i+0.5),buff);
115  t->SetTextAlign(32);
116  t->SetTextSize(0.03);
117  t->SetBit(kCannotPick);
118  fText.push_back(t);
119  }
120 }
121 
122 ////////////////////////////////////////////////////////////////////////
std::list< TLine * > fLine
Definition: UTCLabel.h:26
unsigned int fNdcmSide
Number of DMC&#39;s per diblock on side of detector.
void Clear()
Definition: UTCLabel.cxx:16
void FEBLabels()
Definition: UTCLabel.cxx:51
daqchannelmap::HardwareDisplay * fHwMap
Definition: UTCLabel.h:28
unsigned int fNdiblocks
Number of diblocks in detector.
static GUIModel & Instance()
Definition: GUIModel.cxx:11
unsigned int fNdcmTop
Number of DMC&#39;s per diblock on top of detector.
void Draw()
Definition: UTCLabel.cxx:38
void DCMLabels()
Definition: UTCLabel.cxx:87
std::list< TText * > fText
Definition: UTCLabel.h:25
Online Monitoring package header.