|
|
Go to the documentation of this file.
26 algorithm_(iConfig.getParameter<
int>(
"Algorithm")),
27 qualityCutsPSet_(iConfig.getParameter<
edm::
ParameterSet>(
"qualityCuts")),
28 useBeamSpot_(iConfig.getParameter<
bool>(
"useBeamSpot")),
29 useSelectedTaus_(iConfig.getParameter<
bool>(
"useSelectedTaus")),
30 removeMuonTracks_(iConfig.getParameter<
bool>(
"RemoveMuonTracks")),
31 removeElectronTracks_(iConfig.getParameter<
bool>(
"RemoveElectronTracks")) {
34 iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"discriminators");
43 newCut->
cut_ =
pset.getParameter<
double>(
"selectionCut");
50 produces<edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::VertexRef>>>();
51 produces<reco::VertexCollection>(
"PFTauPrimaryVertices");
104 auto avPFTauPV = std::make_unique<edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::VertexRef>>>(
106 auto vertexCollection_out = std::make_unique<reco::VertexCollection>();
113 disc->discr_ = &(*discr);
136 bool passedDisc =
true;
137 if (
disc->cutFormula_)
138 passedDisc = (
disc->cutFormula_->Eval((*
disc->discr_)[
tau]) > 0.5);
156 for (
const auto&
pfcand : pfTauRef->signalChargedHadrCands()) {
167 if (
muons.isValid()) {
169 if (
muon.track().isNonnull())
180 if (
electron.gsfTrack().isNonnull())
187 std::vector<const reco::Track*> nonTauTracks;
193 std::vector<reco::TransientTrack> transTracks;
194 transTracks.reserve(nonTauTracks.size());
195 for (
const auto track : nonTauTracks) {
196 transTracks.push_back(transTrackBuilder->
build(*
track));
199 if (transTracks.size() >= 2) {
203 transVtx = avf.
vertex(transTracks);
211 if (!std::isfinite(transVtx.
position().
z()))
220 vertexCollection_out->push_back(thePV);
221 avPFTauPV->setValue(iPFTau, vtxRef);
235 vpsd1.
add<
double>(
"selectionCut");
236 desc.addVPSet(
"discriminators", vpsd1);
244 desc.add<
int>(
"Algorithm", 0);
245 desc.add<
bool>(
"RemoveElectronTracks",
false);
246 desc.add<
bool>(
"RemoveMuonTracks",
false);
247 desc.add<
bool>(
"useBeamSpot",
true);
248 desc.add<
bool>(
"useSelectedTaus",
false);
reco::TrackRef trackRef() const
std::unique_ptr< StringCutObjectSelector< reco::PFTau > > cut_
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ParameterSet qualityCutsPSet_
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< std::vector< reco::PFTau > > pftauToken_
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
GlobalPoint position() const
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
virtual void nonTauTracksInPV(const reco::VertexRef &, const std::vector< edm::Ptr< reco::TrackBase > > &, std::vector< const reco::Track * > &)=0
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
~PFTauPrimaryVertexProducerBase() override
virtual void beginEvent(const edm::Event &, const edm::EventSetup &)
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
void produce(edm::Event &, const edm::EventSetup &) override
PFTauPrimaryVertexProducerBase(const edm::ParameterSet &iConfig)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
reco::GsfTrackRef gsfTrackRef() const
bool isNonnull() const
Checks for non-null.
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
edm::EDGetTokenT< edm::View< reco::Electron > > electronToken_
static void fillDescriptions(edm::ParameterSetDescription &descriptions)
Declare all parameters read from python config file.
void setWeightThreshold(float w)
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
static edm::ParameterSetDescription getDescriptionsBase()
std::vector< Vertex > VertexCollection
bool isNonnull() const
Checks for non-null.
T getParameter(std::string const &) const
bool removeElectronTracks_
Particle reconstructed by the particle flow algorithm.
reco::TransientTrack build(const reco::Track *p) const
DiscCutPairVec discriminators_
edm::EDGetTokenT< reco::PFTauDiscriminator > inputToken_
std::unique_ptr< reco::tau::RecoTauVertexAssociator > vertexAssociator_
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_