////////////////////////////////////////////////////////////////////// /// (C)opyright 2004 /// /// Institute of Computer Science V /// Prof. Männer /// University of Mannheim, Germany /// /// ******************************************************************* /// /// Designer(s): Steinle / Gläß /// /// ******************************************************************* /// /// Project: Trackfinder for CBM-Project at GSI-Darmstadt, Germany /// /// ******************************************************************* /// /// Description: /// /// class: /// - derived from prelut /// - class for the first look-up-table implemented with a file /// /// ******************************************************************* /// /// $Author: csteinle $ /// $Date: 2006/11/07 12:48:06 $ /// $Revision: 1.2 $ /// ////////////////////////////////////////////////////////////////////// #ifndef _PRELUTACCESS_H #define _PRELUTACCESS_H #include "prelut.h" #include /* ************************************************************** * CLASS prelutAccess * * **************************************************************/ class prelutAccess : public prelut { protected: prelutHoughBorder* lutMem; /**< Memory which stores the whole look up table. */ unsigned long numberOfEntries; /**< Variable to store the number of entries in the lutMem. */ /** * This method allocates new memory. */ void allocateNewMemory(unsigned long number); public: /** * Default constructor */ prelutAccess(); /** * Constructor * @param dim3Min is the minimal value of the first dimension * @param dim3Max is the maximal value of the first dimension * @param dim3Step is the stepwidth of the first dimension to build a grid * @param dim3StartEntry is the minimal value of the second dimension * @param dim3StopEntry is the maximal value of the second dimension */ prelutAccess(double dim3Min, double dim3Max, int dim3Step, double dim3StartEntry, double dim3StopEntry); /** * Destructor */ virtual ~prelutAccess(); /** * Method inits the variables based on the detector stations. * @param dim3Min is the minimal value of the first dimension * @param dim3Max is the maximal value of the first dimension * @param dim3Step is the stepwidth of the first dimension to build a grid * @param dim3StartEntry is the minimal value of the second dimension * @param dim3StopEntry is the maximal value of the second dimension */ void init(double dim3Min, double dim3Max, int dim3Step, double dim3StartEntry, double dim3StopEntry); /** * This method evaluates the value from the prelut table. * @param hit is the actual hit-object to compute the borders * @param if borderPointer is null, the computation would be done in an internal object * @return if borderPointer is not null, this object would consist of the computed results */ void evaluate(trackfinderInputHit* hit, prelutHoughBorder* borderPointer = NULL); /** * This method clears the prelut table. */ void clear(); /** * This method returns the value from the prelut table. * @param index is the actual index for the borders */ prelutHoughBorder getEntry(unsigned long index); /** * This method adds the value at the end of the prelut table. * @param value is the actual value for the entry */ void addEntry(prelutHoughBorder value); /** * This method converts the prelut table into a string. */ std::string toString(); /** * method reads a file to get the table * @param fileName is the name of the file to read the data */ void read(std::string fileName); /** * method writes a file representing the table * @param fileName is the name of the file to write the data * @param name is the name of the table which should be written to file * @param usage is a string representing the usage of the table in the program which should be written to file */ void write(std::string fileName, std::string name); }; #endif