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);
62 if (candVertices.isValid()) {
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++) {
122 if ((*pf2pc)[trackRef].isNonnull() && (*pf2pc)[trackRef]->numberOfHits() > 0) {
125 if ((*pf2pc2)[trackRef].isNonnull()) {
128 edm::LogError(
"PATSecondaryVertexSlimmer") <<
"HELPME" << std::endl;
const edm::EDGetTokenT< std::vector< reco::Vertex > > srcLegacy_
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > map2_
std::vector< pat::PackedCandidate > PackedCandidateCollection
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > map_
Log< level::Error, false > LogError
PATSecondaryVertexSlimmer(const edm::ParameterSet &)
std::vector< VertexCompositePtrCandidate > VertexCompositePtrCandidateCollection
collection of Candidate objects
const edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > srcV0s_
~PATSecondaryVertexSlimmer() override
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< reco::VertexCompositePtrCandidateCollection > src_
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>