FairShip
Loading...
Searching...
No Matches
eventDisplay.EventLoop Class Reference
Inheritance diagram for eventDisplay.EventLoop:
Collaboration diagram for eventDisplay.EventLoop:

Public Member Functions

None InitTask (self)
 
None NextEvent (self, int i=-1)
 
None rotateView (self, float|int hor=0, float|int ver=0)
 
None topView (self)
 
None bottomView (self)
 
None frontView (self)
 
None backView (self)
 
None leftView (self)
 
None rightView (self)
 
None transparentMode (self, str mode="on")
 

Public Attributes

 n
 
 first
 
 veto
 
 tracks
 
 ioBar
 
 TransparentMode
 

Detailed Description

Definition at line 703 of file eventDisplay.py.

Member Function Documentation

◆ backView()

None eventDisplay.EventLoop.backView (   self)

Definition at line 768 of file eventDisplay.py.

768 def backView(self) -> None:
769 self.rotateView(0.0, -ROOT.TMath.Pi() / 2.0) # rotation around y or x axis
770

◆ bottomView()

None eventDisplay.EventLoop.bottomView (   self)

Definition at line 762 of file eventDisplay.py.

762 def bottomView(self) -> None:
763 self.rotateView(-ROOT.TMath.Pi() / 2.0, 0.0) # rotation around z axis
764

◆ frontView()

None eventDisplay.EventLoop.frontView (   self)

Definition at line 765 of file eventDisplay.py.

765 def frontView(self) -> None:
766 self.rotateView(0.0, ROOT.TMath.Pi() / 2.0) # rotation around y or x axis
767

◆ InitTask()

None eventDisplay.EventLoop.InitTask (   self)

Definition at line 706 of file eventDisplay.py.

706 def InitTask(self) -> None:
707 self.n = 0
708 self.first = True
709 if sGeo.GetVolume("volTarget"):
710 DisplayNuDetector()
711 self.veto = DrawVetoDigi()
712 self.veto.InitTask()
713 self.tracks = DrawTracks()
714 self.tracks.InitTask()
715 # create SHiP GUI
716 self.ioBar = IO()
717 self.TransparentMode = 0
718 v1 = gEve.GetDefaultViewer()
719 v1.GetEveFrame().HideAllDecorations()
720 tr = gEve.GetBrowser().GetTabRight()
721 t0 = tr.GetTabTab(0)
722 t0.SetText(ROOT.TGString("3D"))
723

◆ leftView()

None eventDisplay.EventLoop.leftView (   self)

Definition at line 771 of file eventDisplay.py.

771 def leftView(self) -> None:
772 self.rotateView(0.0, ROOT.TMath.Pi()) # rotation around y or x axis
773

◆ NextEvent()

None eventDisplay.EventLoop.NextEvent (   self,
int   i = -1 
)

Definition at line 724 of file eventDisplay.py.

724 def NextEvent(self, i: int = -1) -> None:
725 if i < 0:
726 self.n += 1
727 else:
728 self.n = i
729 fRun.Run(self.n, self.n + 1) # go for first event
730 # check if tracks are made from real pattern recognition
731 if sTree.GetBranch("FitTracks_PR"):
732 sTree.FitTracks = sTree.FitTracks_PR
733 if sTree.GetBranch("fitTrack2MC_PR"):
734 sTree.fitTrack2MC = sTree.fitTrack2MC_PR
735 if sTree.GetBranch("Particles_PR"):
736 sTree.Particles = sTree.Particles_PR
737 if hasattr(self, "tracks"):
738 self.tracks.ExecuteTask()
739 if sTree.FindBranch("Digi_SBTHits"):
740 self.veto.ExecuteTask()
741 if ROOT.gROOT.FindObject("Root Canvas EnergyLoss"):
743 print("Event %i ready" % (self.n))
744 # make pointsets pickable
745 for x in mcHits:
746 p = ROOT.gEve.GetCurrentEvent().FindChild(mcHits[x].GetName())
747 if p:
748 p.SetPickable(ROOT.kTRUE)
749 p.SetTitle(p.__repr__())
750

◆ rightView()

None eventDisplay.EventLoop.rightView (   self)

Definition at line 774 of file eventDisplay.py.

774 def rightView(self) -> None:
775 self.rotateView(0.0, ROOT.TMath.Pi()) # rotation around y or x axis
776

◆ rotateView()

None eventDisplay.EventLoop.rotateView (   self,
float | int   hor = 0,
float | int   ver = 0 
)

Definition at line 751 of file eventDisplay.py.

751 def rotateView(self, hor: float | int = 0, ver: float | int = 0) -> None:
752 v = ROOT.gEve.GetDefaultGLViewer()
753 cam = v.CurrentCamera()
754 cam.Reset()
755 if hor != 0 or ver != 0:
756 cam.RotateRad(hor, ver)
757 v.DoDraw()
758

◆ topView()

None eventDisplay.EventLoop.topView (   self)

Definition at line 759 of file eventDisplay.py.

759 def topView(self) -> None:
760 self.rotateView(ROOT.TMath.Pi() / 2.0, 0.0) # rotation around z axis
761

◆ transparentMode()

None eventDisplay.EventLoop.transparentMode (   self,
str   mode = "on" 
)

Definition at line 777 of file eventDisplay.py.

777 def transparentMode(self, mode: str = "on") -> None:
778 for m in transparentMaterials:
779 mat = ROOT.gGeoManager.GetMaterial(m)
780 if not mat:
781 continue
782 if mode.lower() == "on" or mode == 1:
783 mat.SetTransparency(transparentMaterials[m])
784 self.TransparentMode = 1
785 else:
786 mat.SetTransparency("\x00")
787 self.TransparentMode = 0
788 sc = gEve.GetScenes()
789 geoscene = sc.FindChild("Geometry scene")
790 if geoscene:
791 gEve.ElementChanged(geoscene, True, True)
792
793
794# add projections DOES NOT WORK YET AS FORESEEN, under investigation. 30.11.2016

Member Data Documentation

◆ first

eventDisplay.EventLoop.first

Definition at line 708 of file eventDisplay.py.

◆ ioBar

eventDisplay.EventLoop.ioBar

Definition at line 716 of file eventDisplay.py.

◆ n

eventDisplay.EventLoop.n

Definition at line 707 of file eventDisplay.py.

◆ tracks

eventDisplay.EventLoop.tracks

Definition at line 713 of file eventDisplay.py.

◆ TransparentMode

eventDisplay.EventLoop.TransparentMode

Definition at line 717 of file eventDisplay.py.

◆ veto

eventDisplay.EventLoop.veto

Definition at line 711 of file eventDisplay.py.


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