Skip to content

Instantly share code, notes, and snippets.

View yhaddad's full-sized avatar
🎯
Focusing

Yacine Haddad yhaddad

🎯
Focusing
View GitHub Profile
@yhaddad
yhaddad / HERWIG7.in
Last active January 30, 2024 08:47
Herwig7 setup for EW Higgs+2jets
##################################################
# Yacine Note: Used to hadrinise VBF LHE files from NLO Powheg
# Example generator based on LHC parameters
# For use with POWHEG events
# usage: Herwig read LHE.in
##################################################
# Technical parameters for this run
##################################################
cd /Herwig/Generators
set EventGenerator:NumberOfEvents NEVENTS
@yhaddad
yhaddad / VBFH_QGTAG.cc
Created April 2, 2020 19:19
QGtagger
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/FastJets.hh"
#include "Rivet/Projections/IdentifiedFinalState.hh"
#include "Rivet/Projections/VetoedFinalState.hh"
#include "qg-taggers.hh"
#include "csvwrite.hh"
#include <iostream>
@yhaddad
yhaddad / plot.py
Created March 18, 2020 10:00
xkcd-plot
from matplotlib import pyplot as plt
import numpy as np
plt.xkcd()
fig = plt.figure(figsize=(6,5))
ax = fig.add_subplot(1, 1, 1)
plt.xticks([])
plt.yticks([])
#!/usr/bin/env python
import subprocess
import sys, os, errno, platform, shutil
import urllib2, ssl
import tarfile
from optparse import OptionParser, OptionGroup
from optparse import SUPPRESS_HELP as NOHELP
from time import sleep
if platform.system() == 'Darwin':
@yhaddad
yhaddad / LHC-Matchbox.in.bash
Last active February 25, 2020 11:05
Herwig7
##################################################
## Collider typeddede
##################################################
read snippets/Matchbox.in
read snippets/PPCollider.in
cd /Herwig/EventHandlers
set EventHandler:LuminosityFunction:Energy 13000*GeV
##################################################
import ROOT
import sys, os
import numpy as np
import math
from importlib import import_module
import itertools
from copy import deepcopy
from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor
from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object
from PhysicsTools.NanoAODTools.postprocessing.framework.eventloop import Module
@yhaddad
yhaddad / EWProducer.py
Created August 5, 2019 21:30
ZZ/WZ EWK corrections (a NanoADO producer)
import ROOT
import sys, os
import numpy as np
from importlib import import_module
from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor
from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object
from PhysicsTools.NanoAODTools.postprocessing.framework.eventloop import Module
ROOT.PyConfig.IgnoreCommandLineOptions = True
@yhaddad
yhaddad / 2016.yaml
Created July 17, 2019 15:50
MonoZ cross sections
ADDMonoZ_ZtoLL_MD-1_d-2_TuneCUETP8M1_13TeV-pythia8:
br: 1.0
kr: 1.0
xsec: 0.06738
ADDMonoZ_ZtoLL_MD-1_d-3_TuneCUETP8M1_13TeV-pythia8:
br: 1.0
kr: 1.0
xsec: 0.06738
ADDMonoZ_ZtoLL_MD-1_d-4_TuneCUETP8M1_13TeV-pythia8:
br: 1.0
@yhaddad
yhaddad / HiggsTemplateCrossSections.cc
Last active July 1, 2019 14:01
HiggsTemplateCrossSections.cc For non decaying Higgs
#ifndef TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONS_CC
#define TRUTHRIVETTOOLS_HIGGSTEMPLATECROSSSECTIONS_CC
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Particle.hh"
#include "Rivet/Projections/FastJets.hh"
// Definition of the StatusCode and Category enums
#include "HiggsTemplateCrossSections.h"
@yhaddad
yhaddad / median.cc
Created August 30, 2018 09:11
Median in c++
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <fstream>
#include "square.h"
using namespace std;