27 if (trackSelectionAlgorithm ==
"filter") {
29 }
else if (trackSelectionAlgorithm ==
"filterWithThreshold") {
32 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " +
33 trackSelectionAlgorithm);
39 if (clusteringAlgorithm ==
"gap") {
42 }
else if (clusteringAlgorithm ==
"DA") {
47 else if (clusteringAlgorithm ==
"DA_vect") {
53 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
57 if (conf.
exists(
"vertexCollections")) {
59 conf.
getParameter<std::vector<edm::ParameterSet> >(
"vertexCollections");
61 for (std::vector<edm::ParameterSet>::const_iterator algoconf = vertexCollections.begin();
62 algoconf != vertexCollections.end();
66 if (fitterAlgorithm ==
"KalmanVertexFitter") {
68 }
else if (fitterAlgorithm ==
"AdaptiveVertexFitter") {
71 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
74 algorithm.
minNdof = algoconf->getParameter<
double>(
"minNdof");
82 <<
"this module's configuration has changed, please update to have a vertexCollections=cms.VPSet parameter.";
86 if (fitterAlgorithm ==
"KalmanVertexFitter") {
88 }
else if (fitterAlgorithm ==
"AdaptiveVertexFitter") {
91 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
124 const std::vector<reco::TransientTrack>&
tracks)
const {
125 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot");
127 return std::vector<TransientVertex>();
135 if ((beamVertexState.
error().
cxx() <= 0.) || (beamVertexState.
error().
cyy() <= 0.) ||
136 (beamVertexState.
error().
czz() <= 0.)) {
152 std::cout <<
" clustering returned " << clusters.size() <<
" clusters from " << seltks.size()
153 <<
" selected tracks" << std::endl;
164 std::vector<TransientVertex>
pvs;
165 for (std::vector<std::vector<reco::TransientTrack> >::const_iterator iclus = clusters.begin();
166 iclus != clusters.end();
169 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
170 v =
algorithm->fitter->vertex(*iclus, beamSpot);
172 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
185 (!validBS || (*(
algorithm->vertexSelector))(
v, beamVertexState)))
190 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" << pvs.size() << std::endl;
194 if (pvs.size() > 1) {
201 std::vector<TransientVertex>
dummy;
T getParameter(std::string const &) const
TrackClusterizerInZ * theTrackClusterizer
T getUntrackedParameter(std::string const &, T const &) const
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
edm::InputTag beamSpotLabel
const AlgebraicSymMatrix33 matrix() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const override
float degreesOfFreedom() const
GlobalPoint position() const
~PrimaryVertexProducerAlgorithm() override
std::vector< algo > algorithms
PrimaryVertexProducerAlgorithm(const edm::ParameterSet &)
TrackFilterForPVFindingBase * theTrackFilter
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
GlobalError error() const
VertexCompatibleWithBeam * vertexSelector
VertexFitter< 5 > * fitter