ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/Tools/ScaleFactors.cc
Revision: 1.1
Committed: Mon May 28 15:18:22 2012 UTC (12 years, 11 months ago) by fgolf
Content type: text/plain
Branch: MAIN
Log Message:
scale factors for 2012 SS analysis

File Contents

# User Rev Content
1 fgolf 1.1 #include "ScaleFactors.h"
2     #include "CORE/CMS2.h"
3     #include "bTagEff_BTV.h"
4    
5     float dileptonTagAndProbeScaleFactor(int idx)
6     {
7     float sf1 = tagAndProbeScaleFactor(cms2.hyp_lt_id().at(idx), cms2.hyp_lt_p4().at(idx).pt(), cms2.hyp_lt_p4().at(idx).eta());
8     float sf2 = tagAndProbeScaleFactor(cms2.hyp_ll_id().at(idx), cms2.hyp_ll_p4().at(idx).pt(), cms2.hyp_ll_p4().at(idx).eta());
9    
10     return (sf1 * sf2);
11     }
12    
13     float tagAndProbeScaleFactor(int id, float pt, float eta)
14     {
15     unsigned int aid = abs(id);
16     float feta = fabs(eta);
17    
18     if (aid == 11) {
19     if (feta < .1479) {
20     if (pt < 40. && pt > 20.)
21     return 0.9989;
22     else if (pt > 40.)
23     return 0.9997;
24     else
25     return 0.;
26     }
27     else if (feta < 2.4) {
28     if (pt < 40. && pt > 20.)
29     return 1.0335;
30     else if (pt > 40.)
31     return 1.0114;
32     else
33     return 0.;
34     }
35     else return 0.;
36     }
37     else if (aid == 13) {
38     if (feta < .1479) {
39     if (pt < 40. && pt > 20.)
40     return 1.0116;
41     else if (pt > 40.)
42     return 1.0163;
43     else
44     return 0.;
45     }
46     else if (feta < 2.4) {
47     if (pt < 40. && pt > 20.)
48     return 0.9965;
49     else if (pt > 40.)
50     return 1.0114;
51     else
52     return 0.;
53     }
54     else return 0.;
55     }
56    
57     return 0.;
58     }
59