ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/samplesinfo.py
Revision: 1.2
Committed: Tue May 8 10:40:23 2012 UTC (13 years ago) by peller
Content type: text/x-python
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
updated code

File Contents

# Content
1 class sample:
2
3
4 #this class is very messy yet....need to remove stuff etc....
5
6
7 def __init__(self,name,type):
8 if name not in ['Zee','Zmm','Zusdcg','Zusdcg_pt100','Zbb','Zbb_pt100','WW','WZ','ZZ','ZZb','ZZudscg','TT','ST_s','ST_t','ST_tW','STbar_s','STbar_t','STbar_tW','ZH110','ZH115','ZH120','ZH125','ZH130','ZH135']:
9 raise Exception("name doesn't exist!")
10 self.name=name
11 #type = bkg, sig or data
12 if type not in ['BKG','SIG','DATA']:
13 raise Exception("type must be 'BKG', 'SIG', or 'DATA'!")
14 self.type=type
15 self.prefix=''
16 self.path=''
17 self.lumi=0.
18 self.xsec=0.
19 self.split=1.0
20 self.weightexpression=1.0
21 self.MVA=''
22 self.SYS=['Nominal']
23 self.Training=''
24 self.weightfiles=''
25 self.tree='tree'
26 self.treecut=''
27 self.comment=''
28
29 def getname(self):
30 return self.name
31
32 def identifier(self):
33 #samples = ['DataZee','DataZmm','udscg_120_DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola','udscg_120_DYJetsToLL_PtZ-100_TuneZ2_7TeV-madgraph-tauola', 'b_120_DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola', 'b_120_DYJetsToLL_PtZ-100_TuneZ2_7TeV-madgraph-tauola','WW_TuneZ2_7TeV_pythia6_tauola', 'WZ_TuneZ2_7TeV_pythia6_tauola','ZZ_TuneZ2_7TeV_pythia6_tauola','TTJets_TuneZ2_7TeV-madgraph-tauola','T_TuneZ2_s-channel_7TeV-powheg-tauola','T_TuneZ2_t-channel_7TeV-powheg-tauola', 'T_TuneZ2_tW-channel-DR_7TeV-powheg-tauola','Tbar_TuneZ2_s-channel_7TeV-powheg-tauola','Tbar_TuneZ2_t-channel_7TeV-powheg-tauola', 'Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola','ZH_ZToLL_HToBB_M-110_7TeV-powheg-herwigpp','ZH_ZToLL_HToBB_M-115_7TeV-powheg-herwigpp','ZH_ZToLL_HToBB_M-120_7TeV-powheg-herwigpp','ZH_ZToLL_HToBB_M-125_7TeV-powheg-herwigpp','ZH_ZToLL_HToBB_M-130_7TeV-powheg-herwigpp','ZH_ZToLL_HToBB_M-135_7TeV-powheg-herwigpp']
34 #samplenames =['Zee','Zmm','Zusdcg','Zusdcg_pt100','Zbb','Zbb_pt100','WW','WZ','ZZ','TT','ST_s','ST_t','ST_tW','STbar_s','STbar_t','STbar_tW','ZH110','ZH115','ZH120','ZH125','ZH130','ZH135']
35 samplesdict={'Zmm': 'DataZmm', 'STbar_tW': 'Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola', 'WW': 'WW_TuneZ2_7TeV_pythia6_tauola', 'WZ': 'WZ_TuneZ2_7TeV_pythia6_tauola', 'Zbb': 'b_120_DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola', 'ST_tW': 'T_TuneZ2_tW-channel-DR_7TeV-powheg-tauola', 'TT': 'TTJets_TuneZ2_7TeV-madgraph-tauola', 'Zusdcg_pt100': 'udscg_120_DYJetsToLL_PtZ-100_TuneZ2_7TeV-madgraph-tauola', 'Zusdcg': 'udscg_120_DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola', 'STbar_s': 'Tbar_TuneZ2_s-channel_7TeV-powheg-tauola', 'STbar_t': 'Tbar_TuneZ2_t-channel_7TeV-powheg-tauola', 'ZH115': 'ZH_ZToLL_HToBB_M-115_7TeV-powheg-herwigpp', 'ZH130': 'ZH_ZToLL_HToBB_M-130_7TeV-powheg-herwigpp', 'ZH110': 'ZH_ZToLL_HToBB_M-110_7TeV-powheg-herwigpp', 'ZH135': 'ZH_ZToLL_HToBB_M-135_7TeV-powheg-herwigpp', 'ZZ': 'ZZ_TuneZ2_7TeV_pythia6_tauola','ZZb': 'b_ZZ_TuneZ2_7TeV_pythia6_tauola','ZZudscg': 'udscg_ZZ_TuneZ2_7TeV_pythia6_tauola', 'Zbb_pt100': 'b_120_DYJetsToLL_PtZ-100_TuneZ2_7TeV-madgraph-tauola', 'ZH125': 'ZH_ZToLL_HToBB_M-125_7TeV-powheg-herwigpp', 'ZH120': 'ZH_ZToLL_HToBB_M-120_7TeV-powheg-herwigpp', 'Zee': 'DataZee', 'ST_t': 'T_TuneZ2_t-channel_7TeV-powheg-tauola', 'ST_s': 'T_TuneZ2_s-channel_7TeV-powheg-tauola'}
36 return samplesdict[self.name]
37
38 def getpath(self):
39 return self.path+'/'+self.prefix+self.identifier()+'.root'
40
41 def addtreecut(self, cut):
42 if self.treecut == '':
43 self.treecut = cut
44 else:
45 self.treecut = '(%s) && (%s)'%(self.treecut,cut)
46
47 def addcomment(self, comment):
48 if self.comment == '':
49 self.comment = '- %s'%comment
50 else:
51 self.comment = '%s\n- %s'%(self.comment,comment)
52
53 def plotcolor(self):
54 colordict={'Zmm': 1, 'STbar_tW': 602, 'WW': 17, 'ZZb': 17,'ZZudscg': 17, 'WZ': 17, 'Zbb': 5, 'ST_tW': 602, 'TT': 596, 'Zusdcg_pt100': 401, 'Zusdcg': 401, 'STbar_s': 602, 'STbar_t': 602, 'ZH115': 2, 'ZH130': 2, 'ZH110': 2, 'ZH135': 2, 'ZZ': 17, 'Zbb_pt100': 5, 'ZH125': 2, 'ZH120': 2, 'Zee': 1, 'ST_t': 602, 'ST_s': 602}
55 return colordict[self.name]
56
57 def plotname(self):
58 plotnamedict={'Zmm': 'Data (4.7 fb^{-1})', 'STbar_tW': 'Single top', 'WW': 'WW/WZ/ZZ', 'ZZb': 'WW/WZ/ZZ','ZZudscg': 'WW/WZ/ZZ', 'WZ': 'WW/WZ/ZZ', 'Zbb': 'DY jets b', 'ST_tW': 'Single top', 'TT': 'TT-bar', 'Zusdcg_pt100':'DY jets udscg', 'Zusdcg': 'DY jets udscg', 'STbar_s': 'Single top', 'STbar_t': 'Single top', 'ZH115': 'Hbb 115', 'ZH130': 'Hbb 130', 'ZH110': 'Hbb 110', 'ZH135': 'Hbb 135', 'ZZ': 'WW/WZ/ZZ', 'Zbb_pt100': 'DY jets b', 'ZH125': 'Hbb 125', 'ZH120': 'Hbb 120', 'Zee': 'Data (4.7 fb^{-1})', 'ST_t': 'Single top', 'ST_s': 'Single top'}
59 return plotnamedict[self.name]
60
61 def addprefix(self,prefix):
62 self.prefix=prefix+self.prefix
63
64 def addpath(self,path):
65 self.path=self.path+path