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

Classes

class  DrawVetoDigi
class  DrawTracks
class  IO
class  EventLoop
class  Rulers

Functions

float z_end_of_detector (ShipGeo)
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)
 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

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

38def _file_accessible(path: str) -> bool:
39 """Check whether a file exists (local or remote via XRootD)."""
40 if path.startswith("root://"):
41 from urllib.parse import urlparse
42
43 from XRootD import client as xrd_client
44
45 parsed = urlparse(path)
46 fs = xrd_client.FileSystem(f"{parsed.scheme}://{parsed.netloc}")
47 status, _ = fs.stat(parsed.path)
48 return status.ok
49 return os.path.exists(path)
50
51

◆ debugStraw()

None eventDisplay.debugStraw ( n)

Definition at line 1178 of file eventDisplay.py.

1178def debugStraw(n) -> None:
1179 sGeo = ROOT.gGeoManager
1180 vols = sGeo.GetListOfVolumes()
1181 sTree = g.FindObjectAny("cbmsim")
1182 sTree.GetEntry(n)
1183 for s in sTree.strawtubesPoint:
1184 print(vols[s.GetDetectorID() - 1].GetName())
1185
1186
1187# ----Load the default libraries------

◆ DisplayNuDetector()

None eventDisplay.DisplayNuDetector ( )

Definition at line 902 of file eventDisplay.py.

902def DisplayNuDetector() -> None:
903 for x in ["Wall"]:
904 xvol = sGeo.GetVolume(x)
905 if not xvol:
906 continue
907 xvol.SetVisDaughters(0)
908 xvol.SetVisibility(1)
909 sc = gEve.GetScenes()
910 geoscene = sc.FindChild("Geometry scene")
911 gEve.ElementChanged(geoscene, True, True)
912
913

◆ DrawCharmTracks()

None eventDisplay.DrawCharmTracks ( )

Definition at line 1330 of file eventDisplay.py.

1330def DrawCharmTracks() -> None:
1331 i = -1
1332 for aTrack in sTree.MCTrack:
1333 i += 1
1334 if i < 2:
1335 continue
1336 if aTrack.GetMotherId() == 1:
1337 pdg_code = sTree.MCTrack[i].GetPdgCode()
1338 if is_known_particle(pdg_code) and get_particle(pdg_code).Lifetime() > 1.0e-12:
1339 print(sTree.MCTrack[i])
1340 SHiPDisplay.tracks.DrawMCTrack(i)
1341
1342

◆ DrawSimpleMCTracks()

None eventDisplay.DrawSimpleMCTracks ( )

Definition at line 1343 of file eventDisplay.py.

1343def DrawSimpleMCTracks() -> None:
1344 comp = SHiPDisplay.tracks.comp
1345 comp.OpenCompound()
1346 n = -1
1347 ntot = 0
1348 fPos = ROOT.TVector3()
1349 fMom = ROOT.TVector3()
1350 delZ = 10 * u.m
1351 for fT in sTree.MCTrack:
1352 n += 1
1353 DTrack = ROOT.TEveLine()
1354 DTrack.SetPickable(ROOT.kTRUE)
1355 DTrack.SetTitle(fT.__repr__())
1356 fT.GetStartVertex(fPos)
1357 fT.GetMomentum(fMom)
1358 hitlist = {}
1359 hitlist[fPos.Z()] = [fPos.X(), fPos.Y()]
1360 z = fPos.Z() + delZ
1361 slx, sly = fMom.X() / fMom.Z(), fMom.Y() / fMom.Z()
1362 hitlist[z] = [fPos.X() + slx * delZ, fPos.Y() + sly * delZ]
1363 for z in hitlist:
1364 DTrack.SetNextPoint(hitlist[z][0], hitlist[z][1], z)
1365 p = pdg.GetParticle(fT.GetPdgCode())
1366 if p:
1367 pName = p.GetName()
1368 else:
1369 pName = str(fT.GetPdgCode())
1370 DTrack.SetName("MCTrack_" + str(n) + "_" + pName)
1371 c = ROOT.kYellow
1372 DTrack.SetMainColor(c)
1373 DTrack.SetLineWidth(3)
1374 comp.AddElement(DTrack)
1375 ntot += 1
1376 comp.CloseCompound()
1377 gEve.ElementChanged(SHiPDisplay.tracks.evscene, True, True)
1378
1379

