CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombineMatchingInput.h
Go to the documentation of this file.
1 // CombineMatchingInput.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2014 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the following classes:
7 // JetMatchingAlpgenInputAlpgen: combines Alpgen-style MLM matching
8 // with Alpgen native format event input.
9 // JetMatchingMadgraphInputAlpgen: combines Madgraph-style MLM matching
10 // with Alpgen native format event input.
11 // CombineMatchingInput: invokes Alpgen- or Madgraphs-style MLM matching
12 // for Madgraph LHEF or Alpgen native format event input.
13 
14 #ifndef Pythia8_CombineMatchingInput_H
15 #define Pythia8_CombineMatchingInput_H
16 
17 // Includes and namespace
18 #include "Pythia8/Pythia.h"
21 
22 //==========================================================================
23 
24 // JetMatchingAlpgenInputAlpgen:
25 // A small UserHooks class that gives the functionality of both AlpgenHooks
26 // and JetMatchingAlpgen. These classes have one overlapping function,
27 // 'initAfterBeams()', which is overridden here such that both are called.
28 
30  public JetMatchingAlpgen {
31 
32 public:
33 
34  // Constructor and destructor.
35  JetMatchingAlpgenInputAlpgen(Pythia8::Pythia& pythia) : AlpgenHooks(pythia),
36  JetMatchingAlpgen() { }
38 
39  // Initialisation.
40  virtual bool initAfterBeams() {
41  if (!AlpgenHooks::initAfterBeams()) return false;
42  if (!JetMatchingAlpgen::initAfterBeams()) return false;
43  return true;
44  }
45 
46  // Process level vetos.
47  virtual bool canVetoProcessLevel() {
49  }
50  virtual bool doVetoProcessLevel(Pythia8::Event & proc) {
52  }
53 
54  // Parton level vetos (before beam remnants and resonance decays).
55  virtual bool canVetoPartonLevelEarly() {
57  }
58  virtual bool doVetoPartonLevelEarly(const Pythia8::Event &proc) {
60  }
61 
62 };
63 
64 //==========================================================================
65 
66 // JetMatchingMadgraphInputAlpgen:
67 // A small UserHooks class that gives the functionality of both AlpgenHooks
68 // and JetMatchingMadgraph. These classes have one overlapping function,
69 // 'initAfterBeams()', which is overridden here such that both are called.
70 
72  public JetMatchingMadgraph {
73 
74 public:
75 
76  // Constructor and destructor.
77  JetMatchingMadgraphInputAlpgen(Pythia8::Pythia& pythia) : AlpgenHooks(pythia),
80 
81  // Initialisation.
82  virtual bool initAfterBeams() {
83  // Madgraph matching parameters should not be set from Alpgen file.
84  settingsPtr->flag("JetMatching:setMad",false);
85  if (!AlpgenHooks::initAfterBeams()) return false;
86  if (!JetMatchingMadgraph::initAfterBeams()) return false;
87  return true;
88  }
89 
90  // Process level vetos.
91  virtual bool canVetoProcessLevel() {
93  }
94  virtual bool doVetoProcessLevel(Pythia8::Event& proc) {
96  }
97 
98  // Parton level vetos (before beam remnants and resonance decays).
99  virtual bool canVetoPartonLevelEarly() {
101  }
102  virtual bool doVetoPartonLevelEarly(const Pythia8::Event& proc) {
104  }
105 
106 };
107 
108 //==========================================================================
109 
111 
112 public:
113 
114  // Constructor and destructor.
117 
118  // Return a hook relevant for combination of input and matching.
119  Pythia8::UserHooks* getHook(Pythia8::Pythia& pythia) {
120 
121  // Find input source and matching scheme.
122  bool isAlpgenFile = ( pythia.word("Alpgen:file") != "void" );
123  int scheme = pythia.mode("JetMatching:scheme");
124 
125  // Return relevant UserHooks.
126  if (isAlpgenFile) {
127  if (scheme == 2) return new JetMatchingAlpgenInputAlpgen(pythia);
128  if (scheme == 1) return new JetMatchingMadgraphInputAlpgen(pythia);
129  } else {
130  if (scheme == 2) return new JetMatchingAlpgen();
131  if (scheme == 1) return new JetMatchingMadgraph();
132  }
133 
134  // If fail then abort message and return VOID.
135  pythia.info.errorMsg("Abort from CombinedInputMatching::getHook: "
136  "settings unavailable");
137  return NULL;
138  }
139 
140 };
141 
142 //==========================================================================
143 
144 #endif // Pythia8_CombineMatchingInput_H
JetMatchingAlpgenInputAlpgen(Pythia8::Pythia &pythia)
bool doVetoProcessLevel(Pythia8::Event &process)
virtual bool doVetoPartonLevelEarly(const Pythia8::Event &proc)
virtual bool doVetoProcessLevel(Pythia8::Event &proc)
TrainProcessor *const proc
Definition: MVATrainer.cc:101
virtual bool doVetoProcessLevel(Pythia8::Event &proc)
bool initAfterBeams()
#define NULL
Definition: scimark2.h:8
Pythia8::UserHooks * getHook(Pythia8::Pythia &pythia)
virtual bool doVetoPartonLevelEarly(const Pythia8::Event &proc)
bool canVetoPartonLevelEarly()
JetMatchingMadgraphInputAlpgen(Pythia8::Pythia &pythia)
bool doVetoPartonLevelEarly(const Pythia8::Event &event)