FairShip
Loading...
Searching...
No Matches
eventDisplay Namespace Reference

Classes

class  DrawTracks
 
class  DrawVetoDigi
 
class  EventLoop
 
class  IO
 
class  Rulers
 

Functions

bool _file_accessible (str path)
 
None evExit ()
 
None printMCTrack (int n, MCTrack)
 
None dump (float pcut=0)
 
None printFittedTracks ()
 
None printParticles ()
 
None projection ()
 
None projection_prescale ()
 
None storeCameraSetting (str fname="camSetting.root")
 
None readCameraSetting (str fname="camSetting.root")
 
None speedUp ()
 
None DisplayNuDetector ()
 
None switchOff (tag)
 
None switchOn (tag)
 
None hidePlasticScintillator ()
 
None switchOffRock ()
 
None switchOffAll (exc)
 
None switchOnAll (exc)
 
def select (pattern)
 
None search (lvdict, tag)
 
None rename (str name="ship.TGeant4.root")
 
None mydebug ()
 
None debugStraw (n)
 
None DrawCharmTracks ()
 
None DrawSimpleMCTracks ()
 
None positionText (r, float x, float y, z, angle, str txt, int size=200, color=ROOT.kBlue, mode=ROOT.TGLFont.kExtrude, light=ROOT.kTRUE)
 
None PRVersion ()
 

Variables

None fMan = None
 
None fRun = None
 
ROOT pdg = ROOT.TDatabasePDG.Instance()
 
ROOT g = ROOT.gROOT
 
ROOT gEnv = ROOT.gEnv
 
str mcEngine = "TGeant4"
 
str simEngine = "Pythia8"
 
bool withGeo = False
 
bool withMCTracks = True
 
dict transparentMaterials
 
ArgumentParser parser = ArgumentParser()
 
 dest
 
 help
 
 required
 
 default
 
 action
 
ArgumentParser options = parser.parse_args()
 
 recoFile
 
 InputFile
 
 else :
 
ArgumentParser candidate = options.InputFile.replace(".root", "_rec.root")
 
ROOT inFile = ROOT.FairFileSource(options.InputFile)
 
 OutputFile
 
None rtdb = fRun.GetRuntimeDb()
 
ROOT parInput1 = ROOT.FairParRootFileIo()
 
int verbose = 0
 
ROOT Track = ROOT.FairMCTracksDraw("Monte-Carlo Tracks")
 
ROOT GTrack = ROOT.FairGeoTracksDraw("GeoTracks")
 
load_from_root_file ShipGeo = load_from_root_file(fRun.GetGeoFile(), "ShipGeo")
 
ROOT _tmpFile = ROOT.TFile.Open(options.InputFile)
 
ROOT _tmpTree = _tmpFile.Get("cbmsim") if _tmpFile else None
 
dict mcHits = {}
 
dict _candidates
 
ROOT source = ROOT.VectorMCPointSource[branch](branch)
 
ROOT fRman = ROOT.FairRootManager.Instance()
 
ROOT sTree = fRman.GetInChain()
 
ROOT lsOfGlobals = ROOT.gROOT.GetListOfGlobals()
 
ROOT sGeo = ROOT.gGeoManager
 
ROOT top = sGeo.GetTopVolume()
 
ROOT gEve = ROOT.gEve
 
geomGeant4 fieldMaker = geomGeant4.addVMCFields(ShipGeo, "", True, withVirtualMC=False)
 
ROOT bfield = ROOT.genfit.FairShipFields()
 
ROOT bellField
 
ROOT compField = ROOT.ShipCompField("compfield", bellField)
 
ROOT geoMat = ROOT.genfit.TGeoMaterialInterface()
 
ROOT fM = ROOT.genfit.FieldManager.getInstance()
 
ROOT br = gEve.GetBrowser()
 
Rulers rulers = Rulers()
 
EventLoop SHiPDisplay = EventLoop()
 

Function Documentation

◆ _file_accessible()

bool eventDisplay._file_accessible ( str  path)
protected
Check whether a file exists (local or remote via XRootD).

Definition at line 26 of file eventDisplay.py.

26def _file_accessible(path: str) -> bool:
27 """Check whether a file exists (local or remote via XRootD)."""
28 if path.startswith("root://"):
29 from urllib.parse import urlparse
30
31 from XRootD import client as xrd_client
32
33 parsed = urlparse(path)
34 fs = xrd_client.FileSystem(f"{parsed.scheme}://{parsed.netloc}")
35 status, _ = fs.stat(parsed.path)
36 return status.ok
37 return os.path.exists(path)
38
39

◆ debugStraw()

None eventDisplay.debugStraw (   n)

Definition at line 1152 of file eventDisplay.py.

