BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
BesVisDisplay Class Reference

#include <BesVisDisplay.h>

+ Inheritance diagram for BesVisDisplay:

Public Member Functions

 BesVisDisplay ()
 
 BesVisDisplay (const char *title)
 
virtual ~BesVisDisplay ()
 
virtual void SetCanvas (TCanvas *c=0)
 
void SetDisplayMode (Int_t mode)
 
Int_t GetDisplayMode ()
 
Bool_t IsVHeader ()
 
virtual void SwitchDisplayMode (Int_t mode)
 
virtual void ResizePad ()
 
virtual void SwitchPad ()
 
TPad * GetPadXY ()
 
TPad * GetPadZR ()
 
TPad * GetPad3D ()
 
virtual void DrawHeader ()
 
virtual void Reset ()
 
virtual void InitGeometryFromGDML (const TString fPath)
 
virtual void InitGeometryFromROOT (TGeoVolume *bes)
 
BesGeometryGetBesGeometry ()
 
virtual void SetMdcOn (Bool_t MdcOn)
 
Bool_t GetMdcOn ()
 
virtual void SetTofOn (Bool_t TofOn)
 
Bool_t GetTofOn ()
 
virtual void SetEmcOn (Bool_t EmcOn)
 
Bool_t GetEmcOn ()
 
virtual Bool_t AllViews ()
 
virtual void Clear (Option_t *option="")
 
virtual void DisplayTrigger (Int_t trig)
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
void Draw2D (Option_t *option="")
 
void Draw3D (Option_t *option="")
 
void Draw2DXY (Option_t *option="")
 
void Draw2DZR (Option_t *option="")
 
virtual void DrawAllViews ()
 
Bool_t DrawClusters ()
 
Bool_t DrawParticles ()
 
Bool_t DrawParticles2 ()
 
virtual void DrawTitle (Option_t *option="")
 
virtual void DrawView (Float_t theta, Float_t phi)
 
void DrawViewRange (Double_t x0, Double_t y0, Double_t z0, Double_t zoomSize)
 
virtual void DrawViewGL ()
 
virtual void DrawViewX3D ()
 
virtual void DrawViewRaytracer (Float_t theta, Float_t phi, Float_t psi)
 
virtual void DrawViewX3D (char option)
 
void DrawImageSequence (Int_t thetaStart, Int_t thetaStep)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void GetEvent (Long64_t event)
 
TGeoVolume * GetVolBes ()
 
MdcROOTGeoGetMdcROOTGeo ()
 
TofROOTGeoGetTofROOTGeo ()
 
EmcROOTGeoGetEmcROOTGeo ()
 
MucROOTGeoGetMucROOTGeo ()
 
void Init ()
 
TPad * Pad ()
 
virtual void Paint (Option_t *option="")
 
virtual void PaintFruit (TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type, Option_t *option="")
 
virtual void PaintParticles (Option_t *option="")
 
Float_t PTcut ()
 
Float_t PTcutEGMUNU ()
 
Float_t Rin ()
 
Float_t Rout ()
 
virtual void SetDrawClusters (Bool_t draw=kTRUE)
 
virtual void SetDrawParticles (Bool_t draw=kTRUE)
 
virtual void SetPTcut (Float_t ptcut=0.4)
 
virtual void SetPTcutEGMUNU (Float_t ptcut=5)
 
virtual void SetView (Float_t theta, Float_t phi)
 
virtual void ShowNextEvent (Int_t delta=1)
 
void SetMdcCon (Int_t mdcCon)
 
void SetTofCon (Int_t tofCon)
 
void SetEmcCon (Int_t emcCon)
 
void SetMucCon (Int_t mucCon)
 
void SetAllVisible (Int_t vis)
 
void SetQuarterVisible (Int_t vis)
 
void SetHalfVisible (Int_t vis)
 
void SetNoEndVisible (Int_t vis)
 
void SetMdcFiredCell ()
 
void SetTofFiredCell ()
 
void SetEmcFiredCell ()
 
void SetMucFiredCell ()
 
virtual void SizeFruit () const
 
virtual void SizeParticles () const
 
Float_t Zin ()
 
Float_t Zout ()
 

Detailed Description

Definition at line 37 of file BesVisDisplay.h.

Constructor & Destructor Documentation

◆ BesVisDisplay() [1/2]

BesVisDisplay::BesVisDisplay ( )

◆ BesVisDisplay() [2/2]

BesVisDisplay::BesVisDisplay ( const char *  title)

Definition at line 66 of file BesVisDisplay.cxx.

66 : TQObject(),
67 fBesGeometry(0),
68 fMdcROOTGeo(0),
69 fTofROOTGeo(0),
70 fEmcROOTGeo(0),
71 fMucROOTGeo(0),
72 fMdcCon(0),
73 fTofCon(0),
74 fEmcCon(0),
75 fMucCon(0),
76 fAllVis(0),
77 fQuarterVis(0),
78 fHalfVis(0),
79 fNoEndVis(0)
80{
81
82}

◆ ~BesVisDisplay()

BesVisDisplay::~BesVisDisplay ( )
virtual

Definition at line 85 of file BesVisDisplay.cxx.

86{
87
88}

Member Function Documentation

◆ AllViews()

virtual Bool_t BesVisDisplay::AllViews ( )
inlinevirtual

Definition at line 148 of file BesVisDisplay.h.

148{return fDrawAllViews;}

◆ Clear()

void BesVisDisplay::Clear ( Option_t *  option = "")
virtual

Definition at line 1327 of file BesVisDisplay.cxx.

1328{
1329// Delete graphics temporary objects
1330
1331}

◆ DisplayTrigger()

void BesVisDisplay::DisplayTrigger ( Int_t  trig)
virtual

Definition at line 726 of file BesVisDisplay.cxx.

727{
728// Display trigger parameters for current event
729 trig = 1;
730
731 if (trig) fEM1->SetFillColor(kGreen);
732 else fEM1->SetFillColor(kRed);
733 if (trig) fPH1->SetFillColor(kGreen);
734 else fPH1->SetFillColor(kRed);
735 if (trig) fEM2->SetFillColor(kGreen);
736 else fEM2->SetFillColor(kRed);
737 if (trig) fMU1->SetFillColor(kGreen);
738 else fMU1->SetFillColor(kRed);
739 if (trig) fMU2->SetFillColor(kGreen);
740 else fMU2->SetFillColor(kRed);
741 if (trig) fEMU->SetFillColor(kGreen);
742 else fEMU->SetFillColor(kRed);
743 if (trig) fJT1->SetFillColor(kGreen);
744 else fJT1->SetFillColor(kRed);
745 if (trig) fJT3->SetFillColor(kGreen);
746 else fJT3->SetFillColor(kRed);
747 if (trig) fJT4->SetFillColor(kGreen);
748 else fJT4->SetFillColor(kRed);
749 if (trig) fALL->SetFillColor(kGreen);
750 else fALL->SetFillColor(kRed);
751 fTrigPad->Modified();
752}

◆ DistancetoPrimitive()

Int_t BesVisDisplay::DistancetoPrimitive ( Int_t  px,
Int_t  py 
)
virtual

Definition at line 755 of file BesVisDisplay.cxx.

756{
757// Compute distance from point px,py to objects in event
758
759 if (fBesHeader) return fBesHeader->DistancetoPrimitive(px, py)-10;
760 else return 9999;
761
762 if (gPad == fTrigPad) {
763 gPad->SetCursor(kCross);
764 return 0;
765 }
766
767 const Int_t big = 9999;
768 Int_t dist = big;
769 Float_t xmin = gPad->GetX1();
770 Float_t xmax = gPad->GetX2();
771 Float_t dx = 0.05*(xmax - xmin);
772 Float_t x = gPad->AbsPixeltoX(px);
773 if (x < xmin+dx || x > xmax-dx) return dist;
774
775 // scan list of particles
776 //dist = fParticle->DistancetoPrimitive(px, py);
777 //if (dist <= 0) return 0;
778
779 // scan list of fruits
780 /*
781 TIter nextf(fFruits);
782 BesVisFruit *fruit;
783 while((fruit=(BesVisFruit*)nextf())) {
784 dist = fruit->DistancetoPrimitive(px, py);
785 if (dist < 5) {
786 gPad->SetSelected(fruit->Fruit());
787 gPad->SetCursor(kCross);
788 return 0;
789 }
790 }
791 */
792
793 /*
794 // scan list of detectors (currently only one tube)
795 dist = fNodin->DistancetoPrimitive(px, py);
796 if (gPad->GetCanvas()->GetSelected() == gPad->GetView()) {
797 gPad->SetSelected(this);
798 }
799 */
800
801 return 0;
802}
Double_t x[10]
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Definition: BesHeader.cxx:42

