31 if(trackSelectionAlgorithm==
"filter"){
33 }
else if (trackSelectionAlgorithm==
"filterWithThreshold"){
36 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " + trackSelectionAlgorithm);
42 if (clusteringAlgorithm==
"gap"){
44 }
else if(clusteringAlgorithm==
"DA"){
48 else if(clusteringAlgorithm ==
"DA_vect") {
54 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
59 if (conf.
exists(
"vertexCollections")){
62 for( std::vector< edm::ParameterSet >::const_iterator algoconf = vertexCollections.begin(); algoconf != vertexCollections.end(); algoconf++){
66 if (fitterAlgorithm==
"KalmanVertexFitter") {
68 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
71 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
74 algorithm.
minNdof = algoconf->getParameter<
double>(
"minNdof");
81 edm::LogWarning(
"MisConfiguration")<<
"this module's configuration has changed, please update to have a vertexCollections=cms.VPSet parameter.";
85 if (fitterAlgorithm==
"KalmanVertexFitter") {
87 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
90 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
123 std::vector<TransientVertex>
127 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot" );
129 return std::vector<TransientVertex>();
133 std::vector<TransientVertex>
146 if ( (beamVertexState.
error().
cxx() <= 0.) ||
147 (beamVertexState.
error().
cyy() <= 0.) ||
148 (beamVertexState.
error().
czz() <= 0.) ) {
166 if (
fVerbose){
std::cout <<
" clustering returned "<< clusters.size() <<
" clusters from " << seltks.size() <<
" selected tracks" <<std::endl;}
171 if ( ! (
algorithm->label == label) )
continue;
177 std::vector<TransientVertex> pvs;
178 for (std::vector< std::vector<reco::TransientTrack> >::const_iterator iclus
179 = clusters.begin(); iclus != clusters.end(); iclus++) {
183 if(
algorithm->useBeamConstraint && validBS &&((*iclus).size()>1) ){
185 v =
algorithm->fitter->vertex(*iclus, beamSpot);
187 }
else if( !(
algorithm->useBeamConstraint) && ((*iclus).size()>1) ) {
196 else std::cout <<
"Invalid fitted vertex\n";
201 && (!validBS || (*(
algorithm->vertexSelector))(
v,beamVertexState))
206 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" << pvs.size() << std::endl;
221 std::vector<TransientVertex>
dummy;
T getParameter(std::string const &) const
TrackClusterizerInZ * theTrackClusterizer
T getUntrackedParameter(std::string const &, T const &) const
vertexCollections
1 cm max separation between clusters
edm::InputTag beamSpotLabel
const AlgebraicSymMatrix33 matrix() const
std::vector< algo > algorithms
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
PrimaryVertexProducerAlgorithm(const edm::ParameterSet &)
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
TrackFilterForPVFindingBase * theTrackFilter
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
GlobalError error() const
VertexCompatibleWithBeam * vertexSelector
VertexFitter< 5 > * fitter