Belle II Software  release-08-01-10
MilleBinary Class Reference

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

#include <MilleBinary.h>

Collaboration diagram for MilleBinary:

Public Member Functions

 MilleBinary (const std::string &fileName="milleBinaryISN.dat", bool doublePrec=false, unsigned int aSize=2000)
 Create binary file. More...
 
void addData (double aMeas, double aPrec, const std::vector< unsigned int > &indLocal, const std::vector< 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.
 

Private Attributes

std::ofstream binaryFile
 Binary File.
 
std::vector< int > intBuffer
 Integer buffer.
 
std::vector< float > floatBuffer
 Float buffer.
 
std::vector< double > doubleBuffer
 Double buffer.
 
bool doublePrecision
 Flag for storage in as double values.
 

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
*

Definition at line 68 of file MilleBinary.h.

Constructor & Destructor Documentation

◆ MilleBinary()

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

Create binary file.

Parameters
[in]fileNameFile name
[in]doublePrecFlag for storage as double values
[in]aSizeBuffer size

Definition at line 41 of file MilleBinary.cc.

42  :
43  binaryFile(fileName.c_str(), std::ios::binary | std::ios::out), intBuffer(), floatBuffer(), doubleBuffer(), doublePrecision(
44  doublePrec) {
45  intBuffer.reserve(aSize);
46  intBuffer.push_back(0); // first word is error counter
47  if (doublePrecision) {
48  doubleBuffer.reserve(aSize);
49  doubleBuffer.push_back(0.);
50 
51  } else {
52  floatBuffer.reserve(aSize);
53  floatBuffer.push_back(0.);
54  }
55 }
std::vector< double > doubleBuffer
Double buffer.
Definition: MilleBinary.h:84
bool doublePrecision
Flag for storage in as double values.
Definition: MilleBinary.h:85
std::vector< int > intBuffer
Integer buffer.
Definition: MilleBinary.h:82
std::ofstream binaryFile
Binary File.
Definition: MilleBinary.h:81
std::vector< float > floatBuffer
Float buffer.
Definition: MilleBinary.h:83

Member Function Documentation

◆ addData()

void addData ( double  aMeas,
double  aErr,
const std::vector< unsigned int > &  indLocal,
const std::vector< 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]indLocalList of labels of local parameters
[in]derLocalList of derivatives for local parameters
[in]labGlobalList of labels of global parameters
[in]derGlobalList of derivatives for global parameters

Definition at line 70 of file MilleBinary.cc.


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