Luiza  v03-01
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
luiza::FindLineTrajectory Class Reference

Analytical line track fitting processor for LUIZA. More...

#include <FindLineTrajectory.h>

Inheritance diagram for luiza::FindLineTrajectory:
luiza::Processor

Public Member Functions

virtual ProcessornewProcessor ()
 Returns a new instance of FindLineTrajectory. More...
 
 FindLineTrajectory ()
 Default constructor.
 
virtual void init ()
 Called at the job beginning. More...
 
virtual void startAnalysis (GloriaDataContainer *)
 Called before first data processing loop. More...
 
virtual void processData (GloriaDataContainer *data)
 Called for every data processing loop. More...
 
virtual void check (GloriaDataContainer *data)
 Called for every loop - right after processData() call. More...
 
virtual void concludeAnalysis (GloriaDataContainer *)
 Called after all data processing loops. More...
 
virtual void end ()
 Called after data processing for clean up. More...
 
- Public Member Functions inherited from luiza::Processor
 Processor (const std::string &typeName)
 Default constructor. More...
 
virtual ~Processor ()
 Destructor.
 
virtual const std::string & type () const
 Return type name for the processor (as set in constructor).
 
virtual const std::string & name () const
 Return name of this processor.
 
virtual const std::string & logLevelName () const
 Return name of the local verbosity level of this processor - "" if not set.
 
virtual StringParameters * parameters ()
 Return parameters defined for this Processor.
 
virtual void printDescription ()
 Print information about this processor in ASCII steering file format.
 
virtual void printDescriptionXML (std::ostream &stream=std::cout)
 Print information about this processor in XML steering file format.
 
template<class T >
void printParameters ()
 Print the parameters and their values depending on the given verbosity level.
 
void printParameters ()
 Print the parameters and their values with verbosity level MESSAGE.
 
const std::string & description ()
 Description of processor.
 
bool isFirstEvent ()
 True if first event in processEvent(evt) - use this e.g. to initialize histograms etc.
 
GloriaCollectionType getGloriaInType (const std::string &colName)
 Return the input type for the collection colName. More...
 
GloriaCollectionType getGloriaOutType (const std::string &colName)
 Return the output type for the collection colName. More...
 
bool isInputCollectionName (const std::string &parameterName)
 Check if parameter defines collection. More...
 
bool isOutputCollectionName (const std::string &parameterName)
 True if the given parameter defines an LCIO output collection */.
 

Protected Member Functions

bool initFit (GloriaDataContainer *)
 Prepare fit environment and calculate nominal fit parameters.
 
void endFit ()
 Clean fit environment.
 
double MatrixFit ()
 Find track. More...
 
double SingleFit ()
 Find track assuming nominal errors. More...
 
double NominalFit ()
 Find track on all frames. More...
 
int DoAnalFit (double *pos, double *err, double velocity=0.)
 
double GetFitChi2 ()
 Calculate $ \chi^{2} $ of the fit. More...
 
int GaussjSolve (double *alfa, double *beta, int n)
 Solve matrix equation.
 
- Protected Member Functions inherited from luiza::Processor
void setReturnValue (bool val)
 Set the return value for this processor - typically at end of processEvent(). More...
 
void setReturnValue (const std::string &name, bool val)
 Set a named return value for this processor - typically at end of processEvent() More...
 
template<class T >
void registerProcessorParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
 Register a steering variable for this processor - call in constructor of processor. More...
 
void registerInputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Register parameter describing input collection. More...
 
void registerOutputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
 Register parameter describing output collection. More...
 
void registerInputCollections (const GloriaCollectionType &type, const std::string &name, const std::string &description, StringVec &parameter, const StringVec &defaultVal, int setSize=0)
 Register parameter describing input collections. More...
 
template<class T >
void registerOptionalParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
 Same as registerProcessorParameter except that the parameter is optional. More...
 
bool parameterSet (const std::string &name)
 Tests whether the parameter has been set in the steering file.
 
template<class T >
void message (const std::string &message) const
 Print message according to verbosity level. More...
 
template<class T >
void message (const std::basic_ostream< char, std::char_traits< char > > &m) const
 Similar to message(const std::string& message) More...
 
std::stringstream & log () const
 Returns an empty stringstream that is used by the message method.
 
virtual void setProcessorParameters (StringParameters *parameters)
 Allow friend class CCProcessor to change/reset processor parameters.
 
virtual void updateParameters ()
 Allow friend class CCProcessor to update processor parameters.
 
virtual void updateTelescopeParameters (std::string name)
 Allow to update processor parameters for given telescope name. More...
 
