ROOTANA
Loading...
Searching...
No Matches
root_server.cxx
Go to the documentation of this file.
1// Default program for dealing with various standard TRIUMF VME setups:
2// V792, V1190 (VME), L2249 (CAMAC), Agilent current meter
3//
4//
5
6#include <stdio.h>
7#include <iostream>
8#include <time.h>
9
10#include "TRootanaEventLoop.hxx"
11#include "TAnaManager.hxx"
12
13
14class Analyzer: public TRootanaEventLoop {
15
16
17
18
19public:
20
21 // An analysis manager. Define and fill histograms in
22 // analysis manager.
24
26 //DisableAutoMainWindow();
28 anaManager = 0;
30 SetOnlineName("jsroot_server");
32
33 };
34
35
36 virtual ~Analyzer() {};
37
38 void Initialize(){
39
40#ifdef HAVE_THTTP_SERVER
41 std::cout << "Using THttpServer in read/write mode" << std::endl;
43#endif
44
45 }
46
48
49 if(anaManager)
50 delete anaManager;
51 anaManager = new TAnaManager();
52
53 }
54
55
56 void BeginRun(int transition,int run,int time){
57
59
60 }
61
63
65
67
69
70 // Only update the transient histograms (like waveforms or event displays) every second.
71 // Otherwise hammers CPU for no reason.
72 struct timeval nowTime;
74 double dtime = nowTime.tv_sec - LastUpdateTime.tv_sec + (nowTime.tv_usec - LastUpdateTime.tv_usec)/1000000.0;
75 if(dtime > 1.0){
78 }
79
80 return true;
81 }
82
83
84};
85
86
87int main(int argc, char *argv[])
88{
89
91 return Analyzer::Get().ExecuteLoop(argc, argv);
92
93}
94
void InitManager()
void BeginRun(int transition, int run, int time)
bool ProcessMidasEvent(TDataContainer &dataContainer)
struct timeval LastUpdateTime
TAnaManager * anaManager
Definition ana.cxx:23
void Initialize()
virtual ~Analyzer()
int ProcessMidasEvent(TDataContainer &dataContainer)
Processes the midas event, fills histograms, etc.
void UpdateTransientPlots(TDataContainer &dataContainer)
static TRootanaEventLoop & Get(void)
void DisableRootOutput(bool disable=true)
void UseBatchMode()
Use a batch mode, where we don't check ROOT status.
int ExecuteLoop(int argc, char *argv[])
Method to actually process the Midas information, either as file or online.
void SetOnlineName(std::string name)
static void CreateSingleton()
void SetTHttpServerReadWrite(bool readwrite=true)
int main(int argc, char *argv[])