File indexing completed on 2024-04-06 12:13:51
0001 #ifndef gen_JetMatchingMGFastJet_h
0002 #define gen_JetMatchingMGFastJet_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "GeneratorInterface/PartonShowerVeto/interface/JetMatching.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015
0016 #include "SimDataFormats/GeneratorProducts/interface/LHECommonBlocks.h"
0017
0018 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
0019 #include "GeneratorInterface/LHEInterface/interface/LHEEvent.h"
0020
0021
0022
0023
0024
0025 #include "fastjet/ClusterSequence.hh"
0026
0027 #include <iostream>
0028 #include <fstream>
0029
0030 namespace gen {
0031 class JetMatchingMGFastJet : public JetMatching {
0032 public:
0033 JetMatchingMGFastJet(const edm::ParameterSet ¶ms);
0034
0035 ~JetMatchingMGFastJet() override {
0036 if (fJetFinder)
0037 delete fJetFinder;
0038 }
0039
0040 const std::vector<int> *getPartonList() override { return typeIdx; }
0041
0042 protected:
0043 void init(const lhef::LHERunInfo *runInfo) override;
0044
0045 bool initAfterBeams() override;
0046 void beforeHadronisation(const lhef::LHEEvent *) override;
0047 void beforeHadronisationExec() override { return; }
0048
0049 int match(const lhef::LHEEvent *partonLevel, const std::vector<fastjet::PseudoJet> *jetInput) override;
0050
0051 double getJetEtaMax() const override;
0052
0053 private:
0054
0055
0056 template <typename T>
0057 static T parseParameter(const std::string &value);
0058 template <typename T>
0059 static T getParameter(const std::map<std::string, std::string> ¶ms,
0060 const std::string &var,
0061 const T &defValue = T());
0062 template <typename T>
0063 T getParameter(const std::string &var, const T &defValue = T()) const;
0064
0065 template <typename T>
0066 static void updateOrDie(const std::map<std::string, std::string> ¶ms, T ¶m, const std::string &name);
0067
0068 std::map<std::string, std::string> mgParams;
0069
0070
0071
0072 enum vetoStatus { NONE, LESS_JETS, MORE_JETS, HARD_JET, UNMATCHED_PARTON };
0073 enum partonTypes { ID_TOP = 6, ID_GLUON = 21, ID_PHOTON = 22 };
0074
0075 double qCut, qCutSq;
0076 double clFact;
0077 int nQmatch;
0078
0079
0080 bool doMerge;
0081
0082
0083 int nJetMax, nJetMin;
0084
0085
0086 int jetAlgoPower;
0087 double coneRadius, etaJetMax;
0088
0089
0090
0091
0092 bool fExcLocal;
0093
0094
0095 std::vector<int> typeIdx[3];
0096
0097 bool runInitialized;
0098 bool soup;
0099 bool exclusive;
0100
0101
0102
0103
0104 fastjet::JetDefinition *fJetFinder;
0105 std::vector<fastjet::PseudoJet> fClusJets, fPtSortedJets;
0106
0107
0108
0109 std::ofstream fDJROutput;
0110 int fDJROutFlag;
0111
0112 bool fIsInit;
0113 };
0114
0115 }
0116
0117 #endif