52 enum Alg{useInputPV=0, usePVwithMaxSumPt, useTauPV};
63 PFTauToken_(consumes<std::vector<
reco::
PFTau> >(iConfig.getParameter<edm::
InputTag>(
"PFTauTag")))
65 produces<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef> > > >();
66 produces<VertexCollection>(
"PFTauSecondaryVertices");
83 std::auto_ptr<VertexCollection> VertexCollection_out= std::auto_ptr<VertexCollection>(
new VertexCollection);
90 std::vector<reco::VertexRef> SV;
91 if(RefPFTau->decayMode()>=5){
94 std::vector<reco::TransientTrack> transTrk;
96 const std::vector<edm::Ptr<reco::PFCandidate> > cands = RefPFTau->signalPFChargedHadrCands();
98 if(
iter->get()->trackRef().isNonnull())transTrk.push_back(transTrackBuilder->build(
iter->get()->trackRef()));
99 else if(
iter->get()->gsfTrackRef().isNonnull())transTrk.push_back(transTrackBuilder->build(
iter->get()->gsfTrackRef()));
106 transVtx = kvf.
vertex(transTrk);
111 if(transVtx.
refittedTracks().size()!=transTrk.size()) FitOk=
false;
113 SV.push_back(
reco::VertexRef(VertexRefProd_out, VertexCollection_out->size()));
114 VertexCollection_out->push_back(transVtx);
117 AVPFTauSV->setValue(iPFTau, SV);
120 iEvent.
put(VertexCollection_out,
"PFTauSecondaryVertices");
121 iEvent.
put(AVPFTauSV);
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
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
RefProd< PROD > getRefBeforePut()
tuple PFTauSecondaryVertexProducer
std::vector< reco::TransientTrack > const & refittedTracks() const