52 enum Alg{useInputPV=0, usePVwithMaxSumPt, useTauPV};
63 PFTauTag_(iConfig.getParameter<
edm::
InputTag>(
"PFTauTag")),
66 produces<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef> > > >();
67 produces<VertexCollection>(
"PFTauSecondaryVertices");
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()));
106 if(transTrk.size() > 1) {
108 transVtx = kvf.
vertex(transTrk);
116 if(transVtx.
refittedTracks().size()!=transTrk.size()) FitOk=
false;
118 SV.push_back(
reco::VertexRef(VertexRefProd_out, VertexCollection_out->size()));
119 VertexCollection_out->push_back(transVtx);
122 AVPFTauSV->setValue(iPFTau, SV);
125 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_
PFTauSecondaryVertexProducer(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
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
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
RefProd< PROD > getRefBeforePut()
const edm::InputTag PFTauTag_
~PFTauSecondaryVertexProducer() override
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
std::vector< reco::TransientTrack > const & refittedTracks() const