25 std::vector<PileupSummaryInfo>
const &ps,
26 int bunchSpacing)
override;
29 void add(
const std::vector<TrackingParticle> &
particles,
const std::vector<TrackingVertex> &
vertices);
50 TrackingParticlePileInputTag_(ps.getParameter<
edm::
InputTag>(
"pileInputTag")),
51 TrackingParticleCollectionDM_(ps.getParameter<
std::
string>(
"collectionDM")) {
57 NewTrackList_ = std::make_unique<std::vector<TrackingParticle>>();
82 LogDebug(
"PreMixingTrackingParticleWorker") <<
"\n===============> adding pileups from event "
92 add(*inputHandle, *inputVHandle);
97 const std::vector<TrackingVertex> &
vertices) {
109 const auto &oldRef =
track.parentVertex();
115 Ntrack.setParentVertex(newRef);
116 Ntrack.clearDecayVertices();
119 for (
auto const &vertexRef :
track.decayVertices()) {
121 Ntrack.addDecayVertex(newRef);
130 for (
size_t iVertex = StartingIndexV; iVertex !=
NewVertexList_->size(); ++iVertex) {
131 auto &
vertex = (*NewVertexList_)[iVertex];
134 sourceTrackIndices.reserve(
vertex.sourceTracks().size());
135 daughterTrackIndices.reserve(
vertex.daughterTracks().size());
136 for (
auto const &ref :
vertex.sourceTracks())
137 sourceTrackIndices.push_back(ref.index());
138 for (
auto const &ref :
vertex.daughterTracks())
139 daughterTrackIndices.push_back(ref.index());
141 vertex.clearParentTracks();
142 vertex.clearDaughterTracks();
144 for (
auto index : sourceTrackIndices) {
146 vertex.addParentTrack(newRef);
150 for (
auto index : daughterTrackIndices) {
152 vertex.addDaughterTrack(newRef);
155 sourceTrackIndices.clear();
156 daughterTrackIndices.clear();
162 std::vector<PileupSummaryInfo>
const &ps,