CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtSemiLepHypMVADisc.cc
Go to the documentation of this file.
3 
5  TtSemiLepHypothesis( cfg ) { }
6 
8 
9 void
12  const edm::Handle<std::vector<pat::MET> >& mets,
13  const edm::Handle<std::vector<pat::Jet> >& jets,
14  std::vector<int>& match, const unsigned int iComb)
15 {
16  // -----------------------------------------------------
17  // add jets
18  // -----------------------------------------------------
19  for(unsigned idx=0; idx<match.size(); ++idx){
20  if( isValid(match[idx], jets) ){
21  switch(idx){
23  setCandidate(jets, match[idx], lightQ_); break;
25  setCandidate(jets, match[idx], lightQBar_); break;
27  setCandidate(jets, match[idx], hadronicB_); break;
29  setCandidate(jets, match[idx], leptonicB_); break;
30  }
31  }
32  }
33 
34  // -----------------------------------------------------
35  // add lepton
36  // -----------------------------------------------------
37  if( !leps->empty() )
38  setCandidate(leps, 0, lepton_);
39  match.push_back( 0 );
40 
41  // -----------------------------------------------------
42  // add neutrino
43  // -----------------------------------------------------
44  if( !mets->empty() )
45  setCandidate(mets, 0, neutrino_);
46 }
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
reco::ShallowClonePtrCandidate * lepton_
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
reco::ShallowClonePtrCandidate * lightQBar_
reco::ShallowClonePtrCandidate * neutrino_
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
reco::ShallowClonePtrCandidate * lightQ_
TtSemiLepHypMVADisc(const edm::ParameterSet &)
reco::ShallowClonePtrCandidate * leptonicB_