Skip to content

Instantly share code, notes, and snippets.

View jstrube's full-sized avatar

Jan Strube jstrube

View GitHub Profile
@jstrube
jstrube / Gauge Boson Mass Resolution.ipynb
Last active December 4, 2020 04:55
Notebook to investigate the effect of detector resolution on the separation of W and Z bosons
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jstrube
jstrube / lcdd2gdml.go
Last active August 29, 2015 14:20
Converter of lcdd files to gdml files. Basically just extracts the gdml sub-tree from the lcdd file
package main
import (
"fmt"
"encoding/xml"
"io/ioutil"
"flag"
)
type InnerGDML struct {
@jstrube
jstrube / parseSVN.go
Last active August 29, 2015 14:23
Proof-of-principle parser of the commit history of an svn repo. Requires the history to be dumped to a single file first.
package main
import (
"os"
"fmt"
"xml"
"time"
"strings"
)
type Path struct {
@jstrube
jstrube / LimitsCalculator.ipynb
Last active December 4, 2020 04:52
IJulia notebook to calculate expected upper limits.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jstrube
jstrube / adventofcode.jl
Created December 15, 2015 06:17
adventofcode
function santa(current, next)
if next == '^' current[1] += 1
elseif next == 'v' current[1] -= 1
elseif next == '<' current[2] += 1
elseif next == '>' current[2] -= 1
else println("not known:", next) end
current
end
#assign variable grid = input from http://adventofcode.com/day/3/input
@jstrube
jstrube / setILCGen_Metadata.py
Last active January 23, 2017 05:09
script to parse log files from SLAC and extract meta data for the DFC.
from DIRAC.Core.Base import Script
Script.initialize()
from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient
from DIRAC import gLogger
from urllib2 import urlopen
import os.path as path
import sys
from pprint import pprint
@jstrube
jstrube / bsubScript.sh
Created September 10, 2016 00:11
bsub script to process 5 files at a time on kekcc queues
#!/bin/bash
#BSUB -J singleParticles[1-130]
#BSUB -q s
### LCG Libraries
contents=($(ls /gpfs/group/ilc/suehara/reco/dbd/train-lcfiplus/bb91new/*.slcio))
filename="${contents[5*(${LSB_JOBINDEX} - 1)]} ${contents[5*(${LSB_JOBINDEX} - 1)+1]} ${contents[5*(${LSB_JOBINDEX} - 1)+2]} ${contents[5*(${LSB_JOBINDEX} - 1)+3]} ${contents[5*(${LSB_JOBINDEX} - 1)+4]} "
xmlfile=$(basename ${contents[${LSB_JOBINDEX} - 1]})
echo $xmlfile
echo ${LSB_JOBINDEX}
# Configuration file for the color ls utility
#
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty
process Zqq = e1, E1 => u:d:s:c:b, U:D:S:C:B
mb = 0
ms = 0
mc = 0
beams = e1, E1
beams_pol_density = @(-1), @(+1)
beams_pol_fraction = 80%, 30%
sqrts = 91 GeV
@jstrube
jstrube / print_FC_Storage.py
Created January 4, 2017 12:13
ILCDIRAC script to print the usage at a given StorageElement
#!/usr/bin/env python
""" Prints the storage usage at a given storage element.
Recursively traverses the starting path up to a given depth (default 2)
"""
from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient
from DIRAC.Core.Base import Script
import sys
import Queue
import threading