◆ dump()

None eventDisplay.dump ( float pcut = 0)

Definition at line 166 of file eventDisplay.py.

166def dump(pcut: float = 0) -> None:
167 print(" # pid px py pz vx vy vz mid")
168 n = -1
169 for mcp in sTree.MCTrack:
170 n += 1
171 if mcp.GetP() / u.GeV < pcut:
172 continue
173 printMCTrack(n, sTree.MCTrack)
174
175

◆ evExit()

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

Definition at line 52 of file eventDisplay.py.

52def evExit() -> None:
53 """Prevent double delete due to a FairRoot bug."""
54 # Check whether the Eve window was closed/destructed
55 if ROOT.addressof(ROOT.gEve) == 0:
56 # Prevent the FairEventManager destructor from being called
57 ROOT.SetOwnership(fMan, False)
58
59

◆ hidePlasticScintillator()

None eventDisplay.hidePlasticScintillator ( )

Definition at line 937 of file eventDisplay.py.

937def hidePlasticScintillator() -> None:
938 sc = gEve.GetScenes()
939 geoscene = sc.FindChild("Geometry scene")
940 v = sGeo.FindVolumeFast("vleft")
941 v.SetVisibility(0)
942 v.SetVisDaughters(0)
943 for v in sGeo.GetListOfVolumes():
944 if v.GetName().find("wallVeto") > 0:
945 v.SetVisibility(0)
946 v.SetVisDaughters(0)
947 gEve.ElementChanged(geoscene, True, True)
948
949
950# switch off drawing of rock

◆ mydebug()

None eventDisplay.mydebug ( )

Definition at line 1129 of file eventDisplay.py.

1129def mydebug() -> None:
1130 t = g.FindObjectAny("cbmsim")
1131 nev = t.GetEntriesFast()
1132 t.GetEntry(0)
1133 # Loop over Geo tracks
1134 for i in range(min(5, nev)):
1135 t.GetEntry(i)
1136 for gTr in t.GeoTracks:
1137 gTr.Print()
1138 gTr.GetParticle()
1139 lorv = ROOT.TLorentzVector()
1140 print(
1141 "xyz E pxpypz",
1142 gTr.GetPoint(0)[0],
1143 gTr.GetPoint(0)[1],
1144 gTr.GetPoint(0)[2],
1145 lorv.E(),
1146 lorv.Px(),
1147 lorv.Py(),
1148 lorv.Pz(),
1149 )
1150 # Loop over MC tracks
1151 for i in range(min(5, nev)):
1152 t.GetEntry(i)
1153 for gMCTr in t.MCTrack:
1154 gMCTr.Print()
1155 print(gMCTr.GetPdgCode(), gMCTr.GetMass(), gMCTr.GetP())
1156 # MC event header
1157 for i in range(nev):
1158 t.GetEntry(i)
1159 print(
1160 t.MCEventHeader.GetEventID(),
1161 t.MCEventHeader.GetRunID(),
1162 t.MCEventHeader.GetZ(),
1163 )
1164 # Load geometry
1165 sGeo = ROOT.gGeoManager
1166 cave = sGeo.GetTopVolume()
1167 cave.Draw("ogl")
1168 # eve
1169 gEve = ROOT.gEve
1170 #
1171 sc = gEve.GetScenes()
1172 geoscene = sc.FindChild("Geometry scene")
1173 topnode = geoscene.FindChild("cave_1")
1174 topnode.SetVisLevel(4)
1175 gEve.ElementChanged(geoscene, True, True)
1176
1177

◆ 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 1380 of file eventDisplay.py.

