Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F11221739
MultiGaussianState.icc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
MultiGaussianState.icc
View Options
#include "TrackingTools/GsfTools/interface/MultiGaussianState.h"
#include "TrackingTools/GsfTools/interface/MultiGaussianStateCombiner.h"
// template <unsigned int N>
// MultiGaussianState<N>::MultiGaussianState
// (const std::vector< boost::shared_ptr<SingleState> >& stateV) :
// theCombinedStateUp2Date(false) {
// theComponents.reserve(stateV.size());
// for ( typename std::vector< boost::shared_ptr<SingleState> >::const_iterator ic=stateV.begin();
// ic!=stateV.end(); ++ic ) theComponents.push_back( boost::shared_ptr<const SingleState>(*ic) );
// }
template <unsigned int N>
double MultiGaussianState<N>::weight() const
{
if (theCombinedStateUp2Date) return theCombinedState->weight();
double result(0.);
for ( typename SingleStateContainer::const_iterator ic=theComponents.begin();
ic!=theComponents.end(); ic++ ) result += (**ic).weight();
return result;
}
template <unsigned int N>
const typename MultiGaussianState<N>::Vector &
MultiGaussianState<N>::mean() const
{
checkCombinedState();
return theCombinedState->mean();
}
template <unsigned int N>
const typename MultiGaussianState<N>::Matrix &
MultiGaussianState<N>::covariance() const
{
checkCombinedState();
return theCombinedState->covariance();
}
template <unsigned int N>
const typename MultiGaussianState<N>::Matrix &
MultiGaussianState<N>::weightMatrix() const
{
checkCombinedState();
return theCombinedState->weightMatrix();
}
template <unsigned int N>
void MultiGaussianState<N>::checkCombinedState() const
{
if (theCombinedStateUp2Date) return;
MultiGaussianStateCombiner<N> theCombiner;
theCombinedState = theCombiner.combine(theComponents);
theCombinedStateUp2Date = true;
// ++constructsCombinedState_;
}
template <unsigned int N> void
MultiGaussianState<N>::setWeight (double newWeight)
{
double wgt = weight();
if ( wgt>DBL_MIN ) rescaleWeight(newWeight/wgt);
}
template <unsigned int N> void
MultiGaussianState<N>::rescaleWeight (double scale)
{
for ( typename std::vector<SingleState>::const_iterator ic=theComponents.begin();
ic!=theComponents.end(); ic++ ) (**ic).rescaleWeight(scale);
if (theCombinedStateUp2Date) theCombinedState->rescaleWeight(scale);
}
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Wed, May 14, 10:50 AM (20 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5111269
Default Alt Text
MultiGaussianState.icc (2 KB)
Attached To
rRAVESVN ravesvn
Event Timeline
Log In to Comment