er  dev
ERTektronixSource.h
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef ERTektronixSource_H
10 #define ERTektronixSource_H
11 
12 #include <stdio.h>
13 #include <map>
14 #include <fstream>
15 
16 using namespace std;
17 
18 #include "TString.h"
19 
20 #include "FairSource.h"
21 
22 #include "ERNeuRadRawEvent.h"
23 
24 class TString;
25 
26 class FairSource;
27 
28 class ERNeuRadRawEvent;
29 
36 class ERTektronixSource : public FairSource
37 {
38  public:
40  ERTektronixSource(const ERTektronixSource& source);
41  virtual ~ERTektronixSource();
42 
43  virtual Bool_t Init();
44 
45  virtual Int_t ReadEvent(UInt_t=0);
46 
47  virtual void Close();
48 
49  virtual void Reset();
50 
51  virtual Source_Type GetSourceType(){return kFILE;}
52 
53  virtual void SetParUnpackers(){}
54 
55  virtual Bool_t InitUnpackers(){return kTRUE;}
56 
57  virtual Bool_t ReInitUnpackers(){return kTRUE;}
58 
59  void AddFile(Int_t chanel, TString path);
60  void SetNPoints(Int_t pointsNb){fNPoints = pointsNb;}
61  void SetNChanels(Int_t chanels){fNChanels = chanels;}
62  private:
63  map<Int_t, vector<TString> > fPaths;
64  map<Int_t, ifstream*> fCurrenStream;
65  Int_t fNPoints;
66  Int_t fNProcessedFiles;
67  Int_t fNForProcFiles;
68  Int_t fNChanels;
69  map<Int_t, Int_t> fCurrentFiles;
70 
71  //Output data
72  ERNeuRadRawEvent** fRawEvents;
73 
74  static Int_t fEvent;
75  public:
76  ClassDef(ERTektronixSource, 1)
77 };
78 
79 
80 #endif
task for reading raw data from text files
class for raw data obtained from measurements or simulations