1 |
dhidas |
1.1 |
/*
|
2 |
|
|
* TestCrossSectionProvider.h
|
3 |
|
|
*
|
4 |
|
|
* Created on: 16 Aug 2010
|
5 |
|
|
* Author: kreczko
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#include "cute/cute.h"
|
9 |
|
|
#include "cute/cute_suite.h"
|
10 |
|
|
#include "../interface/CrossSections.h"
|
11 |
|
|
#include "../interface/DataTypes.h"
|
12 |
|
|
|
13 |
|
|
using namespace BAT;
|
14 |
|
|
|
15 |
|
|
struct TestCrossSectionProvider {
|
16 |
|
|
private:
|
17 |
|
|
float lumi;
|
18 |
|
|
CrossSectionProvider xSectionProvider;
|
19 |
|
|
|
20 |
|
|
public:
|
21 |
|
|
TestCrossSectionProvider() :
|
22 |
|
|
lumi(20), xSectionProvider(lumi) {
|
23 |
|
|
xSectionProvider.useSkimEfficiency(false);
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
~TestCrossSectionProvider() {
|
27 |
|
|
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
void testGetExpectedTTbarEvents() {
|
31 |
|
|
ASSERT_EQUAL(157.5*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::ttbar));
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
void testGetExpectedWjetsEvents() {
|
35 |
|
|
ASSERT_EQUAL(31314.*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::Wjets));
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
void testGetExpectedZjetsEvents() {
|
39 |
|
|
ASSERT_EQUAL(3048.*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::Zjets));
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
void testGetExpectedQCD_EMEnriched_Pt20to30Events() {
|
43 |
|
|
ASSERT_EQUAL(0.2355e9 * 0.0073*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_EMEnriched_Pt20to30));
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
void testGetExpectedQCD_EMEnriched_Pt30to80Events() {
|
47 |
|
|
ASSERT_EQUAL(0.0593e9 * 0.059*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_EMEnriched_Pt30to80));
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
void testGetExpectedQCD_EMEnriched_Pt80to170Events() {
|
51 |
|
|
ASSERT_EQUAL(0.906e6 * 0.148*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_EMEnriched_Pt80to170));
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
void testGetExpectedQCD_BCtoE_Pt20to30Events() {
|
55 |
|
|
ASSERT_EQUAL(0.2355e9 * 0.00046*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_BCtoE_Pt20to30));
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
void testGetExpectedQCD_BCtoE_Pt30to80Events() {
|
59 |
|
|
ASSERT_EQUAL(0.0593e9 * 0.00234*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_BCtoE_Pt30to80));
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
void testGetExpectedQCD_BCtoE_Pt80to170Events() {
|
63 |
|
|
ASSERT_EQUAL(0.906e6 * 0.0104*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::QCD_BCtoE_Pt80to170));
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
void testGetExpectedVQQEvents() {
|
67 |
|
|
ASSERT_EQUAL(36.*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::VQQ));
|
68 |
|
|
}
|
69 |
|
|
|
70 |
|
|
void testGetExpectedsingleTop_And_WEvents() {
|
71 |
|
|
ASSERT_EQUAL(10.6*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::singleTop_And_W));
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
void testGetExpectedsingleTopTChannelEvents() {
|
75 |
|
|
ASSERT_EQUAL_DELTA(21.53*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::singleTopTChannel), 0.1);
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
void testGetExpectedsingleTopSChannelEvents() {
|
79 |
|
|
ASSERT_EQUAL(1.40*lumi, xSectionProvider.getExpectedNumberOfEvents(DataType::singleTopSChannel));
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
void testGetExpectedDataEvents() {
|
83 |
|
|
ASSERT_EQUAL(0, xSectionProvider.getExpectedNumberOfEvents(DataType::DATA));
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
void testGetWeightData() {
|
87 |
|
|
ASSERT_EQUAL(1, xSectionProvider.getWeight(DataType::DATA));
|
88 |
|
|
}
|
89 |
|
|
|
90 |
|
|
void testGetWeightTtbar() {
|
91 |
|
|
ASSERT_EQUAL_DELTA(157.5 * lumi/1306182, xSectionProvider.getWeight(DataType::ttbar), 0.00000001);
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
};
|
95 |
|
|
|
96 |
|
|
extern cute::suite make_suite_TestCrossSectionProvider() {
|
97 |
|
|
cute::suite s;
|
98 |
|
|
|
99 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedTTbarEvents));
|
100 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedWjetsEvents));
|
101 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedZjetsEvents));
|
102 |
|
|
|
103 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_EMEnriched_Pt20to30Events));
|
104 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_EMEnriched_Pt30to80Events));
|
105 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_EMEnriched_Pt80to170Events));
|
106 |
|
|
|
107 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_BCtoE_Pt20to30Events));
|
108 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_BCtoE_Pt30to80Events));
|
109 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedQCD_BCtoE_Pt80to170Events));
|
110 |
|
|
|
111 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedVQQEvents));
|
112 |
|
|
|
113 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedsingleTop_And_WEvents));
|
114 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedsingleTopTChannelEvents));
|
115 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedsingleTopSChannelEvents));
|
116 |
|
|
|
117 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetExpectedDataEvents));
|
118 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetWeightData));
|
119 |
|
|
s.push_back(CUTE_SMEMFUN(TestCrossSectionProvider, testGetWeightTtbar));
|
120 |
|
|
|
121 |
|
|
return s;
|
122 |
|
|
}
|
123 |
|
|
|