ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/samplesclass.py
Revision: 1.1
Committed: Tue May 8 10:38:29 2012 UTC (13 years ago) by peller
Content type: text/x-python
Branch: MAIN
Log Message:
updated code

File Contents

# Content
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 self.xsec=0.
15 self.split=1.0
16 self.weightexpression=1.0
17 self.SYS=['Nominal']
18 self.tree='tree'
19 self.treecut=''
20 self.comment=''
21
22 def getpath(self):
23 return self.path+'/'+self.prefix+self.identifier+'.root'
24
25 def addtreecut(self, cut):
26 if self.treecut == '':
27 self.treecut = cut
28 else:
29 self.treecut = '(%s) && (%s)'%(self.treecut,cut)
30
31 def addcomment(self, comment):
32 if self.comment == '':
33 self.comment = '- %s'%comment
34 else:
35 self.comment = '%s\n- %s'%(self.comment,comment)
36
37 def addprefix(self,prefix):
38 self.prefix=prefix+self.prefix
39
40 def addpath(self,path):
41 self.path=self.path+path