CMS 3D CMS Logo

TtSemiLepHypKinFit.cc
Go to the documentation of this file.
2 
3 
5  TtSemiLepHypothesis( cfg ),
6  statusToken_ (consumes<std::vector<int> >(cfg.getParameter<edm::InputTag>("status" ))),
7  partonsHadPToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("partonsHadP"))),
8  partonsHadQToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("partonsHadQ"))),
9  partonsHadBToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("partonsHadB"))),
10  partonsLepBToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("partonsLepB"))),
11  leptonsToken_ (consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("leptons" ))),
12  neutrinosToken_ (consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("neutrinos" )))
13 {
14 }
15 
17 
18 void
21  const edm::Handle<std::vector<pat::MET> >& mets,
22  const edm::Handle<std::vector<pat::Jet> >& jets,
23  std::vector<int>& match, const unsigned int iComb)
24 {
26  evt.getByToken(statusToken_, status);
27  if( (*status)[iComb] != 0 ){
28  // create empty hypothesis if kinematic fit did not converge
29  return;
30  }
31 
38 
39  evt.getByToken(partonsHadPToken_, partonsHadP);
40  evt.getByToken(partonsHadQToken_, partonsHadQ);
41  evt.getByToken(partonsHadBToken_, partonsHadB);
42  evt.getByToken(partonsLepBToken_, partonsLepB);
43  evt.getByToken(leptonsToken_ , leptons );
44  evt.getByToken(neutrinosToken_ , neutrinos );
45 
46  // -----------------------------------------------------
47  // add jets
48  // -----------------------------------------------------
49  if( !( partonsHadP->empty() || partonsHadQ->empty() ||
50  partonsHadB->empty() || partonsLepB->empty() ) ) {
51  setCandidate(partonsHadP, iComb, lightQ_ );
52  setCandidate(partonsHadQ, iComb, lightQBar_);
53  setCandidate(partonsHadB, iComb, hadronicB_);
54  setCandidate(partonsLepB, iComb, leptonicB_);
55  }
56 
57  // -----------------------------------------------------
58  // add lepton
59  // -----------------------------------------------------
60  if( !leptons->empty() ){
61  setCandidate(leptons, iComb, lepton_);
62  }
63  match.push_back( 0 );
64 
65  // -----------------------------------------------------
66  // add neutrino
67  // -----------------------------------------------------
68  if( !neutrinos->empty() ){
69  setCandidate(neutrinos, iComb, neutrino_);
70  }
71 }
edm::EDGetTokenT< std::vector< pat::Particle > > partonsHadPToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
Definition: HeavyIon.h:7
edm::EDGetTokenT< std::vector< pat::Particle > > partonsHadBToken_
edm::EDGetTokenT< std::vector< int > > statusToken_
reco::ShallowClonePtrCandidate * neutrino_
vector< PseudoJet > jets
edm::EDGetTokenT< std::vector< pat::Particle > > partonsLepBToken_
TtSemiLepHypKinFit(const edm::ParameterSet &)
void buildHypo(edm::Event &, const edm::Handle< edm::View< reco::RecoCandidate > > &, const edm::Handle< std::vector< pat::MET > > &, const edm::Handle< std::vector< pat::Jet > > &, std::vector< int > &, const unsigned int iComb) override
build event hypothesis from the reco objects of a semi-leptonic event
reco::ShallowClonePtrCandidate * hadronicB_
~TtSemiLepHypKinFit() override
edm::EDGetTokenT< std::vector< pat::Particle > > partonsHadQToken_
edm::EDGetTokenT< std::vector< pat::Particle > > neutrinosToken_
HLT enums.
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
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_
reco::ShallowClonePtrCandidate * leptonicB_
edm::EDGetTokenT< std::vector< pat::Particle > > leptonsToken_