test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetMatching.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_JetMatching_h
2 #define GeneratorInterface_LHEInterface_JetMatching_h
3 
4 #include <memory>
5 #include <vector>
6 #include <string>
7 #include <set>
8 
9 #include <boost/shared_ptr.hpp>
10 
11 #include "HepMC/GenEvent.h"
12 #include "HepMC/SimpleVector.h"
13 
16 
17 namespace lhef {
18 
19 class LHERunInfo;
20 class LHEEvent;
21 class JetInput;
22 class JetClustering;
23 
24 class JetMatching {
25  public:
26  JetMatching(const edm::ParameterSet &params);
27  virtual ~JetMatching();
28 
29  struct JetPartonMatch {
30  JetPartonMatch(const HepMC::FourVector &parton,
31  const HepMC::FourVector &jet,
32  double delta,
33  int pdgId) :
34  parton(parton), jet(jet),
35  delta(delta), pdgId(pdgId) {}
36 
37  JetPartonMatch(const HepMC::FourVector &parton,
38  int pdgId) :
39  parton(parton), delta(-1.0), pdgId(pdgId) {}
40 
41  JetPartonMatch(const HepMC::FourVector &jet) :
42  jet(jet), delta(-1.0), pdgId(0) {}
43 
44  inline bool isMatch() const { return delta >= 0 && pdgId; }
45  inline bool hasParton() const { return pdgId; }
46  inline bool hasJet() const { return delta >= 0 || !pdgId; }
47 
48  HepMC::FourVector parton;
49  HepMC::FourVector jet;
50  double delta;
51  int pdgId;
52  };
53 
54  virtual void init(const boost::shared_ptr<LHERunInfo> &runInfo);
55  virtual void beforeHadronisation(
56  const boost::shared_ptr<LHEEvent> &event);
57 
58  virtual double match(const HepMC::GenEvent *partonLevel,
59  const HepMC::GenEvent *finalState,
60  bool showeredFinalState = false) = 0;
61 
62  virtual std::set<std::string> capabilities() const;
63 
64  const std::vector<JetPartonMatch> &getMatchSummary() const
65  { return matchSummary; }
66 
67  static std::auto_ptr<JetMatching> create(
68  const edm::ParameterSet &params);
69 
72 
73  protected:
74  std::vector<JetPartonMatch> matchSummary;
75 };
76 
77 } // namespace lhef
78 
79 #define DEFINE_LHE_JETMATCHING_PLUGIN(T) \
80  DEFINE_EDM_PLUGIN(lhef::JetMatching::Factory, T, #T)
81 
82 #endif // GeneratorCommon_LHEInterface_JetMatching_h
JetPartonMatch(const HepMC::FourVector &parton, int pdgId)
Definition: JetMatching.h:37
JetPartonMatch(const HepMC::FourVector &parton, const HepMC::FourVector &jet, double delta, int pdgId)
Definition: JetMatching.h:30
virtual void beforeHadronisation(const boost::shared_ptr< LHEEvent > &event)
Definition: JetMatching.cc:33
virtual void init(const boost::shared_ptr< LHERunInfo > &runInfo)
Definition: JetMatching.cc:29
virtual ~JetMatching()
Definition: JetMatching.cc:25
static std::auto_ptr< JetMatching > create(const edm::ParameterSet &params)
Definition: JetMatching.cc:46
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual double match(const HepMC::GenEvent *partonLevel, const HepMC::GenEvent *finalState, bool showeredFinalState=false)=0
JetMatching(const edm::ParameterSet &params)
Definition: JetMatching.cc:21
virtual std::set< std::string > capabilities() const
Definition: JetMatching.cc:38
const std::vector< JetPartonMatch > & getMatchSummary() const
Definition: JetMatching.h:64
JetPartonMatch(const HepMC::FourVector &jet)
Definition: JetMatching.h:41
std::vector< JetPartonMatch > matchSummary
Definition: JetMatching.h:74