Diana Software
MQinoDataReader.hh
Go to the documentation of this file.
1 
36 #ifndef _Q_QINODATAREADER_HH
37 #define _Q_QINODATAREADER_HH
38 
39 #include "QReader.hh"
40 #include "QDiana.hh"
41 #include "QRunData.hh"
42 #include <string>
43 #include <vector>
44 #include "zlib.h"
45 
46 //structure for file name and characteristics needed for appropriate
47 // reading
48 struct QFile_t {
49  std::string filename;
50  bool isDiff;
51 };
52 
53 
54 using namespace Diana;
55 
56 
57 class MQinoDataReader : public QReader {
58 
59  public:
61 
62  virtual ~MQinoDataReader();
63 
64  // Init method is called before event loop
65  void Init(QEventAssembler& evi);
66 
67  // Doit method is called for each event, getting the event as argument
68  bool Do(QEventAssembler& evi);
69 
70  // Done method is called after event loop
71  void Done();
72 
73  // MARIA
74  // Jump to Event . Partial to jump is stored in fPartialToJump
75  const QError& JumpToEvent(Long64_t event);
76 
77  private:
78 
80  void NewRun();
81 
82  float fMinAdcRange, fMaxAdcRange;
85  Int_t frecord_size;
86  std::string fRunNumber;
87  std::vector<QFile_t> files;
88 
90  std::vector<QFile_t>::iterator filesIter;
91 
93  std::vector<QFile_t>::iterator filesEnd;
94 
96  std::vector<std::string>::iterator fIter;
97 
100  std::string fFileUName;
101 
103  gzFile fCurrentFile;
104 
106  int fRunEventNumber;
107 
108  /*@brief used to fill the run list*/
109  struct QFile_t f;
110 
111  /*@brief identifier of the current run, as listed in the file list*/
112  std::string fName;
113 
114  /*@brief date of the current run */
115  std::string fDate;
116 
117  /*@brief number of pre trigger samples */
119 
120  /*@brief true if the input file is a noise one */
121  size_t fIsNoise;
122 
124  bool fDebugOn;
125 
128 
130  char *fTimeZone;
131 
132  unsigned int fEventNumber;
133 
134  // MARIA
136 
137  friend class MQinoCompleteDataReader;
138  friend class MQinoMiCompleteDataReader;
139 
140 
141 };
142 
145  char cHeader[8];
146  short chan;
147  unsigned short pulseTime1;
148  unsigned short pulseTime2;
149  short first_sampl;
150  short sampl[1023];
151 };
152 
153 #endif
class wrapper to DetectorName_
Milano-DAQ binary data reader.
std::string fFileUName
file name in the file list of QReader. Modified whenever the run (not the partial measurement!...
std::vector< QFile_t >::iterator filesIter
points to the current partial file of the current measurement
bool fDebugOn
Add variables for debug to the event.
std::string fRunNumber
std::vector< std::string >::iterator fIter
iterator on QReader file list. It it incremented whenever the run is changed
gzFile fCurrentFile
current partial measurement file
unsigned int fEventNumber
std::vector< QFile_t >::iterator filesEnd
points next to the last partial file of the current measurement
std::vector< QFile_t > files
DetectorName fDetector
Current detector.
char * fTimeZone
Time zone from TZ environment variable.
error class with error type and description
Definition: QError.hh:115
Visitor class of QEvent that provides full handling of QEvent.
Base class for diana event readers.
Definition: QReader.hh:50
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...
structure for raw data Qino format
unsigned short pulseTime1
unsigned short pulseTime2
std::string filename