1152def debugStraw(n) -> None:
1153 sGeo = ROOT.gGeoManager
1154 vols = sGeo.GetListOfVolumes()
1155 sTree = g.FindObjectAny("cbmsim")
1156 sTree.GetEntry(n)
1157 for s in sTree.strawtubesPoint:
1158 print(vols[s.GetDetectorID() - 1].GetName())
1159
1160
1161# ----Load the default libraries------

◆ DisplayNuDetector()

None eventDisplay.DisplayNuDetector ( )

Definition at line 876 of file eventDisplay.py.

876def DisplayNuDetector() -> None:
877 for x in ["Wall"]:
878 xvol = sGeo.GetVolume(x)
879 if not xvol:
880 continue
881 xvol.SetVisDaughters(0)
882 xvol.SetVisibility(1)
883 sc = gEve.GetScenes()
884 geoscene = sc.FindChild("Geometry scene")
885 gEve.ElementChanged(geoscene, True, True)
886
887

◆ DrawCharmTracks()

None eventDisplay.DrawCharmTracks ( )

Definition at line 1299 of file eventDisplay.py.

1299def DrawCharmTracks() -> None:
1300 i = -1
1301 for aTrack in sTree.MCTrack:
1302 i += 1
1303 if i < 2:
1304 continue
1305 if aTrack.GetMotherId() == 1:
1306 pa = pdg.GetParticle(sTree.MCTrack[i].GetPdgCode())
1307 if pa.Lifetime() > 1.0e-12:
1308 print(sTree.MCTrack[i])
1309 SHiPDisplay.tracks.DrawMCTrack(i)
1310
1311

◆ DrawSimpleMCTracks()

None eventDisplay.DrawSimpleMCTracks ( )

Definition at line 1312 of file eventDisplay.py.

1312def DrawSimpleMCTracks() -> None:
1313 comp = SHiPDisplay.tracks.comp
1314 comp.OpenCompound()
1315 n = -1
1316 ntot = 0
1317 fPos = ROOT.TVector3()
1318 fMom = ROOT.TVector3()
1319 delZ = 10 * u.m
1320 for fT in sTree.MCTrack:
1321 n += 1
1322 DTrack = ROOT.TEveLine()
1323 DTrack.SetPickable(ROOT.kTRUE)
1324 DTrack.SetTitle(fT.__repr__())
1325 fT.GetStartVertex(fPos)
1326 fT.GetMomentum(fMom)
1327 hitlist = {}
1328 hitlist[fPos.Z()] = [fPos.X(), fPos.Y()]
1329 z = fPos.Z() + delZ
1330 slx, sly = fMom.X() / fMom.Z(), fMom.Y() / fMom.Z()
1331 hitlist[z] = [fPos.X() + slx * delZ, fPos.Y() + sly * delZ]
1332 for z in hitlist:
1333 DTrack.SetNextPoint(hitlist[z][0], hitlist[z][1], z)
1334 p = pdg.GetParticle(fT.GetPdgCode())
1335 if p:
1336 pName = p.GetName()
1337 else:
1338 pName = str(fT.GetPdgCode())
1339 DTrack.SetName("MCTrack_" + str(n) + "_" + pName)
1340 c = ROOT.kYellow
1341 DTrack.SetMainColor(c)
1342 DTrack.SetLineWidth(3)
1343 comp.AddElement(DTrack)
1344 ntot += 1
1345 comp.CloseCompound()
1346 gEve.ElementChanged(SHiPDisplay.tracks.evscene, True, True)
1347
1348

◆ dump()

None eventDisplay.dump ( float   pcut = 0)

Definition at line 153 of file eventDisplay.py.

153def dump(pcut: float = 0) -> None:
154 print(" # pid px py pz vx vy vz mid")
155 n = -1
156 for mcp in sTree.MCTrack:
157 n += 1
158 if mcp.GetP() / u.GeV < pcut:
159 continue
160 printMCTrack(n, sTree.MCTrack)
161
162

◆ evExit()

None eventDisplay.evExit ( )
Prevent double delete due to a FairRoot bug.

Definition at line 40 of file eventDisplay.py.

40def evExit() -> None:
41 """Prevent double delete due to a FairRoot bug."""
42 # Check whether the Eve window was closed/destructed
43 if ROOT.addressof(ROOT.gEve) == 0:
44 # Prevent the FairEventManager destructor from being called
45 ROOT.SetOwnership(fMan, False)
46
47

◆ hidePlasticScintillator()

None eventDisplay.hidePlasticScintillator ( )

Definition at line 911 of file eventDisplay.py.

