ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/samplesclass.py
Revision: 1.2
Committed: Wed May 9 09:48:23 2012 UTC (13 years ago) by peller
Content type: text/x-python
Branch: MAIN
CVS Tags: ichep8TeV, AN-12-181-7TeV_patch1, AN-12-181-7TeV
Changes since 1.1: +1 -0 lines
Log Message:
update

File Contents

# User Rev Content
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