27 std::vector<PileupSummaryInfo>
const &ps,
28 int bunchSpacing)
override;
31 void add(
const std::vector<TrackingParticle> &
particles,
const std::vector<TrackingVertex> &
vertices);
59 NewTrackList_ = std::make_unique<std::vector<TrackingParticle>>();
84 LogDebug(
"PreMixingTrackingParticleWorker") <<
"\n===============> adding pileups from event " 94 add(*inputHandle, *inputVHandle);
99 const std::vector<TrackingVertex> &
vertices) {
105 for (
const auto &
vtx : vertices) {
110 for (
const auto &
track : particles) {
111 const auto &oldRef =
track.parentVertex();
117 Ntrack.setParentVertex(newRef);
118 Ntrack.clearDecayVertices();
121 for (
auto const &vertexRef :
track.decayVertices()) {
123 Ntrack.addDecayVertex(newRef);
132 for (
size_t iVertex = StartingIndexV; iVertex !=
NewVertexList_->size(); ++iVertex) {
133 auto &vertex = (*NewVertexList_)[iVertex];
136 sourceTrackIndices.reserve(vertex.sourceTracks().size());
137 daughterTrackIndices.reserve(vertex.daughterTracks().size());
138 for (
auto const &ref : vertex.sourceTracks())
139 sourceTrackIndices.push_back(ref.index());
140 for (
auto const &ref : vertex.daughterTracks())
141 daughterTrackIndices.push_back(ref.index());
143 vertex.clearParentTracks();
144 vertex.clearDaughterTracks();
146 for (
auto index : sourceTrackIndices) {
148 vertex.addParentTrack(newRef);
152 for (
auto index : daughterTrackIndices) {
154 vertex.addDaughterTrack(newRef);
157 sourceTrackIndices.clear();
158 daughterTrackIndices.clear();
164 std::vector<PileupSummaryInfo>
const &ps,
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
~PreMixingTrackingParticleWorker() override=default
int bunchCrossing() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< TrackingParticle > > TrackSigToken_
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_
PreMixingTrackingParticleWorker(const edm::ParameterSet &ps, edm::ProducerBase &producer, edm::ConsumesCollector &&iC)
TrackingVertexRefProd VertexListRef_
edm::InputTag TrackingParticlePileInputTag_
edm::Ref< TrackingVertexCollection > TrackingVertexRef
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