1391) -> None:
1392 tt = ROOT.TEveText(txt)
1393 tt.SetFontSize(size)
1394 tt.RefMainTrans().SetPos(x, y, z)
1395 tt.PtrMainTrans().RotateLF(1, 3, angle)
1396 tt.SetMainColor(color)
1397 tt.SetFontMode(mode)
1398 tt.SetLighting(light)
1399 r.AddElement(tt)
1400
1401

◆ printFittedTracks()

None eventDisplay.printFittedTracks ( )

Definition at line 176 of file eventDisplay.py.

176def printFittedTracks() -> None:
177 print(" # converged Ndf chi2/Ndf P Pt MCid")
178 n = -1
179 for ft in sTree.FitTracks:
180 n += 1
181 fitStatus = ft.getFitStatus()
182 fitState = ft.getFittedState()
183 mom = fitState.getMom()
184 print(
185 "%3i %6i %4i %6.3F %6.3F %6.3F %6i "
186 % (
187 n,
188 fitStatus.isFitConverged(),
189 fitStatus.getNdf(),
190 fitStatus.getChi2() / fitStatus.getNdf(),
191 mom.Mag() / u.GeV,
192 mom.Pt() / u.GeV,
193 sTree.fitTrack2MC[n],
194 )
195 )
196
197

◆ printMCTrack()

None eventDisplay.printMCTrack ( int n,
MCTrack )

Definition at line 148 of file eventDisplay.py.

148def printMCTrack(n: int, MCTrack) -> None:
149 mcp = MCTrack[n]
150 print(
151 " %6i %7i %6.3F %6.3F %7.3F %7.3F %7.3F %7.3F %6i "
152 % (
153 n,
154 mcp.GetPdgCode(),
155 mcp.GetPx() / u.GeV,
156 mcp.GetPy() / u.GeV,
157 mcp.GetPz() / u.GeV,
158 mcp.GetStartX() / u.m,
159 mcp.GetStartY() / u.m,
160 mcp.GetStartZ() / u.m,
161 mcp.GetMotherId(),
162 )
163 )
164
165

◆ printParticles()

None eventDisplay.printParticles ( )

Definition at line 198 of file eventDisplay.py.

198def printParticles() -> None:
199 print(" # P Pt[GeV/c] DOCA[mm] Rsq Vz[m] d1 d2")
200 n = -1
201 for aP in sTree.Particles:
202 n += 1
203 doca = -1.0
204 if aP.GetMother(1) == 99: # DOCA is set
205 doca = aP.T()
206 Rsq = (aP.Vx() / (2.45 * u.m)) ** 2 + (aP.Vy() / ((10.0 / 2.0 - 0.05) * u.m)) ** 2
207 print(
208 "%3i %6.3F %6.3F %9.3F %6.3F %6.3F %4i %4i "
209 % (
210 n,
211 aP.P() / u.GeV,
212 aP.Pt() / u.GeV,
213 doca / u.mm,
214 Rsq,
215 aP.Vz() / u.m,
216 aP.GetDaughter(0),
217 aP.GetDaughter(1),
218 )
219 )
220
221

◆ projection()

None eventDisplay.projection ( )

Definition at line 821 of file eventDisplay.py.

821def projection() -> None:
822 # if 1>0:
823 # camera
824 s = ROOT.gEve.SpawnNewScene("Projected Event")
825 ROOT.gEve.GetDefaultViewer().AddScene(s)
826 v = ROOT.gEve.GetDefaultGLViewer()
827 v.SetCurrentCamera(ROOT.TGLViewer.kCameraOrthoXOY)
828 cam = v.CurrentCamera()
829 cam.SetZoomMinMax(0.2, 20)
830 # projections
831 mng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPT_RPhi)
832 s.AddElement(mng)
833 axes = ROOT.TEveProjectionAxes(mng)
834 axes.SetTitle("TEveProjections demo")
835 s.AddElement(axes)
836 ROOT.gEve.AddToListTree(axes, ROOT.kTRUE)
837 ROOT.gEve.AddToListTree(mng, ROOT.kTRUE)
838
839

