QwAnalysis
QwEventDisplay.cc File Reference
+ Include dependency graph for QwEventDisplay.cc:

Go to the source code of this file.

Functions

 ClassImp (QwEventDisplay) QwEventDisplay
 

Function Documentation

ClassImp ( QwEventDisplay  )

Definition at line 23 of file QwEventDisplay.cc.

References QwEventDisplay::Box_R1XY, QwEventDisplay::Box_R1XZ, QwEventDisplay::Box_R1YZ, QwEventDisplay::Box_R2bXY, QwEventDisplay::Box_R2bXZ1, QwEventDisplay::Box_R2bXZ2, QwEventDisplay::Box_R2bXZ3, QwEventDisplay::Box_R2bXZ4, QwEventDisplay::Box_R2bYZ1, QwEventDisplay::Box_R2bYZ2, QwEventDisplay::Box_R2bYZ3, QwEventDisplay::Box_R2bYZ4, QwEventDisplay::Box_R2XY, QwEventDisplay::Box_R2XZ1, QwEventDisplay::Box_R2XZ2, QwEventDisplay::Box_R2XZ3, QwEventDisplay::Box_R2XZ4, QwEventDisplay::Box_R2YZ1, QwEventDisplay::Box_R2YZ2, QwEventDisplay::Box_R2YZ3, QwEventDisplay::Box_R2YZ4, QwEventDisplay::Box_R3XY1, QwEventDisplay::Box_R3XY2, QwEventDisplay::Box_R3XY3, QwEventDisplay::Box_R3XY4, QwEventDisplay::Box_R3XZ1, QwEventDisplay::Box_R3XZ2, QwEventDisplay::Box_R3XZ3, QwEventDisplay::Box_R3XZ4, QwEventDisplay::Box_R3YZ1, QwEventDisplay::Box_R3YZ2, QwEventDisplay::Box_R3YZ3, QwEventDisplay::Box_R3YZ4, QwEventDisplay::cOctantID, QwEventDisplay::cR1XY, QwEventDisplay::cR1XZ, QwEventDisplay::cR1YZ, QwEventDisplay::cR2bXY, QwEventDisplay::cR2bXZ, QwEventDisplay::cR2bYZ, QwEventDisplay::cR2XY, QwEventDisplay::cR2XZ, QwEventDisplay::cR2YZ, QwEventDisplay::cR3XY, QwEventDisplay::cR3XZ, QwEventDisplay::cR3YZ, QwEventDisplay::Div_R3XY, QwEventDisplay::Div_R3XZ, QwEventDisplay::Div_R3YZ, QwEventDisplay::ExitButton, QwEventDisplay::fCurrentEvent, QwEventDisplay::fCurrentEventEntry, QwEventDisplay::fCurrentEventLabel, QwEventDisplay::fEventBox1, QwEventDisplay::fEventBox2, QwEventDisplay::fEventBox3, QwEventDisplay::fEventBoxes, QwEventDisplay::fEventBuffer, QwEventDisplay::fEventCounter, QwEventDisplay::fHitList, QwEventDisplay::fMain, QwEventDisplay::fMenuBar, QwEventDisplay::fMenuBarHelpLayout, QwEventDisplay::fMenuBarItemLayout, QwEventDisplay::fMenuBarLayout, QwEventDisplay::fMenuFile, QwEventDisplay::fMenuHelp, QwEventDisplay::fOctantID, QwEventDisplay::fRegion1, QwEventDisplay::fRegion1XY, QwEventDisplay::fRegion1XZ, QwEventDisplay::fRegion1YZ, QwEventDisplay::fRegion2, QwEventDisplay::fRegion2b, QwEventDisplay::fRegion2bXY, QwEventDisplay::fRegion2bXZ, QwEventDisplay::fRegion2bYZ, QwEventDisplay::fRegion2XY, QwEventDisplay::fRegion2XZ, QwEventDisplay::fRegion2YZ, QwEventDisplay::fRegion3, QwEventDisplay::fRegion3TS, QwEventDisplay::fRegion3XY, QwEventDisplay::fRegion3XZ, QwEventDisplay::fRegion3YZ, QwEventDisplay::fRegions, QwEventDisplay::fSubsystemArray, QwEventDisplay::fTreeEntries, QwEventDisplay::fWireInfoListBox, getenv_safe_TString(), Qw::kBlue, Qw::kGreen, Qw::kRed, QwEventDisplay::Label_R1XY, QwEventDisplay::Label_R1XZ, QwEventDisplay::Label_R1YZ, QwEventDisplay::Label_R2bXY, QwEventDisplay::Label_R2bXZ, QwEventDisplay::Label_R2bYZ, QwEventDisplay::Label_R2XY, QwEventDisplay::Label_R2XZ, QwEventDisplay::Label_R2YZ, QwEventDisplay::Label_R3XY, QwEventDisplay::Label_R3XZ, QwEventDisplay::Label_R3YZ, QwEventDisplay::M_FILE_CLOSE, QwEventDisplay::M_FILE_OPEN, QwEventDisplay::M_HELP_ABOUT, QwEventDisplay::M_HELP_TUTORIAL, QwEventDisplay::Octant_1, QwEventDisplay::Octant_2, QwEventDisplay::Octant_3, QwEventDisplay::Octant_4, QwEventDisplay::Octant_5, QwEventDisplay::Octant_6, QwEventDisplay::Octant_7, QwEventDisplay::Octant_8, R1_CM, R1_DEPTH, R1_LENGTH, R1_WIDTH, R2_CM, R2_DEPTH, R2_DIST, R2_LENGTH, R2_WIDTH, R3_CM, R3_DEPTH, R3_DIST, R3_LENGTH, R3_WIDTH, QwEventDisplay::tR2bXY1, QwEventDisplay::tR2bXY2, QwEventDisplay::tR2bXY3, QwEventDisplay::tR2bXY4, QwEventDisplay::tR2bXZ1, QwEventDisplay::tR2bXZ2, QwEventDisplay::tR2bXZ3, QwEventDisplay::tR2bXZ4, QwEventDisplay::tR2XY1, QwEventDisplay::tR2XY2, QwEventDisplay::tR2XY3, QwEventDisplay::tR2XY4, QwEventDisplay::tR2XZ1, QwEventDisplay::tR2XZ2, QwEventDisplay::tR2XZ3, QwEventDisplay::tR2XZ4, QwEventDisplay::tR3XY1, QwEventDisplay::tR3XY2, QwEventDisplay::tR3XY3, QwEventDisplay::tR3XY4, QwEventDisplay::tR3XZ1, QwEventDisplay::tR3XZ2, QwEventDisplay::tR3XZ3, QwEventDisplay::tR3XZ4, QwEventDisplay::tR3YZ1, QwEventDisplay::tR3YZ2, QwEventDisplay::tR3YZ3, and QwEventDisplay::tR3YZ4.

