Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:51

0001 #ifndef GeneratorInterface_PartonShowerVeto_JetMatching_h
0002 #define GeneratorInterface_PartonShowerVeto_JetMatching_h
0003 
0004 #include <memory>
0005 #include <vector>
0006 #include <string>
0007 #include <set>
0008 
0009 // #include <HepMC/GenEvent.h>
0010 // #include <HepMC/SimpleVector.h>
0011 
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 
0014 #include "fastjet/ClusterSequence.hh"  // gives both PseudoJet & JetDefinition
0015 // #include "fastjet/Selector.hh"
0016 
0017 namespace lhef {
0018 
0019   class LHERunInfo;
0020   class LHEEvent;
0021   class JetInput;
0022   // class JetClustering;
0023 }  // namespace lhef
0024 
0025 namespace gen {
0026 
0027   class JetMatching {
0028   public:
0029     JetMatching(const edm::ParameterSet& params);
0030     virtual ~JetMatching();
0031 
0032     /*
0033     struct JetPartonMatch {
0034         JetPartonMatch(const HepMC::FourVector  &parton,
0035                        const HepMC::FourVector  &jet,
0036                        double           delta,
0037                        int          pdgId) :
0038             parton(parton), jet(jet),
0039             delta(delta), pdgId(pdgId) {}
0040 
0041         JetPartonMatch(const HepMC::FourVector  &parton,
0042                        int          pdgId) :
0043             parton(parton), delta(-1.0), pdgId(pdgId) {}
0044 
0045         JetPartonMatch(const HepMC::FourVector &jet) :
0046             jet(jet), delta(-1.0), pdgId(0) {}
0047 
0048         inline bool isMatch() const { return delta >= 0 && pdgId; }
0049         inline bool hasParton() const { return pdgId; }
0050         inline bool hasJet() const { return delta >= 0 || !pdgId; }
0051 
0052         HepMC::FourVector   parton;
0053         HepMC::FourVector   jet;
0054         double          delta;
0055         int         pdgId;
0056     };
0057 */
0058     virtual void init(const lhef::LHERunInfo* runInfo);
0059     virtual bool initAfterBeams() { return true; }
0060     virtual void beforeHadronisation(const lhef::LHEEvent* event);
0061     virtual void beforeHadronisationExec();
0062 
0063     // void setJetInput( const std::vector<fastjet::PseudoJet> input ) { fJetInput=input; return; }
0064 
0065     virtual int match(const lhef::LHEEvent* partonLevel, const std::vector<fastjet::PseudoJet>* jetInput) = 0;
0066     /*
0067     virtual int match(const HepMC::GenEvent *partonLevel,
0068                       const HepMC::GenEvent *finalState,
0069                       bool showeredFinalState = false) = 0;
0070 */
0071     virtual std::set<std::string> capabilities() const;
0072 
0073     void resetMatchingStatus() { fMatchingStatus = false; }
0074     bool isMatchingDone() { return fMatchingStatus; }
0075 
0076     virtual const std::vector<int>* getPartonList() { return nullptr; }
0077     virtual double getJetEtaMax() const = 0;
0078 
0079     /*
0080     const std::vector<JetPartonMatch> &getMatchSummary() const
0081     { return matchSummary; }
0082 */
0083     static std::unique_ptr<JetMatching> create(const edm::ParameterSet& params);
0084 
0085   protected:
0086     bool fMatchingStatus;
0087     /*  std::vector<JetPartonMatch> matchSummary; */
0088     // std::vector<fastjet::PseudoJet> fJetInput;
0089   };
0090 
0091 }  // namespace gen
0092 
0093 #endif  // GeneratorCommon_PartonShowerVeto_JetMatching_h