911def hidePlasticScintillator() -> None:
912 sc = gEve.GetScenes()
913 geoscene = sc.FindChild("Geometry scene")
914 v = sGeo.FindVolumeFast("vleft")
915 v.SetVisibility(0)
916 v.SetVisDaughters(0)
917 for v in sGeo.GetListOfVolumes():
918 if v.GetName().find("wallVeto") > 0:
919 v.SetVisibility(0)
920 v.SetVisDaughters(0)
921 gEve.ElementChanged(geoscene, True, True)
922
923
924# switch off drawing of rock

◆ mydebug()

None eventDisplay.mydebug ( )

Definition at line 1103 of file eventDisplay.py.

1103def mydebug() -> None:
1104 t = g.FindObjectAny("cbmsim")
1105 nev = t.GetEntriesFast()
1106 t.GetEntry(0)
1107 # Loop over Geo tracks
1108 for i in range(min(5, nev)):
1109 t.GetEntry(i)
1110 for gTr in t.GeoTracks:
1111 gTr.Print()
1112 gTr.GetParticle()
1113 lorv = ROOT.TLorentzVector()
1114 print(
1115 "xyz E pxpypz",
1116 gTr.GetPoint(0)[0],
1117 gTr.GetPoint(0)[1],
1118 gTr.GetPoint(0)[2],
1119 lorv.E(),
1120 lorv.Px(),
1121 lorv.Py(),
1122 lorv.Pz(),
1123 )
1124 # Loop over MC tracks
1125 for i in range(min(5, nev)):
1126 t.GetEntry(i)
1127 for gMCTr in t.MCTrack:
1128 gMCTr.Print()
1129 print(gMCTr.GetPdgCode(), gMCTr.GetMass(), gMCTr.GetP())
1130 # MC event header
1131 for i in range(nev):
1132 t.GetEntry(i)
1133 print(
1134 t.MCEventHeader.GetEventID(),
1135 t.MCEventHeader.GetRunID(),
1136 t.MCEventHeader.GetZ(),
1137 )
1138 # Load geometry
1139 sGeo = ROOT.gGeoManager
1140 cave = sGeo.GetTopVolume()
1141 cave.Draw("ogl")
1142 # eve
1143 gEve = ROOT.gEve
1144 #
1145 sc = gEve.GetScenes()
1146 geoscene = sc.FindChild("Geometry scene")
1147 topnode = geoscene.FindChild("cave_1")
1148 topnode.SetVisLevel(4)
1149 gEve.ElementChanged(geoscene, True, True)
1150
1151

◆ positionText()

None eventDisplay.positionText (   r,
float  x,
float  y,
  z,
  angle,
str  txt,
int   size = 200,
  color = ROOT.kBlue,
  mode = ROOT.TGLFont.kExtrude,
  light = ROOT.kTRUE 
)

Definition at line 1349 of file eventDisplay.py.

1360) -> None:
1361 tt = ROOT.TEveText(txt)
1362 tt.SetFontSize(size)
1363 tt.RefMainTrans().SetPos(x, y, z)
1364 tt.PtrMainTrans().RotateLF(1, 3, angle)
1365 tt.SetMainColor(color)
1366 tt.SetFontMode(mode)
1367 tt.SetLighting(light)
1368 r.AddElement(tt)
1369
1370

◆ printFittedTracks()

None eventDisplay.printFittedTracks ( )

Definition at line 163 of file eventDisplay.py.

163def printFittedTracks() -> None:
164 print(" # converged Ndf chi2/Ndf P Pt MCid")
165 n = -1
166 for ft in sTree.FitTracks:
167 n += 1
168 fitStatus = ft.getFitStatus()
169 fitState = ft.getFittedState()
170 mom = fitState.getMom()
171 print(
172 "%3i %6i %4i %6.3F %6.3F %6.3F %6i "
173 % (
174 n,
175 fitStatus.isFitConverged(),
176 fitStatus.getNdf(),
177 fitStatus.getChi2() / fitStatus.getNdf(),
178 mom.Mag() / u.GeV,
179 mom.Pt() / u.GeV,
180 sTree.fitTrack2MC[n],
181 )
182 )
183
184

◆ printMCTrack()

None eventDisplay.printMCTrack ( int  n,
  MCTrack 
)

Definition at line 135 of file eventDisplay.py.

135def printMCTrack(n: int, MCTrack) -> None:
136 mcp = MCTrack[n]
137 print(
138 " %6i %7i %6.3F %6.3F %7.3F %7.3F %7.3F %7.3F %6i "
139 % (
140 n,
141 mcp.GetPdgCode(),
142 mcp.GetPx() / u.GeV,
143 mcp.GetPy() / u.GeV,
144 mcp.GetPz() / u.GeV,
145 mcp.GetStartX() / u.m,
146 mcp.GetStartY() / u.m,
147 mcp.GetStartZ() / u.m,
148 mcp.GetMotherId(),
149 )
150 )
151
152

