56 enum Alg{useInputPV=0, usePVwithMaxSumPt, useTauPV};
69 PFTauTag_(iConfig.getParameter<
edm::
InputTag>(
"PFTauTag")),
72 produces<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef> > > >();
73 produces<VertexCollection>(
"PFTauSecondaryVertices");
83 if (pfCand !=
nullptr) {
104 auto AVPFTauSV = std::make_unique<edm::AssociationVector<PFTauRefProd, std::vector<std::vector<reco::VertexRef>>>>(
PFTauRefProd(Tau));
105 auto VertexCollection_out = std::make_unique<VertexCollection>();
112 std::vector<reco::VertexRef>
SV;
113 if(RefPFTau->decayMode()>=5){
116 std::vector<reco::TransientTrack> transTrk;
118 const std::vector<edm::Ptr<reco::Candidate> >
cands = RefPFTau->signalChargedHadrCands();
119 for (
const auto&
cand : cands) {
120 if (
cand.isNull())
continue;
122 if (track !=
nullptr)
123 transTrk.push_back(transTrackBuilder->
build(*track));
129 if(transTrk.size() > 1) {
130 transVtx = kvf.
vertex(transTrk);
135 if(transVtx.
refittedTracks().size()!=transTrk.size()) FitOk=
false;
137 SV.push_back(
reco::VertexRef(VertexRefProd_out, VertexCollection_out->size()));
138 VertexCollection_out->push_back(transVtx);
141 AVPFTauSV->setValue(iPFTau, SV);
144 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