1 |
#include "cute/cute.h"
|
2 |
#include "cute/cute_suite.h"
|
3 |
|
4 |
#include <boost/shared_ptr.hpp>
|
5 |
|
6 |
#include "../interface/Readers/VertexReader.h"
|
7 |
#include "TChain.h"
|
8 |
|
9 |
using namespace BAT;
|
10 |
|
11 |
struct TestVertexReader {
|
12 |
boost::shared_ptr<TChain> input;
|
13 |
boost::shared_ptr<VertexReader> reader;
|
14 |
VertexPointer vertex;
|
15 |
|
16 |
TestVertexReader() :
|
17 |
input(new TChain(NTupleEventReader::EVENT_CHAIN)),
|
18 |
reader(new VertexReader(input)),
|
19 |
vertex() {
|
20 |
input->Add(InputFile::ttbar);
|
21 |
input->SetBranchStatus("*", 0);
|
22 |
reader->initialise();
|
23 |
input->GetEntry(1);
|
24 |
vertex = reader->getVertices().front();
|
25 |
}
|
26 |
|
27 |
void testVertexZPosition() {
|
28 |
ASSERT_EQUAL_DELTA(1.86712, vertex->absoluteZPosition(), 0.00001);
|
29 |
}
|
30 |
|
31 |
void testVertexRho(){
|
32 |
ASSERT_EQUAL_DELTA(0.461491, vertex->absoluteRho(), 0.000001);
|
33 |
}
|
34 |
|
35 |
void testVertexIsFake(){
|
36 |
ASSERT(vertex->isFake() == false);
|
37 |
}
|
38 |
|
39 |
void testVertexNDOF(){
|
40 |
ASSERT_EQUAL(111, vertex->ndof());
|
41 |
}
|
42 |
};
|
43 |
|
44 |
cute::suite make_suite_TestVertexReader() {
|
45 |
cute::suite s;
|
46 |
|
47 |
s.push_back(CUTE_SMEMFUN(TestVertexReader, testVertexZPosition));
|
48 |
s.push_back(CUTE_SMEMFUN(TestVertexReader, testVertexRho));
|
49 |
s.push_back(CUTE_SMEMFUN(TestVertexReader, testVertexIsFake));
|
50 |
s.push_back(CUTE_SMEMFUN(TestVertexReader, testVertexNDOF));
|
51 |
|
52 |
return s;
|
53 |
}
|