tt_fullyleptonic_NWA.cc
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 
19 
20 #include <momemta/ConfigurationReader.h>
21 #include <momemta/Logging.h>
22 #include <momemta/MoMEMta.h>
23 #include <momemta/Unused.h>
24 
25 #include <chrono>
26 
27 using namespace std::chrono;
28 using namespace momemta;
29 
30 int main(int argc, char** argv) {
31 
32  UNUSED(argc);
33  UNUSED(argv);
34 
35  logging::set_level(logging::level::debug);
36 
37  ConfigurationReader configuration("../examples/tt_fullyleptonic_NWA.lua");
38  MoMEMta weight(configuration.freeze());
39 
40  // Electron
41  Particle electron { "electron", LorentzVector(16.171895980835, -13.7919054031372, -3.42997527122497, 21.5293197631836), -11 };
42  // b-quark
43  Particle b1 { "bjet1", LorentzVector(-55.7908325195313, -111.59294128418, -122.144721984863, 174.66259765625), 5 };
44  // Muon
45  Particle muon { "muon", LorentzVector(-18.9018573760986, 10.0896110534668, -0.602926552295686, 21.4346446990967), +13 };
46  // Anti b-quark
47  Particle b2 { "bjet2", LorentzVector(71.3899612426758, 96.0094833374023, -77.2513122558594, 142.492813110352), -5 };
48 
49  auto start_time = system_clock::now();
50  std::vector<std::pair<double, double>> weights = weight.computeWeights({electron, muon, b1, b2});
51  auto end_time = system_clock::now();
52 
53  LOG(debug) << "Result:";
54  for (const auto& r: weights) {
55  LOG(debug) << r.first << " +- " << r.second;
56  }
57 
58  LOG(info) << "Weight computed in " << std::chrono::duration_cast<milliseconds>(end_time - start_time).count() << "ms";
59 
60 
61  return 0;
62 }
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