Page MenuHomeHEPForge

No OneTemporary

diff --git a/include/RHEJ/config.hh b/include/RHEJ/config.hh
index f084c73..c8f4962 100644
--- a/include/RHEJ/config.hh
+++ b/include/RHEJ/config.hh
@@ -1,203 +1,160 @@
/** \file config.hh
* \brief The file which handles the configuration file parameters
*
* Contains the JetParameters Struct and ScaleConfig Struct. Also
* contains the ScaleGenerator Class and the EventTreatment class.
* Config struct is also defined here. The configuration files
* parameters are read and then stored within this objects.
*/
#pragma once
#include <string>
#include <memory>
#include "fastjet/JetDefinition.hh"
#include "yaml-cpp/yaml.h"
#include "RHEJ/event_types.hh"
#include "RHEJ/Event.hh"
#include "RHEJ/HiggsCouplingSettings.hh"
#include "RHEJ/optional.hh"
#include "RHEJ/output_formats.hh"
#include "RHEJ/ScaleFunction.hh"
#include "RHEJ/utility.hh"
namespace RHEJ{
/**! \struct JetParameters config.hh "include/RHEJ/config.hh"
* \brief Contains Jet Definition and Minimum Pt to be a Jet.
*
* Contains the Fastjet definition of a Jet and a threshold (minimum) value for pt
*/
struct JetParameters{
fastjet::JetDefinition def; /**< Jet Definition */
double min_pt; /**< Minimum Jet Pt */
};
/**! \struct ScaleConfig config.hh "include/RHEJ/config.hh"
* \brief Sets up the possible choices for scale variation?
*
* There is a vector which contains the possible scale choices and
* also vector of doubles with the scale factors along with a max
* scale ratio.
*/
struct ScaleConfig{
// std::vector<std::unique_ptr<ScaleFunction>> scales; /**< Vector of possible Scale choices */
std::vector<std::shared_ptr<ScaleFunction>> scales; /**< Vector of possible Scale choices */
std::vector<double> scale_factors; /**< Vector of possible Scale Factors */
double max_scale_ratio; /**< Maximum ratio for the scales */
};
/**! \class ScaleGenerator config.hh "include/RHEJ/config.hh"
* \brief A Class used to generate scales
*
* This class has a clustered event class and scale config struct
* within it.
*/
class ScaleGenerator{
public:
ScaleGenerator() = default;
explicit ScaleGenerator(ScaleConfig && settings):
settings_{std::move(settings)}
{}
Event operator()(Event ev) const;
ScaleConfig const & settings() const;
private:
ScaleConfig settings_;
};
/**
* \brief Enumeration which deals with how to treat events.
*
* The program will decide on how to treat an event based on
* the value of this enumeration.
*/
enum class EventTreatment{
reweight, /**< Reweigh the event */
keep, /**< Keep the event */
discard, /**< Discard the event */
};
/**
* \brief An ordered Map with EventType keys and mapped values EventTreatment
*
* If called upon with EventTreatMap.at(EventType) it will return the treatment which has
* been specified for that EventType.
*/
using EventTreatMap = std::map<event_type::EventType, EventTreatment>;
/**! \struct Config config.hh "include/RHEJ/config.hh" \todo{update}
- * \brief Config struct for user input parameters.
+ * \brief Config Struct for user input parameters.
*
- * The class which handles the input card given by the user.
+ * The struct which handles the input card given by the user.
*
* \internal To add a new option: \todo{update this list}
* 1. Add a member to the Config struct.
* 2. Add the option name to the "supported" Node in
* get_supported_options.
* 3. Initialise the new Config member in to_Config.
* The functions set_from_yaml (for mandatory options) and
* set_from_yaml_if_defined (non-mandatory) may be helpful.
* 4. Add a new entry (with short description) to config.yaml
*/
struct Config {
ScaleGenerator scale_gen; /**< Scale */
JetParameters resummation_jets; /**< Resummation Jets */
JetParameters fixed_order_jets; /**< Fixed-Order Jets */
double min_extparton_pt; /**< Min External Parton Pt*/
double max_ext_soft_pt_fraction; /**< Min External Parton Pt Fraction */
int trials; /**< Number of resummation points to generate per FO */
bool log_correction; /**< Log Correct On or Off */
bool unweight; /**< Unweight On or Off */
std::vector<OutputFile> output; /**< Output File Type */
optional<std::string> RanLux_init; /**< Ranlux File Choice*/
EventTreatMap treat; /**< Event Treat Map? */
YAML::Node analysis_parameters; /**< Analysis Parameters */
//! Settings for Effective Higgs-Gluon Coupling
HiggsCouplingSettings Higgs_coupling;
};
- /**! \struct Config config.hh "include/RHEJ/config.hh" \todo{update}
- * \brief Config struct for user input parameters.
- *
- * The class which handles the input card given by the user.
- *
- * \internal To add a new option: \todo{update this list}
- * 1. Add a member to the Config struct.
- * 2. Add the option name to the "supported" Node in
- * get_supported_options.
- * 3. Initialise the new Config member in to_Config.
- * The functions set_from_yaml (for mandatory options) and
- * set_from_yaml_if_defined (non-mandatory) may be helpful.
- * 4. Add a new entry (with short description) to config.yaml
- */
- class Parameter{
- public:
- Parameter(Config& conf): config(std::make_shared<Config>(conf)) {}
- Config getConfig() const {return *config;}
-
- protected:
- // Parameter(){ config = new Config;};
- // Config * config;
- Parameter(){ config = std::make_shared<Config>();};
- std::shared_ptr<Config> config;
- public:
- const ScaleGenerator& scale_gen() const {return config->scale_gen;}
- JetParameters resummation_jets() const {return config->resummation_jets;}
- JetParameters fixed_order_jets() const {return config->fixed_order_jets;}
- double min_extparton_pt() const {return config->min_extparton_pt;}
- double max_ext_soft_pt_fraction() const {return config->max_ext_soft_pt_fraction;}
- int trials() const {return config->trials;}
- bool log_correction() const {return config->log_correction;}
- bool unweight() const {return config->unweight;}
- std::vector<OutputFile> output() const {return config->output;}
- optional<std::string> RanLux_init() const {return config->RanLux_init;}
- EventTreatMap treat() const {return config->treat;}
- YAML::Node analysis_parameters() const {return config->analysis_parameters;}
- HiggsCouplingSettings Higgs_coupling() const {return config->Higgs_coupling;}
- };
-
- class EventReweighterParameter: private Parameter{
+ class EventReweighterParameter{
+ private:
+ Config config;
public:
- /**
- * \brief Constructor initialise from given set of \p param
- */
- EventReweighterParameter(const Parameter & param):Parameter(param) {}
- /**
- * \brief Constructor setting only the required parameters
- */
+ EventReweighterParameter(const Config & conf):config{conf}{}
EventReweighterParameter(
- const JetParameters jet_param, /**< external Jet parameter*/
- const EventTreatMap treat, /**< EventType treatment */
- const double extpartonptmin, /**< External Parton \f$p_T\f$ Minimum */
- const double max_ext_soft_pt_fraction, /**< External Parton \f$p_T\f$ Maximum */
- const bool log_corr, /**< Logarithmic correction On or Off */
- const HiggsCouplingSettings higgs_coupling /**< Higgs Coupling */
- ){
- config->resummation_jets = jet_param;
- config->treat = treat;
- config->min_extparton_pt = extpartonptmin;
- config->max_ext_soft_pt_fraction = max_ext_soft_pt_fraction;
- config->log_correction = log_corr;
- config->Higgs_coupling = higgs_coupling;
-
+ const JetParameters & jet_param, /**< external Jet parameter*/
+ const EventTreatMap & treat, /**< EventType treatment */
+ const double extpartonptmin, /**< External Parton \f$p_T\f$ Minimum */
+ const double max_ext_soft_pt_fraction, /**< External Parton \f$p_T\f$ Maximum */
+ const bool log_corr, /**< Logarithmic correction On or Off */
+ const HiggsCouplingSettings & higgs_coupling /**< Higgs Coupling */
+ )
+ {
+ config.resummation_jets = jet_param;
+ config.min_extparton_pt = extpartonptmin;
+ config.max_ext_soft_pt_fraction = max_ext_soft_pt_fraction;
+ config.log_correction = log_corr;
+ config.treat = treat;
+ config.Higgs_coupling = higgs_coupling;
}
///@{
/// @ name possible output functions
- using Parameter::resummation_jets;
- using Parameter::treat;
- using Parameter::min_extparton_pt;
- using Parameter::max_ext_soft_pt_fraction;
- using Parameter::log_correction;
- using Parameter::Higgs_coupling;
-
- using Parameter::trials; //< @todo remove
- ///@}
- };
+ JetParameters jet_param() const {return config.resummation_jets;}
+ double jet_ptmin() const {return jet_param().min_pt;}
+ fastjet::JetDefinition jet_def() const {return jet_param().def;}
+
+ double min_extparton_pt() const {return config.min_extparton_pt;}
+ double max_ext_soft_pt_fraction() const {return config.max_ext_soft_pt_fraction;}
-} // namespace RHEJ
\ No newline at end of file
+ bool log_correction() const {return config.log_correction;}
+ EventTreatMap treat() const {return config.treat;}
+
+ HiggsCouplingSettings Higgs_coupling() const {return config.Higgs_coupling;}
+ };
+} // namespace RHEJ

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jan 21, 1:46 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4243522
Default Alt Text
(10 KB)

Event Timeline