25 #include <TPolyMarker.h>
30 #include <TGeoVolume.h>
31 #include <TGeoManager.h>
33 #include <TGComboBox.h>
35 #include <TGButtonGroup.h>
36 #include <TGTextEntry.h>
43 extern JApplication *
japp;
116 float my_BCAL_PHI_SHIFT;
120 UInt_t MainWidth = w;
130 TGLayoutHints *hints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY|kLHintsLeft, 5,5,5,5);
131 TGLayoutHints *lhints =
new TGLayoutHints(kLHintsNormal, 2,2,2,2);
132 TGLayoutHints *rhints =
new TGLayoutHints(kLHintsCenterY|kLHintsRight, 2,2,2,2);
133 TGLayoutHints *chints =
new TGLayoutHints(kLHintsCenterY|kLHintsCenterX, 2,2,2,2);
134 TGLayoutHints *bhints =
new TGLayoutHints(kLHintsBottom|kLHintsCenterX, 2,2,2,2);
136 TGLayoutHints *xhints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 2,2,2,2);
137 TGLayoutHints *yhints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandY, 2,2,2,2);
138 TGLayoutHints *dhints =
new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 0,0,0,0);
139 TGLayoutHints *ehints =
new TGLayoutHints(kLHintsNormal, 2,2,0,0);
140 TGLayoutHints *thints =
new TGLayoutHints(kLHintsTop|kLHintsCenterX, 2,2,0,0);
141 TGLayoutHints *lxhints =
new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 2,2,0,0);
142 TGHorizontalFrame *sourceframe =
new TGHorizontalFrame(
this,w,20);
143 TGHorizontalFrame *topframe =
new TGHorizontalFrame(
this, w, 200);
145 TGCompositeFrame *midframe =
new TGCompositeFrame(
this, w, 200, kHorizontalFrame);
146 TGHorizontalFrame *botframe =
new TGHorizontalFrame(
this, w, 200);
147 AddFrame(sourceframe, lxhints);
148 AddFrame(topframe, lhints);
149 AddFrame(midframe, lhints);
150 AddFrame(botframe, lhints);
153 TGLabel *sourcelab =
new TGLabel(sourceframe,
"Source:");
154 sourceframe->AddFrame(sourcelab,ehints);
155 source =
new TGLabel(sourceframe,
"--");
156 sourceframe->AddFrame(
source, lxhints);
157 source->SetTextJustify(1);
160 TGGroupFrame *viewcontrols =
new TGGroupFrame(topframe,
"View Controls", kHorizontalFrame);
161 TGGroupFrame *eventcontrols =
new TGGroupFrame(topframe,
"Event Controls", kHorizontalFrame);
162 TGGroupFrame *eventinfo =
new TGGroupFrame(topframe,
"Info", kHorizontalFrame);
163 TGGroupFrame *inspectors =
new TGGroupFrame(topframe,
"Inspectors", kVerticalFrame);
164 TGHorizontalFrame *programcontrols =
new TGHorizontalFrame(topframe);
165 topframe->AddFrame(viewcontrols, lhints);
166 topframe->AddFrame(eventcontrols, hints);
167 topframe->AddFrame(eventinfo, yhints);
168 topframe->AddFrame(inspectors, yhints);
169 topframe->AddFrame(programcontrols, yhints);
172 TGVerticalFrame *panneg =
new TGVerticalFrame(viewcontrols);
173 TGVerticalFrame *panpos =
new TGVerticalFrame(viewcontrols);
174 viewcontrols->AddFrame(panneg, hints);
175 viewcontrols->AddFrame(panpos, hints);
176 TGTextButton *panxneg =
new TGTextButton(panneg,
"-X");
177 TGTextButton *panyneg =
new TGTextButton(panneg,
"-Y");
178 TGTextButton *panzneg =
new TGTextButton(panneg,
"-Z");
179 panneg->AddFrame(panxneg, dhints);
180 panneg->AddFrame(panyneg, dhints);
181 panneg->AddFrame(panzneg, dhints);
183 TGTextButton *panxpos =
new TGTextButton(panpos,
"X+");
184 TGTextButton *panypos =
new TGTextButton(panpos,
"Y+");
185 TGTextButton *panzpos =
new TGTextButton(panpos,
"Z+");
186 panpos->AddFrame(panxpos, dhints);
187 panpos->AddFrame(panypos, dhints);
188 panpos->AddFrame(panzpos, dhints);
190 panxneg->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanXneg()");
191 panyneg->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanYneg()");
192 panzneg->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanZneg()");
193 panxpos->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanXpos()");
194 panypos->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanYpos()");
195 panzpos->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPanZpos()");
197 TGVerticalFrame *zoom =
new TGVerticalFrame(viewcontrols);
198 viewcontrols->AddFrame(zoom, lhints);
199 TGGroupFrame *zoomframe =
new TGGroupFrame(zoom,
"ZOOM", kHorizontalFrame);
200 zoom->AddFrame(zoomframe, thints);
201 TGTextButton *zoomout =
new TGTextButton(zoomframe,
" - ");
202 TGTextButton *zoomin =
new TGTextButton(zoomframe,
" + ");
203 zoomframe->AddFrame(zoomout, thints);
204 zoomframe->AddFrame(zoomin, thints);
205 TGTextButton *reset =
new TGTextButton(zoom,
"Reset");
206 zoom->AddFrame(reset, chints);
209 TGVButtonGroup *coordinates =
new TGVButtonGroup(viewcontrols,
"Transverse Coordinates");
210 viewcontrols->AddFrame(coordinates, lhints);
211 TGRadioButton *xy =
new TGRadioButton(coordinates,
"x/y");
212 new TGRadioButton(coordinates,
"r/phi");
215 prev =
new TGTextButton(eventcontrols,
"<-- Prev");
216 next =
new TGTextButton(eventcontrols,
"Next -->");
217 TGVerticalFrame *contf =
new TGVerticalFrame(eventcontrols);
218 eventcontrols->AddFrame(
prev, chints);
219 eventcontrols->AddFrame(
next, chints);
220 eventcontrols->AddFrame(contf, lhints);
223 checkbuttons[
"continuous"] =
new TGCheckButton(contf,
"continuous");
224 TGHorizontalFrame *delayf =
new TGHorizontalFrame(contf);
226 contf->AddFrame(delayf, lhints);
227 TGLabel *delaylab =
new TGLabel(delayf,
"delay:");
228 delay =
new TGComboBox(delayf,
"0.25");
229 delay->Resize(50,20);
230 float delays[]={0, 0.25, 0.5, 1, 2, 3, 5, 10};
231 for(
int i=0; i<8; i++){
234 delay->AddEntry(ss.str().c_str(),i);
236 delayf->AddFrame(delaylab, lhints);
237 delayf->AddFrame(
delay, lhints);
240 TGVerticalFrame *eventlabs =
new TGVerticalFrame(eventinfo);
241 TGVerticalFrame *eventvals =
new TGVerticalFrame(eventinfo);
242 eventinfo->AddFrame(eventlabs, lhints);
243 eventinfo->AddFrame(eventvals, lhints);
245 TGLabel *runlab =
new TGLabel(eventlabs,
"Run:");
246 TGLabel *eventlab =
new TGLabel(eventlabs,
"Event:");
247 TGLabel *triglab =
new TGLabel(eventlabs,
"GTP bits:");
248 run =
new TGLabel(eventvals,
"--------------");
249 event =
new TGLabel(eventvals,
"--------------");
250 trig =
new TGLabel(eventvals,
"--------------");
251 eventlabs->AddFrame(runlab, rhints);
252 eventlabs->AddFrame(eventlab,rhints);
253 eventlabs->AddFrame(triglab,rhints);
254 eventvals->AddFrame(
run, lhints);
255 eventvals->AddFrame(
event, lhints);
256 eventvals->AddFrame(
trig, lhints);
259 TGTextButton *trackinspector =
new TGTextButton(inspectors,
"Track Inspector");
263 inspectors->AddFrame(trackinspector, xhints);
272 TGTextButton *quit =
new TGTextButton(programcontrols,
"&Quit");
273 programcontrols->AddFrame(quit,
new TGLayoutHints(kLHintsTop|kLHintsRight|kLHintsExpandX, 2,2,2,2));
276 TGHorizontalFrame *detectorframe =
new TGHorizontalFrame(midframe);
277 midframe->AddFrame(detectorframe, hints);
280 TGVerticalFrame *sideviews =
new TGVerticalFrame(detectorframe);
281 TGVerticalFrame *endviews =
new TGVerticalFrame(detectorframe);
282 TGVerticalFrame *drawopts =
new TGVerticalFrame(detectorframe);
283 TGVerticalFrame *caloColorCodes =
new TGVerticalFrame(detectorframe);
284 detectorframe->AddFrame(sideviews, lhints);
285 detectorframe->AddFrame(endviews, lhints);
286 detectorframe->AddFrame(caloColorCodes, lhints);
287 detectorframe->AddFrame(drawopts, lhints);
290 int width = MainWidth/6*2;
291 TGHorizontalFrame *sideviewAframe =
new TGHorizontalFrame(sideviews);
292 TGHorizontalFrame *sideviewBframe =
new TGHorizontalFrame(sideviews);
293 sideviews->AddFrame(sideviewAframe, lhints);
294 sideviews->AddFrame(sideviewBframe, lhints);
295 sideviewA =
new TRootEmbeddedCanvas(
"sideviewA Canvas", sideviewAframe, width, width/2, kSunkenFrame, GetWhitePixel());
296 sideviewB =
new TRootEmbeddedCanvas(
"sideviewB Canvas", sideviewBframe, width, width/2, kSunkenFrame, GetWhitePixel());
297 sideviewAframe->AddFrame(
sideviewA, lhints);
298 sideviewBframe->AddFrame(
sideviewB, lhints);
299 sideviewA->SetScrolling(TGCanvas::kCanvasScrollBoth);
300 sideviewB->SetScrolling(TGCanvas::kCanvasScrollBoth);
305 endviewA =
new TRootEmbeddedCanvas(
"endviewA Canvas", endviews, width/2, width/2, kSunkenFrame, GetWhitePixel());
306 endviewB =
new TRootEmbeddedCanvas(
"endviewB Canvas", endviews, width/2, width/2, kSunkenFrame, GetWhitePixel());
307 endviews->AddFrame(
endviewA, lhints);
308 endviews->AddFrame(
endviewB, lhints);
309 endviewA->SetScrolling(TGCanvas::kCanvasScrollBoth);
310 endviewB->SetScrolling(TGCanvas::kCanvasScrollBoth);
311 endviewA->GetCanvas()->SetFillColor(kGray+1);
312 endviewB->GetCanvas()->SetFillColor(kGray+1);
315 TGGroupFrame *trkdrawopts =
new TGGroupFrame(drawopts,
"Track Draw Options", kVerticalFrame);
316 TGGroupFrame *hitdrawopts =
new TGGroupFrame(drawopts,
"Hit Draw Options", kVerticalFrame);
317 drawopts->AddFrame(trkdrawopts, lhints);
318 drawopts->AddFrame(hitdrawopts, lhints);
321 TGHorizontalFrame *candidatesf =
new TGHorizontalFrame(trkdrawopts);
322 checkbuttons[
"candidates"] =
new TGCheckButton(candidatesf,
"DTrackCandidate:");
325 candidatesf->AddFrame(
checkbuttons[
"candidates"], lhints);
329 trkdrawopts->AddFrame(candidatesf, lhints);
331 TGHorizontalFrame *wiretracksf =
new TGHorizontalFrame(trkdrawopts);
332 checkbuttons[
"wiretracks"] =
new TGCheckButton(wiretracksf,
"DTrackWireBased:");
335 wiretracksf->AddFrame(
checkbuttons[
"wiretracks"], lhints);
339 trkdrawopts->AddFrame(wiretracksf, lhints);
341 TGHorizontalFrame *timetracksf =
new TGHorizontalFrame(trkdrawopts);
342 checkbuttons[
"timetracks"] =
new TGCheckButton(timetracksf,
"DTrackTimeBased:");
345 timetracksf->AddFrame(
checkbuttons[
"timetracks"], lhints);
349 trkdrawopts->AddFrame(timetracksf, lhints);
350 TGHorizontalFrame *chargedtracksf =
new TGHorizontalFrame(trkdrawopts);
351 checkbuttons[
"chargedtracks"] =
new TGCheckButton(chargedtracksf,
"DChargedTrack:");
354 chargedtracksf->AddFrame(
checkbuttons[
"chargedtracks"], lhints);
358 trkdrawopts->AddFrame(chargedtracksf, lhints);
360 checkbuttons[
"neutrals"] =
new TGCheckButton(trkdrawopts,
"DNeutralParticle");
361 checkbuttons[
"thrown"] =
new TGCheckButton(trkdrawopts,
"DMCThrown");
362 checkbuttons[
"trajectories"] =
new TGCheckButton(trkdrawopts,
"DMCTrajectoryPoint");
363 trkdrawopts->AddFrame(
checkbuttons[
"neutrals"], lhints);
365 trkdrawopts->AddFrame(
checkbuttons[
"trajectories"], lhints);
368 checkbuttons[
"cdc"] =
new TGCheckButton(hitdrawopts,
"CDC");
369 checkbuttons[
"cdcdrift"] =
new TGCheckButton(hitdrawopts,
"CDC Drift Time");
370 checkbuttons[
"cdctruth"] =
new TGCheckButton(hitdrawopts,
"CDCTruth");
371 checkbuttons[
"fdcwire"] =
new TGCheckButton(hitdrawopts,
"FDC Wire");
372 checkbuttons[
"fdcpseudo"] =
new TGCheckButton(hitdrawopts,
"FDC Pseudo");
373 checkbuttons[
"fdctruth"] =
new TGCheckButton(hitdrawopts,
"FDCTruth");
374 checkbuttons[
"tof"] =
new TGCheckButton(hitdrawopts,
"TOF");
375 checkbuttons[
"toftruth"] =
new TGCheckButton(hitdrawopts,
"TOFTruth");
376 checkbuttons[
"fcal"] =
new TGCheckButton(hitdrawopts,
"FCAL");
377 checkbuttons[
"bcal"] =
new TGCheckButton(hitdrawopts,
"BCAL");
378 checkbuttons[
"ccal"] =
new TGCheckButton(hitdrawopts,
"CCAL");
381 hitdrawopts->AddFrame(
checkbuttons[
"cdcdrift"], lhints);
382 hitdrawopts->AddFrame(
checkbuttons[
"cdctruth"], lhints);
384 hitdrawopts->AddFrame(
checkbuttons[
"fdcpseudo"], lhints);
385 hitdrawopts->AddFrame(
checkbuttons[
"fdctruth"], lhints);
387 hitdrawopts->AddFrame(
checkbuttons[
"toftruth"], lhints);
392 TGTextButton *moreOptions =
new TGTextButton(hitdrawopts,
"More options");
393 hitdrawopts->AddFrame(moreOptions, lhints);
396 TGGroupFrame *bcalColorCodes =
new TGGroupFrame(caloColorCodes,
"BCAL colors", kVerticalFrame);
397 TGGroupFrame *fcalColorCodes =
new TGGroupFrame(caloColorCodes,
"FCAL colors", kVerticalFrame);
398 TGTextButton *debuger =
new TGTextButton(caloColorCodes,
"Debugger");
399 TGTextButton *bcaldisp =
new TGTextButton(caloColorCodes,
"BcalDisp");
401 caloColorCodes->AddFrame(bcalColorCodes, thints);
402 caloColorCodes->AddFrame(debuger,lhints);
403 caloColorCodes->AddFrame(bcaldisp,lhints);
404 caloColorCodes->AddFrame(fcalColorCodes, bhints);
405 bcalColorCodes->SetWidth(30);
406 fcalColorCodes->SetWidth(30);
409 TGLabel* BCCLables[9];
410 unsigned int BCccodes[9] = {0x0000FF,0x7700FF,0xFF00FF,0xFF0077,0xFF0000,0xFF7700,0xFFFF00,0xFFFF77,0xFFFFFF};
411 for (
int i=0;i<9;i++) {
412 double e = pow(10,((8-(
double)i)/2.0));
415 sprintf(str1,
"%7.2f GeV",e/1000.);
419 BCCLables[i] =
new TGLabel(bcalColorCodes, (
const char*)str1);
421 BCCLables[i]->SetBackgroundColor(BCccodes[i]);
422 bcalColorCodes->AddFrame(BCCLables[i],lhints);
425 TGLabel* FCCLables[9];
426 unsigned int FCccodes[9] = {0x0000FF,0x7700FF,0xFF00FF,0xFF0077,0xFF0000,0xFF7700,0xFFFF00,0xFFFF77,0xFFFFFF};
427 for (
int i=0;i<9;i++) {
428 double e = pow(10,((8-(
double)i)/2.0));
431 sprintf(str1,
"%7.2f GeV",e/1000.);
435 FCCLables[i] =
new TGLabel(fcalColorCodes, (
const char*)str1);
436 FCCLables[i]->SetBackgroundColor(FCccodes[i]);
437 fcalColorCodes->AddFrame(FCCLables[i],lhints);
441 TGGroupFrame *trackinfo =
new TGGroupFrame(botframe,
"Track Info", kHorizontalFrame);
442 botframe->AddFrame(trackinfo, xhints);
445 throwninfo =
new TGGroupFrame(trackinfo,
"Thrown", kHorizontalFrame);
446 reconinfo =
new TGGroupFrame(trackinfo,
"Reconstructed", kHorizontalFrame);
451 vector<string> colnames;
452 colnames.push_back(
"trk");
453 colnames.push_back(
"type");
454 colnames.push_back(
"p");
455 colnames.push_back(
"theta");
456 colnames.push_back(
"phi");
457 colnames.push_back(
"z");
458 colnames.push_back(
"chisq/Ndof");
459 colnames.push_back(
"Ndof");
460 colnames.push_back(
"FOM");
461 colnames.push_back(
"cand");
464 for(
unsigned int i=0; i<colnames.size(); i++){
466 TGVerticalFrame *tf =
new TGVerticalFrame(
throwninfo);
467 TGVerticalFrame *rf =
new TGVerticalFrame(
reconinfo);
472 string lab = colnames[i]+
":";
473 TGLabel *tl =
new TGLabel(tf, lab.c_str());
474 TGLabel *rl =
new TGLabel(rf, lab.c_str());
475 if(i<6)tf->AddFrame(tl, chints);
476 rf->AddFrame(rl, chints);
485 for(
int j=0; j<14; j++){
488 if(i<6)tl =
new TGLabel(tf, i==0 ? ss.str().c_str():
"--------");
489 rl =
new TGLabel(rf, i==0 ? ss.str().c_str():
"--------");
490 if(i<6)tf->AddFrame(tl, bhints);
491 rf->AddFrame(rl, bhints);
502 TGVerticalFrame *vf =
new TGVerticalFrame(
reconinfo);
504 reconfactory =
new TGComboBox(vf,
"DTrackCandidate:", 0);
509 TGTextButton *listall =
new TGTextButton(vf,
"Full List");
510 vf->AddFrame(listall,
new TGLayoutHints(kLHintsBottom|kLHintsExpandX, 2,2,2,2));
524 xy->SetState(kButtonDown,kTRUE);
534 zoomin->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoZoomIn()");
535 zoomout->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoZoomOut()");
536 reset->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoReset()");
538 coordinates->Connect(
"Clicked(Int_t)",
"hdv_mainframe",
this,
"DoSetCoordinates(Int_t)");
539 coordinates->Connect(
"Clicked(Int_t)",
"hdv_mainframe",
this,
"DoMyRedraw()");
541 quit->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoQuit()");
542 this->Connect(
"CloseWindow()",
"hdv_mainframe",
this,
"DoQuit()");
543 this->DontCallClose();
544 next->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoNext()");
545 prev->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoPrev()");
546 checkbuttons[
"continuous"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoCont()");
547 delay->Connect(
"Selected(Int_t)",
"hdv_mainframe",
this,
"DoSetDelay(Int_t)");
549 trackinspector->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoOpenTrackInspector()");
550 moreOptions->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoOpenOptionsWindow()");
551 listall->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoOpenFullListWindow()");
552 debuger->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoOpenDebugerWindow()");
553 bcaldisp->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoBcalDispFrame()");
558 checkbuttons[
"candidates"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
559 checkbuttons[
"wiretracks"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
560 checkbuttons[
"timetracks"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
561 checkbuttons[
"chargedtracks"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
562 checkbuttons[
"neutrals"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
563 checkbuttons[
"thrown"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
565 checkbuttons[
"cdc"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
566 checkbuttons[
"cdcdrift"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
567 checkbuttons[
"cdctruth"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
568 checkbuttons[
"fdcwire"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
569 checkbuttons[
"fdcpseudo"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
570 checkbuttons[
"fdctruth"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
571 checkbuttons[
"tof"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
572 checkbuttons[
"toftruth"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
573 checkbuttons[
"bcal"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
574 checkbuttons[
"bcaltruth"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
575 checkbuttons[
"fcal"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
576 checkbuttons[
"fcaltruth"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
577 checkbuttons[
"ccal"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
578 checkbuttons[
"trajectories"]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
583 checkbuttons[str1]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
589 checkbuttons[str1]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
595 checkbuttons[str1]->Connect(
"Clicked()",
"hdv_mainframe",
this,
"DoMyRedraw()");
598 candidatesfactory->Connect(
"Selected(Int_t)",
"hdv_mainframe",
this,
"DoMyRedraw()");
599 wiretracksfactory->Connect(
"Selected(Int_t)",
"hdv_mainframe",
this,
"DoMyRedraw()");
600 timetracksfactory->Connect(
"Selected(Int_t)",
"hdv_mainframe",
this,
"DoMyRedraw()");
602 reconfactory->Connect(
"Selected(Int_t)",
"hdv_mainframe",
this,
"DoUpdateTrackLabels()");
604 endviewA->GetCanvas()->Connect(
"Selected(TVirtualPad*, TObject*, Int_t)",
"hdv_mainframe",
this,
"DoEndViewAEvent(TVirtualPad*, TObject*, Int_t)");
605 endviewB->GetCanvas()->Connect(
"Selected(TVirtualPad*, TObject*, Int_t)",
"hdv_mainframe",
this,
"DoEndViewBEvent(TVirtualPad*, TObject*, Int_t)");
609 timer =
new TTimer();
610 timer->Connect(
"Timeout()",
"hdv_mainframe",
this,
"DoTimer()");
615 SetWindowName(
"Hall-D Event Viewer");
616 SetIconName(
"HDView");
618 Resize(GetDefaultSize());
622 viewcontrols->Resize();
624 eventcontrols->Resize();
625 inspectors->Resize();
634 const char *home = getenv(
"HOME");
638 string fname =
string(home) +
"/.hdview2";
639 ifstream ifs(fname.c_str());
640 if(!ifs.is_open())
return;
641 cout<<
"Reading preferences from \""<<fname<<
"\" ..."<<endl;
646 ifs.getline(line, 1024);
647 if(strlen(line)==0)
continue;
648 if(line[0] ==
'#')
continue;
652 vector<string> tokens;
654 stringstream ss(str);
655 while (ss >> buf)tokens.push_back(buf);
656 if(tokens.size()<1)
continue;
659 if(tokens[0] ==
"checkbutton"){
660 if(tokens.size()!=4)
continue;
661 map<string, TGCheckButton*>::iterator it =
checkbuttons.find(tokens[1]);
663 if(tokens[3] ==
"on")(it->second)->SetState(kButtonDown);
667 if(tokens[0] ==
"DTrackCandidate"){
668 if(tokens.size()!=3)
continue;
672 if(tokens[0] ==
"DTrackWireBased"){
673 if(tokens.size()!=3)
continue;
677 if(tokens[0] ==
"DTrackTimeBased"){
678 if(tokens.size()!=3)
continue;
682 if(tokens[0] ==
"Reconstructed"){
683 if(tokens.size()!=3)
continue;
699 const char *home = getenv(
"HOME");
703 string fname =
string(home) +
"/.hdview2";
704 unlink(fname.c_str());
705 ofstream ofs(fname.c_str());
707 cout<<
"Unable to create preferences file \""<<fname<<
"\"!"<<endl;
712 time_t t = time(NULL);
713 ofs<<
"##### hdview2 preferences file ###"<<endl;
714 ofs<<
"##### Auto-generated on "<<ctime(&t)<<endl;
718 map<string, TGCheckButton*>::iterator iter;
720 TGCheckButton *but = iter->second;
721 if(but->GetState() == kButtonDown){
722 ofs<<
"checkbutton "<<(iter->first)<<
" = on"<<endl;
730 ofs<<
"Reconstructed = "<<(
reconfactory->GetTextEntry()->GetText())<<endl;
734 cout<<
"Preferences written to \""<<fname<<
"\""<<endl;
752 double y_width = x_width;
753 double z_width = 2.70*x_width;
754 double xlo =
x0 - x_width/2.0;
755 double xhi =
x0 + x_width/2.0;
756 double ylo =
y0 - y_width/2.0;
757 double yhi =
y0 + y_width/2.0;
758 double zlo =
z0 - z_width*0.40;
759 double zhi =
z0 + z_width*0.60;
762 sideviewA->GetCanvas()->Range(zlo, xlo, zhi, xhi);
764 sideviewB->GetCanvas()->Range(zlo, ylo, zhi, yhi);
767 double end_to_side_ratio=1.8;
768 xlo/=end_to_side_ratio;
769 xhi/=end_to_side_ratio;
770 ylo/=end_to_side_ratio;
771 yhi/=end_to_side_ratio;
774 endviewA->GetCanvas()->Range(xlo, ylo, xhi, yhi);
776 endviewB->GetCanvas()->Range(xlo*1.3, ylo*1.3, xhi*1.3, yhi*1.3);
787 double rlo =
r0 - r_width/2.0;
788 double rhi =
r0 + r_width/2.0;
789 double zlo =
z0 - z_width/2.0;
790 double zhi =
z0 + z_width/2.0;
792 double phihi = 2.0*M_PI+0.2;
795 sideviewA->GetCanvas()->Range(zlo, rlo, zhi, rhi);
797 sideviewB->GetCanvas()->Range(zlo, philo, zhi, phihi);
801 endviewA->GetCanvas()->Range(philo, rlo/2.5, phihi, rhi/2.5);
803 endviewB->GetCanvas()->Range(philo, rlo/10.0, phihi, rhi/1.9);
823 gApplication->Terminate(0);
835 vector<const DEPICSvalue*> epicsvalues;
837 if(epicsvalues.empty())
break;
838 cout <<
"Skipping EPICS event " <<
eventloop->GetJEvent().GetEventNumber() << endl;
895 next->Connect(
"Clicked()",
"trk_mainframe",
trkmf,
"DoNewEvent()");
896 prev->Connect(
"Clicked()",
"trk_mainframe",
trkmf,
"DoNewEvent()");
899 trkmf->RaiseWindow();
900 trkmf->RequestFocus();
937 bcaldispmf =
new TCanvas(
"BCALHitCanvas",
"BCAL Hit Distribution", 900, 900);
1194 vector<MyProcessor::DGraphicSet>::iterator iter =
gMYPROC->
graphics.begin();
1199 TPolyMarker *sA =
new TPolyMarker();
1200 TPolyMarker *sB =
new TPolyMarker();
1201 TPolyMarker *eA =
new TPolyMarker();
1202 sA->SetMarkerColor(iter->color);
1203 sB->SetMarkerColor(iter->color);
1204 eA->SetMarkerColor(iter->color);
1205 sA->SetMarkerSize(iter->size);
1206 sB->SetMarkerSize(iter->size);
1207 eA->SetMarkerSize(iter->size);
1208 sA->SetMarkerStyle(iter->marker_style);
1209 sB->SetMarkerStyle(iter->marker_style);
1210 eA->SetMarkerStyle(iter->marker_style);
1211 FillPoly(sA, sB, eA, iter->points);
1214 TPolyLine *sA =
new TPolyLine();
1215 TPolyLine *sB =
new TPolyLine();
1216 TPolyLine *eA =
new TPolyLine();
1217 sA->SetLineColor(iter->color);
1218 sB->SetLineColor(iter->color);
1219 eA->SetLineColor(iter->color);
1220 sA->SetLineWidth((Width_t)iter->size);
1221 sB->SetLineWidth((Width_t)iter->size);
1222 eA->SetLineWidth((Width_t)iter->size);
1223 sA->SetFillStyle(0);
1224 sB->SetFillStyle(0);
1225 eA->SetFillStyle(0);
1226 FillPoly(sA, sB, eA, iter->points);
1231 double *
x = eA->GetX();
1232 double *
y = eA->GetY();
1233 if(fabs(x[0]-x[1])<0.1 && fabs(y[0]==y[1])<0.1){
1234 TMarker *m =
new TMarker(x[0], y[0], 8);
1235 m->SetMarkerColor(iter->color);
1236 m->SetMarkerSize(0.5);
1257 if(l && l->GetFillStyle()!=0){
1289 ss<<
delay->GetSelectedEntry()->GetTitle();
1329 target->SetFillColor(13);
1336 bcal1->SetFillColor(28);
1337 bcal2->SetFillColor(28);
1344 cdc1->SetFillColor(17);
1345 cdc2->SetFillColor(17);
1350 for(
int i=0; i<4; i++){
1352 float zu =
fdcwires[i*6][0]->origin.z();
1353 float zd =
fdcwires[i*6+5][0]->origin.z();
1356 fdc1->SetFillColor(21);
1357 fdc2->SetFillColor(21);
1365 tof1->SetFillColor(11);
1366 tof2->SetFillColor(11);
1373 fcal1->SetFillColor(40);
1374 fcal2->SetFillColor(40);
1381 ccal1->SetFillColor(42);
1382 ccal2->SetFillColor(42);
1409 bcal1->SetFillColor(0);
1410 bcal2->SetFillColor(0);
1416 double dmodule = (double)TMath::TwoPi()/(double)
BCAL_MODS;
1417 double dsector1 = dmodule/(double)
BCAL_SECS1;
1418 double dsector2 = dmodule/(double)
BCAL_SECS2;
1422 for(
int imod=0; imod<
BCAL_MODS; imod++){
1423 double mod_phi = (double)imod*dmodule -2.0*dsector1 +
BCAL_PHI_SHIFT;
1426 r_min+=dlayer1*ilay;
1427 double r_max = r_min+(ilay+1)*dlayer1;
1429 double phimin = mod_phi + (double)isec*dsector1;
1430 double phimax = phimin + dsector1;
1433 x[0] = r_min*cos(phimin);
1434 y[0] = r_min*
sin(phimin);
1435 x[1] = r_max*cos(phimin);
1436 y[1] = r_max*
sin(phimin);
1437 x[2] = r_max*cos(phimax);
1438 y[2] = r_max*
sin(phimax);
1439 x[3] = r_min*cos(phimax);
1440 y[3] = r_min*
sin(phimax);
1442 TPolyLine *poly =
new TPolyLine(4, x, y);
1443 poly->SetLineColor(12);
1444 poly->SetLineWidth(0);
1445 poly->SetFillColor(0);
1446 poly->SetFillStyle(0);
1447 int chan = (imod+1)*1000 + (ilay+1)*100 + (isec+1)*10;
1453 double phimin = mod_phi + (double)isec*dsector2;
1454 double phimax = phimin + dsector2;
1467 TPolyLine *poly =
new TPolyLine(5, x, y);
1468 poly->SetLineColor(12);
1469 poly->SetLineWidth(1);
1470 poly->SetFillColor(0);
1471 poly->SetFillStyle(0);
1472 int chan = (int)((imod+1)*1000 + (ilay+1+
BCAL_LAYS1)*100 + (isec+1)*10);
1480 for(
int imod=0; imod<
BCAL_MODS; imod++){
1482 double mod_phi = (double)imod*dmodule -2.0*dsector1 +
BCAL_PHI_SHIFT;
1486 double phi = mod_phi + (double)isec*dsector1;
1488 TLine *l =
new TLine(rmin*cos(phi), rmin*
sin(phi), rmax*cos(phi), rmax*
sin(phi));
1489 l->SetLineColor(isec==0 ? kBlack:12);
1490 l->SetLineWidth((Width_t)(isec==0 ? 2.5:1.0));
1496 double phi = mod_phi + (double)isec*dsector2;
1498 TLine *l =
new TLine(rmin*cos(phi), rmin*
sin(phi), rmax*cos(phi), rmax*
sin(phi));
1499 l->SetLineColor(isec==0 ? kBlack:12);
1500 l->SetLineWidth((Width_t)(isec==0 ? 2.5:1.0));
1508 TLine *l =
new TLine(r*cos(mod_phi), r*
sin(mod_phi), r*cos(mod_phi+dmodule), r*
sin(mod_phi+dmodule));
1509 l->SetLineColor(ilay==0 ? kBlack:12);
1510 l->SetLineWidth((Width_t)(ilay==0 ? 1.0:1.0));
1515 l->SetLineColor(12);
1516 l->SetLineWidth((Width_t)(1.0));
1523 cdc1->SetFillColor(17);
1524 cdc1->SetLineColor(17);
1525 cdc2->SetFillColor(10);
1532 fdc1->SetFillColor(21);
1533 fdc1->SetLineColor(21);
1534 fdc2->SetFillColor(10);
1535 fdc2->SetLineColor(10);
1556 Double_t inner_radius = 7.7493;
1557 Double_t outer_radius = 8.0493;
1558 Double_t bottom_width = 1.6289;
1559 Double_t top_width = 1.692;
1560 Double_t dtr = 1.745329252e-02;
1563 Double_t x_coords[31][5];
1564 Double_t y_coords[31][5];
1567 x_coords[0][0] = -outer_radius;
1568 x_coords[0][1] = -(outer_radius - top_width*
sin(6.0*dtr));
1569 x_coords[0][2] = -(inner_radius - bottom_width*
sin(6.0*dtr));
1570 x_coords[0][3] = -inner_radius;
1571 x_coords[0][4] = -outer_radius;
1573 y_coords[0][0] = 0.0;
1574 y_coords[0][1] = top_width*cos(6.0*dtr);
1575 y_coords[0][2] = bottom_width*cos(6.0*dtr);
1576 y_coords[0][3] = 0.0;
1577 y_coords[0][4] = 0.0;
1580 TPolyLine *ch_pline[30];
1583 for (
int i = 1; i < 31; i++)
1586 x_coords[i][0] = x_coords[i-1][1];
1587 x_coords[i][1] = x_coords[i-1][1] + top_width*
sin((6.0 + 12.0*i)*dtr);
1588 x_coords[i][2] = x_coords[i-1][2] + bottom_width*
sin((6.0 + 12.0*i)*dtr);
1589 x_coords[i][3] = x_coords[i-1][2];
1590 x_coords[i][4] = x_coords[i-1][1];
1592 y_coords[i][0] = y_coords[i-1][1];
1593 y_coords[i][1] = y_coords[i-1][1] + top_width*cos((6.0 + 12.0*i)*dtr);
1594 y_coords[i][2] = y_coords[i-1][2] + bottom_width*cos((6.0 + 12.0*i)*dtr);
1595 y_coords[i][3] = y_coords[i-1][2];
1596 y_coords[i][4] = y_coords[i-1][1];
1599 Double_t
x[5] = {x_coords[i-1][0], x_coords[i-1][1], x_coords[i-1][2], x_coords[i-1][3], x_coords[i-1][4]};
1600 Double_t
y[5] = {y_coords[i-1][0], y_coords[i-1][1], y_coords[i-1][2], y_coords[i-1][3], y_coords[i-1][4]};
1601 ch_pline[i-1] =
new TPolyLine(5, x, y);
1602 ch_pline[i-1]->SetFillColor(18);
1603 ch_pline[i-1]->SetLineColor(1);
1604 ch_pline[i-1]->SetLineWidth(2);
1609 TEllipse *target =
new TEllipse(0.0, 0.0, 0.5, 0.5);
1610 target->SetFillColor(13);
1630 shift[0].Set(-blocksize/2, -blocksize/2);
1631 shift[1].Set(-blocksize/2, +blocksize/2);
1632 shift[2].Set(+blocksize/2, +blocksize/2);
1633 shift[3].Set(+blocksize/2, -blocksize/2);
1642 for(
int i=0; i<4; i++){
1650 TPolyLine *poly =
new TPolyLine(5, x, y);
1651 poly->SetFillColor(0);
1652 poly->SetLineColor(kBlack);
1666 shift[0].Set(-blocksize/2, -blocksize/2);
1667 shift[1].Set(-blocksize/2, +blocksize/2);
1668 shift[2].Set(+blocksize/2, +blocksize/2);
1669 shift[3].Set(+blocksize/2, -blocksize/2);
1673 for(
int irow=0; irow<12; irow++){
1674 for(
int icol=0; icol<12; icol++){
1675 if( (irow==5 || irow==6) && (icol==5 || icol==6) )
continue;
1677 double center_x = (-6.0 + (icol+0.5))*2.0;
1678 double center_y = (-6.0 + (irow+0.5))*2.0;
1682 for(
int i=0; i<4; i++){
1690 TPolyLine *poly =
new TPolyLine(5, x, y);
1691 poly->SetFillColor(0);
1692 poly->SetLineColor(kBlack);
1695 int channel = icol + 12*(irow);
1702 double x[5] = {-6.0, -6.0, 6.0, 6.0, -6.0};
1703 double y[5] = {-6.0, 6.0, 6.0,-6.0, -6.0};
1704 TPolyLine *poly =
new TPolyLine(5, x, y);
1705 poly->SetFillColor(0);
1706 poly->SetLineColor(kBlack);
1707 poly->SetLineWidth(3);
1708 poly->SetLineStyle(2);
1717 TPolyLine *pmtPline[4][44] = {{ NULL }, { NULL }};
1720 Double_t pmtX[4][44][5];
1721 Double_t pmtY[4][44][5];
1727 Double_t position_x[4] = {-126,-126,-126,126};
1728 Double_t position_y[4] = {-126,-126,126,-126};
1731 Double_t step_x[4][5] = {{0,0,6,6,0},{0,-14,-14,0,0},{0,0,6,6,0},{0,14,14,0,0}};
1732 Double_t step_y[4][5] = {{0,-14,-14,0,0},{0,0,6,6,0},{0,14,14,0,0},{0,0,6,6,0}};
1733 Double_t step_xl[4][5] = {{0,0,3,3,0},{0,-20,-20,0,0},{0,0,3,3,0},{0,20,20,0,0}};
1734 Double_t step_yl[4][5] = {{0,-20,-20,0,0},{0,0,3,3,0},{0,20,20,0,0},{0,0,3,3,0}};
1735 Double_t step_X[4] = {6,0,6,0};
1736 Double_t step_Y[4] = {0,6,0,6};
1737 Double_t step_XL[4] = {3,0,3,0};
1738 Double_t step_YL[4] = {0,3,0,3};
1741 for (
int sd=0; sd<4; sd++)
1743 for (
int i=0; i<44; i++)
1745 for (
int l=0; l<5; l++)
1750 if (i == 19 || i == 20 || i == 23 || i == 24){
1751 pmtX[sd][i][l]=position_x[sd] + step_xl[sd][l];
1752 pmtY[sd][i][l]=position_y[sd] + step_yl[sd][l];
1755 pmtX[sd][i][l]=position_x[sd] + step_x[sd][l];
1756 pmtY[sd][i][l]=position_y[sd] + step_y[sd][l];
1760 if (i == 19 || i == 20 || i == 23 || i == 24){
1761 pmtX[sd][i][l]=position_x[sd] + step_xl[sd][l];
1762 pmtY[sd][i][l]=position_y[sd] + step_yl[sd][l];
1765 pmtX[sd][i][l]=position_x[sd] + step_x[sd][l];
1766 pmtY[sd][i][l]=position_y[sd] + step_y[sd][l];
1770 if (i == 19 || i == 20 || i == 23 || i == 24){
1771 pmtX[sd][i][l]=position_x[sd] + step_xl[sd][l];
1772 pmtY[sd][i][l]=position_y[sd] + step_yl[sd][l];
1775 pmtX[sd][i][l]=position_x[sd] + step_x[sd][l];
1776 pmtY[sd][i][l]=position_y[sd] + step_y[sd][l];
1780 if (i == 19 || i == 20 || i == 23 || i == 24){
1781 pmtX[sd][i][l]=position_x[sd] + step_xl[sd][l];
1782 pmtY[sd][i][l]=position_y[sd] + step_yl[sd][l];
1785 pmtX[sd][i][l]=position_x[sd] + step_x[sd][l];
1786 pmtY[sd][i][l]=position_y[sd] + step_y[sd][l];
1790 if (i == 19 || i == 20 || i == 23 || i == 24){
1791 pmtX[sd][i][l]=position_x[sd] + step_xl[sd][l];
1792 pmtY[sd][i][l]=position_y[sd] + step_yl[sd][l];
1795 pmtX[sd][i][l]=position_x[sd] + step_x[sd][l];
1796 pmtY[sd][i][l]=position_y[sd] + step_y[sd][l];
1801 if ( i == 19 || i == 20 || i == 23 || i == 24){
1802 position_x[sd] = position_x[sd] + step_XL[sd];
1803 position_y[sd] = position_y[sd] + step_YL[sd];
1806 position_x[sd] = position_x[sd] + step_X[sd];
1807 position_y[sd] = position_y[sd] + step_Y[sd];
1812 for (
int sd=0; sd<4; sd++)
1814 for (
int j=0; j<44; j++)
1816 for (
int q=0; q<5; q++)
1818 x[q] = pmtX[sd][j][q];
1819 y[q] = pmtY[sd][j][q];
1821 pmtPline[sd][j] =
new TPolyLine(5,x,y);
1826 for (
int sd=0; sd<4; sd++)
1828 for (
int j=0; j<44; j++)
1830 pmtPline[sd][j]->SetFillColor(1);
1831 pmtPline[sd][j]->SetLineColor(41);
1832 pmtPline[sd][j]->SetLineWidth(2);
1835 tofblocks[sd][tof_count] = pmtPline[sd][j];
1873 target->SetFillColor(13);
1878 bcal1->SetFillColor(28);
1883 cdc1->SetFillColor(17);
1887 for(
int i=0; i<4; i++){
1889 float zu =
fdcwires[i*6][0]->origin.z();
1890 float zd =
fdcwires[i*6+5][0]->origin.z();
1892 fdc1->SetFillColor(21);
1898 tof1->SetFillColor(11);
1903 fcal1->SetFillColor(40);
1917 target->SetFillColor(13);
1922 bcal1->SetFillColor(28);
1927 cdc1->SetFillColor(17);
1931 for(
int i=0; i<4; i++){
1933 float zu =
fdcwires[i*6][0]->origin.z();
1934 float zd =
fdcwires[i*6+5][0]->origin.z();
1936 TBox *fdc1 =
new TBox(zu, 0.0, zd, 2.0*M_PI);
1937 fdc1->SetFillColor(21);
1943 tof1->SetFillColor(11);
1948 fcal1->SetFillColor(40);
1962 bcal1->SetFillColor(28);
1967 cdc1->SetFillColor(17);
1972 fdc1->SetFillColor(21);
1976 TBox *target =
new TBox(0.0, 0.0, 2.0*M_PI, 0.5);
1977 target->SetFillColor(13);
1995 shift[0].Set(-blocksize/2, -blocksize/2);
1996 shift[1].Set(-blocksize/2, +blocksize/2);
1997 shift[2].Set(+blocksize/2, +blocksize/2);
1998 shift[3].Set(+blocksize/2, -blocksize/2);
2004 double r[4], phi[4];
2005 for(
int i=0; i<4; i++){
2008 phi[i] = pos.Phi_0_2pi(pos.Phi());
2011 TPolyLine *poly =
new TPolyLine(4, phi, r);
2012 poly->SetFillColor(18);
2013 poly->SetLineColor(kBlack);
2034 double x1 = c->GetX1();
2035 double x2 = c->GetX2();
2036 double y1 = c->GetY1();
2037 double y2 = c->GetY2();
2038 double deltax = x2-x1;
2039 deltax *= c->GetYsizeReal()/c->GetXsizeReal();
2040 double deltay = y2-y1;
2041 double xlo = x1+0.04*deltax;
2042 double xhi = xlo + 0.075*deltax;
2043 double ylo = y1+0.04*deltay;
2044 double yhi = ylo + 0.075*deltay;
2045 TArrow *yarrow =
new TArrow(xlo, ylo, xlo, yhi, 0.02,
">");
2046 yarrow->SetLineWidth((Width_t)1.5);
2047 graphics.push_back(yarrow);
2049 TLatex *ylabel =
new TLatex(xlo, yhi+0.005*deltay, ylab);
2050 ylabel->SetTextAlign(21);
2051 graphics.push_back(ylabel);
2053 TArrow *xarrow =
new TArrow(xlo, ylo, xhi, ylo, 0.02,
">");
2054 xarrow->SetLineWidth((Width_t)1.5);
2055 graphics.push_back(xarrow);
2057 TLatex *xlabel =
new TLatex(xhi+0.005*deltax, ylo, xlab);
2058 xlabel->SetTextAlign(12);
2059 graphics.push_back(xlabel);
2069 double x1 = c->GetX1();
2070 double x2 = c->GetX2();
2071 double y1 = c->GetY1();
2072 double y2 = c->GetY2();
2073 double deltax = x2-x1;
2074 double deltay = y2-y1;
2075 double p = floor(log(0.1*deltax)/log(10.0));
2076 double m = floor(0.1*deltax/pow(10.0, p) + 0.5);
2077 double xlo = x1+0.72*deltax;
2078 double xhi = xlo + m*pow(10.0, p);
2079 double y = y1+0.04*deltay;
2080 TArrow *arrow =
new TArrow(xlo, y, xhi, y, 0.02,
"|-|");
2081 arrow->SetLineWidth((Width_t)1.0);
2082 graphics.push_back(arrow);
2084 const char *units=
"<out of range>";
2130 sprintf(str,
"%d %s", (
int)m, units);
2131 TLatex *label =
new TLatex(xhi+0.01*deltax, y, str);
2132 label->SetTextAlign(12);
2133 graphics.push_back(label);
2144 double x1 = c->GetX1();
2145 double x2 = c->GetX2();
2146 double y1 = c->GetY1();
2147 double y2 = c->GetY2();
2148 double deltax = x2-x1;
2149 double deltay = y2-y1;
2150 deltax *= c->GetYsizeReal()/c->GetXsizeReal();
2151 double x = x1 + 0.005*deltax;
2152 double y = y2 - 0.003*deltay;
2154 TLatex *label =
new TLatex(x, y, txt);
2155 label->SetTextAlign(13);
2156 label->SetTextSize(0.045);
2157 graphics.push_back(label);
2170 event->SetTitle(ss.str().c_str());
2183 run->SetTitle(ss.str().c_str());
2194 trig->SetTitle(trigstring);
2204 this->source->SetTitle(source.c_str());
2205 this->source->Draw();
2222 for(
unsigned int i=0; i< facnames.size(); i++){
2223 string name =
"DTrackCandidate:";
2224 string::size_type pos = facnames[i].find(name);
2225 if(pos==string::npos)
continue;
2226 string tag = facnames[i];
2227 tag.erase(0, name.size());
2251 for(
unsigned int i=0; i< facnames.size(); i++){
2252 string name =
"DTrackWireBased:";
2253 string::size_type pos = facnames[i].find(name);
2254 if(pos==string::npos)
continue;
2255 string tag = facnames[i];
2256 tag.erase(0, name.size());
2280 for(
unsigned int i=0; i< facnames.size(); i++){
2281 string name =
"DTrackTimeBased:";
2282 string::size_type pos = facnames[i].find(name);
2283 if(pos==string::npos)
continue;
2284 string tag = facnames[i];
2285 tag.erase(0, name.size());
2309 for(
unsigned int i=0; i< facnames.size(); i++){
2310 string name =
"DChargedTrack:";
2311 string::size_type pos = facnames[i].find(name);
2312 if(pos==string::npos)
continue;
2313 string tag = facnames[i];
2314 tag.erase(0, name.size());
2339 reconfactory->GetTextEntry()->SetText(
"DTrackTimeBased:");
2342 for(
unsigned int i=0; i< facnames.size(); i++){
2343 string name =
"DTrackTimeBased:";
2344 string::size_type pos = facnames[i].find(name);
2345 if(pos==string::npos)
continue;
2346 string tag = facnames[i].substr(name.size(), facnames[i].size()-name.size());
2350 reconfactory->GetTextEntry()->SetText(facnames[i].c_str());
2356 for(
unsigned int i=0; i< facnames.size(); i++){
2357 string name =
"DTrackWireBased:";
2358 string::size_type pos = facnames[i].find(name);
2359 if(pos==string::npos)
continue;
2360 string tag = facnames[i].substr(name.size(), facnames[i].size()-name.size());
2364 reconfactory->GetTextEntry()->SetText(facnames[i].c_str());
2370 for(
unsigned int i=0; i< facnames.size(); i++){
2371 string name =
"DTrackCandidate:";
2372 string::size_type pos = facnames[i].find(name);
2373 if(pos==string::npos)
continue;
2374 string tag = facnames[i].substr(name.size(), facnames[i].size()-name.size());
2378 reconfactory->GetTextEntry()->SetText(facnames[i].c_str());
2385 for(
unsigned int i=0; i< facnames.size(); i++){
2386 string name =
"DNeutralParticle:";
2387 string::size_type pos = facnames[i].find(name);
2388 if(pos==string::npos)
continue;
2389 string tag = facnames[i].substr(name.size(), facnames[i].size()-name.size());
2393 reconfactory->GetTextEntry()->SetText(facnames[i].c_str());
2399 for(
unsigned int i=0; i< facnames.size(); i++){
2400 string name =
"DChargedTrack:";
2401 string::size_type pos = facnames[i].find(name);
2402 if(pos==string::npos)
continue;
2403 string tag = facnames[i].substr(name.size(), facnames[i].size()-name.size());
2407 reconfactory->GetTextEntry()->SetText(facnames[i].c_str());
2419 map<string, TGCheckButton*>::iterator iter =
checkbuttons.find(who);
2421 return iter->second->GetState()==kButtonDown;
2428 this->checkbuttons.insert(checkbuttons.begin(), checkbuttons.end());
2436 const char *tag =
"";
2438 if(who==
"DTrackWireBased"){
2442 if(who==
"DTrackCandidate"){
2446 if(who==
"DTrackTimeBased"){
2450 if (who==
"DChargedTrack"){
2453 if(
string(tag) ==
"<default>")tag =
"";
2465 if(!
reconfactory->GetSelectedEntry()->GetTitle())
return;
2466 string nametag(
reconfactory->GetSelectedEntry()->GetTitle());
2467 string::size_type pos = nametag.find(
":");
2468 name = nametag.substr(0, pos);
2469 tag = nametag.substr(pos+1, nametag.size()-(pos+1));
2477 map<int, TPolyLine*>::iterator iter =
fcalblocks.find(channel);
2479 return iter->second;
2498 int channel = col + 12*(row);
2499 map<int, TPolyLine*>::iterator iter =
ccalblocks.find(channel);
2501 return iter->second;
2510 map <int, map<int, TPolyLine*> >::iterator iter;
2512 map <int, TPolyLine*>::iterator iter2 = iter->second.find(tof_ch);
2513 if(iter2==iter->second.end())
return NULL;
2514 return iter2->second;
2522 int chan = module*1000 + layer*100 + sector*10;
2523 map<int, TPolyLine*>::iterator iter =
bcalblocks.find(chan);
2525 _DBG_<<
"ERROR: No BCAL readout segment display poly for module="<<module<<
" layer="<<layer<<
" sector="<<sector<<endl;
2528 return iter->second;
2536 for(
unsigned int i=0; i<v.size(); i++)
graphics_sideA.push_back(v[i]);
2544 for(
unsigned int i=0; i<v.size(); i++)
graphics_sideB.push_back(v[i]);
2552 for(
unsigned int i=0; i<v.size(); i++)
graphics_endA.push_back(v[i]);
2560 for(
unsigned int i=0; i<v.size(); i++)
graphics_endB.push_back(v[i]);
TRootEmbeddedCanvas * sideviewA
void SetReconstructedFactories(vector< string > &facnames)
void DoEndViewBEvent(TVirtualPad *pad, TObject *obj, Int_t event)
void DrawLabel(TCanvas *c, vector< TObject * > &graphics, const char *txt)
void DrawAxes(TCanvas *c, vector< TObject * > &graphics, const char *xlab, const char *ylab)
void DoOpenOptionsWindow(void)
void UpdateBcalDisp(void)
hdv_fulllistframe * fulllistmf
void DoUpdateTrackLabels(void)
TGComboBox * chargedtracksfactory
void SetTrig(char *trigstring)
void DoOpenFCALInspector(void)
bool GetCheckButton(string who)
map< string, TGCheckButton * > checkbuttons
vector< TObject * > graphics_tof_hits
void DoClearBCALInspectorPointer(void)
static DTOFGeometry * tofgeom
void DrawDetectorsXY(void)
void DoOpenFullListWindow(void)
sprintf(text,"Post KinFit Cut")
void AddGraphicsSideA(vector< TObject * > &v)
TPolyLine * GetCCALPolyLine(int row, int col)
vector< TObject * > graphics_xz
static vector< vector< DFDCWire * > > fdcwires
void DoSetCoordinates(Int_t)
void SetEvent(ULong64_t id)
void FillPoly(T *sA, T *sB, T *eA, vector< TVector3 > &v)
map< int, TPolyLine * > bcalblocks
map< int, TPolyLine * > fcalblocks
vector< TObject * > graphics_endA
vector< DGraphicSet > graphics
void DoOpenBCALInspector(void)
void SetTimeBasedTrackFactories(vector< string > &facnames)
void UpdateTrackLabels(void)
void DoClearTOFInspectorPointer(void)
void SetRange(double xlo, double ylo, double xhi, double yhi)
void DoClearFCALInspectorPointer(void)
DVector2 positionOnFace(int row, int column) const
hdv_debugerframe * debugermf
void DrawObjects(vector< TObject * > &graphics_endA)
map< string, vector< TGLabel * > > reconlabs
void AddGraphicsEndA(vector< TObject * > &v)
void AddGraphicsEndB(vector< TObject * > &v)
map< int, map< int, TPolyLine * > > tofblocks
TRootEmbeddedCanvas * endviewB
map< int, TPolyLine * > ccalblocks
hdv_endviewBframe * endviewBmf
void DoOpenDebugerWindow(void)
TPolyLine * GetBCALPolyLine(int mod, int layer, int sector)
string default_reconstructed
void DoOpenTrackInspector(void)
void DrawObjects(vector< TObject * > &graphics_endB)
static double blockSize()
TPolyLine * GetFCALPolyLine(int channel)
TGComboBox * reconfactory
static evioFileChannel * chan
static float BCAL_PHI_SHIFT
void DoOpenTOFInspector(void)
DGeometry * GetDGeometry(unsigned int run_number)
void DoClearOptionsWindowPointer(void)
void SetRange(double xlo, double ylo, double xhi, double yhi)
vector< TObject * > graphics_sideA
void SetChargedTrackFactories(vector< string > &facnames)
vector< TObject * > graphics_endB
void GetReconFactory(string &name, string &tag)
vector< TObject * > graphics_yz
void DoClearTrackInspectorPointer(void)
map< string, vector< TGLabel * > > thrownlabs
int column(int channel) const
void ReadPreferences(void)
vector< TObject * > graphics_xyB
bool GetBCALPhiShift(float &bcal_phi_shift) const
phi angle in degrees that first BCAL module is shifted from being centered at ph=0.0
int channel(int row, int column) const
TGComboBox * candidatesfactory
hdv_optionsframe * optionsmf
void DrawDetectorsRPhi(void)
void DrawScale(TCanvas *c, vector< TObject * > &graphics)
void SavePreferences(void)
vector< TObject * > graphics_sideB
bool GetFDCWires(vector< vector< DFDCWire * > > &fdcwires) const
hdv_mainframe(const TGWindow *p, UInt_t w, UInt_t h)
int row(int channel) const
void DoUpdateBcalDisp(void)
bool GetTargetLength(double &target_length) const
z-location of center of target
void AddGraphicsSideB(vector< TObject * > &v)
coordsys_t coordinatetype
bool isBlockActive(int row, int column) const
void DoEndViewAEvent(TVirtualPad *pad, TObject *obj, Int_t event)
hdv_endviewAframe * endviewAmf
void AddCheckButtons(map< string, TGCheckButton * > &checkbuttons)
void SetSource(string source)
void SetWireBasedTrackFactories(vector< string > &facnames)
TPolyLine * GetTOFPolyLine(int translate_side, int tof_ch)
vector< TObject * > graphics_xyA
TGComboBox * timetracksfactory
TGGroupFrame * throwninfo
locHist_NumHighLevel Draw("COLZ")
void SetCandidateFactories(vector< string > &facnames)
bool GetTargetZ(double &z_target) const
z-location of center of target
const char * GetFactoryTag(string who)
TGComboBox * wiretracksfactory
TRootEmbeddedCanvas * endviewA
TRootEmbeddedCanvas * sideviewB
void DoBcalDispFrame(void)