52 enum Alg{useInputPV=0, usePVwithMaxSumPt, useTauPV};
63 PFTauTag_(iConfig.getParameter<edm::
InputTag>(
"PFTauTag")),
64 PFTauToken_(consumes<std::vector<
reco::
PFTau> >(iConfig.getParameter<edm::
InputTag>(
"PFTauTag")))
66 produces<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef> > > >();
67 produces<VertexCollection>(
"PFTauSecondaryVertices");
84 std::auto_ptr<VertexCollection> VertexCollection_out= std::auto_ptr<VertexCollection>(
new 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(VertexCollection_out,
"PFTauSecondaryVertices");
122 iEvent.
put(AVPFTauSV);
const edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
PFTauSecondaryVertexProducer(const edm::ParameterSet &iConfig)
~PFTauSecondaryVertexProducer()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
bool hasRefittedTracks() const
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
RefProd< PROD > getRefBeforePut()
const edm::InputTag PFTauTag_
tuple PFTauSecondaryVertexProducer
std::vector< reco::TransientTrack > const & refittedTracks() const