CMS 3D CMS Logo

TtFullHadHypKinFit.cc
Go to the documentation of this file.
2 
4  : TtFullHadHypothesis(cfg),
5  statusToken_(consumes<std::vector<int> >(cfg.getParameter<edm::InputTag>("status"))),
6  lightQToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQTag"))),
7  lightQBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQBarTag"))),
8  bToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bTag"))),
9  bBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bBarTag"))),
10  lightPToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPTag"))),
11  lightPBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPBarTag"))) {}
12 
14 
16  const edm::Handle<std::vector<pat::Jet> >& jets,
17  std::vector<int>& match,
18  const unsigned int iComb) {
20  evt.getByToken(statusToken_, status);
21  if ((*status)[iComb] != 0) {
22  // create empty hypothesis if kinematic fit did not converge
23  return;
24  }
25 
32 
33  evt.getByToken(lightQToken_, lightQ);
34  evt.getByToken(lightQBarToken_, lightQBar);
35  evt.getByToken(bToken_, b);
36  evt.getByToken(bBarToken_, bBar);
37  evt.getByToken(lightPToken_, lightP);
38  evt.getByToken(lightPBarToken_, lightPBar);
39 
40  // -----------------------------------------------------
41  // add jets
42  // -----------------------------------------------------
43  if (!(lightQ->empty() || lightQBar->empty() || b->empty() || bBar->empty() || lightP->empty() ||
44  lightPBar->empty())) {
45  setCandidate(lightQ, iComb, lightQ_);
46  setCandidate(lightQBar, iComb, lightQBar_);
47  setCandidate(b, iComb, b_);
48  setCandidate(bBar, iComb, bBar_);
49  setCandidate(lightP, iComb, lightP_);
50  setCandidate(lightPBar, iComb, lightPBar_);
51  }
52 }
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
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
edm::EDGetTokenT< std::vector< int > > statusToken_
reco::ShallowClonePtrCandidate * lightPBar_
Definition: HeavyIon.h:7
edm::EDGetTokenT< std::vector< pat::Particle > > bBarToken_
edm::EDGetTokenT< std::vector< pat::Particle > > lightQBarToken_
~TtFullHadHypKinFit() override
reco::ShallowClonePtrCandidate * lightQBar_
reco::ShallowClonePtrCandidate * lightP_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPToken_
TtFullHadHypKinFit(const edm::ParameterSet &)
edm::EDGetTokenT< std::vector< pat::Particle > > bToken_
double b
Definition: hdecay.h:118
reco::ShallowClonePtrCandidate * bBar_
HLT enums.
reco::ShallowClonePtrCandidate * b_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
reco::ShallowClonePtrCandidate * lightQ_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPBarToken_