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  srcToken_ ( consumes<reco::GenParticleCollection>(cfg.getParameter<edm::InputTag>( "src" ) ) ),
7  initToken_( consumes<reco::GenParticleCollection>(cfg.getParameter<edm::InputTag>( "init" ) ) )
8 {
9  produces<TtGenEvent>();
10 }
11 
13 {
14 }
15 
16 void
18 {
20  evt.getByToken(srcToken_, parts);
21 
23  evt.getByToken(initToken_, 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 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< reco::GenParticleCollection > initToken_
tuple cfg
Definition: looper.py:237
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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:113
edm::EDGetTokenT< reco::GenParticleCollection > srcToken_
virtual void produce(edm::Event &, const edm::EventSetup &)
TtGenEventReco(const edm::ParameterSet &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")