56 enum Alg { useInputPV = 0, usePVwithMaxSumPt, useTauPV };
69 : PFTauTag_(iConfig.getParameter<
edm::
InputTag>(
"PFTauTag")),
71 produces<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef>>>>();
72 produces<VertexCollection>(
"PFTauSecondaryVertices");
80 if (pfCand !=
nullptr) {
101 auto AVPFTauSV = std::make_unique<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef>>>>(
103 auto VertexCollection_out = std::make_unique<VertexCollection>();
110 std::vector<reco::VertexRef>
SV;
111 if (RefPFTau->decayMode() >= 5) {
114 std::vector<reco::TransientTrack> transTrk;
116 const std::vector<edm::Ptr<reco::Candidate>>
cands = RefPFTau->signalChargedHadrCands();
117 for (
const auto&
cand : cands) {
121 if (track !=
nullptr)
122 transTrk.push_back(transTrackBuilder->
build(*track));
128 if (transTrk.size() > 1) {
129 transVtx = kvf.
vertex(transTrk);
138 SV.push_back(
reco::VertexRef(VertexRefProd_out, VertexCollection_out->size()));
139 VertexCollection_out->push_back(transVtx);
142 AVPFTauSV->setValue(iPFTau, SV);
145 iEvent.
put(
std::move(VertexCollection_out),
"PFTauSecondaryVertices");
153 descriptions.
add(
"PFTauSecondaryVertexProducer", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
const edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
PFTauSecondaryVertexProducer(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
reco::TransientTrack build(const reco::Track *p) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
bool hasRefittedTracks() const
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
PFTauSecondaryVertexProducer
reco::TrackRef trackRef() const
#define DEFINE_FWK_MODULE(type)
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
virtual const reco::Track & pseudoTrack() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
RefProd< PROD > getRefBeforePut()
const edm::InputTag PFTauTag_
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
~PFTauSecondaryVertexProducer() override
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Particle reconstructed by the particle flow algorithm.
reco::GsfTrackRef gsfTrackRef() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< reco::TransientTrack > const & refittedTracks() const