CMS 3D CMS Logo

MilleBinary.h
Go to the documentation of this file.
1 /*
2  * MilleBinary.h
3  *
4  * Created on: Aug 31, 2011
5  * Author: kleinwrt
6  */
7 
30 #ifndef MILLEBINARY_H_
31 #define MILLEBINARY_H_
32 
33 #include<fstream>
34 #include<vector>
35 
37 namespace gbl {
38 
40 
68  class MilleBinary {
69  public:
70  MilleBinary(const std::string& fileName = "milleBinaryISN.dat",
71  bool doublePrec = false, unsigned int aSize = 2000);
72  virtual ~MilleBinary();
73  void addData(double aMeas, double aErr, unsigned int numLocal,
74  unsigned int* indLocal, double* derLocal,
75  const std::vector<int> &labGlobal,
76  const std::vector<double> &derGlobal);
77  void writeRecord();
78 
79  private:
80  std::ofstream binaryFile;
81  std::vector<int> intBuffer;
82  std::vector<float> floatBuffer;
83  std::vector<double> doubleBuffer;
85  };
86 }
87 #endif /* MILLEBINARY_H_ */
MilleBinary(const std::string &fileName="milleBinaryISN.dat", bool doublePrec=false, unsigned int aSize=2000)
Create binary file.
Definition: MilleBinary.cc:41
void writeRecord()
Write record to file.
Definition: MilleBinary.cc:113
std::vector< int > intBuffer
Integer buffer.
Definition: MilleBinary.h:81
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.
Definition: MilleBinary.cc:72
std::vector< double > doubleBuffer
Double buffer.
Definition: MilleBinary.h:83
Namespace for the general broken lines package.
virtual ~MilleBinary()
Definition: MilleBinary.cc:58
bool doublePrecision
Flag for storage in as double values.
Definition: MilleBinary.h:84
std::ofstream binaryFile
Binary File.
Definition: MilleBinary.h:80
Millepede-II (binary) record.
Definition: MilleBinary.h:68
std::vector< float > floatBuffer
Float buffer.
Definition: MilleBinary.h:82