Page MenuHomeHEPForge

No OneTemporary

diff --git a/FixedOrderGen/t/CMakeLists.txt b/FixedOrderGen/t/CMakeLists.txt
index 8844ef9..e0a1c33 100644
--- a/FixedOrderGen/t/CMakeLists.txt
+++ b/FixedOrderGen/t/CMakeLists.txt
@@ -1,162 +1,162 @@
set(tst_dir "${CMAKE_CURRENT_SOURCE_DIR}")
foreach(tst W_reconstruct_enu W_2j_classify W_nj_classify)
add_executable(test_${tst} ${tst_dir}/${tst}.cc)
target_link_libraries(test_${tst} hejfog_lib)
add_test(NAME ${tst} COMMAND test_${tst} WORKING_DIRECTORY ${tst_dir})
endforeach()
# this only tests if the runcard actually works, not if the result is correct
add_test(
NAME main_2j
COMMAND HEJFOG ${tst_dir}/config_2j.yml
)
add_test(
NAME main_h2j
COMMAND HEJFOG ${tst_dir}/config_h2j.yml
)
add_test(
NAME main_h2j_decay
COMMAND HEJFOG ${tst_dir}/config_h2j_decay.yml
)
add_test(
NAME peakpt
COMMAND HEJFOG ${tst_dir}/config_2j_peak.yml
)
# check that uno emission doesn't change FKL xs
add_executable(FKL_uno FKL_uno.cc)
target_link_libraries(FKL_uno hejfog_lib)
add_test(
NAME FKL_uno
# calculated with HEJ revision 9570e3809613272ac4b8bf3236279ba23cf64d20
COMMAND FKL_uno ${tst_dir}/config_h3j_uno.yml 0.0243548 0.000119862
)
# xs tests
add_executable(xs_gen xs_gen.cc)
target_link_libraries(xs_gen hejfog_lib)
## Higgs
add_test(
NAME xs_hqQ
# calculated with Sherpa see #132
COMMAND xs_gen ${tst_dir}/config_hqQ.yml 1.612e-02 1.26303e-04
)
add_test(
NAME xs_h2j
# calculated with HEJ revision 9570e3809613272ac4b8bf3236279ba23cf64d20
COMMAND xs_gen ${tst_dir}/config_h2j.yml 2.04928 0.00956022
)
add_test(
NAME xs_h3j
# calculated with HEJ revision bd4388fe55cbc3f5a7b6139096456c551294aa31
COMMAND xs_gen ${tst_dir}/config_h3j.yml 1.07807 0.0132409
)
add_test(
NAME xs_h5j
# calculated with HEJ revision dbde2ffbb3b383ae6709b2424d8f0f9d5658270b
COMMAND xs_gen ${tst_dir}/config_h5j.yml 0.0112504 0.000199633
)
add_test(
NAME xs_h3j_uno
# calculated with HEJ revision 9570e3809613272ac4b8bf3236279ba23cf64d20
COMMAND xs_gen ${tst_dir}/config_h3j_uno.yml 0.00347538 3.85875e-05
)
add_test(
NAME xs_h2j_decay
# calculated with HEJ revision 9570e3809613272ac4b8bf3236279ba23cf64d20
COMMAND xs_gen ${tst_dir}/config_h2j_decay.yml 0.00466994 2.20995e-05
)
## pure jets
add_test(
NAME xs_qQ
# calculated with Sherpa see #132
COMMAND xs_gen ${tst_dir}/config_qQ.yml 7.354e+05 1.905e+03
)
add_test(
NAME xs_2j
# calculated with "combined" HEJ svn r3480
COMMAND xs_gen ${tst_dir}/config_2j.yml 86.42031848e06 590570
)
add_test(
NAME xs_3j_uno
# calculated with HEJ revision 9401196fba75b5d16bc33f2a309175fecaca00f1
COMMAND xs_gen ${tst_dir}/config_3j_uno.yml 900 14.3131
)
add_test(
NAME xs_3j_qqx
# calculated with HEJ revision 9401196fba75b5d16bc33f2a309175fecaca00f1
COMMAND xs_gen ${tst_dir}/config_3j_qqx.yml 62040 1005
)
add_test(
NAME xs_4j_qqx
# calculated with HEJ revision 9401196fba75b5d16bc33f2a309175fecaca00f1
COMMAND xs_gen ${tst_dir}/config_4j_qqx.yml 28936 550
)
add_test(
NAME xs_4j
# calculated with HEJ revision 13207b5f67a5f40a2141aa7ee515b022bd4efb65
COMMAND xs_gen ${tst_dir}/config_4j.yml 915072 15402.4
)
## W
add_test(
NAME xs_WqQ
# calculated with Sherpa see #132
COMMAND xs_gen ${tst_dir}/config_WpqQ.yml 3.086e+00 4.511e-02
)
add_test(
NAME xs_W2j
- # calculated with HEJ revision 987bb30a7985a24a7961f98cfbbc74d3a7992970
- COMMAND xs_gen ${tst_dir}/config_Wm2j.yml 231.404 3.43798
+ # calculated with HEJ revision be065dc9a21e5965ce57583f6c0a3d953664b82b
+ COMMAND xs_gen ${tst_dir}/config_Wm2j.yml 4.628078e+02 6.875951e+00
)
add_test(
NAME xs_W3j_uno
- # calculated with HEJ revision 996f728a56ed67b980fccbe79948fe56914aaccd+1
- COMMAND xs_gen ${tst_dir}/config_Wp3j_uno.yml 0.295275 0.0056667
+ # calculated with HEJ revision be065dc9a21e5965ce57583f6c0a3d953664b82b
+ COMMAND xs_gen ${tst_dir}/config_Wp3j_uno.yml 5.905502e-01 1.133341e-02
)
add_test(
NAME xs_W3j_eqqx
- # calculated with HEJ revision 987bb30a7985a24a7961f98cfbbc74d3a7992970
- COMMAND xs_gen ${tst_dir}/config_Wp3j_qqx.yml 8.45323 0.103449
+ # calculated with HEJ revision be065dc9a21e5965ce57583f6c0a3d953664b82b
+ COMMAND xs_gen ${tst_dir}/config_Wp3j_qqx.yml 1.690646e+01 2.068979e-01
)
add_test(
NAME xs_W4j_qqx
- # calculated with HEJ revision 987bb30a7985a24a7961f98cfbbc74d3a7992970
- COMMAND xs_gen ${tst_dir}/config_Wp4j_qqx.yml 0.0851908 0.00300447
+ # calculated with HEJ revision be065dc9a21e5965ce57583f6c0a3d953664b82b
+ COMMAND xs_gen ${tst_dir}/config_Wp4j_qqx.yml 9.274718e-02 4.875742e-03
)
# Test that sum of partons == proton
add_executable(PSP_channel PSP_channel.cc)
target_link_libraries(PSP_channel hejfog_lib)
# pure jets
add_test(
NAME channel_2j
COMMAND PSP_channel ${tst_dir}/config_2j.yml
)
add_test(
NAME channel_3j_qqx
COMMAND PSP_channel ${tst_dir}/config_3j_qqx.yml
)
add_test(
NAME channel_3j_uno
COMMAND PSP_channel ${tst_dir}/config_3j_uno.yml
)
add_test(
NAME channel_4j_qqx
COMMAND PSP_channel ${tst_dir}/config_4j_qqx.yml
)
# W+jets
# pure jets
add_test(
NAME channel_W2j
COMMAND PSP_channel ${tst_dir}/config_Wm2j.yml
)
add_test(
NAME channel_W3j_uno
COMMAND PSP_channel ${tst_dir}/config_Wp3j_uno.yml
)
add_test(
NAME channel_W3j_eqqx
COMMAND PSP_channel ${tst_dir}/config_Wp3j_qqx.yml
)
add_test(
NAME channel_W4j_qqx
COMMAND PSP_channel ${tst_dir}/config_Wp4j_qqx.yml
)
diff --git a/FixedOrderGen/t/xs_gen.cc b/FixedOrderGen/t/xs_gen.cc
index b771942..7566d25 100644
--- a/FixedOrderGen/t/xs_gen.cc
+++ b/FixedOrderGen/t/xs_gen.cc
@@ -1,106 +1,108 @@
/**
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2020
* \copyright GPLv2 or later
*/
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <memory>
#include "HEJ/Event.hh"
#include "HEJ/Mixmax.hh"
#include "HEJ/PDG_codes.hh"
#include "HEJ/ScaleFunction.hh"
#include "HEJ/utility.hh"
#include "config.hh"
#include "EventGenerator.hh"
#include "Status.hh"
//! throw error if condition not fulfilled
#define ASSERT(x) if(!(x)) { \
throw std::logic_error("Assertion '" #x "' failed."); \
}
namespace {
constexpr double invGeV2_to_pb = 389379292.;
}
int main(int argn, char const *argv[]){
using namespace HEJFOG;
if(argn != 4){
std::cerr << "Usage: " << argv[0] << " config.yml xs xs_err";
return EXIT_FAILURE;
}
const double xs_ref = std::stod(argv[2]);
const double err_ref = std::stod(argv[3]);
const auto config = load_config(argv[1]);
std::shared_ptr<HEJ::RNG> ran{std::make_shared<HEJ::Mixmax>()};
HEJFOG::EventGenerator generator{
config.process,
config.beam,
HEJ::ScaleGenerator{
config.scales.base,
config.scales.factors,
config.scales.max_ratio
},
config.jets,
config.pdf_id,
config.subleading_fraction,
config.subleading_channels,
config.particle_decays,
config.Higgs_coupling,
config.ew_parameters,
ran
};
double xs = 0., xs_err = 0.;
for (std::size_t trials = 0; trials < config.events; ++trials){
auto ev = generator.gen_event();
if(generator.status() != Status::good) continue;
ASSERT(ev);
if(config.process.boson){
const auto boson = std::find_if(
begin(ev->outgoing()), end(ev->outgoing()),
[&](HEJ::Particle const & p){ return p.type == *config.process.boson; }
);
ASSERT(boson != end(ev->outgoing()));
if(!config.process.boson_decay.empty()){
ASSERT(ev->decays().size() == 1);
const auto decay = ev->decays().begin();
ASSERT(ev->outgoing().size() > decay->first);
ASSERT(decay->first == static_cast<std::size_t>(
std::distance(ev->outgoing().begin(), boson)));
ASSERT(decay->second.size() == 2);
auto const & decay_part = decay->second;
ASSERT(decay_part[0].type == config.process.boson_decay[0]);
ASSERT(decay_part[1].type == config.process.boson_decay[1]);
ASSERT(HEJ::nearby_ep(decay_part[0].p + decay_part[1].p, boson->p, 1e-6));
}
}
xs += ev->central().weight;
xs_err += ev->central().weight*ev->central().weight;
}
xs_err = std::sqrt(xs_err);
xs *= invGeV2_to_pb/config.events;
xs_err *= invGeV2_to_pb/config.events;
- std::cout << xs_ref << " +- " << err_ref << " (" << err_ref/xs_ref*100. << "%)"
- << " ~ " << xs << " +- " << xs_err
- << " (" << xs_err/xs*100. << "%)" << std::endl;
+ std::cout <<std::scientific
+ << xs_ref << " +- " << err_ref
+ <<std::fixed<< " (" << err_ref/xs_ref*100. << "%)"
+ <<std::scientific<< " ~ " << xs << " +- " << xs_err
+ <<std::fixed<< " (" << xs_err/xs*100. << "%)" << std::endl;
std::cout << "=> "
<< std::abs(xs - xs_ref)/sqrt(xs_err*xs_err+err_ref*err_ref)
<< " sigma" << std::endl;
ASSERT(std::abs(xs - xs_ref) < 2.*sqrt(xs_err*xs_err+err_ref*err_ref));
ASSERT(std::abs(err_ref - xs_err) < 0.1*xs_err);
return EXIT_SUCCESS;
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 5:22 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805374
Default Alt Text
(9 KB)

Event Timeline