SND@LHC Software
Loading...
Searching...
No Matches
eventDisplay_shipLHC.Rulers Class Reference
Inheritance diagram for eventDisplay_shipLHC.Rulers:
Collaboration diagram for eventDisplay_shipLHC.Rulers:

Public Member Functions

 __init__ (self)
 
 show (self, xy=0, ticks=5)
 
 remove (self)
 

Public Attributes

 ruler
 

Detailed Description

Definition at line 694 of file eventDisplay_shipLHC.py.

Constructor & Destructor Documentation

◆ __init__()

eventDisplay_shipLHC.Rulers.__init__ (   self)

Definition at line 696 of file eventDisplay_shipLHC.py.

696 def __init__(self):
697 self.ruler = ROOT.TEveCompound('Rulers')
698 gEve.AddElement(self.ruler)

Member Function Documentation

◆ remove()

eventDisplay_shipLHC.Rulers.remove (   self)

Definition at line 794 of file eventDisplay_shipLHC.py.

794 def remove(self):
795 self.ruler.DestroyElements()
796

◆ show()

eventDisplay_shipLHC.Rulers.show (   self,
  xy = 0,
  ticks = 5 
)

Definition at line 699 of file eventDisplay_shipLHC.py.

699 def show(self,xy=0,ticks=5):
700 self.ruler.DestroyElements()
701 self.ruler.OpenCompound()
702 xpos,ypos = -500., -1500.
703 zstart = ShipGeo.target.z0
704 zlength = ShipGeo.MuonStation3.z - zstart + 10*u.m
705 a1 = ROOT.TEveLine()
706 a1.SetNextPoint(xpos,ypos, zstart)
707 a1.SetNextPoint(xpos,ypos, zstart+zlength)
708 a1.SetMainColor(ROOT.kAzure-9)
709 a1.SetLineWidth(30)
710 #self.ruler.AddElement(a1)
711 z=zstart
712 for i in range(int(zlength/100/ticks)):
713 m = ROOT.TEveLine()
714 m.SetNextPoint(xpos,ypos, z)
715 m.SetNextPoint(xpos-1*u.m,ypos,z)
716 m.SetMainColor(ROOT.kRed)
717 m.SetLineWidth(5)
718 self.ruler.AddElement(m)
719 t1 = ROOT.TEveText(str(i*ticks)+'m')
720 t1.SetMainColor(ROOT.kGray+3)
721 t1.SetFontSize(5)
722 t1.RefMainTrans().SetPos(xpos-0.1*u.m,ypos+0.2*u.m,z)
723 self.ruler.AddElement(t1)
724 z+=ticks*u.m
725 xpos,ypos = 0., 0.
726 if xy==0: z = ShipGeo.MuonStation3.z+6*u.m
727 else: z=xy
728 ylength = 7*u.m
729 a2 = ROOT.TEveLine()
730 a2.SetNextPoint(xpos,-ylength, z)
731 a2.SetNextPoint(xpos,ylength, z)
732 a2.SetMainColor(ROOT.kAzure-9)
733 a2.SetLineWidth(30)
734 #self.ruler.AddElement(a2)
735 ypos=-ylength
736 for i in range(-int(ylength/100),int(ylength/100),1):
737 m = ROOT.TEveLine()
738 m.SetNextPoint(xpos,ypos, z)
739 m.SetNextPoint(xpos+0.05*u.m,ypos,z)
740 m.SetMainColor(ROOT.kRed)
741 m.SetLineWidth(3)
742 self.ruler.AddElement(m)
743 t1 = ROOT.TEveText(str(i)+'m')
744 t1.SetMainColor(ROOT.kGray+3)
745 t1.SetFontSize(5)
746 t1.RefMainTrans().SetPos(xpos-0.5*u.m,ypos,z)
747 self.ruler.AddElement(t1)
748 ypos+=1*u.m
749 ty = ROOT.TEveText("y-axis")
750 ty.SetFontSize(10)
751 ty.RefMainTrans().SetPos(0.,ypos+1*u.m,z)
752 ty.SetMainColor(ROOT.kRed-2)
753 self.ruler.AddElement(ty)
754 xpos,ypos = 0., 0.
755 if xy==0: z = ShipGeo.MuonStation3.z+10*u.m
756 xlength = 3*u.m
757 a3 = ROOT.TEveLine()
758 a3.SetNextPoint(-xlength,0, z)
759 a3.SetNextPoint(xlength,0, z)
760 a3.SetMainColor(ROOT.kAzure-9)
761 a3.SetLineWidth(30)
762 #self.ruler.AddElement(a3)
763 xpos=-xlength
764 for i in range(-int(xlength/100),int(xlength/100),1):
765 m = ROOT.TEveLine()
766 m.SetNextPoint(xpos,ypos, z)
767 m.SetNextPoint(xpos,ypos-0.05*u.m,z)
768 m.SetMainColor(ROOT.kRed)
769 m.SetLineWidth(3)
770 self.ruler.AddElement(m)
771 t1 = ROOT.TEveText(str(i)+'m')
772 t1.SetMainColor(ROOT.kGray+3)
773 t1.SetFontSize(5)
774 t1.RefMainTrans().SetPos(xpos,ypos-0.1*u.m,z)
775 self.ruler.AddElement(t1)
776 xpos+=1*u.m
777 tx = ROOT.TEveText("x-axis")
778 tx.SetFontSize(10)
779 tx.RefMainTrans().SetPos(xpos+1*u.m,0.,z)
780 tx.SetMainColor(ROOT.kRed-2)
781 self.ruler.AddElement(tx)
782 t1 = ROOT.TEveText("SHiP")
783 t1.SetFontSize(200)
784 t1.RefMainTrans().SetPos(0.,600.,ShipGeo.TrackStation1.z-10*u.m)
785 t1.PtrMainTrans().RotateLF(1, 3, ROOT.TMath.PiOver2())
786 t1.SetMainColor(ROOT.kOrange-2)
787 t1.SetFontMode(ROOT.TGLFont.kExtrude)
788 t1.SetLighting(ROOT.kTRUE)
789 self.ruler.AddElement(t1)
790 self.ruler.CloseCompound()
791 sc = ROOT.gEve.GetScenes()
792 geoscene = sc.FindChild('Geometry scene')
793 ROOT.gEve.ElementChanged(geoscene,True,True)

Member Data Documentation

◆ ruler

eventDisplay_shipLHC.Rulers.ruler

Definition at line 697 of file eventDisplay_shipLHC.py.


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