

Public Member Functions | |
| Analyzer () | |
| virtual | ~Analyzer () |
| void | Initialize () |
| void | BeginRun (int transition, int run, int time) |
| bool | ProcessMidasEvent (TDataContainer &dataContainer) |
| 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 | EndRun (int transition, int run, int time) |
| virtual void | EndRun (int transition, int run, int time) |
| virtual void | Finalize () |
| virtual void | Finalize () |
| virtual void | Usage (void) |
| virtual void | Usage (void) |
| virtual bool | CheckOption (std::string option) |
| virtual bool | CheckOption (std::string option) |
| 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") |
| virtual bool | CheckOptionRAD (std::string option) |
| virtual bool | CheckOptionRAD (std::string option) |
| virtual void | UsageRAD (void) |
| Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. | |
| virtual void | UsageRAD (void) |
| Also a special version of usage for TRootanaDisplay. See CheckOptionRAD. | |
Protected Attributes | |
| TDirectory * | fOnlineHistDir |
| TDirectory for online histograms. | |
Static Protected Attributes | |
| static TRootanaEventLoop * | fTRootanaEventLoop = NULL |
| The static pointer to the singleton instance. | |
Private Attributes | |
| TV792Histograms * | v792_histos |
| TV1190Histograms * | v1190_histos |
Definition at line 33 of file ana.cxx.
| Analyzer::Analyzer | ( | ) | [inline] |
Definition at line 51 of file ana.cxx.
References TRootanaEventLoop::DisableAutoMainWindow(), v1190_histos, and v792_histos.
00051 { 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 };

| void Analyzer::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 TRootanaEventLoop.
Definition at line 79 of file ana.cxx.
References TV1190Histograms::BeginRun(), TV792Histograms::BeginRun(), v1190_histos, and v792_histos.
00079 { 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 }

| 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 }

| virtual bool TRootanaEventLoop::CheckOption | ( | std::string | option | ) | [virtual, inherited] |
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 in MyTestLoop.
| bool TRootanaEventLoop::CheckOption | ( | std::string | option | ) | [virtual, inherited] |
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 in MyTestLoop.
Definition at line 116 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::ExecuteLoop().

| virtual bool TRootanaEventLoop::CheckOptionRAD | ( | std::string | option | ) | [protected, 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 in TRootanaDisplay, and TRootanaDisplay.
| bool TRootanaEventLoop::CheckOptionRAD | ( | std::string | option | ) | [protected, 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 in TRootanaDisplay, and TRootanaDisplay.
Definition at line 117 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::ExecuteLoop().

| 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().
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::MyTestLoop().
00154 {fDisableRootOutput = disable;};

| virtual void TRootanaEventLoop::EndRun | ( | int | transition, | |
| int | run, | |||
| int | time | |||
| ) | [virtual, inherited] |
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 in TRootanaDisplay, MyTestLoop, and TRootanaDisplay.
| void TRootanaEventLoop::EndRun | ( | int | transition, | |
| int | run, | |||
| int | time | |||
| ) | [virtual, inherited] |
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 in TRootanaDisplay, MyTestLoop, and TRootanaDisplay.
Definition at line 108 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::ProcessMidasFile().

| 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 MyTestLoop::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;};
| 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 Analyzer::Initialize | ( | void | ) | [inline, virtual] |
Called after the arguments are processes but before reading the first event is read
Reimplemented from TRootanaEventLoop.
| 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 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 }


| 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 Analyzer::ProcessMidasEvent | ( | TDataContainer & | dataContainer | ) | [inline, virtual] |
The main method, called for each event. Users must implement this function!
Implements TRootanaEventLoop.
Definition at line 99 of file ana.cxx.
References TV1190Histograms::UpdateHistograms(), TV792Histograms::UpdateHistograms(), v1190_histos, and v792_histos.
00099 { 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 }

| 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 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 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::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;};
| virtual void TRootanaEventLoop::Usage | ( | void | ) | [virtual, inherited] |
Called when there is a usage error. This code should print a usage message and then return.
Reimplemented in MyTestLoop.
| void TRootanaEventLoop::Usage | ( | void | ) | [virtual, inherited] |
Called when there is a usage error. This code should print a usage message and then return.
Reimplemented in MyTestLoop.
Definition at line 112 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::PrintHelp().

| virtual void TRootanaEventLoop::UsageRAD | ( | void | ) | [protected, virtual, inherited] |
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
Reimplemented in TRootanaDisplay, and TRootanaDisplay.
| void TRootanaEventLoop::UsageRAD | ( | void | ) | [protected, virtual, inherited] |
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
Reimplemented in TRootanaDisplay, and TRootanaDisplay.
Definition at line 113 of file TRootanaEventLoop.cxx.
Referenced by TRootanaEventLoop::PrintHelp().

TDirectory * TRootanaEventLoop::fOnlineHistDir [protected, inherited] |
TDirectory for online histograms.
Definition at line 198 of file TRootanaEventLoop.hxx.
Referenced by TRootanaEventLoop::ExecuteLoop(), MyTestLoop::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().
TV1190Histograms* Analyzer::v1190_histos [private] |
Definition at line 39 of file ana.cxx.
Referenced by Analyzer(), BeginRun(), and ProcessMidasEvent().
TV792Histograms* Analyzer::v792_histos [private] |
Definition at line 36 of file ana.cxx.
Referenced by Analyzer(), BeginRun(), and ProcessMidasEvent().
1.6.1