integrand.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("Integrand evaluation", "[integration_tests]") {
34  logging::set_level(logging::level::fatal);
35 
36  ConfigurationReader configuration("integrand.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 
48  weight.setEvent({electron, muon, bjet1, bjet2});
49  std::vector<double> psPoint { 0.25, 0.15, 0.1, 0.4 };
50  std::vector<double> weights = weight.evaluateIntegrand(psPoint);
51 
52  REQUIRE(weights.size() == 1);
53  REQUIRE(weights[0] * 1e21 == Approx(6.0072644042));
54 }
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