25 std::vector<PileupSummaryInfo>
const &ps,
26 int bunchSpacing)
override;
29 void add(
const std::vector<TrackingParticle> &
particles,
const std::vector<TrackingVertex> &
vertices);
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) {
103 for (
const auto &
vtx : vertices) {
108 for (
const auto &
track : particles) {
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,
~PreMixingTrackingParticleWorker() override=default
int bunchCrossing() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< TrackingParticle > > TrackSigToken_
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void add(const std::vector< TrackingParticle > &particles, const std::vector< TrackingVertex > &vertices)
EventID const & id() const
std::unique_ptr< std::vector< TrackingParticle > > NewTrackList_
std::string TrackingParticleCollectionDM_
std::unique_ptr< std::vector< TrackingVertex > > NewVertexList_
edm::EventPrincipal const & principal()
TrackingParticleRefProd TrackListRef_
TrackingVertexRefProd VertexListRef_
edm::InputTag TrackingParticlePileInputTag_
edm::Ref< TrackingVertexCollection > TrackingVertexRef
PreMixingTrackingParticleWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
edm::EDGetTokenT< std::vector< TrackingVertex > > VtxSigToken_
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
Monte Carlo truth information used for tracking validation.
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
#define DEFINE_PREMIXING_WORKER(TYPE)
edm::Ref< TrackingParticleCollection > TrackingParticleRef