◆ projection_prescale()

None eventDisplay.projection_prescale ( )

Definition at line 840 of file eventDisplay.py.

840def projection_prescale() -> None:
841 # if 1>0:
842 v = gEve.GetViewers()
843 vw = v.FindChild("Viewer 1")
844 if vw:
845 vw.SetName("3d")
846 sev = ROOT.gEve.SpawnNewViewer("Scaled 2D")
847 smng = ROOT.TEveProjectionManager(ROOT.TEveProjection.kPP_Plane)
848 sp = smng.GetProjection()
849 sp.SetUsePreScale(ROOT.kTRUE)
850 sp.AddPreScaleEntry(2, 100000000.0, 0.1)
851 ss = ROOT.gEve.SpawnNewScene("Scaled Geom")
852 sev.AddScene(ss)
853 ss.AddElement(smng)
854 N = sGeo.GetTopNode()
855 TNod = ROOT.TEveGeoTopNode(sGeo, N, 1, 3, 10)
856 ss.AddElement(TNod)
857 eventscene = ROOT.gEve.SpawnNewScene("Scaled event")
858 eventscene.AddElement(ROOT.FairEventManager.Instance())
859 sev.AddScene(eventscene)
860 eventscene.AddElement(smng)
861 ROOT.gEve.GetBrowser().GetTabRight().SetTab(1)
862 ROOT.gEve.FullRedraw3D(ROOT.kTRUE)
863
864

◆ PRVersion()

None eventDisplay.PRVersion ( )

Definition at line 1402 of file eventDisplay.py.

