phaseSpaceVolume.cc
1 /*
2  * MoMEMta: a modular implementation of the Matrix Element Method
3  * Copyright (C) 2017 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 #include <momemta/Logging.h>
20 
21 #include <cmath>
22 
23 #include "phaseSpaceGenerationTests.h"
24 
25 uint64_t factorial(uint64_t n) {
26  uint64_t ret = 1;
27  for (uint64_t i = 2; i <= n; i++)
28  ret *= i;
29  return ret;
30 }
31 
32 double massless_phase_space(double sqrt_s, unsigned int n) {
33  return pow(sqrt_s, 2 * (n - 3)) / (pow(2, 4 * (n - 1)) * pow(M_PI, 2 * n - 3) * pow(n - 2, 2) * (n - 1) * pow(factorial(n - 2), 2));
34 }
35 
36 int main(int argc, char** argv) {
37 
38  logging::set_level(logging::level::debug);
39 
41 
42  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockA.lua", { "p1", "p2", "p3" }, { 0, 0, 0 }, massless_phase_space(1000, 3) }, 'A');
43  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockA_secondaryBlockCD.lua", { "p1", "p2", "p3", "p4" }, { 0, 0, 0, 0 }, massless_phase_space(1000, 4) }, 'A', 'C');
44  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockB.lua", { "p1", "p2" }, { 0, 0 }, massless_phase_space(1000, 3) }, 'B');
45  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockC.lua", { "p2", "p3" }, { 0, 0 }, massless_phase_space(1000, 3) }, 'C');
46  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockB_secondaryBlockA.lua", { "p2", "p3", "p4" }, { 0, 0, 0 }, massless_phase_space(1000, 5) }, 'B', 'A');
47  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockB_secondaryBlockB.lua", { "p1", "p2", "p3" }, { 0, 0, 0 }, massless_phase_space(1000, 4) }, 'B', 'B');
48  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockB_secondaryBlockE.lua", { "p1", "p2", "p3" }, { 0, 0, 0 }, massless_phase_space(1000, 4) }, 'B', 'E');
49  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockD.lua", { "p1", "p2", "p3", "p4" }, { 0, 0, 0, 0 }, massless_phase_space(1000, 6) }, 'D');
50  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockE.lua", { "p1", "p3" }, { 0, 0 }, massless_phase_space(1000, 4) }, 'E');
51  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockF.lua", { "p1", "p2" }, { 0, 0 }, massless_phase_space(1000, 4) }, 'F');
52  manager.registerTest({ SOURCE_PATH "/tests/phaseSpaceGeneration/phaseSpaceVolume/blockG.lua", { "p1", "p2", "p3", "p4" }, { 0, 0, 0, 0 }, massless_phase_space(1000, 4) }, 'G');
53 
54  manager.parseArgs(argc, argv);
55 
56  return 0;
57 }