51 iConfig.getParameter<
edm::
InputTag>(
"slimmedSecondaryVertices"))),
54 produces<reco::TrackCollection>();
55 produces<reco::VertexCollection>();
56 produces<reco::VertexCollection>(
"secondary");
74 auto outTks = std::make_unique<std::vector<reco::Track>>();
75 std::map<unsigned int, std::vector<unsigned int>> asso;
76 std::map<unsigned int, unsigned int> trackKeys;
78 for (
unsigned int i = 0;
i < cands->size();
i++) {
82 for (
size_t ipv = 0; ipv < pvs->size(); ++ipv) {
84 asso[ipv].push_back(j);
92 for (
unsigned int i = 0;
i < addTracks->size();
i++) {
93 if ((*addTracks)[
i].hasTrackDetails()) {
94 outTks->push_back((*addTracks)[
i].pseudoTrack());
95 for (
size_t ipv = 0; ipv < pvs->size(); ++ipv) {
97 asso[ipv].push_back(j);
105 auto outPv = std::make_unique<std::vector<reco::Vertex>>();
107 for (
size_t ipv = 0; ipv < pvs->size(); ++ipv) {
109 for (
unsigned int i = 0;
i < asso[ipv].size();
i++) {
114 outPv->push_back(pv);
118 auto outSv = std::make_unique<std::vector<reco::Vertex>>();
119 for (
size_t i = 0;
i < svs->size();
i++) {
132 outSv->back().add(rr);
const edm::EDGetTokenT< reco::VertexCollection > PVs_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double vertexNdof() const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< std::vector< pat::PackedCandidate > > Cands_
std::vector< pat::PackedCandidate > PackedCandidateCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
std::vector< VertexCompositePtrCandidate > VertexCompositePtrCandidateCollection
collection of Candidate objects
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
size_t numberOfDaughters() const override
number of daughters
~PATTrackAndVertexUnpacker() override
int charge() const override
electric charge
#define DEFINE_FWK_MODULE(type)
const PVAssoc fromPV(size_t ipv=0) const
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 3
const Point & vertex() const override
vertex position (overwritten by PF...)
virtual const reco::Track & pseudoTrack() const
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
const edm::EDGetTokenT< std::vector< pat::PackedCandidate > > AdditionalTracks_
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
const edm::EDGetTokenT< reco::VertexCompositePtrCandidateCollection > SVs_
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
ProductID id() const
Accessor for product ID.
std::vector< edm::InputTag > VInputTag
PATTrackAndVertexUnpacker(const edm::ParameterSet &iConfig)
double vertexChi2() const override
chi-squares