CMS 3D CMS Logo

JetMatchingMGFastJet.h
Go to the documentation of this file.
1 #ifndef gen_JetMatchingMGFastJet_h
2 #define gen_JetMatchingMGFastJet_h
3 
4 //
5 // Julia V. Yarba, Feb.10, 2013
6 //
7 // This code takes inspirations in the original implemetation
8 // by Steve Mrenna of FNAL (example main32), but is structured
9 // somewhat differently, and is also using FastJet package
10 // instead of Pythia8's native SlowJet
11 //
12 
15 
17 
20 
21 //
22 // FastJet package/tools
23 // Also gives PseudoJet & JetDefinition
24 //
25 #include "fastjet/ClusterSequence.hh"
26 
27 #include <iostream>
28 #include <fstream>
29 
30 namespace gen {
32  public:
34 
35  ~JetMatchingMGFastJet() override {
36  if (fJetFinder)
37  delete fJetFinder;
38  }
39 
40  const std::vector<int> *getPartonList() override { return typeIdx; }
41 
42  protected:
43  void init(const lhef::LHERunInfo *runInfo) override;
44 
45  bool initAfterBeams() override;
46  void beforeHadronisation(const lhef::LHEEvent *) override;
47  void beforeHadronisationExec() override { return; }
48 
49  int match(const lhef::LHEEvent *partonLevel, const std::vector<fastjet::PseudoJet> *jetInput) override;
50 
51  double getJetEtaMax() const override;
52 
53  private:
54  //parameters staff from Madgraph
55 
56  template <typename T>
57  static T parseParameter(const std::string &value);
58  template <typename T>
59  static T getParameter(const std::map<std::string, std::string> &params,
60  const std::string &var,
61  const T &defValue = T());
62  template <typename T>
63  T getParameter(const std::string &var, const T &defValue = T()) const;
64 
65  template <typename T>
66  static void updateOrDie(const std::map<std::string, std::string> &params, T &param, const std::string &name);
67 
68  std::map<std::string, std::string> mgParams;
69 
70  // ----------------------------
71 
73  enum partonTypes { ID_TOP = 6, ID_GLUON = 21, ID_PHOTON = 22 };
74 
75  double qCut, qCutSq;
76  double clFact;
77  int nQmatch;
78 
79  // Master switch for merging
80  bool doMerge;
81 
82  // Maximum and current number of jets
84 
85  // Jet algorithm parameters
86  int jetAlgoPower; // similar to memain_.mektsc ?
88 
89  // Merging procedure control flag(s)
90  // (there're also inclusive, exclusive, and soup/auto in JetMatchingMGFastJet)
91  //
92  bool fExcLocal; // this is similar to memaev_.iexc
93 
94  // Sort final-state of incoming process into light/heavy jets and 'other'
95  std::vector<int> typeIdx[3];
96 
98  bool soup;
99  bool exclusive;
100 
101  //
102  // FastJets tool(s)
103  //
104  fastjet::JetDefinition *fJetFinder;
105  std::vector<fastjet::PseudoJet> fClusJets, fPtSortedJets;
106 
107  // output for DJR analysis
108  //
109  std::ofstream fDJROutput;
111 
112  bool fIsInit;
113  };
114 
115 } // namespace gen
116 
117 #endif
fastjet::JetDefinition * fJetFinder
JetMatchingMGFastJet(const edm::ParameterSet &params)
double getJetEtaMax() const override
static T getParameter(const std::map< std::string, std::string > &params, const std::string &var, const T &defValue=T())
const std::vector< int > * getPartonList() override
static void updateOrDie(const std::map< std::string, std::string > &params, T &param, const std::string &name)
void beforeHadronisationExec() override
void beforeHadronisation(const lhef::LHEEvent *) override
int match(const lhef::LHEEvent *partonLevel, const std::vector< fastjet::PseudoJet > *jetInput) override
Definition: value.py:1
std::vector< fastjet::PseudoJet > fClusJets
static T parseParameter(const std::string &value)
std::vector< fastjet::PseudoJet > fPtSortedJets
std::map< std::string, std::string > mgParams
void init(const lhef::LHERunInfo *runInfo) override
long double T
std::vector< int > typeIdx[3]