CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopDecayChannelFilter.h
Go to the documentation of this file.
7 
8 template <typename S>
10  public:
13 
14  private:
15  virtual bool filter(edm::Event&, const edm::EventSetup&);
22 };
23 
24 template<typename S>
26  src_( cfg.template getParameter<edm::InputTag>( "src" ) ),
27  genEvt_( mayConsume<TtGenEvent>( src_ ) ),
28  parts_( mayConsume<reco::GenParticleCollection>( src_ ) ),
29  sel_( cfg ),
30  checkedSrcType_(0), useTtGenEvent_(0)
31 { }
32 
33 template<typename S>
35 { }
36 
37 template<typename S>
38 bool
40 {
43 
44  if(!checkedSrcType_) {
45  checkedSrcType_ = true;
46  if(iEvent.getByToken( genEvt_, genEvt )) {
47  useTtGenEvent_ = true;
48  return sel_( genEvt->particles(), src_.label() );
49  }
50  }
51  else {
52  if(useTtGenEvent_) {
53  iEvent.getByToken( genEvt_, genEvt );
54  return sel_( genEvt->particles(), src_.label() );
55  }
56  }
57  iEvent.getByToken( parts_, parts );
58  return sel_( *parts, src_.label() );
59 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
tuple cfg
Definition: looper.py:293
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
int iEvent
Definition: GenABIO.cc:230
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
TopDecayChannelFilter(const edm::ParameterSet &)
edm::EDGetTokenT< reco::GenParticleCollection > parts_
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
edm::EDGetTokenT< TtGenEvent > genEvt_
genEvt_(cfg.getParameter< edm::InputTag >("genEvent"))
def template
Definition: svgfig.py:520
virtual bool filter(edm::Event &, const edm::EventSetup &)