diff --git a/FixedOrderGen/t/W_nj_classify.cc b/FixedOrderGen/t/W_nj_classify.cc index ba65db3..90f830a 100644 --- a/FixedOrderGen/t/W_nj_classify.cc +++ b/FixedOrderGen/t/W_nj_classify.cc @@ -1,132 +1,132 @@ #ifdef NDEBUG #undef NDEBUG #endif #include #include "PhaseSpacePoint.hh" #include "Process.hh" #include "JetParameters.hh" #include "HiggsProperties.hh" #include "RHEJ/Event.hh" #include "RHEJ/Mixmax.hh" #include "RHEJ/PDF.hh" #include "RHEJ/utility.hh" using namespace HEJFOG; using namespace RHEJ; namespace { void print_psp(PhaseSpacePoint const & psp){ std::cerr << "Process:\n" << psp.incoming()[0].type << " + "<< psp.incoming()[1].type << " -> "; for(auto const & out: psp.outgoing()){ std::cerr << out.type << " "; } std::cerr << "\n"; } void bail_out(PhaseSpacePoint const & psp, std::string msg){ print_psp(psp); throw std::logic_error{msg}; } } int main(){ constexpr size_t n_psp_base = 19375; const JetParameters jet_para{ fastjet::JetDefinition(fastjet::JetAlgorithm::antikt_algorithm, 0.4), 30, 5, 30}; PDF pdf(11000, pid::proton, pid::proton); constexpr double E_cms = 13000.; constexpr double subl_change = 0.8; const HiggsProperties higgs_para{125., 0.001, {Decay{{pid::photon, pid::photon},1.}}}; RHEJ::Mixmax ran{}; std::vector allowed_types{event_type::FKL, event_type::unob, event_type::unof, event_type::qqxexb, event_type::qqxexf}; // Wp3j Process proc {{pid::proton,pid::proton}, 3, pid::Wp}; size_t n_psp = n_psp_base; size_t t_fail = 0; std::map type_counter; for( size_t i = 0; i try again ++n_psp; if(psp.status()==wrong_final_state) ++t_fail; } } std::cout << "Wp+3j: Took " << n_psp << " to generate " << n_psp_base << " successfully PSP (" << 1.*n_psp/n_psp_base << " trials/PSP)" << std::endl; std::cout << "Failed for wrong final state " << t_fail << " (" << 100.*t_fail/(n_psp-n_psp_base) << " % of fails)" << std::endl; std::cout << "States by classification:\n"; for(auto const & entry: type_counter){ const double fraction = static_cast(entry.second)/n_psp_base; const int percent = std::round(100*fraction); std::cout << std::left << std::setw(25) << (event_type::names[entry.first] + std::string(":")) << entry.second << " (" << percent << "%)\n"; } for(auto const & t: allowed_types){ if(type_counter[t] < 0.05 * n_psp_base){ std::cerr << "Less than 5% of the events are of type " << event_type::names[t] << std::endl; return EXIT_FAILURE; } } // Wm4j proc = Process{{pid::proton,pid::proton}, 4, pid::Wm}; n_psp = n_psp_base; t_fail = 0; allowed_types.push_back(event_type::qqxmid); for(auto & entry: type_counter) entry.second = 0; for( size_t i = 0; i try again ++n_psp; if(psp.status()==wrong_final_state) ++t_fail; } } std::cout << "Wm+4j: Took " << n_psp << " to generate " << n_psp_base << " successfully PSP (" << 1.*n_psp/n_psp_base << " trials/PSP)" << std::endl; std::cout << "Failed for wrong final state " << t_fail << " (" << 100.*t_fail/(n_psp-n_psp_base) << " % of fails)" << std::endl; std::cout << "States by classification:\n"; for(auto const & entry: type_counter){ const double fraction = static_cast(entry.second)/n_psp_base; const int percent = std::round(100*fraction); std::cout << std::left << std::setw(25) << (event_type::names[entry.first] + std::string(":")) << entry.second << " (" << percent << "%)\n"; } for(auto const & t: allowed_types){ - if(type_counter[t] < 0.05 * n_psp_base){ - std::cerr << "Less than 5% of the events are of type " << event_type::names[t] << std::endl; + if(type_counter[t] < 0.03 * n_psp_base){ + std::cerr << "Less than 3% of the events are of type " << event_type::names[t] << std::endl; return EXIT_FAILURE; } } std::cout << "All processes passed." << std::endl; return EXIT_SUCCESS; }