56 const std::vector<reco::PFCandidatePtr>& signalTracks =
57 tau->signalPFChargedHadrCands();
58 std::vector<reco::TransientTrack> signalTransTracks;
59 std::vector<reco::TrackRef> signalTrackPtrs;
60 for(
auto const& pftrack : signalTracks) {
61 if (pftrack->trackRef().isNonnull()) {
62 signalTransTracks.push_back(
64 signalTrackPtrs.push_back(pftrack->trackRef());
71 std::vector<reco::TrackRef> pvTrackRefs;
77 std::sort(signalTrackPtrs.begin(), signalTrackPtrs.end());
78 std::sort(pvTrackRefs.begin(), pvTrackRefs.end());
79 std::vector<reco::TrackRef> uniquePVTracks;
80 uniquePVTracks.reserve(pvTrackRefs.size());
81 std::set_difference(pvTrackRefs.begin(), pvTrackRefs.end(),
82 signalTrackPtrs.begin(), signalTrackPtrs.end(),
83 std::back_inserter(uniquePVTracks));
85 if (uniquePVTracks.size() != pvTrackRefs.size()) {
86 std::vector<reco::TransientTrack> pvTransTracks;
88 for(
auto const&
track : pvTrackRefs) {
100 GlobalVector direction = (tau->signalPFCands().size() == 1 ?
102 tau->jetRef()->px(), tau->jetRef()->py(), tau->jetRef()->pz()) :
106 if (signalTransTracks.size() == 1) {
108 std::pair<bool,Measurement1D> ipsig =
111 return ipsig.second.significance();
114 }
else if (signalTransTracks.size() == 3) {
119 pv, sv, direction,
true);
122 if (significance > 40)
124 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)
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_
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
~PFRecoTauDiscriminationByFlight() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double significance() const
double discriminate(const reco::PFTauRef &) const override
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