45Mille::Mille(
const char *outFileName,
bool asBinary,
bool writeZero) :
46 myOutFile(outFileName, (asBinary ? (std::ios::binary | std::ios::out) : std::ios::out)),
47 myAsBinary(asBinary), myWriteZero(writeZero), myBufferPos(-1), myHasSpecial(false)
55 std::cerr <<
"Mille::Mille: Could not open " << outFileName
56 <<
" as output file." << std::endl;
79 int NGL,
const float *derGl,
const int *label,
80 float rMeas,
float sigma)
82 if (
sigma <= 0.)
return;
92 for (
int i = 0;
i < NLC; ++
i) {
106 for (
int i = 0;
i < NGL; ++
i) {
113 std::cerr <<
"Mille::mille: Invalid label " << label[
i]
129 if (nSpecial == 0)
return;
132 std::cerr <<
"Mille::special: Special values already stored for this record."
153 for (
int i = 0;
i < nSpecial; ++
i) {
175 myOutFile.write(
reinterpret_cast<const char*
>(&numWordsToWrite),
176 sizeof(numWordsToWrite));
218 std::cerr <<
"Mille::checkBufferSize: Buffer too short ("
220 <<
"\n need space for nLocal (" << nLocal<<
")"
221 <<
"/nGlobal (" << nGlobal <<
") local/global derivatives, "
void end()
Write buffer (set of derivatives with same local parameters) to file.
int myBufferInt[myBufferSize]
to collect labels etc.
bool myAsBinary
if false output as text
bool checkBufferSize(int nLocal, int nGlobal)
Enough space for next nLocal + nGlobal derivatives incl. measurement?
void special(int nSpecial, const float *floatings, const int *integers)
Add special data to buffer.
std::ofstream myOutFile
C-binary for output.
bool myHasSpecial
if true, special(..) already called for this record
void kill()
Reset buffers, i.e. kill derivatives accumulated for current set.
float myBufferFloat[myBufferSize]
to collect derivatives etc.
int myBufferPos
position in buffer
void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma)
Add measurement to buffer.
bool myWriteZero
if true also write out derivatives/labels ==0
Mille(const char *outFileName, bool asBinary=true, bool writeZero=false)
author : Gero Flucke, University Hamburg, 2006 date : October 2006
void newSet()
Initialize for new set of locals, e.g. new track.
real(mps), dimension(nplan) sigma
measurement sigma (hit)