This file contains hidden or 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
from Ganga.GPI import * | |
import sys | |
import inspect | |
import os | |
local_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
if len(sys.argv) not in (2,3): | |
sys.exit("Script requires the ID of a DaVinci (Turbo) or Brunel job to use as inputdata and optionally name of a file containing LFNs to process.") |
This file contains hidden or 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
def lockstep(a, b): | |
i = j = 0 | |
while i<len(a) and j<len(b): | |
if a[i] == b[j]: | |
#yield a[i], b[j] | |
yield i,j | |
i+=1;j+=1 | |
elif a[i] < b[j]: | |
i+=1 |
This file contains hidden or 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 numpy as np | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.cross_calidation import train_test_split | |
from root_numpy import root2array | |
signal = root2array("MySignalFile.root", | |
"MyDecayTree", | |
["names", "of", "branches", "to", "use", | |
"for", "classifying"]) |
This file contains hidden or 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
# split our development sample into a test and train set | |
X_train,X_test, y_train,y_test = cross_validation.train_test_split(X_dev, | |
y_dev, | |
test_size=0.33, | |
random_state=7853354) | |
clf = GradientBoostingClassifier(n_estimators=3000, | |
max_depth=1, | |
subsample=0.5, | |
max_features=0.5, |
This file contains hidden or 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 random | |
import pandas as pd | |
import numpy as np | |
import pandas.core.common as com | |
from pandas.core.index import Index | |
from pandas.tools import plotting | |
from pandas.tools.plotting import scatter_matrix |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 math | |
import ROOT as R | |
from ROOT import RooFit as RF | |
from ROOT import RooStats as RS | |
def argset__iter__(self): | |
start = self.fwdIterator() | |
for i in xrange(len(self)): | |
yield start.next() |
This file contains hidden or 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
Nexp = 10000 # how many experiments/searches were performed? | |
power = 0.5 # power of each search or p(discovery | new physics) | |
Pval = 1 - 0.997300204 # p-value | |
NPrate = 0.001 # New physics base rate | |
print "true positives: %i false positives: %i"%((Nexp * NPrate * power), | |
((Nexp-Nexp*NPrate) * Pval)) | |
# true positives: 5 false positives: 26 |
This file contains hidden or 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/sh | |
whoami | |
cd /tmp/ | |
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.2.0-Linux-x86_64.sh | |
bash Anaconda-2.2.0-Linux-x86_64.sh -b -p /opt/anaconda | |
yum install -y curl-devel expat-devel gettext-devel \ | |
openssl-devel zlib-devel | |
yum install -y asciidoc xmlto docbook2x | |
yum install -y gcc | |
wget https://github.com/git/git/archive/v2.4.1.tar.gz |
This file contains hidden or 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
; AD : This Kerberos configuration is for CERN's Active Directory realm | |
; The line above this is magic and is used by cern-config-keytab. Do | |
; not remove. | |
; Installed with puppet from a series of | |
; template fragments. | |
; /etc/krb5.conf | |
[libdefaults] |