#include <Cluster1DCleaner.h>
Public Member Functions | |
Cluster1DCleaner (const float zoffset, bool useErr) | |
std::vector< Cluster1D< T > > | clusters (std::vector< Cluster1D< T > >) |
std::vector< Cluster1D< T > > | discardedCluster1Ds () const |
Private Member Functions | |
float | average (const std::vector< Cluster1D< T > > &) |
void | cleanCluster1Ds (std::vector< Cluster1D< T > >) |
Private Attributes | |
std::vector< Cluster1D< T > > | theCleanedCluster1Ds |
std::vector< Cluster1D< T > > | theDiscardedCluster1Ds |
bool | theUseError |
float | theZOffSet |
Definition at line 14 of file Cluster1DCleaner.h.
pixeltemp::Cluster1DCleaner< T >::Cluster1DCleaner | ( | const float | zoffset, |
bool | useErr | ||
) | [inline] |
Definition at line 18 of file Cluster1DCleaner.h.
: theZOffSet(zoffset), theUseError(useErr) { theCleanedCluster1Ds.clear(); theDiscardedCluster1Ds.clear(); }
float Cluster1DCleaner< T >::average | ( | const std::vector< Cluster1D< T > > & | clust | ) | [private] |
Definition at line 87 of file Cluster1DCleaner.h.
References mathSSE::sqrt().
{ // float ave = clust.front().position().value(); // float err = clust.front().position().error(); // for( typename std::vector < Cluster1D<T> >::const_iterator ic=(clust.begin())+1; // ic != clust.end(); ic++) // { // float oldave = ave; // float olderr = err; // ave = ( oldave/olderr/olderr + // ic->position().value()/ic->position().error()/ic->position().error()) / // (1./olderr/olderr + 1./ic->position().error()/ic->position().error()); // err = sqrt(olderr*olderr + ic->position().error()*ic->position().error()); // } float sumUp = 0; float sumDown = 0; float err = 0; for( typename std::vector < Cluster1D<T> >::const_iterator ic=(clust.begin())+1; ic != clust.end(); ic++) { float err2 = ic->position().error(); err2 *= err2; if (err2 != 0){ sumUp += ic->position().value() / err2; // error-weighted average of Z at IP sumDown += 1/err2; } err += std::sqrt( err2 ); } return (sumDown>0) ? sumUp/sumDown : 0; }
void Cluster1DCleaner< T >::cleanCluster1Ds | ( | std::vector< Cluster1D< T > > | clust | ) | [private] |
Definition at line 59 of file Cluster1DCleaner.h.
References PDRates::average.
{ theCleanedCluster1Ds.clear(); theDiscardedCluster1Ds.clear(); if (clust.size() == 0) return; float oldPos = average(clust); for( typename std::vector < Cluster1D<T> >::const_iterator ic=clust.begin(); ic != clust.end(); ic++) { float discr = theUseError ? fabs( ((*ic).position().value() - oldPos) / (*ic).position().error()) : fabs( ((*ic).position().value() - oldPos) ); if ( discr < theZOffSet ) { theCleanedCluster1Ds.push_back(*ic); } else { theDiscardedCluster1Ds.push_back(*ic); } } return; }
std::vector< Cluster1D< T > > Cluster1DCleaner< T >::clusters | ( | std::vector< Cluster1D< T > > | clust | ) |
Definition at line 51 of file Cluster1DCleaner.h.
{ cleanCluster1Ds(clust); return theCleanedCluster1Ds; }
std::vector< Cluster1D< T > > pixeltemp::Cluster1DCleaner< T >::discardedCluster1Ds | ( | ) | const [inline] |
Definition at line 31 of file Cluster1DCleaner.h.
{ return theDiscardedCluster1Ds; }
std::vector<Cluster1D<T> > pixeltemp::Cluster1DCleaner< T >::theCleanedCluster1Ds [private] |
Definition at line 39 of file Cluster1DCleaner.h.
Referenced by pixeltemp::Cluster1DCleaner< reco::Track >::Cluster1DCleaner().
std::vector<Cluster1D<T> > pixeltemp::Cluster1DCleaner< T >::theDiscardedCluster1Ds [private] |
Definition at line 40 of file Cluster1DCleaner.h.
Referenced by pixeltemp::Cluster1DCleaner< reco::Track >::Cluster1DCleaner(), and pixeltemp::Cluster1DCleaner< reco::Track >::discardedCluster1Ds().
bool pixeltemp::Cluster1DCleaner< T >::theUseError [private] |
Definition at line 42 of file Cluster1DCleaner.h.
float pixeltemp::Cluster1DCleaner< T >::theZOffSet [private] |
Definition at line 41 of file Cluster1DCleaner.h.