Giter Site home page Giter Site logo

go-simple-examples's Introduction

Simple Go examples

This repository contains few examples in go, mostly connected to high energy physics (HEP). Mostly:

  • CLs: computation of a stat-only CLs exclusion wikipedia
  • plotting: very short example of plots produced in go
  • lhe2root: example of how to convert a LHE file into a ROOT file
  • reading-root-ttree: event loop based on a ROOT::TTree, the main HEP software.

CLs exclusion

LHE to ROOT - based on go-hep

LHE format is convention to store data from particle collision into an ASCI file. A LHE parser is available in go-hep and is used to create a TTree for a 10000 proton-proton collisions leading to a top-antitop quark pair production.

Reading a TTree - based on go-hep

In this example, the initial TTree - stored in ttbar_0j_parton.root - was produced from a LHE file [arXiv:0609.017] describing 10000 proton-proton collisions leading to a top-antitop quark pair production, as predicted by MadGraph tool [arXiv:1405.0301], ran at the leading order. These collisions are described at the parton level only and each event is described by

  • partonic intial state: parton flavour and momentum
  • partonic final state: 4-vectors for each particle in the decay t->Wb->lvb

The program reading-root-ttree/main.go loads some variables of the TTree, compute some angular variables probing the spin correlation between the top and the antitop quarks [e.g. arXiv:1612.07004]. These involves Lorentz transformation and simple geometrical calculations, and this progam relies then on the lorentzvector package. The commands

cd reading-root-ttree
go run ./main.go

will produce a ROOT file containing the new TTree with 10 variables:

  • dphi_ll: lab-frame angle between the two leptons
  • k, r, n: the three 3-vectors of the spin basis
  • cos(Theta[axis, lepton]): 6 cosines for 3 axis and 2 leptons

go-simple-examples's People

Contributors

rmadar avatar sbinet avatar

Watchers

 avatar  avatar

Forkers

sbinet-staging

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.