13 throw cms::Exception(
"CorruptData") <<
"Vertex handle doesn't have provenance.";
16 bool is_primary_available =
false;
20 for (std::vector<edm::BranchID>::const_iterator it = parents.begin(), ed = parents.end(); it != ed; ++it) {
23 parent_prov = &parprov;
25 is_primary_available =
true;
30 is_primary_available =
true;
31 if (is_primary_available)
34 throw cms::Exception(
"Configuration") <<
"Vertices to re-produce don't come from a PrimaryVertexProducer \n";
40 bool foundTracks =
false;
41 bool foundBeamSpot =
false;
42 for (std::vector<edm::BranchID>::const_iterator it = parents.begin(), ed = parents.end(); it != ed; ++it) {
53 foundBeamSpot =
false;
56 if (!foundTracks || !foundBeamSpot) {
59 <<
"Can't find correct parentage info for vertex collection inputs: " << (foundTracks ?
"" :
"generalTracks ")
60 << (foundBeamSpot ?
"" :
"offlineBeamSpot") <<
"\n";
68 algo_ = std::make_unique<PrimaryVertexProducerAlgorithm>(
iConfig);
74 std::vector<reco::TransientTrack> t_tks;
75 t_tks.reserve(tracks.size());
76 for (reco::TrackCollection::const_iterator it = tracks.begin(), ed = tracks.end(); it != ed; ++it) {
77 t_tks.push_back(theB.
build(*it));
78 t_tks.back().setBeamSpot(bs);
81 return algo_->vertices(t_tks, bs,
"AdaptiveVertexFitter");
StableProvenance const & stable() const
std::vector< Track > TrackCollection
collection of Tracks
reco::TransientTrack build(const reco::Track *p) const
auto const & tracks
cannot be loose
ProductProvenance const * productProvenance() const
std::unique_ptr< PrimaryVertexProducerAlgorithm > algo_
std::string const & processName() const
std::vector< BranchID > const & parents() const
std::vector< TransientVertex > makeVertices(const reco::TrackCollection &tracks, const reco::BeamSpot &bs, const TransientTrackBuilder &theB) const
Make the vertices.
OniaVtxReProducer(const edm::Handle< reco::VertexCollection > &configFromOriginalVertexCollection, const edm::Event &iEvent)
This is the real constructor to be used.
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
void configure(const edm::ParameterSet &iConfig)
std::string const & friendlyClassName() const
ProcessHistory const & processHistory() const override
T getParameter(std::string const &) const
std::string const & moduleLabel() const
edm::ParameterSet config_
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
Parentage const & parentage() const
edm::InputTag beamSpotTag_
std::string const & productInstanceName() const
Provenance const & getProvenance(BranchID const &theID) const
Provenance const * provenance() const