GeneralBrokenLines V03-01-01
using EIGEN
Public Member Functions | Private Attributes | List of all members
gbl::MilleBinary Class Reference

Millepede-II (binary) record. More...

#include <MilleBinary.h>

Public Member Functions

 MilleBinary (const std::string &fileName="milleBinaryISN.dat", bool doublePrec=false, bool keepZeros=false, unsigned int aSize=2000)
 Create binary file. More...
 
virtual ~MilleBinary ()
 
void addData (double aMeas, double aErr, unsigned int numLocal, unsigned int *indLocal, double *derLocal, const std::vector< int > &labGlobal, const std::vector< double > &derGlobal)
 Add data block to (end of) record. More...
 
void writeRecord ()
 Write record to file. More...
 

Private Attributes

std::ofstream binaryFile
 Binary File. More...
 
std::vector< int > intBuffer
 Integer buffer. More...
 
std::vector< float > floatBuffer
 Float buffer. More...
 
std::vector< double > doubleBuffer
 Double buffer. More...
 
bool doublePrecision
 Flag for storage in as double values. More...
 
bool globalDerKeepZeros
 Flag for keeping global derivatives with value zero. More...
 

Detailed Description

Millepede-II (binary) record.

Containing information for local (track) and global fit.

The data blocks are collected in two arrays, a real array (containing float or double values) and integer array, of same length. A positive record length indicate float and a negative one double values. The content of the record is:

*         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
*

Special data block (other/debug information). Contains no local derivatives and (error) SIGMA is negative (-Number of SPecial data words).

*         real array              integer array
*         0.0                     0                   -+
*         -float(NSP)             0                    |
*         special data            special data         | special block (2+NSP words)
*         special data            special data         |
*         ...                                         -+
*

Definition at line 81 of file MilleBinary.h.

Constructor & Destructor Documentation

◆ MilleBinary()

gbl::MilleBinary::MilleBinary ( const std::string &  fileName = "milleBinaryISN.dat",
bool  doublePrec = false,
bool  keepZeros = false,
unsigned int  aSize = 2000 
)

Create binary file.

Parameters
[in]fileNameFile name
[in]doublePrecFlag for storage as double values
[in]keepZerosFlag for keeping global derivatives with value zero
[in]aSizeBuffer size

Definition at line 42 of file MilleBinary.cpp.

References doubleBuffer, doublePrecision, floatBuffer, and intBuffer.

◆ ~MilleBinary()

gbl::MilleBinary::~MilleBinary ( )
virtual

Definition at line 59 of file MilleBinary.cpp.

References binaryFile.

Member Function Documentation

◆ addData()

void gbl::MilleBinary::addData ( double  aMeas,
double  aErr,
unsigned int  numLocal,
unsigned int *  indLocal,
double *  derLocal,
const std::vector< int > &  labGlobal,
const std::vector< double > &  derGlobal 
)

Add data block to (end of) record.

Parameters
[in]aMeasValue
[in]aErrError
[in]numLocalNumber of local labels/derivatives
[in]indLocalArray of labels of local parameters
[in]derLocalArray of derivatives for local parameters
[in]labGlobalList of labels of global parameters
[in]derGlobalList of derivatives for global parameters

Definition at line 73 of file MilleBinary.cpp.

References doubleBuffer, doublePrecision, floatBuffer, globalDerKeepZeros, and intBuffer.

Referenced by gbl::GblTrajectory::milleOut().

◆ writeRecord()

void gbl::MilleBinary::writeRecord ( )

Write record to file.

Definition at line 114 of file MilleBinary.cpp.

References binaryFile, doubleBuffer, doublePrecision, floatBuffer, and intBuffer.

Referenced by gbl::GblTrajectory::milleOut().

Member Data Documentation

◆ binaryFile

std::ofstream gbl::MilleBinary::binaryFile
private

Binary File.

Definition at line 94 of file MilleBinary.h.

Referenced by writeRecord(), and ~MilleBinary().

◆ doubleBuffer

std::vector<double> gbl::MilleBinary::doubleBuffer
private

Double buffer.

Definition at line 97 of file MilleBinary.h.

Referenced by addData(), MilleBinary(), and writeRecord().

◆ doublePrecision

bool gbl::MilleBinary::doublePrecision
private

Flag for storage in as double values.

Definition at line 98 of file MilleBinary.h.

Referenced by addData(), MilleBinary(), and writeRecord().

◆ floatBuffer

std::vector<float> gbl::MilleBinary::floatBuffer
private

Float buffer.

Definition at line 96 of file MilleBinary.h.

Referenced by addData(), MilleBinary(), and writeRecord().

◆ globalDerKeepZeros

bool gbl::MilleBinary::globalDerKeepZeros
private

Flag for keeping global derivatives with value zero.

Definition at line 99 of file MilleBinary.h.

Referenced by addData().

◆ intBuffer

std::vector<int> gbl::MilleBinary::intBuffer
private

Integer buffer.

Definition at line 95 of file MilleBinary.h.

Referenced by addData(), MilleBinary(), and writeRecord().


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