This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
class PoissonClass: | |
def __init__(self, upper_range, tag = ''): | |
self.function = ROOT.TF1('py_poisson' + tag, self, 0, upper_range, 2) | |
self.function.SetParName(0, 'Overall Normalization') | |
self.function.SetParName(1, 'Lambda') | |
def __call__(self, x, par): | |
res = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
ROOT.gSystem.Load("libEXOROOT") | |
class model: | |
def __init__(self,RC_tau_1,RC_tau_2,CR_tau_1,CR_tau_2,CR_tau_3,baseline,lower_range,upper_range,size): | |
self.function = ROOT.TF1('function',self,lower_range,upper_range,size) | |
self.function.SetParName(0, 'number of signals') | |
self.cm = ROOT.EXOChannelManager() | |
self.cm.initialize(RC_tau_1,RC_tau_2,CR_tau_1,CR_tau_2,CR_tau_3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE, STDOUT | |
import random | |
import math | |
import ROOT | |
# Following in mm | |
lx_radius = 185.7248 | |
z_height = 180.00 | |
voxel_size = 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
class MGMPulserFile: | |
_mydict = None | |
@classmethod | |
def get_event(cls, timestamp ): | |
if not cls._mydict: cls.setup_file() | |
return cls._mydict[ timestamp ] | |
@classmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dat | |
import csv | |
class CoGeNTCutLiveTime(): | |
_livetime_dict = None | |
@classmethod | |
def get_livetime_dict(cls): | |
if cls._livetime_dict != None: return cls._livetime_dict | |
readit = csv.reader(open('livetime.txt'), delimiter='\t') | |
temp = [row for row in readit][1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
cleaned_file = 'before_fire_LG_cleaned.txt' | |
all_events_file = 'LE4.txt' | |
output_file = 'LE5MGM.txt' | |
cleaned = csv.reader(open(cleaned_file), delimiter='\t') | |
clean_events = dict( [ (row[0], {'ts' : row[0], | |
'energy' : row[1], | |
'line' : ' '.join(row[:2]) } ) | |
for row in cleaned] ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile | |
# | |
ROOTCFLAGS = $(shell root-config --cflags) | |
ROOTLIBS = $(shell root-config --libs) -lNew | |
ROOTGLIBS = $(shell root-config --glibs) | |
MYOS := $(subst -,,$(shell uname)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TSystem.h> | |
#include <TROOT.h> | |
#include <TChain.h> | |
#include <TFile.h> | |
#include <string> | |
#include <TRef.h> | |
#include <TRefArray.h> | |
#include <TTree.h> | |
#include "EXOUtilities/EXOEventData.hh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
import numpy | |
ROOT.gROOT.SetBatch() | |
ROOT.gSystem.Load("libEXOUtilities") | |
ROOT.gROOT.ProcessLine(".L $EXOLIB/htmldoc/exo_tree_alias.C") | |
chain = ROOT.TChain("tree") | |
chain.Add("/nfs/slac/g/exo/exo_data/data/MC/ATeamBackgrounds/MC_Background_0000*.root") | |
ROOT.SetEXOAlias(chain) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescale_frame(canvas, frame, scale, title): | |
""" | |
HACK | |
Takes a frame and rescales it to arbitrary coordinates. | |
This is helpful when dealing with RooPlot to get the axes | |
correct. Returns axis in case anything else needs to be done. | |
""" | |
import ROOT | |
yaxis = frame.GetYaxis() | |
yaxis.SetTickLength(0) |
OlderNewer