◆ Draw()

void BesVisDisplay::Draw ( Option_t *  option = "")
virtual

Definition at line 805 of file BesVisDisplay.cxx.

806{
807// Insert current event in graphics pad list
808
809 //fPad->cd();
810
811 //fCanvas->Range(0,0,1,1);
812 Draw2D();
813 Draw3D();
815 //DrawView(fTheta, fPhi);
816 //fPad->x3d();
817 /*
818 TViewerX3D *x3dPad = new TViewerX3D(fPad);
819 x3dPad->CreateScene("x3d");
820 //x3dPad->SetForegroundColor(x3dPad->GetWhitePixel());
821 //x3dPad->SetBackgroundColor(x3dPad->GetWhitePixel());
822 x3dPad->Show();
823 */
824
825 // Display the event number and title
826 //fPad->cd();
827 //DrawTitle();
828}
void Draw3D(Option_t *option="")
virtual void SwitchDisplayMode(Int_t mode)
void Draw2D(Option_t *option="")

Referenced by BesClient::OpenGeoFile().

◆ Draw2D()

void BesVisDisplay::Draw2D ( Option_t *  option = "")

Definition at line 831 of file BesVisDisplay.cxx.

832{
833 cout << "Create 2D View " << endl;
834 fPadXY->cd();
835 fPadXY->Clear();
836 Draw2DXY();
837 fPadXY->Update();
838
839 fPadZR->cd();
840 fPadZR->Clear();
841 Draw2DZR();
842 fPadZR->Update();
843
844 //DrawTitle();
845
846 //fPad->SetEditable(kFALSE);
847}
void Draw2DZR(Option_t *option="")
void Draw2DXY(Option_t *option="")

Referenced by Draw().

◆ Draw2DXY()

void BesVisDisplay::Draw2DXY ( Option_t *  option = "")

Definition at line 862 of file BesVisDisplay.cxx.

863{
864 fxyView = new BesView();
865 fxyView->ViewXY();
866}
void ViewXY()
Definition: BesView.h:70

Referenced by Draw2D().

◆ Draw2DZR()

void BesVisDisplay::Draw2DZR ( Option_t *  option = "")

Definition at line 870 of file BesVisDisplay.cxx.

871{
872 fzrView = new BesView();
873 fzrView->ViewZR();
874}
void ViewZR()
Definition: BesView.h:71

Referenced by Draw2D().

◆ Draw3D()

void BesVisDisplay::Draw3D ( Option_t *  option = "")

Definition at line 850 of file BesVisDisplay.cxx.

851{
852 cout << "enter BesVisDisplay::Draw3D()" << endl; // added by tianhl to debug shutdown
853
854 fPad3D->cd();
855 fPad3D->Clear();
856
857 f3DView = new BesView();
858 f3DView->View3D();
859}
void View3D()
Definition: BesView.h:69

Referenced by Draw().

◆ DrawAllViews()

void BesVisDisplay::DrawAllViews ( )
virtual

Definition at line 877 of file BesVisDisplay.cxx.

878{
879// Draw front,top,side and 30 deg views
880
881 fDrawAllViews = kTRUE;
882 fPad->cd();
883 fPad->SetFillColor(15);
884 fPad->Clear();
885 fPad->Divide(2,2);
886
887 // draw 30 deg view
888 fPad->cd(1);
889 DrawView(30, 30);
890 DrawTitle();
891
892 // draw front view
893 fPad->cd(2);
894 DrawView(0, 180); //0,-90, 0
895 DrawTitle("Front");
896
897 // draw top view
898 fPad->cd(3);
899 DrawView(90, 90);
900 DrawTitle("Top");
901
902 // draw side view
903 fPad->cd(4);
904 DrawView(90, 0);
905 DrawTitle("Side");
906
907 fPad->cd(2);
908}
virtual void DrawView(Float_t theta, Float_t phi)
virtual void DrawTitle(Option_t *option="")

◆ DrawClusters()

Bool_t BesVisDisplay::DrawClusters ( )
inline

Definition at line 159 of file BesVisDisplay.h.

159{return fDrawClusters;}

◆ DrawHeader()

void BesVisDisplay::DrawHeader ( )
virtual

Definition at line 237 of file BesVisDisplay.cxx.

