Public Member Functions | |
def | __init__ |
Public Attributes | |
detelem | |
logvol | |
which |
Definition at line 3 of file visdet.py.
def visdet::VisDetConfig::__init__ | ( | self, | ||
logvol = "" , |
||||
detelem = "" , |
||||
which = "RawTracerX" | ||||
) |
Definition at line 4 of file visdet.py.
00004 : 00005 self.detelem = detelem 00006 self.logvol = logvol 00007 self.which = which 00008 00009 print "Using vis method: ",self.which 00010 00011 import gaudimodule as gm 00012 import units 00013 app = gm.AppMgr() 00014 app.ExtSvc += ["GiGa"] 00015 00016 modularPL = app.property("GiGa.GiGaPhysListModular") 00017 #modularPL.OutputLevel = 1 00018 modularPL.CutForElectron = 100*units.micrometer 00019 modularPL.CutForPositron = 100*units.micrometer 00020 modularPL.CutForGamma = 1*units.millimeter 00021 modularPL.PhysicsConstructors = [ 00022 "DsPhysConsGeneral", 00023 "DsPhysConsOptical" 00024 ] 00025 00026 print "\tGetting property GiGaEventActionCommand:" 00027 viscmd = app.property("GiGa.GiGaEventActionCommand") 00028 #viscmd.OutputLevel = 1 00029 #viscmd.EndOfEventCommands = [ 00030 # "/vis/viewer/update" 00031 # "/vis/viewer/flush", 00032 # ] 00033 00034 print "\tSet EndOfEventCommands" 00035 00036 if self.which == "DAWNFILE": 00037 viscmd.BeginOfEventCommands = \ 00038 [ "/vis/scene/create", 00039 "/vis/sceneHandler/create DAWNFILE", 00040 "/vis/viewer/create", 00041 "/vis/viewer/set/viewpointThetaPhi -90 -90", 00042 "/vis/scene/add/volume", 00043 "/vis/scene/add/trajectories" ] 00044 elif self.which == "HepRepFile": 00045 viscmd.BeginOfEventCommands = [ 00046 "/vis/open HepRepFile", 00047 #"/vis/scene/create", 00048 #"/vis/scene/add/volume "+self.detelem, 00049 #"/vis/DrawVolume", 00050 "/vis/viewer/flush" 00051 ] 00052 elif self.which == "HepRepXML": 00053 viscmd.BeginOfEventCommands = \ 00054 [ "/vis/open HepRepXML", 00055 "/vis/scene/create far.heprep", 00056 "/vis/scene/add/volume", 00057 "/vis/sceneHandler/attach", 00058 #"/vis/drawVolume", 00059 "/vis/viewer/flush" 00060 ] 00061 elif self.which == "OGLIXm" or self.which == "OGLSXm": 00062 viscmd.BeginOfEventCommands = [ 00063 "/vis/open "+self.which, 00064 "/vis/drawVolume", 00065 ] 00066 elif self.which == "OGLIX" or self.which == "OGLSX": 00067 viscmd.BeginOfEventCommands = [ 00068 "/vis/open "+self.which, 00069 "/vis/drawVolume", 00070 ] 00071 elif self.which == "OIX": 00072 viscmd.BeginOfEventCommands = [ 00073 "/vis/open OIX", 00074 "/vis/drawVolume", 00075 ] 00076 elif self.which == "RayTracer" or self.which == "RayTracerX": 00077 viscmd.BeginOfEventCommands = [ 00078 #"/vis/open "+self.which, 00079 #"/vis/viewer/reset", 00080 #"/vis/scene/create", 00081 #"/vis/scene/add/volume "+self.detelem, 00082 #"/vis/sceneHandler/attach", 00083 #"/vis/viewer/set/style surface", 00084 #"/vis/viewer/set/projection perspective 50 deg", 00085 #"/vis/viewer/set/viewpointThetaPhi 130 20", 00086 #"/vis/viewer/zoom 0.5", 00087 #"/vis/rayTracer/trace foo.jpg", 00088 #"/vis/viewer/flush", 00089 ] 00090 elif self.which == "ATree": 00091 viscmd.BeginOfEventCommands = [ 00092 "/vis/open ATree", 00093 "/vis/ASCIITree/Verbose 15", 00094 "/vis/scene/create", 00095 "/vis/scene/add/volume "+self.detelem, 00096 "/vis/sceneHandler/attach", 00097 "/vis/drawTree", 00098 "/vis/viewer/flush", 00099 ] 00100 elif self.which == "GAGTree": 00101 viscmd.BeginOfEventCommands = [ 00102 "/vis/open GAGTree", 00103 "/vis/scene/create", 00104 "/vis/scene/add/volume "+self.detelem, 00105 "/vis/sceneHandler/attach", 00106 "/vis/drawTree", 00107 "/vis/viewer/flush", 00108 ] 00109 elif self.which == "xml": 00110 viscmd.BeginOfEventCommands = [ 00111 "/vis/open XMLTree", 00112 "/vis/scene/create", 00113 "/vis/scene/add/volume "+self.detelem, 00114 "/vis/sceneHandler/attach", 00115 "/vis/drawTree", 00116 "/vis/viewer/flush", 00117 ] 00118 else: 00119 viscmd.BeginOfEventCommands = [] 00120 00121 #eventseq = app.property("GiGa.GiGaEventActionSequence") 00122 #eventseq.Members = [# "GiGaEventActionDraw/DrawEvent", 00123 #"GiGaEventActionCommand" ] 00124 00125 00126 app.TopAlg += [ "GaudiSequencer/Simulation" ] 00127 seq = app.algorithm("Simulation") 00128 seq.Members = [ "GiGaInputStream/GIO" ] 00129 00130 gio = app.algorithm("GIO") 00131 gio.ExecuteOnce = True 00132 gio.ConversionSvcName = "GiGaGeo" 00133 gio.DataProviderSvcName = "DetectorDataSvc" 00134 gio.StreamItems = [ self.logvol, self.detelem ] 00135 00136 import units 00137 ggg = app.service("GiGaGeo") 00138 ggg.XsizeOfWorldVolume = 2400*units.meter 00139 ggg.YsizeOfWorldVolume = 2400*units.meter 00140 ggg.ZsizeOfWorldVolume = 2400*units.meter 00141 #ggg.WorldPhysicalVolumeName = "pvFarSiteRock" 00142 #ggg.WorldLogicalVolumeName = "lvFarSiteRock" 00143 00144 seq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ] 00145 push = app.algorithm("PushKine") 00146 push.Converter = "HepMCtoG4" 00147 00148 giga = app.service("GiGa") 00149 giga.PhysicsList = "GiGaPhysListModular" 00150 giga.EventAction = "GiGaEventActionCommand" 00151 giga.VisManager = "GiGaVisManager/GiGaVis" 00152 if self.which[0:3] == 'Ray': 00153 giga.UIsession = "GiGaUIsession/GiGaUI" 00154 00155 00156 00157 if '__main__' == __name__: