CMS 3D CMS Logo

TtFullHadHypGenMatch.cc
Go to the documentation of this file.
4 
6 public:
8 
9 private:
13  void buildHypo(edm::Event& evt,
14  const edm::Handle<std::vector<pat::Jet> >& jets,
15  std::vector<int>& match,
16  const unsigned int iComb) override;
17 
18 protected:
20 };
21 
23  : TtFullHadHypothesis(cfg), genEvtToken_(consumes<TtGenEvent>(edm::InputTag("genEvt"))) {}
24 
26  const edm::Handle<std::vector<pat::Jet> >& jets,
27  std::vector<int>& match,
28  const unsigned int iComb) {
29  // -----------------------------------------------------
30  // get genEvent (to distinguish between uds and c quarks)
31  // -----------------------------------------------------
34 
35  // -----------------------------------------------------
36  // add jets
37  // -----------------------------------------------------
38  for (unsigned idx = 0; idx < match.size(); ++idx) {
39  if (isValid(match[idx], jets)) {
40  switch (idx) {
42  if (std::abs(genEvt->daughterQuarkOfWPlus()->pdgId()) == 4)
44  else
46  break;
48  if (std::abs(genEvt->daughterQuarkBarOfWPlus()->pdgId()) == 4)
50  else
52  break;
55  break;
57  if (std::abs(genEvt->daughterQuarkOfWMinus()->pdgId()) == 4)
59  else
61  break;
63  if (std::abs(genEvt->daughterQuarkBarOfWMinus()->pdgId()) == 4)
65  else
67  break;
70  break;
71  }
72  }
73  }
74 }
75 
std::unique_ptr< reco::ShallowClonePtrCandidate > makeCandidate(const edm::Handle< C > &handle, const int &idx)
use one object in a collection to set a ShallowClonePtrCandidate
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
std::unique_ptr< reco::ShallowClonePtrCandidate > lightP_
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQ_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightPBar_
void buildHypo(edm::Event &evt, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &match, const unsigned int iComb) override
build event hypothesis from the reco objects of a semi-leptonic event
void buildKey() override
build the event hypothesis key
HLT enums.
int key_
hypothesis key (to be set by the buildKey function)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
edm::EDGetTokenT< TtGenEvent > genEvtToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQBar_
TtFullHadHypGenMatch(const edm::ParameterSet &cfg)