CMS 3D CMS Logo

Mille.h
Go to the documentation of this file.
1 #ifndef MILLE_H
2 #define MILLE_H
3 
4 #include <fstream>
5 
26 class Mille {
27 public:
28  Mille(const char *outFileName, bool asBinary = true, bool writeZero = false);
29  ~Mille();
30 
31  void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma);
32  void special(int nSpecial, const float *floatings, const int *integers);
33  void kill();
34  void flushOutputFile();
35  void resetOutputFile();
36  void end();
37 
38 private:
39  void newSet();
40  bool checkBufferSize(int nLocal, int nGlobal);
41 
42  const std::ios_base::openmode fileMode_; // file open mode of the binary
43  const std::string fileName_; // file name of the binary
44  std::ofstream outFile_; // C-binary for output
45  bool asBinary_; // if false output as text
46  bool writeZero_; // if true also write out derivatives/lables ==0
47 
48  enum { bufferSize_ = 5000 };
49  int bufferInt_[bufferSize_]; // to collect labels etc.
50  float bufferFloat_[bufferSize_]; // to collect derivatives etc.
52  bool hasSpecial_; // if true, special(..) already called for this record
53 
54  enum { maxLabel_ = (0xFFFFFFFF - (1 << 31)) }; // largest label allowed: 2^31 - 1
55 };
56 #endif
void newSet()
Definition: Mille.cc:176
bool writeZero_
Definition: Mille.h:46
void resetOutputFile()
Definition: Mille.cc:138
int bufferInt_[bufferSize_]
Definition: Mille.h:49
Mille(const char *outFileName, bool asBinary=true, bool writeZero=false)
Definition: Mille.cc:17
float bufferFloat_[bufferSize_]
Definition: Mille.h:50
char const * label
void end()
Definition: Mille.cc:149
std::ofstream outFile_
Definition: Mille.h:44
void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma)
Definition: Mille.cc:46
void flushOutputFile()
Definition: Mille.cc:131
bool checkBufferSize(int nLocal, int nGlobal)
Definition: Mille.cc:186
bool asBinary_
Definition: Mille.h:45
bool hasSpecial_
Definition: Mille.h:52
Definition: Mille.h:26
void kill()
Definition: Mille.cc:124
const std::ios_base::openmode fileMode_
Definition: Mille.h:42
~Mille()
Definition: Mille.cc:39
void special(int nSpecial, const float *floatings, const int *integers)
Definition: Mille.cc:88
int bufferPos_
Definition: Mille.h:51
const std::string fileName_
Definition: Mille.h:43