42 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
44 iConfig.existsAs<
edm::
InputTag>(
"lostTracksCandidates")
45 ? iConfig.getParameter<
edm::
InputTag>(
"lostTracksCandidates")
47 produces<reco::VertexCompositePtrCandidateCollection>();
53 auto outPtr = std::make_unique<reco::VertexCompositePtrCandidateCollection>();
56 iEvent.getByToken(src_, candVertices);
59 iEvent.getByToken(map_, pf2pc);
63 outPtr->reserve(candVertices->size());
64 for (
unsigned int i = 0,
n = candVertices->size();
i <
n; ++
i) {
67 std::vector<reco::CandidatePtr>
daughters =
v.daughterPtrVector();
70 for (std::vector<reco::CandidatePtr>::const_iterator it =
daughters.begin(); it !=
daughters.end(); ++it) {
71 if ((*pf2pc)[*it].isNonnull() && (*pf2pc)[*it]->numberOfHits() > 0)
85 iEvent.getByToken(map2_, pf2pc2);
93 if (
v.trackWeight(*it) > 0.5) {
94 if ((*pf2pc)[*it].isNonnull() && (*pf2pc)[*it]->numberOfHits() > 0) {
97 if ((*pf2pc2)[*it].isNonnull()) {
100 edm::LogError(
"PATSecondaryVertexSlimmer") <<
"HELPME" << std::endl;
109 iEvent.getByToken(srcV0s_, srcV0s);
112 iEvent.getByToken(map2_, pf2pc2);
114 outPtr->reserve(srcV0s->size());
115 for (
unsigned int i = 0,
n = srcV0s->size();
i <
n; ++
i) {
118 0,
v.p4(),
v.vertex(),
v.vertexCovariance(),
v.vertexChi2(),
v.vertexNdof()));
120 for (
size_t dIdx = 0; dIdx <
v.numberOfDaughters(); dIdx++) {
121 reco::TrackRef trackRef = (dynamic_cast<const reco::RecoChargedCandidate*>(
v.daughter(dIdx)))->track();
122 if ((*pf2pc)[trackRef].isNonnull() && (*pf2pc)[trackRef]->numberOfHits() > 0) {
125 if ((*pf2pc2)[trackRef].isNonnull()) {
128 edm::LogError(
"PATSecondaryVertexSlimmer") <<
"HELPME" << std::endl;