21 #include "TLorentzVector.h" 34 booleanOutput = iConfig.
getParameter<
bool>(
"BooleanOutput");
46 double threeProngFlightPathSig(
const PFTauRef&)
const ;
61 vertexAssociator_->setEvent(iEvent);
66 transientTrackBuilder = builder.
product();
72 if(booleanOutput)
return ( threeProngFlightPathSig(tau) >
flightPathSig ? 1. : 0. );
73 return threeProngFlightPathSig(tau);
78 double flightPathSignificance = 0;
82 if (primaryVertex.
isNull()) {
83 edm::LogError(
"FlightPathSignficance") <<
"Could not get vertex associated" 84 <<
" to tau, returning -999!" << std::endl;
89 vector<TransientTrack> transientTracks;
90 for(
const auto& pfSignalCand : tau->signalPFChargedHadrCands()){
91 if(pfSignalCand->trackRef().isNonnull()){
92 const TransientTrack transientTrack = transientTrackBuilder->build(pfSignalCand->trackRef());
93 transientTracks.push_back(transientTrack);
95 else if(pfSignalCand->gsfTrackRef().isNonnull()){
96 const TransientTrack transientTrack = transientTrackBuilder->build(pfSignalCand->gsfTrackRef());
97 transientTracks.push_back(transientTrack);
100 if(transientTracks.size() > 1){
111 flightPathSignificance = vertexSignificance(primaryVertexNonConst,secVer,tauDir);
114 return flightPathSignificance;
126 desc.
add<
double>(
"flightPathSig", 1.5);
128 desc.
add<
bool>(
"BooleanOutput",
true);
135 psd1.
add<
double>(
"cut");
141 desc.
add<
bool>(
"UsePVerror",
true);
142 descriptions.
add(
"pfRecoTauDiscriminationByFlightPathSignificance", desc);
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void beginEvent(const edm::Event &, const edm::EventSetup &) override
static Measurement1D computeDist3d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
double vertexSignificance(reco::Vertex const &, reco::Vertex const &, GlobalVector const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PFRecoTauDiscriminationByFlightPathSignificance(const ParameterSet &iConfig)
double threeProngFlightPathSig(const PFTauRef &) const
#define DEFINE_FWK_MODULE(type)
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const TransientTrackBuilder * transientTrackBuilder
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNull() const
Checks for null.
double significance() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
reco::tau::RecoTauVertexAssociator * vertexAssociator_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double discriminate(const reco::PFTauRef &) const override
T const * product() const
~PFRecoTauDiscriminationByFlightPathSignificance() override