ana.cxx

Go to the documentation of this file.
00001 // Default program for dealing with various standard TRIUMF VME setups:
00002 // V792, V1190 (VME), L2249 (CAMAC), Agilent current meter
00003 //
00004 //
00005 
00006 #include <stdio.h>
00007 #include <iostream>
00008 #include <time.h>
00009 
00010 #include "TRootanaEventLoop.hxx"
00011 
00012 #define USE_V792
00013 #define USE_V1190
00014 //#define USE_L2249
00015 //#define USE_AGILENT
00016 
00017 #ifdef  USE_V792
00018 #include "TV792Histogram.h"
00019 #endif 
00020 #ifdef  USE_V1190
00021 #include "TV1190Histogram.h"
00022 #endif 
00023 
00024 #ifdef  USE_L2249
00025 #include <TL2249Data.hxx>
00026 #include "TL2249Histogram.h"
00027 #endif 
00028 
00029 #ifdef USE_AGILENT
00030 #include "TAgilentHistogram.h"
00031 #endif
00032 
00033 class Analyzer: public TRootanaEventLoop {
00034 
00035 #ifdef  USE_V792
00036   TV792Histograms *v792_histos;
00037 #endif 
00038 #ifdef  USE_V1190
00039   TV1190Histograms *v1190_histos;
00040 #endif 
00041 #ifdef  USE_L2249
00042   TL2249Histograms *l2249_histos;
00043 #endif 
00044 #ifdef USE_AGILENT
00045   TAgilentHistograms *agilent_histos;
00046 #endif
00047 
00048 
00049 public:
00050 
00051   Analyzer() {
00052     DisableAutoMainWindow();
00053     
00054     // Create histograms (if enabled)
00055 
00056 #ifdef  USE_V792
00057     v792_histos = new TV792Histograms();
00058 #endif 
00059 #ifdef  USE_V1190
00060     v1190_histos = new TV1190Histograms();
00061 #endif 
00062 #ifdef  USE_L2249
00063     l2249_histos = new TL2249Histograms();
00064 #endif 
00065 #ifdef USE_AGILENT
00066     agilent_histos = new TAgilentHistograms();
00067 #endif
00068 
00069   };
00070 
00071   virtual ~Analyzer() {};
00072 
00073   void Initialize(){
00074 
00075 
00076   }
00077 
00078 
00079   void BeginRun(int transition,int run,int time){
00080 
00081     // Begin of run calls...
00082 
00083 #ifdef  USE_V792
00084     v792_histos->BeginRun(transition,run,time);
00085 #endif 
00086 #ifdef  USE_V1190
00087     v1190_histos->BeginRun(transition,run,time);
00088 #endif 
00089 #ifdef  USE_L2249
00090     l2249_histos->BeginRun(transition,run,time);
00091 #endif 
00092 #ifdef USE_AGILENT
00093     agilent_histos->BeginRun(transition,run,time);
00094 #endif
00095 
00096   }
00097 
00098 
00099   bool ProcessMidasEvent(TDataContainer& dataContainer){
00100 
00101     // actually update histograms
00102 
00103 #ifdef  USE_V792
00104     v792_histos->UpdateHistograms(dataContainer);
00105 #endif 
00106 #ifdef  USE_V1190
00107     v1190_histos->UpdateHistograms(dataContainer);
00108 #endif 
00109 #ifdef  USE_L2249
00110     l2249_histos->UpdateHistograms(dataContainer);
00111 #endif 
00112 #ifdef USE_AGILENT
00113     agilent_histos->UpdateHistograms(dataContainer);
00114 #endif
00115 
00116     return true;
00117   }
00118 
00119 
00120 }; 
00121 
00122 
00123 int main(int argc, char *argv[])
00124 {
00125 
00126   Analyzer::CreateSingleton<Analyzer>();
00127   return Analyzer::Get().ExecuteLoop(argc, argv);
00128 
00129 }
00130 

Generated on 5 May 2014 for ROOT Analyzer by  doxygen 1.6.1