Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8724051
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Subscribers
None
View Options
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 <algorithm>
#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<event_type::EventType> 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<event_type::EventType, size_t> type_counter;
for( size_t i = 0; i<n_psp; ++i){
const PhaseSpacePoint psp{proc,jet_para,pdf, E_cms, subl_change, higgs_para, ran};
if(psp.status()==good){
const Event ev(to_UnclusteredEvent(psp), jet_para.def, jet_para.min_pt);
++type_counter[ev.type()];
if( std::find(allowed_types.cbegin(), allowed_types.cend(), ev.type())
== allowed_types.cend()) {
bail_out(psp, "Found not allowed event of type "
+std::string(event_type::names[ev.type()]));
}
} else { // bad process -> 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<double>(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<n_psp; ++i){
const PhaseSpacePoint psp{proc,jet_para,pdf, E_cms, subl_change, higgs_para, ran};
if(psp.status()==good){
const Event ev(to_UnclusteredEvent(psp), jet_para.def, jet_para.min_pt);
++type_counter[ev.type()];
if( std::find(allowed_types.cbegin(), allowed_types.cend(), ev.type())
== allowed_types.cend()) {
bail_out(psp, "Found not allowed event of type "
+std::string(event_type::names[ev.type()]));
}
} else { // bad process -> 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<double>(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;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Jan 20, 10:24 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242634
Default Alt Text
(5 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment