14 if (prov == 0)
throw cms::Exception(
"CorruptData") <<
"Vertex handle doesn't have provenance.";
17 bool is_primary_available =
false;
21 for (std::vector<edm::BranchID>::const_iterator it = parents.begin(), ed = parents.end(); it != ed; ++it) {
24 parent_prov = &parprov;
26 is_primary_available =
true;
30 }
else is_primary_available =
true;
31 if (is_primary_available) prov = parent_prov;
32 else throw cms::Exception(
"Configuration") <<
"Vertices to re-produce don't come from a PrimaryVertexProducer \n";
38 bool foundTracks =
false;
39 bool foundBeamSpot =
false;
40 for (std::vector<edm::BranchID>::const_iterator it = parents.begin(), ed = parents.end(); it != ed; ++it) {
45 if (parprov.
moduleLabel() !=
"generalTracks") foundTracks =
false;
49 if (parprov.
moduleLabel() !=
"offlineBeamSpot") foundBeamSpot =
false;
52 if (!foundTracks || !foundBeamSpot) {
55 "Can't find correct parentage info for vertex collection inputs: " << (foundTracks ?
"" :
"generalTracks ") << (foundBeamSpot ?
"" :
"offlineBeamSpot") <<
"\n";
69 std::vector<TransientVertex>
77 std::vector<reco::TransientTrack> t_tks; t_tks.reserve(tracks.size());
78 for (reco::TrackCollection::const_iterator it = tracks.begin(), ed = tracks.end(); it != ed; ++it) {
79 t_tks.push_back((*theB).build(*it));
80 t_tks.back().setBeamSpot(bs);
83 return algo_->vertices(t_tks, bs,
"AdaptiveVertexFitter");
T getParameter(std::string const &) const
std::auto_ptr< PrimaryVertexProducerAlgorithm > algo_
std::vector< Track > TrackCollection
collection of Tracks
ProductProvenance const * productProvenance() const
std::string const & processName() const
std::vector< BranchID > const & parents() const
OniaVtxReProducer(const edm::Handle< reco::VertexCollection > &configFromOriginalVertexCollection, const edm::Event &iEvent)
This is the real constructor to be used.
std::string moduleName(Provenance const &provenance)
std::vector< TransientVertex > makeVertices(const reco::TrackCollection &tracks, const reco::BeamSpot &bs, const edm::EventSetup &iSetup) const
Make the vertices.
void configure(const edm::ParameterSet &iConfig)
std::string const & friendlyClassName() const
std::string const & moduleLabel() const
edm::ParameterSet config_
Parentage const & parentage() const
edm::InputTag beamSpotTag_
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const
ParameterSet const & parameterSet(Provenance const &provenance)
Provenance const * provenance() const