238{
239 fPadHeader->cd();
240 //fPadHeader->Clear();
241
242 //TASImage asImage("HeaderH2.gif");
243 //Pixmap_t pic = asImage.GetPixmap();
244
245 //cout << "mode " << fDisplayMode << endl;
246 // draw text over image with funny font
247 if (fDisplayMode == 0 || fDisplayMode == 4) {
248 fHeaderImage->Zoom(161, 649, 635, 174); // (x Offset, y Offset, width, height)
249 //fHeaderImage->Scale(800, 200);
250 }
251 else {
252 fHeaderImage->Zoom(600, 324, 164, 473);
253 //fHeaderImage->Scale(200, 600);
254 }
255
256 // draw text over image with foreground specified by pixmap
257 //img->DrawText(250, 350, "goodbye cruel world ...", 24, 0, ar, TImage::kPlain, "fore.xpm");
258
259 fBesHeader->Clear();
260 //fBesHeader->AddText("Commented");
261
262 if (!gEvent) {
263 fBesHeader->AddText("No Event Info");
264 }
265 else {
266 // old coordinates
267 Double_t coordx=fCoordx;
268 Double_t coordy=fCoordy;
269
270 // Get data
271 Long64_t runno = gEvent->GetRun();
272 Long64_t eventno = gEvent->GetEvent();
273 Int_t year = gEvent->GetYear();
274 Int_t month = gEvent->GetMonth();
275 Int_t day = gEvent->GetDay();
276 Int_t hour = gEvent->GetHour();
277 Int_t min = gEvent->GetMin();
278 Int_t sec = gEvent->GetSec();
279
280 // Add title
281 if (IsVHeader()) {
282 coordx = 0.1;
283 coordy = 0.90;
284 }
285 else {
286 coordx = 0.02;
287 coordy = 0.9;
288 }
289 char title1[20];
290 sprintf(title1, "Run %ld ", runno);
291 TText* ttitle1 = fBesHeader->AddText(coordx,coordy,title1);
292 ttitle1->SetTextSize(fTextSizeTitle);
293 ttitle1->SetTextColor(1);
294 ttitle1->SetTextAlign(12);
295
296 if (IsVHeader()) {
297 coordx = 0.1;
298 coordy = 0.86;
299 }
300 else {
301 coordx = 0.02;
302 coordy = 0.82;
303 }
304 char title2[20];
305 sprintf(title2, "Event %ld ", eventno);
306 TText* ttitle2 = fBesHeader->AddText(coordx,coordy,title2);
307 ttitle2->SetTextSize(fTextSizeTitle);
308 ttitle2->SetTextColor(1);
309 ttitle2->SetTextAlign(12);
310
311 // Add date
312 if (IsVHeader()) {
313 coordx = 0.1;
314 coordy = 0.83;
315 }
316 else {
317 coordx = 0.02;
318 coordy = 0.72;
319 }
320
321 char titleEvTime[30];
322 if(fabs(gEvent->GetHeader().GetEvTime())>0.0001){
323 double esTimeConst = 230;// sub in T0 of each layer in MDC calibration
324 sprintf(titleEvTime, "Estime:%5.1fns", gEvent->GetHeader().GetEvTime()-esTimeConst);
325 }else{
326 sprintf(titleEvTime, "Estime:0 ns");
327 }
328 TText* ttitleEvTime = fBesHeader->AddText(coordx,coordy,titleEvTime);
329 ttitleEvTime->SetTextSize(fTextSizeTime);
330 ttitleEvTime->SetTextFont(52);
331 ttitleEvTime->SetTextColor(1);
332 ttitleEvTime->SetTextAlign(12);
333
334 // Add date
335 if (IsVHeader()) {
336 coordx = 0.1;
337 coordy = 0.81;
338 }
339 else {
340 coordx = 0.2;
341 coordy = 0.72;
342 }
343
344 char titleEvTimeStat[30];
345 sprintf(titleEvTimeStat, " stat:%3d", gEvent->GetHeader().GetEvTimeStatus());
346 TText* ttitleEvTimeStat = fBesHeader->AddText(coordx,coordy,titleEvTimeStat);
347 ttitleEvTimeStat->SetTextSize(fTextSizeTime);
348 ttitleEvTimeStat->SetTextFont(52);
349 ttitleEvTimeStat->SetTextColor(1);
350 ttitleEvTimeStat->SetTextAlign(12);
351
352 // Add date
353 if (IsVHeader()) {
354 coordx = 0.1;
355 coordy = 0.79;
356 }
357 else {
358 coordx = 0.4;
359 coordy = 0.72;
360 }
361
362 char titleEvTimeQ[30];
363 sprintf(titleEvTimeQ, " quality:%3.1f", gEvent->GetHeader().GetEvTimeQuality());
364 TText* ttitleEvTimeQ = fBesHeader->AddText(coordx,coordy,titleEvTimeQ);
365 ttitleEvTimeQ->SetTextSize(fTextSizeTime);
366 ttitleEvTimeQ->SetTextFont(52);
367 ttitleEvTimeQ->SetTextColor(1);
368 ttitleEvTimeQ->SetTextAlign(12);
369
370 // Add date
371 if (IsVHeader()) {
372 coordx = 0.1;
373 coordy = 0.76;
374 }
375 else {
376 coordx = 0.02;
377 coordy = 0.60;
378 }
379
380 char date[70];
381 sprintf(date,"date: %4d-%02d-%02d ", year,month,day);
382 TText* tdate = fBesHeader->AddText(coordx,coordy,date);
383 tdate->SetTextSize(fTextSizeTime);
384 tdate->SetTextFont(52);
385 tdate->SetTextColor(1);
386 tdate->SetTextAlign(12);
387
388 // Add time
389 if (IsVHeader()) {
390 coordx = 0.1;
391 coordy = 0.74;
392 }
393 else {
394 coordx = 0.25;
395 coordy = 0.60;
396 }
397 char time[70];
398 sprintf(time,"time: %02d:%02d:%02d", hour,min,sec);
399 TText* ttime=fBesHeader->AddText(coordx,coordy,time);
400 ttime->SetTextSize(fTextSizeTime);
401 ttime->SetTextFont(52);
402 ttime->SetTextColor(1);
403 ttime->SetTextAlign(12);
404
405 // string for contents
406 TString info;
407 vector<TString> statusCon;
408
409 char data[25];
410 if (gEvent->GetMC()) sprintf(data, "MC=Yes");
411 else sprintf(data, "MC=No");
412 statusCon.push_back(TString(data));
413
414 vector<Int_t> trigChannelVector = gEvent->GetHeader().GetTrigChannelVector();
415 vector<Int_t> trigConditionVector = gEvent->GetHeader().GetTrigConditionVector();
416 Int_t timeType = gEvent->GetHeader().GetTimeType();
417 //************************************
418 sprintf(data, "Time Type: %d", timeType);
419 statusCon.push_back(TString(data));
420 if (IsVHeader()) {
421 coordx = 0.10;
422 coordy = 0.71;
423 }
424 else {
425 coordx = 0.02;
426 coordy = 0.50;
427 }
428 for (Int_t i = 0; i < (Int_t)statusCon.size(); i++) {
429 TText* ttitle=fBesHeader->AddText(coordx,coordy,statusCon[i].Data());
430 if (IsVHeader()) coordy -= 0.02 ;
431 else coordx += 0.2;
432 ttitle->SetTextSize(fTextSizeData);
433 ttitle->SetTextFont(62);
434 ttitle->SetTextColor(1);
435 ttitle->SetTextAlign(12);
436 }
437 vector<TString> infoCon;
438 //cout << "BesVisDisplay::time Type: " << timeType << endl;
439 vector<Int_t>::iterator pTrigVector;
440 for (pTrigVector = trigConditionVector.begin();
441 pTrigVector != trigConditionVector.end();
442 pTrigVector++){
443 //cout << "BesVisDisplay::trigCondition: " << *pTrigVector << endl;
444 }
445 //for (pTrigVector = trigChannelVector.begin();
446 // pTrigVector != trigChannelVector.end();
447 // pTrigVector++){
448 //sprintf(data, "Trig Channel_00");
449 //infoCon.push_back(TString(data));
450 //sprintf(data, "Trig Channel_01");
451 //infoCon.push_back(TString(data));
452 //sprintf(data, "Trig Channel_02");
453 //infoCon.push_back(TString(data));
454 //sprintf(data, "Trig Channel_03");
455 //infoCon.push_back(TString(data));
456 //sprintf(data, "Trig Channel_04");
457 //infoCon.push_back(TString(data));
458 //sprintf(data, "Trig Channel_05");
459 //infoCon.push_back(TString(data));
460 //sprintf(data, "Trig Channel_06");
461 //infoCon.push_back(TString(data));
462 //sprintf(data, "Trig Channel_07");
463 //infoCon.push_back(TString(data));
464 //sprintf(data, "Trig Channel_08");
465 //infoCon.push_back(TString(data));
466 //sprintf(data, "Trig Channel_09");
467 //infoCon.push_back(TString(data));
468 //sprintf(data, "Trig Channel_10");
469 //infoCon.push_back(TString(data));
470 //sprintf(data, "Trig Channel_11");
471 //infoCon.push_back(TString(data));
472 //sprintf(data, "Trig Channel_12");
473 //infoCon.push_back(TString(data));
474 //sprintf(data, "Trig Channel_13");
475 //infoCon.push_back(TString(data));
476 //sprintf(data, "Trig Channel_14");
477 //infoCon.push_back(TString(data));
478 //sprintf(data, "Trig Channel_15");
479 //infoCon.push_back(TString(data));
480 //cout << "BesVisDisplay::trigChannel: " << *pTrigVector << endl;
481 //}
482 //************************************
483
484 //if (GetMdcOn()) {
485 // //Float_t p = gEvent->GetHeader().GetP();
486 // //Float_t pt = gEvent->GetHeader().GetPt();
487 // //Float_t px = gEvent->GetHeader().GetPx();
488 // //Float_t py = gEvent->GetHeader().GetPy();
489 // //Float_t pz = gEvent->GetHeader().GetPz();
490
491 // //sprintf(data, "P= %-.3fGeV", p);
492 // //infoCon.push_back(TString(data));
493 // //sprintf(data, "Pt= %-.3fGeV", pt);
494 // //infoCon.push_back(TString(data));
495 // //sprintf(data, "Px= %-.3fGeV", px);
496 // //infoCon.push_back(TString(data));
497 // //sprintf(data, "Py= %-.3fGeV", py);
498 // //infoCon.push_back(TString(data));
499 // //sprintf(data, "Pz= %-.3fGeV", pz);
500 // //infoCon.push_back(TString(data));
501 //}
502
503 //if (GetTofOn()) {
504 // Float_t t = gEvent->GetHeader().GetT();
505
506 // sprintf(data, "tofMin= %-.3fns", t);
507 // infoCon.push_back(TString(data));
508 //}
509
510 //if (GetEmcOn()) {
511 // Float_t e = gEvent->GetHeader().GetE();
512
513 // sprintf(data, "ECal= %-.3fGeV", e);
514 // infoCon.push_back(TString(data));
515 //}
516
517 ////sprintf(data, "MDC Track(GeV): ");
518 ////infoCon.push_back(TString(data));
519 ////sprintf(data, "P1=0.945");
520 ////infoCon.push_back(TString(data));
521 ////sprintf(data, "P2=0.702");
522 ////infoCon.push_back(TString(data));
523 ////sprintf(data, "P3=0.421");
524 ////infoCon.push_back(TString(data));
525 ////sprintf(data, "P4=1.048");
526 ////infoCon.push_back(TString(data));
527
528 ////sprintf(data, "EMC Cluster(MeV):");
529 ////infoCon.push_back(TString(data));
530 ////sprintf(data, "E1=151.91");
531 ////infoCon.push_back(TString(data));
532 ////sprintf(data, "E2=226.00");
533 ////infoCon.push_back(TString(data));
534 ////sprintf(data, "E3=295.91");
535 ////infoCon.push_back(TString(data));
536 ////sprintf(data, "E4=165.27");
537 ////infoCon.push_back(TString(data));
538 ////sprintf(data, "E5=48.68");
539 ////infoCon.push_back(TString(data));
540 ////sprintf(data, "E6=193.98");
541 ////infoCon.push_back(TString(data));
542 Int_t npr;
543 Float_t rowH;
544 Float_t textSize = fTextSizeData;
545 if (IsVHeader()) {
546 fCoordx = 0.10;
547 fCoordy = 0.70;
548 npr = 1;
549 rowH = 0.04;
550 textSize *= 1.2;
551 }
552 else {
553 fCoordx = 0.02;
554 fCoordy = 0.50;
555 npr = 4;
556 rowH = 0.1;
557 }
558
559 pTrigVector = trigChannelVector.begin();
560 for (Int_t i = 0; i < (Int_t)infoCon.size(); i++) {
561 coordx = fCoordx + (i%npr)*(1.0/npr);
562 coordy = fCoordy - (i/npr)*rowH;
563
564 if (*pTrigVector == i){
565 TString temp = infoCon[i] + " ON";
566 TText* tdata=fBesHeader->AddText(coordx,coordy,temp.Data());
567 tdata->SetTextSize(textSize);
568 tdata->SetTextFont(62);
569 tdata->SetTextColor(2);
570 tdata->SetTextAlign(12);
571 pTrigVector++;
572 }
573 else {
574 TString temp = infoCon[i] + " OFF";
575 TText* tdata=fBesHeader->AddText(coordx,coordy,temp.Data());
576 tdata->SetTextSize(textSize);
577 tdata->SetTextFont(62);
578 tdata->SetTextColor(1);
579 tdata->SetTextAlign(12);
580 }
581 }
582
583 }
584
585 fBesHeader->Draw("same");
586
587 fPadHeader->SetEditable(kFALSE);
588 fPadHeader->Modified();
589 fPadHeader->Update();
590 fCanvas->cd();
591}
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:278
TTree * data
Double_t time
Double_t GetEvTime()
vector< Int_t > & GetTrigChannelVector()
Int_t GetEvTimeStatus()
vector< Int_t > & GetTrigConditionVector()
Int_t GetTimeType()
Double_t GetEvTimeQuality()
Int_t GetSec()
Definition: BesEvent.h:265
Int_t GetMin()
Definition: BesEvent.h:262
Int_t GetMonth()
Definition: BesEvent.h:253
Int_t GetMC()
Definition: BesEvent.h:268
Int_t GetDay()
Definition: BesEvent.h:256
Int_t GetHour()
Definition: BesEvent.h:259
Int_t GetYear()
Definition: BesEvent.h:250
BesEventHeader GetHeader()
Definition: BesEvent.h:271
Long64_t GetRun()
Definition: BesEvent.h:244
Long64_t GetEvent()
Definition: BesEvent.h:247
virtual void Clear(Option_t *option="")
Definition: BesHeader.h:42
Bool_t IsVHeader()

