Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MilleBinary.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MilleBinary.h
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 aPrec,
74  const std::vector<unsigned int> &indLocal,
75  const std::vector<double> &derLocal,
76  const std::vector<int> &labGlobal,
77  const std::vector<double> &derGlobal);
78  void writeRecord();
79 
80 private:
81  std::ofstream binaryFile;
82  std::vector<int> intBuffer;
83  std::vector<float> floatBuffer;
84  std::vector<double> doubleBuffer;
86 };
87 }
88 #endif /* MILLEBINARY_H_ */