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
gen::JetMatchingMGFastJet::beforeHadronisationExec
void beforeHadronisationExec() override
Definition: JetMatchingMGFastJet.h:47
gen::JetMatchingMGFastJet::getPartonList
const std::vector< int > * getPartonList() override
Definition: JetMatchingMGFastJet.h:40
gen::JetMatchingMGFastJet::beforeHadronisation
void beforeHadronisation(const lhef::LHEEvent *) override
Definition: JetMatchingMGFastJet.cc:213
JetMatching.h
gen::JetMatchingMGFastJet::initAfterBeams
bool initAfterBeams() override
Definition: JetMatchingMGFastJet.cc:172
gen::JetMatchingMGFastJet::exclusive
bool exclusive
Definition: JetMatchingMGFastJet.h:99
gen::JetMatchingMGFastJet::etaJetMax
double etaJetMax
Definition: JetMatchingMGFastJet.h:87
gen::JetMatchingMGFastJet::getJetEtaMax
double getJetEtaMax() const override
Definition: JetMatchingMGFastJet.cc:170
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
gen::JetMatchingMGFastJet::LESS_JETS
Definition: JetMatchingMGFastJet.h:72
gen::JetMatchingMGFastJet::HARD_JET
Definition: JetMatchingMGFastJet.h:72
gen::JetMatchingMGFastJet::ID_PHOTON
Definition: JetMatchingMGFastJet.h:73
gen::JetMatchingMGFastJet::fPtSortedJets
std::vector< fastjet::PseudoJet > fPtSortedJets
Definition: JetMatchingMGFastJet.h:105
gen::JetMatchingMGFastJet::NONE
Definition: JetMatchingMGFastJet.h:72
gen::JetMatchingMGFastJet::getParameter
static T getParameter(const std::map< std::string, std::string > &params, const std::string &var, const T &defValue=T())
Definition: JetMatchingMGFastJet.cc:72
gen::JetMatchingMGFastJet::updateOrDie
static void updateOrDie(const std::map< std::string, std::string > &params, T &param, const std::string &name)
Definition: JetMatchingMGFastJet.cc:112
gen::JetMatchingMGFastJet::fIsInit
bool fIsInit
Definition: JetMatchingMGFastJet.h:112
gen::JetMatchingMGFastJet::UNMATCHED_PARTON
Definition: JetMatchingMGFastJet.h:72
gen::JetMatching
Definition: JetMatching.h:27
gen::JetMatchingMGFastJet::fJetFinder
fastjet::JetDefinition * fJetFinder
Definition: JetMatchingMGFastJet.h:104
gen::JetMatchingMGFastJet::qCut
double qCut
Definition: JetMatchingMGFastJet.h:75
gen::JetMatchingMGFastJet::soup
bool soup
Definition: JetMatchingMGFastJet.h:98
gen::JetMatchingMGFastJet::coneRadius
double coneRadius
Definition: JetMatchingMGFastJet.h:87
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
gen::JetMatchingMGFastJet::nQmatch
int nQmatch
Definition: JetMatchingMGFastJet.h:77
gen::JetMatchingMGFastJet::fClusJets
std::vector< fastjet::PseudoJet > fClusJets
Definition: JetMatchingMGFastJet.h:105
gen::JetMatchingMGFastJet::match
int match(const lhef::LHEEvent *partonLevel, const std::vector< fastjet::PseudoJet > *jetInput) override
Definition: JetMatchingMGFastJet.cc:313
gen::JetMatchingMGFastJet::fExcLocal
bool fExcLocal
Definition: JetMatchingMGFastJet.h:92
gen::JetMatchingMGFastJet::qCutSq
double qCutSq
Definition: JetMatchingMGFastJet.h:75
gen::JetMatchingMGFastJet::~JetMatchingMGFastJet
~JetMatchingMGFastJet() override
Definition: JetMatchingMGFastJet.h:35
gen
Definition: PythiaDecays.h:13
gen::JetMatchingMGFastJet::clFact
double clFact
Definition: JetMatchingMGFastJet.h:76
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
lhef::LHERunInfo
Definition: LHERunInfo.h:25
edm::ParameterSet
Definition: ParameterSet.h:47
gen::JetMatchingMGFastJet::runInitialized
bool runInitialized
Definition: JetMatchingMGFastJet.h:97
gen::JetMatchingMGFastJet::jetAlgoPower
int jetAlgoPower
Definition: JetMatchingMGFastJet.h:86
gen::JetMatchingMGFastJet::ID_TOP
Definition: JetMatchingMGFastJet.h:73
LHERunInfo.h
gen::JetMatchingMGFastJet::nJetMax
int nJetMax
Definition: JetMatchingMGFastJet.h:83
lhef::LHEEvent
Definition: LHEEvent.h:23
gen::JetMatchingMGFastJet::init
void init(const lhef::LHERunInfo *runInfo) override
Definition: JetMatchingMGFastJet.cc:258
value
Definition: value.py:1
gen::JetMatchingMGFastJet::JetMatchingMGFastJet
JetMatchingMGFastJet(const edm::ParameterSet &params)
Definition: JetMatchingMGFastJet.cc:127
gen::JetMatchingMGFastJet::ID_GLUON
Definition: JetMatchingMGFastJet.h:73
gen::JetMatchingMGFastJet::fDJROutFlag
int fDJROutFlag
Definition: JetMatchingMGFastJet.h:110
gen::JetMatchingMGFastJet::vetoStatus
vetoStatus
Definition: JetMatchingMGFastJet.h:72
gen::JetMatchingMGFastJet::nJetMin
int nJetMin
Definition: JetMatchingMGFastJet.h:83
T
long double T
Definition: Basic3DVectorLD.h:48
gen::JetMatchingMGFastJet
Definition: JetMatchingMGFastJet.h:31
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
LHEEvent.h
gen::JetMatchingMGFastJet::fDJROutput
std::ofstream fDJROutput
Definition: JetMatchingMGFastJet.h:109
gen::JetMatchingMGFastJet::parseParameter
static T parseParameter(const std::string &value)
Definition: JetMatchingMGFastJet.cc:47
ParameterSet.h
gen::JetMatchingMGFastJet::typeIdx
std::vector< int > typeIdx[3]
Definition: JetMatchingMGFastJet.h:95
gen::JetMatchingMGFastJet::doMerge
bool doMerge
Definition: JetMatchingMGFastJet.h:80
gen::JetMatchingMGFastJet::MORE_JETS
Definition: JetMatchingMGFastJet.h:72
LHECommonBlocks.h
gen::JetMatchingMGFastJet::mgParams
std::map< std::string, std::string > mgParams
Definition: JetMatchingMGFastJet.h:68
gen::JetMatchingMGFastJet::partonTypes
partonTypes
Definition: JetMatchingMGFastJet.h:73