This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define pythia_cxx | |
#include "pythia.h" | |
#include <TH2.h> | |
#include <TStyle.h> | |
#include <TCanvas.h> | |
void pythia::Loop() | |
{ | |
// In a ROOT session, you can do: | |
// root> .L pythia.C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void calcCholesky( int nP, double * fCov, double* fCovSqrt ){ | |
double *C = fCovSqrt; | |
double *V = fCov; | |
// calculate sqrt(V) as lower diagonal matrix | |
for( int i = 0; i < nP; ++i ) { | |
for( int j = 0; j < nP; ++j ) { | |
C[i*nP+j] = 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# for command line args | |
import sys | |
# for regex | |
import re | |
#for JSON parsing | |
import json | |
# for dir searching | |
import glob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> | |
<script type="text/x-mathjax-config"> | |
MathJax.Hub.Config({ | |
tex2jax: { | |
inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], | |
processEscapes: true, | |
processEnvironments: true | |
}, | |
// Center justify equations in code and markdown cells. Elsewhere |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SEE : notebook/notebook/static/notebook/js/outputarea.js | |
// around line 632 | |
var append_markdown = function(markdown, md, element) { | |
var type = MIME_MARKDOWN; | |
var toinsert = this.create_output_subarea(md, "output_markdown rendered_html", type); | |
var text_and_math = mathjaxutils.remove_math(markdown); | |
var text = text_and_math[0]; | |
var math = text_and_math[1]; | |
marked(text, function (err, html) { | |
html = mathjaxutils.replace_math(html, math); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker exec -ti $1 /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess as sp | |
import os | |
from multiprocessing import Pool, Queue | |
def nbd( npp, k ) : | |
cmd_template = """root4star -b -q 'macros/doNbdFitMaker.C("all_mb_fit_center_{npp}_{k}.root", 1000000, "all_mb.root", "hNCollNPart/hNCollNPart_nominal.root", "B_hRefMult_center", 50, {npp}, {k}, 0.12, 0.05, 1.0, 0 )'""" | |
print cmd_template.format( npp=npp, k=k ) | |
os.system( cmd_template.format( npp=npp, k=k ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <unordered_map> | |
#include <vector> | |
map<int, bool> runNumbers; | |
vector<int> runNumbersInFile( string fn ) { | |
TFile * f = new TFile( fn.c_str(), "READ" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "TFile.h" | |
#include "TH1F.h" | |
#include "TTreeReader.h" | |
#include "TTreeReaderValue.h" | |
#include <unordered_map> | |
#include <fstream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["codemirror/keymap/sublime", "notebook/js/cell", "base/js/namespace"], | |
function(sublime_keymap, cell, IPython) { | |
require("notebook/js/cell").Cell | |
setTimeout(function(){ // uncomment line to fake race-condition | |
require("notebook/js/cell").Cell.options_default.cm_config.keyMap = 'sublime'; | |
var cells = IPython.notebook.get_cells(); | |
for(var c=0; c<cells.length ; c++){ | |
console.log( "Setting Sublime" ) | |
cells[c].code_mirror.setOption('keyMap', 'sublime'); | |
} |