FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Mille.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #ifndef MILLE_H
9 #define MILLE_H
10 
11 #include <fstream>
12 
33 #include <fstream>
34 #include <iostream>
35 
36 class Mille
37 {
38  public:
39  Mille(const char* outFileName, bool asBinary = true, bool writeZero = false);
40  ~Mille();
41 
42  void mille(int NLC, const float* derLc, int NGL, const float* derGl, const int* label, float rMeas, float sigma);
43  void special(int nSpecial, const float* floatings, const int* integers);
44  void kill();
45  void end();
46 
47  private:
48  void newSet();
49  bool checkBufferSize(int nLocal, int nGlobal);
50 
51  std::ofstream myOutFile; // C-binary for output
52  bool myAsBinary; // if false output as text
53  bool myWriteZero; // if true also write out derivatives/lables ==0
54 
55  enum
56  {
57  myBufferSize = 10000
58  };
59  int myBufferInt[myBufferSize]; // to collect labels etc.
60  float myBufferFloat[myBufferSize]; // to collect derivatives etc.
61  int myBufferPos;
62  bool myHasSpecial; // if true, special(..) already called for this record
63 
64  enum
65  {
66  myMaxLabel = (0xFFFFFFFF - (1 << 31))
67  }; // largest label allowed: 2^31 - 1
68 };
69 #endif
Mille(const char *outFileName, bool asBinary=true, bool writeZero=false)
Definition: Mille.cc:15
void end()
Definition: Mille.cc:121
void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma)
Definition: Mille.cc:38
Definition: Mille.h:36
void kill()
Definition: Mille.cc:115
~Mille()
Definition: Mille.cc:32
void special(int nSpecial, const float *floatings, const int *integers)
Definition: Mille.cc:82