3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 /** @file AliHLTHOMERManager.cxx
20 @author Jochen Thaeder
22 @brief Manger for HOMER in aliroot
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
37 #include "AliHLTHOMERManager.h"
38 // -- -- -- -- -- -- --
39 #include "AliHLTHOMERLibManager.h"
40 #include "AliHLTHOMERSourceDesc.h"
41 #include "AliHLTHOMERBlockDesc.h"
42 // -- -- -- -- -- -- --
43 #include "AliHLTGlobalTriggerDecision.h"
44 #include "AliHLTTriggerDecision.h"
45 //---------------------------
47 ClassImp(AliHLTHOMERManager)
50 * ---------------------------------------------------------------------------------
51 * Constructor / Destructor
52 * ---------------------------------------------------------------------------------
55 //##################################################################################
56 AliHLTHOMERManager::AliHLTHOMERManager() :
57 fLibManager(new AliHLTHOMERLibManager),
58 fStateHasChanged(kTRUE),
66 fAsyncBlockList(NULL),
71 fCurrentBufferIdx(-1),
72 fNavigateBufferIdx(-1),
75 fTriggerString("ALL"),
76 fNEventsNotTriggered(0),
77 fRetryNextEvent(kFALSE),
80 // see header file for class documentation
82 // refer to README to build package
84 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
88 //##################################################################################
89 AliHLTHOMERManager::~AliHLTHOMERManager() {
90 // see header file for class documentation
95 TIter next(fReaderList);
96 TObject * object = NULL;
97 while ( ( object = next()) )
98 fLibManager->DeleteReader(static_cast<AliHLTHOMERReader*>(object) );
100 fReaderList->Clear();
109 if ( fProxyHandler != NULL )
110 delete fProxyHandler;
111 fProxyHandler = NULL;
113 if ( fSourceList != NULL )
117 if ( fEventBuffer ) {
118 fEventBuffer->Clear();
129 if ( fAsyncBlockList ) {
130 fAsyncBlockList->Clear();
131 delete fAsyncBlockList;
133 fAsyncBlockList = NULL;
136 //##################################################################################
137 Int_t AliHLTHOMERManager::Initialize() {
138 // see header file for class documentation
140 HLTInfo("Initializing");
144 // -- Initialize ProxyHandler
145 if ( !fProxyHandler )
146 fProxyHandler = new AliHLTHOMERProxyHandler();
148 if ( fProxyHandler ) {
149 iResult = fProxyHandler->Initialize();
151 HLTError(Form("Initialize of ProxyHandler failed."));
155 HLTError(Form("Creating of ProxyHandler failed."));
158 // -- Initialize ReaderList
159 // List ist not owner, as reader have to be created/deleted by the LibManager
161 fReaderList = new TList();
163 // -- Initialize asynchronous BlockList
164 if( !fAsyncBlockList ) {
165 fAsyncBlockList = new TList();
166 fAsyncBlockList->SetOwner(kTRUE);
169 //initialize normal block list
171 fBlockList = new TList();
172 fBlockList->SetOwner(kFALSE);
175 // -- Initialize Event Buffer and EventID array
176 if ( !fEventBuffer ) {
177 fEventBuffer = new TClonesArray( "TList", BUFFERSIZE );
180 for ( Int_t idx = 0; idx < BUFFERSIZE; ++idx ) {
181 new ((*fEventBuffer)[idx]) TList( );
182 (reinterpret_cast<TList*>((*fEventBuffer)[idx]))->SetOwner(kTRUE);
191 * ---------------------------------------------------------------------------------
193 * ---------------------------------------------------------------------------------
196 //##################################################################################
197 Int_t AliHLTHOMERManager::CreateSourcesList() {
198 // see header file for class documentation
202 if ( fSourceList != NULL )
206 fSourceList = new TList();
207 fSourceList->SetOwner( kTRUE );
209 iResult = fProxyHandler->FillSourceList( fSourceList );
211 HLTWarning(Form("There have been errors, while creating the sources list."));
213 else if ( iResult > 0 ) {
214 HLTWarning(Form("No active services found."));
216 else if ( fSourceList->IsEmpty() ) {
217 HLTWarning(Form("No active services in the list."));
221 HLTInfo(Form("New sources list created."));
223 // -- New SourceList has been created
224 // --> All Sources are new --> State has changed
225 fStateHasChanged = kTRUE;
231 //##################################################################################
232 void AliHLTHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
233 // see header file for class documentation
235 if ( source->IsSelected() != state ) {
236 source->SetState( state );
237 fStateHasChanged = kTRUE;
244 * ---------------------------------------------------------------------------------
245 * Connection Handling - public
246 * ---------------------------------------------------------------------------------
249 //##################################################################################
250 Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
251 // see header file for class documentation
259 // -- Check if LibManager is present
260 if ( ! fLibManager ) {
261 HLTError(Form("No LibManager present."));
265 // -- Check if already connected and state has not changed
266 if ( fStateHasChanged == kFALSE && IsConnected() ) {
267 HLTInfo(Form("No need for reconnection."));
271 // -- If already connected, disconnect before connect
272 // or if ReaderList already filled
273 if ( IsConnected() || fReaderList->GetSize() != 0 ) {
274 HLTInfo(Form("IsConnected: %d fReaderList.Size: %d", IsConnected(), fReaderList->GetSize()));
277 // -- Create the Readoutlist
278 UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
279 const Char_t ** sourceHostnames = new const Char_t* [fSourceList->GetEntries()];
280 UInt_t sourceCount = 0;
282 CreateReadoutList( sourceHostnames, sourcePorts, sourceCount, detector );
283 if ( sourceCount == 0 ) {
284 HLTError(Form("No sources selected, aborting."));
289 // *** Connect to data sources
292 for (UInt_t idx = 0; idx < sourceCount; idx++) {
294 if (sourcePorts[idx] > 60000)
297 HLTInfo(Form("Adding source %d as %s : %d", idx, sourceHostnames[idx], sourcePorts[idx]));
299 fReaderList->Add(dynamic_cast<TObject*>(fLibManager->OpenReader(sourceHostnames[idx], sourcePorts[idx])));
300 AliHLTHOMERReader *reader = static_cast<AliHLTHOMERReader*>(fReaderList->Last());
302 HLTError(Form("Adding reader failed, aborting"));
306 if ( (iResult = reader->GetConnectionStatus()) ) {
308 // -- Connection to source failed
310 HLTError(Form("Error establishing connection to TCP source %s:%hu: %s (%d)",
311 sourceHostnames[idx], sourcePorts[idx], strerror(iResult), iResult));
313 if( !(TString(sourceHostnames[idx]).CompareTo("localhost")) ) {
314 HLTInfo("The failed connection is on localhost. is SSH tunnel up????? ");
315 HLTInfo(Form("Do: 'ssh -L %d:alihlt-vobox0.cern.ch:%d cernUser@lxplus.cern.ch -fN'",
316 sourcePorts[idx], sourcePorts[idx]));
320 fReaderList->RemoveLast();
323 fLibManager->DeleteReader( reader );
326 HLTInfo(Form("Removed source %d, %s : %d from sourceList", idx, sourceHostnames[idx], sourcePorts[idx]));
330 // -- Connection succeded
333 HLTInfo(Form("Connection established to source %s on port %d", sourceHostnames[idx], sourcePorts[idx]));
336 } // for (Int_t idx = 0; idx < sourceCount; idx++) {
338 delete[] sourceHostnames;
339 delete[] sourcePorts;
345 //##################################################################################
346 void AliHLTHOMERManager::DisconnectHOMER(){
347 // see header file for class documentation
349 HLTInfo("Disconnecting");
351 if ( fReaderList && fLibManager ) {
352 HLTInfo("Deleting readerlist and libmanager");
353 TIter next(fReaderList);
354 TObject * object = NULL;
355 while ( ( object = next()) )
356 fLibManager->DeleteReader(static_cast<AliHLTHOMERReader*>(object) );
359 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
360 fReaderList->Clear();
361 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
363 fReaderList = new TList ();
364 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
367 fStateHasChanged = kTRUE;
370 HLTInfo(Form("Connection closed."));
375 //##################################################################################
376 Int_t AliHLTHOMERManager::ReconnectHOMER( TString detector="" ){
377 // see header file for class documentation
384 iResult = ConnectHOMER(detector);
386 HLTError(Form("Error reconnecting."));
393 * ---------------------------------------------------------------------------------
394 * Event Handling - public
395 * ---------------------------------------------------------------------------------
398 //##################################################################################
399 Int_t AliHLTHOMERManager::NextEvent(){
401 // see header file for class documentation
404 Int_t iRetryCount = 0;
406 if ( !IsConnected() || fStateHasChanged ) {
407 HLTInfo("Not connected or state has changed, returning to AliEveHOMERManager, which will deal with this situation");
408 // cout << "connectecd " << IsConnected() << "haschanged "<<fStateHasChanged << endl;
409 return 55;//ConnectHOMER();
411 if ( !IsConnected() ) {
412 HLTWarning(Form( "Not connected yet." ));
416 // -- Reset asyncronous BlockList
417 fAsyncBlockList->Clear();
420 // *** Loop over all readers and get new event data
423 TIter next(fReaderList);
424 TObject * object = NULL;
426 while( (object = next()) ) {
428 fCurrentReader = static_cast<AliHLTHOMERReader*>(object);
430 // -- Read next event data and error handling for HOMER (error codes and empty blocks)
433 iResult = fCurrentReader->ReadNextEvent( 40000000 /*timeout in us*/);
435 if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
436 HLTError(Form("No connection to source %d: %s (%d)",
437 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
440 else if ( iResult == 110 ) {
441 HLTError(Form("Timeout occured, reading event from source %d: %s (%d)",
442 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
445 else if ( iResult == 56 ) {
448 if ( iRetryCount >= 20 ) {
449 HLTError(Form("Retry Failed: Error reading event from source %d: %s (%d), returning",
450 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
454 HLTError(Form("Retry: Error reading event from source %d: %s (%d), making another attempt (no %d out of 20)",
455 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult, iRetryCount));
460 else if ( iResult ) {
461 HLTError(Form("General Error reading event from source %d: %s (%d), giving up",
462 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
467 HLTDebug("Successfully read out event from source");
473 // -- Check if event could be read
475 HLTInfo("Reading event from source failed");
479 // -- Handle Blocks from current reader
480 iResult = HandleBlocks();
482 HLTError(Form("Handling of blocks failed."));
485 } // while( (object = next()) ) {
490 /* ---------------------------------------------------------------------------------
491 * Buffer Handling - public
492 * ---------------------------------------------------------------------------------
495 //##################################################################################
496 Int_t AliHLTHOMERManager::NavigateEventBufferBack() {
497 // see header file for class documentation
499 // -- reached the end of the buffer
500 if ( fNavigateBufferIdx == fBufferLowIdx )
503 Int_t newIdx = fNavigateBufferIdx - 1;
505 newIdx = BUFFERSIZE-1;
507 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
512 //##################################################################################
513 Int_t AliHLTHOMERManager::NavigateEventBufferFwd() {
514 // see header file for class documentation
516 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
518 // -- reached the top of the buffer
519 if ( fNavigateBufferIdx == fBufferTopIdx )
522 Int_t newIdx = fNavigateBufferIdx + 1;
523 if ( newIdx == BUFFERSIZE )
526 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
527 fNEventsAvailable -= 1;
529 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
535 ///////////////////////////////////////////////////////////////////////////////////
538 * ---------------------------------------------------------------------------------
539 * Connection Handling - private
540 * ---------------------------------------------------------------------------------
543 //##################################################################################
544 void AliHLTHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts,
545 UInt_t &sourceCount, TString detector ){
546 // see header file for class documentation
548 AliHLTHOMERSourceDesc * source= NULL;
550 // -- Read all sources and check if they should be read out
551 TIter next( fSourceList );
552 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
554 ///Don't use sources from dev cluster
555 if(source->GetPort() > 60000) continue;
557 // -- If detector NO detector name given
558 if ( ! detector.CompareTo("ALL") ) {
559 // -- Continue if source is not selected
561 //if ( ! source->IsSelected() )
564 // -- DetectorName given
566 // -- Continue if detector name doesn't match
567 if ( detector.CompareTo(source->GetDetector()) )
573 Bool_t exists = kFALSE;
575 // -- Loop over existing entries and check if entry is already in readout list
576 for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
577 if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() )
578 && sourcePorts[ii] == source->GetPort() ) {
584 // -- Add new entires to readout list
586 sourcePorts[sourceCount] = source->GetPort();
587 sourceHostnames[sourceCount] = source->GetHostname().Data();
591 } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
593 fStateHasChanged = kFALSE;
599 * ---------------------------------------------------------------------------------
600 * Buffer Handling - private
601 * ---------------------------------------------------------------------------------
604 //##################################################################################
605 void AliHLTHOMERManager::AddBlockListToBuffer() {
606 // see header file for class documentation
607 // -- Check if event is already in buffer
608 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
610 if ( fEventID[fBufferTopIdx] == eventID ) {
611 HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
615 // -- Check if event should be selected on basis of trigger string
616 if( fTriggerString.CompareTo("ALL") ){
617 if ( !CheckTriggerDecision() ) {
618 HLTInfo("Event not triggered");
621 HLTInfo("Event triggered");
625 HLTDebug("No trigger selection.");
630 if ( fBufferTopIdx == BUFFERSIZE )
633 // -- Change the low mark if necessary
634 if ( fBufferLowIdx == -1 )
636 else if ( fBufferTopIdx == fBufferLowIdx ) {
638 if ( fBufferLowIdx == BUFFERSIZE )
644 fEventID[fBufferTopIdx] = eventID;
646 // -- Clear Buffer slot
647 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Clear();
648 if(fBlockList->IsOwner()) HLTWarning("block list is owner!!");
649 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
650 //fBlockList->Clear();
651 fBlockList = new TList();
652 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
656 // -- Fill block list
659 // -- Create new block
660 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
661 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
662 GetBlkType(), GetBlkSpecification() );
664 // -- Check sources list if block is requested
665 if ( CheckIfRequested( block ) ) {
666 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
667 fBlockList->Add(block);
671 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
672 fBlockList->Add(block);
677 } while( GetNextBlk() );
679 //We have one more event available
681 HLTInfo(Form("fNEventsAvailable %d", fNEventsAvailable));
685 //##################################################################################
686 void AliHLTHOMERManager::AddToAsyncBlockList() {
687 // see header file for class documentation
689 HLTInfo("Adding blocks to the asynchroneous block list");
695 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
696 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
697 GetBlkType(), GetBlkSpecification() );
700 fAsyncBlockList->Add( block );
702 // -- Check sources list if block is requested
703 // if ( CheckIfRequested( block ) )
704 // fAsyncBlockList->Add( block );
706 // // XXX HACK Jochen
709 } while( GetNextBlk() );
713 //__________________________________________________________________________________
714 void AliHLTHOMERManager::AddToBlockList() {
715 // see header file for class documentation
716 HLTInfo("Adding blocks to the synchroneous block list");
722 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
723 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
724 GetBlkType(), GetBlkSpecification() );
725 fBlockList->Add( block );
727 } while( GetNextBlk() );
730 //__________________________________________________________________________________
731 TList* AliHLTHOMERManager::GetBlockListEventBuffer( Int_t idx ) {
732 // see header file for class documentation
742 return reinterpret_cast<TList*>((*fEventBuffer)[idx]);
747 //__________________________________________________________________________________
748 Int_t AliHLTHOMERManager::HandleBlocks() {
749 // see header file for class documentation
753 // -- Get blockCnt and eventID
754 fNBlks = static_cast<ULong_t>(fCurrentReader->GetBlockCnt());
755 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
758 // -- Check if blocks present
760 HLTWarning(Form("Event 0x%016lX (%lu) with no blocks", eventID, eventID));
764 HLTInfo(Form("Event 0x%016lX (%lu) with %lu blocks", eventID, eventID, fNBlks));
766 if ( IsSyncBlocks() ) {
767 //AddBlockListToBuffer();
770 AddToAsyncBlockList();
776 //__________________________________________________________________________________
777 Bool_t AliHLTHOMERManager::IsSyncBlocks() {
778 // see header file for class documentation
780 Bool_t bResult = kFALSE;
786 if ( !GetBlkType().CompareTo("ALIESDV0")) {
791 if ( !GetBlkType().CompareTo("ROOTTOBJ") ) {
792 AliHLTHOMERBlockDesc blockDesc;
794 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
795 GetBlkType(), GetBlkSpecification() );
796 if ( !blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
803 } while( GetNextBlk() );
809 //##################################################################################
810 void* AliHLTHOMERManager::GetBlk( Int_t ndx ) {
811 // see header file for class documentation
812 // Get pointer to current block in current event
814 if ( !fCurrentReader || !IsConnected() ) {
815 HLTError(Form("Not connected yet."));
818 if ( ndx < static_cast<Int_t>(fNBlks) )
819 return const_cast<void*> (fCurrentReader->GetBlockData(ndx));
824 //##################################################################################
825 ULong_t AliHLTHOMERManager::GetBlkSize( Int_t ndx ) {
826 // see header file for class documentation
828 if ( !fCurrentReader || !IsConnected() ) {
829 HLTError(Form("Not connected yet."));
833 if ( ndx < static_cast<Int_t>(fNBlks) )
834 return static_cast<ULong_t> (fCurrentReader->GetBlockDataLength(ndx));
839 //##################################################################################
840 TString AliHLTHOMERManager::GetBlkOrigin( Int_t ndx ) {
841 // see header file for class documentation
845 // -- Check for Connection
846 if ( !fCurrentReader || ! IsConnected() ) {
847 HLTError(Form("Not connected yet."));
851 // -- Check block index
852 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
853 HLTError(Form("Block index %d out of range.", ndx ));
863 reverseOrigin.data = static_cast<UInt_t>(fCurrentReader->GetBlockDataOrigin(ndx));
865 // -- Reverse the order
866 for (Int_t ii = 3; ii >= 0; ii-- )
867 if ( reverseOrigin.array[ii] != ' ')
868 origin.Append( reverseOrigin.array[ii] );
870 origin.Remove( TString::kTrailing, ' ' );
875 //##################################################################################
876 TString AliHLTHOMERManager::GetBlkType( Int_t ndx ) {
877 // see header file for class documentation
881 // -- Check for Connection
882 if ( !fCurrentReader || ! IsConnected() ) {
883 HLTError(Form("Not connected yet."));
887 // -- Check block index
888 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
889 HLTError(Form("Block index %d out of range.", ndx ));
899 reverseType.data = static_cast<ULong64_t> (fCurrentReader->GetBlockDataType(ndx));
901 // -- Reverse the order
902 for (Int_t ii = 7; ii >= 0; ii-- )
903 if ( reverseType.array[ii] != ' ')
904 type.Append( reverseType.array[ii] );
906 type.Remove( TString::kTrailing, ' ' );
911 //##################################################################################
912 ULong_t AliHLTHOMERManager::GetBlkSpecification( Int_t ndx ) {
913 // see header file for class documentation
915 // -- Check for Connection
916 if ( !fCurrentReader || ! IsConnected() ) {
917 HLTError(Form("Not connected yet."));
921 // -- Check block index
922 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
923 HLTError(Form("Block index %d out of range.", ndx ));
927 return static_cast<ULong_t>(fCurrentReader->GetBlockDataSpec(ndx));
930 //##################################################################################
931 Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
932 // see header file for class documentation
934 Bool_t requested = kFALSE;
936 AliHLTHOMERSourceDesc * source= NULL;
938 // -- Read all sources and check if they should be read out
939 TIter next( fSourceList );
940 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
942 // -- Check if source is selected
943 if ( ! source->IsSelected() )
946 // -- Check if detector matches
947 if ( source->GetSourceName().CompareTo( block->GetBlockName() ) )
953 } // while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
957 HLTInfo(Form("Block requested : %s", block->GetBlockName().Data()));
960 HLTInfo(Form("Block NOT requested : %s", block->GetBlockName().Data()));
967 /* ---------------------------------------------------------------------------------
968 * Trigger Handling - private
969 * ---------------------------------------------------------------------------------
972 //##################################################################################
973 Bool_t AliHLTHOMERManager::CheckTriggerDecision() {
974 // see header file for class documentation
976 Bool_t triggered = kFALSE;
978 if ( !fCurrentReader || !IsConnected() ) {
979 HLTError(Form("Not connected yet."));
983 AliHLTHOMERBlockDesc blockDesc;
987 // -- Fill block list
988 Bool_t foundTriggerBlock = kFALSE;
991 if ( (GetBlkType().CompareTo("ROOTTOBJ") == 0) ) {
992 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
993 GetBlkType(), GetBlkSpecification() );
995 if ( ! blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
997 foundTriggerBlock = kTRUE;
1002 } while( GetNextBlk() );
1004 if ( !foundTriggerBlock ) {
1005 HLTError(Form("No trigger decision object found"));
1009 // -- Get the global decision object
1010 AliHLTGlobalTriggerDecision* globalDecision =
1011 static_cast<AliHLTGlobalTriggerDecision*>(blockDesc.GetTObject());
1013 if ( fTriggerString.CompareTo("HLTGlobalTrigger") == 0 ) {
1014 triggered = globalDecision->EventTriggered();
1018 for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1020 const AliHLTTriggerDecision* triggerDecision =
1021 reinterpret_cast<const AliHLTTriggerDecision*>(globalDecision->InputObject(idx));
1023 if ( !(fTriggerString.CompareTo(triggerDecision->Description())) ) {
1024 triggered = triggerDecision->EventTriggered();
1027 } // for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1033 fRetryNextEvent = kFALSE;
1034 fNEventsNotTriggered = 0;
1037 fRetryNextEvent = kTRUE;
1038 ++fNEventsNotTriggered;