CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtSemiLepHypHitFit.cc
Go to the documentation of this file.
3 
4 
6  TtSemiLepHypothesis( cfg ),
7  status_ (cfg.getParameter<edm::InputTag>("status" )),
8  partonsHadP_(cfg.getParameter<edm::InputTag>("partonsHadP")),
9  partonsHadQ_(cfg.getParameter<edm::InputTag>("partonsHadQ")),
10  partonsHadB_(cfg.getParameter<edm::InputTag>("partonsHadB")),
11  partonsLepB_(cfg.getParameter<edm::InputTag>("partonsLepB")),
12  leptons_ (cfg.getParameter<edm::InputTag>("leptons" )),
13  neutrinos_ (cfg.getParameter<edm::InputTag>("neutrinos" ))
14 {
15 }
16 
18 
19 void
22  const edm::Handle<std::vector<pat::MET> >& mets,
23  const edm::Handle<std::vector<pat::Jet> >& jets,
24  std::vector<int>& match, const unsigned int iComb)
25 {
27  evt.getByLabel(status_, status);
28  if( (*status)[iComb] != 0 ){
29  // create empty hypothesis if kinematic fit did not converge
30  return;
31  }
32 
39 
40  evt.getByLabel(partonsHadP_, partonsHadP);
41  evt.getByLabel(partonsHadQ_, partonsHadQ);
42  evt.getByLabel(partonsHadB_, partonsHadB);
43  evt.getByLabel(partonsLepB_, partonsLepB);
44  evt.getByLabel(leptons_ , leptons );
45  evt.getByLabel(neutrinos_ , neutrinos );
46 
47  // -----------------------------------------------------
48  // add jets
49  // -----------------------------------------------------
50  if( !( partonsHadP->empty() || partonsHadQ->empty() ||
51  partonsHadB->empty() || partonsLepB->empty() ) ) {
52  setCandidate(partonsHadP, iComb, lightQ_ );
53  setCandidate(partonsHadQ, iComb, lightQBar_);
54  setCandidate(partonsHadB, iComb, hadronicB_);
55  setCandidate(partonsLepB, iComb, leptonicB_);
56  }
57 
58  // -----------------------------------------------------
59  // add lepton
60  // -----------------------------------------------------
61  if( !leptons->empty() ){
62  setCandidate(leptons, iComb, lepton_);
63  }
64  match.push_back( 0 );
65 
66  // -----------------------------------------------------
67  // add neutrino
68  // -----------------------------------------------------
69  if( !neutrinos->empty() ){
70  setCandidate(neutrinos, iComb, neutrino_);
71  }
72 }
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
edm::InputTag neutrinos_
edm::InputTag partonsLepB_
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
edm::InputTag leptons_
TtSemiLepHypHitFit(const edm::ParameterSet &)
edm::InputTag partonsHadQ_
reco::ShallowClonePtrCandidate * neutrino_
vector< PseudoJet > jets
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag partonsHadB_
reco::ShallowClonePtrCandidate * hadronicB_
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:6
edm::InputTag partonsHadP_
tuple status
Definition: ntuplemaker.py:245
reco::ShallowClonePtrCandidate * lightQ_
reco::ShallowClonePtrCandidate * leptonicB_