Referenced by Init(), ResizePad(), SetEmcOn(), SetMdcOn(), SetTofOn(), and BesClient::UpdateAllView().

◆ DrawImageSequence()

void BesVisDisplay::DrawImageSequence ( Int_t  thetaStart,
Int_t  thetaStep 
)

Definition at line 1111 of file BesVisDisplay.cxx.

1112{
1113 /*
1114 fRayPicCount = 0;
1115 //for(int i = thetaStart; i < thetaStart + 360; i += thetaStep) {
1116 //DrawViewRaytracer(i, 30, 270);
1117 //}
1118 for (int i = 0; i < fTofROOTGeo->GetScinNb(0); i++) {
1119 for (int j=0; j < 20; j++) {
1120 fTofROOTGeo->GetPhysicalScin(1, i*20+j)->SetVisibility(1);
1121 }
1122 DrawViewRaytracer(30, 30, 270);
1123 }
1124 */
1125}

◆ DrawParticles()

Bool_t BesVisDisplay::DrawParticles ( )
inline

Definition at line 160 of file BesVisDisplay.h.

160{return fDrawParticles;}

◆ DrawParticles2()

Bool_t BesVisDisplay::DrawParticles2 ( )
inline

Definition at line 162 of file BesVisDisplay.h.

162{return fDrawParticles2;}

◆ DrawTitle()

void BesVisDisplay::DrawTitle ( Option_t *  option = "")
virtual

Definition at line 911 of file BesVisDisplay.cxx.

912{
913// Draw the event title
914
915 Float_t xmin = gPad->GetX1();
916 Float_t xmax = gPad->GetX2();
917 Float_t ymin = gPad->GetY1();
918 Float_t ymax = gPad->GetY2();
919 Float_t dx = xmax-xmin;
920 Float_t dy = ymax-ymin;
921 if (strlen(option) == 0) {
922 TPaveText *title = new TPaveText(xmin +0.01*dx, ymax-0.09*dy, xmin +0.5*dx, ymax-0.01*dy);
923 title->SetBit(kCanDelete);
924 title->SetFillColor(42);
925 title->Draw();
926 char ptitle[100];
927 //sprintf(ptitle,"Pythia event: %d, Run:%d",gBesVisast->Event(), gBesVisast->Run());
928 //sprintf(ptitle,"Monte Carlo event: %d",gBesVisast->Event());
929 sprintf(ptitle,"Monte Carlo event");
930 title->AddText(ptitle);
931 //sprintf(ptitle,"Pythia Mode: %s",gBesVisast->MCMaker()->GetTitle());
932 //title->AddText(ptitle);
933 } else {
934 TPaveLabel *label = new TPaveLabel(xmin +0.01*dx, ymax-0.07*dy, xmin +0.2*dx, ymax-0.01*dy,option);
935 label->SetBit(kCanDelete);
936 label->SetFillColor(42);
937 label->Draw();
938 }
939}

Referenced by DrawAllViews().

◆ DrawView()

void BesVisDisplay::DrawView ( Float_t  theta,
Float_t  phi 
)
virtual

Definition at line 942 of file BesVisDisplay.cxx.

943{
944// Draw a view of ATLAS
945
946 //fPad3D->SetFillColor(10);
947 // Display ATLAS outline
948 gPad->Clear();
949
950 //TImage *i1 = TImage::Open("rose512.jpg");
951 //i1->SetConstRatio(kFALSE);
952 //gPad->cd();
953 //i1->Draw();
954
955 Int_t iret;
956 BesTView *view = new BesTView(1);
957 view->SetRange(-0.5*fBesR, -0.5*fBesR, -0.5*fBesZ, 0.5*fBesR, 0.5*fBesR, 0.5*fBesZ);
958 view->ZoomView(gPad, 1.2);
959
960 //fNodin->Draw("same");
961 //fBes->Draw("same");
962 fBesGeometry->Draw("3D");
963
964 // add itself to the list
965 //AppendPad();
966
967 //Loop on all makers to add their products to the pad
968 /*
969 TIter next(gBesVisast->Makers());
970 BesVisMaker *maker;
971 while ((maker = (BesVisMaker*)next())) {
972 maker->Draw();
973 }
974 */
975
976 //view->SetView(phi, theta, 90, iret); //previous side view necessary
977 view->SetView(phi, theta, 270, iret);
978 //view->SetParralel(); //-----------liangyt
979 view->SetParallel();
980 //use SetParallel() instead of depreciated function TView::SetParralel()
981 //changed by tianhl at Mon Aug 20 2007
982 //view->SetPerspective();
983 //view->ShowAxis();
984
985 //DrawViewRange(0, 0, 0, 2500);
986}
virtual void Draw(Option_t *option="3D")
virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor=1.25)
Definition: BesTView.cxx:1777
virtual void SetRange(const Double_t *min, const Double_t *max)
Definition: BesTView.cxx:1453
virtual void SetParallel()
Definition: BesTView.cxx:1432
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1525

Referenced by DrawAllViews().

◆ DrawViewGL()

void BesVisDisplay::DrawViewGL ( )
virtual

Definition at line 999 of file BesVisDisplay.cxx.

1000{
1001// Draw current view using OPENGL
1002
1003 TPad *pad = (TPad*)gPad->GetPadSave();
1004 pad->cd();
1005 TView *view = pad->GetView();
1006 if (!view) return;
1007 pad->x3d("OPENGL");//-----------liangyt
1008}

◆ DrawViewRange()

void BesVisDisplay::DrawViewRange ( Double_t  x0,
Double_t  y0,
Double_t  z0,
Double_t  zoomSize 
)

Definition at line 989 of file BesVisDisplay.cxx.

