Skip to content

Instantly share code, notes, and snippets.

View admorris's full-sized avatar
⚛️

Adam Morris admorris

⚛️
View GitHub Profile
#include <cstdlib>
#include <complex>
#include <iostream>
#include <cstring>
using namespace std;
void PrintPhysicsParameterXML(string name, double value, double min, double max, string unit)
{
cout << " <PhysicsParameter>" << endl;
cout << " <Name>" << name << "</Name>" << endl;
cout << " <Value>" << value << "</Value>" << endl;
@admorris
admorris / bashrc
Created June 28, 2016 09:39
Quick remote access to the LHCb machines
# Executes the first argument as a command on a ui node and keeps an interactive bash session once it closes
function lhcbui()
{
ssh ui.lhcb -t "bash -ic \"$1;bash\""
}
alias presenter='lhcbui /group/online/scripts/presenter'
@admorris
admorris / 13104013-nocuts.py
Last active May 24, 2023 08:44
Quickly run Gauss multi-threaded
# file /nightlies/jenkins/workspace/nightly-slot-checkout/tmp/checkout/DBASE/Gen/DecFiles/v28r1/options/13104013.py generated: Wed, 12 Aug 2015 15:32:33
#
# Event Type: 13104013
#
# ASCII decay Descriptor: [B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> K+ K-)]cc
#
from Gaudi.Configuration import *
#importOptions( "$DECFILESROOT/options/B2PhiPhi.py" )
from Configurables import Generation
Generation().EventType = 13104013
#!/bin/bash
pyp2rpm nbgrader -s
sed -i '/^.*python3dist(jupyter).*$/d' rpmbuild/SPECS/python-nbgrader.spec
rpmbuild -bs rpmbuild/SPECS/python-nbgrader.spec
rpmbuild --rebuild rpmbuild/SRPMS/python-nbgrader-*.src.rpm
@admorris
admorris / update_conversions_table.py
Created October 28, 2021 10:54
Update conversions.csv in scikit-hep/particle with LHCb names
#!/usr/bin/env python
import requests
import csv
def download_table(url="https://gitlab.cern.ch/lhcb-conddb/DDDB/-/raw/master/param/ParticleTable.txt"):
r = requests.get(url)
r.raise_for_status()
lines = r.text.split("\n")
#!/usr/bin/env python
import requests
import csv
import datetime as dt
def download_table(url="https://gitlab.cern.ch/lhcb-conddb/DDDB/-/raw/master/param/ParticleTable.txt"):
r = requests.get(url)
r.raise_for_status()