◆ printParticles()

None eventDisplay.printParticles ( )

Definition at line 185 of file eventDisplay.py.

185def printParticles() -> None:
186 print(" # P Pt[GeV/c] DOCA[mm] Rsq Vz[m] d1 d2")
187 n = -1
188 for aP in sTree.Particles:
189 n += 1
190 doca = -1.0
191 if aP.GetMother(1) == 99: # DOCA is set
192 doca = aP.T()
193 Rsq = (aP.Vx() / (2.45 * u.m)) ** 2 + (aP.Vy() / ((10.0 / 2.0 - 0.05) * u.m)) ** 2
194 print(
195 "%3i %6.3F %6.3F %9.3F %6.3F %6.3F %4i %4i "
196 % (
197 n,
198 aP.P() / u.GeV,
199 aP.Pt() / u.GeV,
200 doca / u.mm,
201 Rsq,
202 aP.Vz() / u.m,
203 aP.GetDaughter(0),
204 aP.GetDaughter(1),
205 )
206 )
207
208

◆ projection()

None eventDisplay.projection ( )

Definition at line 795 of file eventDisplay.py.

795def projection() -> None:
796 # if 1>0:
797 # camera
798 s = ROOT.gEve.SpawnNewScene("Projected Event")
799 ROOT.gEve.GetDefaultViewer().AddScene(s)
800 v = ROOT.gEve.GetDefaultGLViewer()
801 v.SetCurrentCamera(ROOT.TGLViewer.kCameraOrthoXOY)
802 cam = v.CurrentCamera()
803 cam.SetZoomMinMax(0.2, 20)
804 # projections
805 mng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPT_RPhi)
806 s.AddElement(mng)
807 axes = ROOT.TEveProjectionAxes(mng)
808 axes.SetTitle("TEveProjections demo")
809 s.AddElement(axes)
810 ROOT.gEve.AddToListTree(axes, ROOT.kTRUE)
811 ROOT.gEve.AddToListTree(mng, ROOT.kTRUE)
812
813

◆ projection_prescale()

None eventDisplay.projection_prescale ( )

Definition at line 814 of file eventDisplay.py.

814def projection_prescale() -> None:
815 # if 1>0:
816 v = gEve.GetViewers()
817 vw = v.FindChild("Viewer 1")
818 if vw:
819 vw.SetName("3d")
820 sev = ROOT.gEve.SpawnNewViewer("Scaled 2D")
821 smng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPP_Plane)
822 sp = smng.GetProjection()
823 sp.SetUsePreScale(ROOT.kTRUE)
824 sp.AddPreScaleEntry(2, 100000000.0, 0.1)
825 ss = ROOT.gEve.SpawnNewScene("Scaled Geom")
826 sev.AddScene(ss)
827 ss.AddElement(smng)
828 N = sGeo.GetTopNode()
829 TNod = ROOT.TEveGeoTopNode(sGeo, N, 1, 3, 10)
830 ss.AddElement(TNod)
831 eventscene = ROOT.gEve.SpawnNewScene("Scaled event")
832 eventscene.AddElement(ROOT.FairEventManager.Instance())
833 sev.AddScene(eventscene)
834 eventscene.AddElement(smng)
835 ROOT.gEve.GetBrowser().GetTabRight().SetTab(1)
836 ROOT.gEve.FullRedraw3D(ROOT.kTRUE)
837
838

◆ PRVersion()

None eventDisplay.PRVersion ( )

Definition at line 1371 of file eventDisplay.py.

