Particle Identification and Tracking
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
tracking::particle_track Class Reference

Class for particles that are aware of tracking. More...

#include <particle_track.h>

+ Inheritance diagram for tracking::particle_track:
+ Collaboration diagram for tracking::particle_track:

Public Member Functions

 particle_track (int i_ind, int frame)
 
 particle_track (int i_ind, utilities::Tuplef pos, unsigned int frame)
 constructor that does not require any calls to the wrapper to get set up. More...
 
 ~particle_track ()
 Destructor. More...
 
void print_t (int more) const
 recursive print function for printing out the sequence of a track. More...
 
const particle_trackget_next () const
 Returns a pointer to the next particle in the track. More...
 
particle_trackget_next ()
 Returns a pointer to the next particle in the track. More...
 
const particle_trackget_prev () const
 Returns a pointer to the previous particle in the track. More...
 
particle_trackget_prev ()
 Returns a pointer to the previous particle in the track. More...
 
const utilities::Tuplef get_corrected_disp (const particle_track *part_in) const
 Returns the corrected forward displacement. More...
 
bool step_forwards (int n, const particle_track *&next) const
 Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false. More...
 
bool step_backwards (int n, const particle_track *&next) const
 Returns true if there is a particle n steps backwards and passes a pointer to it out as a reference, if there is not a particle, returns false. More...
 
Track_boxget_track () const
 get what track the particle belongs to. More...
 
int get_track_id () const
 Retruns the identifer of the Track_box the particle is in. More...
 
const Hash_shelfget_shelf () const
 Returns pointer to the shelf the particle resides in. More...
 
void set_shelf (Hash_shelf *shelf)
 Sets the shelf that the particle is in. More...
 
float distancesq_corrected (const particle_track *part_in) const
 Returns the displacement squared corrected for the net drift. More...
 
bool has_track () const
 returns if the track is set More...
 
bool has_next () const
 returns if a particle has a next More...
 
const utilities::Tuplef get_corrected_pos () const
 returns the position with the cumulative displacement subtracted off More...
 
int get_value (utilities::D_TYPE type, int &val) const
 
float get_value (utilities::D_TYPE type, float &val) const
 
std::complex< float > get_value (utilities::D_TYPE type, std::complex< float > &val) const
 
void print () const
 Pring out a rasonable representation of the partile. More...
 
template<class T >
get_wrapper_value (utilities::D_TYPE type, T &val) const
 Returns the a value associated with the particle directly from the wrapper, by passing all logic in the particle object. More...
 
const utilities::Tuplefget_position () const
 returns a tuple of the particle's position More...
 
int get_ind () const
 returns the index of the current particle More...
 
int get_frame () const
 returns the frame of the current particle More...
 
float distancesq (const particle_base *part_in) const
 Retruns the distance from this particle to part_in. More...
 
const utilities::Tuplef get_disp (const particle_base *part_in) const
 Returns the uncorrected forward displacement. More...
 
float get_r (const utilities::Tuplef &origin) const
 Returns the distance of the particle from the specified origin. More...
 
float get_theta (const utilities::Tuplef &origin) const
 Returns the angle in the plane from the Y-axis. More...
 
void sort_neighborhood ()
 Sorts the neighborhood vector in ascending order. More...
 
bool no_neighborhood_repeats () const
 checks to make sure the neighborhood does not include any repeats, returns true if the neighborhood is repeat free. More...
 
bool add_to_neighborhood (const particle *in)
 adds a particle to the neighborhood if it is close enough returns true if the particle is added, false otherwise More...
 
void fill_phi_6 ()
 Fills the order parameter with $\Phi_6$. More...
 
std::complex< float > compute_phi_6 () const
 computes and returns the order parameter $\Phi_6$. More...
 
std::complex< float > get_scaler_order_pram () const
 returns the scaler order parameter More...
 
