Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#include <memory>

#include <memory>
#include <string>

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
#include "GeneratorInterface/LHEInterface/interface/LHEEvent.h"

#include "GeneratorInterface/PartonShowerVeto/interface/JetMatchingMadgraph.h"
#include "GeneratorInterface/PartonShowerVeto/interface/JetMatchingAlpgen.h"

namespace gen {

  JetMatching::JetMatching(const edm::ParameterSet& params) { fMatchingStatus = false; }

  JetMatching::~JetMatching() {}

  void JetMatching::init(const lhef::LHERunInfo* runInfo) {}

  void JetMatching::beforeHadronisation(const lhef::LHEEvent* event) {}

  void JetMatching::beforeHadronisationExec() {}

  std::set<std::string> JetMatching::capabilities() const {
    std::set<std::string> result;
    result.insert("psFinalState");
    result.insert("hepmc");
    return result;
  }

  std::unique_ptr<JetMatching> JetMatching::create(const edm::ParameterSet& params) {
    std::string scheme = params.getParameter<std::string>("scheme");

    std::unique_ptr<JetMatching> matching;

    if (scheme == "Madgraph") {
      matching = std::make_unique<JetMatchingMadgraph>(params);
    } else if (scheme == "Alpgen") {
      matching = std::make_unique<JetMatchingAlpgen>(params);
    } else if (scheme == "MLM") {
      matching.reset();
    } else
      throw cms::Exception("InvalidJetMatching") << "Unknown scheme \"" << scheme
                                                 << "\""
                                                    " specified for parton-shower matching."
                                                 << std::endl;

    if (!matching.get())
      throw cms::Exception("InvalidJetMatching") << "Port of " << scheme << "scheme \""
                                                 << "\""
                                                    " for parton-shower matching is still in progress."
                                                 << std::endl;

    return matching;
  }

}  // namespace gen