CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtGenEventReco.cc
Go to the documentation of this file.
2 
4 
6  src_ ( cfg.getParameter<edm::InputTag>( "src" ) ),
7  init_( cfg.getParameter<edm::InputTag>( "init" ) )
8 {
9  produces<TtGenEvent>();
10 }
11 
13 {
14 }
15 
16 void
18 {
20  evt.getByLabel(src_, parts);
21 
23  evt.getByLabel(init_, inits);
24 
25  //add TopDecayTree
26  reco::GenParticleRefProd cands( parts );
27 
28  //add InitialStatePartons
29  reco::GenParticleRefProd initParts( inits );
30 
31  //add genEvt to the output stream
32  TtGenEvent* genEvt = new TtGenEvent( cands, initParts );
33  std::auto_ptr<TtGenEvent> gen( genEvt );
34  evt.put( gen );
35 }
edm::InputTag src_
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag init_
TtGenEventReco(const edm::ParameterSet &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")