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

Public Member Functions

 InitTask (self)
 
 NextEvent (self, i=-1)
 
 rotateView (self, hor=0, ver=0)
 
 topView (self)
 
 bottomView (self)
 
 frontView (self)
 
 backView (self)
 
 leftView (self)
 
 rightView (self)
 
 transparentMode (self, mode='on')
 
 InitTask (self)
 
 update (self)
 
 NextEvent (self, i=-1)
 
 rotateView (self, hor=0, ver=0)
 
 topView (self)
 
 bottomView (self)
 
 frontView (self)
 
 backView (self)
 
 leftView (self)
 
 rightView (self)
 
 transparentMode (self, mode='on')
 
 light (self, step=0.2, source='all')
 
 fittrack (self)
 

Public Attributes

 n
 
 first
 
 digi
 

Static Public Attributes

str ecalGeo = ecalGeoFile+'z'+str(ShipGeo.ecal.z)+".geo"
 
 ecalFiller
 
 rc = sTree.GetEvent(0)
 
 ecalStructure
 
 calos
 
 veto
 
 tracks
 
 ioBar
 
 TransparentMode
 
 v1 = gEve.GetDefaultViewer()
 
 tr = gEve.GetBrowser().GetTabRight()
 
 t0 = tr.GetTabTab(0)
 

Detailed Description

Definition at line 546 of file eventDisplay.py.

Member Function Documentation

◆ backView() [1/2]

eventDisplay.EventLoop.backView (   self)

Definition at line 613 of file eventDisplay.py.

613 def backView(self):
614 self.rotateView(0.,-ROOT.TMath.Pi()/2.) # rotation around y or x axis

◆ backView() [2/2]

eventDisplay.EventLoop.backView (   self)

Definition at line 444 of file eventDisplay.py.

444 def backView(self):
445 self.rotateView(0.,-ROOT.TMath.Pi()/2.) # rotation around y or x axis

◆ bottomView() [1/2]

eventDisplay.EventLoop.bottomView (   self)

Definition at line 609 of file eventDisplay.py.

609 def bottomView(self):
610 self.rotateView(-ROOT.TMath.Pi()/2.,0.) # rotation around z axis

◆ bottomView() [2/2]

eventDisplay.EventLoop.bottomView (   self)

Definition at line 440 of file eventDisplay.py.

440 def bottomView(self):
441 self.rotateView(-ROOT.TMath.Pi()/2.,0.) # rotation around z axis

◆ fittrack()

eventDisplay.EventLoop.fittrack (   self)

Definition at line 478 of file eventDisplay.py.

478 def fittrack(self):
479 trackTask.ExecuteTask()
480 print('tracks found',len(sTree.fittedTracks) )
481 self.tracks.DrawFittedTracks()
482
483# add projections DOES NOT WORK YET AS FORESEEN, under investigation. 30.11.2016

◆ frontView() [1/2]

eventDisplay.EventLoop.frontView (   self)

Definition at line 611 of file eventDisplay.py.

611 def frontView(self):
612 self.rotateView(0.,ROOT.TMath.Pi()/2.) # rotation around y or x axis

◆ frontView() [2/2]

eventDisplay.EventLoop.frontView (   self)

Definition at line 442 of file eventDisplay.py.

442 def frontView(self):
443 self.rotateView(0.,ROOT.TMath.Pi()/2.) # rotation around y or x axis

◆ InitTask() [1/2]

eventDisplay.EventLoop.InitTask (   self)

Definition at line 548 of file eventDisplay.py.

548 def InitTask(self):
549 self.n = 0
550 self.first = True
551 if sGeo.GetVolume('volTarget'): DisplayNuDetector()
552 if sGeo.GetVolume('Ecal'):

◆ InitTask() [2/2]

eventDisplay.EventLoop.InitTask (   self)

Definition at line 374 of file eventDisplay.py.

374 def InitTask(self):
375 self.n = 0
376 self.first = True
377 rc = sTree.GetEvent(0)
378 modules['Scifi'].SiPMmapping()
379 self.digi = DrawDigi()
380 self.digi.InitTask()
381 self.tracks = DrawTracks()
382 self.tracks.InitTask()
383# create GUI
384 self.ioBar = IO()
385 self.TransparentMode = 0
386 v1 = gEve.GetDefaultViewer()
387 v1.GetEveFrame().HideAllDecorations()
388 tr=gEve.GetBrowser().GetTabRight()
389 t0 = tr.GetTabTab(0)
390 t0.SetText(ROOT.TGString('3D'))
391#
392# some default setup
393 SND = ['SciFi','Wall','volVetoBar ','volFeBlock',' volMuUpstreamBar ','volMuDownstreamBar_hor ','volMuDownstreamBar_ver ']
394 tunnel = sGeo.GetVolume('Tunnel')
395 tunnel.SetVisibility(0)
396 tunnel.SetVisDaughters(0)
397 br = gEve.GetBrowser()
398 br.SetWindowName('SND@LHC Eve Window')
399 br.SetWidth(1600)
400 sc = gEve.GetScenes()
401 geoscene = sc.FindChild('Geometry scene')
402 gEve.ElementChanged(geoscene,True,True)
403
404 v = gEve.GetDefaultGLViewer()
405 camera = v.CurrentCamera()
406 for i in range(2): # don't know why this needs to be executed twice to update the screen
407 camera.Reset()
408 center = array('d',[-19.,46.,400.])
409 camera.Configure(1.6, 0, center, -1.57, 0)
410 v.DoDraw()
411

