DAS  3.0
Das Analysis System
JMEmatching.cc File Reference
#include "Core/JEC/interface/JMEmatching.h"
#include <boost/test/included/unit_test.hpp>
#include <iostream>
#include <array>
#include <TTree.h>
#include <TFile.h>
#include "colours.h"
+ Include dependency graph for JMEmatching.cc:

Macros

#define BOOST_TEST_MODULE   Matching
 

Functions

 BOOST_AUTO_TEST_CASE (matching)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Matching

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( matching  )
19 {
20  array<GenJet,6> genjets;
21  genjets[0].p4.SetCoordinates(2540.7522, -0.939323, 2.9671194, 42.679748);
22  genjets[1].p4.SetCoordinates(2524.7915, 0.3277488, -0.195445, 58.079277);
23  genjets[2].p4.SetCoordinates(34.406520, -2.007476, 1.9084951, 6.9956078);
24  genjets[3].p4.SetCoordinates(33.516635, -0.122238, 0.1614812, 7.0759511);
25  genjets[4].p4.SetCoordinates(376.69122, 0.6268847, 0.1621258, 54.715171); // miss
26  genjets[5].p4.SetCoordinates(286.42022, 0.1454636, -2.711239, 30.607936); // miss
27 
28  array<RecJet,14> recjets;
29  recjets[ 0].p4.SetCoordinates(2483.1442, 0.3214379, -0.196805, 106.61298);
30  recjets[ 1].p4.SetCoordinates(2134.2094, -0.942423, 2.9649009, 89.293060);
31  recjets[ 2].p4.SetCoordinates(40.095314, -2.047485, 1.9051857, 8.5427942);
32  recjets[ 3].p4.SetCoordinates(39.125808, -0.116546, 0.1461072, 8.0769491);
33  recjets[ 4].p4.SetCoordinates(26.883150, -3.200822, 0.1855384, 4.9055452); // fake
34  recjets[ 5].p4.SetCoordinates(17.303262, -4.666824, 0.1659940, 4.1057658); // fake
35  recjets[ 6].p4.SetCoordinates(16.604623, 0.3660668, -0.827474, 4.8734064); // fake
36  recjets[ 7].p4.SetCoordinates(16.549018, -2.687304, 2.4509530, 3.4501276); // fake
37  recjets[ 8].p4.SetCoordinates(12.394617, -1.593085, 1.7367856, 2.5770857); // fake
38  recjets[ 9].p4.SetCoordinates(12.211031, 1.5677306, 2.3947563, 3.7380209); // fake
39  recjets[10].p4.SetCoordinates(11.802206, 3.9794914, 3.1383521, 3.0563554); // fake
40  recjets[11].p4.SetCoordinates(11.423704, -4.258290, 2.9604301, 2.9349415); // fake
41  recjets[12].p4.SetCoordinates(11.079508, -1.123926, -1.405094, 2.6803200); // fake
42  recjets[13].p4.SetCoordinates(10.026986, -1.896397, -1.734840, 2.4190814); // fake
43 
44  auto genjets_copy = genjets;
45  auto recjets_copy = recjets;
46 
47  JMEmatching<decltype(recjets),decltype(genjets)>::maxDR = 0.2;
48  JMEmatching matching(recjets, genjets);
49 
50  cout << bold << "matched:" << def;
51  for (auto& [rec_it,gen_it]: matching.match_its)
52  cout << '\n' << rec_it->p4 << '\t' << gen_it->p4;
53  cout << bold << "\nfake jets:" << def;
54  for (auto& rec_it: matching.fake_its)
55  cout << '\n' << rec_it->p4;
56  cout << bold << "\nmiss jets:" << def;
57  for (auto& gen_it: matching.miss_its)
58  cout << '\n' << gen_it->p4;
59  cout << endl;
60 
61  BOOST_TEST( matching.match_its.size() == 4 );
62  BOOST_TEST( matching.fake_its.size() == 10 );
63  BOOST_TEST( matching.miss_its.size() == 2 );
64 
65  BOOST_TEST( genjets == genjets_copy );
66  BOOST_TEST( recjets == recjets_copy );
67 }
Step::def
static const char * def
Definition: Step.h:36
BOOST_TEST
BOOST_TEST(gendijet.Rapidity()==1.3573785791881385)
Ntupliser_cfg.genjets
genjets
Definition: Ntupliser_cfg.py:272
DAS::JMEmatching
Definition: JMEmatching.h:28
Ntupliser_cfg.recjets
recjets
Definition: Ntupliser_cfg.py:273
Step::bold
static const char * bold
Definition: Step.h:35