ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/VHbbDataFormats/macros/samples.h
Revision: 1.1
Committed: Fri Jul 29 10:34:15 2011 UTC (13 years, 9 months ago) by arizzi
Content type: text/plain
Branch: MAIN
Log Message:
macros

File Contents

# User Rev Content
1 arizzi 1.1 #include <string>
2     #include <vector>
3     #include <TFile.h>
4     #include <TH1F.h>
5     #include <iostream>
6    
7    
8     struct Sample {
9     Sample(float xs,std::string n,std::string f, int c, bool isdata,float datalumi=-1.)
10     : xsec(xs),luminosity(datalumi),name(n),filename(f),color(c),data(isdata),f(0),nevents(-1) {}
11    
12     float lumi() { if(data) return luminosity; else return numberOfEvents()/xsec; }
13     float scale(float l) { return l/lumi();}
14     TFile * file() { if(f) return f; else return f=TFile::Open(filename.c_str());}
15     float numberOfEvents()
16     {
17     if(nevents !=-1) return nevents;
18     else
19     {
20     return ((TH1F*)file()->Get("NoCut/CountNoCut"))->GetEntries();
21     }
22     }
23    
24     void dump(float l)
25     {
26     std::cout << name << "\t& " << xsec << "\t& " << lumi()/1000 << "/fb \t& " << scale(l) << std::endl;
27     }
28    
29     float nevents;
30     float xsec;
31     float luminosity;
32     std::string name;
33     std::string filename;
34     int color;
35     bool data;
36     TFile * f;
37     };
38    
39     /*
40     DoubleElectron_HBB_EDMNtupleV1_ProcV2_may_histos.root
41     DoubleElectron_HBB_EDMNtupleV1_ProcV2_prompt_histos.root
42     DoubleMu_HBB_EDMNtupleV1_ProcV2_prompt_histos.root
43     DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
44     METBTag_HBB_EDMNtupleV1_ProcV2_may_histos.root
45     MET_HBB_EDMNtupleV1_ProcV2_prompt_histos.root
46     SingleMu_HBB_EDMNtupleV1_ProcV2_may_histos.root
47     SingleMu_HBB_EDMNtupleV1_ProcV2_prompt_histos.root
48     Tbar_TuneZ2_s-channel_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
49     Tbar_TuneZ2_t-channel_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
50     Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
51     Tbar_TuneZ2_tW-channel-DS_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
52     TTJets_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
53     T_TuneZ2_tW-channel-DR_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
54     WJetsToLNu_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histos.root
55     WW_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root
56     WZ_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root
57     ZZ_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root
58    
59     */
60    
61     std::vector<Sample> samples()
62     {
63     std::vector<Sample> s;
64     // s.push_back(Sample(1000,"data","DoubleElectron_HBB_EDMNtupleV1_ProcV2_may_histos.root", 0, true ,100));
65     // s.push_back(Sample(1000,"data","SingleMu_HBB_EDMNtupleV1_ProcV2_may_histos.root",0 , true,113));
66     s.push_back(Sample(1000,"data","mm/SingleMu_HBB_EDMNtupleV1_ProcV2_prompt_histos.root",0 , true,600));
67     /* s.push_back(1000,"data","DoubleElectron_HBB_EDMNtupleV1_ProcV2_prompt_histos.root",1 , true )
68     s.push_back(1000,"data","DoubleMu_HBB_EDMNtupleV1_ProcV2_prompt_histos.root", 1, true)
69     s.push_back(1000,"data","METBTag_HBB_EDMNtupleV1_ProcV2_may_histos.root", 1, true)
70     s.push_back(1000,"data","MET_HBB_EDMNtupleV1_ProcV2_prompt_histos.root", 1, true)
71     */
72     s.push_back(Sample(165,"TTbar","TTJets_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", 2 , false ));
73    
74     int stcolor=6;
75    
76     s.push_back(Sample(1.44,"Single Top","Tbar_TuneZ2_s-channel_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", stcolor, false ));
77     s.push_back(Sample(22.65,"Single Top","Tbar_TuneZ2_t-channel_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", stcolor, false ));
78     s.push_back(Sample(7.87,"Single Top","Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", stcolor, false));
79     //s.push_back(Sample(7.87,"Single Top","Tbar_TuneZ2_tW-channel-DS_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", stcolor, false));
80     s.push_back(Sample(7.87,"Single Top","T_TuneZ2_tW-channel-DR_7TeV-powheg-tauola_HBB_EDMNtupleV1_ProcV2_histos.root", stcolor, false));
81    
82     float wxsec= 31314.;
83     float wxsec100= 31314./27770.*194.6;
84     //TOT: 18904365 b: 363441 c: 6264682 l: 12276242
85     float t=18904365;
86     float b=363441;
87     float c=6264682;
88     float l=12276242;
89    
90     s.push_back(Sample(wxsec*b/t,"Wb","WJetsToLNu_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosB.root", 3, false ));
91     s.push_back(Sample(wxsec*c/t,"Wc","WJetsToLNu_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosC.root", 7, false ));
92     s.push_back(Sample(wxsec*l/t,"Wl","WJetsToLNu_TuneZ2_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosL.root", 8, false ));
93    
94     float zxsecMG=2475;
95     s.push_back(Sample(3048*0.0441,"Zb","DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosB.root",9 ,false ));
96     s.push_back(Sample(3048*0.244,"Zc","DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosC.root",11 ,false ));
97     s.push_back(Sample(3048*0.711,"Zl","DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola_HBB_EDMNtupleV1_ProcV2_histosL.root",12 ,false ));
98    
99     int VVcolor=5;
100     s.push_back(Sample(42.9,"VV","WW_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root",VVcolor , false ));
101     s.push_back(Sample(18.3,"VV","WZ_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root",VVcolor , false ));
102     s.push_back(Sample(5.9,"VV","ZZ_TuneZ2_7TeV_pythia6_tauola_HBB_EDMNtupleV1_ProcV2_histos.root",VVcolor , false ));
103    
104     return s;
105     }