CEDRIC  Revision_backup-2009-02
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
EventMap Class Reference

#include <EventMap.h>

Classes

struct  Coordinate
 A co-ordinate is represented as 2D point (x,y) on the map. More...
 
struct  SignatureSampler
 

Public Types

enum  Progress {
  STEP_INITIAL = 0, STEP_SUBSET = 10, STEP_DIST_MATRIX = 70, STEP_MDS = 95,
  STEP_STRESS = 100, NUM_STEPS = 100
}
 
typedef ublas::matrix< double > Matrix
 
typedef ublas::vector< double > Vector
 
typedef EarthMoversDistance
< EventSignature, EventFeature > 
EMD
 

Public Member Functions

void print (Matrix A, std::ostream &os=std::cout)
 
 EventMap (const GroundDistance< EventFeature > &gd)
 
 EventMap (EventMap &other)
 Copy constructor (pointer to progress indicator is not copied and must be specified seperately for copy) More...
 
void create (EventSignatureSet &signatures, SignatureSampler &sel)
 Create map for subset of signatures computed with the SignatureSampler sel. More...
 
void setProgressIndicator (ProgressIndicator *pi)
 Specify the progress indicator to use. More...
 
bool wasCanceled () const
 Return true if create() was cancelled via the progress indicator. More...
 
int numCoordinates () const
 Return the number of co-ordinates in map. More...
 
int phast2mapIndex (unsigned int phastIndex) const
 
int getIndex (unsigned int i) const
 Return the Phast index of co-ordinate i. More...
 
Coordinate getCoordinate (unsigned int i) const
 Return Coordinate i. More...
 
double getDissimilarity (unsigned int i, unsigned int j) const
 Return dissimilarity from point i to point j. More...
 
double getRawStress (unsigned int i)
 Return stress for coordinate i. More...
 
double getKruskalPointStress (unsigned int i)
 
double stressMean () const
 
double stressVar () const
 
double stressNorm () const
 
double stressKruskal () const
 
double minRawStress ()
 Return minimum stress. More...
 
double maxRawStress ()
 Return maximum stress. More...
 
Matrix & distanceMatrix ()
 
double dist (Coordinate c1, Coordinate c2) const
 Euclidean distance (needed for stress calculation) More...
 

Protected Types

enum  PointStressType { BortStress, KruskalStress }
 

Protected Member Functions

bool progress (int step)
 
void calculateStress ()
 
double calculateKruskalStress () const
 Calculate overall Kruskal stress. More...
 
double calculatePointStress (int index, PointStressType type) const
 Calculate raw point stress. More...
 

Detailed Description

Compute distance matrix of EventSignatures via Earth-Movers-Distance and on this perform Multidimensional Scaling to produce a 2D map of events.

Author
Max Hermann <mhermann[at]mail.cern.ch>

Member Typedef Documentation

typedef ublas::matrix<double> EventMap::Matrix
typedef ublas::vector<double> EventMap::Vector

Member Enumeration Documentation

enum EventMap::PointStressType
protected
Enumerator
BortStress 
KruskalStress 
Enumerator
STEP_INITIAL 
STEP_SUBSET 
STEP_DIST_MATRIX 
STEP_MDS 
STEP_STRESS 
NUM_STEPS 

Constructor & Destructor Documentation

EventMap::EventMap ( const GroundDistance< EventFeature > &  gd)
inline
EventMap::EventMap ( EventMap &  other)

Copy constructor (pointer to progress indicator is not copied and must be specified seperately for copy)

Member Function Documentation

double EventMap::calculateKruskalStress ( ) const
protected

Calculate overall Kruskal stress.

References dist(), getCoordinate(), and numCoordinates().

Referenced by calculateStress().

double EventMap::calculatePointStress ( int  index,
PointStressType  type 
) const
protected

Calculate raw point stress.

References dist(), getCoordinate(), KruskalStress, and numCoordinates().

Referenced by calculateStress().

void EventMap::calculateStress ( )
protected
void EventMap::create ( EventSignatureSet &  signatures,
SignatureSampler &  sel 
)
double EventMap::dist ( Coordinate  c1,
Coordinate  c2 
) const
inline
Matrix& EventMap::distanceMatrix ( )
inline
Coordinate EventMap::getCoordinate ( unsigned int  i) const
inline
double EventMap::getDissimilarity ( unsigned int  i,
unsigned int  j 
) const
inline

Return dissimilarity from point i to point j.

Referenced by EventNavigator::MapSelection::localStress().

int EventMap::getIndex ( unsigned int  i) const
inline

Return the Phast index of co-ordinate i.

Referenced by EventNavigator::computeClustering(), and EventNavigator::showMap().

double EventMap::getKruskalPointStress ( unsigned int  i)
inline

References numCoordinates().

Referenced by EventNavigator::showMap().

double EventMap::getRawStress ( unsigned int  i)
inline

Return stress for coordinate i.

References numCoordinates().

Referenced by EventNavigator::MapSelection::MapSelection(), and EventNavigator::showMap().

double EventMap::maxRawStress ( )

Return maximum stress.

double EventMap::minRawStress ( )

Return minimum stress.

int EventMap::numCoordinates ( ) const
inline
int EventMap::phast2mapIndex ( unsigned int  phastIndex) const
inline

Return the co-ordinate index for the event with specified Phast index

Returns
-1 if event is not in map

Referenced by EventNavigator::MapSelection::MapSelection().

void EventMap::print ( Matrix  A,
std::ostream &  os = std::cout 
)
inline

Referenced by create().

bool EventMap::progress ( int  step)
protected
void EventMap::setProgressIndicator ( ProgressIndicator *  pi)
inline

Specify the progress indicator to use.

Referenced by EventNavigator::createMap().

double EventMap::stressKruskal ( ) const
inline

Referenced by EventNavigator::immerse().

double EventMap::stressMean ( ) const
inline

Referenced by EventNavigator::showMap().

double EventMap::stressNorm ( ) const
inline

Referenced by EventNavigator::showMap().

double EventMap::stressVar ( ) const
inline
bool EventMap::wasCanceled ( ) const
inline

Return true if create() was cancelled via the progress indicator.

References ProgressIndicator::wasCanceled().

Referenced by EventNavigator::computeOverviewMap(), EventNavigator::immerse(), and EventNavigator::selectEventUserMode().