Skip to content

Instantly share code, notes, and snippets.

@ademus4
ademus4 / gen_events.sh
Created October 20, 2021 14:53
Script to run the elspectro event generator for different tslope values
#!/bin/sh
TSLOPES="3 5 7 9"
FLAT=0
EVENTS=10000
END=1000
for TSLOPE in $TSLOPES; do
for i in $(seq 1 $END); do
clas12-elSpectro \
--ebeam 10.6 \
--trig $EVENTS \
TRUNCATED
chanser [0]
Processing Processor.C...
************************************************
* >=< : --------------------- *
* ,.--' ''-. : HIPO 4.0 I/O Library *
* ( ) ',_.' : Jefferson National Lab *
* Xx'xX : Date: 01/24/2019 *
************************************************
@ademus4
ademus4 / CLAS12Tigger.h
Created October 23, 2019 13:31
See line 125 for short function to return number of sector hits
#ifndef HS_CLAS12TRIGGER_h
#define HS_CLAS12TRIGGER_h
#include <TTree.h>
#include "THSParticle.h"
#include "EventInfo.h"
#include "RunInfo.h"
#include <cmath>
#include <vector>
@ademus4
ademus4 / Dockerfile
Created March 14, 2019 02:35
An example ubuntu latex docker file
FROM ubuntu:18.04
RUN apt-get update \
&& apt-get -y install texlive \
&& apt-get -y install texlive-lang-english
CMD bash
@ademus4
ademus4 / example.tex
Last active March 4, 2019 19:26
Example of mini-pages with figures in latex
\begin{frame}
\frametitle{CLAS12 at Jefferson Lab}
\begin{itemize}
\item 11GeV polarised electrons scattering on LH2/LD target \\
\item Luminosites up to $10^{35} cm^{-1}s^{-1}$ \\
\end{itemize}
\begin{figure}
\begin{minipage}{.5\textwidth}
\includegraphics[width=\linewidth]{./media/cebaf12gev}
\caption{Diagram of CEBAF and the 4 experimental halls}
@ademus4
ademus4 / luigi.cfg
Created December 19, 2018 13:16
An example luigid config file (needs to be in the working directory)
[scheduler]
record_task_history = True
state_path = /usr/local/var/luigi-state.pickle
[task_history]
db_connection = sqlite:////.../luigi-task-hist.db
[core]
workers=4
log_level=INFO
@ademus4
ademus4 / tmux.md
Created January 24, 2017 12:08 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ademus4
ademus4 / db_model.py
Created October 30, 2016 21:03
Using SQLalchemy model relationships
from sqlalchemy import Column, ForeignKey, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.orm import backref
Base = declarative_base()
class Hotel(Base):