1402def PRVersion() -> None:
1403 readCameraSetting()
1404 for x in [
1405 "moreShieldingSide",
1406 "moreShieldingTopBot",
1407 "CoatWall",
1408 "CoatVol",
1409 "AbsorberVol",
1410 ]:
1411 vol = ROOT.gGeoManager.FindVolumeFast(x)
1412 vol.SetVisibility(0)
1413 ROOT.gGeoManager.GetMaterial("Concrete").SetTransparency(0)
1414 r = rulers.ruler
1415 ticks = 5
1416 r.DestroyElements()
1417 r.OpenCompound()
1418 xpos, ypos = -500.0, -1500.0
1419 zstart = ShipGeo.target.z0
1420 zlength = z_end_of_detector(ShipGeo) - zstart + 10 * u.m
1421 z = zstart
1422 for i in range(int(zlength / 100 / ticks)):
1423 m = ROOT.TEveLine()
1424 m.SetNextPoint(xpos, ypos, z)
1425 m.SetNextPoint(xpos - 1 * u.m, ypos, z)
1426 m.SetMainColor(ROOT.kRed)
1427 m.SetLineWidth(5)
1428 r.AddElement(m)
1429 t1 = ROOT.TEveText(str(i * ticks) + "m")
1430 t1.SetMainColor(ROOT.kGray + 3)
1431 t1.SetFontSize(5)
1432 t1.RefMainTrans().SetPos(xpos - 0.1 * u.m, ypos + 0.2 * u.m, z)
1433 r.AddElement(t1)
1434 z += ticks * u.m
1435 xpos, ypos = 0.0, 0.0
1436 z = z_end_of_detector(ShipGeo) + 6 * u.m
1437 ylength = 7 * u.m
1438 ypos = -ylength
1439 for i in range(-int(ylength / 100), int(ylength / 100), 1):
1440 m = ROOT.TEveLine()
1441 m.SetNextPoint(xpos, ypos, z)
1442 m.SetNextPoint(xpos + 0.05 * u.m, ypos, z)
1443 m.SetMainColor(ROOT.kRed)
1444 m.SetLineWidth(3)
1445 r.AddElement(m)
1446 t1 = ROOT.TEveText(str(i) + "m")
1447 t1.SetMainColor(ROOT.kGray + 3)
1448 t1.SetFontSize(5)
1449 t1.RefMainTrans().SetPos(xpos - 0.5 * u.m, ypos, z)
1450 r.AddElement(t1)
1451 ypos += 1 * u.m
1452 ty = ROOT.TEveText("y-axis")
1453 ty.SetFontSize(10)
1454 ty.RefMainTrans().SetPos(0.0, ypos + 1 * u.m, z)
1455 ty.SetMainColor(ROOT.kRed - 2)
1456 r.AddElement(ty)
1457 xpos, ypos = 0.0, 0.0
1458 z = z_end_of_detector(ShipGeo) + 10 * u.m
1459 xlength = 3 * u.m
1460 xpos = -xlength
1461 for i in range(-int(xlength / 100), int(xlength / 100), 1):
1462 m = ROOT.TEveLine()
1463 m.SetNextPoint(xpos, ypos, z)
1464 m.SetNextPoint(xpos, ypos - 0.05 * u.m, z)
1465 m.SetMainColor(ROOT.kRed)
1466 m.SetLineWidth(3)
1467 r.AddElement(m)
1468 t1 = ROOT.TEveText(str(i) + "m")
1469 t1.SetMainColor(ROOT.kGray + 3)
1470 t1.SetFontSize(5)
1471 t1.RefMainTrans().SetPos(xpos, ypos - 0.1 * u.m, z)
1472 r.AddElement(t1)
1473 xpos += 1 * u.m
1474 tx = ROOT.TEveText("x-axis")
1475 tx.SetFontSize(10)
1476 tx.RefMainTrans().SetPos(xpos + 1 * u.m, 0.0, z)
1477 tx.SetMainColor(ROOT.kRed - 2)
1478 r.AddElement(tx)
1479 rotAngle = ROOT.TMath.Pi() + ROOT.TMath.PiOver2() * 5.0 / 2.0
1480 positionText(
1481 r,
1482 0.0,
1483 900.0,
1484 ShipGeo.TrackStation1.z - 20 * u.m,
1485 rotAngle,
1486 "SHiP",
1487 200,
1488 ROOT.kOrange - 2,
1489 )
1490 positionText(
1491 r,
1492 0.0,
1493 750.0,
1494 ShipGeo.TrackStation1.z - 40 * u.m,
1495 rotAngle,
1496 "Vacuum decay vessel",
1497 200,
1498 ROOT.kGray + 1,
1499 )
1500 positionText(r, 0.0, 100.0, ShipGeo.target.z - 6 * u.m, rotAngle, "Target", 200, ROOT.kBlue)
1501 positionText(
1502 r,
1503 0.0,
1504 600.0,
1505 ShipGeo.muShield.z - 10 * u.m,
1506 rotAngle,
1507 "Active muon shield",
1508 200,
1509 ROOT.kGreen - 2,
1510 )
1511 positionText(
1512 r,
1513 0.0,
1514 600.0,
1515 ShipGeo.tauMudet.zMudetC - 10 * u.m,
1516 rotAngle,
1517 "Tau neutrino detector",
1518 200,
1519 ROOT.kRed - 2,
1520 )
1521 positionText(
1522 r,
1523 0.0,
1524 900.0,
1525 ShipGeo.Bfield.z - 5 * u.m,
1526 rotAngle,
1527 "Dipole Magnet",
1528 200,
1529 ROOT.kBlue + 2,
1530 )
1531 positionText(
1532 r,
1533 -1500.0,
1534 -800.0,
1535 ShipGeo.TrackStation3.z - 2 * u.m,
1536 rotAngle,
1537 "Strawtracker",
1538 200,
1539 ROOT.kRed + 2,
1540 )
1541 r.CloseCompound()
1542 sc = gEve.GetScenes()
1543 geoscene = sc.FindChild("Geometry scene")
1544 gEve.ElementChanged(geoscene, True, True)

◆ readCameraSetting()

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

Definition at line 872 of file eventDisplay.py.

