26 conf.getParameter<edm::
ParameterSet>(
"PVSelParameters").getParameter<double>(
"maxDistanceToBeam"))
29 <<
"PVSelParameters::maxDistanceToBeam = "
41 if(trackSelectionAlgorithm==
"filter"){
43 }
else if (trackSelectionAlgorithm==
"filterWithThreshold"){
46 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown track selection algorithm: " + trackSelectionAlgorithm);
52 if (clusteringAlgorithm==
"gap"){
54 }
else if(clusteringAlgorithm==
"DA"){
57 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown clustering algorithm: " + clusteringAlgorithm);
63 if (algorithm ==
"TrimmedKalmanFinder") {
66 }
else if (algorithm==
"KalmanVertexFitter") {
68 }
else if( algorithm==
"AdaptiveVertexFitter") {
71 throw VertexException(
"PrimaryVertexProducerAlgorithm: unknown algorithm: " + algorithm);
75 <<
"Using " << algorithm <<
"\n";
80 <<
"PV producer algorithm initialization: done" <<
"\n";
98 std::vector<TransientVertex>
102 throw VertexException(
"PrimaryVertexProducerAlgorithm: cannot make a Primary Vertex without a beam spot constraint " );
108 return std::vector<TransientVertex>();
112 std::vector<TransientVertex>
118 if ( (beamVertexState.
error().
cxx() <= 0.) ||
119 (beamVertexState.
error().
cyy() <= 0.) ||
120 (beamVertexState.
error().
czz() <= 0.) ) {
128 std::vector<TransientVertex> pvs;
137 if (
fVerbose){
std::cout <<
" clustering returned "<< clusters.size() <<
" clusters from " << seltks.size() <<
" selected tracks" <<std::endl;}
141 std::vector<TransientVertex> pvCand;
143 for (std::vector< std::vector<reco::TransientTrack> >::const_iterator iclus
144 = clusters.begin(); iclus != clusters.end(); iclus++) {
149 if (
fVerbose){
std::cout <<
" constrained fit with "<< (*iclus).size() <<
" tracks" <<std::endl;}
155 else std::cout <<
"Invalid fitted vertex\n";
158 }
else if((*iclus).size()>1){
159 if (
fVerbose){
std::cout <<
" unconstrained fit with "<< (*iclus).size() <<
" tracks" << std::endl;}
166 else std::cout <<
"Invalid fitted vertex\n";
176 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" << pvCand.size() << std::endl;
183 for (std::vector<TransientVertex>::const_iterator ipv = pvCand.begin();
184 ipv != pvCand.end(); ipv++) {
186 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices cand " << npv++ <<
" sel=" <<
187 (validBS &&
theVertexSelector(*ipv,beamVertexState)) <<
" z=" << ipv->position().z() << std::endl;
200 std::vector< std::pair< double , unsigned int > > ptsqpv;
201 for(
unsigned int i=0;
i<pvs.size();
i++){ ptsqpv.push_back( std::make_pair(V.
sumPtSquared(pvs.at(
i)),
i));}
202 std::stable_sort(ptsqpv.begin(), ptsqpv.end());
203 std::vector<TransientVertex> pvsorted( pvs.size());
204 for(
unsigned int i=0;
i<pvs.size();
i++){ pvsorted.push_back(pvs.at(ptsqpv[
i].second));}
211 && ( (clusters.size()!=1) || ( (clusters.size()==1) && (clusters.begin()->size()<seltks.size())) )
224 <<
" tracks=" << seltks.size()
T getParameter(std::string const &) const
TrackClusterizerInZ * theTrackClusterizer
T getUntrackedParameter(std::string const &, T const &) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
VertexCompatibleWithBeam theVertexSelector
~PrimaryVertexProducerAlgorithm()
const AlgebraicSymMatrix33 & matrix() const
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const
VertexFitter< 5 > * theFitter
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
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const =0
float degreesOfFreedom() const
GlobalPoint position() const
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
PrimaryVertexProducerAlgorithm(const edm::ParameterSet &)
void setParameters(const edm::ParameterSet &)
TrackFilterForPVFindingBase * theTrackFilter
double sumPtSquared(const reco::Vertex &v) const
KalmanTrimmedVertexFinder theFinder
GlobalError error() const