Page MenuHomeHEPForge

test_jet_cuts.cc
No OneTemporary

Size
14 KB
Referenced Files
None
Subscribers
None

test_jet_cuts.cc

/**
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2019-2020
* \copyright GPLv2 or later
*/
#include <iostream>
#include "hej_test.hh"
namespace {
const fastjet::JetDefinition jet_def{fastjet::JetAlgorithm::antikt_algorithm, 0.4};
const double min_jet_pt{30.};
const double max_ext_soft_pt_fraction{0.4};
bool correct( bool const expected,
std::array<std::string,2> const & in, std::vector<std::string> const & out,
int const overwrite_boson
){
HEJ::Event ev{ parse_configuration(
in,out,overwrite_boson ).cluster(jet_def, min_jet_pt)};
ASSERT(is_resummable(ev.type())); // only test jet configurations
if(ev.valid_hej_state(max_ext_soft_pt_fraction) != expected){
std::cerr << "Expected " << (expected?"valid":"invalid")
<< " but found "
<< (ev.valid_hej_state(max_ext_soft_pt_fraction)?"valid":"invalid")
<< " jets (" << overwrite_boson << ")\n" << ev;
auto jet_idx{ ev.particle_jet_indices() };
std::cout << "Particle Jet indices: ";
for(int const i: jet_idx)
std::cout << i << " ";
std::cout << std::endl;
return false;
}
return true;
}
// valid jet configurations
bool valid_jets(){
// FKL
// extremal parton inside jet
for(int i=-3; i>-13;--i){
std::array<std::string,2> base_in{"g","g"};
std::vector<std::string> base_out(7, "g");
if(!correct(true, base_in, base_out, i))
return false;
}
std::cout << __LINE__ <<std::endl;
// replace one of the extremal with a boson
if( !( correct(true,{"g","d"},{"g","g","g","g","g","d","h"}, -13)
&& correct(true,{"d","d"},{"d","g","g","g","g","d","h"}, -13)
&& correct(true,{"2","2"},{"1","g","g","g","g","2","Wp"},-14)
))
return false;
std::cout << __LINE__ <<std::endl;
// uno
if( !( correct(true,{"g","3"},{"h","g","g","g","g","3","g"}, -1)
&& correct(true,{"3","2"},{"Wp","g","3","g","g","g","1"}, -1)
&& correct(true,{"1","2"},{"Wm","g","2","g","g","g","2"}, -1)
&& correct(true,{"1","3"},{"1","g","g","g","g","3","g"}, -3)
&& correct(true,{"-1","3"},{"-1","g","g","g","g","3","g"},-5)
&& correct(true,{"3","-2"},{"g","3","g","g","g","g","-2"},-5)
&& correct(true,{"-3","3"},{"g","-3","g","g","g","g","3"},-6)
&& correct(true,{"-4","3"},{"-4","g","g","g","g","3","g"},-7)
&& correct(true,{"3","-5"},{"g","3","g","g","g","g","-5"},-7)
&& correct(true,{"g","3"},{"g","g","g","g","g","3","g"}, -8)
&& correct(true,{"3","g"},{"g","3","g","g","g","g","g"}, -8)
&& correct(true,{"2","3"},{"g","1","g","Wp","g","g","3"}, -9)
&& correct(true,{"2","3"},{"1","g","g","g","3","Wp","g"}, -9)
&& correct(true,{"2","3"},{"1","g","Wp","g","g","3","g"}, -10)
&& correct(true,{"3","g"},{"g","3","g","g","g","g","g"}, -11)
&& correct(true,{"1","3"},{"1","g","g","g","g","3","g"}, -12)
&& correct(true,{"3","2"},{"g","3","g","g","g","g","2"}, -12)
&& correct(true,{"3","g"},{"g","3","g","g","g","g","h"}, -13)
&& correct(true,{"2","3"},{"1","g","g","g","3","g","Wp"}, -13)
&& correct(true,{"2","3"},{"g","1","g","g","g","3","Wp"}, -14)
))
return false;
std::cout << __LINE__ <<std::endl;
// extremal qqx
if( !( correct(true,{"2","g"},{"1","Wp","g","g","g","1","-1"}, -3)
&& correct(true,{"2","g"},{"1","Wp","g","g","g","1","-1"}, -5)
&& correct(true,{"g","2"},{"1","-1","g","Wp","g","g","1"}, -5)
&& correct(true,{"2","g"},{"1","g","g","g","Wp","1","-1"}, -7)
&& correct(true,{"g","2"},{"1","-1","g","g","g","Wp","1"}, -7)
&& correct(true,{"2","g"},{"1","Wp","g","g","g","1","-1"}, -8)
&& correct(true,{"g","2"},{"1","-1","Wp","g","g","g","1"}, -8)
&& correct(true,{"g","2"},{"1","-1","g","Wp","g","g","1"}, -9)
&& correct(true,{"g","3"},{"-2","1","g","Wp","g","g","3"}, -9)
&& correct(true,{"2","g"},{"1","g","g","g","3","Wp","-3"}, -9)
&& correct(true,{"2","g"},{"1","g","Wp","g","g","-3","3"}, -10)
&& correct(true,{"2","g"},{"1","g","g","g","Wp","1","-1"}, -12)
&& correct(true,{"g","2"},{"1","-1","g","Wp","g","g","1"}, -12)
&& correct(true,{"2","g"},{"1","g","g","g","-3","3","Wp"}, -13)
&& correct(true,{"g","g"},{"-2","1","g","g","g","g","Wp"}, -14)
))
return false;
std::cout << __LINE__ <<std::endl;
// central qqx
if( !( correct(true,{"1","g"},{"2","g","-2","Wm","2","g","g"}, -3)
&& correct(true,{"1","g"},{"2","g","g","-2","2","Wm","g"}, -4)
&& correct(true,{"1","g"},{"2","g","g","Wm","-2","2","g"}, -5)
&& correct(true,{"1","g"},{"2","g","g","Wm","-2","2","g"}, -8)
&& correct(true,{"1","g"},{"2","Wm","g","-2","2","g","g"}, -9)
&& correct(true,{"1","g"},{"2","Wm","-2","2","g","g","g"}, -9)
&& correct(true,{"1","g"},{"2","g","g","-2","2","Wm","g"}, -10)
&& correct(true,{"1","g"},{"2","g","Wm","2","-2","g","g"}, -11)
&& correct(true,{"1","g"},{"2","g","g","-2","2","g","Wm"}, -12)
&& correct(true,{"1","g"},{"2","2","-2","g","g","g","Wm"}, -13)
&& correct(true,{"1","g"},{"2","2","-2","g","g","g","Wm"}, -14)
))
return false;
std::cout << __LINE__ <<std::endl;
return true;
}
// invalid jet configurations
bool invalid_jets(){
std::cout << __LINE__ <<std::endl;
// not implemented extremal qqx for pure jets
// if( !( true
// && correct(false,{"2","g"}, {"2","g","g","g","g","2","-2"}, -1)
// && correct(false,{"g","-2"},{"4","-4","g","g","g","g","-2"}, -2)
// // qqx backward not in jet
// && correct(false,{"g","g"}, {"g","g","g","g","g","-2","2"}, -2)
// // qqx backward in same jet
// && correct(false,{"g","2"}, {"-4","4","g","g","g","g","2"}, -3)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -3)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -4)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -5)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -5)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -6)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -7)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -7)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -8)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -8)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -9)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -10)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -11)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -11)
// && correct(false,{"-3","g"},{"-3","g","g","g","g","-3","3"}, -12)
// && correct(false,{"g","-3"},{"-3","3","g","g","g","g","-3"}, -12)
// ))
// return false;
std::cout << __LINE__ <<std::endl;
// not implemented central qqx for pure jets
// if( !( true
// && correct(false,{"-1","g"},{"-1","1","-1","g","g","g","g"}, -1)
// && correct(false,{"4","-3"},{"4","g","g","1","-1","g","-3"}, -2)
// && correct(false,{"1","-1"},{"1","g","-1","1","g","g","-1"}, -3)
// && correct(false,{"1","-1"},{"1","g","g","-1","1","g","-1"}, -3)
// && correct(false,{"1","-1"},{"1","g","g","-1","1","g","-1"}, -4)
// && correct(false,{"1","-1"},{"1","-1","1","g","g","g","-1"}, -4)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -5)
// && correct(false,{"1","-1"},{"1","g","g","-1","1","g","-1"}, -6)
// && correct(false,{"1","-1"},{"1","g","-1","1","g","g","-1"}, -7)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -7)
// && correct(false,{"1","-1"},{"1","-1","1","g","g","g","-1"}, -8)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -8)
// && correct(false,{"1","-1"},{"1","-1","1","g","g","g","-1"}, -9)
// && correct(false,{"1","-1"},{"1","g","-1","1","g","g","-1"}, -9)
// && correct(false,{"1","-1"},{"1","g","g","-1","1","g","-1"}, -10)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -10)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -11)
// && correct(false,{"1","-1"},{"1","g","g","-1","1","g","-1"}, -12)
// && correct(false,{"1","-1"},{"1","g","g","g","-1","1","-1"}, -12)
// ))
// return false;
std::cout << __LINE__ <<std::endl;
// implemented processes failing jet cuts
// FKL
if( !( true
&& correct(false,{"1","g"}, {"g","1","g","g","g","g","g"}, -1)
// FKL not in own jet
&& correct(false,{"1","1"}, {"1","g","g","g","g","g","1"}, -1)
&& correct(false,{"g","g"}, {"g","g","g","g","g","g","g"}, -2)
&& correct(false,{"1","-3"},{"1","g","g","g","g","-3","g"}, -1)
&& correct(false,{"2","g"}, {"g","2","g","g","g","g","g"}, -2)
// FKL below pt
&& correct(false,{"1","1"}, {"1","g","g","g","g","g","1"}, -13)
&& correct(false,{"g","3"},{"h","g","g","g","g","3","g"}, -13)
&& correct(false,{"g","1"},{"Wm","g","g","g","g","2","g"}, -13)
&& correct(false,{"3","1"},{"Wm","g","3","g","g","g","2"}, -13)
// uno in same jet as FKL
&& correct(false,{"-1","1"},{"-1","g","g","g","g","1","g"}, -9)
&& correct(false,{"3","3"}, {"g","3","g","g","g","g","3"}, -9)
&& correct(false,{"-1","1"},{"g","-1","g","g","g","g","1"}, -10)
&& correct(false,{"-1","1"},{"-1","g","g","g","g","1","g"}, -13)
&& correct(false,{"-1","1"},{"g","-1","g","g","g","g","1"}, -13)
// FKL not in jet & uno other side
&& correct(false,{"2","3"},{"Wp","1","g","g","g","3","g"}, -15)
))
return false;
std::cout << __LINE__ <<std::endl;
// uno
if( !( true
// uno backward not in jet
&& correct(false,{"1","2"}, {"g","1","g","g","g","g","2"}, -1)
// uno forward not in jet
&& correct(false,{"3","3"}, {"3","g","g","g","g","3","g"}, -2)
// uno backward in same jet
&& correct(false,{"1","g"}, {"g","1","g","g","g","g","g"}, -3)
// uno forward in same jet
&& correct(false,{"3","2"}, {"3","g","g","g","g","2","g"}, -4)
// uno backward below pt
&& correct(false,{"3","g"}, {"g","3","g","g","g","g","g"}, -4)
// uno forward below pt
&& correct(false,{"4","3"}, {"4","g","g","g","g","3","g"}, -10)
&& correct(false,{"2","3"}, {"1","g","g","g","3","g","Wp"}, -14)
// uno forward not in jet
&& correct(false,{"5","3"}, {"5","g","g","g","g","3","g"}, -11)
))
return false;
std::cout << __LINE__ <<std::endl;
// extremal qqx
if( !( true
// qqxf in same jet
&& correct(false,{"g","g"}, {"Wm","g","g","g","g","-1","2"}, -4)
// qqxb below pt
&& correct(false,{"g","2"},{"1","-1","g","Wp","g","g","1"}, -4)
// central qqx not in jet
&& correct(false,{"1","2"}, {"1","g","-2","2","Wp","g","1"}, -5)
// central qqx in same jet
&& correct(false,{"1","2"}, {"1","-2","2","g","Wp","g","1"}, -6)
// central qqx in same jet
&& correct(false,{"1","2"}, {"1","Wm","g","g","2","-1","2"}, -6)
// qqxf below pt
&& correct(false,{"2","g"},{"1","g","Wp","g","g","1","-1"}, -6)
// central qqx in same jet
&& correct(false,{"1","2"}, {"1","-1","1","g","g","Wp","1"}, -7)
// central qqx in same jet
&& correct(false,{"1","2"}, {"1","Wp","g","3","-3","g","1"}, -7)
// central qqx in same jet
&& correct(false,{"g","3"}, {"g","Wp","-2","1","g","g","3"}, -8)
// central qqx in same jet
&& correct(false,{"g","-2"},{"Wm","g","g","2","-1","g","-2"}, -8)
// qqxf below pt
&& correct(false,{"2","g"},{"1","g","g","g","Wp","1","-1"}, -10)
// qqxf outside jet
&& correct(false,{"2","g"},{"1","g","g","g","Wp","1","-1"}, -11)
// extremal qqx in same jet as FKL
&& correct(false,{"-1","g"},{"-1","g","Wm","g","g","2","-1"},-9)
&& correct(false,{"g","1"}, {"2","-1","g","g","g","Wm","1"}, -10)
// extraml qqx below pt
&& correct(false,{"-1","g"},{"-1","Wm","g","g","g","-1","2"},-13)
&& correct(false,{"g","g"}, {"g","g","g","g","-1","Wm","2"}, -14)
&& correct(false,{"g","g"}, {"-1","2","g","g","g","g","Wm"}, -15)
))
return false;
std::cout << __LINE__ <<std::endl;
// central qqx
if( !( true
&& correct(false,{"1","g"}, {"2","Wm","-2","2","g","g","g"}, -3)
&& correct(false,{"1","g"}, {"2","g","Wm","-2","2","g","g"}, -3)
&& correct(false,{"1","g"}, {"2","-2","2","g","Wm","g","g"}, -4)
&& correct(false,{"-1","g"},{"-1","g","g","Wp","1","-2","g"}, -4)
&& correct(false,{"-1","g"},{"-1","1","-2","g","g","Wp","g"}, -5)
&& correct(false,{"-1","g"},{"-1","g","1","-2","g","Wp","g"}, -5)
&& correct(false,{"-1","g"},{"-1","g","g","1","-2","Wp","g"}, -5)
&& correct(false,{"1","g"}, {"2","g","g","Wm","2","-2","g"}, -6)
&& correct(false,{"1","g"}, {"2","g","Wm","-2","2","g","g"}, -6)
&& correct(false,{"g","4"}, {"g","g","-4","4","g","Wp","3"}, -6)
&& correct(false,{"1","g"}, {"2","g","Wm","g","-2","2","g"}, -7)
&& correct(false,{"g","4"}, {"g","g","-4","4","g","Wp","3"}, -7)
&& correct(false,{"g","4"}, {"g","Wp","g","-4","4","g","3"}, -7)
&& correct(false,{"1","g"}, {"2","-2","2","Wm","g","g","g"}, -8)
&& correct(false,{"g","4"}, {"g","-4","4","g","Wp","g","3"}, -8)
&& correct(false,{"g","g"}, {"g","g","g","g","-2","1","Wp"}, -9)
&& correct(false,{"1","g"}, {"2","-2","2","g","Wm","g","g"}, -9)
&& correct(false,{"1","g"}, {"2","g","-2","2","g","Wm","g"}, -9)
&& correct(false,{"1","g"}, {"2","g","g","Wm","-2","2","g"}, -10)
&& correct(false,{"g","g"}, {"g","1","-2","Wp","g","g","g"}, -10)
&& correct(false,{"g","1"}, {"g","g","Wp","g","-2","1","1"}, -11)
&& correct(false,{"1","g"}, {"2","g","Wm","g","-2","2","g"}, -11)
&& correct(false,{"1","g"}, {"2","Wm","g","-2","2","g","g"}, -12)
&& correct(false,{"3","2"}, {"3","g","-1","2","Wm","g","2"}, -12)
&& correct(false,{"3","-2"},{"3","-1","2","g","g","Wm","-2"}, -13)
&& correct(false,{"3","-2"},{"3","-1","2","g","g","Wm","-2"}, -14)
&& correct(false,{"3","-2"},{"3","g","g","-1","2","Wm","-2"}, -14)
&& correct(false,{"1","g"}, {"Wm","2","2","-2","g","g","g"}, -15)
&& correct(false,{"3","-2"},{"3","-1","2","g","g","-2","Wm"}, -15)
))
return false;
std::cout << __LINE__ <<std::endl;
return true;
}
}
int main() {
if(!valid_jets()) return EXIT_FAILURE;
if(!invalid_jets()) return EXIT_FAILURE;
return EXIT_SUCCESS;
}

File Metadata

Mime Type
text/x-c
Expires
Tue, Sep 30, 6:09 AM (22 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6547145
Default Alt Text
test_jet_cuts.cc (14 KB)

Event Timeline