CMS 3D CMS Logo

TtFullHadHypKinFit.cc
Go to the documentation of this file.
2 
4 
6 public:
7  explicit TtFullHadHypKinFit(const edm::ParameterSet&);
8 
9 private:
11  void buildKey() override { key_ = TtFullHadronicEvent::kKinFit; };
13  void buildHypo(edm::Event&,
14  const edm::Handle<std::vector<pat::Jet> >&,
15  std::vector<int>&,
16  const unsigned int iComb) override;
17 
25 };
26 
29  statusToken_(consumes<std::vector<int> >(cfg.getParameter<edm::InputTag>("status"))),
30  lightQToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQTag"))),
31  lightQBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQBarTag"))),
32  bToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bTag"))),
33  bBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bBarTag"))),
34  lightPToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPTag"))),
35  lightPBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPBarTag"))) {}
36 
38  const edm::Handle<std::vector<pat::Jet> >& jets,
39  std::vector<int>& match,
40  const unsigned int iComb) {
43  if ((*status)[iComb] != 0) {
44  // create empty hypothesis if kinematic fit did not converge
45  return;
46  }
47 
54 
55  evt.getByToken(lightQToken_, lightQ);
56  evt.getByToken(lightQBarToken_, lightQBar);
57  evt.getByToken(bToken_, b);
58  evt.getByToken(bBarToken_, bBar);
59  evt.getByToken(lightPToken_, lightP);
60  evt.getByToken(lightPBarToken_, lightPBar);
61 
62  // -----------------------------------------------------
63  // add jets
64  // -----------------------------------------------------
65  if (!(lightQ->empty() || lightQBar->empty() || b->empty() || bBar->empty() || lightP->empty() ||
66  lightPBar->empty())) {
67  lightQ_ = makeCandidate(lightQ, iComb);
68  lightQBar_ = makeCandidate(lightQBar, iComb);
69  b_ = makeCandidate(b, iComb);
70  bBar_ = makeCandidate(bBar, iComb);
71  lightP_ = makeCandidate(lightP, iComb);
72  lightPBar_ = makeCandidate(lightPBar, iComb);
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
void buildKey() override
build the event hypothesis key
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::EDGetTokenT< std::vector< pat::Particle > > lightQToken_
void buildHypo(edm::Event &, const edm::Handle< std::vector< pat::Jet > > &, std::vector< int > &, const unsigned int iComb) override
build event hypothesis from the reco objects of a full-hadronic event
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
edm::EDGetTokenT< std::vector< int > > statusToken_
Definition: HeavyIon.h:7
edm::EDGetTokenT< std::vector< pat::Particle > > bBarToken_
edm::EDGetTokenT< std::vector< pat::Particle > > lightQBarToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightP_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
TtFullHadHypKinFit(const edm::ParameterSet &)
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQ_
edm::EDGetTokenT< std::vector< pat::Particle > > bToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightPBar_
double b
Definition: hdecay.h:118
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
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQBar_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPBarToken_