1 #ifndef TRootanaEventLoop_hxx_seen
2 #define TRootanaEventLoop_hxx_seen
20 #include "TApplication.h"
21 #include "TDirectory.h"
24 #ifdef HAVE_THTTP_SERVER
25 #include "THttpServer.h"
68 virtual void BeginRun(
int transition,
int run,
int time);
73 virtual void EndRun(
int transition,
int run,
int time);
82 virtual void EndRunRAD(
int transition,
int run,
int time){};
90 virtual void Usage(
void);
140 std::cout <<
"Singleton has already been created" << std::endl;
157 void OpenRootFile(
int run, std::string midasFilename = std::string(
""));
181 return std::string(
"");
215 fOutputFile =
new TFile(name.c_str(),options.c_str());
239 #ifdef HAVE_THTTP_SERVER
240 THttpServer* GetTHttpServer();
void DisableAutoMainWindow()
Disable automatic creation of MainWindow.
void ProcessThisEventID(int eventID)
TFile * fOutputFile
Output ROOT file.
void SuppressTimestampWarnings()
bool fDisableRootOutput
Variable for disabling/enabling Root output.
std::string fBufferName
Buffer to connect to.
virtual ~TRootanaEventLoop()
bool GetSuppressTimestampWarnings()
Suppress timestamp warnings? true = suppress warnings.
static TRootanaEventLoop & Get(void)
bool fIsOffline
Are we processing offline or online data?
virtual void Initialize(void)
virtual bool CheckOptionRAD(std::string option)
virtual bool ProcessMidasEvent(TDataContainer &dataContainer)=0
void DisableRootOutput(bool disable=true)
int GetCurrentRunNumber() const
Current Run Number.
void SetOutputFilename(std::string name)
void PrintHelp()
Help Message.
void SetCurrentRunNumber(int run)
Current Run Number.
TDataContainer * fDataContainer
bool IsRootFileValid()
Check if output ROOT file is valid and open.
bool CreateOutputFile(std::string name, std::string options="RECREATE")
std::string fOutputFilename
MVOdb * GetODB()
Get pointer to ODB variables.
void UseOnlyRecent(bool setting=true)
void UseBatchMode()
Use a batch mode, where we don't check ROOT status.
void OpenRootFile(int run, std::string midasFilename=std::string(""))
Open output ROOT file.
std::vector< int > fProcessEventIDs
This is the set of eventIDs to process.
virtual void BeginRun(int transition, int run, int time)
virtual std::string SetFullOutputFileName(int run, std::string midasFilename)
virtual bool CheckOption(std::string option)
int fCurrentRunNumber
Current run number.
int ExecuteLoop(int argc, char *argv[])
Method to actually process the Midas information, either as file or online.
bool CheckEventID(int eventId)
Little helper method to check if EventID matchs requested EventID list.
int IsRootOutputEnabled()
static TRootanaEventLoop * fTRootanaEventLoop
The static pointer to the singleton instance.
void CloseRootFile()
Cloe output ROOT file.
virtual void UsageRAD(void)
Also a special version of usage for TRootanaDisplay. See CheckOptionRAD.
bool fSuppressTimestampWarnings
Bool for suppressing the warnings about old timestamps.
MVOdb * fODB
Pointer to the ODB access instance.
virtual void EndRun(int transition, int run, int time)
bool IsOffline() const
Are we processing offline data?
bool IsOnline() const
Are we processing online data?
virtual void BeginRunRAD(int transition, int run, int time)
virtual void InitializeRAD(void)
Special version of Init method, to be used only by TRootanaDisplay.
virtual void EndRunRAD(int transition, int run, int time)
Also special version of EOR method, to be used only by TRootanaDisplay.
int ProcessMidasOnline(TApplication *app, const char *hostname, const char *exptname)
void SetOnlineName(std::string name)
static void CreateSingleton()
TDataContainer * GetDataContainer()
Method to get the data container that event loop owns.
std::string fOnlineName
Name of program, as seen by MIDAS.
void SetTHttpServerReadWrite(bool readwrite=true)
TDirectory * fOnlineHistDir
TDirectory for online histograms.
virtual bool PreFilter(TDataContainer &dataContainer)
int ProcessMidasFile(TApplication *app, const char *fname)