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

Public Member Functions

 InitTask (self)
 
 FinishEvent (self)
 
 ExecuteTask (self, option='')
 

Public Attributes

 comp
 
 evscene
 

Detailed Description

Definition at line 56 of file eventDisplay.py.

Member Function Documentation

◆ ExecuteTask()

eventDisplay.DrawDigi.ExecuteTask (   self,
  option = '' 
)

Definition at line 65 of file eventDisplay.py.

65 def ExecuteTask(self,option=''):
66 self.comp.DestroyElements()
67 self.comp.OpenCompound()
68 nav = ROOT.gGeoManager.GetCurrentNavigator()
69 digis = []
70 if sTree.FindBranch("Digi_ScifiHits"): digis.append(sTree.Digi_ScifiHits)
71 if sTree.FindBranch("Digi_MuFilterHits"): digis.append(sTree.Digi_MuFilterHits)
72 for branch in digis:
73 print('digis:',branch.GetName(),":",branch.GetEntries())
74 for digi in branch:
75 if not digi.isValid(): continue
76 B=ROOT.TVector3()
77 A=ROOT.TVector3()
78 detID = digi.GetDetectorID()
79 if digi.GetName() == 'MuFilterHit':
80 system = digi.GetSystem()
81 modules['MuFilter'].GetPosition(detID,A,B)
82 color = ROOT.kGreen
83 if system==1: vol = sGeo.GetVolume('volVetoBar')
84 elif system==2: vol = sGeo.GetVolume('volMuUpstreamBar')
85 elif system==3:
86 if digi.isVertical():
87 color = ROOT.kMagenta
88 vol = sGeo.GetVolume('volMuDownstreamBar_ver')
89 else:
90 color = ROOT.kBlue
91 vol = sGeo.GetVolume('volMuDownstreamBar_hor')
92 shape = vol.GetShape()
93 dx,dy,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
94 origin = shape.GetOrigin()
95 mPoint = 0.5*(A+B)
96 master = array('d',[mPoint[0],mPoint[1],mPoint[2]])
97 o = array('d',[0,0,0])
98 nav.MasterToLocal(master,o)
99
100 elif digi.GetName() == 'sndScifiHit':
101 modules['Scifi'].GetSiPMPosition(detID,A,B)
102 mPoint = 0.5*(A+B)
103 master = array('d',[mPoint[0],mPoint[1],mPoint[2]])
104 o = array('d',[0,0,0])
105 nav.MasterToLocal(master,o)
106 vol = sGeo.GetVolume('ChannelVol')
107 color = ROOT.kWhite
108 shape = vol.GetShape()
109 if digi.isVertical():
110 dy,dx,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
111 # fLengthScifiMat/2, fWidthChannel/2, fZEpoxyMat/2
112 else:
113 dx,dy,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
114
115 bx = ROOT.TEveBox( digi.GetName()+'_'+str(digi.GetDetectorID()) )
116 bx.SetPickable(ROOT.kTRUE)
117 bx.SetTitle(digi.__repr__())
118 bx.SetMainColor(color)
119 master = array('d',[0,0,0])
120 n=0
121 for edge in [ [-dx,-dy,-dz],[-dx,+dy,-dz],[+dx,+dy,-dz],[+dx,-dy,-dz],[-dx,-dy, dz],[-dx,+dy, dz],[+dx,+dy, dz],[+dx,-dy, dz]]:
122 origin = array('d',[edge[0]+o[0],edge[1]+o[1],edge[2]+o[2]])
123 nav.LocalToMaster(origin,master)
124 bx.SetVertex(n,master[0],master[1],master[2])
125 n+=1
126 self.comp.AddElement(bx)
127 self.comp.CloseCompound()
128 gEve.ElementChanged(self.evscene,True,True)
129#

◆ FinishEvent()

eventDisplay.DrawDigi.FinishEvent (   self)

Definition at line 63 of file eventDisplay.py.

63 def FinishEvent(self):
64 pass

◆ InitTask()

eventDisplay.DrawDigi.InitTask (   self)

Definition at line 58 of file eventDisplay.py.

58 def InitTask(self):
59 self.comp = ROOT.TEveCompound('Digis')
60 gEve.AddElement(self.comp)
61 sc = gEve.GetScenes()
62 self.evscene = sc.FindChild('Event scene')

Member Data Documentation

◆ comp

eventDisplay.DrawDigi.comp

Definition at line 59 of file eventDisplay.py.

◆ evscene

eventDisplay.DrawDigi.evscene

Definition at line 62 of file eventDisplay.py.


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