Particle Identification and Tracking
|
Class for particles that are aware of tracking. More...
#include <particle_track.h>
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_track * | get_next () const |
Returns a pointer to the next particle in the track. More... | |
particle_track * | get_next () |
Returns a pointer to the next particle in the track. More... | |
const particle_track * | get_prev () const |
Returns a pointer to the previous particle in the track. More... | |
particle_track * | get_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_box * | get_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_shelf * | get_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 > | |
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::Tuplef & | get_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 . More... | |
std::complex< float > | compute_phi_6 () const |
computes and returns the order parameter . 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_track * | reset_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_track * | next_ |
next particle in track More... | |
particle_track * | prev_ |
prev particle in track More... | |
Track_box * | track_ |
Pointer to which track the particle is in. More... | |
Hash_shelf * | shelf_ |
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 |
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.
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.
|
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().
|
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().
|
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().
|
inlineprivate |
|
inlineprivate |
|
private |
|
staticinherited |
Cleans up the set wrapper_in.
References tracking::particle_base::wrapper_in_.
Referenced by tracking::hash_case::~hash_case(), and tracking::Master_box::~Master_box().
|
inherited |
computes and returns the order parameter .
Defined by
References tracking::particle_base::neighborhood_, and tracking::particle_base::position_.
Referenced by tracking::particle_base::fill_phi_6().
|
inherited |
Retruns the distance from this particle to part_in.
References utilities::Tuple< T, length >::dist_sqr(), and tracking::particle_base::position_.
Referenced by tracking::particle_base::add_to_neighborhood(), tracking::Corr_gofr::compute(), tracking::Corr_pair_diffusion::compute(), tracking::hash_case::fill_pos_link_next(), tracking::particle_base::lthan(), tracking::Track_shelf::msd(), and tracking::Corr_goftheta::trim_nhood().
float particle_track::distancesq_corrected | ( | const particle_track * | part_in) | const |
Returns the displacement squared corrected for the net drift.
References tracking::Hash_shelf::get_cum_forward_disp(), tracking::particle_base::position_, and shelf_.
Referenced by tracking::Accum_chi4_self::add_particle(), tracking::Track_shelf::disp_sq_hist(), and tracking::Track_shelf::msd_corrected().
|
inherited |
Fills the order parameter with .
See compute_phi_6()
References tracking::particle_base::compute_phi_6(), tracking::particle_base::print(), and tracking::particle_base::s_order_parameter_.
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.
[in] | part_in | the final position of the particle |
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().
|
inherited |
Returns the uncorrected forward displacement.
References tracking::particle_base::position_.
Referenced by tracking::Corr_theta_2pt::compute(), tracking::Hash_shelf::compute_mean_forward_disp(), and tracking::Track_box::extract_raw_disp().
|
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().
|
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().
|
inlinestaticinherited |
returns the maximum neighborhood range
References tracking::particle_base::max_neighborhood_range_.
Referenced by tracking::Hash_shelf::fill_in_neighborhood().
|
inlineinherited |
returns the neighborhood vector
References tracking::particle_base::neighborhood_.
|
inlinestaticinherited |
returns the range of the neighborhood
References tracking::particle_base::max_neighborhood_range_.
Referenced by tracking::hash_box::compute_corr().
|
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().
|
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.
References next_.
Referenced by tracking::Accum_chi4_self::add_particle(), tracking::track_list::clean_lists(), tracking::Hash_shelf::compute_mean_forward_disp(), tracking::Track_box::extract_corrected_disp(), tracking::Track_box::extract_corrected_pos(), tracking::Track_box::extract_raw_disp(), tracking::Track_box::extract_raw_pos(), tracking::Track_box::output_to_wrapper(), tracking::Track_box::split_to_parts(), and tracking::Track_box::~Track_box().
|
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_.
|
inlineinherited |
returns a tuple of the particle's position
References tracking::particle_base::position_.
Referenced by tracking::Accum_sofq_ND::add_particle(), tracking::Accum_sofq::add_particle(), tracking::Corr_goftheta::compute(), tracking::Corr_pair_diffusion::compute(), tracking::Track_box::extract_raw_pos(), and tracking::Hash_shelf::hash_function().
|
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().
|
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_.
|
inherited |
Returns the distance of the particle from the specified origin.
origin | the cordinates of the new origin |
References tracking::particle_base::position_.
|
inlineinherited |
returns the scaler order parameter
References tracking::particle_base::s_order_parameter_.
|
inline |
Returns pointer to the shelf the particle resides in.
References shelf_.
|
inherited |
Returns the angle in the plane from the Y-axis.
origin | the 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 |
References utilities::D_NEXT_INDX, utilities::D_PREV_INDX, utilities::D_TRACKID, tracking::Track_box::get_id(), tracking::particle_base::get_ind(), tracking::particle_base::get_value(), next_, prev_, track_, utilities::V_INT, and utilities::v_type().
Referenced by tracking::Track_box::average_cord(), tracking::hash_case::init(), tracking::Hash_shelf::push(), and tracking::Track_box::split_to_parts().
float particle_track::get_value | ( | utilities::D_TYPE | type, |
float & | val | ||
) | const |
References tracking::particle_base::get_value().
std::complex< float > particle_track::get_value | ( | utilities::D_TYPE | type, |
std::complex< float > & | val | ||
) | const |
References tracking::particle_base::get_value().
|
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_.
|
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().
|
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_.
|
inherited |
Pring out a rasonable representation of the partile.
References tracking::particle_base::frame_, tracking::particle_base::ind_, and tracking::particle_base::position_.
Referenced by tracking::particle_base::fill_phi_6(), print_t(), and tracking::Hash_shelf::push().
void particle_track::print_t | ( | int | more) | const |
recursive print function for printing out the sequence of a track.
more | how many more particles to descend |
References next_, tracking::particle_base::print(), and print_t().
Referenced by tracking::Track_box::print(), and print_t().
|
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().
|
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_.
|
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.
[in] | n_next | pointer to the particle to be set as next |
References next_.
Referenced by tracking::Track_box::push_back().
|
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.
n_prev | pointer 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().
|
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.
i_track | pointer to the Track_box that represents the track this particle is to be a part of |
References track_.
|
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.
n | [in] number of steps to take |
next | [out] pointer to the nth particle |
References next_, prev_, and step_backwards().
Referenced by tracking::Track_box::at(), and step_backwards().
|
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
n | [in] number of steps to take |
next | [out] pointer to the nth particle |
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.
n | [in] number of steps to take |
next | [out] pointer to the nth particle |
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().
|
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
n | [in] number of steps to take |
next | [out] pointer to the nth particle |
References next_, and step_forwards().
|
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 |
|
protectedinherited |
|
protectedinherited |
Identifier that comes from the wrapper.
Referenced by tracking::particle_base::fill_position(), tracking::particle_base::get_ind(), tracking::particle_base::get_value(), tracking::particle_base::get_wrapper_value(), and tracking::particle_base::print().
|
staticprotectedinherited |
Maximum distance to be part of the neighborhood.
Referenced by tracking::particle_base::add_to_neighborhood(), tracking::particle_base::get_max_range(), tracking::particle_base::get_neighborhood_range(), and tracking::particle_base::set_neighborhood_range().
std::list<std::pair<particle_track*, float> >* tracking::particle_track::n_pos_link |
pointer to a list of particles to be used durring the tracking process
Referenced by tracking::track_list::clean_lists(), tracking::hash_case::fill_pos_link_next(), tracking::track_list::link_pairs(), tracking::track_list::recur_fnc_pn(), tracking::track_list::set_up_sub_ntwrk(), tracking::track_list::trivial_bonds(), and ~particle_track().
|
protectedinherited |
Vector of the particles with in max_range_ in the Hash_shelf_ of the particle.
Referenced by tracking::particle_base::add_to_neighborhood(), tracking::particle_base::compute_phi_6(), tracking::particle_base::get_neighborhood(), tracking::particle_base::get_neighborhood_size(), tracking::particle_base::get_value(), tracking::particle_base::no_neighborhood_repeats(), and tracking::particle_base::sort_neighborhood().
|
private |
next particle in track
Referenced by tracking::Track_box::average_cord(), clear_data_backward(), clear_data_forward(), clear_next(), clear_track_data(), get_next(), get_value(), has_next(), print_t(), reset_track(), set_next(), step_backwards(), and step_forwards().
std::list<std::pair<particle_track*, float> >* tracking::particle_track::p_pos_link |
h pointer to a list of particles to be used durring the tracking process
Referenced by tracking::track_list::clean_lists(), tracking::hash_case::fill_pos_link_next(), tracking::track_list::link_pairs(), tracking::track_list::recur_fnc_np(), tracking::track_list::set_up_sub_ntwrk(), tracking::track_list::trivial_bonds(), and ~particle_track().
|
protectedinherited |
New attempt at storing the position data, this has the problem of taking more memory, but it might help the time.
This will also make keeping track of the displacements.
Referenced by tracking::particle_base::compute_phi_6(), tracking::particle_base::distancesq(), distancesq_corrected(), tracking::particle_base::fill_position(), get_corrected_disp(), get_corrected_pos(), tracking::particle_base::get_disp(), tracking::particle_base::get_position(), tracking::particle_base::get_r(), tracking::particle_base::get_theta(), and tracking::particle_base::print().
|
private |
prev particle in track
Referenced by clear_data_backward(), clear_data_forward(), clear_prev(), clear_track_data(), get_prev(), get_value(), set_prev(), and step_backwards().
|
protectedinherited |
Scaler order parameter, ex phi_6 in 2D.
Referenced by tracking::particle_base::fill_phi_6(), tracking::particle_base::get_scaler_order_pram(), and tracking::particle_base::get_value().
|
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().
|
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().
|
staticprotectedinherited |
object that takes care of all the underling data structures.
Referenced by tracking::particle_base::clear_wrapper_in(), tracking::particle_base::fill_position(), tracking::particle_base::get_value(), tracking::particle_base::get_wrapper_value(), tracking::particle_base::intialize_wrapper_in(), and tracking::particle_base::priv_init().