

Public Member Functions | |
| MyTestLoop () | |
| void | AddAllCanvases () |
| User must. | |
| virtual | ~MyTestLoop () |
| void | ResetHistograms () |
| This method can be implemented by users to plotting of current canvas. | |
| void | UpdateHistograms (TDataContainer &dataContainer) |
| This method can be implemented by users to update user histograms. | |
| void | PlotCanvas (TDataContainer &dataContainer) |
| This method can be implemented by users to plotting of current canvas. | |
| MyTestLoop () | |
| virtual | ~MyTestLoop () |
| void | BeginRun (int transition, int run, int time) |
| void | EndRun (int transition, int run, int time) |
| bool | ProcessMidasEvent (TDataContainer &dataContainer) |
| Process each midas event. | |
| void | Usage (void) |
| bool | CheckOption (std::string option) |
| MyTestLoop () | |
| void | AddAllCanvases () |
| User must. | |
| virtual | ~MyTestLoop () |
| void | ResetHistograms () |
| This method can be implemented by users to plotting of current canvas. | |
| void | UpdateHistograms (TDataContainer &dataContainer) |
| This method can be implemented by users to update user histograms. | |
| void | PlotCanvas (TDataContainer &dataContainer) |
| This method can be implemented by users to plotting of current canvas. | |
| void | AddSingleCanvas (std::string name, std::string subtab_name=std::string("")) |
| Add a new canvas; user will interactively fill it. | |
| void | AddSingleCanvas (TCanvasHandleBase *handleClass, std::string subtab_name=std::string("")) |
| void | AddSingleCanvas (std::string name, std::string subtab_name=std::string("")) |
| Add a new canvas; user will interactively fill it. | |
| void | AddSingleCanvas (TCanvasHandleBase *handleClass, std::string subtab_name=std::string("")) |
| TMainDisplayWindow * | GetDisplayWindow () |
| TMainDisplayWindow * | GetDisplayWindow () |
| void | NextButtonPushed () |
| Method for when next button is pushed (offline mode). | |
| void | NextButtonPushed () |
| Method for when next button is pushed (offline mode). | |
| void | EventSkipButtonPushed () |
| Method for when skip event button is pushed (online mode). | |
| void | EventSkipButtonPushed () |
| Method for when skip event button is pushed (online mode). | |
| void | Reset () |
| void | Reset () |
| void | UpdatePlotsAction () |
| void | UpdatePlotsAction () |
| void | QuitButtonAction () |
| Method to call when 'quit' button is pressed. | |
| void | QuitButtonAction () |
| Method to call when 'quit' button is pressed. | |
| void | SetNumberSkipEvent (int number) |
| void | SetNumberSkipEvent (int number) |
| std::string | GetDisplayName () |
| Get Display name. | |
| std::string | GetDisplayName () |
| Get Display name. | |
| void | SetDisplayName (std::string name) |
| Set Display name. | |
| void | SetDisplayName (std::string name) |
| Set Display name. | |
| void | Initialize () |
| void | Initialize () |
| bool | CheckOptionRAD (std::string option) |
| bool | CheckOptionRAD (std::string option) |
| void | UsageRAD () |
| Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. | |
| void | UsageRAD () |
| Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. | |
| TDataContainer * | GetDataContainer () |
| Method to get the data container that event loop owns. | |
| TDataContainer * | GetDataContainer () |
| Method to get the data container that event loop owns. | |
| virtual void | Finalize () |
| virtual void | Finalize () |
| virtual bool | PreFilter (TDataContainer &dataContainer) |
| virtual bool | PreFilter (TDataContainer &dataContainer) |
| bool | IsOnline () const |
| Are we processing online data? | |
| bool | IsOnline () const |
| Are we processing online data? | |
| bool | IsOffline () const |
| Are we processing offline data? | |
| bool | IsOffline () const |
| Are we processing offline data? | |
| int | GetCurrentRunNumber () const |
| Current Run Number. | |
| int | GetCurrentRunNumber () const |
| Current Run Number. | |
| void | SetCurrentRunNumber (int run) |
| Current Run Number. | |
| void | SetCurrentRunNumber (int run) |
| Current Run Number. | |
| int | ExecuteLoop (int argc, char *argv[]) |
| Method to actually process the Midas information, either as file or online. | |
| int | ExecuteLoop (int argc, char *argv[]) |
| Method to actually process the Midas information, either as file or online. | |
| int | ProcessMidasFile (TApplication *app, const char *fname) |
| int | ProcessMidasFile (TApplication *app, const char *fname) |
| void | DisableAutoMainWindow () |
| Disable automatic creation of MainWindow. | |
| void | DisableAutoMainWindow () |
| Disable automatic creation of MainWindow. | |
| VirtualOdb * | GetODB () |
| Get pointer to ODB variables. | |
| VirtualOdb * | GetODB () |
| Get pointer to ODB variables. | |
| void | OpenRootFile (int run) |
| Open output ROOT file. | |
| void | OpenRootFile (int run) |
| Open output ROOT file. | |
| void | CloseRootFile () |
| Cloe output ROOT file. | |
| void | CloseRootFile () |
| Cloe output ROOT file. | |
| bool | IsRootFileValid () |
| Check if output ROOT file is valid and open. | |
| bool | IsRootFileValid () |
| Check if output ROOT file is valid and open. | |
| void | DisableRootOutput (bool disable=true) |
| void | DisableRootOutput (bool disable=true) |
| int | IsRootOutputEnabled () |
| int | IsRootOutputEnabled () |
| void | SetOutputFilename (std::string name) |
| void | SetOutputFilename (std::string name) |
| void | SetOnlineName (std::string name) |
| void | SetOnlineName (std::string name) |
| void | ProcessThisEventID (int eventID) |
| void | ProcessThisEventID (int eventID) |
| bool | CheckEventID (int eventId) |
| Little helper method to check if EventID matchs requested EventID list. | |
| bool | CheckEventID (int eventId) |
| Little helper method to check if EventID matchs requested EventID list. | |
| void | SuppressTimestampWarnings () |
| void | SuppressTimestampWarnings () |
| bool | GetSuppressTimestampWarnings () |
| Suppress timestamp warnings? true = suppress warnings. | |
| bool | GetSuppressTimestampWarnings () |
| Suppress timestamp warnings? true = suppress warnings. | |
Static Public Member Functions | |
| static TRootanaEventLoop & | Get (void) |
| static TRootanaEventLoop & | Get (void) |
| template<typename T > | |
| static void | CreateSingleton () |
| template<typename T > | |
| static void | CreateSingleton () |
Protected Member Functions | |
| bool | CreateOutputFile (std::string name, std::string options="RECREATE") |
| bool | CreateOutputFile (std::string name, std::string options="RECREATE") |
Protected Attributes | |
| TDirectory * | fOnlineHistDir |
| TDirectory for online histograms. | |
| TDirectory * | fOnlineHistDir |
| TDirectory for online histograms. | |
Static Protected Attributes | |
| static TRootanaEventLoop * | fTRootanaEventLoop = NULL |
| The static pointer to the singleton instance. | |
| static TRootanaEventLoop * | fTRootanaEventLoop = NULL |
| The static pointer to the singleton instance. | |
Private Attributes | |
| int | nnn |
| TH1F * | sizeBankFR10 |
This is an example of the a user defined event display. The user then needs to define how they what to update and plot histograms. The updating of histograms happens for each event. In online mode, the plotting of histograms only happens for each XX events; for offline mode the plotting happens for each event.
There are two ways that users can decide to update and plot histograms:
1) They can create histograms in their event display class and then fill the methods UpdateHistograms(TMidasEvent*) and PlotCanvas(TMidasEvent*). This histograms can then file in the canvases that are added using AddSingleCanvas(std::string name).
In this example this method is used for the histogram sizeBankFR10, which is just a histogram of the size of the bank called "FR10".
2) They can create classes that are derived from TCanvasHandleBase. The derived classes are then added using the method AddSingleCanvas(TCanvasHandleBase* handleClass). In this example there are two classes derived from TCanvasHandleBase: a) TSimpleExampleCanvas: this class just creates a tab/canvas with a histogram of the size of the bank called "FR11". a) TComplicatedExampleCanvas: this class creates a set of four different canvases/histograms which the user can select using a ROOT number widget.
The actual ROOT GUI is encapsulated in a separate class TMainDisplayWindow. The TRootanaDisplay has an instance of this TMainDisplayWindow class. Users will be need to access the TMainDisplayWindow by calling
TRootanaDisplay::GetDisplayWindow()
in order to grab the particular canvas that we want plot on.
Definition at line 31 of file anaDisplay.cxx.
| MyTestLoop::MyTestLoop | ( | ) | [inline] |
Definition at line 35 of file anaDisplay.cxx.
References TRootanaEventLoop::DisableRootOutput(), and TRootanaEventLoop::SetOutputFilename().
00035 { 00036 SetOutputFilename("example_output"); 00037 DisableRootOutput(false); 00038 }

