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),
67 fAsyncBlockList(NULL),
72 fCurrentBufferIdx(-1),
73 fNavigateBufferIdx(-1),
76 fTriggerString("ALL"),
77 fNEventsNotTriggered(0),
78 fRetryNextEvent(kFALSE),
81 // see header file for class documentation
83 // refer to README to build package
85 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
89 //##################################################################################
90 AliHLTHOMERManager::~AliHLTHOMERManager() {
91 // see header file for class documentation
96 TIter next(fReaderList);
97 TObject * object = NULL;
98 while ( ( object = next()) )
99 fLibManager->DeleteReader(static_cast<AliHLTHOMERReader*>(object) );
101 fReaderList->Clear();
110 if ( fProxyHandler != NULL )
111 delete fProxyHandler;
112 fProxyHandler = NULL;
114 if ( fSourceList != NULL )
118 if ( fEventBuffer ) {
119 fEventBuffer->Clear();
130 if ( fAsyncBlockList ) {
131 fAsyncBlockList->Delete();
132 delete fAsyncBlockList;
134 fAsyncBlockList = NULL;
137 //##################################################################################
138 Int_t AliHLTHOMERManager::Initialize() {
139 // see header file for class documentation
141 HLTInfo("Initializing");
145 // -- Initialize ProxyHandler
146 if ( !fProxyHandler )
147 fProxyHandler = new AliHLTHOMERProxyHandler();
149 if ( fProxyHandler ) {
150 iResult = fProxyHandler->Initialize();
152 HLTError("Initialize of ProxyHandler failed.");
156 HLTError("Creating of ProxyHandler failed.");
159 // -- Initialize ReaderList
160 // List ist not owner, as reader have to be created/deleted by the LibManager
162 fReaderList = new TList();
164 // -- Initialize asynchronous BlockList
165 if( !fAsyncBlockList ) {
166 fAsyncBlockList = new TList();
167 fAsyncBlockList->SetOwner(kTRUE);
170 //initialize normal block list
172 fBlockList = new TList();
173 fBlockList->SetOwner(kFALSE);
176 // -- Initialize Event Buffer and EventID array
177 if ( !fEventBuffer ) {
178 fEventBuffer = new TClonesArray( "TList", BUFFERSIZE );
181 for ( Int_t idx = 0; idx < BUFFERSIZE; ++idx ) {
182 new ((*fEventBuffer)[idx]) TList( );
183 (reinterpret_cast<TList*>((*fEventBuffer)[idx]))->SetOwner(kTRUE);
192 * ---------------------------------------------------------------------------------
194 * ---------------------------------------------------------------------------------
197 //##################################################################################
198 Int_t AliHLTHOMERManager::CreateSourcesList() {
199 // see header file for class documentation
201 if (fProxyHandler == NULL)
203 HLTError("The object must first be initialised with a call to Initialize().");
209 if ( fSourceList != NULL )
213 fSourceList = new TList();
214 fSourceList->SetOwner( kTRUE );
216 iResult = fProxyHandler->FillSourceList( fSourceList );
218 HLTWarning("There have been errors, while creating the sources list.");
220 else if ( iResult > 0 ) {
221 HLTWarning("No active services found.");
223 else if ( fSourceList->IsEmpty() ) {
224 HLTWarning("No active services in the list.");
228 HLTInfo("New sources list created.");
230 // -- New SourceList has been created
231 // --> All Sources are new --> State has changed
232 fStateHasChanged = kTRUE;
238 //##################################################################################
239 void AliHLTHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
240 // see header file for class documentation
242 if ( source->IsSelected() != state ) {
243 source->SetState( state );
244 fStateHasChanged = kTRUE;
251 * ---------------------------------------------------------------------------------
252 * Connection Handling - public
253 * ---------------------------------------------------------------------------------
256 //##################################################################################
257 Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
258 // see header file for class documentation
260 if (fReaderList == NULL or fSourceList == NULL)
262 HLTError("Must first create a source list with a call to CreateSourcesList().");
272 // -- Check if LibManager is present
273 if ( ! fLibManager ) {
274 HLTError("No LibManager present.");
278 // -- Check if already connected and state has not changed
279 if ( fStateHasChanged == kFALSE && IsConnected() ) {
280 HLTInfo("No need for reconnection.");
284 // -- If already connected, disconnect before connect
285 // or if ReaderList already filled
286 if ( IsConnected() || fReaderList->GetSize() != 0 ) {
287 HLTInfo(Form("IsConnected: %d fReaderList.Size: %d", IsConnected(), fReaderList->GetSize()));
290 // -- Create the Readoutlist
291 UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
292 const Char_t ** sourceHostnames = new const Char_t* [fSourceList->GetEntries()];
293 for(Int_t i = 0; i < fSourceList->GetEntries(); i++) {
294 sourceHostnames[i] = "";
296 UInt_t sourceCount = 0;
298 CreateReadoutList( sourceHostnames, sourcePorts, sourceCount, detector );
299 if ( sourceCount == 0 ) {
300 HLTError("No sources selected, aborting.");
301 delete [] sourcePorts;
302 delete [] sourceHostnames;
307 // *** Connect to data sources
310 for (UInt_t idx = 0; idx < sourceCount; idx++) {
312 if (sourcePorts[idx] > 60000)
315 HLTInfo(Form("Adding source %d as %s : %d", idx, sourceHostnames[idx], sourcePorts[idx]));
317 fReaderList->Add(dynamic_cast<TObject*>(fLibManager->OpenReader(sourceHostnames[idx], sourcePorts[idx])));
318 AliHLTHOMERReader *reader = static_cast<AliHLTHOMERReader*>(fReaderList->Last());
320 HLTError("Adding reader failed, aborting");
321 delete [] sourcePorts;
322 delete [] sourceHostnames;
326 if ( (iResult = reader->GetConnectionStatus()) ) {
328 // -- Connection to source failed
330 HLTError(Form("Error establishing connection to TCP source %s:%hu: %s (%d)",
331 sourceHostnames[idx], sourcePorts[idx], strerror(iResult), iResult));
333 if( !(TString(sourceHostnames[idx]).CompareTo("localhost")) ) {
334 HLTInfo("The failed connection is on localhost. is SSH tunnel up????? ");
335 HLTInfo(Form("Do: 'ssh -L %d:alihlt-vobox0.cern.ch:%d cernUser@lxplus.cern.ch -fN'",
336 sourcePorts[idx], sourcePorts[idx]));
340 fReaderList->RemoveLast();
343 fLibManager->DeleteReader( reader );
346 HLTInfo(Form("Removed source %d, %s : %d from sourceList", idx, sourceHostnames[idx], sourcePorts[idx]));
350 // -- Connection succeded
353 HLTInfo(Form("Connection established to source %s on port %d", sourceHostnames[idx], sourcePorts[idx]));
356 } // for (Int_t idx = 0; idx < sourceCount; idx++) {
358 delete[] sourceHostnames;
359 delete[] sourcePorts;
365 //##################################################################################
366 void AliHLTHOMERManager::DisconnectHOMER(){
367 // see header file for class documentation
369 HLTInfo("Disconnecting");
371 if ( fReaderList && fLibManager ) {
372 HLTInfo("Deleting readerlist and libmanager");
373 TIter next(fReaderList);
374 TObject * object = NULL;
375 while ( ( object = next()) )
376 fLibManager->DeleteReader(static_cast<AliHLTHOMERReader*>(object) );
379 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
380 fReaderList->Clear();
381 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
383 fReaderList = new TList ();
384 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
387 fStateHasChanged = kTRUE;
390 HLTInfo("Connection closed.");
395 //##################################################################################
396 Int_t AliHLTHOMERManager::ReconnectHOMER( TString detector="" ){
397 // see header file for class documentation
404 iResult = ConnectHOMER(detector);
406 HLTError("Error reconnecting.");
413 * ---------------------------------------------------------------------------------
414 * Event Handling - public
415 * ---------------------------------------------------------------------------------
418 //##################################################################################
419 Int_t AliHLTHOMERManager::NextEvent(){
421 // see header file for class documentation
424 Int_t iRetryCount = 0;
426 if ( !IsConnected() || fStateHasChanged ) {
427 HLTInfo("Not connected or state has changed, returning to AliEveHOMERManager, which will deal with this situation");
428 // cout << "connectecd " << IsConnected() << "haschanged "<<fStateHasChanged << endl;
429 return 55;//ConnectHOMER();
431 if ( !IsConnected() ) {
432 HLTWarning("Not connected yet.");
436 // -- Reset asyncronous BlockList
437 fAsyncBlockList->Delete();
440 // *** Loop over all readers and get new event data
443 TIter next(fReaderList);
444 TObject * object = NULL;
446 while( (object = next()) ) {
448 fCurrentReader = static_cast<AliHLTHOMERReader*>(object);
450 // -- Read next event data and error handling for HOMER (error codes and empty blocks)
453 iResult = fCurrentReader->ReadNextEvent( 40000000 /*timeout in us*/);
455 if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
456 HLTError(Form("No connection to source %d: %s (%d)",
457 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
460 else if ( iResult == 110 ) {
461 HLTError(Form("Timeout occured, reading event from source %d: %s (%d)",
462 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
465 else if ( iResult == 56 ) {
468 if ( iRetryCount >= 20 ) {
469 HLTError(Form("Retry Failed: Error reading event from source %d: %s (%d), returning",
470 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
474 HLTError(Form("Retry: Error reading event from source %d: %s (%d), making another attempt (no %d out of 20)",
475 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult, iRetryCount));
480 else if ( iResult ) {
481 HLTError(Form("General Error reading event from source %d: %s (%d), giving up",
482 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
487 HLTDebug("Successfully read out event from source");
493 // -- Check if event could be read
495 HLTInfo("Reading event from source failed");
499 // -- Handle Blocks from current reader
500 iResult = HandleBlocks();
502 HLTError("Handling of blocks failed.");
505 } // while( (object = next()) ) {
510 /* ---------------------------------------------------------------------------------
511 * Buffer Handling - public
512 * ---------------------------------------------------------------------------------
515 //##################################################################################
516 Int_t AliHLTHOMERManager::NavigateEventBufferBack() {
517 // see header file for class documentation
519 // -- reached the end of the buffer
520 if ( fNavigateBufferIdx == fBufferLowIdx )
523 Int_t newIdx = fNavigateBufferIdx - 1;
525 newIdx = BUFFERSIZE-1;
527 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
532 //##################################################################################
533 Int_t AliHLTHOMERManager::NavigateEventBufferFwd() {
534 // see header file for class documentation
536 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
538 // -- reached the top of the buffer
539 if ( fNavigateBufferIdx == fBufferTopIdx )
542 Int_t newIdx = fNavigateBufferIdx + 1;
543 if ( newIdx == BUFFERSIZE )
546 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
547 fNEventsAvailable -= 1;
549 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
555 ///////////////////////////////////////////////////////////////////////////////////
558 * ---------------------------------------------------------------------------------
559 * Connection Handling - private
560 * ---------------------------------------------------------------------------------
563 //##################################################################################
564 void AliHLTHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts,
565 UInt_t &sourceCount, TString detector ){
566 // see header file for class documentation
568 AliHLTHOMERSourceDesc * source= NULL;
570 // -- Read all sources and check if they should be read out
571 TIter next( fSourceList );
572 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
574 ///Don't use sources from dev cluster
575 if(source->GetPort() > 60000) continue;
577 // -- If detector NO detector name given
578 if ( ! detector.CompareTo("ALL") ) {
579 // -- Continue if source is not selected
581 //if ( ! source->IsSelected() )
584 // -- DetectorName given
586 // -- Continue if detector name doesn't match
587 if ( detector.CompareTo(source->GetDetector()) )
593 Bool_t exists = kFALSE;
595 // -- Loop over existing entries and check if entry is already in readout list
596 for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
597 if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() )
598 && sourcePorts[ii] == source->GetPort() ) {
604 // -- Add new entires to readout list
606 sourcePorts[sourceCount] = source->GetPort();
607 sourceHostnames[sourceCount] = source->GetHostname().Data();
611 } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
613 fStateHasChanged = kFALSE;
619 * ---------------------------------------------------------------------------------
620 * Buffer Handling - private
621 * ---------------------------------------------------------------------------------
624 //##################################################################################
625 void AliHLTHOMERManager::AddBlockListToBuffer() {
626 // see header file for class documentation
627 // -- Check if event is already in buffer
628 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
630 if ( fEventID[fBufferTopIdx] == eventID ) {
631 HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
635 // -- Check if event should be selected on basis of trigger string
636 if( fTriggerString.CompareTo("ALL") ){
637 if ( !CheckTriggerDecision() ) {
638 HLTInfo("Event not triggered");
641 HLTInfo("Event triggered");
645 HLTDebug("No trigger selection.");
650 if ( fBufferTopIdx == BUFFERSIZE )
653 // -- Change the low mark if necessary
654 if ( fBufferLowIdx == -1 )
656 else if ( fBufferTopIdx == fBufferLowIdx ) {
658 if ( fBufferLowIdx == BUFFERSIZE )
664 fEventID[fBufferTopIdx] = eventID;
666 // -- Clear Buffer slot
667 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Clear();
668 if(fBlockList->IsOwner()) HLTWarning("block list is owner!!");
669 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
670 //fBlockList->Clear();
671 fBlockList = new TList();
672 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
676 // -- Fill block list
679 // -- Create new block
680 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
681 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
682 GetBlkType(), GetBlkSpecification() );
684 // -- Check sources list if block is requested
685 if ( CheckIfRequested( block ) ) {
686 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
687 fBlockList->Add(block);
691 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
692 fBlockList->Add(block);
697 } while( GetNextBlk() );
699 //We have one more event available
701 HLTInfo(Form("fNEventsAvailable %d", fNEventsAvailable));
705 //##################################################################################
706 void AliHLTHOMERManager::AddToAsyncBlockList() {
707 // see header file for class documentation
709 HLTInfo("Adding blocks to the asynchroneous block list");
715 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
716 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
717 GetBlkType(), GetBlkSpecification() );
720 fAsyncBlockList->Add( block );
722 } while( GetNextBlk() );
726 //__________________________________________________________________________________
727 void AliHLTHOMERManager::AddToBlockList() {
728 // see header file for class documentation
729 HLTInfo("Adding blocks to the synchroneous block list");
731 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
733 if ( fEventId == eventID ) {
734 HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
743 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
744 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
745 GetBlkType(), GetBlkSpecification() );
746 fBlockList->Add( block );
748 } while( GetNextBlk() );
751 //__________________________________________________________________________________
752 TList* AliHLTHOMERManager::GetBlockListEventBuffer() {
753 // see header file for class documentation
764 //__________________________________________________________________________________
765 Int_t AliHLTHOMERManager::HandleBlocks() {
766 // see header file for class documentation
770 // -- Get blockCnt and eventID
771 fNBlks = static_cast<ULong_t>(fCurrentReader->GetBlockCnt());
772 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
775 // -- Check if blocks present
777 HLTWarning(Form("Event 0x%016lX (%lu) with no blocks", eventID, eventID));
781 HLTInfo(Form("Event 0x%016lX (%lu) with %lu blocks", eventID, eventID, fNBlks));
783 if ( IsSyncBlocks() ) {
784 //AddBlockListToBuffer();
788 AddToAsyncBlockList();
794 //__________________________________________________________________________________
795 Bool_t AliHLTHOMERManager::IsSyncBlocks() {
796 // see header file for class documentation
798 Bool_t bResult = kFALSE;
804 if ( !GetBlkType().CompareTo("ALIESDV0")) {
809 if ( !GetBlkType().CompareTo("GLOBTRIG")) {
814 if ( !GetBlkType().CompareTo("ROOTTOBJ") ) {
815 AliHLTHOMERBlockDesc blockDesc;
817 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
818 GetBlkType(), GetBlkSpecification() );
819 if ( !blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
826 } while( GetNextBlk() );
832 //##################################################################################
833 void* AliHLTHOMERManager::GetBlk( Int_t ndx ) {
834 // see header file for class documentation
835 // Get pointer to current block in current event
837 if ( !fCurrentReader || !IsConnected() ) {
838 HLTError("Not connected yet.");
841 if ( ndx < static_cast<Int_t>(fNBlks) )
842 return const_cast<void*> (fCurrentReader->GetBlockData(ndx));
847 //##################################################################################
848 ULong_t AliHLTHOMERManager::GetBlkSize( Int_t ndx ) {
849 // see header file for class documentation
851 if ( !fCurrentReader || !IsConnected() ) {
852 HLTError("Not connected yet.");
856 if ( ndx < static_cast<Int_t>(fNBlks) )
857 return static_cast<ULong_t> (fCurrentReader->GetBlockDataLength(ndx));
862 //##################################################################################
863 TString AliHLTHOMERManager::GetBlkOrigin( Int_t ndx ) {
864 // see header file for class documentation
868 // -- Check for Connection
869 if ( !fCurrentReader || ! IsConnected() ) {
870 HLTError("Not connected yet.");
874 // -- Check block index
875 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
876 HLTError(Form("Block index %d out of range.", ndx ));
886 reverseOrigin.data = static_cast<UInt_t>(fCurrentReader->GetBlockDataOrigin(ndx));
888 // -- Reverse the order
889 for (Int_t ii = 3; ii >= 0; ii-- )
890 if ( reverseOrigin.array[ii] != ' ')
891 origin.Append( reverseOrigin.array[ii] );
893 origin.Remove( TString::kTrailing, ' ' );
898 //##################################################################################
899 TString AliHLTHOMERManager::GetBlkType( Int_t ndx ) {
900 // see header file for class documentation
904 // -- Check for Connection
905 if ( !fCurrentReader || ! IsConnected() ) {
906 HLTError("Not connected yet.");
910 // -- Check block index
911 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
912 HLTError(Form("Block index %d out of range.", ndx ));
922 reverseType.data = static_cast<ULong64_t> (fCurrentReader->GetBlockDataType(ndx));
924 // -- Reverse the order
925 for (Int_t ii = 7; ii >= 0; ii-- )
926 if ( reverseType.array[ii] != ' ')
927 type.Append( reverseType.array[ii] );
929 type.Remove( TString::kTrailing, ' ' );
934 //##################################################################################
935 ULong_t AliHLTHOMERManager::GetBlkSpecification( Int_t ndx ) {
936 // see header file for class documentation
938 // -- Check for Connection
939 if ( !fCurrentReader || ! IsConnected() ) {
940 HLTError("Not connected yet.");
944 // -- Check block index
945 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
946 HLTError(Form("Block index %d out of range.", ndx ));
950 return static_cast<ULong_t>(fCurrentReader->GetBlockDataSpec(ndx));
953 //##################################################################################
954 Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
955 // see header file for class documentation
957 Bool_t requested = kFALSE;
959 AliHLTHOMERSourceDesc * source= NULL;
961 // -- Read all sources and check if they should be read out
962 TIter next( fSourceList );
963 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
965 // -- Check if source is selected
966 if ( ! source->IsSelected() )
969 // -- Check if detector matches
970 if ( source->GetSourceName().CompareTo( block->GetBlockName() ) )
976 } // while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
980 HLTInfo(Form("Block requested : %s", block->GetBlockName().Data()));
983 HLTInfo(Form("Block NOT requested : %s", block->GetBlockName().Data()));
990 /* ---------------------------------------------------------------------------------
991 * Trigger Handling - private
992 * ---------------------------------------------------------------------------------
995 //##################################################################################
996 Bool_t AliHLTHOMERManager::CheckTriggerDecision() {
997 // see header file for class documentation
999 Bool_t triggered = kFALSE;
1001 if ( !fCurrentReader || !IsConnected() ) {
1002 HLTError("Not connected yet.");
1006 AliHLTHOMERBlockDesc blockDesc;
1010 // -- Fill block list
1011 Bool_t foundTriggerBlock = kFALSE;
1014 if ( (GetBlkType().CompareTo("ROOTTOBJ") == 0) ) {
1015 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
1016 GetBlkType(), GetBlkSpecification() );
1018 if ( ! blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
1020 foundTriggerBlock = kTRUE;
1025 } while( GetNextBlk() );
1027 if ( !foundTriggerBlock ) {
1028 HLTError("No trigger decision object found");
1032 // -- Get the global decision object
1033 AliHLTGlobalTriggerDecision* globalDecision =
1034 static_cast<AliHLTGlobalTriggerDecision*>(blockDesc.GetTObject());
1036 if ( fTriggerString.CompareTo("HLTGlobalTrigger") == 0 ) {
1037 triggered = globalDecision->EventTriggered();
1041 for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1043 const AliHLTTriggerDecision* triggerDecision =
1044 reinterpret_cast<const AliHLTTriggerDecision*>(globalDecision->InputObject(idx));
1046 if ( !(fTriggerString.CompareTo(triggerDecision->Description())) ) {
1047 triggered = triggerDecision->EventTriggered();
1050 } // for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1056 fRetryNextEvent = kFALSE;
1057 fNEventsNotTriggered = 0;
1060 fRetryNextEvent = kTRUE;
1061 ++fNEventsNotTriggered;