Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:58

0001 #include "GeneratorInterface/GenFilters/plugins/PythiaFilterGammaGamma.h"
0002 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0003 
0004 #include "TLorentzVector.h"
0005 
0006 #include <iostream>
0007 
0008 using namespace edm;
0009 using namespace std;
0010 using namespace HepMC;
0011 
0012 PythiaFilterGammaGamma::PythiaFilterGammaGamma(const edm::ParameterSet& iConfig)
0013     : token_(consumes<edm::HepMCProduct>(
0014           edm::InputTag(iConfig.getUntrackedParameter("moduleLabel", std::string("generator")), "unsmeared"))),
0015       hepMCFilter_(new PythiaHepMCFilterGammaGamma(iConfig)) {}
0016 
0017 PythiaFilterGammaGamma::~PythiaFilterGammaGamma() {}
0018 
0019 bool PythiaFilterGammaGamma::filter(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0020   Handle<HepMCProduct> evt;
0021   iEvent.getByToken(token_, evt);
0022 
0023   const HepMC::GenEvent* myGenEvent = evt->GetEvent();
0024 
0025   return hepMCFilter_->filter(myGenEvent);
0026 }