Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8310517
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
12 KB
Subscribers
None
View Options
diff --git a/FixedOrderGen/configFO.yml b/FixedOrderGen/configFO.yml
index 8b3be56..962e8cd 100644
--- a/FixedOrderGen/configFO.yml
+++ b/FixedOrderGen/configFO.yml
@@ -1,44 +1,49 @@
trials : 200
jets:
min pt: 30
R: 0.4
algorithm: antikt
max rapidity: 5
beam:
energy: 6500
particles: [p, p]
pdf: 230000
process: p p => h 4j
# fraction of events with two extremal emissions in one direction
# that contain an unordered emission
unordered fraction: 0.05
scales: max jet pperp
event output:
- HEJ.lhe
# - RHEJ.lhe
# - RHEJ_events.hepmc3
+Higgs properties:
+ mass: 125
+ width: 0.004165
+ decays: {into: [photon, photon], branching ratio: 0.0023568762400521404}
+
# analysis:
# # to use a custom analysis
# plugin: /home/andersen/HEJ/PURE/GitReverse/build/analysis-plugins/src/libVBF.so
# min dy12: 2.8
# min m12: 400
# output: HEJFO.root
# # wtwt cut: # optional cut on (event weight)^2
#RanLux init: ranlux.0 # file for initialisation of random number engine
# parameters for Higgs-gluon couplings
# this requires compilation with looptools
# Higgs coupling:
# use impact factors: false
# mt: 174
# include bottom: true
# mb: 4.7
diff --git a/FixedOrderGen/include/Decay.hh b/FixedOrderGen/include/Decay.hh
new file mode 100644
index 0000000..2f556fc
--- /dev/null
+++ b/FixedOrderGen/include/Decay.hh
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "RHEJ/PDG_codes.hh"
+#include <vector>
+
+namespace HEJFOG{
+ struct Decay{
+ std::vector<RHEJ::pid::ParticleID> products;
+ double branching_ratio;
+ };
+}
diff --git a/FixedOrderGen/include/HiggsProperties.hh b/FixedOrderGen/include/HiggsProperties.hh
new file mode 100644
index 0000000..4d86d56
--- /dev/null
+++ b/FixedOrderGen/include/HiggsProperties.hh
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <vector>
+
+#include "Decay.hh"
+
+namespace HEJFOG{
+ struct HiggsProperties{
+ double mass;
+ double width;
+ std::vector<Decay> decays;
+ };
+}
diff --git a/FixedOrderGen/include/config.hh b/FixedOrderGen/include/config.hh
index f19cc6d..c1c57c1 100644
--- a/FixedOrderGen/include/config.hh
+++ b/FixedOrderGen/include/config.hh
@@ -1,34 +1,36 @@
#pragma once
#include "yaml-cpp/yaml.h"
#include "fastjet/JetDefinition.hh"
#include "RHEJ/HiggsCouplingSettings.hh"
#include "RHEJ/optional.hh"
#include "RHEJ/config.hh"
#include "RHEJ/output_formats.hh"
#include "RHEJ/exceptions.hh"
#include "Process.hh"
#include "JetParameters.hh"
#include "Beam.hh"
+#include "HiggsProperties.hh"
namespace HEJFOG{
struct Config{
Process process;
int trials;
JetParameters jets;
Beam beam;
int pdf_id;
double unordered_fraction;
+ HiggsProperties higgs_properties;
YAML::Node analysis_parameters;
RHEJ::ScaleGenerator scale_gen;
std::vector<RHEJ::OutputFile> output;
RHEJ::optional<std::string> RanLux_init;
RHEJ::HiggsCouplingSettings Higgs_coupling;
};
Config load_config(std::string const & config_file);
}
diff --git a/FixedOrderGen/src/config.cc b/FixedOrderGen/src/config.cc
index f69ae32..1454d63 100644
--- a/FixedOrderGen/src/config.cc
+++ b/FixedOrderGen/src/config.cc
@@ -1,210 +1,264 @@
#include "config.hh"
#include <cctype>
#include "RHEJ/config.hh"
namespace HEJFOG{
using RHEJ::set_from_yaml;
using RHEJ::set_from_yaml_if_defined;
namespace{
//! Get YAML tree of supported options
/**
* The configuration file is checked against this tree of options
* in assert_all_options_known.
*/
YAML::Node const & get_supported_options(){
const static YAML::Node supported = [](){
YAML::Node supported;
static const auto opts = {
"process", "trials", "unordered fraction", "scales", "scale factors",
- "max scale ratio", "pdf", "event output", "analysis", "RanLux init"
+ "max scale ratio", "pdf", "event output", "analysis", "RanLux init",
};
// add subnodes to "supported" - the assigned value is irrelevant
for(auto && opt: opts) supported[opt] = "";
for(auto && jet_opt: {"min pt", "algorithm", "R", "max rapidity"}){
supported["jets"][jet_opt] = "";
}
+ for(auto && Higgs_opt: {"mass", "width"}){
+ supported["Higgs properties"][Higgs_opt] = "";
+ }
+ supported["Higgs properties"]["decays"]["into"] = "";
+ supported["Higgs properties"]["decays"]["branching ratio"] = "";
for(auto && opt: {"mt", "use impact factors", "include bottom", "mb"}){
supported["Higgs coupling"][opt] = "";
}
for(auto && beam_opt: {"energy", "particles"}){
supported["beam"][beam_opt] = "";
}
return supported;
}();
return supported;
}
JetParameters get_jet_parameters(
YAML::Node const & node, std::string const & entry
){
const auto p = RHEJ::get_jet_parameters(node, entry);
JetParameters result;
result.def = p.def;
result.min_pt = p.min_pt;
set_from_yaml(result.max_y, node, entry, "max rapidity");
return result;
}
Beam get_Beam(
YAML::Node const & node, std::string const & entry
){
Beam beam;
std::vector<RHEJ::ParticleID> particles;
set_from_yaml(beam.energy, node, entry, "energy");
set_from_yaml_if_defined(particles, node, entry, "particles");
if(! particles.empty()){
for(RHEJ::ParticleID particle: particles){
if(particle != RHEJ::pid::p && particle != RHEJ::pid::p_bar){
throw std::invalid_argument{
"Unsupported value in option " + entry + ": particles:"
" only proton ('p') and antiproton ('p_bar') beams are supported"
};
}
}
if(particles.size() != 2){
throw std::invalid_argument{"Not exactly two beam particles"};
}
beam.particles.front() = particles.front();
beam.particles.back() = particles.back();
}
return beam;
}
std::vector<std::string> split(
std::string const & str, std::string const & delims
){
std::vector<std::string> result;
for(size_t begin, end = 0; end != str.npos;){
begin = str.find_first_not_of(delims, end);
if(begin == str.npos) break;
end = str.find_first_of(delims, begin + 1);
result.emplace_back(str.substr(begin, end - begin));
}
return result;
}
std::invalid_argument invalid_incoming(std::string const & what){
return std::invalid_argument{
"Incoming particle type " + what + " not supported,"
" incoming particles have to be 'p', 'p_bar' or partons"
};
}
std::invalid_argument invalid_outgoing(std::string const & what){
return std::invalid_argument{
"Outgoing particle type " + what + " not supported,"
" outgoing particles have to be 'j', 'photon', 'W+', 'W-', 'Z', 'H'"
};
}
Process get_process(
YAML::Node const & node, std::string const & entry
){
Process result;
std::string process_string;
set_from_yaml(process_string, node, entry);
assert(! process_string.empty());
const auto particles = split(process_string, " \n\t\v=>");
if(particles.size() < 3){
throw std::invalid_argument{
"Bad format in option process: '" + process_string
+ "', expected format is 'in1 in2 => out1 ...'"
};
}
result.incoming.front() = RHEJ::to_ParticleID(particles[0]);
result.incoming.back() = RHEJ::to_ParticleID(particles[1]);
for(size_t i = 0; i < result.incoming.size(); ++i){
const RHEJ::ParticleID in = result.incoming[i];
if(
in != RHEJ::pid::proton && in != RHEJ::pid::p_bar
&& !RHEJ::is_parton(in)
){
throw invalid_incoming(particles[i]);
}
}
result.njets = 0;
for(size_t i = result.incoming.size(); i < particles.size(); ++i){
assert(! particles[i].empty());
if(particles[i] == "j") ++result.njets;
else if(std::isdigit(particles[i].front())){
if(particles[i].back() != 'j'){
throw invalid_outgoing(particles[i]);
}
result.njets += std::stoi(particles[i]);
}
else{
const auto pid = RHEJ::to_ParticleID(particles[i]);
if(!RHEJ::is_AWZH_boson(pid)){
throw invalid_outgoing(particles[i]);
}
if(result.boson){
throw std::invalid_argument{
"More than one outgoing boson is not supported"
};
}
result.boson = pid;
}
}
if(result.njets < 2){
throw std::invalid_argument{
"Process has to include at least two jets ('j')"
};
}
return result;
}
+ Decay get_decay(YAML::Node const & node){
+ Decay decay;
+ set_from_yaml(decay.products, node, "into");
+ set_from_yaml(decay.branching_ratio, node, "branching ratio");
+ return decay;
+ }
+
+ std::vector<Decay> get_decays(YAML::Node const & node){
+ using YAML::NodeType;
+ if(!node) return {};
+ switch(node.Type()){
+ case NodeType::Null:
+ case NodeType::Undefined:
+ return {};
+ case NodeType::Scalar:
+ throw RHEJ::invalid_type{"value is not a list of decays"};
+ case NodeType::Map:
+ return {get_decay(node)};
+ case NodeType::Sequence:
+ std::vector<Decay> result;
+ for(auto && decay_str: node){
+ result.emplace_back();
+ set_from_yaml(result.back().products, decay_str, "into");
+ set_from_yaml(result.back().branching_ratio, decay_str, "branching ratio");
+ }
+ return result;
+ }
+ throw std::logic_error{"unreachable"};
+ }
+
+ HiggsProperties get_higgs_properties(
+ YAML::Node const & node, std::string const & entry
+ ){
+ HiggsProperties result;
+ set_from_yaml(result.mass, node, entry, "mass");
+ set_from_yaml(result.width, node, entry, "width");
+ try{
+ result.decays = get_decays(node[entry]["decays"]);
+ }
+ catch(RHEJ::missing_option const & ex){
+ throw RHEJ::missing_option{entry + ": decays: " + ex.what()};
+ }
+ catch(RHEJ::invalid_type const & ex){
+ throw RHEJ::invalid_type{entry + ": decays: " + ex.what()};
+ }
+ return result;
+ }
+
Config to_Config(YAML::Node const & yaml){
try{
RHEJ::assert_all_options_known(yaml, get_supported_options());
}
catch(RHEJ::unknown_option const & ex){
throw RHEJ::unknown_option{std::string{"Unknown option '"} + ex.what() + "'"};
}
Config config;
config.process = get_process(yaml, "process");
set_from_yaml(config.trials, yaml, "trials");
config.jets = get_jet_parameters(yaml, "jets");
config.beam = get_Beam(yaml, "beam");
for(size_t i = 0; i < config.process.incoming.size(); ++i){
const auto & in = config.process.incoming[i];
using namespace RHEJ::pid;
if( (in == p || in == p_bar) && in != config.beam.particles[i]){
throw std::invalid_argument{
"Particle type of beam " + std::to_string(i+1) + " incompatible"
+ " with type of incoming particle " + std::to_string(i+1)
};
}
}
set_from_yaml(config.pdf_id, yaml, "pdf");
set_from_yaml(config.unordered_fraction, yaml, "unordered fraction");
if(config.unordered_fraction < 0 || config.unordered_fraction > 1){
throw std::invalid_argument{
"unordered fraction has to be between 0 and 1"
};
}
+ config.higgs_properties = get_higgs_properties(yaml, "Higgs properties");
set_from_yaml_if_defined(config.analysis_parameters, yaml, "analysis");
config.scale_gen = RHEJ::ScaleGenerator{RHEJ::to_ScaleConfig(yaml)};
set_from_yaml_if_defined(config.output, yaml, "event output");
set_from_yaml_if_defined(config.RanLux_init, yaml, "RanLux init");
config.Higgs_coupling = RHEJ::get_Higgs_coupling(yaml, "Higgs coupling");
return config;
}
}
Config load_config(std::string const & config_file){
try{
return to_Config(YAML::LoadFile(config_file));
}
catch(...){
std::cerr << "Error reading " << config_file << ":\n ";
throw;
}
}
}
diff --git a/FixedOrderGen/t/config_h_2j.yml b/FixedOrderGen/t/config_h_2j.yml
index 1507e83..a666ee1 100644
--- a/FixedOrderGen/t/config_h_2j.yml
+++ b/FixedOrderGen/t/config_h_2j.yml
@@ -1,19 +1,23 @@
trials : 100000
jets:
min pt: 30
R: 0.4
algorithm: antikt
max rapidity: 5
beam:
energy: 6500
particles: [p, p]
pdf: 11000
process: p p => h 2j
unordered fraction: 0
scales: 125
+
+Higgs properties:
+ mass: 125
+ width: 0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 21, 6:43 PM (5 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023855
Default Alt Text
(12 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment