ROOTANA
Loading...
Searching...
No Matches
anaDisplay.cxx
Go to the documentation of this file.
1#include <stdio.h>
2#include <iostream>
3
4#include "TRootanaDisplay.hxx"
5#include "TH1D.h"
6#include "TV792Data.hxx"
7
10
11
12#include "TAnaManager.hxx"
13#include "TTRB3Data.hxx"
14
16
17public:
18
19 // An analysis manager. Define and fill histograms in
20 // analysis manager.
22
24 SetOutputFilename("example_output");
25 DisableRootOutput(false);
26 anaManager = new TAnaManager();
27 // Number of events to skip before plotting one.
28 //SetNumberSkipEvent(10);
29 // Choose to use functionality to update after X seconds
31 // Uncomment this to enable the 'interesting event' functionality.
32 //iem_t::instance()->Enable();
33 }
34
36
37 // Set up tabbed canvases
38
39 // Set up all the listed canvases from the AnaManager list of THistogramArrayBases
40 std::vector<THistogramArrayBase*> histos = anaManager->GetHistograms();
41
42 for (unsigned int i = 0; i < histos.size(); i++) {
43 TCanvasHandleBase* canvas = histos[i]->CreateCanvas();
44 if (canvas) {
45 AddSingleCanvas(canvas, histos[i]->GetTabName());
46 }
47 }
48
49 SetDisplayName("Example Display");
50 };
51
52 virtual ~MyTestLoop() {};
53
54 void BeginRun(int transition,int run,int time) {
55 std::cout << "User BOR method" << std::endl;
57 std::cout << "End User BOR method" << std::endl;
58 }
59
60 void EndRun(int transition,int run,int time) {
61 std::cout << "User EOR method" << std::endl;
63 }
64
66
68 // Update the cumulative histograms here
70 }
71
73 // Update the transient (per-event) histograms here.
74 // saves CPU to not update them always when not being used.
76 }
77
78};
79
80
81
82
83
84
85int main(int argc, char *argv[])
86{
88 return MyTestLoop::Get().ExecuteLoop(argc, argv);
89}
90
int main(int argc, char *argv[])
void UpdateHistograms(TDataContainer &dataContainer)
This method can be implemented by users to update user histograms.
void EndRun(int transition, int run, int time)
void PlotCanvas(TDataContainer &dataContainer)
This method can be implemented by users to plotting of current canvas.
TAnaManager * anaManager
void AddAllCanvases()
User must.
virtual ~MyTestLoop()
void ResetHistograms()
This method can be implemented by users to plotting of current canvas.
void BeginRun(int transition, int run, int time)
void EndRun(int transition, int run, int time)
int ProcessMidasEvent(TDataContainer &dataContainer)
Processes the midas event, fills histograms, etc.
void UpdateTransientPlots(TDataContainer &dataContainer)
std::vector< THistogramArrayBase * > GetHistograms()
void BeginRun(int transition, int run, int time)
void AddSingleCanvas(std::string name, std::string subtab_name=std::string(""))
Add a new canvas; user will interactively fill it.
void SetDisplayName(std::string name)
Set Display name.
void SetOnlineUpdatingBasedSeconds(bool updateBasedSeconds=true)
static TRootanaEventLoop & Get(void)
void DisableRootOutput(bool disable=true)
void SetOutputFilename(std::string name)
int ExecuteLoop(int argc, char *argv[])
Method to actually process the Midas information, either as file or online.
static void CreateSingleton()