26 void add(
const std::vector<TrackingParticle>&
particles,
const std::vector<TrackingVertex>&
vertices);
54 NewTrackList_ = std::make_unique<std::vector<TrackingParticle>>();
76 LogDebug(
"PreMixingTrackingParticleWorker") <<
"\n===============> adding pileups from event "<<pep.
principal().
id()<<
" for bunchcrossing "<<pep.
bunchCrossing();
85 add(*inputHandle, *inputVHandle);
94 for(
const auto&
vtx: vertices) {
99 for(
const auto&
track: particles) {
100 const auto& oldRef=
track.parentVertex();
106 Ntrack.setParentVertex( newRef );
107 Ntrack.clearDecayVertices();
110 for(
auto const& vertexRef :
track.decayVertices() ) {
112 Ntrack.addDecayVertex(newRef);
120 for(
size_t iVertex = StartingIndexV; iVertex !=
NewVertexList_->size(); ++iVertex) {
121 auto& vertex = (*NewVertexList_)[iVertex];
124 sourceTrackIndices.reserve(vertex.sourceTracks().size());
125 daughterTrackIndices.reserve(vertex.daughterTracks().size());
126 for(
auto const& ref: vertex.sourceTracks()) sourceTrackIndices.push_back(ref.index());
127 for(
auto const& ref: vertex.daughterTracks()) daughterTrackIndices.push_back(ref.index());
129 vertex.clearParentTracks();
130 vertex.clearDaughterTracks();
132 for(
auto index : sourceTrackIndices ) {
134 vertex.addParentTrack(newRef);
138 for(
auto index : daughterTrackIndices ) {
140 vertex.addDaughterTrack(newRef);
143 sourceTrackIndices.clear();
144 daughterTrackIndices.clear();
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