◆ leftView() [1/2]

eventDisplay.EventLoop.leftView (   self)

Definition at line 615 of file eventDisplay.py.

615 def leftView(self):
616 self.rotateView(0.,ROOT.TMath.Pi()) # rotation around y or x axis

◆ leftView() [2/2]

eventDisplay.EventLoop.leftView (   self)

Definition at line 446 of file eventDisplay.py.

446 def leftView(self):
447 self.rotateView(0.,ROOT.TMath.Pi()) # rotation around y or x axis

◆ light()

eventDisplay.EventLoop.light (   self,
  step = 0.2,
  source = 'all' 
)

Definition at line 465 of file eventDisplay.py.

465 def light(self,step=0.2,source='all'):
466 v1 = gEve.GetDefaultViewer()
467 gl = v1.GetGLViewer()
468 status = {}
469 sources = ["Side","Front","Specular"]
470 ls = gl.GetLightSet()
471 for s in sources:
472 exec("status['"+s+"']=ls.Get"+s+"Power()")
473 if source!='all': sources = [source]
474 for s in sources:
475 newPw = str(status[s]+step)
476 exec("ls.Set"+s+"Power("+newPw+")")
477 self.update()

◆ NextEvent() [1/2]

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

Definition at line 578 of file eventDisplay.py.

578 def NextEvent(self,i=-1):
579 if i<0: self.n+=1
580 else : self.n=i
581 fRun.Run(self.n,self.n+1) # go for first event
582# check if tracks are made from real pattern recognition
583 if sTree.GetBranch("FitTracks_PR"): sTree.FitTracks = sTree.FitTracks_PR
584 if sTree.GetBranch("fitTrack2MC_PR"): sTree.fitTrack2MC = sTree.fitTrack2MC_PR
585 if sTree.GetBranch("Particles_PR"): sTree.Particles = sTree.Particles_PR
586 if hasattr(self,"tracks"): self.tracks.ExecuteTask()
587 if sTree.FindBranch("EcalClusters"):
588 if sTree.EcalClusters.GetEntries()>0:
589 self.ecalFiller.Exec('start',sTree.EcalPointLite)
590 self.calos.ExecuteTask()
591 if sTree.FindBranch("Digi_SBTHits"): self.veto.ExecuteTask()
592 if ROOT.gROOT.FindObject('Root Canvas EnergyLoss'): evd_fillEnergy.execute()
593 print('Event %i ready'%(self.n))
594# make pointsets pickable
595 for x in mcHits:
596 p = ROOT.gEve.GetCurrentEvent().FindChild(mcHits[x].GetName())
597 if p:
598 p.SetPickable(ROOT.kTRUE)
599 p.SetTitle(p.__repr__())

◆ NextEvent() [2/2]

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

Definition at line 417 of file eventDisplay.py.

417 def NextEvent(self,i=-1):
418 if i<0: self.n+=1
419 else : self.n=i
420 fRun.Run(self.n,self.n+1) # go for first event
421 if sTree.FindBranch("Digi_MuFilterHits") or sTree.FindBranch("Digi_ScifiHits"):
422 self.digi.ExecuteTask()
423 print('Event %i ready'%(self.n))
424# make pointsets pickable
425 if isMC:
426 for x in mcHits:
427 p = ROOT.gEve.GetCurrentEvent().FindChild(mcHits[x].GetName())
428 if p:
429 p.SetPickable(ROOT.kTRUE)
430 p.SetTitle(p.__repr__())

◆ rightView() [1/2]

eventDisplay.EventLoop.rightView (   self)

Definition at line 617 of file eventDisplay.py.

617 def rightView(self):
618 self.rotateView(0.,ROOT.TMath.Pi()) # rotation around y or x axis

◆ rightView() [2/2]

eventDisplay.EventLoop.rightView (   self)

Definition at line 448 of file eventDisplay.py.

448 def rightView(self):
449 self.rotateView(0.,ROOT.TMath.Pi()) # rotation around y or x axis

◆ rotateView() [1/2]

eventDisplay.EventLoop.rotateView (   self,
  hor = 0,
  ver = 0 
)

Definition at line 600 of file eventDisplay.py.

600 def rotateView(self,hor=0,ver=0):
601 v = ROOT.gEve.GetDefaultGLViewer()
602 cam = v.CurrentCamera()
603 cam.Reset()
604 if hor!=0 or ver!=0:
605 cam.RotateRad(hor,ver)
606 v.DoDraw()

