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

Public Member Functions

 InitTask (self, ecalStructure)
 
 FinishEvent (self)
 
 ExecuteTask (self, option='')
 
 DrawParticle (self, n)
 

Public Attributes

 comp
 
 evscene
 
 z_ecal
 
 ecalStructure
 
 Targetz
 

Detailed Description

Definition at line 120 of file eventDisplay.py.

Member Function Documentation

◆ DrawParticle()

eventDisplay.DrawEcalCluster.DrawParticle (   self,
  n 
)

Definition at line 163 of file eventDisplay.py.

163 def DrawParticle(self,n):
164 self.comp.OpenCompound()
165 DTrack = ROOT.TEveLine()
166 DTrack.SetPickable(ROOT.kTRUE)
167 DTrack.SetMainColor(ROOT.kCyan)
168 DTrack.SetLineWidth(4)
169 aP=sTree.Particles[n]
170 DTrack.SetTitle(aP.__repr__())
171 DTrack.SetName('Prtcle_'+str(n))
172 DTrack.SetNextPoint(aP.Vx(),aP.Vy(),aP.Vz())
173 lam = (self.Targetz - aP.Vz())/aP.Pz()
174 DTrack.SetNextPoint(aP.Vx()+lam*aP.Px(),aP.Vy()+lam*aP.Py(),self.Targetz)
175 self.comp.AddElement(DTrack)
176 self.comp.CloseCompound()
177 gEve.ElementChanged(self.evscene,True,True)
178#

◆ ExecuteTask()

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

Definition at line 133 of file eventDisplay.py.

133 def ExecuteTask(self,option=''):
134 self.comp.DestroyElements()
135 self.comp.OpenCompound()
136 cl=-1
137 for aClus in sTree.EcalClusters:
138# ecal cell dx=dy=2cm, dz=21.84cm
139 cl+=1
140 for i in range( aClus.Size() ):
141 mccell = self.ecalStructure.GetHitCell(aClus.CellNum(i)) # Get i'th cell of the cluster.
142 if not mccell: continue
143 x1,y1,x2,y2,dz = mccell.X1(),mccell.Y1(),mccell.X2(),mccell.Y2(),mccell.GetEnergy()/u.GeV*0.5*u.m
144 if mccell.GetEnergy()/u.MeV < 4. : continue
145# ADC noise simulated Guassian with \sigma=1 MeV
146 DClus = ROOT.TEveBox()
147 DClus.SetName('EcalCluster_'+str(cl)+'_'+str(i))
148 DClus.SetPickable(ROOT.kTRUE)
149 DClus.SetTitle(aClus.__repr__())
150 DClus.SetMainColor(ROOT.kRed-4)
151 DClus.SetMainTransparency("\x10")
152 DClus.SetVertex(0,x1,y1,self.z_ecal)
153 DClus.SetVertex(1,x1,y1,self.z_ecal+dz)
154 DClus.SetVertex(2,x2,y1,self.z_ecal+dz)
155 DClus.SetVertex(3,x2,y1,self.z_ecal)
156 DClus.SetVertex(4,x1,y2,self.z_ecal)
157 DClus.SetVertex(5,x1,y2,self.z_ecal+dz)
158 DClus.SetVertex(6,x2,y2,self.z_ecal+dz)
159 DClus.SetVertex(7,x2,y2,self.z_ecal)
160 self.comp.AddElement(DClus)
161 self.comp.CloseCompound()
162 gEve.ElementChanged(self.evscene,True,True)

◆ FinishEvent()

eventDisplay.DrawEcalCluster.FinishEvent (   self)

Definition at line 131 of file eventDisplay.py.

131 def FinishEvent(self):
132 pass

◆ InitTask()

eventDisplay.DrawEcalCluster.InitTask (   self,
  ecalStructure 
)

Definition at line 122 of file eventDisplay.py.

122 def InitTask(self,ecalStructure):
123# prepare ecal structure
124 self.comp = ROOT.TEveCompound('Ecal Clusters')
125 gEve.AddElement(self.comp)
126 sc = gEve.GetScenes()
127 self.evscene = sc.FindChild('Event scene')
128 mE = top.GetNode('Ecal_1').GetMatrix()
129 self.z_ecal = mE.GetTranslation()[2]
130 self.ecalStructure = ecalStructure

Member Data Documentation

◆ comp

eventDisplay.DrawEcalCluster.comp

Definition at line 124 of file eventDisplay.py.

◆ ecalStructure

eventDisplay.DrawEcalCluster.ecalStructure

Definition at line 130 of file eventDisplay.py.

◆ evscene

eventDisplay.DrawEcalCluster.evscene

Definition at line 127 of file eventDisplay.py.

◆ Targetz

eventDisplay.DrawEcalCluster.Targetz

Definition at line 174 of file eventDisplay.py.

◆ z_ecal

eventDisplay.DrawEcalCluster.z_ecal

Definition at line 129 of file eventDisplay.py.


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