991{
992// Draw a view of some place
993
994 gPad->GetView()->SetRange(x0 - 0.5*zoomSize, y0 - 0.5*zoomSize, z0 - 0.5*zoomSize,
995 x0 + 0.5*zoomSize, y0 + 0.5*zoomSize, z0 + 0.5*zoomSize);
996}

◆ DrawViewRaytracer()

void BesVisDisplay::DrawViewRaytracer ( Float_t  theta,
Float_t  phi,
Float_t  psi 
)
virtual

Definition at line 1023 of file BesVisDisplay.cxx.

1024{
1025 //TCanvas *rayCanvas = new TCanvas("rayCanvas", "Raytracer Canvas", 10, 10, 800, 800);
1026 TCanvas *rayCanvas = new TCanvas("rayCanvas", "Raytracer Canvas", 10, 10, 800, 800);
1027 rayCanvas->cd();
1028
1029
1030 //TPad *rayPad = new TPad("rayPad", "Raytracer display",0.,0.,1,1);
1031 //rayPad->Draw();
1032 //rayPad->Modified();
1033 gPad->SetFillColor(1);
1034
1035 //rayPad->SetBorderSize(2);
1036 //rayPad->cd();
1037 //fMucGeo->GetVolMuc()->Draw();
1038 //fBes->Draw();
1039
1040 TView *view = gPad->GetView();
1041 //view->SetPerspective();
1042 int iret;
1043 view->ZoomView(gPad, 1.5);
1044 view->SetView(phi, theta, psi, iret);
1045 // |
1046 // \|/
1047
1048 //gGeoManager->GetGeomPainter()->SetBombFactors(2, 2, 2, 2);
1049 //gGeoManager->GetGeomPainter()->SetExplodedView(3);
1050
1051 gGeoManager->GetGeomPainter()->SetRaytracing(kTRUE);
1052
1053 rayCanvas->Modified();
1054 rayCanvas->Update();
1055 //rayPad->Modified();
1056 //rayPad->Update();
1057
1058 stringstream sPicCount;
1059 sPicCount << fRayPicCount << ".gif";
1060 string str = sPicCount.str();
1061
1062 gPad->SaveAs(str.c_str());
1063 fRayPicCount++;
1064}

◆ DrawViewX3D() [1/2]

void BesVisDisplay::DrawViewX3D ( )
virtual

Definition at line 1011 of file BesVisDisplay.cxx.

1012{
1013// Draw current view using X3D
1014
1015 TPad *pad = (TPad*)gPad->GetPadSave();
1016 pad->cd();
1017 TView *view = pad->GetView();
1018 if (!view) return;
1019 pad->x3d();//-----------liangyt
1020}

◆ DrawViewX3D() [2/2]

void BesVisDisplay::DrawViewX3D ( char  option)
virtual

Definition at line 1066 of file BesVisDisplay.cxx.

1067{
1068 TCanvas *x3dCanvas = new TCanvas("x3dCanvas", "X3dtracer Canvas", 10, 10, 800, 800);
1069 x3dCanvas->cd();
1070
1071 gPad->SetFillColor(1);
1072 //x3dPad->SetBorderSize(2);
1073 //x3dPad->cd();
1074
1075 //fBes->Draw("x3d");
1076
1077 //TView *view = gPad->GetView();
1078 //view->SetPerspective();
1079 //int iret;
1080 //view->ZoomView(gPad, 1.2);
1081 //view->SetView(30, 60, 270, iret);
1082
1083
1084 //gPad->x3d();//-----------liangyt
1085 gPad->GetViewer3D();
1086 //use TPad::GetViewer3D() instead of depreciated function TPad::x3d()
1087 //changed by tianhl at Mon Aug 20 2007
1088 //TViewerX3D *x3d = (TViewerX3D*)gPad->GetViewer3D();
1089
1090 //TViewerX3D *x3d = new TViewerX3D(x3dCanvas, "");
1091 //x3d->ExecCommand(0,0,option);
1092
1093 //for (Int_t i=0;i<500;i++) {
1094 //Int_t px = i%500;
1095 //Int_t py = (2*i)%200;
1096 //x3d->ExecCommand(px,py,0); //rotate
1097 //if (i%20 >10) x3d->ExecCommand(px,py,'j'); //zoom
1098 //if (i%20 <10) x3d->ExecCommand(px,py,'k'); //unzoom
1099 //}
1100
1101
1102 stringstream sPicCount;
1103 fRayPicCount = 0;
1104 sPicCount << fRayPicCount << ".gif";
1105 string str = sPicCount.str();
1106
1107 gPad->SaveAs(str.c_str());
1108 fRayPicCount++;
1109}

◆ ExecuteEvent()

void BesVisDisplay::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Definition at line 1128 of file BesVisDisplay.cxx.

1129{
1130//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
1131//*-* =========================================
1132
1133 if (gPad->GetView()) {
1134 gPad->GetView()->ExecuteRotateView(event, px, py);
1135 }
1136}

◆ GetBesGeometry()

BesGeometry * BesVisDisplay::GetBesGeometry ( )
inline

Definition at line 139 of file BesVisDisplay.h.

139{ return fBesGeometry; }

Referenced by BesClient::OpenGeoFile(), and BesClient::SaveGeoAs().

◆ GetDisplayMode()

Int_t BesVisDisplay::GetDisplayMode ( )
inline

Definition at line 126 of file BesVisDisplay.h.

126{ return fDisplayMode; }

Referenced by BesClient::HandleButtons().

◆ GetEmcOn()

Bool_t BesVisDisplay::GetEmcOn ( )
inline

Definition at line 146 of file BesVisDisplay.h.

146{ return fEmcOn; }

◆ GetEmcROOTGeo()

EmcROOTGeo * BesVisDisplay::GetEmcROOTGeo ( )
inline

Definition at line 177 of file BesVisDisplay.h.

177{return fEmcROOTGeo;}

◆ GetEvent()

void BesVisDisplay::GetEvent ( Long64_t  event)
virtual

Definition at line 1139 of file BesVisDisplay.cxx.

1140{
1141// Read event in memory
1142
1143 // gBesVisast->GetEvent(event);
1144
1145 //Draw();
1146
1147 //gGeoManager->ClearAttributes();
1152}

◆ GetMdcOn()

Bool_t BesVisDisplay::GetMdcOn ( )
inline

Definition at line 142 of file BesVisDisplay.h.

142{ return fMdcOn; }

◆ GetMdcROOTGeo()

MdcROOTGeo * BesVisDisplay::GetMdcROOTGeo ( )
inline

Definition at line 175 of file BesVisDisplay.h.

175{return fMdcROOTGeo;}

◆ GetMucROOTGeo()

MucROOTGeo * BesVisDisplay::GetMucROOTGeo ( )
inline

Definition at line 178 of file BesVisDisplay.h.

178{return fMucROOTGeo;}

◆ GetPad3D()

TPad * BesVisDisplay::GetPad3D ( )
inline

Definition at line 133 of file BesVisDisplay.h.

133{ return fPad3D; }

Referenced by BesClient::LoadMyConfig(), BesClient::SaveMyConfig(), and BesClient::UpdateAllView().

◆ GetPadXY()

TPad * BesVisDisplay::GetPadXY ( )
inline

◆ GetPadZR()

TPad * BesVisDisplay::GetPadZR ( )
inline

◆ GetTofOn()

Bool_t BesVisDisplay::GetTofOn ( )
inline

Definition at line 144 of file BesVisDisplay.h.

144{ return fTofOn; }

◆ GetTofROOTGeo()

TofROOTGeo * BesVisDisplay::GetTofROOTGeo ( )
inline

Definition at line 176 of file BesVisDisplay.h.

176{return fTofROOTGeo;}

◆ GetVolBes()

TGeoVolume * BesVisDisplay::GetVolBes ( )
inline

Definition at line 174 of file BesVisDisplay.h.

174{return fBes;}

◆ Init()

void BesVisDisplay::Init ( )

Definition at line 101 of file BesVisDisplay.cxx.

