CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StGenEventReco.cc
Go to the documentation of this file.
2 
4  srcToken_ ( consumes<reco::GenParticleCollection>(cfg.getParameter<edm::InputTag>( "src" ) ) ),
5  initToken_( consumes<reco::GenParticleCollection>(cfg.getParameter<edm::InputTag>( "init" ) ) )
6 {
7  produces<StGenEvent>();
8 }
9 
11 {
12 }
13 
14 void
16 {
18  evt.getByToken(srcToken_, parts);
19 
21  evt.getByToken(initToken_, inits);
22 
23  //add TopDecayTree
24  reco::GenParticleRefProd cands( parts );
25 
26  //add InitialStatePartons
27  reco::GenParticleRefProd initParts( inits );
28 
29  //add genEvt to the output stream
30  StGenEvent* genEvt = new StGenEvent( cands, initParts );
31  std::auto_ptr<StGenEvent> gen( genEvt );
32  evt.put( gen );
33 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
tuple cfg
Definition: looper.py:293
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< reco::GenParticleCollection > initToken_
edm::EDGetTokenT< reco::GenParticleCollection > srcToken_
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
Class derived from the TopGenEvent for single-top events.
Definition: StGenEvent.h:17
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
virtual void produce(edm::Event &, const edm::EventSetup &)
StGenEventReco(const edm::ParameterSet &)