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

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

int n = 0
bool first = True
 veto = DrawVetoDigi()
 tracks = DrawTracks()
 ioBar = IO()
int TransparentMode = 0

Detailed Description

Definition at line 727 of file eventDisplay.py.

Member Function Documentation

◆ backView()

None eventDisplay.EventLoop.backView ( self)

Definition at line 794 of file eventDisplay.py.

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

◆ bottomView()

None eventDisplay.EventLoop.bottomView ( self)

Definition at line 788 of file eventDisplay.py.

788 def bottomView(self) -> None:
789 self.rotateView(-ROOT.TMath.Pi() / 2.0, 0.0) # rotation around z axis
790

◆ frontView()

None eventDisplay.EventLoop.frontView ( self)

Definition at line 791 of file eventDisplay.py.

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

◆ InitTask()

None eventDisplay.EventLoop.InitTask ( self)

Definition at line 730 of file eventDisplay.py.

730 def InitTask(self) -> None:
731 self.n = 0
732 self.first = True
733 if sGeo.GetVolume("volTarget"):
734 DisplayNuDetector()
735 self.veto = DrawVetoDigi()
736 self.veto.InitTask()
737 self.tracks = DrawTracks()
738 self.tracks.InitTask()
739 # create SHiP GUI
740 self.ioBar = IO()
741 self.TransparentMode = 0
742 v1 = gEve.GetDefaultViewer()
743 v1.GetEveFrame().HideAllDecorations()
744 tr = gEve.GetBrowser().GetTabRight()
745 t0 = tr.GetTabTab(0)
746 t0.SetText(ROOT.TGString("3D"))
747

◆ leftView()

None eventDisplay.EventLoop.leftView ( self)

Definition at line 797 of file eventDisplay.py.

797 def leftView(self) -> None:
798 self.rotateView(0.0, ROOT.TMath.Pi()) # rotation around y or x axis
799

◆ NextEvent()

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

Definition at line 748 of file eventDisplay.py.

748 def NextEvent(self, i: int = -1) -> None:
749 if fRun is None:
750 raise RuntimeError("NextEvent called before fRun was initialised")
751 if i < 0:
752 self.n += 1
753 else:
754 self.n = i
755 fRun.Run(self.n, self.n + 1) # go for first event
756 # check if tracks are made from real pattern recognition
757 if sTree.GetBranch("FitTracks_PR"):
758 sTree.FitTracks = sTree.FitTracks_PR
759 if sTree.GetBranch("fitTrack2MC_PR"):
760 sTree.fitTrack2MC = sTree.fitTrack2MC_PR
761 if sTree.GetBranch("Particles_PR"):
762 sTree.Particles = sTree.Particles_PR
763 if hasattr(self, "tracks"):
764 self.tracks.ExecuteTask()
765 if sTree.FindBranch("Digi_SBTHits"):
766 self.veto.ExecuteTask()
767 if ROOT.gROOT.FindObject("Root Canvas EnergyLoss"):
769 print("Event %i ready" % (self.n))
770 # make pointsets pickable
771 for x in mcHits:
772 p = ROOT.gEve.GetCurrentEvent().FindChild(mcHits[x].GetName())
773 if p:
774 p.SetPickable(ROOT.kTRUE)
775 p.SetTitle(p.__repr__())
776

◆ rightView()

None eventDisplay.EventLoop.rightView ( self)

Definition at line 800 of file eventDisplay.py.

800 def rightView(self) -> None:
801 self.rotateView(0.0, ROOT.TMath.Pi()) # rotation around y or x axis
802

◆ rotateView()

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

Definition at line 777 of file eventDisplay.py.

777 def rotateView(self, hor: float | int = 0, ver: float | int = 0) -> None:
778 v = ROOT.gEve.GetDefaultGLViewer()
779 cam = v.CurrentCamera()
780 cam.Reset()
781 if hor != 0 or ver != 0:
782 cam.RotateRad(hor, ver)
783 v.DoDraw()
784

◆ topView()

None eventDisplay.EventLoop.topView ( self)

Definition at line 785 of file eventDisplay.py.

785 def topView(self) -> None:
786 self.rotateView(ROOT.TMath.Pi() / 2.0, 0.0) # rotation around z axis
787

◆ transparentMode()

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

Definition at line 803 of file eventDisplay.py.

803 def transparentMode(self, mode: str = "on") -> None:
804 for m in transparentMaterials:
805 mat = ROOT.gGeoManager.GetMaterial(m)
806 if not mat:
807 continue
808 if mode.lower() == "on" or mode == 1:
809 mat.SetTransparency(transparentMaterials[m])
810 self.TransparentMode = 1
811 else:
812 mat.SetTransparency("\x00")
813 self.TransparentMode = 0
814 sc = gEve.GetScenes()
815 geoscene = sc.FindChild("Geometry scene")
816 if geoscene:
817 gEve.ElementChanged(geoscene, True, True)
818
819
820# add projections DOES NOT WORK YET AS FORESEEN, under investigation. 30.11.2016

Member Data Documentation

◆ first

bool eventDisplay.EventLoop.first = True

Definition at line 732 of file eventDisplay.py.

◆ ioBar

eventDisplay.EventLoop.ioBar = IO()

Definition at line 740 of file eventDisplay.py.

◆ n

eventDisplay.EventLoop.n = 0

Definition at line 731 of file eventDisplay.py.

◆ tracks

eventDisplay.EventLoop.tracks = DrawTracks()

Definition at line 737 of file eventDisplay.py.

◆ TransparentMode

int eventDisplay.EventLoop.TransparentMode = 0

Definition at line 741 of file eventDisplay.py.

◆ veto

eventDisplay.EventLoop.veto = DrawVetoDigi()

Definition at line 735 of file eventDisplay.py.


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