24 zSeparation_(zSeparation),
27 wtAverage_(wtAverage),
28 divmeth_(zOffset, ntrkMin, useError, zSeparation, wtAverage),
48 for (
unsigned int i = 0;
i < trks.
size();
i++) {
49 double vz = trks[
i]->vz();
55 vertexes.push_back(
v);
63 std::vector<PVCluster>
in;
64 std::pair<std::vector<PVCluster>, std::vector<const reco::Track *> >
out;
68 std::map<const reco::Track *, reco::TrackRef> mapa;
70 for (
unsigned int i = 0;
i < trks.
size(); ++
i) {
71 double vz = trks[
i]->vz();
74 std::vector<const reco::Track *>
temp;
76 temp.push_back(&(*trks[
i]));
79 mapa[temp[0]] = trks[
i];
83 edm::LogInfo(
"DivisiveVertexFinder") <<
"size of input vector of clusters " << in.size();
84 for (
unsigned int i = 0;
i < in.size(); ++
i) {
86 <<
"Track " <<
i <<
" addr " << in[
i].tracks()[0] <<
" dz " << in[
i].tracks()[0]->dz(bs) <<
" +- "
87 << in[
i].tracks()[0]->dzError() <<
" prodID " << mapa[in[
i].tracks()[0]].id() <<
" dz from RefTrack "
88 << mapa[in[
i].tracks()[0]]->dz(bs) <<
" +- " << mapa[in[
i].tracks()[0]]->dzError();
97 edm::LogInfo(
"DivisiveVertexFinder") <<
" DivisiveClusterizer1D found " << out.first.size() <<
" vertexes";
100 for (
unsigned int iv = 0;
iv < out.first.size(); ++
iv) {
102 err(2, 2) = out.first[
iv].position().error() * out.first[
iv].position().error();
107 <<
" DivisiveClusterizer1D vertex " <<
iv <<
" has " << out.first[
iv].tracks().size()
108 <<
" tracks and a position of " <<
v.z() <<
" +- " <<
std::sqrt(
v.covariance(2, 2));
109 for (
unsigned int itrk = 0; itrk < out.first[
iv].tracks().size(); ++itrk) {
112 vertexes.push_back(
v);
117 std::sort(vertexes.begin(), vertexes.end(), *
pvComparer_);
constexpr bool isNotFinite(T x)
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.
Log< level::Info, false > LogInfo
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
pixeltemp::DivisiveClusterizer1D< reco::Track > divmeth_
We use Wolfgang's templated class that implements the actual divisive method.
Measurement1D wtAverage(const reco::TrackRefVector &trks) const
Calculate Error-Weighted average of Z of tracks from const collection of track pointers.