14 bool useError,
double zSeparation,
bool wtAverage,
16 : zOffset_(zOffset), zSeparation_(zSeparation), ntrkMin_(ntrkMin), useError_(useError),
17 wtAverage_(wtAverage),
18 divmeth_(zOffset, ntrkMin, useError, zSeparation, wtAverage),
40 for (
unsigned int i=0;
i<trks.
size();
i++) {
41 double vz = trks[
i]->vz();
46 vertexes.push_back(
v);
53 std::vector< PVCluster >
in;
54 std::pair< std::vector< PVCluster >, std::vector< const reco::Track* > >
out;
58 std::map< const reco::Track*, reco::TrackRef > mapa;
60 for (
unsigned int i=0;
i<trks.
size(); ++
i) {
61 double vz = trks[
i]->vz();
63 std::vector< const reco::Track* >
temp;
65 temp.push_back( &(*trks[
i]) );
68 mapa[temp[0]] = trks[
i];
72 edm::LogInfo(
"DivisiveVertexFinder") <<
"size of input vector of clusters " << in.size();
73 for (
unsigned int i=0;
i<in.size(); ++
i) {
74 edm::LogInfo(
"DivisiveVertexFinder") <<
"Track " <<
i <<
" addr " << in[
i].tracks()[0]
75 <<
" dz " << in[
i].tracks()[0]->dz(bs)
76 <<
" +- " << in[
i].tracks()[0]->dzError()
77 <<
" prodID " << mapa[in[
i].tracks()[0]].id()
78 <<
" dz from RefTrack " << mapa[in[
i].tracks()[0]]->dz(bs)
79 <<
" +- " << mapa[in[
i].tracks()[0]]->dzError();
88 << out.first.size() <<
" vertexes";
91 for (
unsigned int iv=0; iv<out.first.size(); ++iv) {
93 err(2,2) = out.first[iv].position().error()*out.first[iv].position().error();
96 if (
verbose_ > 0 )
edm::LogInfo(
"DivisiveVertexFinder") <<
" DivisiveClusterizer1D vertex " << iv
97 <<
" has " << out.first[iv].tracks().size()
98 <<
" tracks and a position of " <<
v.z()
100 for (
unsigned int itrk=0; itrk<out.first[iv].tracks().size(); ++itrk) {
103 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.