CMS 3D CMS Logo

TtGenEventReco.cc

Go to the documentation of this file.
00001 #include "FWCore/Utilities/interface/EDMException.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 #include "AnalysisDataFormats/TopObjects/interface/TtGenEvent.h"
00005 #include "TopQuarkAnalysis/TopEventProducers/interface/TopDecaySubset.h"
00006 #include "TopQuarkAnalysis/TopEventProducers/interface/TtGenEventReco.h"
00007 
00008 using namespace std;
00009 using namespace reco;
00010 
00011 TtGenEventReco::TtGenEventReco(const edm::ParameterSet& cfg):
00012   src_ ( cfg.getParameter<edm::InputTag>( "src"  ) ),
00013   init_( cfg.getParameter<edm::InputTag>( "init" ) )
00014 {
00015   produces<TtGenEvent>();
00016 }
00017 
00018 TtGenEventReco::~TtGenEventReco()
00019 {
00020 }
00021 
00022 void
00023 TtGenEventReco::produce(edm::Event& evt, const edm::EventSetup& setup)
00024 {     
00025   edm::Handle<reco::GenParticleCollection> parts;
00026   evt.getByLabel(src_,  parts);
00027 
00028   edm::Handle<reco::GenParticleCollection> inits;
00029   evt.getByLabel(init_, inits);
00030 
00031   //add TopDecayTree
00032   reco::GenParticleRefProd cands( parts );
00033   //add InitialStatePartons
00034   reco::GenParticleRefProd initParts( inits );
00035 
00036   //add genEvt to the output stream
00037   TtGenEvent* genEvt = new TtGenEvent( cands, initParts );
00038   //genEvt->dumpEventContent();
00039   //phase out the gen event
00040   std::auto_ptr<TtGenEvent> gen( genEvt );
00041   evt.put( gen );
00042 }

Generated on Tue Jun 9 17:48:06 2009 for CMSSW by  doxygen 1.5.4