diff options
Diffstat (limited to 'sim.py')
-rwxr-xr-x | sim.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -75,7 +75,13 @@ def write_event(T, ev, event_id, hits, photon_start=None, photon_stop=None): root.fill_hits(ev, len(hits['t']), hits['t'], hits['q'], hits['history']) T.Fill() -#@profile +# Allow profile decorator to exist, but do nothing if not running under kernprof +try: + profile = profile +except NameError: + profile = lambda x: x + +@profile def main(): parser = optparse.OptionParser('%prog') parser.add_option('-b', type='int', dest='nbits', default=10) |