Git Product home page Git Product logo

ppmc's Introduction

ppmc

Toy code to calculate production cross sections in pp hard scattering collisions to leading order at tree level using Monte Carlo integration over the ELHQ parton distribution functions.

to build, test and run

make
./ppmc_test
./ppmc

to calculate a cross section

Let's do our own calculation, in a new directory called src/my_calc. Create a file in src/my_calc/ with a main function. Include any other files you need as normal, and place them in src/my_calc/. Using mc::Integrate2D and the parton distribution functions in elhq:: a variety of tree-level hard scattering diagrams can be computed. See src/ppmc.cpp for an example; calculating the Drell-Yan pp -> μ+μ- cross section for multiple low-energy cutoffs.

Add your file(s) (lets call it src/my_calc/my_calculation.cpp, which #includes src/my_calc/support.hpp, which is implemented in src/my_calc/support.cpp) as a target to the Makefile like so:

MYCALC_DIR         = ./my_calc
MYCALC_FILES       = $(wildcard $(MYCALC_DIR)/*.cpp)
MYCALC_OBJ_FILES   = $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/my_calc/%.o,$(MYCALC_FILES))

my_calculation: $(OBJ_FILES_NOPP) $(MYCALC_FILES)
  $(CC) $(LDFLAGS) -o $@ $^ 

And build and run:

make my_calculation
./my_calculation

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.