| virtual MyTestLoop::~MyTestLoop | ( | ) | [inline, virtual] |
Definition at line 65 of file anaDisplay.cxx.
| MyTestLoop::MyTestLoop | ( | ) | [inline] |
| virtual MyTestLoop::~MyTestLoop | ( | ) | [inline, virtual] |
Definition at line 23 of file analyzer_example.cxx.
| MyTestLoop::MyTestLoop | ( | ) | [inline] |
Definition at line 48 of file display_example.cxx.
References sizeBankFR10.
00048 { 00049 00050 // Initialize histograms. 00051 sizeBankFR10 = new TH1F("sizeBankFR10","Size of FR10 bank",2000,0,10000); 00052 }
| virtual MyTestLoop::~MyTestLoop | ( | ) | [inline, virtual] |
Definition at line 63 of file display_example.cxx.
| void MyTestLoop::AddAllCanvases | ( | ) | [inline, virtual] |
User must.
Implements TRootanaDisplay.
Definition at line 54 of file display_example.cxx.
References TRootanaDisplay::AddSingleCanvas(), TRootanaDisplay::SetDisplayName(), and TRootanaDisplay::SetNumberSkipEvent().
00054 { 00055 // Set up tabbed canvases 00056 AddSingleCanvas(new TSimpleExampleCanvas()); 00057 AddSingleCanvas(new TComplicatedExampleCanvas()); 00058 AddSingleCanvas("FR10"); 00059 SetNumberSkipEvent(20); 00060 SetDisplayName("Example Display"); 00061 };

| void MyTestLoop::AddAllCanvases | ( | ) | [inline, virtual] |
User must.
Implements TRootanaDisplay.
Definition at line 40 of file anaDisplay.cxx.
References TRootanaDisplay::AddSingleCanvas(), TRootanaDisplay::SetDisplayName(), and TRootanaDisplay::SetNumberSkipEvent().
00040 { 00041 00042 SetNumberSkipEvent(100); 00043 // Set up tabbed canvases 00044 #ifdef USE_V792 00045 TFancyHistogramCanvas* v792_all = new TFancyHistogramCanvas(new TV792Histograms(),"V792"); 00046 AddSingleCanvas(v792_all); 00047 #endif 00048 #ifdef USE_V1190 00049 TFancyHistogramCanvas* v1190_all = new TFancyHistogramCanvas(new TV1190Histograms(),"V1190"); 00050 AddSingleCanvas(v1190_all); 00051 #endif 00052 #ifdef USE_L2249 00053 TFancyHistogramCanvas* l2249_all = new TFancyHistogramCanvas(new TL2249Histograms(),"L2249"); 00054 AddSingleCanvas(l2249_all); 00055 #endif 00056 #ifdef USE_AGILENT 00057 TFancyHistogramCanvas* agilent_all = new TFancyHistogramCanvas(new TAgilentHistograms(),"AGILENT"); 00058 AddSingleCanvas(agilent_all); 00059 #endif 00060 00061 00062 SetDisplayName("Example Display"); 00063 };

| void TRootanaDisplay::AddSingleCanvas | ( | TCanvasHandleBase * | handleClass, | |
| std::string | subtab_name = std::string("") | |||
| ) | [inherited] |
Add a new canvas, using a TCanvasHandleBase class. TRootanaDisplay will take ownership of pointer and delete memory it points to.
| void TRootanaDisplay::AddSingleCanvas | ( | std::string | name, | |
| std::string | subtab_name = std::string("") | |||
| ) | [inline, inherited] |
Add a new canvas; user will interactively fill it.
Definition at line 70 of file TRootanaDisplay.hxx.
References TMainDisplayWindow::AddCanvas(), and TRootanaDisplay::fMainWindow.
00070 { 00071 fMainWindow->AddCanvas(name,subtab_name); 00072 }

| void TRootanaDisplay::AddSingleCanvas | ( | TCanvasHandleBase * | handleClass, | |
| std::string | subtab_name = std::string("") | |||
| ) | [inherited] |
Add a new canvas, using a TCanvasHandleBase class. TRootanaDisplay will take ownership of pointer and delete memory it points to.
Definition at line 74 of file TRootanaDisplay.cxx.
References TMainDisplayWindow::AddCanvas(), TRootanaDisplay::fCanvasHandlers, TMainDisplayWindow::GetCompositeFrame(), TRootanaDisplay::GetDisplayWindow(), TMainDisplayWindow::GetSubTab(), TCanvasHandleBase::GetTabName(), and TCanvasHandleBase::SetUpCompositeFrame().
00074 { 00075 00076 std::pair<int,int> index = GetDisplayWindow()->AddCanvas(handleClass->GetTabName(),subtab_name); 00077 00078 std::pair< std::pair<int,int>, TCanvasHandleBase*> tmp(index,handleClass); 00079 00080 fCanvasHandlers.push_back(tmp); 00081 // Now set up the embedded canvas, if user so desires. 00082 TGCompositeFrame* embed = GetDisplayWindow()->GetCompositeFrame(index);//ssGetTab()->GetTabContainer(tab_index); 00083 handleClass->SetUpCompositeFrame(embed,this); 00084 00085 // If we just created a new sub-tab, grab the tab and add 00086 // call-back to UpdatePlot 00087 if(index.second == 0){ 00088 TGTab* tab = GetDisplayWindow()->GetSubTab(index.first); 00089 tab->Connect("Selected(Int_t)", "TRootanaDisplay", this, "UpdatePlotsAction()"); 00090 } 00091 00092 00093 }

| void TRootanaDisplay::AddSingleCanvas | ( | std::string | name, | |
| std::string | subtab_name = std::string("") | |||
| ) | [inline, inherited] |
Add a new canvas; user will interactively fill it.
Definition at line 70 of file TRootanaDisplay.hxx.
References TMainDisplayWindow::AddCanvas(), and TRootanaDisplay::fMainWindow.
Referenced by AddAllCanvases().
00070 { 00071 fMainWindow->AddCanvas(name,subtab_name); 00072 }


| void MyTestLoop::BeginRun | ( | int | transition, | |
| int | run, | |||
| int | time | |||
| ) | [inline, virtual] |
Called before the first event of a file is read, but you should prefer Initialize() for general initialization. This method will be called once for each input file.
Reimplemented from TRootanaDisplay.
Definition at line 25 of file analyzer_example.cxx.
| bool TRootanaEventLoop::CheckEventID | ( | int | eventId | ) | [inherited] |
Little helper method to check if EventID matchs requested EventID list.
| bool TRootanaEventLoop::CheckEventID | ( | int | eventId | ) | [inherited] |
Little helper method to check if EventID matchs requested EventID list.
Definition at line 120 of file TRootanaEventLoop.cxx.
References TRootanaEventLoop::fProcessEventIDs.
Referenced by TRootanaEventLoop::ProcessMidasFile().
00120 { 00121 00122 // If we didn't specify list of accepted IDs, then accept all. 00123 if(fProcessEventIDs.size()==0) return true; 00124 00125 // Otherwise check event ID against list 00126 for(unsigned int i = 0; i < fProcessEventIDs.size(); i++){ 00127 if(fProcessEventIDs[i] == (eventId & 0xFFFF)) 00128 return true; 00129 } 00130 00131 return false; 00132 }

| bool MyTestLoop::CheckOption | ( | std::string | option | ) | [inline, virtual] |
Check an option and return true if it is valid. The return value is used to flag errors during option handling. If the options are valid, then CheckOption should return true to indicate success. If there is a problem processing the options, then CheckOption should return false. If this returns false, then the event loop will print the Usage message and exit with a non zero value (i.e. indicate failure).
Reimplemented from TRootanaEventLoop.
Definition at line 89 of file analyzer_example.cxx.
| bool TRootanaDisplay::CheckOptionRAD | ( | std::string | option | ) | [inline, virtual, inherited] |
This is a special version of CheckOption that is only used by TRootanaDisplay. This is just so that users still have the ability to set options for executables derived from TRootanaDisplay.
Reimplemented from TRootanaEventLoop.
Definition at line 131 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fNumberSkipEventsOffline.
00131 { 00132 if(option.find("-s") != std::string::npos){ 00133 std::string sub = option.substr(2); 00134 fNumberSkipEventsOffline = atoi(sub.c_str()); 00135 printf("Will process %i events before plotting first event.\n",fNumberSkipEventsOffline); 00136 return true; 00137 } 00138 return false; 00139 }
| bool TRootanaDisplay::CheckOptionRAD | ( | std::string | option | ) | [inline, virtual, inherited] |
This is a special version of CheckOption that is only used by TRootanaDisplay. This is just so that users still have the ability to set options for executables derived from TRootanaDisplay.
Reimplemented from TRootanaEventLoop.
Definition at line 131 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fNumberSkipEventsOffline.
00131 { 00132 if(option.find("-s") != std::string::npos){ 00133 std::string sub = option.substr(2); 00134 fNumberSkipEventsOffline = atoi(sub.c_str()); 00135 printf("Will process %i events before plotting first event.\n",fNumberSkipEventsOffline); 00136 return true; 00137 } 00138 return false; 00139 }
| void TRootanaEventLoop::CloseRootFile | ( | ) | [inherited] |
Cloe output ROOT file.
| void TRootanaEventLoop::CloseRootFile | ( | ) | [inherited] |
Cloe output ROOT file.
Definition at line 397 of file TRootanaEventLoop.cxx.
References TRootanaEventLoop::fOutputFile.
Referenced by TRootanaEventLoop::ProcessMidasFile(), TRootanaDisplay::QuitButtonAction(), and TRootanaEventLoop::~TRootanaEventLoop().
00397 { 00398 00399 if(fOutputFile) { 00400 std::cout << "Closing ROOT file " << std::endl; 00401 fOutputFile->Write(); 00402 fOutputFile->Close(); 00403 fOutputFile=0; 00404 } 00405 00406 }

| bool TRootanaEventLoop::CreateOutputFile | ( | std::string | name, | |
| std::string | options = "RECREATE" | |||
| ) | [inline, protected, inherited] |
Definition at line 184 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFile.
00184 { 00185 00186 fOutputFile = new TFile(name.c_str(),options.c_str()); 00187 00188 return true; 00189 }
| bool TRootanaEventLoop::CreateOutputFile | ( | std::string | name, | |
| std::string | options = "RECREATE" | |||
| ) | [inline, protected, inherited] |
Definition at line 184 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFile.
00184 { 00185 00186 fOutputFile = new TFile(name.c_str(),options.c_str()); 00187 00188 return true; 00189 }
| static void TRootanaEventLoop::CreateSingleton | ( | ) | [inline, static, inherited] |
This static templated function will make it a little easier for users to create the singleton instance.
Definition at line 125 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fTRootanaEventLoop.
00126 { 00127 if(fTRootanaEventLoop) 00128 std::cout << "Singleton has already been created" << std::endl; 00129 else 00130 fTRootanaEventLoop = new T(); 00131 }
| static void TRootanaEventLoop::CreateSingleton | ( | ) | [inline, static, inherited] |
This static templated function will make it a little easier for users to create the singleton instance.
Definition at line 125 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fTRootanaEventLoop.
00126 { 00127 if(fTRootanaEventLoop) 00128 std::cout << "Singleton has already been created" << std::endl; 00129 else 00130 fTRootanaEventLoop = new T(); 00131 }
| void TRootanaEventLoop::DisableAutoMainWindow | ( | ) | [inline, inherited] |
Disable automatic creation of MainWindow.
Definition at line 135 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCreateMainWindow.
00135 { fCreateMainWindow = false;}
| void TRootanaEventLoop::DisableAutoMainWindow | ( | ) | [inline, inherited] |
Disable automatic creation of MainWindow.
Definition at line 135 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCreateMainWindow.
Referenced by Analyzer::Analyzer().
00135 { fCreateMainWindow = false;}

| void TRootanaEventLoop::DisableRootOutput | ( | bool | disable = true |
) | [inline, inherited] |
Definition at line 154 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDisableRootOutput.
00154 {fDisableRootOutput = disable;};
| void TRootanaEventLoop::DisableRootOutput | ( | bool | disable = true |
) | [inline, inherited] |
Definition at line 154 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDisableRootOutput.
Referenced by MyTestLoop().
00154 {fDisableRootOutput = disable;};

| void MyTestLoop::EndRun | ( | int | transition, | |
| int | run, | |||
| int | time | |||
| ) | [inline, virtual] |
Called after the last event of a file is read, but you should prefer Finalize() for general finalization. This method will be called once for each input file.
Reimplemented from TRootanaDisplay.
Definition at line 29 of file analyzer_example.cxx.
| void TRootanaDisplay::EventSkipButtonPushed | ( | ) | [inline, inherited] |
Method for when skip event button is pushed (online mode).
Definition at line 98 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow, TRootanaDisplay::fNumberSkipEventsOnline, and TMainDisplayWindow::GetSkipEventButton().
00098 { 00099 fNumberSkipEventsOnline = fMainWindow->GetSkipEventButton()->GetNumberEntry()->GetIntNumber(); 00100 }

| void TRootanaDisplay::EventSkipButtonPushed | ( | ) | [inline, inherited] |
Method for when skip event button is pushed (online mode).
Definition at line 98 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow, TRootanaDisplay::fNumberSkipEventsOnline, and TMainDisplayWindow::GetSkipEventButton().
00098 { 00099 fNumberSkipEventsOnline = fMainWindow->GetSkipEventButton()->GetNumberEntry()->GetIntNumber(); 00100 }

| int TRootanaEventLoop::ExecuteLoop | ( | int | argc, | |
| char * | argv[] | |||
| ) | [inherited] |
Method to actually process the Midas information, either as file or online.
| int TRootanaEventLoop::ExecuteLoop | ( | int | argc, | |
| char * | argv[] | |||
| ) | [inherited] |
Method to actually process the Midas information, either as file or online.
Definition at line 159 of file TRootanaEventLoop.cxx.
References TDirectory::cd(), TRootanaEventLoop::CheckOption(), TRootanaEventLoop::CheckOptionRAD(), TRootanaEventLoop::fApp, TRootanaEventLoop::fBufferName, TRootanaEventLoop::fCreateMainWindow, TRootanaEventLoop::Finalize(), TRootanaEventLoop::fIsOffline, TRootanaEventLoop::fMaxEvents, TRootanaEventLoop::fOnlineHistDir, TRootanaEventLoop::Initialize(), TRootanaEventLoop::PrintHelp(), TRootanaEventLoop::ProcessMidasFile(), and StartNetDirectoryServer().
Referenced by main().
00159 { 00160 00161 setbuf(stdout,NULL); 00162 setbuf(stderr,NULL); 00163 00164 signal(SIGILL, SIG_DFL); 00165 signal(SIGBUS, SIG_DFL); 00166 signal(SIGSEGV, SIG_DFL); 00167 00168 std::vector<std::string> args; 00169 for (int i=0; i<argc; i++) 00170 { 00171 if (strcmp(argv[i],"-h")==0) 00172 PrintHelp(); // does not return 00173 args.push_back(argv[i]); 00174 } 00175 00176 00177 if(gROOT->IsBatch()) { 00178 printf("Cannot run in batch mode\n"); 00179 return 1; 00180 } 00181 00182 bool forceEnableGraphics = false; 00183 bool testMode = false; 00184 int tcpPort = 0; 00185 const char* hostname = NULL; 00186 const char* exptname = NULL; 00187 00188 for (unsigned int i=1; i<args.size(); i++) // loop over the commandline options 00189 { 00190 const char* arg = args[i].c_str(); 00191 //printf("argv[%d] is %s\n",i,arg); 00192 00193 if (strncmp(arg,"-e",2)==0) // Event cutoff flag (only applicable in offline mode) 00194 fMaxEvents = atoi(arg+2); 00195 else if (strncmp(arg,"-m",2)==0) // Enable memory debugging 00196 ;// gEnableShowMem = true; 00197 else if (strncmp(arg,"-P",2)==0) // Set the histogram server port 00198 tcpPort = atoi(arg+2); 00199 else if (strcmp(arg,"-T")==0) 00200 testMode = true; 00201 else if (strcmp(arg,"-g")==0) 00202 forceEnableGraphics = true; 00203 else if (strncmp(arg,"-H",2)==0) 00204 hostname = strdup(arg+2); 00205 else if (strncmp(arg,"-E",2)==0) 00206 exptname = strdup(arg+2); 00207 else if (strncmp(arg,"-b",2)==0){ 00208 fBufferName = std::string(arg+2); 00209 }else if (strcmp(arg,"-h")==0) 00210 PrintHelp(); // does not return 00211 else if(arg[0] == '-')// Check if a TRootanaDisplay or user-defined options 00212 if(!CheckOptionRAD(args[i])) 00213 if(!CheckOption(args[i])) 00214 PrintHelp(); // does not return 00215 } 00216 00217 // Do quick check if we are processing online or offline. 00218 // Want to know before we initialize. 00219 fIsOffline = false; 00220 for (unsigned int i=1; i<args.size(); i++){ 00221 const char* arg = args[i].c_str(); 00222 if (arg[0] != '-') 00223 { 00224 fIsOffline = true; 00225 } 00226 } 00227 00228 00229 MainWindow *mainWindow=0; 00230 if(fCreateMainWindow){ 00231 mainWindow = new MainWindow(gClient->GetRoot(), 200, 300); 00232 } 00233 00234 gROOT->cd(); 00235 fOnlineHistDir = new TDirectory("rootana", "rootana online plots"); 00236 00237 #ifdef HAVE_LIBNETDIRECTORY 00238 if (tcpPort) 00239 StartNetDirectoryServer(tcpPort, fOnlineHistDir); 00240 #else 00241 if (tcpPort) 00242 fprintf(stderr,"ERROR: No support for the TNetDirectory server!\n"); 00243 #endif 00244 00245 // Initialize the event loop with user initialization. 00246 Initialize(); 00247 00248 for (unsigned int i=1; i<args.size(); i++){ 00249 const char* arg = args[i].c_str(); 00250 if (arg[0] != '-') 00251 { 00252 ProcessMidasFile(fApp,arg); 00253 } 00254 } 00255 00256 if (testMode){ 00257 std::cout << "Entering test mode." << std::endl; 00258 fOnlineHistDir->cd(); 00259 TH1D* hh = new TH1D("test", "test", 100, 0, 100); 00260 hh->Fill(1); 00261 hh->Fill(10); 00262 hh->Fill(50); 00263 00264 fApp->Run(kTRUE); 00265 if(fCreateMainWindow) delete mainWindow; 00266 return 0; 00267 } 00268 00269 // if we processed some data files, 00270 // do not go into online mode. 00271 if (fIsOffline){ 00272 if(fCreateMainWindow) delete mainWindow; 00273 return 0; 00274 } 00275 00276 #ifdef HAVE_MIDAS 00277 ProcessMidasOnline(fApp, hostname, exptname);; 00278 #endif 00279 00280 if(fCreateMainWindow) delete mainWindow; 00281 00282 Finalize(); 00283 00284 return 0; 00285 00286 }


| virtual void TRootanaEventLoop::Finalize | ( | ) | [virtual, inherited] |
Called after the last event has been processed, but before any open output files are closed.
| void TRootanaEventLoop::Finalize | ( | ) | [virtual, inherited] |
Called after the last event has been processed, but before any open output files are closed.
Definition at line 110 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::ExecuteLoop().

| static TRootanaEventLoop& TRootanaEventLoop::Get | ( | void | ) | [static, inherited] |
| TRootanaEventLoop & TRootanaEventLoop::Get | ( | void | ) | [static, inherited] |
Definition at line 59 of file TRootanaEventLoop.cxx.
References TRootanaEventLoop::fTRootanaEventLoop.
Referenced by main().
00059 { 00060 00061 if(!fTRootanaEventLoop){ 00062 std::cerr << "Singleton Not Instantiated! " 00063 << " Need to call something like SomeClass::CreateSingleton<SomeClass>(); Exiting!" 00064 <<std::endl; exit(0); 00065 } 00066 return *fTRootanaEventLoop; 00067 }

| int TRootanaEventLoop::GetCurrentRunNumber | ( | ) | const [inline, inherited] |
Current Run Number.
Definition at line 107 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCurrentRunNumber.
00107 {return fCurrentRunNumber;};
| int TRootanaEventLoop::GetCurrentRunNumber | ( | ) | const [inline, inherited] |
Current Run Number.
Definition at line 107 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCurrentRunNumber.
Referenced by ProcessMidasEvent(), TRootanaDisplay::QuitButtonAction(), and TRootanaDisplay::UpdatePlotsAction().
00107 {return fCurrentRunNumber;};

| TDataContainer* TRootanaEventLoop::GetDataContainer | ( | ) | [inline, inherited] |
Method to get the data container that event loop owns.
Definition at line 49 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDataContainer.
00049 {return fDataContainer;};
| TDataContainer* TRootanaEventLoop::GetDataContainer | ( | ) | [inline, inherited] |
Method to get the data container that event loop owns.
Definition at line 49 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDataContainer.
00049 {return fDataContainer;};
| std::string TRootanaDisplay::GetDisplayName | ( | ) | [inline, inherited] |
Get Display name.
Definition at line 123 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fDisplayName.
00123 {return fDisplayName;}
| std::string TRootanaDisplay::GetDisplayName | ( | ) | [inline, inherited] |
Get Display name.
Definition at line 123 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fDisplayName.
Referenced by TRootanaDisplay::UpdatePlotsAction().
00123 {return fDisplayName;}

| TMainDisplayWindow* TRootanaDisplay::GetDisplayWindow | ( | ) | [inline, inherited] |
Retrieve the main display window, so that users can do things like grab the canvases and update them.
Definition at line 82 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow.
00082 { return fMainWindow;}
| TMainDisplayWindow* TRootanaDisplay::GetDisplayWindow | ( | ) | [inline, inherited] |
Retrieve the main display window, so that users can do things like grab the canvases and update them.
Definition at line 82 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow.
Referenced by TRootanaDisplay::AddSingleCanvas(), TRootanaDisplay::InitializeMainWindow(), PlotCanvas(), and TRootanaDisplay::UpdatePlotsAction().
00082 { return fMainWindow;}

| VirtualOdb* TRootanaEventLoop::GetODB | ( | ) | [inline, inherited] |
Get pointer to ODB variables.
Definition at line 138 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fODB.
00138 {return fODB;}
| VirtualOdb* TRootanaEventLoop::GetODB | ( | ) | [inline, inherited] |
Get pointer to ODB variables.
Definition at line 138 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fODB.
00138 {return fODB;}
| bool TRootanaEventLoop::GetSuppressTimestampWarnings | ( | ) | [inline, inherited] |
Suppress timestamp warnings? true = suppress warnings.
Definition at line 179 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fSuppressTimestampWarnings.
00179 { return fSuppressTimestampWarnings;};
| bool TRootanaEventLoop::GetSuppressTimestampWarnings | ( | ) | [inline, inherited] |
Suppress timestamp warnings? true = suppress warnings.
Definition at line 179 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fSuppressTimestampWarnings.
00179 { return fSuppressTimestampWarnings;};
| void TRootanaDisplay::Initialize | ( | void | ) | [inline, virtual, inherited] |
Called after the arguments are processes but before reading the first event is read
Reimplemented from TRootanaEventLoop.
Definition at line 127 of file TRootanaDisplay.hxx.
References TRootanaDisplay::InitializeMainWindow().
00127 { 00128 InitializeMainWindow(); 00129 }

| void TRootanaDisplay::Initialize | ( | void | ) | [inline, virtual, inherited] |
Called after the arguments are processes but before reading the first event is read
Reimplemented from TRootanaEventLoop.
Definition at line 127 of file TRootanaDisplay.hxx.
References TRootanaDisplay::InitializeMainWindow().
00127 { 00128 InitializeMainWindow(); 00129 }

| bool TRootanaEventLoop::IsOffline | ( | ) | const [inline, inherited] |
Are we processing offline data?
Definition at line 104 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fIsOffline.
00104 {return fIsOffline;};
| bool TRootanaEventLoop::IsOffline | ( | ) | const [inline, inherited] |
Are we processing offline data?
Definition at line 104 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fIsOffline.
Referenced by TRootanaDisplay::InitializeMainWindow().
00104 {return fIsOffline;};

| bool TRootanaEventLoop::IsOnline | ( | ) | const [inline, inherited] |
Are we processing online data?
Definition at line 101 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fIsOffline.
00101 {return !fIsOffline;};
| bool TRootanaEventLoop::IsOnline | ( | ) | const [inline, inherited] |
Are we processing online data?
Definition at line 101 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fIsOffline.
Referenced by TRootanaDisplay::InitializeMainWindow(), TRootanaDisplay::ProcessMidasEvent(), TRootanaDisplay::QuitButtonAction(), and TRootanaDisplay::UpdatePlotsAction().
00101 {return !fIsOffline;};

| bool TRootanaEventLoop::IsRootFileValid | ( | ) | [inline, inherited] |
Check if output ROOT file is valid and open.
Definition at line 148 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFile.
00148 { 00149 if(fOutputFile) return true; 00150 return false; 00151 }
| bool TRootanaEventLoop::IsRootFileValid | ( | ) | [inline, inherited] |
Check if output ROOT file is valid and open.
Definition at line 148 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFile.
00148 { 00149 if(fOutputFile) return true; 00150 return false; 00151 }
| int TRootanaEventLoop::IsRootOutputEnabled | ( | ) | [inline, inherited] |
Definition at line 156 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDisableRootOutput.
00156 {return !fDisableRootOutput;};
| int TRootanaEventLoop::IsRootOutputEnabled | ( | ) | [inline, inherited] |
Definition at line 156 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fDisableRootOutput.
00156 {return !fDisableRootOutput;};
| void TRootanaDisplay::NextButtonPushed | ( | ) | [inline, inherited] |
Method for when next button is pushed (offline mode).
Definition at line 94 of file TRootanaDisplay.hxx.
References TRootanaDisplay::waitingForNextButton.
00094 { 00095 waitingForNextButton = false; 00096 }
| void TRootanaDisplay::NextButtonPushed | ( | ) | [inline, inherited] |
Method for when next button is pushed (offline mode).
Definition at line 94 of file TRootanaDisplay.hxx.
References TRootanaDisplay::waitingForNextButton.
00094 { 00095 waitingForNextButton = false; 00096 }
| void TRootanaEventLoop::OpenRootFile | ( | int | run | ) | [inherited] |
Open output ROOT file.
| void TRootanaEventLoop::OpenRootFile | ( | int | run | ) | [inherited] |
Open output ROOT file.
Definition at line 375 of file TRootanaEventLoop.cxx.
References TRootanaEventLoop::fDisableRootOutput, TRootanaEventLoop::fOutputFile, TRootanaEventLoop::fOutputFilename, and NetDirectoryExport().
Referenced by TRootanaEventLoop::ProcessMidasFile().
00375 { 00376 00377 if(fDisableRootOutput) return; 00378 00379 if(fOutputFile) { 00380 fOutputFile->Write(); 00381 fOutputFile->Close(); 00382 fOutputFile=0; 00383 } 00384 00385 char filename[1024]; 00386 sprintf(filename, "%s%05d.root",fOutputFilename.c_str(), run); 00387 fOutputFile = new TFile(filename,"RECREATE"); 00388 std::cout << "Opened output file with name : " << filename << std::endl; 00389 00390 00391 #ifdef HAVE_LIBNETDIRECTORY 00392 NetDirectoryExport(fOutputFile, "outputFile"); 00393 #endif 00394 }


| void MyTestLoop::PlotCanvas | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
This method can be implemented by users to plotting of current canvas.
Reimplemented from TRootanaDisplay.
Definition at line 78 of file display_example.cxx.
References TMainDisplayWindow::GetCanvas(), TRootanaDisplay::GetDisplayWindow(), and sizeBankFR10.
00078 { 00079 00080 if(GetDisplayWindow()->GetCurrentTabName().compare("FR10") == 0){ 00081 TCanvas* c1 = GetDisplayWindow()->GetCanvas("FR10"); 00082 c1->Clear(); 00083 sizeBankFR10->Draw(); 00084 c1->Modified(); 00085 c1->Update(); 00086 } 00087 00088 }

| void MyTestLoop::PlotCanvas | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
This method can be implemented by users to plotting of current canvas.
Reimplemented from TRootanaDisplay.
Definition at line 71 of file anaDisplay.cxx.
| virtual bool TRootanaEventLoop::PreFilter | ( | TDataContainer & | dataContainer | ) | [inline, virtual, inherited] |
The PreFilter method allows user to specify whether to ignore a particular event. Specifically, if PreFilter returns
true -> then ProcessMidasEvent will be called or false -> then ProcessMidasEvent will not be called
This is particularly useful for the RootanaDisplay, where you might want to only process and plot certain events.
Definition at line 98 of file TRootanaEventLoop.hxx.
| virtual bool TRootanaEventLoop::PreFilter | ( | TDataContainer & | dataContainer | ) | [inline, virtual, inherited] |
The PreFilter method allows user to specify whether to ignore a particular event. Specifically, if PreFilter returns
true -> then ProcessMidasEvent will be called or false -> then ProcessMidasEvent will not be called
This is particularly useful for the RootanaDisplay, where you might want to only process and plot certain events.
Definition at line 98 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::ProcessMidasFile().

| bool MyTestLoop::ProcessMidasEvent | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
Process each midas event.
Reimplemented from TRootanaDisplay.
Definition at line 33 of file analyzer_example.cxx.
References TDirectory::cd(), TRootanaEventLoop::fOnlineHistDir, TDirectory::Get(), TDCMeasurement::GetChannel(), TRootanaEventLoop::GetCurrentRunNumber(), TDataContainer::GetEventData(), TDCMeasurement::GetMeasurement(), TV1190Data::GetMeasurements(), TDataContainer::GetMidasData(), TDCMeasurement::GetTDCNumber(), TMidasEvent::LocateBank(), nnn, and TV792Data::Print().
00033 { 00034 00035 00036 void *ptr; 00037 int size = dataContainer.GetMidasData().LocateBank(NULL, "FR10", &ptr); 00038 if (ptr){ 00039 nnn++; 00040 if(nnn%100 == 0){ 00041 std::cout << "Current run : " << GetCurrentRunNumber() << std::endl; 00042 std::cout << "Trying to handle this event... " << size << " " << nnn << std::endl; 00043 } 00044 00045 fOnlineHistDir->cd(); 00046 char sname[256]; 00047 sprintf(sname, "size%d", 0); 00048 TH1D* hsize = (TH1D*)fOnlineHistDir->Get(sname); 00049 if (!hsize){ 00050 printf("Create [%s]\n", sname); 00051 hsize = new TH1D(sname, sname, 600, 0, 6000); 00052 } 00053 hsize->Fill(size); 00054 } 00055 00056 00057 TV1190Data *v1190 = dataContainer.GetEventData<TV1190Data>("TDC0"); 00058 if(v1190){ 00059 00060 std::cout << "TDC measurements for V1190" << std::endl; 00061 std::vector<TDCMeasurement>& measurements = v1190->GetMeasurements(); 00062 for(unsigned int i = 0; i < measurements.size(); i++){ 00063 TDCMeasurement tdcmeas = measurements[i]; 00064 00065 std::cout << "Measurement: " << tdcmeas.GetMeasurement() << " for tdc/chan " << 00066 tdcmeas.GetTDCNumber() << "/"<< tdcmeas.GetChannel() << std::endl; 00067 00068 } 00069 00070 } 00071 00072 TV792Data *v792 = dataContainer.GetEventData<TV792Data>("ADC0"); 00073 if(v792 ){ 00074 00075 v792->Print(); 00076 00077 } 00078 00079 return true; 00080 }

| int TRootanaEventLoop::ProcessMidasFile | ( | TApplication * | app, | |
| const char * | fname | |||
| ) | [inherited] |
| int TRootanaEventLoop::ProcessMidasFile | ( | TApplication * | app, | |
| const char * | fname | |||
| ) | [inherited] |
Treat the begin run and end run events differently.
Definition at line 290 of file TRootanaEventLoop.cxx.
References TRootanaEventLoop::BeginRun(), TRootanaEventLoop::CheckEventID(), TDataContainer::CleanupEvent(), TMidasFile::Close(), TRootanaEventLoop::CloseRootFile(), TRootanaEventLoop::EndRun(), TRootanaEventLoop::fCurrentRunNumber, TRootanaEventLoop::fDataContainer, TRootanaEventLoop::fMaxEvents, TRootanaEventLoop::fODB, TMidasEvent::GetData(), TMidasEvent::GetSerialNumber(), TMidasFile::Open(), TRootanaEventLoop::OpenRootFile(), TRootanaEventLoop::PreFilter(), PrintCurrentStats(), TRootanaEventLoop::ProcessMidasEvent(), TMidasFile::Read(), and TDataContainer::SetMidasEventPointer().
Referenced by TRootanaEventLoop::ExecuteLoop().
00291 { 00292 TMidasFile f; 00293 bool tryOpen = f.Open(fname); 00294 00295 if (!tryOpen){ 00296 printf("Cannot open input file \"%s\"\n",fname); 00297 return -1; 00298 } 00299 00300 00301 int i=0; 00302 while (1) 00303 { 00304 TMidasEvent event; 00305 if (!f.Read(&event)) 00306 break; 00307 00308 /// Treat the begin run and end run events differently. 00309 int eventId = event.GetEventId(); 00310 00311 00312 00313 if ((eventId & 0xFFFF) == 0x8000){// begin run event 00314 00315 event.Print(); 00316 00317 // Load ODB contents from the ODB XML file 00318 if (fODB) delete fODB; 00319 fODB = new XmlOdb(event.GetData(),event.GetDataSize()); 00320 00321 fCurrentRunNumber = event.GetSerialNumber(); 00322 OpenRootFile(fCurrentRunNumber); 00323 BeginRun(0,event.GetSerialNumber(),0); 00324 00325 } else if ((eventId & 0xFFFF) == 0x8001){// end run event 00326 00327 event.Print(); 00328 //EndRun(0,fCurrentRunNumber,0); 00329 00330 00331 } else if ((eventId & 0xFFFF) == 0x8002){ 00332 00333 event.Print(); 00334 printf("Log message: %s\n", event.GetData()); 00335 00336 }else if(CheckEventID(eventId)){ // all other events; check that this event ID should be processed. 00337 00338 // Set the bank list for midas event. 00339 event.SetBankList(); 00340 00341 // Set the midas event pointer in the physics event. 00342 fDataContainer->SetMidasEventPointer(event); 00343 00344 //ProcessEvent if prefilter is satisfied... 00345 if(PreFilter(*fDataContainer)) 00346 ProcessMidasEvent(*fDataContainer); 00347 00348 // Cleanup the information for this event. 00349 fDataContainer->CleanupEvent(); 00350 00351 } 00352 00353 PrintCurrentStats(); 00354 00355 // Check if we have processed desired number of events. 00356 i++; 00357 if ((fMaxEvents!=0)&&(i>=fMaxEvents)){ 00358 printf("Reached event %d, exiting loop.\n",i); 00359 break; 00360 } 00361 } 00362 00363 f.Close(); 00364 00365 EndRun(0,fCurrentRunNumber,0); 00366 CloseRootFile(); 00367 00368 // start the ROOT GUI event loop 00369 // app->Run(kTRUE); 00370 00371 return 0; 00372 }


| void TRootanaEventLoop::ProcessThisEventID | ( | int | eventID | ) | [inline, inherited] |
Provide a way to force program to only process certain event IDs. This method can be called repeatedly to specify several different event IDs to accept. If the method is not called then all eventIDs are accepted.
Definition at line 167 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fProcessEventIDs.
00167 { 00168 fProcessEventIDs.push_back(eventID); 00169 };
| void TRootanaEventLoop::ProcessThisEventID | ( | int | eventID | ) | [inline, inherited] |
Provide a way to force program to only process certain event IDs. This method can be called repeatedly to specify several different event IDs to accept. If the method is not called then all eventIDs are accepted.
Definition at line 167 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fProcessEventIDs.
00167 { 00168 fProcessEventIDs.push_back(eventID); 00169 };
| void TRootanaDisplay::QuitButtonAction | ( | ) | [inherited] |
Method to call when 'quit' button is pressed.
| void TRootanaDisplay::QuitButtonAction | ( | ) | [inherited] |
Method to call when 'quit' button is pressed.
Definition at line 234 of file TRootanaDisplay.cxx.
References TRootanaEventLoop::CloseRootFile(), TRootanaDisplay::EndRun(), TRootanaDisplay::fQuitPushed, TRootanaEventLoop::GetCurrentRunNumber(), and TRootanaEventLoop::IsOnline().
00235 { 00236 // If we are offline, then we close the ROOT file here. 00237 // If we are online then the control will return to TRootanaEventLoop::ProcessMidasOnline 00238 // which will take care of closing the file. 00239 00240 if(!IsOnline()){ 00241 EndRun(0,GetCurrentRunNumber(),0); 00242 CloseRootFile(); 00243 } 00244 00245 // Set a flag so that we can breakout of loop if 00246 // we are ONLINE and PAUSED. 00247 // It is odd that gApplication->Terminate(0) doesn't 00248 // finish, but somehow it seems to wait for the the 00249 // RootanaDisplay::ProcessMidasEvent() to finish. 00250 fQuitPushed = true; 00251 gApplication->Terminate(0); 00252 }

| void TRootanaDisplay::Reset | ( | ) | [inherited] |
This method calls a couple other methods for resets the histograms. This method is attached using the ROOT signal/input system to the reset button on the canvas.
| void TRootanaDisplay::Reset | ( | ) | [inherited] |
This method calls a couple other methods for resets the histograms. This method is attached using the ROOT signal/input system to the reset button on the canvas.
Definition at line 224 of file TRootanaDisplay.cxx.
References TRootanaDisplay::fCanvasHandlers, TRootanaDisplay::ResetHistograms(), and TRootanaDisplay::UpdatePlotsAction().
00224 { 00225 // Call the reset functions defined in user event loop. 00226 ResetHistograms(); 00227 // Call the user defined canvas classes. 00228 for(unsigned int i = 0; i < fCanvasHandlers.size(); i++) 00229 fCanvasHandlers[i].second->ResetCanvasHistograms(); 00230 UpdatePlotsAction(); 00231 }

| void MyTestLoop::ResetHistograms | ( | ) | [inline, virtual] |
This method can be implemented by users to plotting of current canvas.
Reimplemented from TRootanaDisplay.
Definition at line 65 of file display_example.cxx.
References sizeBankFR10.
00065 { 00066 sizeBankFR10->Reset(); 00067 }
| void MyTestLoop::ResetHistograms | ( | ) | [inline, virtual] |
This method can be implemented by users to plotting of current canvas.
Reimplemented from TRootanaDisplay.
Definition at line 67 of file anaDisplay.cxx.
| void TRootanaEventLoop::SetCurrentRunNumber | ( | int | run | ) | [inline, inherited] |
Current Run Number.
Definition at line 110 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCurrentRunNumber.
00110 {fCurrentRunNumber = run;};
| void TRootanaEventLoop::SetCurrentRunNumber | ( | int | run | ) | [inline, inherited] |
Current Run Number.
Definition at line 110 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fCurrentRunNumber.
00110 {fCurrentRunNumber = run;};
| void TRootanaDisplay::SetDisplayName | ( | std::string | name | ) | [inline, inherited] |
Set Display name.
Definition at line 125 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fDisplayName.
00125 {fDisplayName = name;}
| void TRootanaDisplay::SetDisplayName | ( | std::string | name | ) | [inline, inherited] |
Set Display name.
Definition at line 125 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fDisplayName.
Referenced by AddAllCanvases().
00125 {fDisplayName = name;}

| void TRootanaDisplay::SetNumberSkipEvent | ( | int | number | ) | [inline, inherited] |
Function so that user can specify at outset how many events to skip before refreshing display (in online mode).
Definition at line 116 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow, TRootanaDisplay::fNumberSkipEventsOnline, and TMainDisplayWindow::GetSkipEventButton().
00116 { 00117 fNumberSkipEventsOnline = number; 00118 if(fMainWindow->GetSkipEventButton()) 00119 fMainWindow->GetSkipEventButton()->GetNumberEntry()->SetIntNumber(number); 00120 }

| void TRootanaDisplay::SetNumberSkipEvent | ( | int | number | ) | [inline, inherited] |
Function so that user can specify at outset how many events to skip before refreshing display (in online mode).
Definition at line 116 of file TRootanaDisplay.hxx.
References TRootanaDisplay::fMainWindow, TRootanaDisplay::fNumberSkipEventsOnline, and TMainDisplayWindow::GetSkipEventButton().
Referenced by AddAllCanvases().
00116 { 00117 fNumberSkipEventsOnline = number; 00118 if(fMainWindow->GetSkipEventButton()) 00119 fMainWindow->GetSkipEventButton()->GetNumberEntry()->SetIntNumber(number); 00120 }


| void TRootanaEventLoop::SetOnlineName | ( | std::string | name | ) | [inline, inherited] |
Definition at line 162 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOnlineName.
00162 {fOnlineName = name;};
| void TRootanaEventLoop::SetOnlineName | ( | std::string | name | ) | [inline, inherited] |
Definition at line 162 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOnlineName.
00162 {fOnlineName = name;};
| void TRootanaEventLoop::SetOutputFilename | ( | std::string | name | ) | [inline, inherited] |
Set the output filename. File name will be XXX.root, where XXX is run number
Definition at line 160 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFilename.
00160 {fOutputFilename = name;};
| void TRootanaEventLoop::SetOutputFilename | ( | std::string | name | ) | [inline, inherited] |
Set the output filename. File name will be XXX.root, where XXX is run number
Definition at line 160 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fOutputFilename.
Referenced by MyTestLoop().
00160 {fOutputFilename = name;};

| void TRootanaEventLoop::SuppressTimestampWarnings | ( | ) | [inline, inherited] |
Suppress the warning methods regarding old timestamp events for online ie warnings about analyzer falling behind data taking.
Definition at line 176 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fSuppressTimestampWarnings.
00176 { fSuppressTimestampWarnings = true;};
| void TRootanaEventLoop::SuppressTimestampWarnings | ( | ) | [inline, inherited] |
Suppress the warning methods regarding old timestamp events for online ie warnings about analyzer falling behind data taking.
Definition at line 176 of file TRootanaEventLoop.hxx.
References TRootanaEventLoop::fSuppressTimestampWarnings.
00176 { fSuppressTimestampWarnings = true;};
| void MyTestLoop::UpdateHistograms | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
This method can be implemented by users to update user histograms.
Reimplemented from TRootanaDisplay.
Definition at line 69 of file display_example.cxx.
References TDataContainer::GetMidasData(), TMidasEvent::LocateBank(), and sizeBankFR10.
00069 { 00070 void *ptr; 00071 // Update histograms 00072 int size = dataContainer.GetMidasData().LocateBank(NULL, "FR10", &ptr); 00073 sizeBankFR10->Fill(size); 00074 00075 }

| void MyTestLoop::UpdateHistograms | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
This method can be implemented by users to update user histograms.
Reimplemented from TRootanaDisplay.
Definition at line 69 of file anaDisplay.cxx.
| void TRootanaDisplay::UpdatePlotsAction | ( | ) | [inherited] |
This is a generic action to call when some button gets pushed. Also called in regular event handling loop
| void TRootanaDisplay::UpdatePlotsAction | ( | ) | [inherited] |
This is a generic action to call when some button gets pushed. Also called in regular event handling loop
Definition at line 182 of file TRootanaDisplay.cxx.
References TRootanaDisplay::fCachedDataContainer, TRootanaDisplay::fCanvasHandlers, TRootanaDisplay::fMainWindow, TMainDisplayWindow::GetCurrentEmbeddedCanvas(), TRootanaEventLoop::GetCurrentRunNumber(), TMainDisplayWindow::GetCurrentTabIndex(), TRootanaDisplay::GetDisplayName(), TRootanaDisplay::GetDisplayWindow(), TMainDisplayWindow::GetMain(), TDataContainer::GetMidasData(), TMidasEvent::GetSerialNumber(), TRootanaEventLoop::IsOnline(), TRootanaDisplay::PlotCanvas(), and TMainDisplayWindow::ResetSize().
Referenced by TRootanaDisplay::BeginRun(), TRootanaDisplay::EndRun(), TRootanaDisplay::ProcessMidasEvent(), and TRootanaDisplay::Reset().
00182 { 00183 00184 if(!fCachedDataContainer){ 00185 char displayTitle[200]; 00186 sprintf(displayTitle,"%s (): run %i (no events yet)", 00187 GetDisplayName().c_str(),GetCurrentRunNumber()); 00188 GetDisplayWindow()->GetMain()->SetWindowName(displayTitle); 00189 return; 00190 } 00191 00192 // Execute the plotting actions from user event loop. 00193 PlotCanvas(*fCachedDataContainer); 00194 00195 // See if we find a user class that describes this tab. 00196 std::pair<int,int> tabdex = GetDisplayWindow()->GetCurrentTabIndex(); 00197 for(unsigned int i = 0; i < fCanvasHandlers.size(); i++){ 00198 if(tabdex == fCanvasHandlers[i].first){ 00199 TRootEmbeddedCanvas* embed = GetDisplayWindow()->GetCurrentEmbeddedCanvas(); 00200 fCanvasHandlers[i].second->PlotCanvas(*fCachedDataContainer,embed); 00201 } 00202 } 00203 00204 00205 // Set the display title 00206 char displayTitle[200]; 00207 if(IsOnline()) 00208 sprintf(displayTitle,"%s (online): run %i event %i", 00209 GetDisplayName().c_str(),GetCurrentRunNumber(), 00210 fCachedDataContainer->GetMidasData().GetSerialNumber()); 00211 else 00212 sprintf(displayTitle,"%s (offline): run %i event %i", 00213 GetDisplayName().c_str(),GetCurrentRunNumber(), 00214 fCachedDataContainer->GetMidasData().GetSerialNumber()); 00215 00216 GetDisplayWindow()->GetMain()->SetWindowName(displayTitle); 00217 00218 00219 // Update canvas and window sizes 00220 fMainWindow->ResetSize(); 00221 00222 }


| void MyTestLoop::Usage | ( | void | ) | [inline, virtual] |
Called when there is a usage error. This code should print a usage message and then return.
Reimplemented from TRootanaEventLoop.
Definition at line 84 of file analyzer_example.cxx.
| void TRootanaDisplay::UsageRAD | ( | void | ) | [inline, virtual, inherited] |
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
Reimplemented from TRootanaEventLoop.
Definition at line 140 of file TRootanaDisplay.hxx.
| void TRootanaDisplay::UsageRAD | ( | void | ) | [inline, virtual, inherited] |
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
Reimplemented from TRootanaEventLoop.
Definition at line 140 of file TRootanaDisplay.hxx.
TDirectory * TRootanaEventLoop::fOnlineHistDir [protected, inherited] |
TDirectory for online histograms.
Definition at line 198 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::ExecuteLoop(), ProcessMidasEvent(), and TRootanaEventLoop::TRootanaEventLoop().
TDirectory * TRootanaEventLoop::fOnlineHistDir [protected, inherited] |
TDirectory for online histograms.
Definition at line 198 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::ExecuteLoop(), ProcessMidasEvent(), and TRootanaEventLoop::TRootanaEventLoop().
static TRootanaEventLoop * TRootanaEventLoop::fTRootanaEventLoop = NULL [static, protected, inherited] |
The static pointer to the singleton instance.
Definition at line 195 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::CreateSingleton(), and TRootanaEventLoop::Get().
static TRootanaEventLoop * TRootanaEventLoop::fTRootanaEventLoop = NULL [static, protected, inherited] |
The static pointer to the singleton instance.
Definition at line 195 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::CreateSingleton(), and TRootanaEventLoop::Get().
int MyTestLoop::nnn [private] |
Definition at line 15 of file analyzer_example.cxx.
Referenced by MyTestLoop(), and ProcessMidasEvent().
TH1F* MyTestLoop::sizeBankFR10 [private] |
Definition at line 45 of file display_example.cxx.
Referenced by MyTestLoop(), PlotCanvas(), ResetHistograms(), and UpdateHistograms().
1.6.1