Skip to content

errai-/jetscripts

Repository files navigation

IMPORTANT:

Project has been split into three parts and moved to CERN gitlab:

https://gitlab.cern.ch/hsiikone/gen_handle // A handle for gen-level simulations
https://gitlab.cern.ch/hsiikone/gen_analysis // A collection of analysis tools for the gen-level simulations
https://gitlab.cern.ch/hsiikone/jet_compos // Jet composition plots

Author Hannu Siikonen (github: errai-)
README updated 3.4.2016

#1) INTRODUCTION
#2) FOLDER DESCRIPTIONS
#3) INSTALLATION INSTRUCTIONS


#1) INTRODUCTION
This is a collection of data analysis and simulation tools used with the CMS
project. Developed under Helsinki Institute of Physics, which contributes to
the CMS project.

My master's thesis was done using this software:


A direct link to the github repository:
    https://github.com/errai-/jetscripts

Note: while building the sources, the number 'N' of parallel processes in 'make -jN'
should be chosen wisely. E.g. for an 8-core processor N=6 can be a good choice.

#2) FOLDER DESCRIPTIONS

data_analysis:
    Tools for analyzing CMS jet data. Aim is to conveniently and quickly make plots
    of different aspects.
    Last updates in autumn 2014

lhc_simulation:
    Simulation tools for generating particle data with pythia6, pythia8 and Herwig++. 
    A common jet sorting algorithm to turn the particle data into jet data.

simulation_analysis:
    A collection of scripts for turning simulated jet data into various plots.

useful_structures:
    A collection of useful small scripts and old code versions, which may come in
    handy in certain circumstances.


#3) INSTALLATION

Installation instructions for various softwares that are needed for the simulations.
Some of the installations need to be done in the correct order, so that dependencies work correctly.
The steps are given in a chronological order, but some steps can be skipped.

 #0] Misc operations

 -These can be done before/after the installations; these are generally important for obtaining working code.

 In .bashrc (or similar), add:
     export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:"installdir"/lib:"pythia6Dir":"jetscriptsDir"/lhc_simulations/lib

 Before continuing, any pre-existing installations should be eliminated completely or made compatible with the
 new installation structures.

 #] HepMC2[.06.09]

 Preliminary:
     export CFLAGS='-march=native -O2'
     export CXXFLAGS='-march=native -O2 -std=c++11'

 Run:
     ./configure --with-momentum=GEV --with-length=MM --prefix="installdir"

 Run:
     make -jN

 Run:
     make install

 #] ProMC

 Preliminary:
     export CFLAGS_OPT='-march=native -O2'
     export CXXFLAGS_OPT='-march=native -O2 -std=c++11'

 Run:
     ./build.sh

 Run:
     ./install.sh "installdir" "installdir"

 Insert into .bashrc:
     source "installdir"/promc/setup.sh

 Remarks:
     -Dependent on HepMC
     -PYTHONPATH might be messed up in the install.sh. This can be corrected within setup.sh.
     -There's an annoying echo within setup.sh, this can/should be edited out.

 #] Fastjet3[.2.0]

 Preliminary:
     export CFLAGS_OPT='-march=native -O2'
     export CXXFLAGS_OPT='-march=native -O2'

 Run:
     ./configure --prefix="installdir"

 Run:
     make -jN

 Run:
     make install

 #] fjcontrib-1[.022]

 Run:
     ./configure --prefix="installdir" --fastjet-config="installdir"/bin/fastjet-config

 Run:
     make -jN

 Run:
     make install

 Remarks:
     -Fastjet compiles OK with c++11, but fjcontrib does not work with this

 #] LHAPDF 6[.1.6]

 Preliminary:
     export CFLAGS_OPT='-march=native -O2'
     export CXXFLAGS_OPT='-march=native -O2'

 Note: on lxplus this requires definition of the Boost location.
 Run:
     ./configure --prefix="installdir"

 Run:
     make -jN

 Run:
     make install

 Remarks:
     -May require redhat-rpm-config to be installed.

 #] Pythia6[.4.28]

     Fetch http://home.fnal.gov/~rhatcher/build_pythia6.sh.
     The files pyevwt.f and pyrand.f might need to be replaced (this needs to be done in the script).
     Only thus event weighting and such will be performed as desired.

 #] ROOT 6[.06.04]

 Preliminary:
     export CLINGCXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
     export CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
     export CPPFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
     export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"


 Dropped out: -D_GLIBCXX_USE_CXX11_ABI=0
 Run:
     ./configure --prefix=/home/hannu/Cern/install --with-clang --enable-cxx14 --with-pythia6-libdir=/home/hannu/Cern/install/lib --disable-pythia8 --cflags='-march=native' --cxxflags='-D_GLIBCXX_USE_CXX11_ABI=0 -march=native -O2'

 Run:
     make -jN

 In .bashrc, add:
     source "rootDir"/bin/thisroot.sh

 Remarks:
     -Note that pythia8 is not linked with root, since this will lead to inconveniences.
     -Apparently root is developed using clang; it is not currently compatible with newest gcc versions.
     -The ABI-tag causes issues even in clang, we need to set this ABI-macro to zero everywhere.
     -Having or not having pythia8 explicitly linked for root should not be an issue. TPythia8 can be a convenient and
      fast way to access pythia8 features, but it also removes some of the agility of the plain pythia8.

 #] Pythia8[.2.19]

 Run:
     ./configure --prefix="installdir" --enable-64bit --enable-shared --with-fastjet3="installdir" --with-hepmc2="installdir" --with-lhapdf6="installdir" --with-promc="installdir"/promc --with-boost=/usr --with-powheg="installdir"/powheg --cxx-common="-D_GLIBCXX_USE_CXX11_ABI=0 -march=native -O2 -fPIC"

Run:
     make -jN

Run:
     make install

In .bashrc, write:
     export PYTHIA8=/usr/local
     export PYTHIA8DATA=/share/Pythia8/xmldoc

 #] ThePEG 2[.0.2] (dependency: fastjet, optional dependency: LHAPDF)

Run:
 ./configure --with-lhapdf=$HOME/Cern/install --with-hepmc=$HOME/Cern/install --with-fastjet=$HOME/Cern/install --prefix=$HOME/Cern/install
 -Basic configuration. Check for errors.

Run:
 make -jN

Run:
 sudo make install
 -Copies the installation under /usr/local

Remarks:
 A majority of the functionality of Herwig++ is based on ThePEG (Toolkit for High Energy Physics Event Generation).
 ThePEG offers generic structures for particles, events etc. and its documentation is essential in daily life.
 Herwig++ is just some sugar on the top to make the simulator software complete.

 #] HERWIG7[.0.2] (dependencies: fastjet, thepeg)

Run:
 ./configure --prefix=$HOME/Cern/install --with-thepeg=$HOME/Cern/install --with-thepeg=$HOME/Cern/install --with-fastjet=$HOME/Cern/install --with-madgraph=$HOME/Cern/sources/MG5_aMC_v2_4_2 --with-gosam=$HOME/Cern/install
 -Basic configuration, check for errors.

Run:
 make -jN
 -Basic installation.

Run:
 sudo make install
 -Copies the installation under /usr/local

Remarks:
 Herwig is used with commands like 'Herwig++ run'.