ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
GETDecoder2.h
Go to the documentation of this file.
1 // =================================================
2 // GETDecoder Class
3 //
4 //
5 // Author:
6 // Genie Jhang ( geniejhang@majimak.com )
7 //
8 // Log:
9 // - 2015. 11. 09
10 // Start writing new! class
11 // =================================================
12 
13 #ifndef GETDECODER2
14 #define GETDECODER2
15 
16 #include <Rtypes.h>
17 #include <TString.h>
18 
19 #include <fstream>
20 #include <vector>
21 
22 class GETBasicFrame;
24 class GETCoboFrame;
25 class GETFrameInfo;
26 class GETHeaderBase;
27 class GETLayerHeader;
28 class GETLayeredFrame;
29 class GETTopologyFrame;
30 class TBuffer;
31 class TClass;
32 class TClonesArray;
33 class TMemberInspector;
34 
35 // class GETPlot;
36 
38 class GETDecoder2 {
39 public:
41  GETDecoder2();
43  GETDecoder2(TString filename );
44 
45  void Clear();
46 
49 
51  void SetNumTbs(Int_t value = 512);
53  Bool_t AddData(TString filename);
55  Bool_t SetData(Int_t index);
56  void SetDiscontinuousData(Bool_t value = kTRUE);
57  Bool_t NextData();
60  void SetPositivePolarity(Bool_t value = kTRUE);
62  void ShowList();
64  Int_t GetNumData();
66  TString GetDataName(Int_t index);
67 
69  Int_t GetNumTbs();
73 
74  Int_t GetNumFrames();
76  GETBasicFrame *GetBasicFrame(Int_t frameID = -1);
77  GETCoboFrame *GetCoboFrame(Int_t frameID = -1);
78  GETLayeredFrame *GetLayeredFrame(Int_t frameID = -1);
79 
80  void PrintFrameInfo(Int_t frameID = -1);
81  void PrintCoboFrameInfo(Int_t frameID = -1);
82 
84  Bool_t SetWriteFile(TString filename, Bool_t overwrite = kFALSE);
86  void WriteFrame();
87 
88  void CheckEndOfData();
89 
90  void BackupCurrentState();
91  void RestorePreviousState();
92 
93  void SetPseudoTopologyFrame(Int_t asadMask, Bool_t check = kFALSE);
94 
95 private:
97  void Initialize();
98 
99  GETHeaderBase *fHeaderBase;
100  GETBasicFrameHeader *fBasicFrameHeader;
101  GETLayerHeader *fLayerHeader;
102 
103  GETTopologyFrame *fTopologyFrame;
104  GETBasicFrame *fBasicFrame;
105  GETCoboFrame *fCoboFrame;
106  GETLayeredFrame *fLayeredFrame;
107 
108  TClonesArray *fFrameInfoArray;
109  TClonesArray *fCoboFrameInfoArray;
110  GETFrameInfo *fFrameInfo;
111  GETFrameInfo *fCoboFrameInfo;
112 
113  Int_t fNumTbs;
114 
116  EFrameType fFrameType;
117  ULong64_t fFrameSize;
118 
119  Bool_t fIsDataInfo;
120  Bool_t fIsDoneAnalyzing;
121  Bool_t fIsPositivePolarity;
122  Bool_t fIsContinuousData;
123  Bool_t fIsMetaData;
124 
125  std::ifstream fData;
126  ULong64_t fDataSize;
127  std::vector<TString> fDataList;
128  Int_t fCurrentDataID;
129 
130  Int_t fFrameInfoIdx;
131  Int_t fCoboFrameInfoIdx;
132  Int_t fTargetFrameInfoIdx;
133 
134  Char_t *fBuffer;
135  TString fWriteFile;
136 
137  Int_t fPrevDataID;
138  ULong64_t fPrevPosition;
139 
140  ClassDef(GETDecoder2, 1);
141 };
142 
143 #endif
GETDecoder2::kCobo
@ kCobo
Definition: GETDecoder2.h:48
GETDecoder2::RestorePreviousState
void RestorePreviousState()
Definition: GETDecoder2.cxx:730
GETDecoder2::GetFrameType
EFrameType GetFrameType()
Definition: GETDecoder2.cxx:338
GETDecoder2::GetBasicFrame
GETBasicFrame * GetBasicFrame(Int_t frameID=-1)
Return specific frame of the given frame number. If frameID is -1, this method returns next frame.
Definition: GETDecoder2.cxx:357
GETDecoder2::GETDecoder2
GETDecoder2()
Constructor.
Definition: GETDecoder2.cxx:43
GETDecoder2::GetDataName
TString GetDataName(Int_t index)
Return the filename of data at index.
Definition: GETDecoder2.cxx:323
GETLayerHeader
Definition: GETLayerHeader.h:18
GETBasicFrame
Definition: GETBasicFrame.h:14
GETDecoder2::GetLayeredFrame
GETLayeredFrame * GetLayeredFrame(Int_t frameID=-1)
Definition: GETDecoder2.cxx:526
GETDecoder2::SetNumTbs
void SetNumTbs(Int_t value=512)
Setting the number of time buckets.
Definition: GETDecoder2.cxx:179
GETDecoder2::CheckEndOfData
void CheckEndOfData()
Definition: GETDecoder2.cxx:708
GETDecoder2::WriteFrame
void WriteFrame()
Write current frame.
Definition: GETDecoder2.cxx:665
GETDecoder2
Definition: GETDecoder2.h:38
GETDecoder2::GetNumData
Int_t GetNumData()
Return the number of data added in the list.
Definition: GETDecoder2.cxx:318
GETDecoder2::GetNumTbs
Int_t GetNumTbs()
Return the number of time buckets.
Definition: GETDecoder2.cxx:334
GETDecoder2::kMergedTime
@ kMergedTime
Definition: GETDecoder2.h:48
GETDecoder2::SetData
Bool_t SetData(Int_t index)
Set the data file to the class.
Definition: GETDecoder2.cxx:210
GETDecoder2::Clear
void Clear()
Clear data information.
Definition: GETDecoder2.cxx:141
GETDecoder2::PrintFrameInfo
void PrintFrameInfo(Int_t frameID=-1)
Definition: GETDecoder2.cxx:599
GETDecoder2::SetPseudoTopologyFrame
void SetPseudoTopologyFrame(Int_t asadMask, Bool_t check=kFALSE)
Definition: GETDecoder2.cxx:741
GETFrameInfo
Definition: GETFrameInfo.h:11
GETDecoder2::GetNumFrames
Int_t GetNumFrames()
Definition: GETDecoder2.cxx:343
GETDecoder2::NextData
Bool_t NextData()
Search the next file and set it if exists. Returns 1 if successful.
Definition: GETDecoder2.cxx:293
GETDecoder2::SetWriteFile
Bool_t SetWriteFile(TString filename, Bool_t overwrite=kFALSE)
Set the file for writing frame.
Definition: GETDecoder2.cxx:627
GETHeaderBase
Definition: GETHeaderBase.h:23
GETDecoder2::GetCoboFrame
GETCoboFrame * GetCoboFrame(Int_t frameID=-1)
Definition: GETDecoder2.cxx:419
GETDecoder2::PrintCoboFrameInfo
void PrintCoboFrameInfo(Int_t frameID=-1)
Definition: GETDecoder2.cxx:608
GETDecoder2::SetPositivePolarity
void SetPositivePolarity(Bool_t value=kTRUE)
Set the positive signal polarity.
Definition: GETDecoder2.cxx:300
GETDecoder2::BackupCurrentState
void BackupCurrentState()
Definition: GETDecoder2.cxx:724
GETBasicFrameHeader
Definition: GETBasicFrameHeader.h:21
GETLayeredFrame
Definition: GETLayeredFrame.h:16
GETDecoder2::kMergedID
@ kMergedID
Definition: GETDecoder2.h:48
GETCoboFrame
Definition: GETCoboFrame.h:14
GETTopologyFrame
Definition: GETTopologyFrame.h:20
GETDecoder2::kBasic
@ kBasic
Definition: GETDecoder2.h:48
GETDecoder2::AddData
Bool_t AddData(TString filename)
Add the data file to the list of rawdata.
Definition: GETDecoder2.cxx:184
GETDecoder2::EFrameType
EFrameType
Frame type enumerator.
Definition: GETDecoder2.h:48
GETDecoder2::SetDiscontinuousData
void SetDiscontinuousData(Bool_t value=kTRUE)
Definition: GETDecoder2.cxx:289
GETDecoder2::ShowList
void ShowList()
Print rawdata file list on the screen.
Definition: GETDecoder2.cxx:305