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