Code Monkey home page Code Monkey logo

rupt / paper-hunting-vampires Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 256.23 MB

Supporting data and code for: Hunting for vampires and other unlikely forms of parity violation at the Large Hadron Collider (https://arxiv.org/abs/2205.09876)

Home Page: https://doi.org/10.1007/JHEP08%282022%29231

License: MIT License

Makefile 0.05% Fortran 42.80% Pascal 0.12% Python 53.07% Forth 0.01% C++ 2.00% Shell 0.29% Perl 0.08% HTML 0.03% CSS 0.01% JavaScript 0.03% Assembly 0.45% NASL 0.72% SourcePawn 0.01% C 0.02% PHP 0.01% POV-Ray SDL 0.08% Pawn 0.01% Batchfile 0.01% Gnuplot 0.22%
hep machine-learning symmetries physics

paper-hunting-vampires's Introduction

Supporting data and code for:
Hunting for vampires and other unlikely forms of parity violation at the Large Hadron Collider

Download datasets

You do not need to download the complete datasets to use this repository. But you may wish to, for example, to train and test your own models.

This repository includes:

  • all data to reproduce all plots in the paper (serialized results, not raw input data),
  • serialized versions of our trained BDT and NN models,
  • some small example datasets. Larger datasets are shared on Zenodo. Thanks for hosting them, Zenodo!

Each run of MadGraph produces an lhe file which includes partonic truth and various metadata. For each model (meaning each lambdaPV or rotated coupling matrix), we are one example lhe file in the

We share complete train, validation, and test datasets for

The calo-image datasets are very large. We share two examples:

Use this repository

Use a Linux environment with a recent version of python 3.

For compatibility, it may be helpful to start from a clean conda environment.
The bundled version of MadGraph does not work with python 3.10.
We also require gfortran for MadGraph and texlive for plotting.

conda create -n hunting-vampires -c conda-forge python==3.9.12 gfortran==12.1.0

Then to set up

conda activate hunting-vampires

Some LaTeX context is also required for matplotlib, but I have failed to install it through conda (texlive-core doesn't work). From a CERN-linked environment, for example, you can link texlive with export PATH=/cvmfs/sft.cern.ch/lcg/external/texlive/2020/bin/x86_64-linux:$PATH.

Generate paper plots

All plots used in the paper (and some others) are produced from serialized data which are included in this repository.
To jump into the plotting environment and reproduce those plots, execute:

source example_plots.sh

Simulate a PV-mSME lhe file

Choosing $\lambda_\textrm{PV} = 0.5$ as an example.
Again, this hops into an environment.
It then:

  • generates the mSME model for MadGraph,
  • modifies the MadGraph code to evaluate matrix elements in the lab frame(*),
  • runs MadGraph to simulate 3-partonic-jet events under our kinematic selections (4-jet is very slow), and
  • moves the lhe to the local directory as pv_msme_0p5.lhe.gz.

(*) MadGraph is modified by the --lab arguments to lib/madcontrol.py. The modification is implemented in liv/use_lab_frame.py, and implements a Lorentz boost in each liv/process/${PROCESS}/SubProcesses/*/auto_dsig?.f file.

We also leave lots of mess behind in the liv/ directory; you can use git diff to see what's there.

Execute:

source example_pv_msme_lhe.sh 0.5

Extract truth-jet lhe data to h5

For later use, we convert parts of the lhe file (XML) to an efficient format.

This script first converts it to padded four-momenta in an h5 file pv_msme_0p5_truth.h5.
It then applies kinematic cuts to produce pv_msme_0p5_truth_cut.h5.
It then converts that to the image representation in pv_msme_0p5_truth_cut_images.h5.

Execute:

source example_truth_jet.sh pv_msme_0p5.lhe.gz

(Note that the 0.5 above has become 0p5 here.)

An example lhe (from the test set) with $\lambda_\textrm{PV} = 1$ and up to four partonic jets is included as example_results/pv_msme_3j_4j_1_seed_80.lhe.gz.
Extract it by executing:

source example_truth_jet.sh example_results/pv_msme_3j_4j_1_seed_80.lhe.gz

Test a BDT model

Lead a serialized BDT model and test it against the $\lambda_\textrm{PV} = 1$ sample that we (could have) generated above.

source example_bdt.sh

This prints out a json-formatted report of its results, in which:

  • ntest is the number of testing data,
  • log_r_test is the model-versus-symmetry $\log$-likelihood ratio, which equals $nQ$, and
  • quality is $Q$ with its standard mean and standard deviation estiamtes.

Many other models are saved in results/models/.
Modify the paths given in example_bdt.sh as arguments to example_bdt.py to test them, too!

Test an NN model

Lead a serialized NN model and test it against the $\lambda_\textrm{PV} = 1$ sample that we (could have) generated above.

source example_nn.sh

Just as for the BDT, this prints out a json-formatted report of its results, in which:

  • ntest is the number of testing data,
  • log_r_test is the model-versus-symmetry $\log$-likelihood ratio, which equals $nQ$, and
  • quality is $Q$ with its standard mean and standard deviation estimates.

Many other models are saved in results/models/.
Modify the paths given in example_nn.sh as arguments to example_nn.py to test them, too!

We don't attempt to set up a GPU; you can ignore the warning WARNING:absl:No GPU/TPU found, falling back to CPU....

Rotated PV-mSME extras

We include plots of cross-sections and Q split by hour in a notebook.

The split-Q plot uses data shared on Zenodo.
To run it yourself, download truth-jet-rot* from https://zenodo.org/record/6822267 and unzip them at a common path.
In the notebook, update the line DATAPATH = "..." in cell 8 to point to these unzipped data.

To launch it:

make env_nn/bin/activate
source env_nn/bin/activate
jupyter notebook
# in the notebook web interface, open: example_rotated_pv_msme.ipynb

Run Delphes reconstruction

Follow instructions in delphes/README.md for environment setup and execution. (cd delphes)

paper-hunting-vampires's People

Contributors

daniel-noel avatar rupt avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.