34  { // Creates main graphical components
35 
36  // Formatting variables
37  ULong_t ucolor; // Will reflect user color changes
38  TGFont *ufont; // Will reflect user font changes
39  TGGC *uGC; // Will reflect user GC changes
40 
41  // Initialize variables to 0
42  fEventNumber = 0; // Current event number
43  fTreeEntries = 0; // Number of entries in tree
44  fSubsystemArray = 0; // Organizes subsystems
45  fEventBuffer = 0; // Houses event information
46  fHitList = 0; // Houses hit information
47 
48  // Create new pop up window on screen; main frame
49  fMain = new TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame);
50  fMain->SetLayoutBroken(kTRUE);
51  fMain->SetWindowName("Qweak 2D Single Event Display");
52 
53 
54  ////MENU BAR----------------------------------------------------------------------------------------------------////
55 
56  // Create menu bar for file and help functions
57  fMenuBarLayout = new TGLayoutHints(kLHintsTop, kLHintsExpandX); // Layout for the menu bar
58  fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kRaisedFrame); // Layout for popup menus
59  fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight | kRaisedFrame); // Layout for Help popup menu
60 
61  fMenuFile = new TGPopupMenu(gClient->GetRoot()); // Add a popup menu for file options
62  fMenuFile->AddEntry("&Open ROOT File", M_FILE_OPEN); // Add option to open a ROOT file
63  fMenuFile->AddSeparator();
64  fMenuFile->AddEntry("&Close ROOT File", M_FILE_CLOSE); // Add option to close a ROOT file
65 
66  fMenuHelp = new TGPopupMenu(gClient->GetRoot()); // Add a popup menu for help options
67  fMenuHelp->AddEntry("&Tutorial", M_HELP_TUTORIAL); // Add option to connect to the event display tutorial documentation
68  fMenuHelp->AddSeparator();
69  fMenuHelp->AddEntry("&About", M_HELP_ABOUT); // Add option to print information about the event display
70 
71  fMenuFile->Connect("Activated(Int_t)", "QwEventDisplay", this, "HandleMenu(Int_t)"); // Connect popup menus to a menu control function
72  fMenuHelp->Connect("Activated(Int_t)", "QwEventDisplay", this, "HandleMenu(Int_t)");
73 
74  fMenuBar = new TGMenuBar(fMain, kLHintsTop | kLHintsExpandX); // Create a menu bar
75  fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout); // Add a file popup menu
76  fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout); // Add a help popup menu
77  gClient->GetColorByName("#deba87", ucolor); // Set ucolor to mute orange
78  fMenuBar->SetBackgroundColor(ucolor);
79 
80  fMain->AddFrame(fMenuBar, fMenuBarLayout); // Add menu bar to the main frame
81  fMenuBar->MoveResize(0,0,900,20);
82 
83 
84  ////TITLE AND LOGOS----------------------------------------------------------------------------------------------------////
85 
86  // Create horizontal frame for logo and title placement: includes Qweak and GWU logos
87  gClient->GetColorByName("#ffffff",ucolor); // Set ucolor to white
88  TGHorizontalFrame *fLogos = new TGHorizontalFrame(fMain,900,80,kHorizontalFrame | kRaisedFrame,ucolor);
89  fLogos->SetLayoutBroken(kTRUE);
90  // Insert Qweak logo
91  TGIcon *QweakLogo = new TGIcon(fLogos, getenv_safe_TString("QWANALYSIS") + "/Extensions/Logos/qweak.jpg");
92  fLogos->AddFrame(QweakLogo, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
93  QweakLogo->MoveResize(0,1,140,77);
94 
95  // Graphics context changes for "Qweak 2D Single Event Display" title label
96  ufont = gClient->GetFont("-*-helvetica-bold-r-*-*-34-*-*-*-*-*-*-*"); // Set ufont to bold helvetica 25
97  GCValues_t valBox;
98  valBox.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
99  gClient->GetColorByName("#000000",valBox.fForeground);
100  gClient->GetColorByName("#c0c0c0",valBox.fBackground);
101  valBox.fFillStyle = kFillSolid;
102  valBox.fFont = ufont->GetFontHandle();
103  valBox.fGraphicsExposures = kFALSE;
104  uGC = gClient->GetGC(&valBox, kTRUE);
105 
106  // Create title box for event display
107  gClient->GetColorByName("#d45954",ucolor); // Set ucolor to soft red
108  TGLabel *TitleBox = new TGLabel(fLogos,"Qweak 2D Single Event Display",uGC->GetGC(),ufont->GetFontStruct(),kRaisedFrame,ucolor);
109  TitleBox->SetTextJustify(36);
110  TitleBox->SetMargins(0,0,0,0);
111  TitleBox->SetWrapLength(-1);
112  fLogos->AddFrame(TitleBox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
113  TitleBox->MoveResize(143,1,627,77);
114 
115  // Insert GWU logo
116  TGIcon *GWULogo = new TGIcon(fLogos, getenv_safe_TString("QWANALYSIS") + "/Extensions/Logos/gwu_logo_main.gif");
117  fLogos->AddFrame(GWULogo, new TGLayoutHints(kLHintsNormal));
118  GWULogo->MoveResize(772,1,135,77);
119 
120  // Add logos frame to main frame
121  fMain->AddFrame(fLogos, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
122  fLogos->MoveResize(0,20,900,100);
123 
124 
125  ////EVENT BOXES----------------------------------------------------------------------------------------------------////
126 
127  // Create horizontal frame for event boxes including current event number, goto event function, wire hits information, and octant identification
128  gClient->GetColorByName("#0047ab",ucolor); // Set ucolor to blue
129  fEventBoxes = new TGHorizontalFrame(fMain,900,240,kHorizontalFrame,ucolor);
130  fEventBoxes->SetLayoutBroken(kTRUE);
131 
132  //EVENT BOX 1--Current Event Number and Goto Event--------------------------------------------------//
133 
134  // Create vertical frame for event box 1
135  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
136  fEventBox1 = new TGVerticalFrame(fEventBoxes,220,226,kVerticalFrame | kRaisedFrame,ucolor);
137  fEventBox1->SetLayoutBroken(kTRUE);
138 
139  // Graphics context changes for "Event Counter" label
140  gClient->GetColorByName("#deba87", ucolor); // Set ucolor to mute orange
141  ufont = gClient->GetFont("-*-charter-bold-r-*-*-15-*-*-*-*-*-*-*"); // Set ufont to bold charter 15
142  GCValues_t valunterLabel;
143  valunterLabel.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
144  gClient->GetColorByName("#000000",valunterLabel.fForeground);
145  gClient->GetColorByName("#c0c0c0",valunterLabel.fBackground);
146  valunterLabel.fFillStyle = kFillSolid;
147  valunterLabel.fFont = ufont->GetFontHandle();
148  valunterLabel.fGraphicsExposures = kFALSE;
149  uGC = gClient->GetGC(&valunterLabel, kTRUE);
150 
151  // Create label for the event counter
152  TGLabel *EventCounterLabel = new TGLabel(fEventBox1,"Event Counter",uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame,ucolor);
153  EventCounterLabel->SetTextJustify(36);
154  EventCounterLabel->SetMargins(0,0,0,0);
155  EventCounterLabel->SetWrapLength(-1);
156  fEventBox1->AddFrame(EventCounterLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
157  EventCounterLabel->MoveResize(45,6,125,20);
158  EventCounterLabel->SetBackgroundColor(ucolor);
159 
160  // Create vertical frame for event counter information: current event number, goto event number entry, and goto event button
161  gClient->GetColorByName("#507ba7", ucolor); // Set ucolor to navy blue
162  fEventCounter = new TGVerticalFrame(fEventBox1,144,176,kVerticalFrame | kSunkenFrame, ucolor);
163  fEventCounter->SetLayoutBroken(kTRUE);
164 
165  // Graphics context changes for "Current Event" group frame
166  ufont = gClient->GetFont("-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*"); // Set ufont to bold charter 10
167  GCValues_t valentHit;
168  valentHit.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
169  gClient->GetColorByName("#000000",valentHit.fForeground);
170  gClient->GetColorByName("#c0c0c0",valentHit.fBackground);
171  valentHit.fFillStyle = kFillSolid;
172  valentHit.fFont = ufont->GetFontHandle();
173  valentHit.fGraphicsExposures = kFALSE;
174  uGC = gClient->GetGC(&valentHit, kTRUE);
175 
176  // Create "Current Event" group frame
177  fCurrentEvent = new TGGroupFrame(fEventCounter,"Current Event",kVerticalFrame,uGC->GetGC(),ufont->GetFontStruct(),ucolor);
178  fCurrentEvent->SetLayoutBroken(kTRUE);
179 
180  // Graphics context changes for "Current Event" label
181  ufont = gClient->GetFont("-*-charter-bold-r-*-*-33-*-*-*-*-*-*-*"); // Set ufont to bold charter 33
182  GCValues_t valntHitLabel;
183  valntHitLabel.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
184  gClient->GetColorByName("#000000",valntHitLabel.fForeground);
185  gClient->GetColorByName("#c0c0c0",valntHitLabel.fBackground);
186  valntHitLabel.fFillStyle = kFillSolid;
187  valntHitLabel.fFont = ufont->GetFontHandle();
188  valntHitLabel.fGraphicsExposures = kFALSE;
189  uGC = gClient->GetGC(&valntHitLabel, kTRUE);
190  gClient->GetColorByName("#fff897",ucolor); // Set ucolor to mute yellow
191 
192  // Create label for current event: variable changes based on fEventNumber
193  fCurrentEventLabel = new TGLabel(fCurrentEvent, Form("%u", (Int_t) fEventNumber), uGC->GetGC(),ufont->GetFontStruct(),ucolor);
194  fCurrentEventLabel->SetTextJustify(36);
195  fCurrentEventLabel->SetMargins(0,0,0,0);
196  fCurrentEventLabel->SetWrapLength(-1);
197  fCurrentEventLabel->MoveResize(11,18,104,32);
198  fCurrentEventLabel->SetBackgroundColor(ucolor);
199 
200  // Add current event label to "Current Event" group frame
201  fCurrentEvent->AddFrame(fCurrentEventLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
202  fCurrentEvent->SetLayoutManager(new TGVerticalLayout(fCurrentEvent));
203 
204  // Add "Current Event" group frame to event counter frame
205  fEventCounter->AddFrame(fCurrentEvent, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
206  fCurrentEvent->MoveResize(8,8,126,64);
207 
208  // Graphics context changes for "Goto Event" button
209  ufont = gClient->GetFont("-*-helvetica-bold-r-*-*-11-*-*-*-*-*-*-*"); // Set ufont to bold helvetica 11
210  GCValues_t valitButton;
211  valitButton.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
212  gClient->GetColorByName("#000000",valitButton.fForeground);
213  gClient->GetColorByName("#c0c0c0",valitButton.fBackground);
214  valitButton.fFillStyle = kFillSolid;
215  valitButton.fFont = ufont->GetFontHandle();
216  valitButton.fGraphicsExposures = kFALSE;
217  uGC = gClient->GetGC(&valitButton, kTRUE);
218 
219  // Create goto event button
220  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
221  TGTextButton *GotoEventButton = new TGTextButton(fEventCounter,"&Goto Event",-1,uGC->GetGC(),ufont->GetFontStruct());
222  GotoEventButton->Connect("Clicked()", "QwEventDisplay", this, "GotoEvent()");
223  GotoEventButton->SetTextJustify(36);
224  GotoEventButton->SetMargins(0,0,0,0);
225  GotoEventButton->SetWrapLength(-1);
226  GotoEventButton->Resize(67,24);
227  GotoEventButton->ChangeBackground(ucolor);
228 
229  // Add goto event button to event counter frame
230  fEventCounter->AddFrame(GotoEventButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
231  GotoEventButton->MoveResize(64,133,67,24);
232 
233  // Create number entry for goto event function
234  fCurrentEventEntry = new TGNumberEntry(fEventCounter, (Double_t) 0,11,-1,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1);
235  fEventCounter->AddFrame(fCurrentEventEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
236  fCurrentEventEntry->MoveResize(24,94,96,22);
237 
238  // Add event counter frame to event box 1
239  fEventBox1->AddFrame(fEventCounter, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
240  fEventCounter->MoveResize(35,32,144,180);
241 
242  // Add event box 1 to event box frame
243  fEventBoxes->AddFrame(fEventBox1, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
244  fEventBox1->MoveResize(3,6,220,226);
245 
246  //EVENT BOX 2--Wire Hit Information--------------------------------------------------//
247 
248  // Create vertical frame for event box 2
249  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
250  fEventBox2 = new TGVerticalFrame(fEventBoxes,220,226,kVerticalFrame | kRaisedFrame,ucolor);
251  fEventBox2->SetLayoutBroken(kTRUE);
252 
253  // Create list box for wire hit information
254  fWireInfoListBox = new TGListBox(fEventBox2);
255  fWireInfoListBox->Resize(200,180);
256  fEventBox2->AddFrame(fWireInfoListBox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
257  fWireInfoListBox->MoveResize(8,32,428,180);
258  ufont = gClient->GetFont("-*-charter-bold-r-*-*-15-*-*-*-*-*-*-*"); // Set font to bold charter 15
259 
260  // Graphics context changes for "Wire Hit Information" label
261  GCValues_t valitsLabel;
262  valitsLabel.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
263  gClient->GetColorByName("#000000",valitsLabel.fForeground);
264  gClient->GetColorByName("#c0c0c0",valitsLabel.fBackground);
265  valitsLabel.fFillStyle = kFillSolid;
266  valitsLabel.fFont = ufont->GetFontHandle();
267  valitsLabel.fGraphicsExposures = kFALSE;
268  uGC = gClient->GetGC(&valitsLabel, kTRUE);
269  gClient->GetColorByName("#deba87", ucolor); // Set ucolor to mute orange
270 
271  // Create label for event box 2
272  TGLabel *fWireInfoLabel = new TGLabel(fEventBox2,"Wire Hit Information",uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame,ucolor);
273  fWireInfoLabel->SetTextJustify(36);
274  fWireInfoLabel->SetMargins(0,0,0,0);
275  fWireInfoLabel->SetWrapLength(-1);
276  fWireInfoLabel->MoveResize(129,6,196,20);
277  fWireInfoLabel->SetBackgroundColor(ucolor);
278  fEventBox2->AddFrame(fWireInfoLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
279 
280  // Add event box 2 to event box frame
281  fEventBoxes->AddFrame(fEventBox2, new TGLayoutHints(kLHintsNormal));
282  fEventBox2->MoveResize(227,6,444,226);
283 
284  //EVENT BOX 3--Octant Identification--------------------------------------------------//
285 
286  // Create vertical frame for event box 3
287  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
288  fEventBox3 = new TGVerticalFrame(fEventBoxes,220,226,kVerticalFrame | kRaisedFrame,ucolor);
289  fEventBox3->SetLayoutBroken(kTRUE);
290 
291  // Graphics context changes for "Octant Identification" label
292  ufont = gClient->GetFont("-*-charter-bold-r-*-*-15-*-*-*-*-*-*-*"); // Set ufont to bold charter 15
293  GCValues_t valInfoLabel;
294  valInfoLabel.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
295  gClient->GetColorByName("#000000",valInfoLabel.fForeground);
296  gClient->GetColorByName("#c0c0c0",valInfoLabel.fBackground);
297  valInfoLabel.fFillStyle = kFillSolid;
298  valInfoLabel.fFont = ufont->GetFontHandle();
299  valInfoLabel.fGraphicsExposures = kFALSE;
300  uGC = gClient->GetGC(&valInfoLabel, kTRUE);
301  gClient->GetColorByName("#deba87", ucolor); // Set ucolor to mute orange
302 
303  // Create label for event box 3
304  TGLabel *fOctantLabel = new TGLabel(fEventBox3,"Octant Identification",uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame,ucolor);
305  fOctantLabel->SetTextJustify(36);
306  fOctantLabel->SetMargins(0,0,0,0);
307  fOctantLabel->SetWrapLength(-1);
308  fOctantLabel->MoveResize(25,6,175,20);
309  fOctantLabel->SetBackgroundColor(ucolor);
310  fEventBox3->AddFrame(fOctantLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
311 
312  // Create canvas for octant identification
313  fOctantID = new TRootEmbeddedCanvas(0, fEventBox3, 200, 180);
314  Int_t wOctantID = fOctantID->GetCanvasWindowId();
315  cOctantID = new TCanvas("cOctantID", 10, 10, wOctantID);
316  fOctantID->AdoptCanvas(cOctantID);
317  fEventBox3->AddFrame(fOctantID, new TGLayoutHints(kVerticalFrame | kSunkenFrame));
318  fOctantID->MoveResize(22,32,180,180);
319  fOctantID->GetCanvas()->SetFillColor(kAzure-7);
320  Octant_1 = new TPaveLabel(.4,.75,.6,.95, "3"); // Create labels for each octant
321  Octant_1->SetLineColor(1);
322  Octant_1->SetFillColor(0);
323  Octant_1->Draw();
324  Octant_2 = new TPaveLabel(.675,.675,.875,.875, "4");
325  Octant_2->SetLineColor(1);
326  Octant_2->SetFillColor(0);
327  Octant_2->Draw();
328  Octant_3 = new TPaveLabel(.75,.4,.95,.6, "5");
329  Octant_3->SetLineColor(1);
330  Octant_3->SetFillColor(0);
331  Octant_3->Draw();
332  Octant_4 = new TPaveLabel(.675,.125,.875,.325, "6");
333  Octant_4->SetLineColor(1);
334  Octant_4->SetFillColor(0);
335  Octant_4->Draw();
336  Octant_5 = new TPaveLabel(.4,.05,.6,.25, "7");
337  Octant_5->SetLineColor(1);
338  Octant_5->SetFillColor(0);
339  Octant_5->Draw();
340  Octant_6 = new TPaveLabel(.125,.125,.325,.325, "8");
341  Octant_6->SetLineColor(1);
342  Octant_6->SetFillColor(0);
343  Octant_6->Draw();
344  Octant_7 = new TPaveLabel(.05,.4,.25,.6, "1");
345  Octant_7->SetLineColor(1);
346  Octant_7->SetFillColor(0);
347  Octant_7->Draw();
348  Octant_8 = new TPaveLabel(.125,.675,.325,.875, "2");
349  Octant_8->SetLineColor(1);
350  Octant_8->SetFillColor(0);
351  Octant_8->Draw();
352  fOctantID->GetCanvas()->SetEditable(kFALSE);
353 
354  // Add event box 3 to event box frame
355  fEventBoxes->AddFrame(fEventBox3, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
356  fEventBox3->MoveResize(675,6,222,226);
357 
358  // Add event box frame to main frame
359  fMain->AddFrame(fEventBoxes, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
360  fEventBoxes->MoveResize(0,100,900,260);
361 
362 
363  ////REGION BOXES----------------------------------------------------------------------------------------------------////
364 
365  // Graphics context changes for region tabs
366  ufont = gClient->GetFont("-*-charter-bold-r-*-*-15-*-*-*-*-*-*-*"); // Set ufont to bold charter 10
367  GCValues_t valTabs;
368  valTabs.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
369  gClient->GetColorByName("#000000",valTabs.fForeground);
370  gClient->GetColorByName("#c0c0c0",valTabs.fBackground);
371  valTabs.fFillStyle = kFillSolid;
372  valTabs.fFont = ufont->GetFontHandle();
373  valTabs.fGraphicsExposures = kFALSE;
374  uGC = gClient->GetGC(&valTabs, kTRUE);
375  gClient->GetColorByName("#0047ab",ucolor); // Set ucolor to blue
376 
377  // Create region boxes tab frame
378  fRegions = new TGTab(fMain,900,312,uGC->GetGC(),ufont->GetFontStruct(),kChildFrame,ucolor);
379  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
380 
381  //REGION 1--Gas Electron Multiplier--------------------------------------------------//
382 
383  // Create tab and container of "Region 1" data
384  fRegion1 = fRegions->AddTab("Region 1--GEM");
385  fRegion1->SetLayoutManager(new TGMatrixLayout(fRegion1,0,1,0,0));
386  fRegion1->SetLayoutBroken(kTRUE);
387  fRegion1->SetBackgroundColor(ucolor);
388 
389  // Create embedded canvas for Region 1 XY view
390  fRegion1XY = new TRootEmbeddedCanvas(0,fRegion1,280,280);
391  Int_t wRegion1XY = fRegion1XY->GetCanvasWindowId();
392  cR1XY = new TCanvas("cR1XY", 10, 10, wRegion1XY);
393  fRegion1XY->AdoptCanvas(cR1XY);
394  fRegion1->AddFrame(fRegion1XY, new TGLayoutHints(kLHintsNormal));
395  fRegion1XY->MoveResize(12,4,280,280);
396  fRegion1XY->GetCanvas()->SetFillColor(0);
397  Label_R1XY = new TPaveLabel(.03,.94,.97,.99,"Front View (X-Y Projection)"); // Create canvas label
398  Label_R1XY->Draw();
399  Box_R1XY = new TBox(.5-(R1_WIDTH*R1_CM*.5), .5-(R1_LENGTH*R1_CM*.5), .5+(R1_WIDTH*R1_CM*.5), .5+(R1_LENGTH*R1_CM*.5)); // Create and center box to frame wire lines
400  Box_R1XY->SetLineColor(1);
401  Box_R1XY->SetFillStyle(0);
402  Box_R1XY->Draw();
403  fRegion1XY->GetCanvas()->SetEditable(kFALSE);
404 
405  // Create embedded canvas for Region 1 YZ view
406  fRegion1YZ = new TRootEmbeddedCanvas(0,fRegion1,280,280);
407  Int_t wRegion1YZ = fRegion1YZ->GetCanvasWindowId();
408  cR1YZ = new TCanvas("cR1YZ", 10, 10, wRegion1YZ);
409  fRegion1YZ->AdoptCanvas(cR1YZ);
410  fRegion1->AddFrame(fRegion1YZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
411  fRegion1YZ->MoveResize(306,4,280,280);
412  fRegion1YZ->GetCanvas()->SetFillColor(0);
413  Label_R1YZ = new TPaveLabel(.03,.94,.97,.99,"Top View (Y-Z Projection)"); // Create canvas label
414  Label_R1YZ->Draw();
415  Box_R1YZ = new TBox(.5-(R1_WIDTH*R1_CM*.5), .5-(R1_DEPTH*R1_CM*.5), .5+(R1_WIDTH*R1_CM*.5), .5+(R1_DEPTH*R1_CM*.5)); // Create and center box to frame wire lines
416  Box_R1YZ->SetLineColor(1);
417  Box_R1YZ->SetFillStyle(0);
418  Box_R1YZ->Draw();
419  fRegion1YZ->GetCanvas()->SetEditable(kFALSE);
420 
421  // Create embedded canvas for Region 1 XZ view
422  fRegion1XZ = new TRootEmbeddedCanvas(0,fRegion1,280,280);
423  Int_t wRegion1XZ = fRegion1XZ->GetCanvasWindowId();
424  cR1XZ = new TCanvas("cR1XZ", 10, 10, wRegion1XZ);
425  fRegion1XZ->AdoptCanvas(cR1XZ);
426  fRegion1->AddFrame(fRegion1XZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
427  fRegion1XZ->MoveResize(603,4,280,280);
428  fRegion1XZ->GetCanvas()->SetFillColor(0);
429  Label_R1XZ = new TPaveLabel(.03,.94,.97,.99,"Side View (X-Z Projection)"); // Create canvas label
430  Label_R1XZ->Draw();
431  Box_R1XZ = new TBox(.5-(R1_DEPTH*R1_CM*.5), .5-(R1_LENGTH*R1_CM*.5), .5+(R1_DEPTH*R1_CM*.5), .5+(R1_LENGTH*R1_CM*.5)); // Create and center box to frame wire lines
432  Box_R1XZ->SetLineColor(1);
433  Box_R1XZ->SetFillStyle(0);
434  Box_R1XZ->Draw();
435  fRegion1XZ->GetCanvas()->SetEditable(kFALSE);
436 
437  //REGION 2--Horizontal Drift Chamber--------------------------------------------------//
438 
439  // Create tab and container of "Region 2" data in chambers 1 through 4
440  fRegion2 = fRegions->AddTab("Region 2--HDC (1-4)");
441  fRegion2->SetLayoutManager(new TGVerticalLayout(fRegion2));
442  fRegion2->SetLayoutBroken(kTRUE);
443  fRegion2->SetBackgroundColor(ucolor);
444 
445  // Create embedded canvas for Region 2 XY view
446  fRegion2XY = new TRootEmbeddedCanvas(0,fRegion2,280,280);
447  Int_t wRegion2XY = fRegion2XY->GetCanvasWindowId();
448  cR2XY = new TCanvas("cR2XY", 10, 10, wRegion2XY);
449  fRegion2XY->AdoptCanvas(cR2XY);
450  fRegion2->AddFrame(fRegion2XY, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
451  fRegion2XY->MoveResize(12,4,280,280);
452  fRegion2XY->GetCanvas()->SetFillColor(0);
453  Label_R2XY = new TPaveLabel(.03,.94,.97,.99,"Front View (X-Y Projection)"); // Create canvas label
454  Label_R2XY->Draw();
455  Box_R2XY = new TBox(.5-(R2_WIDTH*R2_CM*.5), .5-(R2_LENGTH*R2_CM*.5), .5+(R2_WIDTH*R2_CM*.5), .5+(R2_LENGTH*R2_CM*.5)); // Create and center box to frame wire lines
456  Box_R2XY->SetLineColor(1);
457  Box_R2XY->SetFillStyle(0);
458  Box_R2XY->Draw();
459  fRegion2XY->GetCanvas()->SetEditable(kFALSE);
460 
461  // Create embedded canvas for Region 2 YZ view
462  fRegion2YZ = new TRootEmbeddedCanvas(0,fRegion2,280,280);
463  Int_t wRegion2YZ = fRegion2YZ->GetCanvasWindowId();
464  cR2YZ = new TCanvas("cR2YZ", 10, 10, wRegion2YZ);
465  fRegion2YZ->AdoptCanvas(cR2YZ);
466  fRegion2->AddFrame(fRegion2YZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
467  fRegion2YZ->MoveResize(306,4,280,280);
468  fRegion2YZ->GetCanvas()->SetFillColor(0);
469  Label_R2YZ = new TPaveLabel(.03,.94,.97,.99,"Top View (Y-Z Projection)"); // Create canvas label
470  Label_R2YZ->Draw();
471  Box_R2YZ1 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 - (1.5*R2_DIST*R2_CM) - (2*R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5),.5 - (1.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM)); // Create and place box for chamber 1
472  Box_R2YZ1->SetLineColor(1);
473  Box_R2YZ1->SetFillStyle(0);
474  Box_R2YZ1->Draw();
475  Box_R2YZ2 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM)); // Create and place box for chamber 2
476  Box_R2YZ2->SetLineColor(7);
477  Box_R2YZ2->SetFillStyle(0);
478  Box_R2YZ2->Draw();
479  Box_R2YZ3 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM)); // Create and place box for chamber 3
480  Box_R2YZ3->SetLineColor(6);
481  Box_R2YZ3->SetFillStyle(0);
482  Box_R2YZ3->Draw();
483  Box_R2YZ4 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (2*R2_DEPTH*R2_CM)); // Create and place box for chamber 4
484  Box_R2YZ4->SetLineColor(8);
485  Box_R2YZ4->SetFillStyle(0);
486  Box_R2YZ4->Draw();
487  tR2XY1 = new TText(.03, .03, "Cham. 1"); // Color-coded text for HDC chamber labels
488  tR2XY1->SetTextColor(1);
489  tR2XY1->Draw();
490  tR2XY2 = new TText(.29, .03, "Cham. 2");
491  tR2XY2->SetTextColor(7);
492  tR2XY2->Draw();
493  tR2XY3 = new TText(.55, .03, "Cham. 3");
494  tR2XY3->SetTextColor(6);
495  tR2XY3->Draw();
496  tR2XY4 = new TText(.81, .03, "Cham. 4");
497  tR2XY4->SetTextColor(8);
498  tR2XY4->Draw();
499  fRegion2YZ->GetCanvas()->SetEditable(kFALSE);
500 
501  // Create embedded canvas for Region 2 XZ view
502  fRegion2XZ = new TRootEmbeddedCanvas(0,fRegion2,280,280);
503  Int_t wRegion2XZ = fRegion2XZ->GetCanvasWindowId();
504  cR2XZ = new TCanvas("cR2XZ",10, 10, wRegion2XZ);
505  fRegion2XZ->AdoptCanvas(cR2XZ);
506  fRegion2->AddFrame(fRegion2XZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
507  fRegion2XZ->MoveResize(603,4,280,280);
508  fRegion2XZ->GetCanvas()->SetFillColor(0);
509  Label_R2XZ = new TPaveLabel(.03,.94,.97,.99,"Side View (X-Z Projection)"); // Create canvas label
510  Label_R2XZ->Draw();
511  Box_R2XZ1 = new TBox(.5 + (1.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (2*R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 1
512  Box_R2XZ1->SetLineColor(8);
513  Box_R2XZ1->SetFillStyle(0);
514  Box_R2XZ1->Draw();
515  Box_R2XZ2 = new TBox(.5 + (.5*R2_DIST*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 2
516  Box_R2XZ2->SetLineColor(6);
517  Box_R2XZ2->SetFillStyle(0);
518  Box_R2XZ2->Draw();
519  Box_R2XZ3 = new TBox(.5 - (.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 3
520  Box_R2XZ3->SetLineColor(7);
521  Box_R2XZ3->SetFillStyle(0);
522  Box_R2XZ3->Draw();
523  Box_R2XZ4 = new TBox(.5 - (1.5*R2_DIST*R2_CM) - (2*R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 - (1.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 4
524  Box_R2XZ4->SetLineColor(1);
525  Box_R2XZ4->SetFillStyle(0);
526  Box_R2XZ4->Draw();
527  tR2XZ1 = new TText(.03, .03, "Cham. 1"); // Color-coded text for HDC chamber labels
528  tR2XZ1->SetTextColor(1);
529  tR2XZ1->Draw();
530  tR2XZ2 = new TText(.29, .03, "Cham. 2");
531  tR2XZ2->SetTextColor(7);
532  tR2XZ2->Draw();
533  tR2XZ3 = new TText(.55, .03, "Cham. 3");
534  tR2XZ3->SetTextColor(6);
535  tR2XZ3->Draw();
536  tR2XZ4 = new TText(.81, .03, "Cham. 4");
537  tR2XZ4->SetTextColor(8);
538  tR2XZ4->Draw();
539  fRegion2XZ->GetCanvas()->SetEditable(kFALSE);
540 
541  //REGION 2b--Horizontal Drift Chamber (2nd Arm)--------------------------------------------------//
542 
543  // Create tab and container of "Region 2" data in chambers 5 through 8
544  fRegion2b = fRegions->AddTab("Region 2--HDC (5-8)");
545  fRegion2b->SetLayoutManager(new TGVerticalLayout(fRegion2));
546  fRegion2b->SetLayoutBroken(kTRUE);
547  fRegion2b->SetBackgroundColor(ucolor);
548 
549  // Create embedded canvas for Region 2b XY view
550  fRegion2bXY = new TRootEmbeddedCanvas(0,fRegion2b,280,280);
551  Int_t wRegion2bXY = fRegion2bXY->GetCanvasWindowId();
552  cR2bXY = new TCanvas("cR2bXY", 10, 10, wRegion2bXY);
553  fRegion2bXY->AdoptCanvas(cR2bXY);
554  fRegion2b->AddFrame(fRegion2bXY, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
555  fRegion2bXY->MoveResize(12,4,280,280);
556  fRegion2bXY->GetCanvas()->SetFillColor(0);
557  Label_R2bXY = new TPaveLabel(.03,.94,.97,.99,"Front View (X-Y Projection)"); // Create canvas label
558  Label_R2bXY->Draw();
559  Box_R2bXY = new TBox(.5-(R2_WIDTH*R2_CM*.5), .5-(R2_LENGTH*R2_CM*.5), .5+(R2_WIDTH*R2_CM*.5), .5+(R2_LENGTH*R2_CM*.5)); // Create and center box to frame wire lines
560  Box_R2bXY->SetLineColor(1);
561  Box_R2bXY->SetFillStyle(0);
562  Box_R2bXY->Draw();
563  fRegion2bXY->GetCanvas()->SetEditable(kFALSE);
564 
565  // Create embedded canvas for Region 2b YZ view
566  fRegion2bYZ = new TRootEmbeddedCanvas(0,fRegion2b,280,280);
567  Int_t wRegion2bYZ = fRegion2bYZ->GetCanvasWindowId();
568  cR2bYZ = new TCanvas("cR2bYZ", 10, 10, wRegion2bYZ);
569  fRegion2bYZ->AdoptCanvas(cR2bYZ);
570  fRegion2b->AddFrame(fRegion2bYZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
571  fRegion2bYZ->MoveResize(306,4,280,280);
572  fRegion2bYZ->GetCanvas()->SetFillColor(0);
573  Label_R2bYZ = new TPaveLabel(.03,.94,.97,.99,"Top View (Y-Z Projection)"); // Create canvas label
574  Label_R2bYZ->Draw();
575  Box_R2bYZ1 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 - (1.5*R2_DIST*R2_CM) - (2*R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5),.5 - (1.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM)); // Create and place box for chamber 5
576  Box_R2bYZ1->SetLineColor(1);
577  Box_R2bYZ1->SetFillStyle(0);
578  Box_R2bYZ1->Draw();
579  Box_R2bYZ2 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM)); // Create and place box for chamber 6
580  Box_R2bYZ2->SetLineColor(7);
581  Box_R2bYZ2->SetFillStyle(0);
582  Box_R2bYZ2->Draw();
583  Box_R2bYZ3 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM)); // Create and place box for chamber 7
584  Box_R2bYZ3->SetLineColor(6);
585  Box_R2bYZ3->SetFillStyle(0);
586  Box_R2bYZ3->Draw();
587  Box_R2bYZ4 = new TBox(.5 - (R2_WIDTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 + (R2_WIDTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (2*R2_DEPTH*R2_CM)); // Create and place box for chamber 8
588  Box_R2bYZ4->SetLineColor(8);
589  Box_R2bYZ4->SetFillStyle(0);
590  Box_R2bYZ4->Draw();
591  tR2bXY1 = new TText(.03, .03, "Cham. 5"); // color-coded text for HDC chamber labels
592  tR2bXY1->SetTextColor(1);
593  tR2bXY1->Draw();
594  tR2bXY2 = new TText(.29, .03, "Cham. 6");
595  tR2bXY2->SetTextColor(7);
596  tR2bXY2->Draw();
597  tR2bXY3 = new TText(.55, .03, "Cham. 7");
598  tR2bXY3->SetTextColor(6);
599  tR2bXY3->Draw();
600  tR2bXY4 = new TText(.81, .03, "Cham. 8");
601  tR2bXY4->SetTextColor(8);
602  tR2bXY4->Draw();
603  fRegion2bYZ->GetCanvas()->SetEditable(kFALSE);
604 
605  // Create embedded canvas for Region 2b XZ view
606  fRegion2bXZ = new TRootEmbeddedCanvas(0,fRegion2b,280,280);
607  Int_t wRegion2bXZ = fRegion2bXZ->GetCanvasWindowId();
608  cR2bXZ = new TCanvas("cR2bXZ",10, 10, wRegion2bXZ);
609  fRegion2bXZ->AdoptCanvas(cR2bXZ);
610  fRegion2b->AddFrame(fRegion2bXZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
611  fRegion2bXZ->MoveResize(603,4,280,280);
612  fRegion2bXZ->GetCanvas()->SetFillColor(0);
613  Label_R2bXZ = new TPaveLabel(.03,.94,.97,.99,"Side View (X-Z Projection)"); // Create canvas label
614  Label_R2bXZ->Draw();
615  Box_R2bXZ1 = new TBox(.5 + (1.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 + (1.5*R2_DIST*R2_CM) + (2*R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 5
616  Box_R2bXZ1->SetLineColor(8);
617  Box_R2bXZ1->SetFillStyle(0);
618  Box_R2bXZ1->Draw();
619  Box_R2bXZ2 = new TBox(.5 + (.5*R2_DIST*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 + (.5*R2_DIST*R2_CM) + (R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 6
620  Box_R2bXZ2->SetLineColor(6);
621  Box_R2bXZ2->SetFillStyle(0);
622  Box_R2bXZ2->Draw();
623  Box_R2bXZ3 = new TBox(.5 - (.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 - (.5*R2_DIST*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 7
624  Box_R2bXZ3->SetLineColor(7);
625  Box_R2bXZ3->SetFillStyle(0);
626  Box_R2bXZ3->Draw();
627  Box_R2bXZ4 = new TBox(.5 - (1.5*R2_DIST*R2_CM) - (2*R2_DEPTH*R2_CM), .5 - (R2_LENGTH*R2_CM*.5), .5 - (1.5*R2_DIST*R2_CM) - (R2_DEPTH*R2_CM), .5 + (R2_LENGTH*R2_CM*.5)); // Create and place box for chamber 8
628  Box_R2bXZ4->SetLineColor(1);
629  Box_R2bXZ4->SetFillStyle(0);
630  Box_R2bXZ4->Draw();
631  tR2bXZ1 = new TText(.03, .03, "Cham. 5"); // Color-coded text for HDC chamber labels
632  tR2bXZ1->SetTextColor(1);
633  tR2bXZ1->Draw();
634  tR2bXZ2 = new TText(.29, .03, "Cham. 6");
635  tR2bXZ2->SetTextColor(7);
636  tR2bXZ2->Draw();
637  tR2bXZ3 = new TText(.55, .03, "Cham. 7");
638  tR2bXZ3->SetTextColor(6);
639  tR2bXZ3->Draw();
640  tR2bXZ4 = new TText(.81, .03, "Cham. 8");
641  tR2bXZ4->SetTextColor(8);
642  tR2bXZ4->Draw();
643  fRegion2bXZ->GetCanvas()->SetEditable(kFALSE);
644 
645  //REGION 3--Vertical Drift Chambers--------------------------------------------------//
646 
647  // Create tab and container of "Region 3" VDC data
648  fRegion3 = fRegions->AddTab("Region 3--VDC");
649  fRegion3->SetLayoutManager(new TGVerticalLayout(fRegion3));
650  fRegion3->SetLayoutBroken(kTRUE);
651  fRegion3->SetBackgroundColor(ucolor);
652 
653  // Create embedded canvas for Region 3 XY view
654  fRegion3XY = new TRootEmbeddedCanvas(0,fRegion3,280,280);
655  Int_t wRegion3XY = fRegion3XY->GetCanvasWindowId();
656  cR3XY = new TCanvas("cR3XY", 10, 10, wRegion3XY);
657  fRegion3XY->AdoptCanvas(cR3XY);
658  fRegion3->AddFrame(fRegion3XY, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
659  fRegion3XY->MoveResize(12,4,280,280);
660  fRegion3XY->GetCanvas()->SetFillColor(0);
661  Label_R3XY = new TPaveLabel(.03,.94,.97,.99,"Front View (Normal to Tilt Angle)"); // Create canvas label
662  Label_R3XY->Draw();
663  Box_R3XY1 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .65-(R3_LENGTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .65+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 1
664  Box_R3XY1->SetLineColor(1);
665  Box_R3XY1->SetFillStyle(0);
666  Box_R3XY2 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .75-(R3_LENGTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .75+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 2
667  Box_R3XY2->SetLineColor(7);
668  Box_R3XY2->SetFillStyle(0);
669  Box_R3XY2->Draw();
670  Box_R3XY1->Draw(); // Draw 1 on top of 2
671  Box_R3XY3 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .25-(R3_LENGTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .25+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 3
672  Box_R3XY3->SetLineColor(6);
673  Box_R3XY3->SetFillStyle(0);
674  Box_R3XY4 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .35-(R3_LENGTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .35+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 4
675  Box_R3XY4->SetLineColor(8);
676  Box_R3XY4->SetFillStyle(0);
677  Box_R3XY4->Draw();
678  Box_R3XY3->Draw(); // Draw 3 on top of 4
679  tR3XY1 = new TText(.03, .03, "Leia (1)"); // Color-coded text for VDC chamber labels
680  tR3XY1->SetTextColor(1);
681  tR3XY1->Draw();
682  tR3XY2 = new TText(.28, .03, "Vader (2)");
683  tR3XY2->SetTextColor(7);
684  tR3XY2->Draw();
685  tR3XY3 = new TText(.55, .03, "Han (3)");
686  tR3XY3->SetTextColor(6);
687  tR3XY3->Draw();
688  tR3XY4 = new TText(.81, .03, "Yoda (4)");
689  tR3XY4->SetTextColor(8);
690  tR3XY4->Draw();
691  Div_R3XY = new TLine(0,.5,1,.5);
692  Div_R3XY->SetLineStyle(2);
693  Div_R3XY->Draw();
694  fRegion3XY->GetCanvas()->SetEditable(kFALSE);
695 
696  // Create embedded canvas for Region 3 YZ view
697  fRegion3YZ = new TRootEmbeddedCanvas(0,fRegion3,280,280);
698  Int_t wRegion3YZ = fRegion3YZ->GetCanvasWindowId();
699  cR3YZ = new TCanvas("cR3YZ", 10, 10, wRegion3YZ);
700  fRegion3YZ->AdoptCanvas(cR3YZ);
701  fRegion3->AddFrame(fRegion3YZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
702  fRegion3YZ->MoveResize(306,4,280,280);
703  fRegion3YZ->GetCanvas()->SetFillColor(0);
704  Label_R3YZ = new TPaveLabel(.03,.94,.97,.99,"Top View (Oriented to Tilt Angle)"); // Create canvas label
705  Label_R3YZ->Draw();
706  Box_R3YZ1 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .65-(R3_DEPTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .65+(R3_DEPTH*R3_CM*.5)); // Create and place box for chamber 1
707  Box_R3YZ1->SetLineColor(1);
708  Box_R3YZ1->SetFillStyle(0);
709  Box_R3YZ2 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .75-(R3_DEPTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .75+(R3_DEPTH*R3_CM*.5)); // Create and place box for chamber 2
710  Box_R3YZ2->SetLineColor(7);
711  Box_R3YZ2->SetFillStyle(0);
712  Box_R3YZ2->Draw();
713  Box_R3YZ1->Draw(); // Draw 1 on top of 2
714  Box_R3YZ3 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .25-(R3_DEPTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .25+(R3_DEPTH*R3_CM*.5)); // Create and place box for chamber 3
715  Box_R3YZ3->SetLineColor(6);
716  Box_R3YZ3->SetFillStyle(0);
717  Box_R3YZ4 = new TBox(.5-(R3_WIDTH*R3_CM*.5), .35-(R3_DEPTH*R3_CM*.5), .5+(R3_WIDTH*R3_CM*.5), .35+(R3_DEPTH*R3_CM*.5)); // Create and place box for chamber 4
718  Box_R3YZ4->SetLineColor(8);
719  Box_R3YZ4->SetFillStyle(0);
720  Box_R3YZ4->Draw();
721  Box_R3YZ3->Draw(); // Draw 3 on top of 4
722  tR3YZ1 = new TText(.03, .03, "Leia (1)"); // Color-coded text for VDC chamber labels
723  tR3YZ1->SetTextColor(1);
724  tR3YZ1->Draw();
725  tR3YZ2 = new TText(.28, .03, "Vader (2)");
726  tR3YZ2->SetTextColor(7);
727  tR3YZ2->Draw();
728  tR3YZ3 = new TText(.55, .03, "Han (3)");
729  tR3YZ3->SetTextColor(6);
730  tR3YZ3->Draw();
731  tR3YZ4 = new TText(.81, .03, "Yoda (4)");
732  tR3YZ4->SetTextColor(8);
733  tR3YZ4->Draw();
734  Div_R3YZ = new TLine(0,.5,1,.5);
735  Div_R3YZ->SetLineStyle(2);
736  Div_R3YZ->Draw();
737  fRegion3YZ->GetCanvas()->SetEditable(kFALSE);
738 
739  // Create embedded canvas for Region 3 XZ view
740  fRegion3XZ = new TRootEmbeddedCanvas(0,fRegion3,280,280);
741  Int_t wRegion3XZ = fRegion3XZ->GetCanvasWindowId();
742  cR3XZ = new TCanvas("cR3XZ", 10, 10, wRegion3XZ);
743  fRegion3XZ->AdoptCanvas(cR3XZ);
744  fRegion3->AddFrame(fRegion3XZ, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
745  fRegion3XZ->MoveResize(603,4,280,280);
746  fRegion3XZ->GetCanvas()->SetFillColor(0);
747  Label_R3XZ = new TPaveLabel(.03,.94,.97,.99,"Side View (Rotated to Tilt Angle)"); // Create canvas label
748  Label_R3XZ->Draw();
749  Box_R3XZ1 = new TBox(.5-(R3_DEPTH*R3_CM*.5)-(R3_DIST*R3_CM*.5), .65-(R3_LENGTH*R3_CM*.5), .5+(R3_DEPTH*R3_CM*.5)-(R3_DIST*R3_CM*.5), .65+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 1
750  Box_R3XZ1->SetLineColor(1);
751  Box_R3XZ1->SetFillStyle(0);
752  Box_R3XZ2 = new TBox(.5-(R3_DEPTH*R3_CM*.5)+(R3_DIST*R3_CM*.5), .75-(R3_LENGTH*R3_CM*.5), .5+(R3_DEPTH*R3_CM*.5)+(R3_DIST*R3_CM*.5), .75+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 2
753  Box_R3XZ2->SetLineColor(7);
754  Box_R3XZ2->SetFillStyle(0);
755  Box_R3XZ2->Draw();
756  Box_R3XZ1->Draw();
757  Box_R3XZ3 = new TBox(.5-(R3_DEPTH*R3_CM*.5)-(R3_DIST*R3_CM*.5), .25-(R3_LENGTH*R3_CM*.5), .5+(R3_DEPTH*R3_CM*.5)-(R3_DIST*R3_CM*.5), .25+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 3
758  Box_R3XZ3->SetLineColor(6);
759  Box_R3XZ3->SetFillStyle(0);
760  Box_R3XZ4 = new TBox(.5-(R3_DEPTH*R3_CM*.5)+(R3_DIST*R3_CM*.5), .35-(R3_LENGTH*R3_CM*.5), .5+(R3_DEPTH*R3_CM*.5)+(R3_DIST*R3_CM*.5), .35+(R3_LENGTH*R3_CM*.5)); // Create and place box for chamber 4
761  Box_R3XZ4->SetLineColor(8);
762  Box_R3XZ4->SetFillStyle(0);
763  Box_R3XZ4->Draw();
764  Box_R3XZ3->Draw();
765  tR3XZ1 = new TText(.03, .03, "Leia (1)"); // Color-coded text for VDC chamber labels
766  tR3XZ1->SetTextColor(1);
767  tR3XZ1->Draw();
768  tR3XZ2 = new TText(.28, .03, "Vader (2)");
769  tR3XZ2->SetTextColor(7);
770  tR3XZ2->Draw();
771  tR3XZ3 = new TText(.55, .03, "Han (3)");
772  tR3XZ3->SetTextColor(6);
773  tR3XZ3->Draw();
774  tR3XZ4 = new TText(.81, .03, "Yoda (4)");
775  tR3XZ4->SetTextColor(8);
776  tR3XZ4->Draw();
777  Div_R3XZ = new TLine(0,.5,1,.5);
778  Div_R3XZ->SetLineStyle(2);
779  Div_R3XZ->Draw();
780  fRegion3XZ->GetCanvas()->SetEditable(kFALSE);
781 
782  //REGION 3--Trigger Scintillator--------------------------------------------------// NOT USED CURRENTLY
783 
784  // create tab and container of "Region 3" TS data
785  fRegion3TS = fRegions->AddTab("Region 3--TS");
786  fRegion3TS->SetLayoutManager(new TGVerticalLayout(fRegion3TS));
787  fRegion3TS->SetLayoutBroken(kTRUE);
788  fRegion3TS->SetBackgroundColor(ucolor);
789 
790  // Set region tab attributes
791  fRegions->SetTab(0);
792  fRegions->Resize(fRegions->GetDefaultSize());
793  fMain->AddFrame(fRegions, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
794  fRegions->MoveResize(0,340,900,332);
795  gClient->GetColorByName("#deba87", ucolor); // Set ucolor to mute orange
796  fRegions->GetTabTab("Region 1--GEM")->SetBackgroundColor(ucolor);
797  fRegions->GetTabTab("Region 2--HDC (1-4)")->SetBackgroundColor(ucolor);
798  fRegions->GetTabTab("Region 2--HDC (5-8)")->SetBackgroundColor(ucolor);
799  fRegions->GetTabTab("Region 3--VDC")->SetBackgroundColor(ucolor);
800  fRegions->GetTabTab("Region 3--TS")->SetBackgroundColor(ucolor);
801 
802 
803  ////BUTTONS----------------------------------------------------------------------------------------------------////
804 
805  // Create horizontal frame for buttons
806  gClient->GetColorByName("#0047ab",ucolor);
807  TGHorizontalFrame *fButtons = new TGHorizontalFrame(fMain,900,60,kHorizontalFrame,ucolor);
808  fButtons->SetLayoutBroken(kTRUE);
809  ufont = gClient->GetFont("-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*"); // Set ufont to bold helvetica 12
810  gClient->GetColorByName("#d4cf87",ucolor); // Set ucolor to buff
811 
812  // Graphics context changes for "Exit" button
813  GCValues_t valutton;
814  valutton.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
815  gClient->GetColorByName("#000000",valutton.fForeground);
816  gClient->GetColorByName("#c0c0c0",valutton.fBackground);
817  valutton.fFillStyle = kFillSolid;
818  valutton.fFont = ufont->GetFontHandle();
819  valutton.fGraphicsExposures = kFALSE;
820  uGC = gClient->GetGC(&valutton, kTRUE);
821  // Create exit button
822  ExitButton = new TGTextButton(fButtons,"E&xit","gApplication->Terminate(0)"); // Connect button to application termination
823  ExitButton->SetFont(ufont->GetFontStruct());
824  ExitButton->SetTextJustify(36);
825  ExitButton->SetMargins(0,0,0,0);
826  ExitButton->SetWrapLength(-1);
827  ExitButton->Resize(100,50);
828  ExitButton->ChangeBackground(ucolor);
829  // Add exit button to buttons frame
830  fButtons->AddFrame(ExitButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
831  ExitButton->MoveResize(784,6,100,50);
832 
833  // Graphics context changes for "Previous Event" button
834  GCValues_t valousButton;
835  valousButton.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
836  gClient->GetColorByName("#000000",valousButton.fForeground);
837  gClient->GetColorByName("#c0c0c0",valousButton.fBackground);
838  valousButton.fFillStyle = kFillSolid;
839  valousButton.fFont = ufont->GetFontHandle();
840  valousButton.fGraphicsExposures = kFALSE;
841  uGC = gClient->GetGC(&valousButton, kTRUE);
842  // Create previous button
843  TGTextButton *PreviousButton = new TGTextButton(fButtons,"&Previous Event",-1,uGC->GetGC(),ufont->GetFontStruct());
844  PreviousButton->Connect("Clicked()", "QwEventDisplay", this, "GoPrevious()"); // Connect button to GoPrevious() function
845  PreviousButton->SetTextJustify(36);
846  PreviousButton->SetMargins(0,0,0,0);
847  PreviousButton->SetWrapLength(-1);
848  PreviousButton->Resize(100,50);
849  PreviousButton->ChangeBackground(ucolor);
850  // Add previous button to buttons frame
851  fButtons->AddFrame(PreviousButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
852  PreviousButton->MoveResize(12,6,100,50);
853 
854 
855  // Graphics context changes for "Next Event" button
856  valutton.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
857  gClient->GetColorByName("#000000",valutton.fForeground);
858  gClient->GetColorByName("#c0c0c0",valutton.fBackground);
859  valutton.fFillStyle = kFillSolid;
860  valutton.fFont = ufont->GetFontHandle();
861  valutton.fGraphicsExposures = kFALSE;
862  uGC = gClient->GetGC(&valutton, kTRUE);
863  // Create next button
864  TGTextButton *NextButton = new TGTextButton(fButtons,"&Next Event",-1,uGC->GetGC(),ufont->GetFontStruct());
865  NextButton->Connect("Clicked()", "QwEventDisplay", this, "GoNext()"); // Connect button to GoNext() function
866  NextButton->SetTextJustify(36);
867  NextButton->SetMargins(0,0,0,0);
868  NextButton->SetWrapLength(-1);
869  NextButton->Resize(100,50);
870  NextButton->ChangeBackground(ucolor);
871  // Add next button to buttons frame
872  fButtons->AddFrame(NextButton, new TGLayoutHints(kLHintsNormal));
873  NextButton->MoveResize(125,6,100,50);
874 
875  // Add buttons frame to main frame
876  fMain->AddFrame(fButtons, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
877  fButtons->MoveResize(0,652,900,80);
878 
879 
880  //LOCAL COORDINATE KEY----------------------------------------------------------------------------------------------------//
881 
882  // Create embedded canvas to display key for local coordinates
883  TRootEmbeddedCanvas *fKey = new TRootEmbeddedCanvas(0,fButtons,280,280);
884  Int_t wKey = fKey->GetCanvasWindowId();
885  TCanvas *cKey = new TCanvas("cKey", 10, 10, wKey);
886  fKey->AdoptCanvas(cKey);
887  fButtons->AddFrame(fKey, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
888  fKey->MoveResize(245,6,515,50);
889  // Fill in key details
890  fKey->GetCanvas()->cd();
891  fKey->GetCanvas()->SetFillColor(0);
892  TPaveLabel *Label_KeyX = new TPaveLabel(.01,.05,.24,.95," X"); // Create key label for X direction
893  Label_KeyX->SetTextAlign(12);
894  Label_KeyX->SetTextColor(kRed);
895  Label_KeyX->SetShadowColor(0);
896  Label_KeyX->Draw();
897  TLine *Line_KeyX = new TLine(.1,.5,.2,.5);
898  Line_KeyX->SetLineColor(kRed);
899  Line_KeyX->Draw();
900  TPaveLabel *Label_KeyY = new TPaveLabel(.25,.05,.49,.95," Y"); // Create key label for Y direction
901  Label_KeyY->SetTextAlign(12);
902  Label_KeyY->SetTextColor(kViolet);
903  Label_KeyY->SetShadowColor(0);
904  Label_KeyY->Draw();
905  TLine *Line_KeyY = new TLine(.4,.1,.4,.9);
906  Line_KeyY->SetLineColor(kViolet);
907  Line_KeyY->Draw();
908  TPaveLabel *Label_KeyU = new TPaveLabel(.5,.05,.74,.95," U"); // Create key label for U direction
909  Label_KeyU->SetTextAlign(12);
910  Label_KeyU->SetTextColor(kGreen);
911  Label_KeyU->SetShadowColor(0);
912  Label_KeyU->Draw();
913  TLine *Line_KeyU = new TLine(.59,.1,.7,.9);
914  Line_KeyU->SetLineColor(kGreen);
915  Line_KeyU->Draw();
916  TPaveLabel *Label_KeyV = new TPaveLabel(.75,.05,.99,.95," V"); // Create key label for V direction
917  Label_KeyV->SetTextAlign(12);
918  Label_KeyV->SetTextColor(kBlue);
919  Label_KeyV->SetShadowColor(0);
920  Label_KeyV->Draw();
921  TLine *Line_KeyV = new TLine(.84,.9,.95,.1);
922  Line_KeyV->SetLineColor(kBlue);
923  Line_KeyV->Draw();
924  fKey->GetCanvas()->SetEditable(kFALSE);
925  fKey->GetCanvas()->Update();
926 
927  // Add main frame to the client window and customize
928  fMain->SetMWMHints(kMWMDecorAll,kMWMFuncAll,kMWMInputModeless);
929  fMain->MapSubwindows();
930  fMain->Resize(fMain->GetDefaultSize());
931  fMain->MapWindow();
932  fMain->Resize(900,712);
933 } // End QwEventDisplay()
#define R3_WIDTH
#define R2_CM
#define R1_CM
const TString getenv_safe_TString(const char *name)
Definition: QwOptions.h:40
#define R2_DIST
#define R3_LENGTH
#define R2_LENGTH
#define R1_DEPTH
#define R2_DEPTH
#define R3_CM
#define R3_DIST
#define R2_WIDTH
#define R3_DEPTH
#define R1_LENGTH
#define R1_WIDTH

+ Here is the call graph for this function: