1 | // $Id: SimpleTelemetry.hh 1655 2005-04-06 14:03:43Z thea $ |
---|
2 | // Author: M. Pallavicini |
---|
3 | // write MacroCell data onto a ASCII file |
---|
4 | // May-6-2003 modified to produce temporary ASCII file for reco |
---|
5 | // |
---|
6 | |
---|
7 | /***************************************************************************** |
---|
8 | * ESAF: Euso Simulation and Analysis Framework * |
---|
9 | * * |
---|
10 | * Id: SimpleTelemetry * |
---|
11 | * Package: Electronics * |
---|
12 | * Coordinator: Marco.Pallavicini * |
---|
13 | * * |
---|
14 | *****************************************************************************/ |
---|
15 | |
---|
16 | #ifndef _SIMPLETELEMETRY_HH_ |
---|
17 | #define _SIMPLETELEMETRY_HH_ |
---|
18 | |
---|
19 | #include <iostream> |
---|
20 | #include <vector> |
---|
21 | #include <stdio.h> |
---|
22 | #include <string> |
---|
23 | #include <zlib.h> |
---|
24 | #include "utils.hh" |
---|
25 | #include "euso.hh" |
---|
26 | |
---|
27 | #include "Telemetry.hh" |
---|
28 | #include "EsafMsgSource.hh" |
---|
29 | |
---|
30 | //////////////////////////////////////////////////////////////////////////////// |
---|
31 | // // |
---|
32 | // SimpleTelemetry // |
---|
33 | // // |
---|
34 | // Write MacroCell data onto a ASCII file // |
---|
35 | // // |
---|
36 | //////////////////////////////////////////////////////////////////////////////// |
---|
37 | |
---|
38 | class SimpleTelemetry : public Telemetry, public EsafMsgSource { |
---|
39 | public: |
---|
40 | |
---|
41 | // ctor |
---|
42 | SimpleTelemetry(); |
---|
43 | |
---|
44 | // dtor |
---|
45 | virtual ~SimpleTelemetry(); |
---|
46 | |
---|
47 | // simulate third level trigger at TCU level and |
---|
48 | // on-board data handling; does nothing in this implementation |
---|
49 | virtual void SimulateTCU(); |
---|
50 | |
---|
51 | // open output file |
---|
52 | virtual Bool_t Open( const char* ); |
---|
53 | |
---|
54 | // close output file |
---|
55 | virtual Bool_t Close(); |
---|
56 | |
---|
57 | // write event on output file |
---|
58 | virtual Bool_t Write(); |
---|
59 | |
---|
60 | // get ready for next event |
---|
61 | virtual void Clear(); |
---|
62 | |
---|
63 | // dump on string |
---|
64 | virtual string& Dump(); |
---|
65 | |
---|
66 | // add data from a macrocell |
---|
67 | virtual void Add( MacroCellData* ); |
---|
68 | |
---|
69 | // returns the number of macrocell that gave some data |
---|
70 | virtual int NumCell() const {return (int)(fData.size());} |
---|
71 | |
---|
72 | // returns macrocell data |
---|
73 | virtual MacroCellData* GetData(int ncell) {return fData[ncell];} |
---|
74 | |
---|
75 | private: |
---|
76 | |
---|
77 | string fTextDump; // string used by Dump |
---|
78 | string fFileName; // output file name |
---|
79 | gzFile fp; // output file |
---|
80 | |
---|
81 | vector<MacroCellData*> fData; // vector with macrocell data |
---|
82 | |
---|
83 | void WriteData(); |
---|
84 | void WriteHeader(); |
---|
85 | |
---|
86 | ClassDef(SimpleTelemetry,0) |
---|
87 | }; |
---|
88 | |
---|
89 | #endif |
---|