1371def PRVersion() -> None:
1372 readCameraSetting()
1373 for x in [
1374 "moreShieldingSide",
1375 "moreShieldingTopBot",
1376 "CoatWall",
1377 "CoatVol",
1378 "AbsorberVol",
1379 ]:
1380 vol = ROOT.gGeoManager.FindVolumeFast(x)
1381 vol.SetVisibility(0)
1382 ROOT.gGeoManager.GetMaterial("Concrete").SetTransparency(0)
1383 r = rulers.ruler
1384 ticks = 5
1385 r.DestroyElements()
1386 r.OpenCompound()
1387 xpos, ypos = -500.0, -1500.0
1388 zstart = ShipGeo.target.z0
1389 zlength = ShipGeo.MuonStation3.z - zstart + 10 * u.m
1390 z = zstart
1391 for i in range(int(zlength / 100 / ticks)):
1392 m = ROOT.TEveLine()
1393 m.SetNextPoint(xpos, ypos, z)
1394 m.SetNextPoint(xpos - 1 * u.m, ypos, z)
1395 m.SetMainColor(ROOT.kRed)
1396 m.SetLineWidth(5)
1397 r.AddElement(m)
1398 t1 = ROOT.TEveText(str(i * ticks) + "m")
1399 t1.SetMainColor(ROOT.kGray + 3)
1400 t1.SetFontSize(5)
1401 t1.RefMainTrans().SetPos(xpos - 0.1 * u.m, ypos + 0.2 * u.m, z)
1402 r.AddElement(t1)
1403 z += ticks * u.m
1404 xpos, ypos = 0.0, 0.0
1405 z = ShipGeo.MuonStation3.z + 6 * u.m
1406 ylength = 7 * u.m
1407 ypos = -ylength
1408 for i in range(-int(ylength / 100), int(ylength / 100), 1):
1409 m = ROOT.TEveLine()
1410 m.SetNextPoint(xpos, ypos, z)
1411 m.SetNextPoint(xpos + 0.05 * u.m, ypos, z)
1412 m.SetMainColor(ROOT.kRed)
1413 m.SetLineWidth(3)
1414 r.AddElement(m)
1415 t1 = ROOT.TEveText(str(i) + "m")
1416 t1.SetMainColor(ROOT.kGray + 3)
1417 t1.SetFontSize(5)
1418 t1.RefMainTrans().SetPos(xpos - 0.5 * u.m, ypos, z)
1419 r.AddElement(t1)
1420 ypos += 1 * u.m
1421 ty = ROOT.TEveText("y-axis")
1422 ty.SetFontSize(10)
1423 ty.RefMainTrans().SetPos(0.0, ypos + 1 * u.m, z)
1424 ty.SetMainColor(ROOT.kRed - 2)
1425 r.AddElement(ty)
1426 xpos, ypos = 0.0, 0.0
1427 z = ShipGeo.MuonStation3.z + 10 * u.m
1428 xlength = 3 * u.m
1429 xpos = -xlength
1430 for i in range(-int(xlength / 100), int(xlength / 100), 1):
1431 m = ROOT.TEveLine()
1432 m.SetNextPoint(xpos, ypos, z)
1433 m.SetNextPoint(xpos, ypos - 0.05 * u.m, z)
1434 m.SetMainColor(ROOT.kRed)
1435 m.SetLineWidth(3)
1436 r.AddElement(m)
1437 t1 = ROOT.TEveText(str(i) + "m")
1438 t1.SetMainColor(ROOT.kGray + 3)
1439 t1.SetFontSize(5)
1440 t1.RefMainTrans().SetPos(xpos, ypos - 0.1 * u.m, z)
1441 r.AddElement(t1)
1442 xpos += 1 * u.m
1443 tx = ROOT.TEveText("x-axis")
1444 tx.SetFontSize(10)
1445 tx.RefMainTrans().SetPos(xpos + 1 * u.m, 0.0, z)
1446 tx.SetMainColor(ROOT.kRed - 2)
1447 r.AddElement(tx)
1448 rotAngle = ROOT.TMath.Pi() + ROOT.TMath.PiOver2() * 5.0 / 2.0
1449 positionText(
1450 r,
1451 0.0,
1452 900.0,
1453 ShipGeo.TrackStation1.z - 20 * u.m,
1454 rotAngle,
1455 "SHiP",
1456 200,
1457 ROOT.kOrange - 2,
1458 )
1459 positionText(
1460 r,
1461 0.0,
1462 750.0,
1463 ShipGeo.TrackStation1.z - 40 * u.m,
1464 rotAngle,
1465 "Vacuum decay vessel",
1466 200,
1467 ROOT.kGray + 1,
1468 )
1469 positionText(r, 0.0, 100.0, ShipGeo.target.z - 6 * u.m, rotAngle, "Target", 200, ROOT.kBlue)
1470 positionText(
1471 r,
1472 0.0,
1473 600.0,
1474 ShipGeo.muShield.z - 10 * u.m,
1475 rotAngle,
1476 "Active muon shield",
1477 200,
1478 ROOT.kGreen - 2,
1479 )
1480 positionText(
1481 r,
1482 0.0,
1483 600.0,
1484 ShipGeo.tauMudet.zMudetC - 10 * u.m,
1485 rotAngle,
1486 "Tau neutrino detector",
1487 200,
1488 ROOT.kRed - 2,
1489 )
1490 positionText(
1491 r,
1492 0.0,
1493 900.0,
1494 ShipGeo.Bfield.z - 5 * u.m,
1495 rotAngle,
1496 "Dipole Magnet",
1497 200,
1498 ROOT.kBlue + 2,
1499 )
1500 positionText(
1501 r,
1502 -1500.0,
1503 -800.0,
1504 ShipGeo.TrackStation3.z - 2 * u.m,
1505 rotAngle,
1506 "Strawtracker",
1507 200,
1508 ROOT.kRed + 2,
1509 )
1510 positionText(r, 0.0, 700.0, ShipGeo.MuonFilter2.z, rotAngle, "Muon", 200, ROOT.kGreen + 2)
1511 r.CloseCompound()
1512 sc = gEve.GetScenes()
1513 geoscene = sc.FindChild("Geometry scene")
1514 gEve.ElementChanged(geoscene, True, True)

