27 if (trackSelectionAlgorithm ==
"filter") {
29 }
else if (trackSelectionAlgorithm ==
"filterWithThreshold") {
32 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " +
33 trackSelectionAlgorithm);
39 if (clusteringAlgorithm ==
"gap") {
44 else if (clusteringAlgorithm ==
"DA_vect") {
50 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
55 conf.
getParameter<std::vector<edm::ParameterSet> >(
"vertexCollections");
57 for (std::vector<edm::ParameterSet>::const_iterator algoconf =
vertexCollections.begin();
62 if (fitterAlgorithm ==
"KalmanVertexFitter") {
64 }
else if (fitterAlgorithm ==
"AdaptiveVertexFitter") {
67 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
70 algorithm.minNdof = algoconf->getParameter<
double>(
"minNdof");
71 algorithm.useBeamConstraint = algoconf->getParameter<
bool>(
"useBeamConstraint");
97 const std::vector<reco::TransientTrack>&
tracks)
const {
98 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot");
100 return std::vector<TransientVertex>();
108 if ((beamVertexState.
error().
cxx() <= 0.) || (beamVertexState.
error().
cyy() <= 0.) ||
109 (beamVertexState.
error().
czz() <= 0.)) {
125 std::cout <<
" clustering returned " <<
clusters.size() <<
" clusters from " << seltks.size()
126 <<
" selected tracks" << std::endl;
137 std::vector<TransientVertex>
pvs;
138 for (
std::vector<std::vector<reco::TransientTrack> >::const_iterator iclus =
clusters.begin();
142 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
145 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
152 std::cout <<
"x,y,z=" <<
v.position().x() <<
" " <<
v.position().y() <<
" " <<
v.position().z() << std::endl;
157 if (
v.isValid() && (
v.degreesOfFreedom() >=
algorithm->minNdof) &&
158 (!validBS || (*(
algorithm->vertexSelector))(
v, beamVertexState)))
163 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" <<
pvs.size() << std::endl;
167 if (
pvs.size() > 1) {
174 std::vector<TransientVertex>
dummy;
TrackClusterizerInZ * theTrackClusterizer
T getParameter(std::string const &) const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const override
edm::InputTag beamSpotLabel
Log< level::Error, false > LogError
T getUntrackedParameter(std::string const &, T const &) const
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
GlobalError error() const
~PrimaryVertexProducerAlgorithm() override
const AlgebraicSymMatrix33 matrix() const
std::vector< algo > algorithms
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
PrimaryVertexProducerAlgorithm(const edm::ParameterSet &)
TrackFilterForPVFindingBase * theTrackFilter