00001 #ifndef gen_JetMatchinhHook_h 00002 #define gen_JetMatchingHook_h 00003 00004 #include <Pythia.h> 00005 00006 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00007 00008 #include "SimDataFormats/GeneratorProducts/interface/LHECommonBlocks.h" 00009 00010 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h" 00011 #include "GeneratorInterface/LHEInterface/interface/LHEEvent.h" 00012 00013 #include "GeneratorInterface/PartonShowerVeto/interface/JetMatching.h" 00014 00015 // forward declaration 00016 class Py8toJetInput; 00017 00018 class JetMatchingHook : public Pythia8::UserHooks 00019 { 00020 00021 public: 00022 00023 JetMatchingHook( const edm::ParameterSet&, Pythia8::Info* ); 00024 virtual ~JetMatchingHook(); 00025 00026 // 00027 // Julia Yarba, Jan.8, 2013 00028 // The "Early" option will work with Pythia8.170 or higher; 00029 // for lower versions, please use just VetoPartonLevel 00030 // 00031 // virtual bool canVetoPartonLevelEarly() { return true; } 00032 // virtual bool doVetoPartonLevelEarly( const Pythia8::Event& event ); 00033 virtual bool canVetoPartonLevel() { return true; } 00034 virtual bool doVetoPartonLevel( const Pythia8::Event& event ); 00035 00036 void setEventNumber( int ievt ) { fEventNumber = ievt; return ; } 00037 00038 virtual void init( lhef::LHERunInfo* runInfo ); 00039 virtual bool initAfterBeams() { if ( fIsInitialized ) return true; fJetMatching->initAfterBeams(); fIsInitialized=true; return true; } 00040 void resetMatchingStatus() { fJetMatching->resetMatchingStatus(); return; } 00041 virtual void beforeHadronization( lhef::LHEEvent* lhee ); 00042 00043 protected: 00044 00045 00046 JetMatchingHook() : UserHooks() {} 00047 00048 void setLHERunInfo( lhef::LHERunInfo* lheri ) { 00049 fRunBlock=lheri; 00050 if ( fRunBlock == 0 ) return; 00051 const lhef::HEPRUP* heprup = fRunBlock->getHEPRUP(); 00052 lhef::CommonBlocks::fillHEPRUP(heprup); 00053 return; 00054 } 00055 void setLHEEvent( lhef::LHEEvent* lhee ) { 00056 fEventBlock=lhee; 00057 if ( fEventBlock == 0 ) return; 00058 const lhef::HEPEUP* hepeup = fEventBlock->getHEPEUP(); 00059 lhef::CommonBlocks::fillHEPEUP(hepeup); 00060 return; 00061 } 00062 00063 // private: 00064 00065 lhef::LHERunInfo* fRunBlock; 00066 lhef::LHEEvent* fEventBlock; 00067 int fEventNumber; 00068 00069 Pythia8::Info* fInfoPtr; 00070 00071 gen::JetMatching* fJetMatching; 00072 Py8toJetInput* fJetInputFill; 00073 00074 //void setJetAlgoInput( const Pythia8::Event& ); 00075 //int getAncestor( int, const Pythia8::Event& ); 00076 00077 bool fIsInitialized; 00078 00079 }; 00080 00081 #endif 00082 00083