872def readCameraSetting(fname: str = "camSetting.root") -> None:
873 f = ROOT.TFile.Open(fname)
874 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
875 f.GetKey(cam.ClassName()).Read(cam)
876 cam.IncTimeStamp()
877 gEve.GetDefaultGLViewer().RequestDraw()
878 f.Close()
879
880

◆ rename()

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

Definition at line 1009 of file eventDisplay.py.

1009def rename(name: str = "ship.TGeant4.root") -> None:
1010 f = ROOT.TFile(name, "UPDATE")
1011 t = f.Get("cbmsim")
1012 for x in t.GetListOfBranches():
1013 nm = x.GetName().replace("_1", "")
1014 x.SetName(nm)
1015 t.Write()
1016 f.Close()
1017
1018

◆ search()

None eventDisplay.search ( lvdict,
tag )

Definition at line 1003 of file eventDisplay.py.

1003def search(lvdict, tag) -> None:
1004 for x in lvdict:
1005 if not x.find(tag) < 0:
1006 print(x)
1007
1008

◆ select()

eventDisplay.select ( pattern)

Definition at line 994 of file eventDisplay.py.

994def select(pattern):
995 exc = []
996 for v in sGeo.GetListOfVolumes():
997 vname = v.GetName()
998 if not vname.find(pattern) < 0:
999 exc.append(vname)
1000 return exc
1001
1002

◆ speedUp()

None eventDisplay.speedUp ( )

Definition at line 881 of file eventDisplay.py.

881def speedUp() -> None:
882 for x in ["wire", "gas", "rockD", "rockS", "rockSFe"]:
883 xvol = sGeo.GetVolume(x)
884 if xvol:
885 xvol.SetVisibility(0)
886 for k in range(1, 7):
887 va = sGeo.GetVolume("T" + str(k))
888 if not va:
889 continue
890 for x in va.GetNodes():
891 nm = x.GetName()
892 if not nm.find("Inner") < 0 and k < 3:
893 x.SetVisDaughters(False)
894 x.SetVisibility(False)
895 if not nm.find("LiSc") < 0:
896 x.SetVisDaughters(False)
897 if not nm.find("RibPhi") < 0:
898 x.SetVisDaughters(False)
899
900
901# set display properties for tau nu target

◆ storeCameraSetting()

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

Definition at line 865 of file eventDisplay.py.

865def storeCameraSetting(fname: str = "camSetting.root") -> None:
866 f = ROOT.TFile.Open(fname, "RECREATE")
867 cam = ROOT.gEve.GetDefaultGLViewer().CurrentCamera()
868 cam.Write()
869 f.Close()
870
871

◆ switchOff()

None eventDisplay.switchOff ( tag)

Definition at line 914 of file eventDisplay.py.

914def switchOff(tag) -> None:
915 sc = gEve.GetScenes()
916 geoscene = sc.FindChild("Geometry scene")
917 for v in top.GetNodes():
918 vname = v.GetName()
919 if not vname.find(tag) < 0:
920 v.SetVisibility(0)
921 v.SetVisDaughters(0)
922 gEve.ElementChanged(geoscene, True, True)
923
924

◆ switchOffAll()

None eventDisplay.switchOffAll ( exc)

Definition at line 960 of file eventDisplay.py.

960def switchOffAll(exc) -> None:
961 sc = gEve.GetScenes()
962 geoscene = sc.FindChild("Geometry scene")
963 for v in top.GetNodes():
964 vname = v.GetName()
965 if not vname.find("cave") < 0:
966 continue
967 todo = True
968 for tag in exc:
969 if not tag.find(vname) < 0:
970 todo = False
971 if todo:
972 v.SetVisibility(0)
973 v.SetVisDaughters(0)
974 gEve.ElementChanged(geoscene, True, True)
975
976

◆ switchOffRock()

None eventDisplay.switchOffRock ( )

Definition at line 951 of file eventDisplay.py.

951def switchOffRock() -> None:
952 sc = gEve.GetScenes()
953 geoscene = sc.FindChild("Geometry scene")
954 for x in ["rockD", "rockS"]:
955 v = sGeo.FindVolumeFast(x)
956 v.SetVisibility(0)
957 gEve.ElementChanged(geoscene, True, True)
958
959

