// make sure logger is instantiated
AliLog::GetRootLogger();
- TRint *app = new TRint("App", &argc, argv);
+ TApplication *app = new TRint("App", &argc, argv);
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT
// Waiting for update by Pawel. Now GED in ROOT is better again :)
alistoragemanager/AliStorageDatabase.cxx
alieventserver/AliEventServerReconstruction.cxx
alieventserver/AliEventServerWindow.cxx
-
+ alieventserver/AliEventServer.cxx
)
string ( REPLACE ".cxx" ".h" CINTHDRS "${SRCS}" )
#pragma link C++ class AliStorageAdministratorPanelSetStorageParams+;
#pragma link C++ class AliEventServerReconstruction+;
#pragma link C++ class AliEventServerWindow+;
+#pragma link C++ class AliEventServer+;
#endif
fIsListenning(kFALSE),
fSettings(0),
fHost(0),
- fRecoThread(0)
+ fRecoThread(0),
+ fRecoIsRunning(false)
{}
AliEventServerReconstruction::~AliEventServerReconstruction()
{
Close();
if(fSettings){delete fSettings;fSettings=0;}
+ if(fAliReco){delete fAliReco;fAliReco=0;}
}
void AliEventServerReconstruction::Close()
{
fCurrentRunId = run;
- StopReconstruction();
-
// re-read settings
- if(fSettings){delete fSettings;}
+ if(fSettings){delete fSettings;fSettings=0;}
fSettings = new TEnv(AliEventServerUtil::GetPathToServerConf());
- TString recoBaseDir = fSettings->GetValue("server.saveRecoDir",
- DEFAULT_SERVER_SAVE_RECO_DIR);
+ TString recoBaseDir = fSettings->GetValue("server.saveRecoDir",DEFAULT_SERVER_SAVE_RECO_DIR);
// Create directories and logfile
- TString logFile = Form("%s/log/run%d.log",
- recoBaseDir.Data(),
- run);
-
+ TString logFile = Form("%s/log/run%d.log",recoBaseDir.Data(),run);
Info("DoStart","Reconstruction log will be written to %s",logFile.Data());
if( gSystem->RedirectOutput(logFile.Data())!=0)
{
printf(Form("AliRecoServer::StartReconstruction [] Error while trying to redirect output to [%s]. Exiting...", logFile.Data()) );
return kFALSE;
}
-
gSystem->cd(recoBaseDir.Data());
TString gdcs;
// Create Reco and Reco Thread
SetupReco(input);
- fAliReco->InitRun(input);
-
+
fHost = (const char*)Form("%s:%d", fSettings->GetValue("server.host", DEFAULT_SERVER_HOST), fSettings->GetValue("server.port", DEFAULT_SERVER_PORT));
fRecoThread = new TThread("AliEventServerReconstruction",
(void*)this);
fRecoThread->Run();
fIsListenning = kTRUE;
+ fRecoIsRunning=true;
return true;
}
void AliEventServerReconstruction::StopReconstruction()
{
- if(!fRecoThread) return;
- delete fRecoThread;
- fRecoThread=0;
- Emit("Stopped()");
-
- if(fAliReco){delete fAliReco;fAliReco=0;}
- if(fCDBmanager){delete fCDBmanager;fCDBmanager=0;}
+ cout<<"Reco server -- StopPeconstruction() called"<<endl;
+ if(!fRecoIsRunning)
+ {
+ cout<<"Reco is not running. Returning"<<endl;
+ return;
+ }
+ if(!fRecoThread)
+ {
+ cout<<"Reco server -- no thread. Returning"<<endl;
+ return;
+ }
+ cout<<"killing thread"<<endl;
+ fRecoThread->Kill();
+ cout<<"thread killed"<<endl;
+ delete fRecoThread;
+ fRecoThread=0;
+ cout<<"Reco server -- thread removed"<<endl;
+ // Emit("Stopped()");
+
+ cout<<"Reco server -- terminating reconstruction"<<endl;
+ fAliReco->SlaveTerminate();
+ if (fAliReco->GetAbort() != TSelector::kContinue) return;
+ fAliReco->Terminate();
+ if (fAliReco->GetAbort() != TSelector::kContinue) return;
+
+ if(fAliReco){delete fAliReco;fAliReco=0;}
+ cout<<"Reco server -- deleting CDBManager"<<endl;
+ if(fCDBmanager){delete fCDBmanager;fCDBmanager=0;}
+ cout<<"Reco server -- recontruction stopped"<<endl;
+ fRecoIsRunning=false;
}
void AliEventServerReconstruction::ReconstructionHandle()
fAliReco->SlaveTerminate();
if (fAliReco->GetAbort() != TSelector::kContinue) return;
fAliReco->Terminate();
- if (fAliReco->GetAbort() != TSelector::kContinue) return;
+ if (fAliReco->GetAbort() != TSelector::kContinue) return;
+ StopReconstruction();
+ fRecoIsRunning=false;
}
Int_t AliEventServerReconstruction::RetrieveGRP(UInt_t run, TString &gdc)
fCDBmanager->SetSpecificStorage(fSettings->GetValue( "cdb.specificStoragePath3", DEFAULT_CDB_SPEC_STORAGE_PATH3),
fSettings->GetValue( "cdb.specificStorageValue3", DEFAULT_CDB_SPEC_STORAGE_VALUE3));
- /* Reconstruction settings */
- if(fAliReco) delete fAliReco;
-
- AliReconstruction* rec = new AliReconstruction;
-
+ /* Reconstruction settings */
+ if(!fAliReco)fAliReco = new AliReconstruction();
+
// QA options
- rec->SetRunQA(fSettings->GetValue( "qa.runDetectors", DEFAULT_QA_RUN));
- rec->SetRunGlobalQA(fSettings->GetValue( "qa.runGlobal", DEFAULT_QA_RUN_GLOBAL));
- rec->SetQARefDefaultStorage(fSettings->GetValue( "qa.defaultStorage",DEFAULT_QAREF_STORAGE)) ;
- rec->SetRunPlaneEff(fSettings->GetValue( "reco.runPlaneEff", DEFAULT_RECO_RUN_PLANE_EFF));
+ //rec->SetRunQA(fSettings->GetValue( "qa.runDetectors", DEFAULT_QA_RUN));
+ //rec->SetRunGlobalQA(fSettings->GetValue( "qa.runGlobal", DEFAULT_QA_RUN_GLOBAL));
+ fAliReco->SetQARefDefaultStorage(fSettings->GetValue( "qa.defaultStorage",DEFAULT_QAREF_STORAGE)) ;
+ //rec->SetRunPlaneEff(fSettings->GetValue( "reco.runPlaneEff", DEFAULT_RECO_RUN_PLANE_EFF));
+
+ fAliReco->SetRunQA(":");
+ fAliReco->SetRunGlobalQA(false);
+ fAliReco->SetRunPlaneEff(false);
// AliReconstruction settings
- rec->SetWriteESDfriend(fSettings->GetValue( "reco.writeESDfriend", DEFAULT_RECO_WRITE_ESDF));
- rec->SetWriteAlignmentData(fSettings->GetValue( "reco.writeAlignment",DEFAULT_RECO_WRITE_ALIGN));
- rec->SetInput(input); // reconstruct data from this input
- rec->SetRunReconstruction(fSettings->GetValue( "reco.detectors", DEFAULT_RECO_DETECTORS));
- rec->SetUseTrackingErrorsForAlignment("ITS"); //-- !should be set from conf file!
+ fAliReco->SetWriteESDfriend(fSettings->GetValue( "reco.writeESDfriend", DEFAULT_RECO_WRITE_ESDF));
+ fAliReco->SetWriteAlignmentData(fSettings->GetValue( "reco.writeAlignment",DEFAULT_RECO_WRITE_ALIGN));
+ fAliReco->SetInput(input); // reconstruct data from this input
+ fAliReco->SetRunReconstruction(fSettings->GetValue( "reco.detectors", DEFAULT_RECO_DETECTORS));
+ fAliReco->SetUseTrackingErrorsForAlignment("ITS"); //-- !should be set from conf file!
// switch off cleanESD
- rec->SetCleanESD(fSettings->GetValue( "reco.cleanESD",DEFAULT_RECO_CLEAN_ESD));
+ fAliReco->SetCleanESD(fSettings->GetValue( "reco.cleanESD",DEFAULT_RECO_CLEAN_ESD));
- fAliReco = rec;
+ // init reco for given run
+ fAliReco->InitRun(input);
}
TEnv *fSettings;
TString fHost;
TThread *fRecoThread;
+ bool fRecoIsRunning;
AliEventServerReconstruction(const AliEventServerReconstruction&);
AliEventServerReconstruction& operator=(const AliEventServerReconstruction&);
#define DEFAULT_SERVER_HOST "tcp://*"
#define DEFAULT_SERVER_PORT 5024
#define DEFAULT_SERVER_SAVE_RECO_DIR "/local/reco"
-#define DEFAULT_CDB_STORAGE "local:///local/OCDB/2013"
+#define DEFAULT_CDB_STORAGE "local:///local/cdb"
#define DEFAULT_CDB_SPEC_STORAGE_PATH1 "/local/reco/GRP/GRP/Data"
#define DEFAULT_CDB_SPEC_STORAGE_VALUE1 ""
#define DEFAULT_CDB_SPEC_STORAGE_PATH2 "/local/reco/GRP/CTP/Config"
#define DEFAULT_RECO_WRITE_ALIGN 1
#define DEFAULT_RECO_CLEAN_ESD 0
#define DEFAULT_RECO_DETECTORS "ALL -PHOS -EMCAL"
-#define DEFAULT_LOGBOOK_HOST "localhost"
+#define DEFAULT_LOGBOOK_HOST "aldaqdb"
#define DEFAULT_LOGBOOK_PORT 3306
-#define DEFAULT_LOGBOOK_DB "logbook"
-#define DEFAULT_LOGBOOK_USER "dqm"
-#define DEFAULT_LOGBOOK_PASS "dqm123"
+#define DEFAULT_LOGBOOK_DB "LOGBOOK"
+#define DEFAULT_LOGBOOK_USER "logbookdqm"
+#define DEFAULT_LOGBOOK_PASS "SivaGJqi"
#define DEFAULT_DATA_SOURCE "local"
#include <TSystem.h>
}
/*
- void AliEventServerWindow::FinishedReconstruction(Int_t status)
- {
-// Slot called on termination of child process.
-Int_t run = fServer->GetRunId();
+void AliEventServerWindow::FinishedReconstruction(Int_t status)
+{
+ // Slot called on termination of child process.
+ Int_t run = fServer->GetRunId();
-Info("FinishedReconstruction", "Reconstruction Thread finished \tRunId:%d \tstatus=%d", run, status);
+ Info("FinishedReconstruction", "Reconstruction Thread finished \tRunId:%d \tstatus=%d", run, status);
-mIntInt_i i =fRun2PidMap.find(run);
-if (i != fRun2PidMap.end())
-{
-fRunList->RemoveEntry(run);
+ mIntInt_i i =fRun2PidMap.find(run);
+ if (i != fRun2PidMap.end())
+ {
+ fRunList->RemoveEntry(run);
-// clean (remove) run's reconstructed directory
-//gSystem->Exec(Form("rm -rf %s/reco/run%d_%d",gSystem->Getenv("ONLINERECO_BASE_DIR"),run,pid));
+ // clean (remove) run's reconstructed directory
+ //gSystem->Exec(Form("rm -rf %s/reco/run%d_%d",gSystem->Getenv("ONLINERECO_BASE_DIR"),run,pid));
-if (status == 0)
-{
-fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED", run), run);
-}
-else
-{
-fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED [%d]", run, status), run);
-}
-fRunList->Layout();
+ if (status == 0)
+ {
+ fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED", run), run);
+ }
+ else
+ {
+ fRunList->AddEntrySort(TString::Format("%-20d -- PROCESSED [%d]", run, status), run);
+ }
+ fRunList->Layout();
-}
-else
-{
-Warning("FinishedReconstruction", "Run number %d not registered.", run);
-}
+ }
+ else
+ {
+ Warning("FinishedReconstruction", "Run number %d not registered.", run);
+ }
+
+ }*/
-}
-*/
//------------------------------------------------------------------------------
// Private methods
//------------------------------------------------------------------------------
fRunList->AddEntrySort(TString::Format("%d", run), run);
fRunList->Layout();
gClient->NeedRedraw(fRunList);
-
+
+ if(fRecoServer){fRecoServer->StopReconstruction();}
StartReco(run);
}
// Slot called from DIM handler on stop of run.
AliInfo(Form("called for Run %d", run) );
- if(fRecoServer) fRecoServer->StopReconstruction();
+ if(fRecoServer){fRecoServer->StopReconstruction();}
+ printf("Updating GUI");
fRunList->RemoveEntry(run);
fRunList->Layout();
gClient->NeedRedraw(fRunList);
#include <TApplication.h>
#include "AliEventServerWindow.h"
+#include "AliEventServer.h"
+#include <iostream>
+#include <string.h>
int main(int argc, char **argv)
{
TApplication app("AliEventServer", &argc, argv);
+ if(argc<2)
+ {
+ std::cout<<"Starting Event Server without GUI"<<std::endl;
+ AliEventServer *server = new AliEventServer;
+ app.Run(kTRUE);
+ if(server){delete server;}
+ }
+ else if(strcmp(argv[1],"gui")==0)
+ {
+ std::cout<<"Starting Event Server in GUI mode"<<std::endl;
AliEventServerWindow *win = new AliEventServerWindow;
app.Run(kTRUE);
if(win){delete win;}
-
+ }
+ else
+ {
+ std::cout<<"Call without parameters to run without GUI.\nCall with \"gui\" parameter to launch with GUI"<<std::endl;
+ }
+
return 0;
}
mess->ResetMap();
AliESDEvent* data = (AliESDEvent*)(mess->ReadObjectAny(AliESDEvent::Class()));
-
+
if (data)
{
+ data->GetStdContent();
+ if(message){delete message;}
+ return data;
+ /*
TTree* tree= new TTree("esdTree", "esdTree");
data->WriteToTree(tree);
tree->Fill();
if(tree){delete tree;}
if(message){delete message;}
return event;
+ */
}
else
{