#include <TauMETAlgo.h>
Public Member Functions | |
virtual void | run (edm::Event &, const edm::EventSetup &, edm::Handle< reco::PFTauCollection >, edm::Handle< reco::CaloJetCollection >, double, double, const JetCorrector &, const std::vector< reco::CaloMET > &, double, double, double, bool, double, bool, double, bool, double, bool, std::vector< reco::CaloMET > *corrMET) |
virtual void | run (edm::Event &, const edm::EventSetup &, edm::Handle< reco::PFTauCollection >, edm::Handle< reco::CaloJetCollection >, double, double, const JetCorrector &, const std::vector< reco::MET > &, double, double, double, bool, double, bool, double, bool, double, bool, std::vector< reco::MET > *corrMET) |
TauMETAlgo () | |
virtual | ~TauMETAlgo () |
Definition at line 31 of file TauMETAlgo.h.
TauMETAlgo::TauMETAlgo | ( | ) |
Definition at line 14 of file TauMETAlgo.cc.
{}
TauMETAlgo::~TauMETAlgo | ( | ) | [virtual] |
Definition at line 15 of file TauMETAlgo.cc.
{}
void TauMETAlgo::run | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup, | ||
edm::Handle< reco::PFTauCollection > | tauHandle, | ||
edm::Handle< reco::CaloJetCollection > | calojetHandle, | ||
double | jetPTthreshold, | ||
double | jetEMfracLimit, | ||
const JetCorrector & | correctedjets, | ||
const std::vector< reco::CaloMET > & | uncorMET, | ||
double | jetMatchDeltaR, | ||
double | tauMinEt, | ||
double | tauEtaMax, | ||
bool | useSeedTrack, | ||
double | seedTrackPt, | ||
bool | useTrackIsolation, | ||
double | trackIsolationMinPt, | ||
bool | useECALIsolation, | ||
double | gammaIsolationMinPt, | ||
bool | useProngStructure, | ||
std::vector< reco::CaloMET > * | corrMET | ||
) | [virtual] |
Definition at line 17 of file TauMETAlgo.cc.
References edm::RefVector< C, T, F >::begin(), dtNoiseDBValidation_cfg::cerr, JetCorrector::correction(), delta, deltaR(), edm::RefVector< C, T, F >::end(), reco::CaloMET::getSpecific(), reco::MET::mEtCorr(), CorrMETData::mex, CorrMETData::mey, reco::LeafCandidate::px(), reco::LeafCandidate::py(), query::result, mathSSE::sqrt(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().
Referenced by cms::TauMET::produce().
{ // std::cerr << "TauMETAlgo::run -> Test.. " << std::endl; double DeltaPx = 0.0; double DeltaPy = 0.0; double DeltaSumET = 0.0; for(PFTauCollection::size_type iPFTau=0;iPFTau<tauHandle->size();iPFTau++) { PFTauRef thePFTau(tauHandle,iPFTau); bool matchFlag = false; bool goodTau = false; if((fabs(thePFTau->eta()) <= tauEtaMax) && (thePFTau->et() >= tauMinEt)) { goodTau = true; if(useSeedTrack) { if(!(thePFTau->leadPFChargedHadrCand())) {goodTau = false;} else { if(thePFTau->leadPFChargedHadrCand()->et() < seedTrackPt) {goodTau = false;} } } if(useTrackIsolation) { PFCandidateRefVector PFTauProdIsolCHCands = (*thePFTau).isolationPFChargedHadrCands(); for(PFCandidateRefVector::const_iterator iChargedHadrCand=PFTauProdIsolCHCands.begin(); iChargedHadrCand!=PFTauProdIsolCHCands.end();++iChargedHadrCand) { if((**iChargedHadrCand).pt() > trackIsolationMinPt) {goodTau = false;} } } if(useECALIsolation) { PFCandidateRefVector PFTauProdIsolGammaCands = (*thePFTau).isolationPFGammaCands(); for(PFCandidateRefVector::const_iterator iGammaCand=PFTauProdIsolGammaCands.begin(); iGammaCand!=PFTauProdIsolGammaCands.end();++iGammaCand) { if((**iGammaCand).et() > gammaIsolationMinPt) {goodTau = false;} } } if(useProngStructure) { if((thePFTau->signalPFChargedHadrCands().size() != 1) && (thePFTau->signalPFChargedHadrCands().size() != 3)) {goodTau = false;} } } if(goodTau) { for(CaloJetCollection::const_iterator calojetIter = calojetHandle->begin();calojetIter != calojetHandle->end();++calojetIter) { if(deltaR(calojetIter->p4(),thePFTau->p4())<jetMatchDeltaR) { if( calojetIter->pt() > jetPTthreshold && calojetIter->emEnergyFraction() < jetEMfracLimit ) { double correct = correctedjets.correction (*calojetIter); DeltaPx += ((correct * calojetIter->px()) - thePFTau->px()); DeltaPy += ((correct * calojetIter->py()) - thePFTau->py()); DeltaSumET += ((correct * calojetIter->et()) - thePFTau->et()); } else { DeltaPx += (calojetIter->px() - thePFTau->px()); DeltaPy += (calojetIter->py() - thePFTau->py()); DeltaSumET += (calojetIter->et() - thePFTau->et()); } if(matchFlag) {std::cerr << "### TauMETAlgo - ERROR: Multiple jet matches!!!! " << std::endl;} matchFlag = true; } } } } CorrMETData delta; delta.mex = DeltaPx; delta.mey = DeltaPy; delta.sumet = - DeltaSumET; const CaloMET* u = &(uncorMET.front()); double corrMetPx = u->px() + delta.mex; double corrMetPy = u->py() + delta.mey; MET::LorentzVector correctedMET4vector( corrMetPx, corrMetPy, 0., sqrt(corrMetPx*corrMetPx + corrMetPy*corrMetPy)); std::vector<CorrMETData> corrections = u->mEtCorr(); corrections.push_back(delta); CaloMET result; result = CaloMET(u->getSpecific(), (u->sumEt() + delta.sumet), corrections, correctedMET4vector, u->vertex()); corrMET->push_back(result); }
void TauMETAlgo::run | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup, | ||
edm::Handle< reco::PFTauCollection > | tauHandle, | ||
edm::Handle< reco::CaloJetCollection > | calojetHandle, | ||
double | jetPTthreshold, | ||
double | jetEMfracLimit, | ||
const JetCorrector & | correctedjets, | ||
const std::vector< reco::MET > & | uncorMET, | ||
double | jetMatchDeltaR, | ||
double | tauMinEt, | ||
double | tauEtaMax, | ||
bool | useSeedTrack, | ||
double | seedTrackPt, | ||
bool | useTrackIsolation, | ||
double | trackIsolationMinPt, | ||
bool | useECALIsolation, | ||
double | gammaIsolationMinPt, | ||
bool | useProngStructure, | ||
std::vector< reco::MET > * | corrMET | ||
) | [virtual] |
Definition at line 93 of file TauMETAlgo.cc.
References edm::RefVector< C, T, F >::begin(), dtNoiseDBValidation_cfg::cerr, JetCorrector::correction(), delta, deltaR(), edm::RefVector< C, T, F >::end(), reco::MET::mEtCorr(), CorrMETData::mex, CorrMETData::mey, reco::LeafCandidate::px(), reco::LeafCandidate::py(), query::result, mathSSE::sqrt(), CorrMETData::sumet, reco::MET::sumEt(), and reco::LeafCandidate::vertex().
{ std::cerr << "TauMETAlgo::run -> Test.. " << std::endl; double DeltaPx = 0.0; double DeltaPy = 0.0; double DeltaSumET = 0.0; for(PFTauCollection::size_type iPFTau=0;iPFTau<tauHandle->size();iPFTau++) { PFTauRef thePFTau(tauHandle,iPFTau); bool matchFlag = false; bool goodTau = false; if((fabs(thePFTau->eta()) <= tauEtaMax) && (thePFTau->et() >= tauMinEt)) { goodTau = true; if(useSeedTrack) { if(!(thePFTau->leadPFChargedHadrCand())) {goodTau = false;} else { if(thePFTau->leadPFChargedHadrCand()->et() < seedTrackPt) {goodTau = false;} } } if(useTrackIsolation) { PFCandidateRefVector PFTauProdIsolCHCands = (*thePFTau).isolationPFChargedHadrCands(); for(PFCandidateRefVector::const_iterator iChargedHadrCand=PFTauProdIsolCHCands.begin(); iChargedHadrCand!=PFTauProdIsolCHCands.end();++iChargedHadrCand) { if((**iChargedHadrCand).pt() > trackIsolationMinPt) {goodTau = false;} } } if(useECALIsolation) { PFCandidateRefVector PFTauProdIsolGammaCands = (*thePFTau).isolationPFGammaCands(); for(PFCandidateRefVector::const_iterator iGammaCand=PFTauProdIsolGammaCands.begin(); iGammaCand!=PFTauProdIsolGammaCands.end();++iGammaCand) { if((**iGammaCand).et() > gammaIsolationMinPt) {goodTau = false;} } } if(useProngStructure) { if((thePFTau->signalPFChargedHadrCands().size() != 1) && (thePFTau->signalPFChargedHadrCands().size() != 3)) {goodTau = false;} } } if(goodTau) { for(CaloJetCollection::const_iterator calojetIter = calojetHandle->begin();calojetIter != calojetHandle->end();++calojetIter) { if(deltaR(calojetIter->p4(),thePFTau->p4())<jetMatchDeltaR) { if( calojetIter->pt() > jetPTthreshold && calojetIter->emEnergyFraction() < jetEMfracLimit ) { double correct = correctedjets.correction (*calojetIter); DeltaPx += ((correct * calojetIter->px()) - thePFTau->px()); DeltaPy += ((correct * calojetIter->py()) - thePFTau->py()); DeltaSumET += ((correct * calojetIter->et()) - thePFTau->et()); } else { DeltaPx += (calojetIter->px() - thePFTau->px()); DeltaPy += (calojetIter->py() - thePFTau->py()); DeltaSumET += (calojetIter->et() - thePFTau->et()); } if(matchFlag) {std::cerr << "### TauMETAlgo - ERROR: Multiple jet matches!!!! " << std::endl;} matchFlag = true; } } } } CorrMETData delta; delta.mex = DeltaPx; delta.mey = DeltaPy; delta.sumet = - DeltaSumET; const MET* u = &(uncorMET.front()); double corrMetPx = u->px() + delta.mex; double corrMetPy = u->py() + delta.mey; MET::LorentzVector correctedMET4vector( corrMetPx, corrMetPy, 0., sqrt(corrMetPx*corrMetPx + corrMetPy*corrMetPy)); std::vector<CorrMETData> corrections = u->mEtCorr(); corrections.push_back(delta); MET result; result = MET((u->sumEt() + delta.sumet), corrections, correctedMET4vector, u->vertex()); corrMET->push_back(result); }