-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTigManager.h
139 lines (122 loc) · 3.96 KB
/
TigManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// part of TigSortGUI
// author: Ulrike Hager
#ifndef TIGMANAGER_H
#define TIGMANAGER_H
#include <string>
#include <vector>
#include <TFolder.h>
#include <TObjArray.h>
#include <TList.h>
#include <TThread.h>
#include <TH1.h>
#include <TMidasEvent.h>
#include "TigTree.h"
#include "TigEvent.h"
#include "TigDetector.h"
#include "TigScaler.h"
#include "TigUnpack.h"
#include "TigMidasHandler.h"
#include <RQ_OBJECT.h>
class TigManager
{
RQ_OBJECT("TigManager")
public:
TigManager(void);
virtual ~TigManager(void);
static TigManager& Instance(void);
int AnaEventID(){return mAnaEventID;}
bool ConfigFromRootFile(std::string filename);
void ConnectFormulas();
void DeleteHistos(void);
void DeleteFormulas(void);
void DeleteTrees(void);
bool FlushTreeBuffers(int pCutoff);
void GenerateTrees(bool trees);
std::vector<TigDataObject*> GetDataObjects(std::string tree);
std::vector<std::string> GetDetectors(std::string tree);
bool GetGenerateTrees(){return mGenerateTrees;}
std::vector<std::string> GetHistos(std::string tree);
const char* GetOutFile(){ return mOutFile.c_str();}
int GetOutfileSetting(){return mSingleOutfile;}
const char * GetOutPostfix(){return mOutPostfix.c_str();}
const char* GetOutPrefix(){ return mOutPrefix.c_str();}
TList * GetRunFiles(){return mRunFiles;}
std::string GetTreeName(int index);
int GuiInterval(){return mGuiInterval;}
TH1 *Histogram(int treeN, int histN);
void HistoUpdate() ; // *SIGNAL*
int HistoUpdateInterval(){return mHistoUpdateInterval;}
void IncAnaEventID(){mAnaEventID++;}
bool IsRunning(){return mRunning;}
bool KeepRunning(){return mKeepRunning;}
TigMidasHandler *MidasHandler(){return mMidasHandler;}
void ParseCalibrationFile(std::string configFile);
void ParseFormHistFile(std::string configFile);
void ParseInputFile(std::string configFile);
void ProcessTig64(TMidasEvent* pEvent, std::string pBankName);
void ProcessSignal(TigEvent* pEvent);
void ProcessScaler(TMidasEvent* pEvent);
void ProcessScalerData(std::string pBankName, std::vector<int> pValues);
void ResetHistos(void);
void ResetTrees(void);
void RunRoot(int treeN);
int RunNumber(){return mRunNumber;}
void Run();
void SaveHistos();
void SaveTrees(int treeN);
void SetGuiInterval(int time);
void SetHistoUpdateInterval(int time);
void SetOutFile( char *out){mOutFile = out;}
void SetOutPostfix( char *out){mOutPostfix = out;}
void SetOutPrefix( char *out){mOutPrefix = out;}
void SetRunFiles(TList *list);
void SetRunNumber(int num){mRunNumber = num;}
bool SetWriteDet(int treeN, int det);
void StepMidasFile();
void Stepped(){mSteps++;}
void StepTrees(bool step);
void StopRunning();
void SwitchOutfileSetting(Int_t index){mSingleOutfile = index-1;}
int TimeStamp(){return mTimeStamp;}
std::vector<std::string> TreeNames();
void Write(void){}
bool mHasConfig;
bool mHasRootConfig;
bool mHasMidasFiles;
bool mHasRootFiles;
protected: //----- protected ------------------
// void CreateWindow(void);
bool OpenTreeOutFile(int treeN);
// TigDetector *ParseDetector(istream& pStream);
void ParsePrimitive(std::string pToken, istream& pStream);
// TigScaler *ParseScaler(istream& pStream);
void RunHisto();
void ParseTree(istream& pStream);
int mAnaEventID; // global event ID used by all trees
int mBuffer;
bool mGenerateTrees;
int mGuiInterval;
int mHistoUpdateInterval;
// TigFrame *mFrame;
bool mKeepRunning;
TigMCSUnpack* mMCSUnpack;
TigMidasHandler *mMidasHandler;
std::string mOutFile;
std::string mOutPrefix;
std::string mOutPostfix;
TFile *mRootInfile;
TFile *mRootOutfile;
TList *mRunFiles;
bool mRunning;
int mRunNumber;
bool mSingleOutfile;
int mSteps;
int mTimeStamp; // MIDAS event time stamp used by all trees
std::vector<TigTree*> mTrees;
TigUnpack* mUnpack;
private:
TigManager(const TigManager& );
TigManager& operator = ( const TigManager& );
// ClassDef(TigManager,0)
};
#endif /* TIGMANAGER_H */