CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_
virtual 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)
build event hypothesis from the reco objects of a semi-leptonic event
tuple cfg
Definition: looper.py:259
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
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 &)
reco::ShallowClonePtrCandidate * hadronicB_
edm::EDGetTokenT< std::vector< pat::Particle > > partonsHadQToken_
edm::EDGetTokenT< std::vector< pat::Particle > > neutrinosToken_
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
tuple status
Definition: ntuplemaker.py:245
reco::ShallowClonePtrCandidate * lightQ_
reco::ShallowClonePtrCandidate * leptonicB_
edm::EDGetTokenT< std::vector< pat::Particle > > leptonsToken_