Skip to content

Instantly share code, notes, and snippets.

View jstrube's full-sized avatar

Jan Strube jstrube

View GitHub Profile
@jstrube
jstrube / tubePlotting.jl
Created August 28, 2021 22:23
Plotting the ZVTop algorithm on three tracks
using GLMakie
const σT = 0.3
function tube(x0, κ, ϕ, x, y)
exp(-0.5*(x*cos(ϕ) + y*sin(ϕ) - x0 - κ*(y*cos(ϕ) - x*sin(ϕ))^2)^2 / σT^2)
end
f1(x, y) = tube(0, 0.01, 1.05, x, y)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jstrube
jstrube / testEvtShapes.jl
Created December 20, 2018 06:33
Test case for julia-1.1-pre performance regression
using StaticArrays
using BenchmarkTools
using LinearAlgebra
function testfoxWolframMoments(entries)
h0 = 0.0
hd = 0.0
# init
h10 = 0.0
h20 = 0.0
@jstrube
jstrube / perfectClustering.jl
Created July 30, 2018 04:21
Starting point for finding the enveloping ellipsoid for a point cloud of calorimeter hits
###
# Compiles a cloud of calorimeter hits for each MCParticle
# Calorimeter cells with multiple hits are assigned to each particle, weighted with the correct energy contribution
###
using LCIO
using DataStructures
using PyPlot
using JuMP
@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
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
# 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
@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}
@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 / 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