Skip to content

Instantly share code, notes, and snippets.

View matz-e's full-sized avatar
🎯
Focusing

Matthias Wolf matz-e

🎯
Focusing
View GitHub Profile
{
"cmsweb-dev": {
"delegate-dn": [
"/DC=ch/DC=cern/OU=computers/CN=jibbers-crabst.cern.ch|/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=matze/CN=695852/CN=Matthias Wolf|/DC=ch/DC=cern/OU=computers/CN=vocms(3[136]|21|045|052|021|03[01]).cern.ch"
],
"transformation": {
"Analysis": "http://common-analysis-framework.cern.ch/CMSRunAnaly.sh",
"PrivateMC": "http://common-analysis-framework.cern.ch/CMSRunMCProd.sh"
},
"backend-urls" : {
@matz-e
matz-e / UseCrab.sh
Last active August 29, 2015 14:10
Crab bash completion for commands. Just source it!
# with help of the following unix-chainsaw command line:
# crab help|sed -n '/^Valid/,/^To/p'|awk '/^ / {print $1}'|while read cmd; do echo $cmd\); echo "'$(crab $cmd -h|sed -ne '/^ *-/ s/.*\(--\w*\).*/\1/p')'"; done
_UseCrab ()
{
local cur
COMPREPLY=()
# echo ${COMP_WORDS[1]}
cur=${COMP_WORDS[COMP_CWORD]}
sub=${COMP_WORDS[1]}
@matz-e
matz-e / parrot_test.sh
Last active August 29, 2015 14:21
Parrot ELF error test script. Execute at ND or adjust HTTP_PROXY.
dir=$(mktemp -d)
cd $dir
export HTTP_PROXY="http://eddie.crc.nd.edu:3128"
parrot_run bash<<EOF
source /cvmfs/cms.cern.ch/cmsset_default.sh
export SCRAM_ARCH=slc6_amd64_gcc491
scramv1 project CMSSW CMSSW_7_3_5
cd CMSSW_7_3_5
@matz-e
matz-e / mc_production.py
Created May 26, 2015 16:46
MC test generation config.
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: MinBias_8TeV_cfi --conditions auto:startup -s GEN,SIM --datatier GEN-SIM -n 10
# --relval 9000,300 --eventcontent RAWSIM --io MinBias.io --python MinBias.py --no_exec --fileout minbias.root
import FWCore.ParameterSet.Config as cms
process = cms.Process('SIM')
@matz-e
matz-e / hf_1x1_test.py
Last active December 1, 2015 14:53
Test configuration for HCAL HF 1x1 update
import FWCore.ParameterSet.Config as cms
process = cms.Process("HFCALIB")
## Import of standard configurations
process.load('FWCore/MessageService/MessageLogger_cfi')
process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff")
process.GlobalTag.globaltag = 'PRE_SHI72_V7'
@matz-e
matz-e / run.sh
Last active December 10, 2015 13:33
Run CMS MCM workflow with one event
#!/bin/sh
set -e
mkdir -p mc_gen3
cd mc_gen3
source /cvmfs/cms.cern.ch/cmsset_default.sh
curl -k https://cms-pdmv.cern.ch/mcm/public/restapi/requests/get_setup/HIG-RunIIWinter15wmLHE-00196 > setup01_lhe.sh
import FWCore.ParameterSet.Config as cms
process = cms.Process("HFCALIB")
## Import of standard configurations
process.load('FWCore/MessageService/MessageLogger_cfi')
process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff")
from Configuration.AlCa.autoCond import autoCond
@matz-e
matz-e / trigger_studies.sh
Last active June 28, 2016 09:39
Recipe for trigger update studies (Phase 1)
# Recipe from the RECO/DIGI part of HCAL:
# https://twiki.cern.ch/twiki/bin/view/CMS/HcalPhase1SoftwareSimulationRecipe
# has a useful script for MC generation
cmsrel CMSSW_8_1_0_pre8
cd CMSSW_8_1_0_pre8/src
cmsenv
git cms-init
git cms-merge-topic matz-e:hcal-tp-2017-v3
scram b -j 12
# Download SinglePi_Phase1.sh from the twiki above and copy it into local directory
@matz-e
matz-e / beeminder.py
Last active May 29, 2017 16:29 — forked from annawoodard/beeminder.py
Update beeminder with TeX wordcount
#!/usr/local/bin/python3
import re
import requests
import shlex
import subprocess
# login to beeminder and visit https://www.beeminder.com/api/v1/auth_token.json
auth_token = 'token'
username = 'username'
goal = 'thesis'
@matz-e
matz-e / beeminder.py
Last active June 2, 2017 23:02 — forked from annawoodard/beeminder.py
Send beeminder word count delta, not cumulative
#!/usr/local/bin/python3
import re
import requests
import shlex
import subprocess
# login to beeminder and visit https://www.beeminder.com/api/v1/auth_token.json
auth_token = 'token'
username = 'username'
goal = 'thesis'