1 #include "AliDimIntNotifier.h"
2 #include "AliOnlineReco.h"
6 #include <TSQLServer.h>
7 #include <TSQLResult.h>
10 #include <TTimeStamp.h>
12 int main(int argc, char **argv)
14 AliDimIntNotifier::SetMainThreadId();
16 Bool_t test = argc > 1 && strcmp("-test", argv[1]) == 0;
18 TRint app("App", &argc, argv);
20 AliOnlineReco *win = new AliOnlineReco;
23 TString autoRun(gSystem->Getenv("ONLINERECO_AUTORUN"));
24 if (autoRun == "1" || autoRun.CompareTo("true", TString::kIgnoreCase) == 0)
26 win->SetAutoRunMode(kTRUE);
33 win->GetSOR(0)->infoHandlerTest(2214);
34 win->GetSOR(0)->infoHandlerTest(2215);
35 win->GetSOR(0)->infoHandlerTest(2224);
36 win->GetSOR(0)->infoHandlerTest(2244);
38 printf("win = (AliOnlineReco*) 0x%lx\n", (unsigned long)win);
42 TString baseDir = gSystem->Getenv("ONLINERECO_BASE_DIR");
45 printf("ERROR: ONLINERECO_BASE_DIR is not set. Exiting...");
49 TString dbHost = gSystem->Getenv("ONLINERECO_DB_HOST");
52 printf("ERROR: ONLINERECO_DB_HOST is not set. Exiting...");
56 TString dbPort = gSystem->Getenv("ONLINERECO_DB_PORT");
59 printf("ERROR: ONLINERECO_DB_PORT is not set. Exiting...");
63 TString dbName = gSystem->Getenv("ONLINERECO_DB_NAME");
66 printf("ERROR: ONLINERECO_DB_NAME is not set. Exiting...");
70 TString user = gSystem->Getenv("ONLINERECO_DB_USER");
73 printf("ERROR: ONLINERECO_DB_USER is not set. Exiting...");
77 TString password = gSystem->Getenv("ONLINERECO_DB_PASSWORD");
78 if (password.IsNull())
80 printf("ERROR: ONLINERECO_DB_PASSWORD is not set. Exiting...");
84 TSQLServer* server = TSQLServer::Connect(Form("mysql://%s:%s/%s", dbHost.Data(), dbPort.Data(), dbName.Data()), user.Data(), password.Data());
86 printf("ERROR: Could not connect to DAQ Logbook");
91 sqlQuery.Form("SELECT run FROM logbook WHERE DAQ_time_start > %u AND DAQ_time_end IS NULL AND partition REGEXP 'PHYSICS.*'",
92 (UInt_t)ts.GetSec()-86400);
93 TSQLResult* result = server->Query(sqlQuery);
96 printf("ERROR: Can't execute query <%s>!", sqlQuery.Data());
99 if (result->GetRowCount() == 0)
101 printf("No active physics runs found");
105 for (Int_t iRow = 0; iRow < result->GetRowCount(); iRow++)
107 TSQLRow* row = result->Next();
108 TString runStr = row->GetField(0);
109 if (runStr.IsDigit())
110 win->StartOfRun(runStr.Atoi());