CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepHypGeom.cc

Go to the documentation of this file.
00001 #include "AnalysisDataFormats/TopObjects/interface/TtSemiLepEvtPartons.h"
00002 #include "TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepHypGeom.h"
00003 
00004 TtSemiLepHypGeom::TtSemiLepHypGeom(const edm::ParameterSet& cfg):
00005   TtSemiLepHypothesis( cfg ),
00006   neutrinoSolutionType_(cfg.getParameter<int>("neutrinoSolutionType"))
00007 { }
00008 
00009 TtSemiLepHypGeom::~TtSemiLepHypGeom() { }
00010 
00011 void
00012 TtSemiLepHypGeom::buildHypo(edm::Event& evt,
00013                             const edm::Handle<edm::View<reco::RecoCandidate> >& leps,
00014                             const edm::Handle<std::vector<pat::MET> >& mets, 
00015                             const edm::Handle<std::vector<pat::Jet> >& jets, 
00016                             std::vector<int>& match, const unsigned int iComb)
00017 {
00018   // -----------------------------------------------------
00019   // add jets
00020   // -----------------------------------------------------
00021   for(unsigned idx=0; idx<match.size(); ++idx){
00022     if( isValid(match[idx], jets) ){
00023       switch(idx){
00024       case TtSemiLepEvtPartons::LightQ:
00025         setCandidate(jets, match[idx], lightQ_,    jetCorrectionLevel("wQuarkMix")); break;
00026       case TtSemiLepEvtPartons::LightQBar:
00027         setCandidate(jets, match[idx], lightQBar_, jetCorrectionLevel("wQuarkMix")); break;
00028       case TtSemiLepEvtPartons::HadB:
00029         setCandidate(jets, match[idx], hadronicB_, jetCorrectionLevel("bQuark")); break;
00030       case TtSemiLepEvtPartons::LepB: 
00031         setCandidate(jets, match[idx], leptonicB_, jetCorrectionLevel("bQuark")); break;
00032       }
00033     }
00034   }
00035 
00036   // -----------------------------------------------------
00037   // add lepton
00038   // -----------------------------------------------------
00039   if( leps->empty() )
00040     return;
00041   setCandidate(leps, 0, lepton_);
00042   match.push_back( 0 );
00043   
00044   // -----------------------------------------------------
00045   // add neutrino
00046   // -----------------------------------------------------
00047   if( mets->empty() )
00048     return;
00049   if(neutrinoSolutionType_ == -1)
00050     setCandidate(mets, 0, neutrino_);
00051   else
00052     setNeutrino(mets, leps, 0, neutrinoSolutionType_);
00053 }