fSourceList(NULL),
fNBlks(0),
fEventID(),
+ fEventId(-1),
fCurrentBlk(0),
fAsyncBlockList(NULL),
fBlockList(NULL),
fBlockList = NULL;
if ( fAsyncBlockList ) {
- fAsyncBlockList->Clear();
+ fAsyncBlockList->Delete();
delete fAsyncBlockList;
}
fAsyncBlockList = NULL;
if ( fProxyHandler ) {
iResult = fProxyHandler->Initialize();
if (iResult)
- HLTError(Form("Initialize of ProxyHandler failed."));
+ HLTError("Initialize of ProxyHandler failed.");
} else {
iResult = -1;
- HLTError(Form("Creating of ProxyHandler failed."));
+ HLTError("Creating of ProxyHandler failed.");
}
// -- Initialize ReaderList
Int_t AliHLTHOMERManager::CreateSourcesList() {
// see header file for class documentation
+ if (fProxyHandler == NULL)
+ {
+ HLTError("The object must first be initialised with a call to Initialize().");
+ return -1;
+ }
+
Int_t iResult = 0;
if ( fSourceList != NULL )
iResult = fProxyHandler->FillSourceList( fSourceList );
if ( iResult < 0 ) {
- HLTWarning(Form("There have been errors, while creating the sources list."));
+ HLTWarning("There have been errors, while creating the sources list.");
}
else if ( iResult > 0 ) {
- HLTWarning(Form("No active services found."));
+ HLTWarning("No active services found.");
}
else if ( fSourceList->IsEmpty() ) {
- HLTWarning(Form("No active services in the list."));
+ HLTWarning("No active services in the list.");
iResult = 2;
}
else {
- HLTInfo(Form("New sources list created."));
+ HLTInfo("New sources list created.");
// -- New SourceList has been created
// --> All Sources are new --> State has changed
Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
// see header file for class documentation
+ if (fReaderList == NULL or fSourceList == NULL)
+ {
+ HLTError("Must first create a source list with a call to CreateSourcesList().");
+ return -1;
+ }
+
Int_t iResult = 0;
// HAck Jochen
// -- Check if LibManager is present
if ( ! fLibManager ) {
- HLTError(Form("No LibManager present."));
+ HLTError("No LibManager present.");
return -1;
}
// -- Check if already connected and state has not changed
if ( fStateHasChanged == kFALSE && IsConnected() ) {
- HLTInfo(Form("No need for reconnection."));
+ HLTInfo("No need for reconnection.");
return 0;
}
// -- Create the Readoutlist
UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
const Char_t ** sourceHostnames = new const Char_t* [fSourceList->GetEntries()];
+ for(Int_t i = 0; i < fSourceList->GetEntries(); i++) {
+ sourceHostnames[i] = "";
+ }
UInt_t sourceCount = 0;
CreateReadoutList( sourceHostnames, sourcePorts, sourceCount, detector );
if ( sourceCount == 0 ) {
- HLTError(Form("No sources selected, aborting."));
+ HLTError("No sources selected, aborting.");
+ delete [] sourcePorts;
+ delete [] sourceHostnames;
return -2;
}
fReaderList->Add(dynamic_cast<TObject*>(fLibManager->OpenReader(sourceHostnames[idx], sourcePorts[idx])));
AliHLTHOMERReader *reader = static_cast<AliHLTHOMERReader*>(fReaderList->Last());
if ( !reader ) {
- HLTError(Form("Adding reader failed, aborting"));
+ HLTError("Adding reader failed, aborting");
+ delete [] sourcePorts;
+ delete [] sourceHostnames;
return -3;
}
fStateHasChanged = kTRUE;
fConnected = kFALSE;
- HLTInfo(Form("Connection closed."));
+ HLTInfo("Connection closed.");
return;
}
iResult = ConnectHOMER(detector);
if ( iResult ) {
- HLTError(Form("Error reconnecting."));
+ HLTError("Error reconnecting.");
}
return iResult;
return 55;//ConnectHOMER();
}
if ( !IsConnected() ) {
- HLTWarning(Form( "Not connected yet." ));
+ HLTWarning("Not connected yet.");
return -1;
}
// -- Reset asyncronous BlockList
- fAsyncBlockList->Clear();
+ fAsyncBlockList->Delete();
// ***
// *** Loop over all readers and get new event data
// -- Handle Blocks from current reader
iResult = HandleBlocks();
if ( iResult ) {
- HLTError(Form("Handling of blocks failed."));
+ HLTError("Handling of blocks failed.");
}
} // while( (object = next()) ) {
- return 0;
+ return iResult;
}
/* ---------------------------------------------------------------------------------
fAsyncBlockList->Add( block );
-
- // -- Check sources list if block is requested
- // if ( CheckIfRequested( block ) )
- // fAsyncBlockList->Add( block );
- // else {
- // // XXX HACK Jochen
- // }
} while( GetNextBlk() );
// see header file for class documentation
HLTInfo("Adding blocks to the synchroneous block list");
+ ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
+ if ( fEventId == eventID ) {
+ HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
+ return;
+ }
+
+ fEventId = eventID;
+
GetFirstBlk();
do {
}
//__________________________________________________________________________________
-TList* AliHLTHOMERManager::GetBlockListEventBuffer( Int_t idx ) {
+TList* AliHLTHOMERManager::GetBlockListEventBuffer() {
// see header file for class documentation
if(fBlockList)
else
return NULL;
- if ( idx == -1 )
- return NULL;
-
- return reinterpret_cast<TList*>((*fEventBuffer)[idx]);
}
if ( IsSyncBlocks() ) {
//AddBlockListToBuffer();
+ fBlockList->Clear();
AddToBlockList();
} else {
AddToAsyncBlockList();
bResult = kTRUE;
break;
}
+
+ if ( !GetBlkType().CompareTo("GLOBTRIG")) {
+ bResult = kTRUE;
+ break;
+ }
if ( !GetBlkType().CompareTo("ROOTTOBJ") ) {
AliHLTHOMERBlockDesc blockDesc;
// Get pointer to current block in current event
if ( !fCurrentReader || !IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return NULL;
}
if ( ndx < static_cast<Int_t>(fNBlks) )
// see header file for class documentation
if ( !fCurrentReader || !IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return 0;
}
// -- Check for Connection
if ( !fCurrentReader || ! IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return origin;
}
// -- Check for Connection
if ( !fCurrentReader || ! IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return type;
}
// -- Check for Connection
if ( !fCurrentReader || ! IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return 0;
}
Bool_t triggered = kFALSE;
if ( !fCurrentReader || !IsConnected() ) {
- HLTError(Form("Not connected yet."));
+ HLTError("Not connected yet.");
return kFALSE;
}
} while( GetNextBlk() );
if ( !foundTriggerBlock ) {
- HLTError(Form("No trigger decision object found"));
+ HLTError("No trigger decision object found");
return kFALSE;
}