Skip to content

nkarast/Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snippets

This holds various code snippets of things that I keep forgetting how I've done them last time...

Bash

  • runSubmitJHU.sh : Submit script for JHU Generator

C++

  • mergeLHEFile.cpp : Merge LHE files

  • boostProgressBar.cpp : Progress bar for loop using BOOST lib


Python

  • LHESplitter.py : Split LHE Files

  • MG5_OfficialProduction_JOfile.py : Job options example from CP MG5 Sample official production (2014)

  • duplicates.py : Get the duplicates (indices) objects within a list

  • pyximportcpp.py : "Overwrite" Cythons pyximport to load C++ instead of C code

  • progressBar.py : Progress bar using the progressbar module

  • mymodule.py : This is my library with various functions

  • beamCal.py : Calculate machine/beam conditions depending on beam parameters


R

  • boxPlot.R : Create a Box-Plot

  • complete.R : Given a directory of csv files returns a dataframe with the numeric id of the file and the number of complete cases in it

  • conditionalHistograms.R : Generate histograms of the columns of the dataset conditional upon another variable

  • corr.R : Given a directory, it calls complete.R and in its df calculate the correlations of variables

  • evaluateClassificationMode.R : Evaluate the metrics for a classification model

  • featureEngineering.R : Feature engineering

  • pairPlots.R : Make pairs plot.

  • plotResiduals.R : Plot residuals label from prediction.

  • prepareDataset.R : Prepare dataset with column selection

  • removeOutliers.R : Remove outliers by applying selection requirements to dataset columns

  • selectSubsetOfColumns.R : Select a subset of columns

  • visualizeClusters.R : Visualize the result of a clustering algorithm (k-means)

  • visualizeDataset.R : Visualize the columns of a dataset.


ROOT-PyROOT

  • atlaslabel.py : Functions to use for ATLAS label on plots

  • CalcZMFVars.C : Calculate Zero Momentum Frame variables (Cabbibo-Maksymowicz)

  • fakeData.py : Copy a file and scale one of its branches by a constant factor

  • generateToys.C : Generate pseudo-experiments around a value (RooWorkspace)

  • makeCorrelationAnalytically.C : Calculate correlations of variables

  • mergeTwoMakeClasses.C : Template used to merge info from two "MakeClass"-ed files

  • mylibrary.h : Usefull functions and settings (helperfunc)

  • mymodule.py : Usefull functions and settings

  • plot_toys.C : Plot the fit variable for Asimov, Data, and toys

  • plotToyRatio.py : Calculate and plot the ratio of toys/Asimov to check their fluctuations

  • pythonGraph.py : placeholder

  • removeBranchesFromNtuple.C : Remove branches from an ntuple.

  • rootnotes.py : Helper module for displaying ROOT canvases in iPython notebook

  • overlayOutputHistograms.py Get distributions from two files and make (ratio) plots.