Skip to content

Instantly share code, notes, and snippets.

@jdbrice
jdbrice / pythia.C
Created February 1, 2017 03:39
Code to skim Pythia events with muons and use some Toy MC to test pair background mehtods
#define pythia_cxx
#include "pythia.h"
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
void pythia::Loop()
{
// In a ROOT session, you can do:
// root> .L pythia.C
@jdbrice
jdbrice / VpdTriggerBank.C
Last active March 6, 2017 20:27
Accessing VPD Trigger Data from MuDst
#include "StEvent/StTriggerData2016.h"
// "event" is a class object storing the data into an nTuple
void StVpdPicoDstMaker::analyzeEvent(){
StMuEvent *muEvent = muDst->event();
const StTriggerData2016 *td = (StTriggerData2016*)muEvent->triggerData();
@jdbrice
jdbrice / SubHistoMaker.h
Created April 25, 2018 03:10
A sub class of HistoMaker
#ifndef SIGNAL_MAKER_H
#define SIGNAL_MAKER_H
#include "HistoAnalyzer.h"
#include "vendor/loguru.h"
class SignalMaker : public HistoAnalyzer {
protected:
@jdbrice
jdbrice / export_params.C
Created May 29, 2018 04:23
Run13 TOF reso export
void print_tray( int tray ){
cout << endl << tray << " 0" << endl;
}
void export_params(){
@jdbrice
jdbrice / bias.C
Created May 29, 2018 04:30
NColl Bias
TChain *c = NULL;
double meanNcollAt( float mlow, float mhigh ){
TH1D * hncoll = new TH1D( "hncoll", "", 1000, 0, 1000 );
TString cut = TString::Format("mult > %f && mult <= %f", mlow, mhigh );
c->Draw( "ncoll>>hncoll", cut );
@jdbrice
jdbrice / scale.C
Created May 29, 2018 04:33
Shuai's ccbar scaling code
void scale(){
TFile *f = new TFile( "cc2ee_dimuonAcc_2014BR.root" );
TH1 * hnParent = (TH1*)f->Get( "nParent" );
TH2 * hMcAcc = (TH2*)f->Get( "hMCAcc1MvsPtcc2ee" );
double Ncc = hnParent->GetBinContent(1);
@jdbrice
jdbrice / blank.condor.config.sh
Created June 13, 2018 17:02
Submit jobs to condor easily
GetEnv = True
@jdbrice
jdbrice / sample_submit.xml
Created August 28, 2018 14:18
Sample RCF condor submit XML file
<job name="MuDst2FemtoDst_Run15_pp200" simulateSubmission ="false" maxFilesPerProcess="10" filesPerHour="50" >
<stdout URL="file:/star/data03/pwg/jdb/scratch/log/log_$JOBID.log" />
<stderr URL="file:/star/data03/pwg/jdb/scratch/log/err_$JOBID.err" />
<output fromScratch="*FemtoDst.root" toURL="file:/star/data03/pwg/jdb/scratch/" />
<input URL="catalog:star.bnl.gov?trgsetupname=AuAu200_production_2011,filetype=daq_reco_MuDst,filename~st_upc,storage=local" nFiles="50000" />
<command>
@jdbrice
jdbrice / play_pause.applescript
Created September 5, 2018 01:58
play pause apple script for Better TouchTools
if application "Spotify" is running then
tell application "Spotify"
if player state is playing then return "pause"
end tell
end if
if application "iTunes" is running then
tell application "iTunes"
if player state is playing then return "pause"
end tell
@jdbrice
jdbrice / spotify_now_playing.applescript
Created September 5, 2018 01:59
apple script for spotify now playing in better touch tools
if application "Spotify" is running then
tell application "Spotify"
if player state is playing then
return (get artist of current track) & " – " & (get name of current track)
else
return ""
end if
end tell
end if