102{
103 fDisplayMode = 0;
104 fCanvas->cd();
105 //fCanvas->SetEditable(kFALSE);
106 fCanvas->SetFillColor(10);
107
108 // pad 3D
109 fPad3D = new TPad("Pad3D", "Pad3D", 0.75, 0.75, 0.9, 0.9);
110 fPad3D->SetFillColor(TColor::GetColor(204,204,204));
111 fPad3D->SetFillColor(16);
112 fPad3D->Draw();
113
114 // pad Header
115 fPadHeader = new TPad("PadHeader", "PadHeader", 0.0, 0.68, 1.0, 1.0);
116 fPadHeader->Draw();
117 fPadHeader->cd();
118
119 TString fp = gEnv->GetValue("Root.TTFontPath", "");
120 TString bc = fp + "/BlackChancery.ttf";
121 TString ar = fp + "/arial.ttf";
122
123 string besvisPath = getenv("BESVISLIBROOT");
124 TString filePath(besvisPath);
125 filePath += "/icons/";
126
127 fHeaderHImage = TImage::Open(filePath + "HeaderH.gif");
128 fHeaderHImage->SetEditable(kTRUE);
129 //fHeaderHImage->Draw("same");
130 fHeaderVImage = TImage::Open(filePath + "HeaderV.gif");
131 fHeaderVImage->SetEditable(kTRUE);
132 // fHeaderVImage->Draw("same");
133 fHeaderImage = TImage::Open(filePath + "Header.gif");
134 fHeaderImage->DrawText(620, 15, "BesVis", 30,
135 gROOT->GetColor(2)->AsHexString(),
136 bc, TImage::kShadeBelow);
137 fHeaderImage->SetConstRatio(false);
138 fHeaderImage->Draw("same");
139
140 fBesHeader = new BesHeader(0,0,1,1, "br");
141 fBesHeader->SetTextSize(0.1);
142 fBesHeader->SetFillColor(28);
143 fBesHeader->SetFillStyle(0);
144 fBesHeader->SetBorderSize(4);
145
146 fLatticeWidth=0.185;
147 fTextSizeTitle=0.08;
148 fTextSizeTime=0.07;
149 fTextSizeData=0.05;
150 fTextSizeFlt=0.02;
151 fCoordx=0.01;
152 fCoordy=0.8;
153 fDistanceOfRows=0.01;
154
155 fMdcOn = true;
156 fTofOn = true;
157 fEmcOn = true;
158
159 Connect(fBesHeader,"TransferMdcOn(Bool_t)","BesVisDisplay",this,"SetMdcOn(Bool_t)");
160 Connect(fBesHeader,"TransferTofOn(Bool_t)","BesVisDisplay",this,"SetTofOn(Bool_t)");
161 Connect(fBesHeader,"TransferEmcOn(Bool_t)","BesVisDisplay",this,"SetEmcOn(Bool_t)");
162
163 DrawHeader();
164
165 // pad XY
166 fPadXY = new TPad("PadXY", "PadXY", 0.0, 0.0, 0.5, 0.68);
167 fPadXY->Draw();
168
169 // pad ZR
170 fPadZR = new TPad("PadZR", "PadZR", 0.5, 0.0, 1.0, 0.68);
171 fPadZR->Draw();
172
173 /*
174 fPad3D->SetBorderMode(0);
175 fPad3D->SetBorderSize(3);
176 fPadHeader->SetBorderMode(1);
177 fPadHeader->SetBorderSize(3);
178 fPadXY->SetBorderMode(2);
179 fPadXY->SetBorderSize(3);
180 fPadZR->SetBorderMode(3);
181 fPadZR->SetBorderSize(3);
182 */
183}
virtual void SetBorderSize(Int_t bordersize=4)
Definition: BesHeader.h:53
virtual void DrawHeader()

Referenced by BesClient::CreateCanvas().

◆ InitGeometryFromGDML()

void BesVisDisplay::InitGeometryFromGDML ( const TString  fPath)
virtual

Definition at line 206 of file BesVisDisplay.cxx.

207{
208 if ( gBesGeometry ) delete gBesGeometry;
209 fBesGeometry = new BesGeometry();
210 gBesGeometry = fBesGeometry;
211 fBesGeometry->InitFromGDML(fPath);
212 fBesGeometry->SetDefaultVis();
213
214 // should be deleted after BesView completed;
215 fMdcROOTGeo = fBesGeometry->GetMdcROOTGeo(); //here liang
216 fTofROOTGeo = fBesGeometry->GetTofROOTGeo(); //here liang
217 fEmcROOTGeo = fBesGeometry->GetEmcROOTGeo(); //here liang
218 fMucROOTGeo = fBesGeometry->GetMucROOTGeo();
219}
R__EXTERN BesGeometry * gBesGeometry
Definition: BesGeometry.h:103
virtual void SetDefaultVis()
EmcROOTGeo * GetEmcROOTGeo()
Definition: BesGeometry.h:43
virtual void InitFromGDML(const TString fPath)
Definition: BesGeometry.cxx:63
MdcROOTGeo * GetMdcROOTGeo()
Definition: BesGeometry.h:41
MucROOTGeo * GetMucROOTGeo()
Definition: BesGeometry.h:44
TofROOTGeo * GetTofROOTGeo()
Definition: BesGeometry.h:42

Referenced by BesClient::OpenGeoFile().

◆ InitGeometryFromROOT()

void BesVisDisplay::InitGeometryFromROOT ( TGeoVolume *  bes)
virtual

Definition at line 223 of file BesVisDisplay.cxx.

224{
225 if ( gBesGeometry ) delete gBesGeometry;
226 fBesGeometry = new BesGeometry();
227 gBesGeometry = fBesGeometry;
228 fBesGeometry->InitFromROOT(volBes);
229
230 // should be deleted after BesView completed;
231 fMdcROOTGeo = fBesGeometry->GetMdcROOTGeo();
232 fTofROOTGeo = fBesGeometry->GetTofROOTGeo();
233 fEmcROOTGeo = fBesGeometry->GetEmcROOTGeo();
234 fMucROOTGeo = fBesGeometry->GetMucROOTGeo();
235}
virtual void InitFromROOT(TGeoVolume *volBes)

Referenced by BesClient::OpenGeoFile().

◆ IsVHeader()

Bool_t BesVisDisplay::IsVHeader ( )
inline

Definition at line 127 of file BesVisDisplay.h.

127{ if (fDisplayMode == 0 || fDisplayMode == 4) return false; else return true; }

Referenced by DrawHeader().

◆ Pad()

TPad * BesVisDisplay::Pad ( )
inline

Definition at line 182 of file BesVisDisplay.h.

182{return fPad;}

◆ Paint()

void BesVisDisplay::Paint ( Option_t *  option = "")
virtual

Definition at line 1155 of file BesVisDisplay.cxx.

1156{
1157// Paint miscellaneous items
1158
1159}

◆ PaintFruit()

void BesVisDisplay::PaintFruit ( TObject *  obj,
Float_t  eta,
Float_t  phi,
Float_t  pt,
Int_t  type,
Option_t *  option = "" 
)
virtual

Definition at line 1162 of file BesVisDisplay.cxx.

1163{
1164 // Display fruit from obj
1165 /*
1166 if (fDrawClusters) {
1167 if (!fFruits) fFruits = new TList();
1168 BesVisFruit *fruit = new BesVisFruit(obj, eta, phi, pt, type);
1169 fFruits->Add(fruit);
1170 fruit->Paint(option);
1171 }
1172 */
1173}

◆ PaintParticles()

void BesVisDisplay::PaintParticles ( Option_t *  option = "")
virtual

Definition at line 1176 of file BesVisDisplay.cxx.

1177{
1178 //if (fDrawParticles) fParticle->Paint(option);
1179}

◆ PTcut()

Float_t BesVisDisplay::PTcut ( )
inline

Definition at line 187 of file BesVisDisplay.h.

187{return fPTcut;}

◆ PTcutEGMUNU()

Float_t BesVisDisplay::PTcutEGMUNU ( )
inline

Definition at line 188 of file BesVisDisplay.h.

188{return fPTcutEGMUNU;}

◆ Reset()

void BesVisDisplay::Reset ( )
virtual

Definition at line 186 of file BesVisDisplay.cxx.

187{
188 if (fPadXY) {
189 fPadXY->cd();
190 ((BesView*)fPadXY->GetView())->Reset();
191 }
192 if (fPadZR) {
193 fPadZR->cd();
194 ((BesView*)fPadZR->GetView())->Reset();
195 }
196 if (fPad3D) {
197 fPad3D->cd();
198 ((BesView*)fPad3D->GetView())->Reset();
199 }
200
201 SwitchDisplayMode(fDisplayMode);
202}
virtual void Reset()

Referenced by BesClient::HandleButtons(), and Reset().

◆ ResizePad()

void BesVisDisplay::ResizePad ( )
virtual