◆ rotateView() [2/2]

eventDisplay.EventLoop.rotateView (   self,
  hor = 0,
  ver = 0 
)

Definition at line 431 of file eventDisplay.py.

431 def rotateView(self,hor=0,ver=0):
432 v = ROOT.gEve.GetDefaultGLViewer()
433 cam = v.CurrentCamera()
434 cam.Reset()
435 if hor!=0 or ver!=0:
436 cam.RotateRad(hor,ver)
437 v.DoDraw()

◆ topView() [1/2]

eventDisplay.EventLoop.topView (   self)

Definition at line 607 of file eventDisplay.py.

607 def topView(self):
608 self.rotateView(ROOT.TMath.Pi()/2.,0.) # rotation around z axis

◆ topView() [2/2]

eventDisplay.EventLoop.topView (   self)

Definition at line 438 of file eventDisplay.py.

438 def topView(self):
439 self.rotateView(ROOT.TMath.Pi()/2.,0.) # rotation around z axis

◆ transparentMode() [1/2]

eventDisplay.EventLoop.transparentMode (   self,
  mode = 'on' 
)

Definition at line 619 of file eventDisplay.py.

619 def transparentMode(self,mode='on'):
620 for m in transparentMaterials:
621 mat = ROOT.gGeoManager.GetMaterial(m)
622 if not mat:continue
623 if mode.lower()=='on' or mode==1:
624 mat.SetTransparency(transparentMaterials[m])
625 self.TransparentMode = 1
626 else:
627 mat.SetTransparency("\x00")
628 self.TransparentMode = 0
629 sc = gEve.GetScenes()
630 geoscene = sc.FindChild('Geometry scene')
631 if geoscene: gEve.ElementChanged(geoscene,True,True)
632# add projections DOES NOT WORK YET AS FORESEEN, under investigation. 30.11.2016

◆ transparentMode() [2/2]

eventDisplay.EventLoop.transparentMode (   self,
  mode = 'on' 
)

Definition at line 450 of file eventDisplay.py.

450 def transparentMode(self,mode='on'):
451 for m in transparentMaterials:
452 mat = ROOT.gGeoManager.GetMaterial(m)
453 if not mat:continue
454 if mode.lower()=='on' or mode==1:
455 mat.SetTransparency(transparentMaterials[m])
456 vol = sGeo.FindVolumeFast('HorMatVolume')
457 vol.SetTransparency(99)
458 vol = sGeo.FindVolumeFast('VertMatVolume')
459 vol.SetTransparency(99)
460 self.TransparentMode = 1
461 else:
462 mat.SetTransparency("\x00")
463 self.TransparentMode = 0
464 self.update()

◆ update()

eventDisplay.EventLoop.update (   self)

Definition at line 412 of file eventDisplay.py.

412 def update(self):
413 sc = gEve.GetScenes()
414 geoscene = sc.FindChild('Geometry scene')
415 gEve.ElementChanged(geoscene,True,True)
416

Member Data Documentation

◆ calos

eventDisplay.EventLoop.calos
static

Definition at line 564 of file eventDisplay.py.

◆ digi

eventDisplay.EventLoop.digi

Definition at line 379 of file eventDisplay.py.

◆ ecalFiller

eventDisplay.EventLoop.ecalFiller
static

Definition at line 556 of file eventDisplay.py.

◆ ecalGeo

str eventDisplay.EventLoop.ecalGeo = ecalGeoFile+'z'+str(ShipGeo.ecal.z)+".geo"
static

Definition at line 554 of file eventDisplay.py.

◆ ecalStructure

eventDisplay.EventLoop.ecalStructure
static

Definition at line 563 of file eventDisplay.py.

◆ first

eventDisplay.EventLoop.first

Definition at line 550 of file eventDisplay.py.

◆ ioBar

eventDisplay.EventLoop.ioBar
static

Definition at line 571 of file eventDisplay.py.

◆ n

eventDisplay.EventLoop.n

Definition at line 549 of file eventDisplay.py.

◆ rc

eventDisplay.EventLoop.rc = sTree.GetEvent(0)
static

Definition at line 562 of file eventDisplay.py.

◆ t0

eventDisplay.EventLoop.t0 = tr.GetTabTab(0)
static

Definition at line 576 of file eventDisplay.py.

◆ tr

eventDisplay.EventLoop.tr = gEve.GetBrowser().GetTabRight()
static

Definition at line 575 of file eventDisplay.py.

◆ tracks

eventDisplay.EventLoop.tracks
static

Definition at line 568 of file eventDisplay.py.

◆ TransparentMode

eventDisplay.EventLoop.TransparentMode
static

Definition at line 572 of file eventDisplay.py.

◆ v1

eventDisplay.EventLoop.v1 = gEve.GetDefaultViewer()
static

Definition at line 573 of file eventDisplay.py.

◆ veto

eventDisplay.EventLoop.veto
static

Definition at line 566 of file eventDisplay.py.


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