virtual void updateTelescopeParameters (GloriaFitsHeader *header)
 Update processor parameters based on FITS header. More...
 

Protected Attributes

std::string _inputCollectionName
 Name of the input object list collection.
 
std::string _outputTrackCollectionName
 Name of the output collection for storing track parameters.
 
std::string _outputPositionCollectionName
 Name of the collection for storing fitted object positions on subsequent frames.
 
int _maxFrameObjects
 Maximum number of objects considered per.
 
double _chi2Max
 Maximum $ \chi^{2} $ for accepted track fit.
 
std::vector< std::string > _positionColumns
 Names of the columns, where object positions are stored.
 
std::vector< float > _positionErrors
 Assumed errors on object positions in Ra and Dec.
 
std::string _timeRecord
 Name of header record storing frame time.
 
bool _searchMultipleTracks
 Flag for searching multiple tracks.
 
bool _allowAmbiguousObjects
 Allow same object to be used in more than track.
 
int _maximumAmbiguousObjects
 Number of objects than can be shared by two tracks.
 
int _allowMissingObservations
 Allowed number of frames with missing object on the track.
 
double _missingObservationPenalty
 "Penalty" added to track $ \chi^{2} $ for each frame without track object
 
bool _useVelocityConstraint
 Flag for using expected direction and angular velocity constraint in the fit.
 
double _velocitySpread
 Assumed spread of the fitted object velocity.
 
double _raVelocity
 Assumed object sky velocity in Ra [deg/s].
 
double _decVelocity
 Assumed object sky velocity in Dec [deg/s].
 
bool _usePreselection
 Use additional cuts, based on measured object position on the first frame.
 
int _nLoops
 Total number of processing loops.
 
int _nFrames
 Total number of processed frames.
 
int _nTracks
 Total number of reconstructed tracks.
 
- Protected Attributes inherited from luiza::Processor
std::string _description
 Describes what the processor does. Set in constructor.
 

Detailed Description

Analytical line track fitting processor for LUIZA.

This processor was adopted for fitting tracks to object positions on the sky reconstructed on subsequent frames. Input collection should contain object lists with objectc suspected to be satellites (based on shape, comparison with previous frame or matching with catalogue). There are usually multiple such objects in each frame, so main task of the processor is to look for the best track candidate considering all fit possibilities. All considered frames should be loaded in one loop.

Fit method
Track fitting is performed separately in RA vs time and DEC vs time. Object trajectory (position on each frame) is found by solving matrix equation resulting from $ \chi^{2} $ minimum condition.
Track finding algorithm
  • Read object lists for frame set from input table collection and copy to local tables
  • Calculate number of fit hypothesis (including missing object possibility)
  • Search the list of fit hypotheses to find the one with best $ \chi^{2} $ (including ``penalties'' for missing observation)
  • Accept the fit if $ \chi^{2} $ is below threshold
  • Write fitted track to output collection; reconstructed object positions can also be stored to object collection.
Output
Fitted object position on the first frame as well as RA/Dec velocities are stored in the output track collection. Also fitted object positions at all frames (at corresponding times) can be stored in new collection or added to the input object list collection. Following parameters define input and output from the processor.
Parameters
InputCollectionNameName of the input object list collection
OutputTrackCollectionNameName of the output collection for storing track parameters (main output of the processor).
OutputPositionCollectionNameName of the collection for storing fitted object positions on subsequent frames
Fit performance parameters
Parameters
MaxFrameObjectsMaximum number of objects considered per frame. Should be large (default is 100) for high track finding efficiency even for frames with high object multiplicities (but have a look at preformance issues below). For low values algorithm runs much faster (reduced number of hypothesis), but the efficiency is lower.
Chi2MaxMaximum $ \chi^{2} $ for accepted track fit.
PositionColumnsNames of the columns, where object positions, to be used in the fit, are stored
PositionErrorsAssumed errors on object positions used in the fit (one number, or separate errors for Ra and Dec).
TimeRecordKeyword of the header record storing frame time (assumed to be in seconds; default is TIME_UT)
SearchMultipleTracksFlag for searching multiple tracks in lists with multiple objects. If false, only best (lowest $ \chi^{2} $) track is taken.
AllowAmbiguousObjectsAllow same object to be used in more than one track.
MaximumAmbiguousObjectsNumber of objects than can be shared by two tracks (when AllowAmbiguousObjects option is set)
UseVelocityConstraintFlag for using expected direction and angular velocity constraint in the fit. Can improve the fit, also improves track searching for multiple objects.
RaVelocityAssumed object sky velocity in Ra [deg/s]
DecVelocityAssumed object sky velocity in Dec [deg/s]
VelocitySpreadAssumed spread of the fitted object velocity
AllowMissingObservationsAllowed number of frames with missing object on the track
MissingObservationPenalty"Penalty" added to track $ \chi^{2} $ for each frame without reconstructed object on the track
UsePreselectionUse additional cuts, based on measured object position on the first frame and the expected object track direction (velocities given when UseVelocityConstraint option is used) to constraint number of considered hit combinations and speed up the processing.
Performance issues
As described above, if multiple objects are found in sky images, the algorithm checks all object selection possibilities (all track hypothesis). This task is optimized to a large extent, but still track finding can be slow for large object multiplicities. Here are some suggestions on how to improve performance.
Author
A.F.Zarnecki, University of Warsaw, zarne.nosp@m.cki@.nosp@m.fuw.e.nosp@m.du.p.nosp@m.l

