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
using Cxx | |
const ROOT_PATH = "/Users/joosep/Documents/root-build/" | |
addHeaderDir(joinpath(ROOT_PATH, "include"), kind=C_System) | |
for lib in ["Core", "RIO", "Hist"] | |
Libdl.dlopen("$ROOT_PATH/lib$lib.so", Libdl.RTLD_GLOBAL) | |
end | |
cxx"""#include <TFile.h> """ | |
cxx"""#include <TH1D.h> """ |
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 cProfile, time | |
def func(): | |
s = 0 | |
for i in range(100000): | |
s += i | |
p = cProfile.Profile(time.clock) | |
p.runcall(func) | |
p.print_stats() |
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 dask | |
import sys, glob | |
import numpy as np | |
def fixPath(): | |
newpath = [] | |
for v in sys.path: | |
if "cvmfs" in v and "pandas" in v: | |
continue | |
newpath += [v] |
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
//compile as c++ -g `root-config --cflags --libs` CloneTreeCorruption.cc -o CloneTreeCorruption | |
#include "TFile.h" | |
#include "TTree.h" | |
int main(int argc, const char** argv) { | |
TFile* inf = new TFile("DoubleEG_Run2015D_v4_7_post.root"); | |
TTree* intree = (TTree*)(inf->Get("mt2")); | |
ULong64_t evt; | |
intree->SetBranchAddress("evt", &evt); | |
TFile* outf = new TFile("out.root", "RECREATE"); |
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
MEM::get_support: E(reco) = 148.35699 ==> range at 0.98 CL is [68.356995, 430.85699] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 148.35699 ==> range at 0.98 CL is [70.856995, 650.85699] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 138.43381 ==> range at 0.98 CL is [63.433807, 403.43381] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 138.43381 ==> range at 0.98 CL is [65.933807, 610.93381] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 75.970924 ==> range at 0.98 CL is [23.470924, 243.47092] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 75.970924 ==> range at 0.98 CL is [30.970924, 365.97092] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 43.183689 ==> range at 0.98 CL is [0, 155.68369] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 43.183689 ==> range at 0.98 CL is [0, 183.18369] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 176.26241 ==> range at 0.98 CL is [98.762405, 498.76241] (stepping every 2.5 GeV) | |
MEM::get_support: E(reco) = 176.26241 ==> range at |
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 ROOT | |
f = ROOT.TFile("/Users/joosep/Documents/tth/data/ntp/v16/Jan18_fixbdt/TT_TuneCUETP8M1_13TeV-powheg-pythia8.root") | |
t = f.Get("tree") | |
of = ROOT.TFile("x.root", "RECREATE") | |
of.cd() | |
t.CopyTree("is_sl==1") | |
of.Add(t) |
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 ROOT | |
from DataFormats.FWLite import Events, Handle | |
events = Events ('exerciseIPartII_histos.root') | |
handle = Handle ('std::vector<pat::Jet>') | |
label = ("selectedPatJets") | |
for event in events: | |
event.getByLabel(label, handle) |
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
using namespace reco; | |
using namespace PhysicsTools; | |
CombinedMVAJetTagComputerETH::CombinedMVAJetTagComputerETH( | |
const edm::ParameterSet ¶ms) : | |
GenericMVAJetTagComputer(params) | |
{ | |
std::cout << "CombinedMVAJetTagComputerETH::constructor" << std::endl; | |
inputComputerNames = params.getParameter< std::vector<std::string>>( |
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
using namespace reco; | |
using namespace PhysicsTools; | |
CombinedMVAJetTagComputerETH::CombinedMVAJetTagComputerETH( | |
const edm::ParameterSet ¶ms) : | |
GenericMVAJetTagComputer(params) | |
{ | |
std::cout << "CombinedMVAJetTagComputerETH::constructor" << std::endl; | |
inputComputerNames = params.getParameter< std::vector<std::string>>( |
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
int addr = 0 | |
void loop() | |
{ | |
if (digitalRead(D1) == 1) { | |
// need to divide by 4 because analog inputs range from | |
// 0 to 1023 and each byte of the EEPROM can only hold a | |
// value from 0 to 255. | |
int val = analogRead(0) / 4; |