test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
8 #ifndef MILLEBINARY_H_
9 #define MILLEBINARY_H_
10 
11 #include<fstream>
12 #include<vector>
13 
15 namespace gbl {
16 
18 
46 class MilleBinary {
47 public:
48  MilleBinary(const std::string fileName = "milleBinaryISN.dat",
49  bool doublePrec = false, unsigned int aSize = 2000);
50  virtual ~MilleBinary();
51  void addData(double aMeas, double aPrec,
52  const std::vector<unsigned int> &indLocal,
53  const std::vector<double> &derLocal,
54  const std::vector<int> &labGlobal,
55  const std::vector<double> &derGlobal);
56  void writeRecord();
57 
58 private:
59  std::ofstream binaryFile;
60  std::vector<int> intBuffer;
61  std::vector<float> floatBuffer;
62  std::vector<double> doubleBuffer;
64 };
65 }
66 #endif /* MILLEBINARY_H_ */
void writeRecord()
Write record to file.
Definition: MilleBinary.cc:89
MilleBinary(const std::string fileName="milleBinaryISN.dat", bool doublePrec=false, unsigned int aSize=2000)
Create binary file.
Definition: MilleBinary.cc:19
std::vector< int > intBuffer
Integer buffer.
Definition: MilleBinary.h:60
std::vector< double > doubleBuffer
Double buffer.
Definition: MilleBinary.h:62
virtual ~MilleBinary()
Definition: MilleBinary.cc:35
bool doublePrecision
Flag for storage in as double values.
Definition: MilleBinary.h:63
std::ofstream binaryFile
Binary File.
Definition: MilleBinary.h:59
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.
Definition: MilleBinary.cc:48
Millepede-II (binary) record.
Definition: MilleBinary.h:46
std::vector< float > floatBuffer
Float buffer.
Definition: MilleBinary.h:61