4from argparse
import ArgumentParser
5from ShipGeoConfig
import ConfigRegistry
6from rootpyPickler
import Unpickler
9from decorators
import *
10import shipRoot_conf,shipDet_conf
12G = open(
'eveGlobal.py',
'w')
17pdg = ROOT.TDatabasePDG.Instance()
20gEnv.SetValue(
'Eve.Viewer.HideMenus',
'off')
23withAllMCTracks =
False
25transparentMaterials = {
'air':99,
'iron':99,
'aluminium':90,
'EmulsionFilmMixture':90,
'Polycarbonate':90,
26'CarbonComposite':90,
'Aluminum':90,
'rohacell':90,
'Scintillator':90,
'tungstenalloySND':99,
'polyvinyltoluene':90}
28parser = ArgumentParser()
30parser.add_argument(
"-f",
"--inputFile", dest=
"InputFile", help=
"Input file", required=
True)
31parser.add_argument(
"-g",
"--geoFile", dest=
"geoFile", help=
"ROOT geofile", required=
True)
32parser.add_argument(
"-p",
"--paramFile", dest=
"ParFile", help=
"FairRoot param file", required=
False, default=
None)
33parser.add_argument(
"--Debug", dest=
"Debug", help=
"Switch on debugging", required=
False, action=
"store_true")
34parser.add_argument(
"-o",
"--outFile", dest=
"OutputFile", help=
"Output file", required=
False,default=
None)
36parser.add_argument(
"-H",
"--houghTransform", dest=
"houghTransform", help=
"do not use hough transform for track reco", action=
'store_false',default=
True)
37parser.add_argument(
"-t",
"--tolerance", dest=
"tolerance", type=float, help=
"How far away from Hough line hits assigned to the muon can be. In cm.", default=0.)
38parser.add_argument(
"--hits_to_fit", dest =
"hits_to_fit", type=str, help=
"Which detectors to use in the fit, in the format: vesfusds, where [ve] is veto, [sf] is Scifi, [us] is Upstream muon filter, and [ds] is downstream muon filter", default =
"sfusds")
39parser.add_argument(
"--hits_for_triplet", dest =
"hits_for_triplet", type=str, help=
"Which detectors to use for the triplet condition. In the same format as --hits_to_fit", default =
"ds")
41options = parser.parse_args()
45 print(
' %6i %7i %6.3F %6.3F %7.3F %7.3F %7.3F %7.3F %6i '%(n,mcp.GetPdgCode(),mcp.GetPx()/u.GeV,mcp.GetPy()/u.GeV,mcp.GetPz()/u.GeV, \
46 mcp.GetStartX()/u.m,mcp.GetStartY()/u.m,mcp.GetStartZ()/u.m,mcp.GetMotherId() ))
49 print(
' # pid px py pz vx vy vz mid')
51 for mcp
in sTree.MCTrack:
53 if mcp.GetP()/u.GeV < pcut :
continue
59 self.
comp = ROOT.TEveCompound(
'Digis')
60 gEve.AddElement(self.
comp)
62 self.
evscene = sc.FindChild(
'Event scene')
66 self.comp.DestroyElements()
67 self.comp.OpenCompound()
68 nav = ROOT.gGeoManager.GetCurrentNavigator()
70 if sTree.FindBranch(
"Digi_ScifiHits"): digis.append(sTree.Digi_ScifiHits)
71 if sTree.FindBranch(
"Digi_MuFilterHits"): digis.append(sTree.Digi_MuFilterHits)
73 print(
'digis:',branch.GetName(),
":",branch.GetEntries())
75 if not digi.isValid():
continue
78 detID = digi.GetDetectorID()
79 if digi.GetName() ==
'MuFilterHit':
80 system = digi.GetSystem()
81 modules[
'MuFilter'].GetPosition(detID,A,B)
83 if system==1: vol = sGeo.GetVolume(
'volVetoBar')
84 elif system==2: vol = sGeo.GetVolume(
'volMuUpstreamBar')
88 vol = sGeo.GetVolume(
'volMuDownstreamBar_ver')
91 vol = sGeo.GetVolume(
'volMuDownstreamBar_hor')
92 shape = vol.GetShape()
93 dx,dy,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
94 origin = shape.GetOrigin()
96 master = array(
'd',[mPoint[0],mPoint[1],mPoint[2]])
97 o = array(
'd',[0,0,0])
98 nav.MasterToLocal(master,o)
100 elif digi.GetName() ==
'sndScifiHit':
101 modules[
'Scifi'].GetSiPMPosition(detID,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')
108 shape = vol.GetShape()
109 if digi.isVertical():
110 dy,dx,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
113 dx,dy,dz = shape.GetDX(),shape.GetDY(),shape.GetDZ()
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])
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])
126 self.comp.AddElement(bx)
127 self.comp.CloseCompound()
128 gEve.ElementChanged(self.evscene,
True,
True)
130class DrawTracks(ROOT.FairTask):
134 self.
comp = ROOT.TEveCompound(
'Tracks')
135 gEve.AddElement(self.
comp)
139 sc = gEve.GetScenes()
140 self.
evscene = sc.FindChild(
'Event scene')
144 self.comp.DestroyElements()
145 self.comp.OpenCompound()
146 if sTree.MCTrack.GetEntries() > 0:
148 elif globals()[
'withMCTracks']: self.DrawMCTracks()
149 self.comp.CloseCompound()
150 gEve.ElementChanged(self.evscene,
True,
True)
154 for fT
in sTree.fittedTracks:
156 fst = fT.getFitStatus()
157 if not fst.isFitConverged():
continue
158 DTrack = ROOT.TEveLine()
159 DTrack.SetPickable(ROOT.kTRUE)
160 DTrack.SetTitle(fT.__repr__())
161 for n
in range(fT.getNumPoints()):
162 fstate = fT.getFittedState(n)
163 fPos = fstate.getPos()
164 DTrack.SetNextPoint(fPos.X(),fPos.Y(),fPos.Z())
165 DTrack.SetName(
'FitTrack_'+
str(n))
167 DTrack.SetMainColor(c)
168 DTrack.SetLineWidth(3)
169 self.
comp.AddElement(DTrack)
171 print(
"draw ",ntot,
" fitted tracks")
174 self.
comp.OpenCompound()
175 fT = sTree.MCTrack[n]
176 DTrack = ROOT.TEveLine()
177 DTrack.SetPickable(ROOT.kTRUE)
178 DTrack.SetTitle(fT.__repr__())
179 p = pdg.GetParticle(fT.GetPdgCode())
180 if p : pName = p.GetName()
181 else: pName =
str(fT.GetPdgCode())
182 DTrack.SetName(
'MCTrck_'+
str(n)+
'_'+pName)
183 fPos = ROOT.TVector3()
184 fMom = ROOT.TVector3()
185 fT.GetStartVertex(fPos)
189 for da
in sTree.MCTrack:
190 if da.GetMotherId()==n:
193 DTrack.SetNextPoint(fPos.X(),fPos.Y(),fPos.Z())
194 if evVx
and abs( da.GetStartZ()-fPos.Z() )>1*u.cm :
195 DTrack.SetNextPoint(da.GetStartX(),da.GetStartY(),da.GetStartZ())
198 if evVx : zEx = -10*u.m
199 lam = (zEx+fPos.Z())/fMom.Z()
200 DTrack.SetNextPoint(fPos.X()+lam*fMom.X(),fPos.Y()+lam*fMom.Y(),zEx+fPos.Z())
202 DTrack.SetMainColor(c)
203 DTrack.SetLineWidth(3)
204 self.
comp.AddElement(DTrack)
205 self.
comp.CloseCompound()
206 gEve.ElementChanged(self.
evscene,
True,
True)
210 fPos = ROOT.TVector3()
211 fMom = ROOT.TVector3()
212 for fT
in sTree.MCTrack:
214 DTrack = ROOT.TEveLine()
215 DTrack.SetPickable(ROOT.kTRUE)
216 DTrack.SetTitle(fT.__repr__())
217 fT.GetStartVertex(fPos)
219 hitlist[fPos.Z()] = [fPos.X(),fPos.Y()]
221 if abs(fT.GetPdgCode()) == options.HiddenParticleID:
222 for da
in sTree.MCTrack:
223 if da.GetMotherId()==n:
break
225 da.GetStartVertex(fPos)
226 hitlist[fPos.Z()] = [fPos.X(),fPos.Y()]
228 for P
in [
"EmulsionDetPoint",
"MuFilterPoint",
"ScifiPoint"]:
229 if not sTree.GetBranch(P):
continue
232 if p.GetTrackID()==n:
233 if hasattr(p,
"LastPoint"):
235 if lp.x()==lp.y()
and lp.x()==lp.z()
and lp.x()==0:
237 hitlist[p.GetZ()] = [p.GetX(),p.GetY()]
239 hitlist[lp.z()] = [lp.x(),lp.y()]
240 hitlist[2.*p.GetZ()-lp.z()] = [2.*p.GetX()-lp.x(),2.*p.GetY()-lp.y()]
242 hitlist[p.GetZ()] = [p.GetX(),p.GetY()]
244 if fT.GetMotherId()<0:
continue
245 if abs(sTree.MCTrack[fT.GetMotherId()].GetPdgCode()) == options.HiddenParticleID:
249 for da
in sTree.MCTrack:
250 if da.GetMotherId()==n:
253 if evVx : hitlist[da.GetStartZ()] = [da.GetStartX(),da.GetStartY()]
257 lam = (zEx+fPos.Z())/fMom.Z()
258 hitlist[zEx+fPos.Z()] = [fPos.X()+lam*fMom.X(),fPos.Y()+lam*fMom.Y()]
260 lz = list(hitlist.keys())
263 for z
in lz: DTrack.SetNextPoint(hitlist[z][0],hitlist[z][1],z)
264 p = pdg.GetParticle(fT.GetPdgCode())
265 if p : pName = p.GetName()
266 else: pName =
str(fT.GetPdgCode())
267 DTrack.SetName(
'MCTrack_'+
str(n)+
'_'+pName)
269 if abs(fT.GetPdgCode()) == options.HiddenParticleID:c = ROOT.kMagenta
270 DTrack.SetMainColor(c)
271 DTrack.SetLineWidth(3)
272 self.
comp.AddElement(DTrack)
274 print(
"draw ",ntot,
" MC tracks")
281 slot = ROOT.TEveWindow.CreateWindowInTab(gEve.GetBrowser().GetTabLeft())
282 slot.SetShowTitleBar(ROOT.kFALSE)
283 packs = slot.MakePack();
284 packs.SetShowTitleBar(ROOT.kFALSE);
285 packs.SetElementName(
"ActionsX")
286 packs.SetHorizontal()
287 slot = packs.NewSlot()
288 frame = slot.MakeFrame()
289 frame.SetElementName(
"commands")
290 frame.SetShowTitleBar(ROOT.kFALSE)
291 cf = frame.GetGUICompositeFrame()
292 hf = ROOT.TGVerticalFrame(cf)
293 hf.SetCleanup(ROOT.kLocalCleanup)
296 guiFrame = ROOT.TGVerticalFrame(hf)
297 hf.AddFrame(guiFrame, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
298 guiFrame.SetCleanup(ROOT.kDeepCleanup)
300 bnx = ROOT.TGTextButton(guiFrame,
"next event")
302 bnx.SetToolTipText(
'click for next event')
303 bnx.SetCommand(
'TPython::Exec("import evdsnd_commands ; rc=evdsnd_commands.nextEvent()")')
304 bnx.SetTextColor(ROOT.kBlue)
305 guiFrame.AddFrame(bnx, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
307 bt = ROOT.TGTextButton(guiFrame,
"switch transparent mode on/off")
309 bt.SetToolTipText(
'switch transparent mode on/off for better visibility of tracks')
310 bt.SetCommand(
'TPython::Exec("import evdsnd_commands ; rc=evdsnd_commands.transparentMode()")')
311 guiFrame.AddFrame(bt, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
313 blu = ROOT.TGTextButton(guiFrame,
"more light")
315 blu.SetToolTipText(
'increase light power. Front, Side, Specular')
316 blu.SetCommand(
'TPython::Exec("import evdsnd_commands ; rc=evdsnd_commands.light(0.5)")')
317 guiFrame.AddFrame(blu, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
318 bld = ROOT.TGTextButton(guiFrame,
"less light")
320 bld.SetToolTipText(
'decrease light power. Front, Side, Specular')
321 bld.SetCommand(
'TPython::Exec("import evdsnd_commands ; rc=evdsnd_commands.light(-0.5)")')
322 guiFrame.AddFrame(bld, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
324 bld = ROOT.TGTextButton(guiFrame,
"fit track")
326 bld.SetToolTipText(
'simple PR, fit track')
327 bld.SetCommand(
'TPython::Exec("import evdsnd_commands ; rc=evdsnd_commands.fittrack")')
328 guiFrame.AddFrame(bld, ROOT.TGLayoutHints(ROOT.kLHintsExpandX))
336 if i==self.
n: self.
n+=1
339 SHiPDisplay.NextEvent(self.
n)
341 tl = fRun.GetMainTask().GetListOfTasks()
342 geoTask = tl.FindObject(
"GeoTracks")
343 if globals()[
'withMCTracks']:
344 globals()[
'withMCTracks'] =
False
345 self.
lbut[
'withMC'].var.set(1)
346 if geoTask: geoTask.SetActive(0)
348 globals()[
'withMCTracks'] =
True
349 self.
lbut[
'withMC'].var.set(0)
350 if geoTask: geoTask.SetActive(1)
353 assemb =
"Assembly" in v.GetVolume().__str__()
354 if v.IsVisible()>0
or assemb
and v.IsVisDaughters()>0 :
355 print(
"switch off ",x)
358 self.
lbut[x].var.set(0)
360 print(
"switch on ",x)
361 if assemb: v.SetVisDaughters(1)
362 else: v.SetVisibility(1)
363 self.
lbut[x].var.set(1)
364 gEve.ElementChanged(self.
geoscene,
True,
True)
365 for v
in top.GetNodes():
368 assemb =
"Assembly" in v.GetVolume().__str__()
369 if v.IsVisible()>0
or assemb
and v.IsVisDaughters()>0 : self.
lbut[x].var.set(1)
370 else : self.
lbut[x].var.set(0)
377 rc = sTree.GetEvent(0)
378 modules[
'Scifi'].SiPMmapping()
386 v1 = gEve.GetDefaultViewer()
387 v1.GetEveFrame().HideAllDecorations()
388 tr=gEve.GetBrowser().GetTabRight()
390 t0.SetText(ROOT.TGString(
'3D'))
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')
400 sc = gEve.GetScenes()
401 geoscene = sc.FindChild(
'Geometry scene')
402 gEve.ElementChanged(geoscene,
True,
True)
404 v = gEve.GetDefaultGLViewer()
405 camera = v.CurrentCamera()
408 center = array(
'd',[-19.,46.,400.])
409 camera.Configure(1.6, 0, center, -1.57, 0)
413 sc = gEve.GetScenes()
414 geoscene = sc.FindChild(
'Geometry scene')
415 gEve.ElementChanged(geoscene,
True,
True)
420 fRun.Run(self.
n,self.
n+1)
421 if sTree.FindBranch(
"Digi_MuFilterHits")
or sTree.FindBranch(
"Digi_ScifiHits"):
422 self.
digi.ExecuteTask()
423 print(
'Event %i ready'%(self.
n))
427 p = ROOT.gEve.GetCurrentEvent().FindChild(mcHits[x].GetName())
429 p.SetPickable(ROOT.kTRUE)
430 p.SetTitle(p.__repr__())
432 v = ROOT.gEve.GetDefaultGLViewer()
433 cam = v.CurrentCamera()
436 cam.RotateRad(hor,ver)
451 for m
in transparentMaterials:
452 mat = ROOT.gGeoManager.GetMaterial(m)
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)
462 mat.SetTransparency(
"\x00")
465 def light(self,step=0.2,source='all'):
466 v1 = gEve.GetDefaultViewer()
467 gl = v1.GetGLViewer()
469 sources = [
"Side",
"Front",
"Specular"]
470 ls = gl.GetLightSet()
472 exec(
"status['"+s+
"']=ls.Get"+s+
"Power()")
473 if source!=
'all': sources = [source]
475 newPw =
str(status[s]+step)
476 exec(
"ls.Set"+s+
"Power("+newPw+
")")
479 trackTask.ExecuteTask()
480 print(
'tracks found',len(sTree.fittedTracks) )
481 self.
tracks.DrawFittedTracks()
487 s = ROOT.gEve.SpawnNewScene(
"Projected Event")
488 ROOT.gEve.GetDefaultViewer().AddScene(s)
489 v = ROOT.gEve.GetDefaultGLViewer()
490 v.SetCurrentCamera(ROOT.TGLViewer.kCameraOrthoXOY)
491 cam = v.CurrentCamera()
492 cam.SetZoomMinMax(0.2, 20)
494 mng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPT_RPhi)
496 axes = ROOT.TEveProjectionAxes(mng)
497 axes.SetTitle(
"TEveProjections demo")
499 ROOT.gEve.AddToListTree(axes, ROOT.kTRUE)
500 ROOT.gEve.AddToListTree(mng, ROOT.kTRUE)
504 v = gEve.GetViewers()
505 vw = v.FindChild(
'Viewer 1')
506 if vw: vw.SetName(
'3d')
507 sev = ROOT.gEve.SpawnNewViewer(
"Scaled 2D")
508 smng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPP_Plane)
509 sp = smng.GetProjection()
510 sp.SetUsePreScale(ROOT.kTRUE)
511 sp.AddPreScaleEntry(2, 100000000., 0.1)
512 ss = ROOT.gEve.SpawnNewScene(
"Scaled Geom")
515 N = sGeo.GetTopNode()
516 TNod=ROOT.TEveGeoTopNode(sGeo, N, 1, 3, 10)
518 eventscene = ROOT.gEve.SpawnNewScene(
'Scaled event')
519 eventscene.AddElement(ROOT.FairEventManager.Instance())
520 sev.AddScene(eventscene)
521 eventscene.AddElement(smng)
522 ROOT.gEve.GetBrowser().GetTabRight().SetTab(1)
523 ROOT.gEve.FullRedraw3D(ROOT.kTRUE)
526 f = ROOT.TFile.Open(fname,
"RECREATE");
527 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
531 f = ROOT.TFile.Open(fname)
532 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
533 f.GetKey(cam.ClassName()).Read(cam)
535 gEve.GetDefaultGLViewer().RequestDraw()
542 sc = gEve.GetScenes()
543 geoscene = sc.FindChild(
'Geometry scene')
544 for v
in top.GetNodes():
546 if not vname.find(tag)<0:
549 gEve.ElementChanged(geoscene,
True,
True)
552 sc = gEve.GetScenes()
553 geoscene = sc.FindChild(
'Geometry scene')
554 for v
in top.GetNodes():
556 if not vname.find(tag)<0:
557 print(
'switch on ',vname)
560 gEve.ElementChanged(geoscene,
True,
True)
564 sc = gEve.GetScenes()
565 geoscene = sc.FindChild(
'Geometry scene')
566 for v
in top.GetNodes():
568 if not vname.find(
'cave')< 0 :
continue
571 if not tag.find(vname)<0: todo =
False
575 gEve.ElementChanged(geoscene,
True,
True)
578 sc = gEve.GetScenes()
579 geoscene = sc.FindChild(
'Geometry scene')
580 for v
in top.GetNodes():
582 if not vname.find(
'cave')< 0 :
continue
585 if not tag.find(vname)<0: todo =
False
589 gEve.ElementChanged(geoscene,
True,
True)
593 for v
in sGeo.GetListOfVolumes():
595 if not vname.find(pattern) < 0 : exc.append(vname)
600 if not x.find(tag)<0: print(x)
603from basiclibs
import *
605fRun = ROOT.FairRunAna()
606ioman = ROOT.FairRootManager.Instance()
609 if options.geoFile[0:4] ==
"/eos": options.geoFile=ROOT.gSystem.Getenv(
"EOSSHIP")+options.geoFile
610 fRun.SetGeomFile(options.geoFile)
612if options.InputFile[0:4] ==
"/eos": options.InputFile=ROOT.gSystem.Getenv(
"EOSSHIP")+options.InputFile
614f=ROOT.TFile.Open(options.InputFile)
617if f.FindKey(
'rawConv'):
618 ioman.SetTreeName(
'rawConv')
621outFile = ROOT.TMemFile(
'dummy',
'CREATE')
622source = ROOT.FairFileSource(f)
623fRun.SetSource(source)
624sink = ROOT.FairRootFileSink(outFile)
627if options.houghTransform:
628 import SndlhcMuonReco
630 fRun.AddTask(muon_reco_task)
632 import SndlhcTracking
634 trackTask.SetName(
'simpleTracking')
635 fRun.AddTask(trackTask)
638xrdb = ROOT.FairRuntimeDb.instance()
639xrdb.getContainer(
"FairBaseParSet").setStatic()
640xrdb.getContainer(
"FairGeoParSet").setStatic()
645lsOfGlobals = ROOT.gROOT.GetListOfGlobals()
646lsOfGlobals.Add(modules[
'Scifi'])
647lsOfGlobals.Add(modules[
'MuFilter'])
650 rtdb = fRun.GetRuntimeDb()
651 parInput1 = ROOT.FairParRootFileIo()
652 parInput1.open(options.ParFile)
653 rtdb.setFirstInput(parInput1)
655fMan= ROOT.FairEventManager()
656fMan.SetMaxEnergy(5000.)
657fMan.SetMinEnergy(0.1)
658fMan.SetEvtMaxEnergy(5000.)
659fMan.SetPriOnly(
False)
663 mcHits[
'MuFilterPoints'] = ROOT.FairMCPointDraw(
"MuFilterPoint", ROOT.kBlue, ROOT.kFullSquare)
664 mcHits[
'ScifiPoints'] = ROOT.FairMCPointDraw(
"ScifiPoint", ROOT.kGreen, ROOT.kFullCircle)
665 mcHits[
'EmulsionDetPoints'] = ROOT.FairMCPointDraw(
"EmulsionDetPoint", ROOT.kMagenta, ROOT.kFullDiamond)
666 for x
in mcHits: fMan.AddTask(mcHits[x])
675fRman = ROOT.FairRootManager.Instance()
677sTree = ioman.GetInTree()
678lsOfGlobals.Add(sTree)
681if sTree.GetBranch(
'Digi_MuFilterHit'): sTree.Digi_MuFilterHits = sTree.Digi_MuFilterHit
683sGeo = ROOT.gGeoManager
684top = sGeo.GetTopVolume()
687br = gEve.GetBrowser()
689br.SetWindowName(
'SND@LHC Eve Window')
693eveGlobal.SHiPDisplay = SHiPDisplay
694SHiPDisplay.SetName(
'SHiP Displayer')
695lsOfGlobals.Add(SHiPDisplay)
700SHiPDisplay.InitTask()
702print(
'Help on GL viewer can be found by pressing Help button followed by help on GL viewer')
703print(
'With the camera button, you can switch to different views.')
714 comp = SHiPDisplay.tracks.comp
718 fPos = ROOT.TVector3()
719 fMom = ROOT.TVector3()
721 for fT
in sTree.MCTrack:
723 DTrack = ROOT.TEveLine()
724 DTrack.SetPickable(ROOT.kTRUE)
725 DTrack.SetTitle(fT.__repr__())
726 fT.GetStartVertex(fPos)
729 hitlist[fPos.Z()] = [fPos.X(),fPos.Y()]
731 slx,sly = fMom.X()/fMom.Z(),fMom.Y()/fMom.Z()
732 hitlist[z] = [fPos.X()+slx*delZ,fPos.Y()+sly*delZ]
733 for z
in hitlist.keys():
734 DTrack.SetNextPoint(hitlist[z][0],hitlist[z][1],z)
735 p = pdg.GetParticle(fT.GetPdgCode())
736 if p : pName = p.GetName()
737 else: pName =
str(fT.GetPdgCode())
738 DTrack.SetName(
'MCTrack_'+
str(n)+
'_'+pName)
740 DTrack.SetMainColor(c)
741 DTrack.SetLineWidth(3)
742 comp.AddElement(DTrack)
745 gEve.ElementChanged(SHiPDisplay.tracks.evscene,
True,
True)
set(INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${VMC_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/shipdata ${CMAKE_SOURCE_DIR}/shipLHC ${CMAKE_SOURCE_DIR}/analysis/cuts ${CMAKE_SOURCE_DIR}/analysis/tools ${FMT_INCLUDE_DIR}) include_directories($
ExecuteTask(self, option='')
DrawFittedTracks(self, option='')
ExecuteTask(self, option='')
DrawMCTracks(self, option='')
light(self, step=0.2, source='all')
transparentMode(self, mode='on')
rotateView(self, hor=0, ver=0)
readCameraSetting(fname='camSetting.root')
storeCameraSetting(fname='camSetting.root')
configure(darkphoton=None)