ROOTANA
TAnaManager.hxx
Go to the documentation of this file.
1 #ifndef TAnaManager_h
2 #define TAnaManager_h
3 
4 // Use this list here to decide which type of equipment to use.
5 
6 //#define USE_V792
7 //#define USE_V1190
8 //#define USE_L2249
9 //#define USE_AGILENT
10 #define USE_V1720
11 //#define USE_V1720_CORRELATIONS
12 //#define USE_V1730DPP
13 //#define USE_V1730RAW
14 #define USE_DT724
15 #define USE_TRB3
16 //#define USE_CAMACADC
17 
18 #include "TV792Histogram.h"
19 #include "TV1190Histogram.h"
20 #include "TL2249Histogram.h"
21 #include "TAgilentHistogram.h"
22 #include "TV1720Waveform.h"
23 #include "TV1720Correlations.h"
24 #include "TV1730DppWaveform.h"
25 #include "TV1730RawWaveform.h"
26 #include "TDT724Waveform.h"
27 #include "TTRB3Histogram.hxx"
28 #include "TCamacADCHistogram.h"
29 
30 /// This is an example of how to organize a set of different histograms
31 /// so that we can access the same information in a display or a batch
32 /// analyzer.
33 /// Change the set of ifdef's above to define which equipment to use.
34 ///
35 /// We simplify a lot of code by mostly using an array of THistogramArrayBase classes
36 /// for storing different histograms.
37 class TAnaManager {
38 public:
39  TAnaManager();
40  virtual ~TAnaManager(){};
41 
42  /// Processes the midas event, fills histograms, etc.
43  int ProcessMidasEvent(TDataContainer& dataContainer);
44 
45  /// Update those histograms that only need to be updated when we are plotting.
47 
48  void Initialize();
49 
50  bool CheckOption(std::string option);
51 
52  void BeginRun(int transition,int run,int time) {};
53  void EndRun(int transition,int run,int time) {};
54 
55  // Add a THistogramArrayBase object to the list
56  void AddHistogram(THistogramArrayBase* histo);
57 
58  // Little trick; we only fill the transient histograms here (not cumulative), since we don't want
59  // to fill histograms for events that we are not displaying.
60  // It is pretty slow to fill histograms for each event.
61  void UpdateTransientPlots(TDataContainer& dataContainer);
62 
63  // Get the histograms
64  std::vector<THistogramArrayBase*> GetHistograms() {
65  return fHistos;
66  }
67 
68 private:
69 
70  // Make some cross-channel histograms
73 
74  std::vector<THistogramArrayBase*> fHistos;
75 
76 };
77 
78 
79 
80 #endif
81 
82 
TH2F * fV1720PHCompare
Definition: TAnaManager.hxx:71
std::vector< THistogramArrayBase * > GetHistograms()
Definition: TAnaManager.hxx:64
std::vector< THistogramArrayBase * > fHistos
Definition: TAnaManager.hxx:74
void Initialize()
void UpdateForPlotting()
Update those histograms that only need to be updated when we are plotting.
virtual ~TAnaManager()
Definition: TAnaManager.hxx:40
TH2F * fV1720TimeCompare
Definition: TAnaManager.hxx:72
void EndRun(int transition, int run, int time)
Definition: TAnaManager.hxx:53
int ProcessMidasEvent(TDataContainer &dataContainer)
Processes the midas event, fills histograms, etc.
Definition: TAnaManager.cxx:77
bool CheckOption(std::string option)
void UpdateTransientPlots(TDataContainer &dataContainer)
void BeginRun(int transition, int run, int time)
Definition: TAnaManager.hxx:52
void AddHistogram(THistogramArrayBase *histo)
Definition: TAnaManager.cxx:68