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),
41 for (
unsigned int i=0;
i<trks.
size();
i++) {
42 double vz = trks[
i]->vz();
47 vertexes.push_back(
v);
54 std::vector< PVCluster >
in;
55 std::pair< std::vector< PVCluster >, std::vector< const reco::Track* > >
out;
59 std::map< const reco::Track*, reco::TrackRef > mapa;
61 for (
unsigned int i=0;
i<trks.
size(); ++
i) {
62 double vz = trks[
i]->vz();
64 std::vector< const reco::Track* >
temp;
66 temp.push_back( &(*trks[
i]) );
69 mapa[temp[0]] = trks[
i];
73 edm::LogInfo(
"DivisiveVertexFinder") <<
"size of input vector of clusters " << in.size();
74 for (
unsigned int i=0;
i<in.size(); ++
i) {
75 edm::LogInfo(
"DivisiveVertexFinder") <<
"Track " <<
i <<
" addr " << in[
i].tracks()[0]
76 <<
" dz " << in[
i].tracks()[0]->dz(bs)
77 <<
" +- " << in[
i].tracks()[0]->dzError()
78 <<
" prodID " << mapa[in[
i].tracks()[0]].id()
79 <<
" dz from RefTrack " << mapa[in[
i].tracks()[0]]->dz(bs)
80 <<
" +- " << mapa[in[
i].tracks()[0]]->dzError();
89 << out.first.size() <<
" vertexes";
92 for (
unsigned int iv=0; iv<out.first.size(); ++iv) {
94 err(2,2) = out.first[iv].position().error()*out.first[iv].position().error();
97 if (
verbose_ > 0 )
edm::LogInfo(
"DivisiveVertexFinder") <<
" DivisiveClusterizer1D vertex " << iv
98 <<
" has " << out.first[iv].tracks().size()
99 <<
" tracks and a position of " <<
v.z()
101 for (
unsigned int itrk=0; itrk<out.first[iv].tracks().size(); ++itrk) {
104 vertexes.push_back(
v);
pixeltemp::DivisiveClusterizer1D< reco::Track > divmeth_
We use Wolfgang's templated class that implements the actual divisive method.
DivisiveVertexFinder(double zOffset=5.0, int ntrkMin=5, bool useError=true, double zSeparation=0.05, bool wtAverage=true, int verbosity=0)
bool findVertexesAlt(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes, const math::XYZPoint &bs)
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
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.