Skip to content

Instantly share code, notes, and snippets.


Kyle Cranmer cranmer

View GitHub Profile
cranmer /
Last active Dec 31, 2021
RooMomentMorph example for RooFit
#for C++ look here:
import ROOT
import numpy as np
def testMomentMorph():
#Going to make a few statistical models we want to interpolate
#initialize workspace with some common background part
w = ROOT.RooWorkspace('w')
x = w.var('x')
cranmer / RooMomentMorphExample.C
Last active Feb 5, 2020
RooMomentMorph example for RooFit
View RooMomentMorphExample.C
#for python, look here:
void testMM(){
// #Make statistical model
w = new RooWorkspace("w");
x = w->var("x");
mu = w->var("mu");
frame = x->frame();
RooArgList pdfs;
View example.tex
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
cranmer / gist:24f6b1f4074b65dd34f0
Created Jun 15, 2015
Embed custom.css into IPython for slides customization
View gist:24f6b1f4074b65dd34f0
from IPython.display import HTML
myf = open('custom.css')
htmlstring = "<style>%s </style>" %(
except IOError:
print "no file"
cranmer / gist:96c4930b87b98387a11a
Created Oct 17, 2014
Betterize with Arial font instead
View gist:96c4930b87b98387a11a
import ROOT
import numpy as np
def makeBSpline(w,interpParam, observable, pdfList, paramPoints):
# source code for these classes can be found here:
#if you don't have this class in your ROOT library, but have it locally
ROOT.gROOT.ProcessLine(".L RooBSpline.cxx+")
paramVec = ROOT.TVectorD(len(paramPoints))