/* * MilleBinary.h * * Created on: Aug 31, 2011 * Author: kleinwrt */ #ifndef MILLEBINARY_H_ #define MILLEBINARY_H_ #include #include //! Namespace for the general broken lines package namespace gbl { /// Millepede-II (binary) record. /** * Containing information for local (track) and global fit. * * The data blocks are collected in two arrays, a real array and * an integer array, of same length. The content of the record is: *\verbatim * real array integer array * 0 0.0 error count (this record) * 1 RMEAS, measured value 0 -+ * 2 local derivative index of local derivative | * 3 local derivative index of local derivative | * 4 ... | block * SIGMA, error (>0) 0 | * global derivative label of global derivative | * global derivative label of global derivative -+ * RMEAS, measured value 0 * local derivative index of local derivative * local derivative index of local derivative * ... * SIGMA, error 0 * global derivative label of global derivative * global derivative label of global derivative * ... * global derivative label of global derivative *\endverbatim */ class MilleBinary { public: MilleBinary(const std::string fileName = "milleBinaryISN.dat", unsigned int aSize = 2000); virtual ~MilleBinary(); void addData(float aMeas, float aPrec, const std::vector &indLocal, const std::vector &derLocal, const std::vector &labGlobal, const std::vector &derGlobal); void writeRecord(); private: std::ofstream binaryFile; ///< Binary File std::vector intBuffer; ///< Integer buffer std::vector floatBuffer; ///< Float buffer }; } #endif /* MILLEBINARY_H_ */