Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:47

0001 #!/usr/bin/python
0002 #
0003 # Copyright (c) 2019 Opticks Team. All Rights Reserved.
0004 #
0005 # This file is part of Opticks
0006 # (see https://bitbucket.org/simoncblyth/opticks).
0007 #
0008 # Licensed under the Apache License, Version 2.0 (the "License"); 
0009 # you may not use this file except in compliance with the License.  
0010 # You may obtain a copy of the License at
0011 #
0012 #   http://www.apache.org/licenses/LICENSE-2.0
0013 #
0014 # Unless required by applicable law or agreed to in writing, software 
0015 # distributed under the License is distributed on an "AS IS" BASIS, 
0016 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0017 # See the License for the specific language governing permissions and 
0018 # limitations under the License.
0019 #
0020 
0021 """
0022 ## NB system python
0023 
0024 g4lldb.py
0025 =============
0026 
0027 Caution with the PREFIXd comment strings in this
0028 file, they are parsed by this file to extract the 
0029 lldb startup command to define breakpoints.
0030 
0031 Using lldb breakpoint python scripting
0032 ---------------------------------------
0033 
0034 ::
0035 
0036     tboolean-;tboolean-box --okg4 --align --mask 1230 --pindex 0 -DD
0037 
0038         # special -DD debug launching: 
0039         #
0040         # 1. update the breakpoint setup, via parsing this file
0041         # 2. source the commands on starting lldb 
0042 
0043 
0044 Automated breakpoint scripting
0045 ---------------------------------
0046 
0047 The below is done on every op.sh launch with -D option
0048 and when envvar OPTICKS_LLDB_SOURCE is defined.
0049 
0050 ::
0051 
0052     delta:~ blyth$ g4lldb.py 
0053     # generated from-and-by /Users/blyth/opticks/ana/g4lldb.py 
0054     command script import opticks.ana.g4lldb
0055     br set -f CRandomEngine.cc -l 210
0056     br com add 1 -F opticks.ana.g4lldb.CRandomEngine_cc_210
0057     br set -f G4TrackingManager.cc -l 131
0058     br com add 2 -F opticks.ana.g4lldb.G4TrackingManager_cc_131
0059 
0060 
0061 Background on g4lldb python scripting
0062 -----------------------------------
0063 
0064 * moved to env-/lldb-vi as got too long 
0065 * see also env-/tools/lldb_/standalone.py for development of evaluation functions
0066 
0067 
0068     >>> from opticks.tools.evaluate import Evaluate
0069     >>> ev = Evaluate()
0070     >>> ev.evaluate_frame(lldb.frame)
0071     >>> this = lldb.frame.FindVariable("this")
0072     >>> ec = ev.evaluate_comp(this)
0073 
0074 
0075 """
0076 
0077 import os, sys, logging, re
0078 
0079 from collections import defaultdict, OrderedDict
0080 
0081 from opticks.ana.autobreakpoint import AutoBreakPoint
0082 from opticks.ana.ucf import UCF
0083 from opticks.ana.loc import Loc
0084 from opticks.class="varlink" href="/lxr/search?_filestring=tools">tools.lldb_ import lldb
0085 from opticks.class="varlink" href="/lxr/search?_filestring=tools">tools.evaluate import Evaluate, Value
0086 
0087 log = logging.getLogger(__name__)
0088 
0089 
0090 class Quote(object):
0091     PTN = re.compile("\"(\S*)\"")
0092 
0093     @classmethod
0094     def Extract(cls, s):
0095         q = cls(str(s))
0096         return q.q
0097 
0098     def __init__(self, s):
0099         match = self.PTN.search(str(s))
0100         self.q = match.group(1) if match else None
0101   
0102 
0103 
0104 FMT = "// %80s : %s " 
0105 COUNT = defaultdict(lambda:0)
0106 
0107 REGISTER = {}
0108 INSTANCE = defaultdict(lambda:[])
0109 
0110 
0111 
0112 class Frm(object):
0113     """
0114     """
0115     @classmethod 
0116     def Split(cls, memkln):
0117         if memkln.find(":") > -1:
0118              mem, kln = memkln.split(":")
0119         else:
0120              mem, kln = memkln, None
0121         pass 
0122         return mem, kln
0123 
0124     def __init__(self, frame, pfx="", pframe=None):
0125 
0126 
0127         loc = Loc(pframe)
0128 
0129         self.frame = frame
0130         self.pfx = pfx
0131         self.pframe = pframe
0132         self.loc = loc
0133         self.this = frame.FindVariable("this")
0134 
0135     def __call__(self, keykln ):
0136         key, kln = self.Split(keykln)
0137         kls = REGISTER.get(kln, None) 
0138         if key[0] == ".":
0139             child = self.this.GetValueForExpressionPath(key)
0140         elif key[0] == "/":
0141             child = self.frame.FindVariable(key[1:])
0142         else:
0143             child = self.this.GetChildMemberWithName(key)
0144         pass
0145         mpfx = self.pfx+"->"+key
0146         obj = kls(child, mpfx, pframe=self.pframe) if kls is not None else child
0147         return obj
0148 
0149 
0150  
0151 class QDict(OrderedDict):
0152 
0153     @classmethod
0154     def Dump(cls):
0155         for func, ls in INSTANCE.items():
0156             print FMT % ( func, len(ls) )
0157         pass
0158 
0159     
0160     loc = property(lambda self:self.frm.loc)
0161     tag = property(lambda self:self.frm.loc.tag)
0162     idx = property(lambda self:self.frm.loc.idx)
0163 
0164     def __init__(self,  this, pfx, pframe=None):
0165         """
0166         :param this: SBValue object 
0167         :param pfx: string prefix 
0168         :param pframe: python frame of calling breakpoint function sys._getframe()
0169         """
0170         OrderedDict.__init__(self)
0171 
0172         #print "QDict kls:%s pfx:%s " % (self.__class__.__name__, pfx )
0173 
0174         frame = this.GetFrame()
0175         loc = Loc(pframe)
0176 
0177         frm = Frm(frame, pfx, pframe)
0178 
0179         self.frm = frm 
0180         self.this = this
0181         self.pfx = pfx
0182 
0183 
0184         global INSTANCE
0185         if loc.func is not None:
0186             INSTANCE[loc.func].append(self)         
0187         pass
0188 
0189         if self.MEMBERS is None:
0190             return
0191         pass
0192         m = self.MEMBERS
0193         if "\n" in m:    ## multi-line raw members lists
0194             m = " ".join(m.replace("\n", " ").split())
0195         pass
0196 
0197         for keykln in m.split():
0198             key, kln = Frm.Split(keykln)
0199 
0200             #print "tag:%s key:%s kln:%s " % ( tag, key, kln ) 
0201 
0202             try:
0203                 self[key] = str(frm(keykln))
0204             except TypeError:
0205                 self[key] = "type-error" 
0206             pass
0207         pass
0208 
0209     def __repr__(self):
0210         lines = []
0211         if self.tag is not None:
0212             lines.append("")
0213             lines.append(self.loc.hdr)
0214         pass
0215         lines.append(FMT % (self.pfx, self.__class__.__name__))
0216         for k,v in self.items():
0217             brief = getattr(v, "BRIEF", False)
0218             composite = v.__class__ in REGISTER.values()
0219             if brief:
0220                 lines.append(FMT % (k,v))
0221             elif composite:
0222                 lines.append(FMT % (k, ""))
0223                 lines.append("%s" % v)
0224             else:
0225                 lines.append(FMT % (k,v))
0226             pass
0227         pass
0228         return "\n".join(lines)
0229 
0230 
0231 class bool_(QDict):
0232     BRIEF = True
0233     MEMBERS = None
0234     def __repr__(self):
0235         s = self.this.GetValue()
0236         return str(s == "true")
0237 
0238 class G4bool(bool_):
0239     pass
0240 
0241 class int_(QDict):
0242     BRIEF = True
0243     MEMBERS = None
0244     def __repr__(self):
0245         return " %d " % int(self.this.GetValue())
0246  
0247 class size_t(int_):
0248     pass
0249 
0250 class G4int(int_):
0251     pass
0252  
0253 class double_(QDict):
0254     BRIEF = True
0255     MEMBERS = None
0256     def __repr__(self):
0257         return " %g " % float(self.this.GetValue())  # GetValue yields str
0258 
0259 class G4double(double_):
0260     pass
0261 
0262 
0263 
0264 class G4ThreeVector(QDict):
0265     BRIEF = True
0266     MEMBERS = r"""
0267     dx:G4double
0268     dy:G4double
0269     dz:G4double
0270     """ 
0271     def __repr__(self):
0272         return  " (%s %s %s) " % ( self["dx"], self["dy"], self["dz"] )
0273         #return  " (%8.3f %8.3f %8.3f) " % ( float(self["dx"]), float(self["dy"]), float(self["dz"]) )
0274         
0275 
0276 
0277 
0278 
0279 
0280 
0281 class string_(QDict):
0282     BRIEF = True
0283     MEMBERS = None
0284     def __repr__(self):
0285         return " %s " % Quote.Extract(self.this)
0286     
0287 class G4String(string_):
0288     pass
0289       
0290 class Enum(QDict):
0291     BRIEF = True
0292     MEMBERS = None
0293     def __repr__(self):
0294         return " %s " % self.this.GetValue()
0295 
0296 
0297 class G4StepPoint(QDict):
0298     MEMBERS = r"""
0299     fPosition:G4ThreeVector 
0300     fGlobalTime:G4double 
0301     fMomentumDirection:G4ThreeVector 
0302     fPolarization:G4ThreeVector 
0303     fVelocity:G4double
0304     """
0305 
0306 class G4Step(QDict):
0307     MEMBERS = r"""
0308     fpPreStepPoint:G4StepPoint 
0309     fpPostStepPoint:G4StepPoint
0310     """
0311 
0312 class G4SteppingManager(QDict):
0313     MEMBERS = r"""
0314     fStep:G4Step 
0315     fStepStatus:Enum 
0316     PhysicalStep:G4double 
0317     fCurrentProcess:G4VProcess
0318     """
0319 
0320 class G4TrackingManager(QDict):
0321     MEMBERS = r"""
0322     .fpSteppingManager.fCurrentProcess.theProcessName:G4String 
0323 
0324     .fpSteppingManager.fStep.fpPreStepPoint.fPosition:G4ThreeVector
0325     .fpSteppingManager.fStep.fpPreStepPoint.fGlobalTime:G4double
0326 
0327     .fpSteppingManager.fStep.fpPostStepPoint.fPosition:G4ThreeVector
0328     .fpSteppingManager.fStep.fpPostStepPoint.fGlobalTime:G4double
0329     """
0330 
0331     _MEMBERS = r"""
0332     fpSteppingManager:G4SteppingManager
0333 
0334     .fpSteppingManager.fStepStatus:Enum
0335     .fpSteppingManager.PhysicalStep:G4double
0336     .fpSteppingManager.fStep.fpPreStepPoint.fMomentumDirection:G4ThreeVector
0337     .fpSteppingManager.fStep.fpPostStepPoint.fMomentumDirection:G4ThreeVector
0338     """
0339 
0340 class G4VProcess(QDict):
0341     MEMBERS = r"""
0342     theProcessName:G4String
0343     """
0344 
0345 
0346 
0347 
0348 class CRandomEngine_cc_flatExit(QDict):
0349     MEMBERS = r"""
0350     .m_flat:double
0351     .m_curand_index:int
0352     .m_current_record_flat_count:int
0353     .m_current_step_flat_count:int
0354     .m_location:string
0355     """ 
0356     def __repr__(self):
0357         brief = " %3d %3d  : %s : %s " % ( 
0358                                   int(self[".m_current_record_flat_count"]),
0359                                   int(self[".m_current_step_flat_count"]),
0360                                   self[".m_flat"],
0361                                   self[".m_location"]
0362                                 )
0363         return FMT % (self.tag, brief)
0364 
0365 
0366 
0367 
0368 ENGINE = None
0369 class CRandomEngine(object):
0370     def __init__(self, pindex):
0371         pass
0372         ucf = UCF( pindex )
0373         print repr(ucf)
0374         self.ucf = ucf 
0375         self.pindex = pindex
0376 
0377     def postTrack(self, func):
0378         finst = INSTANCE[func]
0379         for i, inst in enumerate(finst):
0380             print "%30s : %s " % ( i, inst )
0381             #print "%30s : %10s : %s " % ( i, inst[".m_curand_index"], inst )
0382         pass
0383  
0384 
0385 def CRandomEngine_cc_flatExit_(frame, bp_loc, sess):
0386     """  
0387     flatExit
0388  
0389     (*lldb*) br set -f CRandomEngine.cc -l %(flatExit)s
0390     (*lldb*) br com add 1 -F opticks.ana.g4lldb.CRandomEngine_cc_flatExit_
0391     """
0392 
0393     e = Evaluate()
0394     v = Value(frame.FindVariable("this"))
0395 
0396     u_g4 = e(v("m_flat")) 
0397     loc_g4 = e(v("m_location")) 
0398     assert type(u_g4) is float 
0399     assert type(loc_g4) is str 
0400 
0401     crfc = e(v("m_current_record_flat_count")) 
0402     curi = e(v("m_curand_index")) 
0403     assert type(crfc) is int 
0404     assert type(curi) is int
0405 
0406     assert ENGINE is not None 
0407     lucf = len(ENGINE.ucf) 
0408     u = ENGINE.ucf[crfc-1] if crfc-1 < lucf else None 
0409 
0410     u_ok = u.fval if u is not None else -1
0411     loc_ok = u.lab  if u is not None else "ucf-overflow" 
0412 
0413     df = abs(u_g4 - u_ok) 
0414     misrng = df > 1e-6 
0415     misloc = loc_ok != loc_g4
0416     mrk = "%s%s" % ( "*" if misrng else "-", "#" if misloc else "-")
0417 
0418     print "flatExit: mrk:%2s crfc:%5d df:%.9g u_g4:%.9g u_ok:%.9g loc_g4:%20s loc_ok:%20s  : lucf : %d    " % ( mrk, crfc, df, u_g4, u_ok, loc_g4,loc_ok, lucf )
0419     print u 
0420 
0421     stop = mrk != "--"
0422     return stop
0423 
0424 
0425 
0426 def CRandomEngine_cc_preTrack_(frame, bp_loc, sess):
0427     global ENGINE
0428 
0429     e = Evaluate()
0430     v = Value(frame.FindVariable("this"))
0431     curi = e(v("m_curand_index")) 
0432     assert type(curi) is int 
0433     print "curi:%d " % curi 
0434 
0435     ENGINE = CRandomEngine(pindex=curi)
0436     return False
0437     
0438 
0439 def CRandomEngine_cc_postTrack_(frame, bp_loc, sess):
0440     ENGINE.postTrack("CRandomEngine_cc_flatExit_")
0441     return False
0442 
0443 
0444 
0445 
0446 
0447 def _G4SteppingManager_cc_191_(frame, bp_loc, sess):
0448     """
0449     After DefinePhysicalStepLength() sets PhysicalStep and fStepStatus, before InvokeAlongStepDoItProcs()
0450 
0451     g4-;g4-cls G4SteppingManager 
0452     """
0453     stepMgr = G4SteppingManager(frame.FindVariable("this") , "this", sys._getframe() ) 
0454     print stepMgr
0455     return True
0456 
0457 
0458 def _G4TrackingManager_cc_131_(frame, bp_loc, sess):
0459     """
0460     Step Conclusion : TrackingManager step loop just after Stepping() 
0461 
0462     g4-;g4-cls G4TrackingManager 
0463     """
0464 
0465     trackMgr = G4TrackingManager(frame.FindVariable("this") , "this", sys._getframe() ) 
0466     print trackMgr
0467     QDict.Dump() 
0468 
0469     return False
0470 
0471 
0472 
0473 
0474 class OpRayleigh_cc_ExitPostStepDoIt(QDict):
0475     MEMBERS = r"""
0476     .theProcessName:G4String 
0477     .thePILfactor:G4double
0478     .aParticleChange.thePositionChange:G4ThreeVector
0479     .aParticleChange.thePolarizationChange:G4ThreeVector
0480     .aParticleChange.theMomentumDirectionChange:G4ThreeVector
0481    
0482     /rand:G4double
0483     /constant:G4double
0484     /cosTheta:G4double
0485     /CosTheta:G4double
0486     /SinTheta:G4double
0487     /CosPhi:G4double
0488     /SinPhi:G4double
0489     /OldMomentumDirection:G4ThreeVector
0490     /NewMomentumDirection:G4ThreeVector
0491     /OldPolarization:G4ThreeVector
0492     /NewPolarization:G4ThreeVector
0493 
0494     """
0495 
0496 class OpRayleigh_cc_EndWhile(OpRayleigh_cc_ExitPostStepDoIt):
0497     pass
0498 
0499 
0500 def _OpRayleigh_cc_EndWhile_(frame, bp_loc, sess):
0501     """
0502     EndWhile
0503     """
0504     inst = OpRayleigh_cc_EndWhile(frame.FindVariable("this") , "this", sys._getframe() )
0505     print inst
0506     return False
0507 
0508 
0509 def _OpRayleigh_cc_ExitPostStepDoIt_(frame, bp_loc, sess):
0510     """
0511     ExitPostStepDoIt
0512 
0513     opticks-;opticks-cls OpRayleigh
0514     g4-;g4-cls G4VDiscreteProcess
0515     g4-;g4-cls G4VProcess
0516     """
0517     inst = OpRayleigh_cc_ExitPostStepDoIt(frame.FindVariable("this") , "this", sys._getframe() )
0518     print inst
0519     return False
0520 
0521 
0522 
0523 
0524 
0525 
0526 
0527 class G4SteppingManager2_cc_181(QDict):
0528     MEMBERS = r"""
0529     .fCurrentProcess.theProcessName:G4String 
0530     .physIntLength:G4double 
0531     fCurrentProcess:G4VProcess 
0532     fCondition:Enum 
0533     fStepStatus:Enum 
0534     fPostStepDoItProcTriggered:size_t
0535     """
0536     _MEMBERS = "PhysicalStep"  # undef at this juncture
0537 
0538     @classmethod 
0539     def Dump(cls, pframe):
0540 
0541         func = pframe.f_code.co_name
0542         doc = pframe.f_code.co_consts[0]
0543         doclines = filter(None, doc.split("\n"))
0544         label = doclines[0].lstrip() if len(doclines) > 0 else "-"  # 1st line of docstring
0545      
0546         bpfunc = "%s_" % cls.__name__ 
0547         print "%s : %s " % ( bpfunc, label)
0548         
0549         qwn = ".fCurrentProcess.theProcessName .physIntLength"
0550         for i, inst in enumerate(INSTANCE[bpfunc]):        
0551             for q in qwn.split():
0552                 print FMT % ( q, inst[q] )
0553             pass
0554         pass
0555         INSTANCE[bpfunc][:] = []    ## clear collected breakpoint states
0556 
0557 
0558 def _G4SteppingManager2_cc_181_(frame, bp_loc, sess):
0559     """
0560     Collecting physIntLength within process loop after PostStepGPIL
0561 
0562     g4-;g4-cls G4SteppingManager 
0563 
0564     See:  notes/issues/stepping_process_review.rst 
0565     """
0566     inst = G4SteppingManager2_cc_181(frame.FindVariable("this"), "this", sys._getframe() )
0567     #print inst.tag
0568     #print inst 
0569     return False
0570 
0571 def _G4SteppingManager2_cc_225_(frame, bp_loc, sess):
0572     """
0573     Dumping lengths collected by _181 after PostStep process loop 
0574     """
0575     G4SteppingManager2_cc_181.Dump(sys._getframe())
0576     return False
0577 
0578 
0579 class G4SteppingManager2_cc_270(QDict):
0580     MEMBERS = r"""
0581     .fCurrentProcess.theProcessName:G4String 
0582     .physIntLength:G4double 
0583     .PhysicalStep:G4double 
0584     .fStepStatus:Enum
0585     """
0586 
0587 def _G4SteppingManager2_cc_270_(frame, bp_loc, sess):
0588     """
0589     Near end of DefinePhysicalStepLength : Inside MAXofAlongStepLoops after AlongStepGPIL
0590 
0591     g4-;g4-cls G4SteppingManager
0592     """
0593     inst = G4SteppingManager2_cc_270(frame.FindVariable("this"), "this", sys._getframe() )
0594     print inst
0595     return False
0596 
0597 
0598 class DsG4OpBoundaryProcess_cc_ExitPostStepDoIt(QDict):
0599     MEMBERS = r"""
0600     .OldMomentum:G4ThreeVector
0601     .NewMomentum:G4ThreeVector
0602     .theStatus
0603     """
0604 
0605 def _DsG4OpBoundaryProcess_cc_ExitPostStepDoIt_(frame, bp_loc, sess):
0606     """
0607     ExitPostStepDoIt
0608 
0609     opticks-;opticks-cls DsG4OpBoundaryProcess
0610     """
0611     inst = DsG4OpBoundaryProcess_cc_ExitPostStepDoIt(frame.FindVariable("this"), "this", sys._getframe() )
0612     print inst
0613     return False
0614 
0615 
0616 class DsG4OpBoundaryProcess_cc_DiDiTransCoeff(QDict):
0617     MEMBERS = r"""
0618     .OldMomentum:G4ThreeVector
0619     .NewMomentum:G4ThreeVector
0620     /TransCoeff:G4double
0621     /_u:G4double
0622     /_transmit:bool_
0623     """
0624 
0625 def DsG4OpBoundaryProcess_cc_DiDiTransCoeff_(frame, bp_loc, sess):
0626     """
0627     DiDiTransCoeff
0628     opticks-;opticks-cls DsG4OpBoundaryProcess
0629     """
0630     inst = DsG4OpBoundaryProcess_cc_DiDiTransCoeff(frame.FindVariable("this"), "this", sys._getframe() )
0631     print inst
0632     return False
0633 
0634 
0635 
0636 
0637 
0638 
0639 class G4Navigator_ComputeStep_1181(QDict):
0640     MEMBERS = r"""
0641     .fNumberZeroSteps:G4int
0642     .fLastStepWasZero:G4bool
0643     """  
0644 
0645 def _G4Navigator_ComputeStep_1181_(frame, bp_loc, sess):
0646     """
0647     ComputeStep return : NOT WORKING : MISSING THIS 
0648     """ 
0649     inst = G4Navigator_ComputeStep_1181(frame.FindVariable("this"), "this", sys._getframe() )
0650     print inst
0651     return True
0652 
0653     
0654 
0655 class G4Transportation_cc_517(QDict):
0656     MEMBERS = r"""
0657     .fParticleChange.thePositionChange:G4ThreeVector
0658     """
0659 
0660     _MEMBERS = r"""
0661     /startPosition:G4ThreeVector
0662     /startMomentumDir:G4ThreeVector
0663     /newSafety:G4double
0664     .fGeometryLimitedStep:G4bool
0665     .fFirstStepInVolume:G4bool
0666     .fLastStepInVolume:G4bool
0667     .fMomentumChanged:G4bool
0668     .fShortStepOptimisation:G4bool
0669     .fTransportEndPosition:G4ThreeVector
0670     .fTransportEndMomentumDir:G4ThreeVector
0671     .fEndPointDistance:G4double
0672     .fParticleChange.thePositionChange:G4ThreeVector
0673     .fParticleChange.theMomentumDirectionChange:G4ThreeVector
0674     .fLinearNavigator.fNumberZeroSteps:G4int
0675     .fLinearNavigator.fLastStepWasZero:G4bool
0676     """
0677 
0678 
0679 def _G4Transportation_cc_517_(frame, bp_loc, sess):
0680     """
0681     AlongStepGetPhysicalInteractionLength Exit 
0682 
0683     g4-;g4-cls G4Transportation
0684     """
0685     inst = G4Transportation_cc_517(frame.FindVariable("this"), "this", sys._getframe() )
0686     print inst
0687     return False
0688 
0689 
0690 
0691 
0692 def G4VDiscreteProcess_PostStepGetPhysicalInteractionLength(frame, bp_loc, sess):
0693     """
0694     """
0695     name = "%s.%s " % ( __name__, sys._getframe().f_code.co_name  )
0696     proc = frame.FindVariable("this")
0697     procName = proc.GetChildMemberWithName("theProcessName")
0698     left = proc.GetChildMemberWithName("theNumberOfInteractionLengthLeft")
0699     print "%100s %s %s  " % ( name, procName, left )
0700     return False
0701 
0702 def G4VProcess_ResetNumberOfInteractionLengthLeft(frame, bp_loc, sess):
0703     """
0704     """
0705     name = "%s.%s " % ( __name__, sys._getframe().f_code.co_name  )
0706     this = frame.FindVariable("this")
0707     procName = this.GetChildMemberWithName("theProcessName")
0708 
0709     print "%100s %s " % ( name, procName )
0710     return False
0711 
0712 
0713 class Mock(object):
0714     def GetChildMemberWithName(self, name):
0715         return name
0716 
0717 def test_G4StepPoint():
0718     dummy = Mock() 
0719     sp = G4StepPoint(dummy,"dummy")
0720     print sp  
0721 
0722 
0723 
0724 
0725 REGISTER["G4ThreeVector"] = G4ThreeVector
0726 REGISTER["double"] = double_
0727 REGISTER["string"] = string_
0728 REGISTER["int"] = int_
0729 REGISTER["G4double"] = G4double
0730 REGISTER["G4bool"] = G4bool
0731 REGISTER["bool_"] = bool_
0732 REGISTER["G4int"] = G4int
0733 REGISTER["size_t"] = size_t
0734 REGISTER["G4String"] = G4String
0735 REGISTER["Enum"] = Enum
0736 REGISTER["G4StepPoint"] = G4StepPoint
0737 REGISTER["G4Step"] = G4Step
0738 REGISTER["G4SteppingManager"] = G4SteppingManager
0739 REGISTER["G4TrackingManager"] = G4TrackingManager
0740 REGISTER["G4VProcess"] = G4VProcess
0741 REGISTER["CRandomEngine"] = CRandomEngine
0742 
0743 
0744 
0745 
0746 
0747 
0748 def test_Quote():
0749     """
0750 
0751     The exmaple docstring first line
0752     The exmaple docstring
0753     """
0754 
0755     s = "(G4String) theProcessName = (std::__1::string = \"OpBoundary\")"
0756     q = Quote.Extract(s)
0757     print q
0758     assert q == "OpBoundary"
0759 
0760 
0761 def test_resolve_bp():
0762     print resolve_bp("CRandomEngine.cc", "flatExit")
0763 
0764 if __name__ == '__main__':
0765 
0766     #logging.basicConfig(level=logging.INFO) 
0767     print AutoBreakPoint(path=__file__, module="opticks.ana.g4lldb")
0768     #test_Quote()
0769     #test_resolve_bp()
0770 
0771 
0772 
0773 
0774 
0775 
0776 
0777 
0778 
0779 
0780