◆ switchOn()

None eventDisplay.switchOn ( tag)

Definition at line 925 of file eventDisplay.py.

925def switchOn(tag) -> None:
926 sc = gEve.GetScenes()
927 geoscene = sc.FindChild("Geometry scene")
928 for v in top.GetNodes():
929 vname = v.GetName()
930 if not vname.find(tag) < 0:
931 print("switch on ", vname)
932 v.SetVisibility(1)
933 v.SetVisDaughters(1)
934 gEve.ElementChanged(geoscene, True, True)
935
936

◆ switchOnAll()

None eventDisplay.switchOnAll ( exc)

Definition at line 977 of file eventDisplay.py.

977def switchOnAll(exc) -> None:
978 sc = gEve.GetScenes()
979 geoscene = sc.FindChild("Geometry scene")
980 for v in top.GetNodes():
981 vname = v.GetName()
982 if not vname.find("cave") < 0:
983 continue
984 todo = True
985 for tag in exc:
986 if not tag.find(vname) < 0:
987 todo = False
988 if todo:
989 v.SetVisibility(1)
990 v.SetVisDaughters(1)
991 gEve.ElementChanged(geoscene, True, True)
992
993

◆ z_end_of_detector()

float eventDisplay.z_end_of_detector ( ShipGeo)
Downstream reference for the rulers.

The scoring plane, or the former MuonStation3 position in geometry files
made before the SplitCal removal.

Definition at line 27 of file eventDisplay.py.

27def z_end_of_detector(ShipGeo) -> float:
28 """Downstream reference for the rulers.
29
30 The scoring plane, or the former MuonStation3 position in geometry files
31 made before the SplitCal removal.
32 """
33 if hasattr(ShipGeo, "CaloScoringPlane"):
34 return ShipGeo.CaloScoringPlane.z
35 return ShipGeo.MuonStation3.z
36
37

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 "CaloScoringPlanePoints": ("CaloScoringPlanePoint", ROOT.kMagenta, ROOT.kFullCircle),
5 "StrawPoints": ("strawtubesPoint", ROOT.kGreen, ROOT.kFullCircle),
6 "TargetPoints": ("TargetPoint", ROOT.kRed, ROOT.kFullSquare),
7 "MTCDetPoint": ("MTCDetPoint", ROOT.kGreen, ROOT.kFullSquare),
8 "SiliconTargetPoint": ("SiliconTargetPoint", ROOT.kCyan, ROOT.kFullSquare),
9}

Definition at line 1238 of file eventDisplay.py.

◆ _tmpFile

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

Definition at line 1234 of file eventDisplay.py.

◆ _tmpTree

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

Definition at line 1235 of file eventDisplay.py.

◆ action

eventDisplay.action

Definition at line 113 of file eventDisplay.py.

◆ bellField

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 1286 of file eventDisplay.py.

◆ bfield

eventDisplay.bfield = ROOT.genfit.FairShipFields()

Definition at line 1283 of file eventDisplay.py.

◆ br

eventDisplay.br = gEve.GetBrowser()

Definition at line 1299 of file eventDisplay.py.

◆ candidate

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

Definition at line 143 of file eventDisplay.py.

◆ compField

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

Definition at line 1289 of file eventDisplay.py.

◆ default

eventDisplay.default

Definition at line 106 of file eventDisplay.py.

◆ dest

eventDisplay.dest

Definition at line 95 of file eventDisplay.py.

◆ fieldMaker

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

Definition at line 1282 of file eventDisplay.py.

◆ fM

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

Definition at line 1294 of file eventDisplay.py.

◆ fMan

eventDisplay.fMan = None

Definition at line 62 of file eventDisplay.py.

◆ fRman

eventDisplay.fRman = ROOT.FairRootManager.Instance()

Definition at line 1265 of file eventDisplay.py.

◆ fRun

eventDisplay.fRun = None

