diff --git a/include/HEJ/EmptyAnalysis.hh b/include/HEJ/EmptyAnalysis.hh index f540390..3da4d28 100644 --- a/include/HEJ/EmptyAnalysis.hh +++ b/include/HEJ/EmptyAnalysis.hh @@ -1,55 +1,55 @@ /** \file * \brief Declaration of the trivial (empty) analysis * * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019-2020 * \copyright GPLv2 or later */ #pragma once #include #include "HEJ/Analysis.hh" namespace YAML { class Node; } namespace LHEF { class HEPRUP; } namespace HEJ { class Event; /** An analysis that does nothing * * This analysis is used by default if no user analysis is specified. * The member functions don't do anything and events passed to the * analysis are simply ignored. */ struct EmptyAnalysis: Analysis{ //! Create EmptyAnalysis static std::unique_ptr create( YAML::Node const & parameters, LHEF::HEPRUP const & /*unused*/); //! Fill event into analysis (e.g. to histograms) /** * This function does nothing */ void fill(Event const & /*res_event*/, Event const & /*FO_event*/) override; //! Whether a resummation event passes all cuts /** * There are no cuts, so all events pass */ bool pass_cuts(Event const & /*res_event*/, Event const & /*FO_event*/) override; //! Finalise analysis /** * This function does nothing */ void finalise() override; - void scale(double xsscale) override; + void scale(double /*xsscale*/) override; ~EmptyAnalysis() override = default; }; } // namespace HEJ diff --git a/src/EmptyAnalysis.cc b/src/EmptyAnalysis.cc index 6aff224..e8b5c0c 100644 --- a/src/EmptyAnalysis.cc +++ b/src/EmptyAnalysis.cc @@ -1,79 +1,77 @@ /** * \authors The HEJ collaboration (see AUTHORS for details) * \date 2019-2020 * \copyright GPLv2 or later */ #include "HEJ/EmptyAnalysis.hh" #include #include #include #include "yaml-cpp/yaml.h" #include "HEJ/exceptions.hh" namespace HEJ { namespace { std::vector param_as_strings(YAML::Node const & parameters){ using YAML::NodeType; switch(parameters.Type()){ case NodeType::Null: case NodeType::Undefined: return {}; case NodeType::Scalar: return {parameters.as()}; case NodeType::Sequence: { std::vector param_strings; for(auto && param: parameters){ param_strings.emplace_back(param.as()); } return param_strings; } case NodeType::Map: { std::vector param_strings; for(auto && param: parameters){ param_strings.emplace_back(param.first.as()); } return param_strings; } default:; } throw std::logic_error{"unreachable"}; } } // namespace std::unique_ptr EmptyAnalysis::create( YAML::Node const & parameters, LHEF::HEPRUP const & /*unused*/ ){ const auto param_strings = param_as_strings(parameters); if(! param_strings.empty()){ std::string error{"Unknown analysis parameter(s):"}; for(auto && p: param_strings) error += " " + p; throw unknown_option{error}; } return std::make_unique(); } void EmptyAnalysis::fill( Event const & /*res_event*/, Event const & /*FO_event*/ ){ // do nothing } bool EmptyAnalysis::pass_cuts( Event const & /*res_event*/, Event const & /*FO_event*/ ){ return true; } - void EmptyAnalysis::scale(double xsscale){ - // used to scale the cross sections and histograms before .finalise in case the - // normalisation is unknown until the end of the run - std::cout <<"EmptyAnalysis Warning:: Function scale does nothing\n"; + void EmptyAnalysis::scale(double /*xsscale*/){ + // do nothing } void EmptyAnalysis::finalise(){ // do nothing } } // namespace HEJ