CMS 3D CMS Logo

TopDecayChannelFilter.h
Go to the documentation of this file.
7 
8 template <typename S>
10  public:
12  ~TopDecayChannelFilter() override;
13 
14  private:
15  bool filter(edm::Event&, const edm::EventSetup&) override;
22 };
23 
24 template<typename S>
26  src_( cfg.template getParameter<edm::InputTag>( "src" ) ),
29  sel_( cfg ),
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool filter(edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
TopDecayChannelFilter(const edm::ParameterSet &)
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
edm::EDGetTokenT< reco::GenParticleCollection > parts_
std::string const & label() const
Definition: InputTag.h:36
const reco::GenParticleCollection & particles() const
return particles of decay chain
Definition: TopGenEvent.h:53
fixed size matrix
HLT enums.
edm::EDGetTokenT< TtGenEvent > genEvt_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)