I hereby claim:
- I am cshimmin on github.
- I am cshimmin (https://keybase.io/cshimmin) on keybase.
- I have a public key whose fingerprint is 3B63 7F65 7C37 F6FE E1F5 963A 8BB0 5DAE 1977 9A91
To claim this, I am signing this object:
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
# NOTE FOR WINDOWS USERS: | |
# You can download a "exefied" version of this game at: | |
# http://kch42.de/progs/tetris_py_exefied.zip | |
# If a DLL is missing or something like this, write an E-Mail (kevin@kch42.de) | |
# or leave a comment on this gist. | |
# Very simple tetris implementation |
import subprocess | |
list_of_files = ['some', 'list', 'of', 'files', ...] | |
template = '''#!/bin/bash | |
# you can access python variables using named format strings | |
INPUT_FILES="%(input_files)s" | |
./run_analysis_program.py $INPUT_FILES | |
''' |
#!/usr/bin/env python | |
''' quick proof-of-concept for indexed TChains ''' | |
import sys | |
import argparse | |
import ROOT as r | |
import numpy as np | |
class IndexedChain(r.TChain): |
#!/usr/bin/env expect | |
# this expect script will connect to an lxplus node, | |
# start a vncserver session, and then locally | |
# forward the vnc host to port 5901. | |
# the ssh session is left open with a kill command ready to go | |
# for easy cleanup. | |
set timeout 30 | |
# set this to (uniquely) match your terminal prompt. if your |
#!/usr/bin/env expect | |
# this expect script will connect to an lxplus node, | |
# start a vncserver session, and then locally | |
# forward the vnc host to port 5901. | |
# the ssh session is left open with a kill command ready to go | |
# for easy cleanup. | |
set timeout 30 | |
set local_user [lindex [array get env USER] 1] |
#!/usr/bin/env python | |
import numpy as np | |
''' | |
Try to simulate the nearAvg5 distribution with pixel | |
noise modelled as a gamma distribution. | |
''' | |
def simulate_navg(threshold=40., nsamples=100000, mean=25., shape=2., gridsize=5): | |
if not gridsize%2: |
import sys, os | |
import ROOT as r | |
# prohibit root from hijacking command-line args | |
r.PyConfig.IgnoreCommandLineOptions = True | |
try: | |
ROOTCORE_PATH = os.environ['ROOTCOREDIR'] | |
except KeyError: | |
print >>sys.stderr, "Warning! $ROOTCOREDIR env. variable is not set. Did you configure RootCore?" | |
ROOTCORE_PATH = None |
I hereby claim:
To claim this, I am signing this object:
import sys | |
import ROOT as r | |
from analysis_utils.root.dpd_object import get_objects, build_tlv | |
if __name__ == "__main__": | |
t = r.TChain("physics") | |
map(t.Add, sys.argv[1:]) | |
for evt in t: | |
# pull lightweight 'objects' from the mc_* branches |
import sys | |
import ROOT as r | |
from analysis_utils.root.dpd_object import get_objects, build_tlv | |
if __name__ == "__main__": | |
t = r.TChain("physics") | |
map(t.Add, sys.argv[1:]) | |
for evt in t: | |
# pull lightweight 'objects' from the mc_* branches |