Skip to content

Instantly share code, notes, and snippets.

@mgmarino
Forked from anonymous/gist:906053
Created April 6, 2011 17:05
Show Gist options
  • Save mgmarino/906056 to your computer and use it in GitHub Desktop.
Save mgmarino/906056 to your computer and use it in GitHub Desktop.
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)
self.cm.set_baseline(baseline)
def __call__(self, t, par):
val = 0.0
try:
val = self.cm.signal_sum(t,par)
except OverflowError:
return 0.0
return val
def GetTF1(self):
return self.function
amodel = model( 0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment