Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F7878950
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
View Options
diff --git a/FixedOrderGen/t/CMakeLists.txt b/FixedOrderGen/t/CMakeLists.txt
index 325e1a5..8307199 100644
--- a/FixedOrderGen/t/CMakeLists.txt
+++ b/FixedOrderGen/t/CMakeLists.txt
@@ -1,70 +1,72 @@
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_h_2j.yml
+ COMMAND HEJFOG ${tst_dir}/config_h2j.yml
)
add_test(
NAME main_h2j_decay
- COMMAND HEJFOG ${tst_dir}/config_h_2j_decay.yml
+ 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_h_3j_uno.yml 0.0243548 0.000119862
+ 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_h2j
# calculated with HEJ revision 9570e3809613272ac4b8bf3236279ba23cf64d20
- COMMAND xs_gen ${tst_dir}/config_h_2j.yml 2.04928 0.00956022
+ 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_h_3j.yml 1.07807 0.0132409
+ 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_h_5j.yml 0.0112504 0.000199633
+ 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_h_3j_uno.yml 0.00347538 3.85875e-05
+ 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_h_2j_decay.yml 0.00466994 2.20995e-05
+ COMMAND xs_gen ${tst_dir}/config_h2j_decay.yml 0.00466994 2.20995e-05
)
+## pure jets
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_4j
# calculated with HEJ revision 13207b5f67a5f40a2141aa7ee515b022bd4efb65
COMMAND xs_gen ${tst_dir}/config_4j.yml 915072 15402.4
)
diff --git a/FixedOrderGen/t/config_h_2j.yml b/FixedOrderGen/t/config_h2j.yml
similarity index 100%
rename from FixedOrderGen/t/config_h_2j.yml
rename to FixedOrderGen/t/config_h2j.yml
diff --git a/FixedOrderGen/t/config_h_2j_decay.yml b/FixedOrderGen/t/config_h2j_decay.yml
similarity index 100%
rename from FixedOrderGen/t/config_h_2j_decay.yml
rename to FixedOrderGen/t/config_h2j_decay.yml
diff --git a/FixedOrderGen/t/config_h_3j.yml b/FixedOrderGen/t/config_h3j.yml
similarity index 100%
rename from FixedOrderGen/t/config_h_3j.yml
rename to FixedOrderGen/t/config_h3j.yml
diff --git a/FixedOrderGen/t/config_h_3j_uno.yml b/FixedOrderGen/t/config_h3j_uno.yml
similarity index 100%
rename from FixedOrderGen/t/config_h_3j_uno.yml
rename to FixedOrderGen/t/config_h3j_uno.yml
diff --git a/FixedOrderGen/t/config_h_5j.yml b/FixedOrderGen/t/config_h5j.yml
similarity index 100%
rename from FixedOrderGen/t/config_h_5j.yml
rename to FixedOrderGen/t/config_h5j.yml
diff --git a/FixedOrderGen/t/xs_gen.cc b/FixedOrderGen/t/xs_gen.cc
index 0e20c77..9a04a0a 100644
--- a/FixedOrderGen/t/xs_gen.cc
+++ b/FixedOrderGen/t/xs_gen.cc
@@ -1,107 +1,107 @@
/**
* \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() != 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 & gamma = decay->second;
- ASSERT(gamma[0].type == HEJ::pid::photon);
- ASSERT(gamma[1].type == HEJ::pid::photon);
- ASSERT(HEJ::nearby_ep(gamma[0].p + gamma[1].p, boson->p, 1e-6));
+ 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::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);
ASSERT(xs_err < 0.02*xs);
return EXIT_SUCCESS;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Nov 19, 7:03 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805746
Default Alt Text
(7 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment