1 #include <boost/foreach.hpp> 57 const std::vector<reco::PFCandidatePtr>& signalTracks =
58 tau->signalPFChargedHadrCands();
59 std::vector<reco::TransientTrack> signalTransTracks;
60 std::vector<reco::TrackRef> signalTrackPtrs;
63 signalTransTracks.push_back(
65 signalTrackPtrs.push_back(pftrack->trackRef());
72 std::vector<reco::TrackRef> pvTrackRefs;
78 std::sort(signalTrackPtrs.begin(), signalTrackPtrs.end());
79 std::sort(pvTrackRefs.begin(), pvTrackRefs.end());
80 std::vector<reco::TrackRef> uniquePVTracks;
81 uniquePVTracks.reserve(pvTrackRefs.size());
82 std::set_difference(pvTrackRefs.begin(), pvTrackRefs.end(),
83 signalTrackPtrs.begin(), signalTrackPtrs.end(),
84 std::back_inserter(uniquePVTracks));
86 if (uniquePVTracks.size() != pvTrackRefs.size()) {
87 std::vector<reco::TransientTrack> pvTransTracks;
101 GlobalVector direction = (tau->signalPFCands().size() == 1 ?
103 tau->jetRef()->px(), tau->jetRef()->py(), tau->jetRef()->pz()) :
107 if (signalTransTracks.size() == 1) {
109 std::pair<bool,Measurement1D> ipsig =
112 return ipsig.second.significance();
115 }
else if (signalTransTracks.size() == 3) {
120 pv, sv, direction,
true);
123 if (significance > 40)
125 if (significance < -20)
T getParameter(std::string const &) const
edm::Handle< reco::BeamSpot > beamspot_
edm::Handle< reco::VertexCollection > vertices_
PFRecoTauDiscriminationByFlight(const edm::ParameterSet &pset)
trackRef_iterator tracks_end() const
last iterator over tracks
void beginEvent(const edm::Event &evt, const edm::EventSetup &es) override
#define DEFINE_FWK_MODULE(type)
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
reco::TransientTrack build(const reco::Track *p) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
static Measurement1D computeDist2d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
const TransientTrackBuilder * builder_
edm::InputTag vertexSource_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isNonnull() const
Checks for non-null.
double significance() const
double discriminate(const reco::PFTauRef &) const override
virtual ~PFRecoTauDiscriminationByFlight()
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
trackRef_iterator tracks_begin() const
first iterator over tracks
T const * product() const
double prediscriminantFailValue_
Global3DVector GlobalVector