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_PartonShowerVeto_JetMatching_h
2 #define GeneratorInterface_PartonShowerVeto_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 
15 
16 namespace lhef {
17 
18 class LHERunInfo;
19 class LHEEvent;
20 class JetInput;
21 // class JetClustering;
22 }
23 
24 namespace gen {
25 
26 class JetMatching {
27  public:
28  JetMatching(const edm::ParameterSet &params);
29  virtual ~JetMatching();
30 
31  struct JetPartonMatch {
32  JetPartonMatch(const HepMC::FourVector &parton,
33  const HepMC::FourVector &jet,
34  double delta,
35  int pdgId) :
36  parton(parton), jet(jet),
37  delta(delta), pdgId(pdgId) {}
38 
39  JetPartonMatch(const HepMC::FourVector &parton,
40  int pdgId) :
41  parton(parton), delta(-1.0), pdgId(pdgId) {}
42 
43  JetPartonMatch(const HepMC::FourVector &jet) :
44  jet(jet), delta(-1.0), pdgId(0) {}
45 
46  inline bool isMatch() const { return delta >= 0 && pdgId; }
47  inline bool hasParton() const { return pdgId; }
48  inline bool hasJet() const { return delta >= 0 || !pdgId; }
49 
50  HepMC::FourVector parton;
51  HepMC::FourVector jet;
52  double delta;
53  int pdgId;
54  };
55 
56  virtual void init(const lhef::LHERunInfo* runInfo);
57  virtual void beforeHadronisation(const lhef::LHEEvent* event);
58  virtual void beforeHadronisationExec();
59 
60  virtual int match(const HepMC::GenEvent *partonLevel,
61  const HepMC::GenEvent *finalState,
62  bool showeredFinalState = false) = 0;
63 
64  virtual std::set<std::string> capabilities() const;
65 
67  bool isMatchingDone() { return fMatchingStatus; }
68 
69  const std::vector<JetPartonMatch> &getMatchSummary() const
70  { return matchSummary; }
71 
72  static std::auto_ptr<JetMatching> create(
73  const edm::ParameterSet &params);
74 
75  protected:
77  std::vector<JetPartonMatch> matchSummary;
78 };
79 
80 } // namespace gen
81 
82 
83 #endif // GeneratorCommon_PartonShowerVeto_JetMatching_h
static std::auto_ptr< JetMatching > create(const edm::ParameterSet &params)
Definition: JetMatching.cc:47
JetPartonMatch(const HepMC::FourVector &jet)
Definition: JetMatching.h:43
const std::vector< JetPartonMatch > & getMatchSummary() const
Definition: JetMatching.h:69
JetPartonMatch(const HepMC::FourVector &parton, const HepMC::FourVector &jet, double delta, int pdgId)
Definition: JetMatching.h:32
virtual void beforeHadronisation(const lhef::LHEEvent *event)
Definition: JetMatching.cc:31
virtual ~JetMatching()
Definition: JetMatching.cc:23
void resetMatchingStatus()
Definition: JetMatching.h:66
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
std::vector< JetPartonMatch > matchSummary
Definition: JetMatching.h:77
JetPartonMatch(const HepMC::FourVector &parton, int pdgId)
Definition: JetMatching.h:39
virtual std::set< std::string > capabilities() const
Definition: JetMatching.cc:39
JetMatching(const edm::ParameterSet &params)
Definition: JetMatching.cc:18
virtual void beforeHadronisationExec()
Definition: JetMatching.cc:35
bool isMatchingDone()
Definition: JetMatching.h:67
virtual int match(const HepMC::GenEvent *partonLevel, const HepMC::GenEvent *finalState, bool showeredFinalState=false)=0
virtual void init(const lhef::LHERunInfo *runInfo)
Definition: JetMatching.cc:27