83 auto AVPFTauSV = std::make_unique<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef>>>>(
PFTauRefProd(Tau));
84 auto VertexCollection_out = std::make_unique<VertexCollection>();
91 std::vector<reco::VertexRef> SV;
92 if(RefPFTau->decayMode()>=5){
95 std::vector<reco::TransientTrack> transTrk;
97 const std::vector<edm::Ptr<reco::PFCandidate> > cands = RefPFTau->signalPFChargedHadrCands();
99 if(iter->get()->trackRef().isNonnull())transTrk.push_back(transTrackBuilder->
build(iter->get()->trackRef()));
100 else if(iter->get()->gsfTrackRef().isNonnull())transTrk.push_back(transTrackBuilder->
build(iter->get()->gsfTrackRef()));
107 transVtx = kvf.vertex(transTrk);
112 if(transVtx.
refittedTracks().size()!=transTrk.size()) FitOk=
false;
114 SV.push_back(
reco::VertexRef(VertexRefProd_out, VertexCollection_out->size()));
115 VertexCollection_out->push_back(transVtx);
118 AVPFTauSV->setValue(iPFTau, SV);
121 iEvent.
put(
std::move(VertexCollection_out),
"PFTauSecondaryVertices");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
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
RefProd< PROD > getRefBeforePut()
std::vector< reco::TransientTrack > const & refittedTracks() const