unsigned int get_neighborhood_size () const
 returns the number of particles with in max_neighborhood_range_ of the particle (assuming that these have been initialized More...
 
const std::vector< const
particle * > 
get_neighborhood () const
 returns the neighborhood vector More...
 

Static Public Member Functions

static float get_max_range ()
 returns the maximum neighborhood range More...
 
static void intialize_wrapper_in (const utilities::Wrapper_in *in)
 Intialize the static input wrapper for all particles. More...
 
static void clear_wrapper_in ()
 Cleans up the set wrapper_in. More...
 
static void set_neighborhood_range (float in)
 Sets the maximum neighborhood range, there needs to be something to make sure that this doesn't get changed with out updating the. More...
 
static float get_neighborhood_range ()
 returns the range of the neighborhood More...
 

Public Attributes

std::list< std::pair
< particle_track *, float > > * 
n_pos_link
 pointer to a list of particles to be used durring the tracking process More...
 
std::list< std::pair
< particle_track *, float > > * 
p_pos_link
 h pointer to a list of particles to be used durring the tracking process More...
 

Protected Attributes

int ind_
 Identifier that comes from the wrapper. More...
 
utilities::Tuplef position_
 New attempt at storing the position data, this has the problem of taking more memory, but it might help the time. More...
 
int frame_
 The frame of the particle. More...
 
std::vector< const particle * > neighborhood_
 Vector of the particles with in max_range_ in the Hash_shelf_ of the particle. More...
 
std::complex< float > s_order_parameter_
 Scaler order parameter, ex phi_6 in 2D. More...
 

Static Protected Attributes

static const
utilities::Wrapper_in
wrapper_in_ = NULL
 object that takes care of all the underling data structures. More...
 
static float max_neighborhood_range_ = 0
 Maximum distance to be part of the neighborhood. More...
 

Private Member Functions

bool step_backwards (int n, particle_track *&next)
 Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false. More...
 
bool step_forwards (int n, particle_track *&next)
 Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false. More...
 
void set_track (Track_box *i_track)
 sets what track the particle belongs to. More...
 
particle_trackreset_track (Track_box *i_track, int &count)
 sets the track pointer with out any sanity checks, used for track splitting. More...
 
void clear_next ()
 cuts the track pointers More...
 
void clear_prev ()
 cuts track pointers More...
 
void set_next (particle_track *n_next)
 Sets the pointer to the next particle. More...
 
void set_prev (particle_track *n_prev)
 Sets the pointer to the previous particle. More...
 
void clear_track_data ()
 Clears all of the data associated with the tracking. More...
 
void clear_data_forward ()
 Clears the track data form all particles after the current particle. More...
 
void clear_data_backward ()
 Clears the track data from all particles before this particle. More...
 

Private Attributes

particle_tracknext_
 next particle in track More...
 
particle_trackprev_
 prev particle in track More...
 
Track_boxtrack_
 Pointer to which track the particle is in. More...
 
Hash_shelfshelf_
 Pointer to the shelf that the particle lives in. More...
 

Friends

class Track_box
 Friends with Track_box to allow it to screw with the linked list directly with out having to go through the getter/setter functions to remove an uneeded level of indrection, still keep the sanity check on not nuking the list for most uses. More...
 
class track_list
 

Detailed Description

Class for particles that are aware of tracking.

This class carries additional information about which track the particle is in and some members needed for tracking.

Constructor & Destructor Documentation

particle_track::particle_track ( int  i_ind,
int  frame 
)
particle_track::particle_track ( int  i_ind,
utilities::Tuplef  pos,
unsigned int  frame 
)

constructor that does not require any calls to the wrapper to get set up.

particle_track::~particle_track ( )

Destructor.

References n_pos_link, and p_pos_link.

Member Function Documentation

bool particle_base::add_to_neighborhood ( const particle in)
inherited

adds a particle to the neighborhood if it is close enough returns true if the particle is added, false otherwise

References tracking::particle_base::distancesq(), tracking::particle_base::frame_, tracking::particle_base::max_neighborhood_range_, and tracking::particle_base::neighborhood_.

Referenced by tracking::Hash_shelf::fill_in_neighborhood().

void particle_track::clear_data_backward ( )
private

Clears the track data from all particles before this particle.

This leave this particle as the head of the track, ie t_prev_ ==NULL

References clear_data_backward(), next_, prev_, and track_.

Referenced by clear_data_backward(), and tracking::Track_box::trim_track().

void particle_track::clear_data_forward ( )
private

Clears the track data form all particles after the current particle.

This leaves the current particle in the track as the last particle, ie t_next_ == NULL

References clear_data_forward(), next_, prev_, and track_.

Referenced by clear_data_forward(), and tracking::Track_box::trim_track().

void tracking::particle_track::clear_next ( )
inlineprivate

cuts the track pointers

References next_.

Referenced by tracking::Track_box::split_track().

void tracking::particle_track::clear_prev ( )
inlineprivate

cuts track pointers

References prev_.

Referenced by tracking::Track_box::split_track().

void particle_track::clear_track_data ( )
private

Clears all of the data associated with the tracking.

References next_, prev_, and track_.

void particle_base::clear_wrapper_in ( )
staticinherited
complex< float > particle_base::compute_phi_6 ( ) const
inherited

computes and returns the order parameter $\Phi_6$.

Defined by

\[ \Phi_{6}(r_{m}) = \frac{1}{N_{b}}\sum_{n=1}^{N_{b}}e^{6 i\theta_{mn} } \]

References tracking::particle_base::neighborhood_, and tracking::particle_base::position_.

Referenced by tracking::particle_base::fill_phi_6().

float particle_base::distancesq ( const particle_base part_in) const
inherited
float particle_track::distancesq_corrected ( const particle_track part_in) const
void particle_base::fill_phi_6 ( )
inherited
const utilities::Tuplef particle_track::get_corrected_disp ( const particle_track part_in) const

Returns the corrected forward displacement.

The assumption is that this particle is the initial position and part_in is the final position.

Parameters
[in]part_inthe final position of the particle
Returns
the vector from this to part_in

References tracking::Hash_shelf::get_cum_forward_disp(), tracking::particle_base::position_, and shelf_.

Referenced by tracking::Corr_pair_diffusion::compute(), tracking::Track_shelf::compute_corrected_TA(), tracking::Track_shelf::compute_corrected_TA_ncuts(), and tracking::Track_box::extract_corrected_disp().

const utilities::Tuplef particle_track::get_corrected_pos ( ) const

returns the position with the cumulative displacement subtracted off

References tracking::Hash_shelf::get_cum_forward_disp(), tracking::particle_base::position_, and shelf_.

Referenced by tracking::Track_box::extract_corrected_pos().

const utilities::Tuplef particle_base::get_disp ( const particle_base part_in) const
inherited
int tracking::particle_base::get_frame ( ) const
inlineinherited

returns the frame of the current particle

References tracking::particle_base::frame_.

Referenced by tracking::Track_box::output_to_wrapper(), and tracking::Track_shelf::output_to_wrapper().

int tracking::particle_base::get_ind ( ) const
inlineinherited

returns the index of the current particle

References tracking::particle_base::ind_.

Referenced by get_value(), tracking::Track_shelf::output_to_wrapper(), and tracking::Hash_shelf::push().

static float tracking::particle_base::get_max_range ( )
inlinestaticinherited

returns the maximum neighborhood range

References tracking::particle_base::max_neighborhood_range_.

Referenced by tracking::Hash_shelf::fill_in_neighborhood().

const std::vector<const particle*> tracking::particle_base::get_neighborhood ( ) const
inlineinherited

returns the neighborhood vector

References tracking::particle_base::neighborhood_.

static float tracking::particle_base::get_neighborhood_range ( )
inlinestaticinherited

returns the range of the neighborhood

References tracking::particle_base::max_neighborhood_range_.

Referenced by tracking::hash_box::compute_corr().

unsigned int tracking::particle_base::get_neighborhood_size ( ) const
inlineinherited

returns the number of particles with in max_neighborhood_range_ of the particle (assuming that these have been initialized

References tracking::particle_base::neighborhood_.

Referenced by tracking::Track_shelf::compute_corrected_TA_ncuts().

const particle_track* tracking::particle_track::get_next ( ) const
inline
particle_track* tracking::particle_track::get_next ( )
inline

Returns a pointer to the next particle in the track.

If this is the last particle in the track than NULL will be returned that is not const protected

References next_.

const utilities::Tuplef& tracking::particle_base::get_position ( ) const
inlineinherited
const particle_track* tracking::particle_track::get_prev ( ) const
inline

Returns a pointer to the previous particle in the track.

If this is the first particle in the track than NULL will be returned.

References prev_.

Referenced by tracking::track_list::clean_lists(), and tracking::Track_box::split_track().

particle_track* tracking::particle_track::get_prev ( )
inline

Returns a pointer to the previous particle in the track.

If this is the first particle in the track than NULL will be returned.

References prev_.

float particle_base::get_r ( const utilities::Tuplef origin) const
inherited

Returns the distance of the particle from the specified origin.

Parameters
originthe cordinates of the new origin

References tracking::particle_base::position_.

std::complex<float> tracking::particle_base::get_scaler_order_pram ( ) const
inlineinherited

returns the scaler order parameter

References tracking::particle_base::s_order_parameter_.

const Hash_shelf* tracking::particle_track::get_shelf ( ) const
inline

Returns pointer to the shelf the particle resides in.

References shelf_.

float particle_base::get_theta ( const utilities::Tuplef origin) const
inherited

Returns the angle in the plane from the Y-axis.

Parameters
originthe cordinates of the new origin

References tracking::particle_base::position_.

Track_box * particle_track::get_track ( ) const

get what track the particle belongs to.

Each particle can only belong to one track.

References track_.

Referenced by tracking::track_list::link_pairs(), and tracking::track_list::trivial_bonds().

int particle_track::get_track_id ( ) const

Retruns the identifer of the Track_box the particle is in.

References tracking::Track_box::get_id(), and track_.

int particle_track::get_value ( utilities::D_TYPE  type,
int &  val 
) const
float particle_track::get_value ( utilities::D_TYPE  type,
float &  val 
) const
std::complex< float > particle_track::get_value ( utilities::D_TYPE  type,
std::complex< float > &  val 
) const
template<class T >
template int particle_base::get_wrapper_value ( utilities::D_TYPE  type,
T &  val 
) const
inherited

Returns the a value associated with the particle directly from the wrapper, by passing all logic in the particle object.

References tracking::particle_base::frame_, utilities::Wrapper_in::get_value(), tracking::particle_base::ind_, and tracking::particle_base::wrapper_in_.

Referenced by tracking::Track_shelf::init().

bool particle_track::has_next ( ) const

returns if a particle has a next

References next_.

bool particle_track::has_track ( ) const

returns if the track is set

References track_.

void particle_base::intialize_wrapper_in ( const utilities::Wrapper_in in)
staticinherited

Intialize the static input wrapper for all particles.

References tracking::particle_base::wrapper_in_.

Referenced by tracking::hash_case::init(), and tracking::Master_box::priv_init().

bool particle_base::no_neighborhood_repeats ( ) const
inherited

checks to make sure the neighborhood does not include any repeats, returns true if the neighborhood is repeat free.

Mostly for debugging

References tracking::particle_base::neighborhood_.

void particle_base::print ( ) const
inherited
void particle_track::print_t ( int  more) const

recursive print function for printing out the sequence of a track.

Parameters
morehow many more particles to descend

References next_, tracking::particle_base::print(), and print_t().

Referenced by tracking::Track_box::print(), and print_t().

particle_track * particle_track::reset_track ( Track_box i_track,
int &  count 
)
private

sets the track pointer with out any sanity checks, used for track splitting.

Walks down the list to reset all particles.

References next_, reset_track(), and track_.

Referenced by tracking::Track_box::push_back(), reset_track(), and tracking::Track_box::Track_box().

static void tracking::particle_base::set_neighborhood_range ( float  in)
inlinestaticinherited

Sets the maximum neighborhood range, there needs to be something to make sure that this doesn't get changed with out updating the.

References tracking::particle_base::max_neighborhood_range_.

void particle_track::set_next ( particle_track n_next)
private

Sets the pointer to the next particle.

If next isn't NULL before being set, then this function thows the error "nuking the list" to prevent accidental destruction of the track.

Parameters
[in]n_nextpointer to the particle to be set as next

References next_.

Referenced by tracking::Track_box::push_back().

void particle_track::set_prev ( particle_track n_prev)
private

Sets the pointer to the previous particle.

If prev isn't NULL before being set, then this function thows the error "nuking the list" to prevent accidental destruction of the track.

Parameters
n_prevpointer to the particle to be set as prev

References prev_.

Referenced by tracking::Track_box::push_back().

void particle_track::set_shelf ( Hash_shelf shelf)

Sets the shelf that the particle is in.

References shelf_.

Referenced by tracking::hash_case::init().

void particle_track::set_track ( Track_box i_track)
private

sets what track the particle belongs to.

Each particle can only belong to one track. This code will do sanity checks to make sure that tracks are not accidentally moved from track to track. If track is already non-NULL then the error "moving between lists!" is thrown.

Parameters
i_trackpointer to the Track_box that represents the track this particle is to be a part of

References track_.

void particle_base::sort_neighborhood ( )
inherited

Sorts the neighborhood vector in ascending order.

References tracking::particle_base::neighborhood_.

Referenced by tracking::Hash_shelf::fill_in_neighborhood().

bool particle_track::step_backwards ( int  n,
const particle_track *&  next 
) const

Returns true if there is a particle n steps backwards and passes a pointer to it out as a reference, if there is not a particle, returns false.

Todo:
fix naming sematics
Parameters
n[in] number of steps to take
next[out] pointer to the nth particle
Returns
true if the nth particle exists

References next_, prev_, and step_backwards().

Referenced by tracking::Track_box::at(), and step_backwards().

bool particle_track::step_backwards ( int  n,
particle_track *&  next 
)
private

Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false.

Private, non-const version

Parameters
n[in] number of steps to take
next[out] pointer to the nth particle
Returns
true if the nth particle exists

References prev_, and step_backwards().

bool particle_track::step_forwards ( int  n,
const particle_track *&  next 
) const

Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false.

Parameters
n[in] number of steps to take
next[out] pointer to the nth particle
Returns
true if the nth particle exists

References next_, and step_forwards().

Referenced by tracking::Track_box::at(), tracking::Corr_pair_diffusion::compute(), tracking::Track_shelf::compute_corrected_TA(), tracking::Track_shelf::compute_corrected_TA_ncuts(), tracking::Track_shelf::disp_sq_hist(), tracking::Track_shelf::msd(), tracking::Track_shelf::msd_corrected(), step_forwards(), and tracking::Track_box::trim_track().

bool particle_track::step_forwards ( int  n,
particle_track *&  next 
)
private

Returns true if there is a particle n steps forward and passes a pointer to it out as a reference, if there is not a particle, returns false.

Private, non-const version

Parameters
n[in] number of steps to take
next[out] pointer to the nth particle
Returns
true if the nth particle exists

References next_, and step_forwards().

Friends And Related Function Documentation

friend class Track_box
friend

Friends with Track_box to allow it to screw with the linked list directly with out having to go through the getter/setter functions to remove an uneeded level of indrection, still keep the sanity check on not nuking the list for most uses.

friend class track_list
friend

Member Data Documentation

int tracking::particle_base::frame_
protectedinherited
int tracking::particle_base::ind_
protectedinherited
float particle_base::max_neighborhood_range_ = 0
staticprotectedinherited
std::list<std::pair<particle_track*, float> >* tracking::particle_track::n_pos_link
std::vector<const particle*> tracking::particle_base::neighborhood_
protectedinherited
particle_track* tracking::particle_track::next_
private
std::list<std::pair<particle_track*, float> >* tracking::particle_track::p_pos_link
utilities::Tuplef tracking::particle_base::position_
protectedinherited
particle_track* tracking::particle_track::prev_
private
std::complex<float> tracking::particle_base::s_order_parameter_
protectedinherited
Hash_shelf* tracking::particle_track::shelf_
private

Pointer to the shelf that the particle lives in.

This is redundent with the plane information, but this is more elegent and makes looking up the planes cumlative displacemet easier

Referenced by distancesq_corrected(), get_corrected_disp(), get_corrected_pos(), get_shelf(), and set_shelf().

Track_box* tracking::particle_track::track_
private

Pointer to which track the particle is in.

If the particle is not in a track this is NULL

Referenced by clear_data_backward(), clear_data_forward(), clear_track_data(), get_track(), get_track_id(), get_value(), has_track(), reset_track(), and set_track().

const Wrapper_in * particle_base::wrapper_in_ = NULL
staticprotectedinherited

The documentation for this class was generated from the following files: