Go to the documentation of this file.00001 #ifndef GeneratorInterface_LHEInterface_JetMatching_h
00002 #define GeneratorInterface_LHEInterface_JetMatching_h
00003
00004 #include <memory>
00005 #include <vector>
00006 #include <string>
00007 #include <set>
00008
00009 #include <boost/shared_ptr.hpp>
00010
00011 #include <HepMC/GenEvent.h>
00012 #include <HepMC/SimpleVector.h>
00013
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "FWCore/PluginManager/interface/PluginFactory.h"
00016
00017 namespace lhef {
00018
00019 class LHERunInfo;
00020 class LHEEvent;
00021 class JetInput;
00022 class JetClustering;
00023
00024 class JetMatching {
00025 public:
00026 JetMatching(const edm::ParameterSet ¶ms);
00027 virtual ~JetMatching();
00028
00029 struct JetPartonMatch {
00030 JetPartonMatch(const HepMC::FourVector &parton,
00031 const HepMC::FourVector &jet,
00032 double delta,
00033 int pdgId) :
00034 parton(parton), jet(jet),
00035 delta(delta), pdgId(pdgId) {}
00036
00037 JetPartonMatch(const HepMC::FourVector &parton,
00038 int pdgId) :
00039 parton(parton), delta(-1.0), pdgId(pdgId) {}
00040
00041 JetPartonMatch(const HepMC::FourVector &jet) :
00042 jet(jet), delta(-1.0), pdgId(0) {}
00043
00044 inline bool isMatch() const { return delta >= 0 && pdgId; }
00045 inline bool hasParton() const { return pdgId; }
00046 inline bool hasJet() const { return delta >= 0 || !pdgId; }
00047
00048 HepMC::FourVector parton;
00049 HepMC::FourVector jet;
00050 double delta;
00051 int pdgId;
00052 };
00053
00054 virtual void init(const boost::shared_ptr<LHERunInfo> &runInfo);
00055 virtual void beforeHadronisation(
00056 const boost::shared_ptr<LHEEvent> &event);
00057
00058 virtual double match(const HepMC::GenEvent *partonLevel,
00059 const HepMC::GenEvent *finalState,
00060 bool showeredFinalState = false) = 0;
00061
00062 virtual std::set<std::string> capabilities() const;
00063
00064 const std::vector<JetPartonMatch> &getMatchSummary() const
00065 { return matchSummary; }
00066
00067 static std::auto_ptr<JetMatching> create(
00068 const edm::ParameterSet ¶ms);
00069
00070 typedef edmplugin::PluginFactory<JetMatching*(
00071 const edm::ParameterSet &)> Factory;
00072
00073 protected:
00074 std::vector<JetPartonMatch> matchSummary;
00075 };
00076
00077 }
00078
00079 #define DEFINE_LHE_JETMATCHING_PLUGIN(T) \
00080 DEFINE_EDM_PLUGIN(lhef::JetMatching::Factory, T, #T)
00081
00082 #endif // GeneratorCommon_LHEInterface_JetMatching_h