Definition at line 630 of file BesVisDisplay.cxx.

631{
632 fCanvas->cd();
633 Double_t xlowH = -0.11, xupH = -0.1, ylowH = -0.11, yupH = -0.1;
634 Int_t width = fCanvas->GetWw();
635 Int_t height = fCanvas->GetWh();
636 Double_t hVSw = Double_t(height)/width;
637 Double_t x2D = 1.0-hVSw;
638 //cout << "Canvas width " << width << " height " << height << " x2D " << x2D << endl;
639 Double_t y2D = 0.5/hVSw;
640 Double_t x3D = (1.0/3)/hVSw;
641
642 switch ( fDisplayMode ) {
643 case 0 : // 2D XY+ZR
644 fPadHeader->SetPad(0.0, y2D, 1.0, 1.0);
645 fPadXY ->SetPad(0.0, 0.0, 0.5, y2D);
646 fPadZR ->SetPad(0.5, 0.0, 1.0, y2D);
647 fPad3D ->SetPad(xlowH, ylowH, xupH, yupH);
648 break;
649 case 1 : // 2D XY
650 fPadHeader->SetPad(0.0, 0.0, x2D, 1.0);
651 fPadXY ->SetPad(x2D, 0.0, 1.0, 1.0);
652 fPadZR ->SetPad(xlowH, ylowH, xupH, yupH);
653 fPad3D ->SetPad(xlowH, ylowH, xupH, yupH);
654 break;
655 case 2 : // 2D ZR
656 fPadHeader->SetPad(0.0, 0.0, x2D, 1.0);
657 fPadXY ->SetPad(xlowH, ylowH, xupH, yupH);
658 fPadZR ->SetPad(x2D, 0.0, 1.0, 1.0);
659 fPad3D ->SetPad(xlowH, ylowH, xupH, yupH);
660 break;
661 case 3 : // 3D
662 fPadHeader->SetPad(0.0, 0.0, x2D, 1.0);
663 fPadXY ->SetPad(xlowH, ylowH, xupH, yupH);
664 fPadZR ->SetPad(xlowH, ylowH, xupH, yupH);
665 fPad3D ->SetPad(x2D, 0.0, 1.0, 1.0);
666 break;
667 case 4 : // 2D+3D
668 //fPadHeader->SetPad(xlowH, ylowH, xupH, yupH);
669 fPadHeader->SetPad(0.0, 2*x3D, 1.0, 1.0);
670 fPadXY ->SetPad(0.0, x3D, 1.0/3, 2*x3D);
671 fPadZR ->SetPad(0.0, 0.0, 1.0/3, x3D);
672 fPad3D ->SetPad(1.0/3, 0.0, 1.0, 2*x3D);
673 break;
674 default :
675 return;
676 }
677
678 //fPadHeader->Update();
679 DrawHeader();
680
681 switch ( fDisplayMode ) {
682 case 0 : // 2D XY+ZR
683 fPadXY->cd();
684 fPadXY->Update();
685 fPadZR->Update();
686 break;
687 case 1 : // 2D XY
688 fPadXY->cd();
689 fPadXY->Update();
690 break;
691 case 2 : // 2D ZR
692 fPadZR->cd();
693 fPadZR->Update();
694 break;
695 case 3 : // 3D
696 fPad3D->cd();
697 fPad3D->Update();
698 break;
699 case 4 : // 2D+3D
700 fPad3D->cd();
701 fPad3D->Update();
702 break;
703 default :
704 return;
705 }
706}

Referenced by SwitchDisplayMode().

◆ Rin()

Float_t BesVisDisplay::Rin ( )
inline

Definition at line 189 of file BesVisDisplay.h.

189{return fRin;}

◆ Rout()

Float_t BesVisDisplay::Rout ( )
inline

Definition at line 190 of file BesVisDisplay.h.

190{return fRout;}

◆ SetAllVisible()

void BesVisDisplay::SetAllVisible ( Int_t  vis)
inline

Definition at line 202 of file BesVisDisplay.h.

202{fAllVis = vis;}

◆ SetCanvas()

void BesVisDisplay::SetCanvas ( TCanvas *  c = 0)
virtual

Definition at line 91 of file BesVisDisplay.cxx.

92{
93 if (c != 0) {
94 fCanvas = c;
95 }
96 else {
97 fCanvas = new TCanvas("Canvas", " ",0,0,1024,768);
98 }
99}

Referenced by BesClient::CreateCanvas().

◆ SetDisplayMode()

void BesVisDisplay::SetDisplayMode ( Int_t  mode)
inline

Definition at line 125 of file BesVisDisplay.h.

125{ fDisplayMode = mode; }

Referenced by SwitchDisplayMode().

◆ SetDrawClusters()

virtual void BesVisDisplay::SetDrawClusters ( Bool_t  draw = kTRUE)
inlinevirtual

Definition at line 191 of file BesVisDisplay.h.

191{fDrawClusters=draw;} // *MENU*

◆ SetDrawParticles()

virtual void BesVisDisplay::SetDrawParticles ( Bool_t  draw = kTRUE)
inlinevirtual

Definition at line 192 of file BesVisDisplay.h.

192{fDrawParticles=draw;} // *MENU*

◆ SetEmcCon()

void BesVisDisplay::SetEmcCon ( Int_t  emcCon)
inline

Definition at line 200 of file BesVisDisplay.h.

200{fEmcCon=emcCon;}

◆ SetEmcFiredCell()

void BesVisDisplay::SetEmcFiredCell ( )

Definition at line 1282 of file BesVisDisplay.cxx.

1283{
1284 int theta[26] = {3,3,2,9,9,8,5,7,6,10,10,7,8,9,9,9,37,2,7,7,4,4,5,5,15,15};
1285 int phi[26] = {45,46,46,80,81,80,83,81,81,81,80,80,81,82,83,84,17,84,77,78,79,80,80,79,31,32};
1286
1287 for (int i = 0; i < 26; i++) {
1288 fEmcROOTGeo->GetPhysicalCrystal(1, phi[i], theta[i])->SetVisibility(1);
1289 std::cout << "1" << " " << phi[i] << " " << theta[i] << std::endl;
1290 }
1291}
TGeoPhysicalNode * GetPhysicalCrystal(int part, int phi, int theta)
Get crystal physical node;.

Referenced by GetEvent().

◆ SetEmcOn()

void BesVisDisplay::SetEmcOn ( Bool_t  EmcOn)
virtual

Definition at line 613 of file BesVisDisplay.cxx.

614{
615 fEmcOn = EmcOn;
616 //fBesHeader->SetEmcOn(EmcOn);
617 DrawHeader();
618}

◆ SetHalfVisible()

void BesVisDisplay::SetHalfVisible ( Int_t  vis)
inline

Definition at line 204 of file BesVisDisplay.h.

204{fHalfVis = vis;}

◆ SetMdcCon()

void BesVisDisplay::SetMdcCon ( Int_t  mdcCon)
inline

Definition at line 198 of file BesVisDisplay.h.

198{fMdcCon=mdcCon;}

◆ SetMdcFiredCell()

void BesVisDisplay::SetMdcFiredCell ( )

Definition at line 1256 of file BesVisDisplay.cxx.

1257{
1258 int layer[135] = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12,13,14,15,16,17,18,19,19,20,21,22,22,23,24,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,41,42,0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42};
1259 int replica[135] = {12 ,13 ,14 ,17 ,19 ,23 ,25 ,25 ,25 ,26 ,29 ,30 ,33 ,34 ,38 ,38 ,44 ,44 ,48 ,48 ,49 ,51 ,52 ,51 ,52 ,52 ,62 ,63 ,63 ,63 ,68 ,68 ,69 ,68 ,69 ,79 ,80 ,79 ,80 ,91 ,91 ,91 ,92 ,103,103,104,103,4 ,7 ,9 ,4 ,9 ,4 ,9 ,9 ,8 ,8 ,55 ,56 ,63 ,64 ,71 ,71 ,82 ,82 ,89 ,90 ,99 ,100,99 ,100,120,120,120,120,130,131,130,131,151,151,151,151,166,166,167,166,167,187,188,188,7 ,9 ,9 ,12 ,13 ,15 ,16 ,17 ,17 ,17 ,20 ,20 ,22 ,23 ,25 ,26 ,29 ,30 ,32 ,33 ,34 ,35 ,34 ,35 ,42 ,42 ,42 ,42 ,45 ,46 ,46 ,46 ,46 ,53 ,54 ,53 ,54 ,61 ,62 ,61 ,62 ,69 ,70 ,70};
1260
1261 for (int i = 0; i < 135; i++) {
1262 fMdcROOTGeo->GetPhysicalReplica(layer[i], replica[i])->SetVisibility(1);
1263 if (layer[i] > 35) fMdcROOTGeo->GetPhysicalReplica(layer[i]+7, replica[i])->SetVisibility(1);
1264 std::cout << layer[i] << " " << replica[i] << std::endl;
1265 }
1266}
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.

