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