test
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::unique_ptr<TtGenEvent> gen( genEvt );
34  evt.put(std::move(gen));
35 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< reco::GenParticleCollection > initToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
tuple cfg
Definition: looper.py:293
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
def move
Definition: eostools.py:510
edm::EDGetTokenT< reco::GenParticleCollection > srcToken_
virtual void produce(edm::Event &, const edm::EventSetup &)
TtGenEventReco(const edm::ParameterSet &)