Referenced by GetEvent().

◆ SetMdcOn()

void BesVisDisplay::SetMdcOn ( Bool_t  MdcOn)
virtual

Definition at line 595 of file BesVisDisplay.cxx.

596{
597 fMdcOn = MdcOn;
598 //fBesHeader->SetMdcOn(MdcOn);
599 DrawHeader();
600}

◆ SetMucCon()

void BesVisDisplay::SetMucCon ( Int_t  mucCon)
inline

Definition at line 201 of file BesVisDisplay.h.

201{fMucCon=mucCon;}

◆ SetMucFiredCell()

void BesVisDisplay::SetMucFiredCell ( )

Definition at line 1294 of file BesVisDisplay.cxx.

1295{
1296 vector<int> cellCon;
1297
1298 int part[11] = {1,1,1,1,1,1,1,1,1,1,1};
1299 int seg[11] = {6,6,2,2,2,2,2,2,2,2,2};
1300 int gap[11] = {0, 1, 0, 1, 2, 2, 3, 4, 5, 6, 7};
1301 int strip[11]= {2,20,20,29,21,22,27,25,25,30,22};
1302
1303 for (int i = 0; i < 11; i++) {
1304 fMucROOTGeo->GetPhysicalStrip(part[i], seg[i], gap[i], strip[i])->SetVisibility(1);
1305 std::cout << " " << part[i] << " " << seg[i] << " " << gap[i] << " " << strip[i] << std::endl;
1306 }
1307}
TGeoPhysicalNode * GetPhysicalStrip(int part, int seg, int gap, int strip)
Get strip physical node;.

Referenced by GetEvent().

◆ SetNoEndVisible()

void BesVisDisplay::SetNoEndVisible ( Int_t  vis)
inline

Definition at line 205 of file BesVisDisplay.h.

205{fNoEndVis = vis;}

◆ SetPTcut()

void BesVisDisplay::SetPTcut ( Float_t  ptcut = 0.4)
virtual

Definition at line 1182 of file BesVisDisplay.cxx.

1183{
1184 fPTcut = ptcut;
1185
1186 if (fDrawAllViews) {
1187 fPad->cd(1);
1188 gPad->Modified();
1189 fPad->cd(2);
1190 gPad->Modified();
1191 fPad->cd(3);
1192 gPad->Modified();
1193 fPad->cd(4);
1194 gPad->Modified();
1195 fPad->cd();
1196 }
1197}

◆ SetPTcutEGMUNU()

void BesVisDisplay::SetPTcutEGMUNU ( Float_t  ptcut = 5)
virtual

Definition at line 1200 of file BesVisDisplay.cxx.

1201{
1202 fPTcutEGMUNU = ptcut;
1203
1204 if (fDrawAllViews) {
1205 fPad->cd(1);
1206 gPad->Modified();
1207 fPad->cd(2);
1208 gPad->Modified();
1209 fPad->cd(3);
1210 gPad->Modified();
1211 fPad->cd(4);
1212 gPad->Modified();
1213 fPad->cd();
1214 }
1215}

◆ SetQuarterVisible()

void BesVisDisplay::SetQuarterVisible ( Int_t  vis)
inline

Definition at line 203 of file BesVisDisplay.h.

203{fQuarterVis = vis;}

◆ SetTofCon()

void BesVisDisplay::SetTofCon ( Int_t  tofCon)
inline

Definition at line 199 of file BesVisDisplay.h.

199{fTofCon=tofCon;}

◆ SetTofFiredCell()

void BesVisDisplay::SetTofFiredCell ( )

Definition at line 1269 of file BesVisDisplay.cxx.

1270{
1271 int part[7] = {1,1,1,2,2,1,1,};
1272 int scin[7] = {31,32,57,31,32,59,21};
1273
1274 std::cout << "set tof fired cell" << std::endl;
1275 for (int i = 0; i < 7; i++) {
1276 fTofROOTGeo->GetPhysicalScin(part[i], 0, scin[i])->SetVisibility(1);
1277 std::cout << part[i] << " " << scin[i] << std::endl;
1278 }
1279}
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.

Referenced by GetEvent().

◆ SetTofOn()

void BesVisDisplay::SetTofOn ( Bool_t  TofOn)
virtual

Definition at line 604 of file BesVisDisplay.cxx.

605{
606 fTofOn = TofOn;
607 //fBesHeader->SetTofOn(TofOn);
608 DrawHeader();
609}

◆ SetView()

void BesVisDisplay::SetView ( Float_t  theta,
Float_t  phi 
)
virtual

Definition at line 1218 of file BesVisDisplay.cxx.

1219{
1220// change viewing angles for current event
1221
1222 fPad->cd();
1223 fDrawAllViews = kFALSE;
1224 fPhi = phi;
1225 fTheta = theta;
1226 Int_t iret;
1227
1228 TView *view = gPad->GetView();
1229 if (view) view->SetView(fPhi, fTheta, 0, iret);
1230 else Draw();
1231
1232 gPad->Modified();
1233}
c1_1 Draw()

◆ ShowNextEvent()

void BesVisDisplay::ShowNextEvent ( Int_t  delta = 1)
virtual

Definition at line 1236 of file BesVisDisplay.cxx.

1237{
1238// Display (current event_number+delta)
1239// delta = 1 shown next event
1240// delta = -1 show previous event
1241
1242 //fTheta += 10;
1243 //fPhi += 10;
1244 if (delta) {
1245 //gBesVisast->Clear();
1246 //Int_t current_event = gBesVisast->Event();
1247 //Int_t new_event = current_event + delta;
1248 //gBesVisast->GetEvent(new_event);
1249 //GetEvent(new_event);
1250 }
1251 fPad->cd();
1252 Draw();
1253}

◆ SizeFruit()

void BesVisDisplay::SizeFruit ( ) const
virtual

Definition at line 1310 of file BesVisDisplay.cxx.

1311{
1312 const Int_t npoints = 2;
1313 gSize3D.numPoints += npoints;
1314 gSize3D.numSegs += (npoints-1);
1315 gSize3D.numPolys += 0;
1316}

◆ SizeParticles()

void BesVisDisplay::SizeParticles ( ) const
virtual

Definition at line 1319 of file BesVisDisplay.cxx.

1320{
1321 //if (fDrawParticles) fParticle->SizeParticles();
1322 //printf("numPoints=%d, numSegs=%d, numPolys=%d\n",gSize3D.numPoints,gSize3D.numSegs,gSize3D.numPolys);
1323}

◆ SwitchDisplayMode()

void BesVisDisplay::SwitchDisplayMode ( Int_t  mode)
virtual

Definition at line 622 of file BesVisDisplay.cxx.

623{
624 SetDisplayMode(mode);
625 ResizePad();
626 fCanvas->Update();
627}
void SetDisplayMode(Int_t mode)
virtual void ResizePad()

Referenced by Draw(), BesClient::HandleButtons(), and Reset().

◆ SwitchPad()

void BesVisDisplay::SwitchPad ( )
virtual

Definition at line 708 of file BesVisDisplay.cxx.

709{
710 if (fDisplayMode == 0) {
711 if ((TPad*)gPad == fPadXY) fPadZR->cd();
712 else fPadXY->cd();
713 }
714
715 if (fDisplayMode == 4) {
716 if ((TPad*)gPad == fPadXY) fPadZR->cd();
717 else if ((TPad*)gPad == fPadZR) fPad3D->cd();
718 else fPadXY->cd();
719 }
720
721 fCanvas->Update();
722}

Referenced by BesClient::HandleButtons().

◆ Zin()

Float_t BesVisDisplay::Zin ( )
inline

Definition at line 213 of file BesVisDisplay.h.

213{return fZin;}

◆ Zout()

Float_t BesVisDisplay::Zout ( )
inline

Definition at line 214 of file BesVisDisplay.h.

214{return fZout;}

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