1 |
peller |
1.1 |
class sample:
|
2 |
|
|
|
3 |
|
|
def __init__(self,name,type):
|
4 |
|
|
self.name=name
|
5 |
|
|
#type = bkg, sig or data
|
6 |
|
|
if type not in ['BKG','SIG','DATA']:
|
7 |
|
|
raise Exception("type must be 'BKG', 'SIG', or 'DATA'!")
|
8 |
|
|
self.type=type
|
9 |
|
|
self.prefix=''
|
10 |
|
|
self.identifier=''
|
11 |
|
|
self.group=''
|
12 |
|
|
self.path=''
|
13 |
|
|
self.lumi=0.
|
14 |
peller |
1.2 |
self.sf=1.0
|
15 |
peller |
1.1 |
self.xsec=0.
|
16 |
|
|
self.split=1.0
|
17 |
|
|
self.weightexpression=1.0
|
18 |
|
|
self.SYS=['Nominal']
|
19 |
|
|
self.tree='tree'
|
20 |
|
|
self.treecut=''
|
21 |
|
|
self.comment=''
|
22 |
|
|
|
23 |
|
|
def getpath(self):
|
24 |
|
|
return self.path+'/'+self.prefix+self.identifier+'.root'
|
25 |
|
|
|
26 |
|
|
def addtreecut(self, cut):
|
27 |
|
|
if self.treecut == '':
|
28 |
|
|
self.treecut = cut
|
29 |
|
|
else:
|
30 |
|
|
self.treecut = '(%s) && (%s)'%(self.treecut,cut)
|
31 |
|
|
|
32 |
|
|
def addcomment(self, comment):
|
33 |
|
|
if self.comment == '':
|
34 |
|
|
self.comment = '- %s'%comment
|
35 |
|
|
else:
|
36 |
|
|
self.comment = '%s\n- %s'%(self.comment,comment)
|
37 |
|
|
|
38 |
|
|
def addprefix(self,prefix):
|
39 |
|
|
self.prefix=prefix+self.prefix
|
40 |
|
|
|
41 |
|
|
def addpath(self,path):
|
42 |
|
|
self.path=self.path+path
|