◆ readCameraSetting()

None eventDisplay.readCameraSetting ( str   fname = "camSetting.root")

Definition at line 846 of file eventDisplay.py.

846def readCameraSetting(fname: str = "camSetting.root") -> None:
847 f = ROOT.TFile.Open(fname)
848 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
849 f.GetKey(cam.ClassName()).Read(cam)
850 cam.IncTimeStamp()
851 gEve.GetDefaultGLViewer().RequestDraw()
852 f.Close()
853
854

◆ rename()

None eventDisplay.rename ( str   name = "ship.TGeant4.root")

Definition at line 983 of file eventDisplay.py.

983def rename(name: str = "ship.TGeant4.root") -> None:
984 f = ROOT.TFile(name, "UPDATE")
985 t = f.Get("cbmsim")
986 for x in t.GetListOfBranches():
987 nm = x.GetName().replace("_1", "")
988 x.SetName(nm)
989 t.Write()
990 f.Close()
991
992

◆ search()

None eventDisplay.search (   lvdict,
  tag 
)

Definition at line 977 of file eventDisplay.py.

977def search(lvdict, tag) -> None:
978 for x in lvdict:
979 if not x.find(tag) < 0:
980 print(x)
981
982

◆ select()

def eventDisplay.select (   pattern)

Definition at line 968 of file eventDisplay.py.

968def select(pattern):
969 exc = []
970 for v in sGeo.GetListOfVolumes():
971 vname = v.GetName()
972 if not vname.find(pattern) < 0:
973 exc.append(vname)
974 return exc
975
976

◆ speedUp()

None eventDisplay.speedUp ( )

Definition at line 855 of file eventDisplay.py.

855def speedUp() -> None:
856 for x in ["wire", "gas", "rockD", "rockS", "rockSFe"]:
857 xvol = sGeo.GetVolume(x)
858 if xvol:
859 xvol.SetVisibility(0)
860 for k in range(1, 7):
861 va = sGeo.GetVolume("T" + str(k))
862 if not va:
863 continue
864 for x in va.GetNodes():
865 nm = x.GetName()
866 if not nm.find("Inner") < 0 and k < 3:
867 x.SetVisDaughters(False)
868 x.SetVisibility(False)
869 if not nm.find("LiSc") < 0:
870 x.SetVisDaughters(False)
871 if not nm.find("RibPhi") < 0:
872 x.SetVisDaughters(False)
873
874
875# set display properties for tau nu target

◆ storeCameraSetting()

None eventDisplay.storeCameraSetting ( str   fname = "camSetting.root")

Definition at line 839 of file eventDisplay.py.

839def storeCameraSetting(fname: str = "camSetting.root") -> None:
840 f = ROOT.TFile.Open(fname, "RECREATE")
841 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
842 cam.Write()
843 f.Close()
844
845

◆ switchOff()

None eventDisplay.switchOff (   tag)

Definition at line 888 of file eventDisplay.py.

888def switchOff(tag) -> None:
889 sc = gEve.GetScenes()
890 geoscene = sc.FindChild("Geometry scene")
891 for v in top.GetNodes():
892 vname = v.GetName()
893 if not vname.find(tag) < 0:
894 v.SetVisibility(0)
895 v.SetVisDaughters(0)
896 gEve.ElementChanged(geoscene, True, True)
897
898

◆ switchOffAll()

None eventDisplay.switchOffAll (   exc)

Definition at line 934 of file eventDisplay.py.

934def switchOffAll(exc) -> None:
935 sc = gEve.GetScenes()
936 geoscene = sc.FindChild("Geometry scene")
937 for v in top.GetNodes():
938 vname = v.GetName()
939 if not vname.find("cave") < 0:
940 continue
941 todo = True
942 for tag in exc:
943 if not tag.find(vname) < 0:
944 todo = False
945 if todo:
946 v.SetVisibility(0)
947 v.SetVisDaughters(0)
948 gEve.ElementChanged(geoscene, True, True)
949
950

◆ switchOffRock()

None eventDisplay.switchOffRock ( )

Definition at line 925 of file eventDisplay.py.

