14 double zOffset,
int ntrkMin,
15 bool useError,
double zSeparation,
bool wtAverage,
17 : zOffset_(zOffset), zSeparation_(zSeparation), ntrkMin_(ntrkMin), useError_(useError),
18 wtAverage_(wtAverage),
19 divmeth_(zOffset, ntrkMin, useError, zSeparation, wtAverage),
43 for (
unsigned int i=0;
i<trks.
size();
i++) {
44 double vz = trks[
i]->vz();
49 vertexes.push_back(
v);
56 std::vector< PVCluster >
in;
57 std::pair< std::vector< PVCluster >, std::vector< const reco::Track* > >
out;
61 std::map< const reco::Track*, reco::TrackRef > mapa;
63 for (
unsigned int i=0;
i<trks.
size(); ++
i) {
64 double vz = trks[
i]->vz();
66 std::vector< const reco::Track* >
temp;
68 temp.push_back( &(*trks[
i]) );
71 mapa[temp[0]] = trks[
i];
75 edm::LogInfo(
"DivisiveVertexFinder") <<
"size of input vector of clusters " << in.size();
76 for (
unsigned int i=0;
i<in.size(); ++
i) {
77 edm::LogInfo(
"DivisiveVertexFinder") <<
"Track " <<
i <<
" addr " << in[
i].tracks()[0]
78 <<
" dz " << in[
i].tracks()[0]->dz(bs)
79 <<
" +- " << in[
i].tracks()[0]->dzError()
80 <<
" prodID " << mapa[in[
i].tracks()[0]].id()
81 <<
" dz from RefTrack " << mapa[in[
i].tracks()[0]]->dz(bs)
82 <<
" +- " << mapa[in[
i].tracks()[0]]->dzError();
91 << out.first.size() <<
" vertexes";
94 for (
unsigned int iv=0; iv<out.first.size(); ++iv) {
96 err(2,2) = out.first[iv].position().error()*out.first[iv].position().error();
99 if (
verbose_ > 0 )
edm::LogInfo(
"DivisiveVertexFinder") <<
" DivisiveClusterizer1D vertex " << iv
100 <<
" has " << out.first[iv].tracks().size()
101 <<
" tracks and a position of " <<
v.z()
103 for (
unsigned int itrk=0; itrk<out.first[iv].tracks().size(); ++itrk) {
106 vertexes.push_back(
v);
pixeltemp::DivisiveClusterizer1D< reco::Track > divmeth_
We use Wolfgang's templated class that implements the actual divisive method.
bool findVertexesAlt(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes, const math::XYZPoint &bs)
PVClusterComparer * pvComparer_
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
math::XYZPoint Point
point in the space
bool findVertexes(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes)
Run the divisive algorithm and return a vector of vertexes for the input track collection.
Measurement1D average(const reco::TrackRefVector &trks) const
Calculate unweighted average of Z of tracks from const collection of track pointers.
XYZPointD XYZPoint
point in space with cartesian internal representation
DivisiveVertexFinder(double track_pt_min, double track_pt_max, double track_chi2_max, double track_prob_min, double zOffset=5.0, int ntrkMin=5, bool useError=true, double zSeparation=0.05, bool wtAverage=true, int verbosity=0)
void setBeamSpot(const math::XYZPoint &bs)
size_type size() const
Size of the RefVector.
Cluster1D< reco::Track > PVCluster
Measurement1D wtAverage(const reco::TrackRefVector &trks) const
Calculate Error-Weighted average of Z of tracks from const collection of track pointers.