00001 #include "RecoTauTag/TauTagTools/interface/PFTauQualityCutWrapper.h"
00002
00003
00004
00005
00006
00007 using namespace reco;
00008
00009 void
00010 PFTauQualityCutWrapper::isolationChargedObjects(const PFTau& pfTau, const Vertex& pv, std::vector<reco::LeafCandidate>& output)
00011 {
00012 if( isoQCuts.useTracksInsteadOfPF )
00013 {
00014 TrackRefVector result = TauTagTools::filteredTracks(pfTau.isolationTracks(),
00015 isoQCuts.minTrackPt,
00016 isoQCuts.minTrackPixelHits,
00017 isoQCuts.minTrackHits,
00018 isoQCuts.maxTransverseImpactParameter,
00019 isoQCuts.maxTrackChi2,
00020 isoQCuts.maxDeltaZ,
00021 pv,
00022 pv.position().z() );
00023
00024 size_t nTracks = result.size();
00025 for(size_t iTrack = 0; iTrack < nTracks; ++iTrack)
00026 {
00027
00028 int charge = result[iTrack]->charge();
00029 math::XYZVector p3 = result[iTrack]->momentum();
00030 reco::Particle::LorentzVector p4(p3.R(), p3.x(), p3.y(), p3.z());
00031 output.push_back(reco::LeafCandidate(charge, p4));
00032 }
00033 } else
00034 {
00035 PFCandidateRefVector result = TauTagTools::filteredPFChargedHadrCands(pfTau.isolationPFChargedHadrCands(),
00036 isoQCuts.minTrackPt,
00037 isoQCuts.minTrackPixelHits,
00038 isoQCuts.minTrackHits,
00039 isoQCuts.maxTransverseImpactParameter,
00040 isoQCuts.maxTrackChi2,
00041 isoQCuts.maxDeltaZ,
00042 pv,
00043 pv.position().z() );
00044
00045 size_t nTracks = result.size();
00046 for(size_t iTrack = 0; iTrack < nTracks; ++iTrack)
00047 {
00048 output.push_back(reco::LeafCandidate(result[iTrack]->charge(), result[iTrack]->p4()));
00049 }
00050 }
00051
00052 }
00053
00054 void
00055 PFTauQualityCutWrapper::isolationGammaObjects(const PFTau& pfTau, std::vector<reco::LeafCandidate>& output)
00056 {
00057 PFCandidateRefVector result = TauTagTools::filteredPFGammaCands(pfTau.isolationPFGammaCands(), isoQCuts.minGammaEt);
00058
00059 size_t nGammas = result.size();
00060 for(size_t iGamma = 0; iGamma < nGammas; ++iGamma)
00061 {
00062 output.push_back(reco::LeafCandidate(result[iGamma]->charge(), result[iGamma]->p4()));
00063 }
00064
00065 }
00066
00067
00068
00069
00070
00071 void
00072 PFTauQualityCutWrapper::signalChargedObjects(const PFTau& pfTau, const Vertex& pv, std::vector<reco::LeafCandidate>& output)
00073 {
00074 if( signalQCuts.useTracksInsteadOfPF )
00075 {
00076 TrackRefVector result = TauTagTools::filteredTracks(pfTau.signalTracks(),
00077 signalQCuts.minTrackPt,
00078 signalQCuts.minTrackPixelHits,
00079 signalQCuts.minTrackHits,
00080 signalQCuts.maxTransverseImpactParameter,
00081 signalQCuts.maxTrackChi2,
00082 signalQCuts.maxDeltaZ,
00083 pv,
00084 pv.position().z() );
00085
00086 size_t nTracks = result.size();
00087 for(size_t iTrack = 0; iTrack < nTracks; ++iTrack)
00088 {
00089
00090 int charge = result[iTrack]->charge();
00091 math::XYZVector p3 = result[iTrack]->momentum();
00092 reco::Particle::LorentzVector p4(p3.R(), p3.x(), p3.y(), p3.z());
00093 output.push_back(reco::LeafCandidate(charge, p4));
00094 }
00095 } else
00096 {
00097 PFCandidateRefVector result = TauTagTools::filteredPFChargedHadrCands(pfTau.signalPFChargedHadrCands(),
00098 signalQCuts.minTrackPt,
00099 signalQCuts.minTrackPixelHits,
00100 signalQCuts.minTrackHits,
00101 signalQCuts.maxTransverseImpactParameter,
00102 signalQCuts.maxTrackChi2,
00103 signalQCuts.maxDeltaZ,
00104 pv,
00105 pv.position().z() );
00106
00107 size_t nTracks = result.size();
00108 for(size_t iTrack = 0; iTrack < nTracks; ++iTrack)
00109 {
00110 output.push_back(reco::LeafCandidate(result[iTrack]->charge(), result[iTrack]->p4()));
00111 }
00112 }
00113
00114 }
00115
00116 void
00117 PFTauQualityCutWrapper::signalGammaObjects(const PFTau& pfTau, std::vector<reco::LeafCandidate>& output)
00118 {
00119 PFCandidateRefVector result = TauTagTools::filteredPFGammaCands(pfTau.signalPFGammaCands(), signalQCuts.minGammaEt);
00120
00121 size_t nGammas = result.size();
00122 for(size_t iGamma = 0; iGamma < nGammas; ++iGamma)
00123 {
00124 output.push_back(reco::LeafCandidate(result[iGamma]->charge(), result[iGamma]->p4()));
00125 }
00126
00127 }