no_integration.cc
Go to the documentation of this file.
1 /*
2  * MoMEMta: a modular implementation of the Matrix Element Method
3  * Copyright (C) 2016 Universite catholique de Louvain (UCL), Belgium
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 #include <catch.hpp>
26 
27 #include <momemta/ConfigurationReader.h>
28 #include <momemta/Logging.h>
29 #include <momemta/MoMEMta.h>
30 
31 using namespace momemta;
32 
33 TEST_CASE("No integration", "[integration_tests]") {
34  logging::set_level(logging::level::fatal);
35 
36  ConfigurationReader configuration("no_integration.lua");
37  MoMEMta weight(configuration.freeze());
38 
39  // Electron
40  Particle electron { "electron", LorentzVector(16.171895980835, -13.7919054031372, -3.42997527122497, 21.5293197631836), -11 };
41  // b-quark
42  Particle bjet1 { "bjet1", LorentzVector(-55.7908325195313, -111.59294128418, -122.144721984863, 174.66259765625), 5 };
43  // Muon
44  Particle muon { "muon", LorentzVector(-18.9018573760986, 10.0896110534668, -0.602926552295686, 21.4346446990967), +13 };
45  // Anti b-quark
46  Particle bjet2 { "bjet2", LorentzVector(71.3899612426758, 96.0094833374023, -77.2513122558594, 142.492813110352), -5 };
47  // Electronic neutrino
48  Particle nu1 { "neutrino1", LorentzVector(-57.9413, 40.7629, -54.2982, 89.2587), +12 };
49  // Muonic neutrino
50  Particle nu2 { "neutrino2", LorentzVector(57.9413, -40.7629, -40.8437, 81.7742), -14 };
51 
52  std::vector<std::pair<double, double>> weights = weight.computeWeights({electron, muon, bjet1, bjet2, nu1, nu2});
53 
54  REQUIRE(weight.getIntegrationStatus() == MoMEMta::IntegrationStatus::SUCCESS);
55 
56  REQUIRE(weights.size() == 1);
57  REQUIRE(weights[0].first == Approx(8.36916e-13));
58  REQUIRE(weights[0].second == Approx(0.));
59 }
A lua configuration file parser.
A MoMEMta instance.
Definition: MoMEMta.h:44
Definition: Graph.h:21
Describe a reco particle. Used as input of MoMEMta::computeWeights.
Definition: Particle.h:30
Integration was successful.