00001 /* 00002 class: SignPFSpecificAlgo.cc 00003 description: add the infrastructure to compute the jet-based significance for MET computed with particle flow 00004 authors: A. Khukhunaishvili (Cornell), L. Gibbons (Cornell) 00005 date: 11/11/10 00006 */ 00007 00008 #include "RecoMET/METAlgorithms/interface/SignPFSpecificAlgo.h" 00009 00010 metsig::SignPFSpecificAlgo::SignPFSpecificAlgo(): 00011 resolutions_(0), 00012 algo_() 00013 {clusteredParticlePtrs_.clear();} 00014 00015 metsig::SignPFSpecificAlgo::~SignPFSpecificAlgo(){} 00016 00017 void 00018 metsig::SignPFSpecificAlgo::setResolutions( metsig::SignAlgoResolutions *resolutions) { 00019 resolutions_ = resolutions; 00020 } 00021 00022 00023 void 00024 metsig::SignPFSpecificAlgo::addPFJets(edm::Handle<edm::View<reco::PFJet> > PFJets){ 00025 std::vector<metsig::SigInputObj> vobj; 00026 for(edm::View<reco::PFJet>::const_iterator jet = PFJets->begin(); jet != PFJets->end(); ++jet){ 00027 vobj.push_back(resolutions_->evalPFJet(&(*jet))); 00028 //save jet constituents 00029 std::vector<reco::PFCandidatePtr> pfs = jet->getPFConstituents(); 00030 for(unsigned int i=0; i<pfs.size(); i++) clusteredParticlePtrs_.insert(pfs[i]); 00031 } 00032 algo_.addObjects(vobj); 00033 } 00034 00035 00036 void 00037 metsig::SignPFSpecificAlgo::addPFCandidate(reco::PFCandidatePtr pf){ 00038 if(clusteredParticlePtrs_.find(pf) != clusteredParticlePtrs_.end()) return; //pf candidate already added in jet collection 00039 std::vector<metsig::SigInputObj> vobj; 00040 vobj.push_back(resolutions_->evalPF(&(*pf))); 00041 algo_.addObjects(vobj); 00042 } 00043