ROOTANA
displayDoc.cxx
Go to the documentation of this file.
1 
2 /*! \page displayClass Display Classes
3 
4 \section displayIntro Introduction
5 
6 TRootanaDisplay is an attempt to provide a simple way of
7 making ROOT event displays that can quickly be used to show
8 ADC/TDC spectrum or whatever else you'd like to plot.
9 
10 
11 \section displayUsage Using TRootanaDisplay
12 
13 TRootanaDisplay is an abstract base class for event displays.
14 Users need to define a class that derives from this class in order to
15 make an event display. The only method that users must implement
16 is the method AddAllCanvas(), where the user defines which tabs to use.
17 
18 The user then needs to define how they what to update and plot histograms.
19 The updating of histograms happens for each event.
20 In online mode, the plotting of histograms only happens for each NN events, where
21 NN is controlled by the user.
22 For offline mode the plotting happens for each event.
23 
24 There are three ways that users can decide to update and plot histograms:
25 1) They can create histograms in their event display class and then fill
26  the methods UpdateHistograms(TDataContainer) and PlotCanvas(TDataContainer).
27  This histograms can then fill in the canvases that are added using
28  AddSingleCanvas(std::string name).
29 2) They can create classes that are derived from TCanvasHandleBase. The derived
30  classes are then added using the method AddSingleCanvas(TCanvasHandleBase* handleClass).
31 3) They can create a histogram-set class (derived from THistogramArrayBase) and
32 pass it to TFancyHistogramCanvas. This provides a richer set of button control
33 of the histogram display.
34 
35 There is no substantial difference between the first two methods. The second method
36 is mainly meant to allow the user to separate the methods into separate files
37 for code cleaniness.
38 
39 The actual ROOT GUI is encapsulated in a separate class TMainDisplayWindow.
40 The TRootanaDisplay has an instance of this TMainDisplayWindow class.
41 Users will be need to access the TMainDisplayWindow by calling
42 
43 TRootanaDisplay::GetDisplayWindow()
44 
45 in order to grab the particular canvas that we want plot on.
46 
47 The program display_example.cxx shows an nice example plot using all three
48 methods for histogram filling.
49 
50 \section displayFlowControl Program Flow Control
51 
52 The following images try to describe the program flow graphically. This is largely the same information
53 as what is described above, but presently differently.
54 
55 
56 
57 
58 \image html event_display_offline_diagram.png "Program flow for offline rootana display" width=10cm
59 
60 \image html event_display_online_diagram.png "Program flow for online rootana display" width=10cm
61 
62 
63 
64 
65 \section roodyComp Comparison of RootanaDisplay and Roody
66 
67 rootana also provides a different way of visualizing histograms
68 through roody and the TNetDirectoryServer. Should the user use TRootanaDisplay
69 or roody? The following are some of the differences between the two tools:
70 
71 - roody requires two programs to be running: an analyzer that produces the histogram
72 and the roody program for displaying them. This has some advantages in that you can
73 independently restart the roody part; also you can run the analyzer on the midas server
74 machine, but run roody on your desktop.
75 But it also some disadvantages in complexity, since you need to keep track of both programs.
76 - Using roody is simpler from a coding point of view, since all the visualization is
77 handled for you. The TRootanaDisplay option requires some understanding of ROOT canvases
78 and GUIs.
79 - roody can only handle a limited set of ROOT classes, like TH1 histograms. If you
80 want to be able to plot more complicated ROOT options or plot them in a more complicated
81 way (overlaying histograms, fits and labels) then TRootanaDisplay is a better option.
82 
83 So, in summary: if you are only producing a simple set of ROOT histograms and/or
84 you don't want to do much programming then roody might be the right solution; if you want
85 complicated plots and don't mind using ROOT display classes, then TRootanaDisplay is the way
86 to go.
87 
88 Of course, the user can easily have a program that implements both solutions
89 and get the best of both worlds.
90 
91 
92 
93 
94 
95 T. Lindner
96 */