Member Function Documentation

void luiza::FindLineTrajectory::check ( GloriaDataContainer data)
virtual

Called for every loop - right after processData() call.

Can be used to check processing and/or produce check plots.

Reimplemented from luiza::Processor.

void luiza::FindLineTrajectory::concludeAnalysis ( GloriaDataContainer data)
virtual

Called after all data processing loops.

This method is called to finalize the analysis, after all input data was read (or required number of loops was reached). Analysis of data collected in permanent data collections is possible here.

Reimplemented from luiza::Processor.

int luiza::FindLineTrajectory::DoAnalFit ( double *  pos,
double *  err,
double  velocity = 0. 
)
protected

Fit track in one coordinate (Ra or Dec), taking into account object velocity

References _useVelocityConstraint, _velocitySpread, and GaussjSolve().

Referenced by initFit(), MatrixFit(), and SingleFit().

void luiza::FindLineTrajectory::end ( )
virtual

Called after data processing for clean up.

Used to release memory allocated in init() step

Reimplemented from luiza::Processor.

References _nFrames, _nLoops, and _nTracks.

double luiza::FindLineTrajectory::GetFitChi2 ( )
protected

Calculate $ \chi^{2} $ of the fit.

Calculate $ \chi^{2} $ of the fit taking into account measured object positions in Ra and Dec

References _decVelocity, _raVelocity, _useVelocityConstraint, and _velocitySpread.

Referenced by MatrixFit(), NominalFit(), and SingleFit().

void luiza::FindLineTrajectory::init ( )
virtual

Called at the job beginning.

This is executed only once in the whole execution.

Reimplemented from luiza::Processor.

References _inputCollectionName, _nFrames, _nLoops, _nTracks, _outputPositionCollectionName, _outputTrackCollectionName, _positionColumns, _positionErrors, luiza::Processor::name(), and luiza::Processor::parameters().

double luiza::FindLineTrajectory::MatrixFit ( )
protected

Find track.

Fit track in two coordinates (Ra and Dec) by solving two matrix equations and calculate $ \chi^{2} $

References _decVelocity, _raVelocity, DoAnalFit(), and GetFitChi2().

Referenced by processData().

virtual Processor* luiza::FindLineTrajectory::newProcessor ( )
inlinevirtual

Returns a new instance of FindLineTrajectory.

This method returns an new instance of the this processor. It is called by Luiza execution framework and it shouldn't be called/used by the final user.

Returns
a new FindLineTrajectory

Implements luiza::Processor.

double luiza::FindLineTrajectory::NominalFit ( )
protected

Find track on all frames.

Fit track in two coordinates: Ra and Dec. When same position error is assumed and objects are found on all frames, same inverse matrix can be used for all events.

References _decVelocity, _raVelocity, _useVelocityConstraint, _velocitySpread, and GetFitChi2().

Referenced by processData().

void luiza::FindLineTrajectory::processData ( GloriaDataContainer data)
virtual
double luiza::FindLineTrajectory::SingleFit ( )
protected

Find track assuming nominal errors.

Fit track in two coordinates (Ra and Dec). When single position error is used, only one matrix equation has to be solved and the inverse matrix can be applied to the second equation.

References _decVelocity, _raVelocity, _useVelocityConstraint, _velocitySpread, DoAnalFit(), and GetFitChi2().

Referenced by processData().

void luiza::FindLineTrajectory::startAnalysis ( GloriaDataContainer data)
virtual

Called before first data processing loop.

Can be used to initialize data collections required for analysis, eg. define permanent collections, or fill them with external data (from file, database or net). It is possible as GloriaDataContainer is already defined, contrary to init().

Reimplemented from luiza::Processor.


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