1 #ifndef _MtvClusterizer1D_H_
2 #define _MtvClusterizer1D_H_
24 std::pair < std::vector < Cluster1D<T> >, std::vector < const T * > >
64 std::pair < std::vector < Cluster1D<T> >, std::vector < const T * > >
68 using namespace Clusterizer1DCommons;
69 std::vector < const T * > unusedtracks;
75 std::pair < std::vector < Cluster1D >, std::vector < const T * > >
ret ( ov, unusedtracks );
78 std::vector < Cluster1D >
v = ov;
80 std::vector < Cluster1D > sols;
81 std::vector < const T * > trks;
83 typename std::vector< Cluster1D >::iterator cur =
v.begin();
84 typename std::vector< Cluster1D >::iterator
end = (
v.end() - 1 );
85 double cur_min = cur->weight() + ( cur+1 )->
weight();
87 for (
typename std::vector< Cluster1D >::iterator
i=
v.begin();
90 double cur_val =
i->weight() + (
i+1 )->
weight();
91 if ( cur_val > cur_min )
99 double est = ( cur->weight() * cur->position().value() +
101 double sigma =
sqrt (
square ( cur->position().value() - est ) +
102 square ( (cur+1)->position().value() - est ) );
106 for (
typename std::vector< Cluster1D >::iterator
i=
v.begin();
109 if ( fabs (
i->position().value() - est ) < 3 * sigma )
113 (
i->tracks(), trks );
114 err+=
square (
i->position().value() - est );
120 (
i->tracks(), unusedtracks );
123 err /= ( inliers - 1 );
127 std::pair < std::vector < Cluster1D >, std::vector < const T * > >
ret ( sols, unusedtracks );
MtvClusterizer1D(const WeightEstimator< T > &est=TrivialWeightEstimator< T >())
virtual MtvClusterizer1D * clone() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static int position[TOTALCHAMBERS][3]
std::pair< std::vector< Cluster1D< T > >, std::vector< const T * > > operator()(const std::vector< Cluster1D< T > > &) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
double square(const double a)
WeightEstimator< T > * theEstimator
float theErrorStretchFactor