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);
58 conf.
getParameter<std::vector<edm::ParameterSet> >(
"vertexCollections");
60 for (std::vector<edm::ParameterSet>::const_iterator algoconf =
vertexCollections.begin();
65 if (fitterAlgorithm ==
"KalmanVertexFitter") {
67 }
else if (fitterAlgorithm ==
"AdaptiveVertexFitter") {
70 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
73 algorithm.minNdof = algoconf->getParameter<
double>(
"minNdof");
74 algorithm.useBeamConstraint = algoconf->getParameter<
bool>(
"useBeamConstraint");
100 const std::vector<reco::TransientTrack>&
tracks)
const {
101 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot");
103 return std::vector<TransientVertex>();
111 if ((beamVertexState.
error().
cxx() <= 0.) || (beamVertexState.
error().
cyy() <= 0.) ||
112 (beamVertexState.
error().
czz() <= 0.)) {
128 std::cout <<
" clustering returned " <<
clusters.size() <<
" clusters from " << seltks.size()
129 <<
" selected tracks" << std::endl;
140 std::vector<TransientVertex>
pvs;
141 for (
std::vector<std::vector<reco::TransientTrack> >::const_iterator iclus =
clusters.begin();
145 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
148 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
155 std::cout <<
"x,y,z=" <<
v.position().x() <<
" " <<
v.position().y() <<
" " <<
v.position().z() << std::endl;
160 if (
v.isValid() && (
v.degreesOfFreedom() >=
algorithm->minNdof) &&
161 (!validBS || (*(
algorithm->vertexSelector))(
v, beamVertexState)))
166 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" <<
pvs.size() << std::endl;
170 if (
pvs.size() > 1) {
177 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