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 #ifdef __GXX_EXPERIMENTAL_CXX0X__
49 else if(clusteringAlgorithm ==
"DA_vect") {
56 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
61 if (conf.
exists(
"vertexCollections")){
62 std::vector<edm::ParameterSet> vertexCollections =conf.
getParameter< std::vector<edm::ParameterSet> >(
"vertexCollections");
64 for( std::vector< edm::ParameterSet >::const_iterator algoconf = vertexCollections.begin(); algoconf != vertexCollections.end(); algoconf++){
68 if (fitterAlgorithm==
"KalmanVertexFitter") {
70 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
73 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
76 algorithm.
minNdof = algoconf->getParameter<
double>(
"minNdof");
83 edm::LogWarning(
"MisConfiguration")<<
"this module's configuration has changed, please update to have a vertexCollections=cms.VPSet parameter.";
87 if (fitterAlgorithm==
"KalmanVertexFitter") {
89 }
else if( fitterAlgorithm==
"AdaptiveVertexFitter") {
92 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + fitterAlgorithm);
125 std::vector<TransientVertex>
129 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot" );
131 return std::vector<TransientVertex>();
135 std::vector<TransientVertex>
148 if ( (beamVertexState.
error().
cxx() <= 0.) ||
149 (beamVertexState.
error().
cyy() <= 0.) ||
150 (beamVertexState.
error().
czz() <= 0.) ) {
168 if (
fVerbose){
std::cout <<
" clustering returned "<< clusters.size() <<
" clusters from " << seltks.size() <<
" selected tracks" <<std::endl;}
173 if ( ! (
algorithm->label == label) )
continue;
179 std::vector<TransientVertex> pvs;
180 for (std::vector< std::vector<reco::TransientTrack> >::const_iterator iclus
181 = clusters.begin(); iclus != clusters.end(); iclus++) {
185 if(
algorithm->useBeamConstraint && validBS &&((*iclus).size()>1) ){
187 v =
algorithm->fitter->vertex(*iclus, beamSpot);
189 }
else if( !(
algorithm->useBeamConstraint) && ((*iclus).size()>1) ) {
198 else std::cout <<
"Invalid fitted vertex\n";
203 && (!validBS || (*(
algorithm->vertexSelector))(
v,beamVertexState))
208 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" << pvs.size() << std::endl;
223 std::vector<TransientVertex> dummy;
T getParameter(std::string const &) const
TrackClusterizerInZ * theTrackClusterizer
T getUntrackedParameter(std::string const &, T const &) const
~PrimaryVertexProducerAlgorithm()
edm::InputTag beamSpotLabel
const AlgebraicSymMatrix33 & matrix() const
std::vector< algo > algorithms
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const =0
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const
float degreesOfFreedom() const
GlobalPoint position() const
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
PrimaryVertexProducerAlgorithm(const edm::ParameterSet &)
TrackFilterForPVFindingBase * theTrackFilter
GlobalError error() const
VertexCompatibleWithBeam * vertexSelector
VertexFitter< 5 > * fitter