Definition at line 63 of file eventDisplay.py.

◆ g

eventDisplay.g = ROOT.gROOT

Definition at line 65 of file eventDisplay.py.

◆ gEnv

eventDisplay.gEnv = ROOT.gEnv

Definition at line 66 of file eventDisplay.py.

◆ geoMat

eventDisplay.geoMat = ROOT.genfit.TGeoMaterialInterface()

Definition at line 1292 of file eventDisplay.py.

◆ gEve

eventDisplay.gEve = ROOT.gEve

Definition at line 1275 of file eventDisplay.py.

◆ GTrack

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

Definition at line 1226 of file eventDisplay.py.

◆ help

eventDisplay.help

Definition at line 95 of file eventDisplay.py.

◆ inFile

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

Definition at line 1199 of file eventDisplay.py.

◆ InputFile

eventDisplay.InputFile

Definition at line 141 of file eventDisplay.py.

◆ lsOfGlobals

eventDisplay.lsOfGlobals = ROOT.gROOT.GetListOfGlobals()

Definition at line 1269 of file eventDisplay.py.

◆ mcEngine

str eventDisplay.mcEngine = "TGeant4"

Definition at line 69 of file eventDisplay.py.

◆ mcHits

dict eventDisplay.mcHits = {}

Definition at line 1237 of file eventDisplay.py.

◆ options

eventDisplay.options = parser.parse_args()

Definition at line 132 of file eventDisplay.py.

◆ OutputFile

eventDisplay.OutputFile

Definition at line 1205 of file eventDisplay.py.

◆ parInput1

eventDisplay.parInput1 = ROOT.FairParRootFileIo()

Definition at line 1212 of file eventDisplay.py.

◆ parser

eventDisplay.parser = ArgumentParser()

Definition at line 93 of file eventDisplay.py.

◆ pdg

eventDisplay.pdg = ROOT.TDatabasePDG.Instance()

Definition at line 64 of file eventDisplay.py.

◆ recoFile

eventDisplay.recoFile

Definition at line 140 of file eventDisplay.py.

◆ required

eventDisplay.required

Definition at line 95 of file eventDisplay.py.

◆ rtdb

eventDisplay.rtdb = fRun.GetRuntimeDb()

Definition at line 1211 of file eventDisplay.py.

◆ rulers

eventDisplay.rulers = Rulers()

Definition at line 1306 of file eventDisplay.py.

◆ sGeo

eventDisplay.sGeo = ROOT.gGeoManager

Definition at line 1271 of file eventDisplay.py.

◆ SHiPDisplay

eventDisplay.SHiPDisplay = EventLoop()

Definition at line 1307 of file eventDisplay.py.

◆ ShipGeo

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

Definition at line 1231 of file eventDisplay.py.

◆ simEngine

str eventDisplay.simEngine = "Pythia8"

Definition at line 70 of file eventDisplay.py.

◆ sink

eventDisplay.sink = ROOT.FairRootFileSink(options.OutputFile)

Definition at line 1206 of file eventDisplay.py.

◆ source

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

Definition at line 1249 of file eventDisplay.py.

◆ sTree

eventDisplay.sTree = fRman.GetInChain()

Definition at line 1266 of file eventDisplay.py.

◆ suffix

eventDisplay.suffix

Definition at line 1205 of file eventDisplay.py.

◆ top

eventDisplay.top = sGeo.GetTopVolume()

Definition at line 1272 of file eventDisplay.py.

◆ Track

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

Definition at line 1225 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 "Scintillator": 80,
8 "LiquidScintillator": 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 75 of file eventDisplay.py.

◆ type

eventDisplay.type

Definition at line 128 of file eventDisplay.py.

◆ verbose

int eventDisplay.verbose = 0

Definition at line 1223 of file eventDisplay.py.

◆ withGeo

bool eventDisplay.withGeo = False

Definition at line 71 of file eventDisplay.py.

◆ withMCTracks

bool eventDisplay.withMCTracks = True

Definition at line 72 of file eventDisplay.py.