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");
T getParameter(std::string const &) const
ProductProvenance const * productProvenance() const
std::vector< Track > TrackCollection
collection of Tracks
std::string const & processName() const
std::vector< BranchID > const & parents() const
std::unique_ptr< PrimaryVertexProducerAlgorithm > algo_
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
reco::TransientTrack build(const reco::Track *p) const
OniaVtxReProducer(const edm::Handle< reco::VertexCollection > &configFromOriginalVertexCollection, const edm::Event &iEvent)
This is the real constructor to be used.
std::string const & productInstanceName() const
std::vector< TransientVertex > makeVertices(const reco::TrackCollection &tracks, const reco::BeamSpot &bs, const TransientTrackBuilder &theB) const
Make the vertices.
void configure(const edm::ParameterSet &iConfig)
auto const & tracks
cannot be loose
edm::ParameterSet config_
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
std::string const & moduleLabel() const
edm::InputTag beamSpotTag_
StableProvenance const & stable() const
std::string const & friendlyClassName() const
Parentage const & parentage() const