925def switchOffRock() -> None:
926 sc = gEve.GetScenes()
927 geoscene = sc.FindChild("Geometry scene")
928 for x in ["rockD", "rockS"]:
929 v = sGeo.FindVolumeFast(x)
930 v.SetVisibility(0)
931 gEve.ElementChanged(geoscene, True, True)
932
933

◆ switchOn()

None eventDisplay.switchOn (   tag)

Definition at line 899 of file eventDisplay.py.

899def switchOn(tag) -> None:
900 sc = gEve.GetScenes()
901 geoscene = sc.FindChild("Geometry scene")
902 for v in top.GetNodes():
903 vname = v.GetName()
904 if not vname.find(tag) < 0:
905 print("switch on ", vname)
906 v.SetVisibility(1)
907 v.SetVisDaughters(1)
908 gEve.ElementChanged(geoscene, True, True)
909
910

◆ switchOnAll()

None eventDisplay.switchOnAll (   exc)

Definition at line 951 of file eventDisplay.py.

951def switchOnAll(exc) -> None:
952 sc = gEve.GetScenes()
953 geoscene = sc.FindChild("Geometry scene")
954 for v in top.GetNodes():
955 vname = v.GetName()
956 if not vname.find("cave") < 0:
957 continue
958 todo = True
959 for tag in exc:
960 if not tag.find(vname) < 0:
961 todo = False
962 if todo:
963 v.SetVisibility(1)
964 v.SetVisDaughters(1)
965 gEve.ElementChanged(geoscene, True, True)
966
967

Variable Documentation

◆ _candidates

dict eventDisplay._candidates
protected
Initial value:
1= {
2 "VetoPoints": ("vetoPoint", ROOT.kBlue, ROOT.kFullDiamond),
3 "TimeDetPoints": ("TimeDetPoint", ROOT.kBlue, ROOT.kFullDiamond),
4 "StrawPoints": ("strawtubesPoint", ROOT.kGreen, ROOT.kFullCircle),
5 "TargetPoints": ("TargetPoint", ROOT.kRed, ROOT.kFullSquare),
6 "MTCDetPoint": ("MTCDetPoint", ROOT.kGreen, ROOT.kFullSquare),
7 "SiliconTargetPoint": ("SiliconTargetPoint", ROOT.kCyan, ROOT.kFullSquare),
8}

Definition at line 1207 of file eventDisplay.py.

◆ _tmpFile

ROOT eventDisplay._tmpFile = ROOT.TFile.Open(options.InputFile)
protected

Definition at line 1203 of file eventDisplay.py.

◆ _tmpTree

ROOT eventDisplay._tmpTree = _tmpFile.Get("cbmsim") if _tmpFile else None
protected

Definition at line 1204 of file eventDisplay.py.

◆ action

eventDisplay.action

Definition at line 101 of file eventDisplay.py.

◆ bellField

ROOT eventDisplay.bellField
Initial value:
1= ROOT.ShipBellField(
2 "bellfield", ShipGeo.Bfield.max, ShipGeo.Bfield.z, 2, ShipGeo.Bfield.y / 2.0 * u.m
3 )

Definition at line 1255 of file eventDisplay.py.

◆ bfield

ROOT eventDisplay.bfield = ROOT.genfit.FairShipFields()

Definition at line 1252 of file eventDisplay.py.

◆ br

ROOT eventDisplay.br = gEve.GetBrowser()

Definition at line 1268 of file eventDisplay.py.

◆ candidate

ArgumentParser eventDisplay.candidate = options.InputFile.replace(".root", "_rec.root")

Definition at line 130 of file eventDisplay.py.

◆ compField

ROOT eventDisplay.compField = ROOT.ShipCompField("compfield", bellField)

Definition at line 1258 of file eventDisplay.py.

◆ default

eventDisplay.default

Definition at line 94 of file eventDisplay.py.

◆ dest

eventDisplay.dest

Definition at line 83 of file eventDisplay.py.

◆ else

eventDisplay.else :

Definition at line 129 of file eventDisplay.py.

◆ fieldMaker

geomGeant4 eventDisplay.fieldMaker = geomGeant4.addVMCFields(ShipGeo, "", True, withVirtualMC=False)

Definition at line 1251 of file eventDisplay.py.

◆ fM

ROOT eventDisplay.fM = ROOT.genfit.FieldManager.getInstance()

Definition at line 1263 of file eventDisplay.py.

◆ fMan

ROOT eventDisplay.fMan = None

Definition at line 50 of file eventDisplay.py.

◆ fRman

ROOT eventDisplay.fRman = ROOT.FairRootManager.Instance()

Definition at line 1233 of file eventDisplay.py.

◆ fRun

ROOT eventDisplay.fRun = None

Definition at line 51 of file eventDisplay.py.

◆ g

ROOT eventDisplay.g = ROOT.gROOT

