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();
66 if (fitterAlgorithm ==
"KalmanVertexFitter") {
68 }
else if (fitterAlgorithm ==
"AdaptiveVertexFitter") {
71 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
74 algorithm.minNdof = algoconf->getParameter<
double>(
"minNdof");
75 algorithm.useBeamConstraint = algoconf->getParameter<
bool>(
"useBeamConstraint");
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();
169 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
172 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
179 std::cout <<
"x,y,z=" <<
v.position().x() <<
" " <<
v.position().y() <<
" " <<
v.position().z() << std::endl;
184 if (
v.isValid() && (
v.degreesOfFreedom() >=
algorithm->minNdof) &&
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;