Definition at line 53 of file eventDisplay.py.

◆ gEnv

ROOT eventDisplay.gEnv = ROOT.gEnv

Definition at line 54 of file eventDisplay.py.

◆ geoMat

ROOT eventDisplay.geoMat = ROOT.genfit.TGeoMaterialInterface()

Definition at line 1261 of file eventDisplay.py.

◆ gEve

ROOT eventDisplay.gEve = ROOT.gEve

Definition at line 1243 of file eventDisplay.py.

◆ GTrack

ROOT eventDisplay.GTrack = ROOT.FairGeoTracksDraw("GeoTracks")

Definition at line 1195 of file eventDisplay.py.

◆ help

eventDisplay.help

Definition at line 83 of file eventDisplay.py.

◆ inFile

ROOT eventDisplay.inFile = ROOT.FairFileSource(options.InputFile)

Definition at line 1173 of file eventDisplay.py.

◆ InputFile

eventDisplay.InputFile

Definition at line 128 of file eventDisplay.py.

◆ lsOfGlobals

ROOT eventDisplay.lsOfGlobals = ROOT.gROOT.GetListOfGlobals()

Definition at line 1237 of file eventDisplay.py.

◆ mcEngine

str eventDisplay.mcEngine = "TGeant4"

Definition at line 57 of file eventDisplay.py.

◆ mcHits

dict eventDisplay.mcHits = {}

Definition at line 1206 of file eventDisplay.py.

◆ options

ArgumentParser eventDisplay.options = parser.parse_args()

Definition at line 119 of file eventDisplay.py.

◆ OutputFile

eventDisplay.OutputFile

Definition at line 1176 of file eventDisplay.py.

◆ parInput1

ROOT eventDisplay.parInput1 = ROOT.FairParRootFileIo()

Definition at line 1181 of file eventDisplay.py.

◆ parser

ArgumentParser eventDisplay.parser = ArgumentParser()

Definition at line 81 of file eventDisplay.py.

◆ pdg

ROOT eventDisplay.pdg = ROOT.TDatabasePDG.Instance()

Definition at line 52 of file eventDisplay.py.

◆ recoFile

eventDisplay.recoFile

Definition at line 127 of file eventDisplay.py.

◆ required

eventDisplay.required

Definition at line 83 of file eventDisplay.py.

◆ rtdb

None eventDisplay.rtdb = fRun.GetRuntimeDb()

Definition at line 1180 of file eventDisplay.py.

◆ rulers

Rulers eventDisplay.rulers = Rulers()

Definition at line 1275 of file eventDisplay.py.

◆ sGeo

ROOT eventDisplay.sGeo = ROOT.gGeoManager

Definition at line 1239 of file eventDisplay.py.

◆ SHiPDisplay

eventDisplay.SHiPDisplay = EventLoop()

Definition at line 1276 of file eventDisplay.py.

◆ ShipGeo

load_from_root_file eventDisplay.ShipGeo = load_from_root_file(fRun.GetGeoFile(), "ShipGeo")

Definition at line 1200 of file eventDisplay.py.

◆ simEngine

str eventDisplay.simEngine = "Pythia8"

Definition at line 58 of file eventDisplay.py.

◆ source

ROOT eventDisplay.source = ROOT.VectorMCPointSource[branch](branch)

Definition at line 1217 of file eventDisplay.py.

◆ sTree

ROOT eventDisplay.sTree = fRman.GetInChain()

Definition at line 1234 of file eventDisplay.py.

◆ top

ROOT eventDisplay.top = sGeo.GetTopVolume()

Definition at line 1240 of file eventDisplay.py.

◆ Track

ROOT eventDisplay.Track = ROOT.FairMCTracksDraw("Monte-Carlo Tracks")

Definition at line 1194 of file eventDisplay.py.

◆ transparentMaterials

dict eventDisplay.transparentMaterials
Initial value:
1= {
2 "iron": 80,
3 "aluminium": 80,
4 "mylar": 60,
5 "STTmix9010_2bar": 95,
6 "steel": 80,
7 "Aluminum": 80,
8 "Scintillator": 80,
9 # tau nu detector
10 "CoilCopper": 70,
11 "copper": 90,
12 "HPTgas": 70,
13 "Bakelite": 70,
14 "RPCgas": 70,
15 "TTmedium": 70,
16}

Definition at line 63 of file eventDisplay.py.

◆ verbose

int eventDisplay.verbose = 0

Definition at line 1192 of file eventDisplay.py.

◆ withGeo

bool eventDisplay.withGeo = False

Definition at line 59 of file eventDisplay.py.

◆ withMCTracks

bool eventDisplay.withMCTracks = True

Definition at line 60 of file eventDisplay.py.