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(Form("Initialize of ProxyHandler failed."));
156 HLTError(Form("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
203 if ( fSourceList != NULL )
207 fSourceList = new TList();
208 fSourceList->SetOwner( kTRUE );
210 iResult = fProxyHandler->FillSourceList( fSourceList );
212 HLTWarning(Form("There have been errors, while creating the sources list."));
214 else if ( iResult > 0 ) {
215 HLTWarning(Form("No active services found."));
217 else if ( fSourceList->IsEmpty() ) {
218 HLTWarning(Form("No active services in the list."));
222 HLTInfo(Form("New sources list created."));
224 // -- New SourceList has been created
225 // --> All Sources are new --> State has changed
226 fStateHasChanged = kTRUE;
232 //##################################################################################
233 void AliHLTHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
234 // see header file for class documentation
236 if ( source->IsSelected() != state ) {
237 source->SetState( state );
238 fStateHasChanged = kTRUE;
245 * ---------------------------------------------------------------------------------
246 * Connection Handling - public
247 * ---------------------------------------------------------------------------------
250 //##################################################################################
251 Int_t AliHLTHOMERManager::ConnectHOMER( TString detector ){
252 // see header file for class documentation
260 // -- Check if LibManager is present
261 if ( ! fLibManager ) {
262 HLTError(Form("No LibManager present."));
266 // -- Check if already connected and state has not changed
267 if ( fStateHasChanged == kFALSE && IsConnected() ) {
268 HLTInfo(Form("No need for reconnection."));
272 // -- If already connected, disconnect before connect
273 // or if ReaderList already filled
274 if ( IsConnected() || fReaderList->GetSize() != 0 ) {
275 HLTInfo(Form("IsConnected: %d fReaderList.Size: %d", IsConnected(), fReaderList->GetSize()));
278 // -- Create the Readoutlist
279 UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
280 const Char_t ** sourceHostnames = new const Char_t* [fSourceList->GetEntries()];
281 for(Int_t i = 0; i < fSourceList->GetEntries(); i++) {
282 sourceHostnames[i] = "";
284 UInt_t sourceCount = 0;
286 CreateReadoutList( sourceHostnames, sourcePorts, sourceCount, detector );
287 if ( sourceCount == 0 ) {
288 HLTError(Form("No sources selected, aborting."));
289 delete [] sourcePorts;
290 delete [] sourceHostnames;
295 // *** Connect to data sources
298 for (UInt_t idx = 0; idx < sourceCount; idx++) {
300 if (sourcePorts[idx] > 60000)
303 HLTInfo(Form("Adding source %d as %s : %d", idx, sourceHostnames[idx], sourcePorts[idx]));
305 fReaderList->Add(dynamic_cast<TObject*>(fLibManager->OpenReader(sourceHostnames[idx], sourcePorts[idx])));
306 AliHLTHOMERReader *reader = static_cast<AliHLTHOMERReader*>(fReaderList->Last());
308 HLTError(Form("Adding reader failed, aborting"));
309 delete [] sourcePorts;
310 delete [] sourceHostnames;
314 if ( (iResult = reader->GetConnectionStatus()) ) {
316 // -- Connection to source failed
318 HLTError(Form("Error establishing connection to TCP source %s:%hu: %s (%d)",
319 sourceHostnames[idx], sourcePorts[idx], strerror(iResult), iResult));
321 if( !(TString(sourceHostnames[idx]).CompareTo("localhost")) ) {
322 HLTInfo("The failed connection is on localhost. is SSH tunnel up????? ");
323 HLTInfo(Form("Do: 'ssh -L %d:alihlt-vobox0.cern.ch:%d cernUser@lxplus.cern.ch -fN'",
324 sourcePorts[idx], sourcePorts[idx]));
328 fReaderList->RemoveLast();
331 fLibManager->DeleteReader( reader );
334 HLTInfo(Form("Removed source %d, %s : %d from sourceList", idx, sourceHostnames[idx], sourcePorts[idx]));
338 // -- Connection succeded
341 HLTInfo(Form("Connection established to source %s on port %d", sourceHostnames[idx], sourcePorts[idx]));
344 } // for (Int_t idx = 0; idx < sourceCount; idx++) {
346 delete[] sourceHostnames;
347 delete[] sourcePorts;
353 //##################################################################################
354 void AliHLTHOMERManager::DisconnectHOMER(){
355 // see header file for class documentation
357 HLTInfo("Disconnecting");
359 if ( fReaderList && fLibManager ) {
360 HLTInfo("Deleting readerlist and libmanager");
361 TIter next(fReaderList);
362 TObject * object = NULL;
363 while ( ( object = next()) )
364 fLibManager->DeleteReader(static_cast<AliHLTHOMERReader*>(object) );
367 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
368 fReaderList->Clear();
369 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
371 fReaderList = new TList ();
372 HLTInfo(Form("fReaderList size %d", fReaderList->GetSize()));
375 fStateHasChanged = kTRUE;
378 HLTInfo(Form("Connection closed."));
383 //##################################################################################
384 Int_t AliHLTHOMERManager::ReconnectHOMER( TString detector="" ){
385 // see header file for class documentation
392 iResult = ConnectHOMER(detector);
394 HLTError(Form("Error reconnecting."));
401 * ---------------------------------------------------------------------------------
402 * Event Handling - public
403 * ---------------------------------------------------------------------------------
406 //##################################################################################
407 Int_t AliHLTHOMERManager::NextEvent(){
409 // see header file for class documentation
412 Int_t iRetryCount = 0;
414 if ( !IsConnected() || fStateHasChanged ) {
415 HLTInfo("Not connected or state has changed, returning to AliEveHOMERManager, which will deal with this situation");
416 // cout << "connectecd " << IsConnected() << "haschanged "<<fStateHasChanged << endl;
417 return 55;//ConnectHOMER();
419 if ( !IsConnected() ) {
420 HLTWarning(Form( "Not connected yet." ));
424 // -- Reset asyncronous BlockList
425 fAsyncBlockList->Delete();
428 // *** Loop over all readers and get new event data
431 TIter next(fReaderList);
432 TObject * object = NULL;
434 while( (object = next()) ) {
436 fCurrentReader = static_cast<AliHLTHOMERReader*>(object);
438 // -- Read next event data and error handling for HOMER (error codes and empty blocks)
441 iResult = fCurrentReader->ReadNextEvent( 40000000 /*timeout in us*/);
443 if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
444 HLTError(Form("No connection to source %d: %s (%d)",
445 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
448 else if ( iResult == 110 ) {
449 HLTError(Form("Timeout occured, reading event from source %d: %s (%d)",
450 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
453 else if ( iResult == 56 ) {
456 if ( iRetryCount >= 20 ) {
457 HLTError(Form("Retry Failed: Error reading event from source %d: %s (%d), returning",
458 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
462 HLTError(Form("Retry: Error reading event from source %d: %s (%d), making another attempt (no %d out of 20)",
463 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult, iRetryCount));
468 else if ( iResult ) {
469 HLTError(Form("General Error reading event from source %d: %s (%d), giving up",
470 fCurrentReader->GetErrorConnectionNdx(), strerror(iResult), iResult));
475 HLTDebug("Successfully read out event from source");
481 // -- Check if event could be read
483 HLTInfo("Reading event from source failed");
487 // -- Handle Blocks from current reader
488 iResult = HandleBlocks();
490 HLTError(Form("Handling of blocks failed."));
493 } // while( (object = next()) ) {
498 /* ---------------------------------------------------------------------------------
499 * Buffer Handling - public
500 * ---------------------------------------------------------------------------------
503 //##################################################################################
504 Int_t AliHLTHOMERManager::NavigateEventBufferBack() {
505 // see header file for class documentation
507 // -- reached the end of the buffer
508 if ( fNavigateBufferIdx == fBufferLowIdx )
511 Int_t newIdx = fNavigateBufferIdx - 1;
513 newIdx = BUFFERSIZE-1;
515 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
520 //##################################################################################
521 Int_t AliHLTHOMERManager::NavigateEventBufferFwd() {
522 // see header file for class documentation
524 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
526 // -- reached the top of the buffer
527 if ( fNavigateBufferIdx == fBufferTopIdx )
530 Int_t newIdx = fNavigateBufferIdx + 1;
531 if ( newIdx == BUFFERSIZE )
534 fCurrentBufferIdx = fNavigateBufferIdx = newIdx;
535 fNEventsAvailable -= 1;
537 HLTInfo(Form("fNavigateBufferIdx: %d, fCurrentBufferIdx %d, fBufferTopIdx %d", fNavigateBufferIdx, fCurrentBufferIdx, fBufferTopIdx));
543 ///////////////////////////////////////////////////////////////////////////////////
546 * ---------------------------------------------------------------------------------
547 * Connection Handling - private
548 * ---------------------------------------------------------------------------------
551 //##################################################################################
552 void AliHLTHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts,
553 UInt_t &sourceCount, TString detector ){
554 // see header file for class documentation
556 AliHLTHOMERSourceDesc * source= NULL;
558 // -- Read all sources and check if they should be read out
559 TIter next( fSourceList );
560 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
562 ///Don't use sources from dev cluster
563 if(source->GetPort() > 60000) continue;
565 // -- If detector NO detector name given
566 if ( ! detector.CompareTo("ALL") ) {
567 // -- Continue if source is not selected
569 //if ( ! source->IsSelected() )
572 // -- DetectorName given
574 // -- Continue if detector name doesn't match
575 if ( detector.CompareTo(source->GetDetector()) )
581 Bool_t exists = kFALSE;
583 // -- Loop over existing entries and check if entry is already in readout list
584 for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
585 if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() )
586 && sourcePorts[ii] == source->GetPort() ) {
592 // -- Add new entires to readout list
594 sourcePorts[sourceCount] = source->GetPort();
595 sourceHostnames[sourceCount] = source->GetHostname().Data();
599 } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
601 fStateHasChanged = kFALSE;
607 * ---------------------------------------------------------------------------------
608 * Buffer Handling - private
609 * ---------------------------------------------------------------------------------
612 //##################################################################################
613 void AliHLTHOMERManager::AddBlockListToBuffer() {
614 // see header file for class documentation
615 // -- Check if event is already in buffer
616 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
618 if ( fEventID[fBufferTopIdx] == eventID ) {
619 HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
623 // -- Check if event should be selected on basis of trigger string
624 if( fTriggerString.CompareTo("ALL") ){
625 if ( !CheckTriggerDecision() ) {
626 HLTInfo("Event not triggered");
629 HLTInfo("Event triggered");
633 HLTDebug("No trigger selection.");
638 if ( fBufferTopIdx == BUFFERSIZE )
641 // -- Change the low mark if necessary
642 if ( fBufferLowIdx == -1 )
644 else if ( fBufferTopIdx == fBufferLowIdx ) {
646 if ( fBufferLowIdx == BUFFERSIZE )
652 fEventID[fBufferTopIdx] = eventID;
654 // -- Clear Buffer slot
655 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Clear();
656 if(fBlockList->IsOwner()) HLTWarning("block list is owner!!");
657 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
658 //fBlockList->Clear();
659 fBlockList = new TList();
660 HLTInfo(Form("fBlockList size %d", fBlockList->GetSize()));
664 // -- Fill block list
667 // -- Create new block
668 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
669 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
670 GetBlkType(), GetBlkSpecification() );
672 // -- Check sources list if block is requested
673 if ( CheckIfRequested( block ) ) {
674 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
675 fBlockList->Add(block);
679 (reinterpret_cast<TList*>((*fEventBuffer)[fBufferTopIdx]))->Add( block );
680 fBlockList->Add(block);
685 } while( GetNextBlk() );
687 //We have one more event available
689 HLTInfo(Form("fNEventsAvailable %d", fNEventsAvailable));
693 //##################################################################################
694 void AliHLTHOMERManager::AddToAsyncBlockList() {
695 // see header file for class documentation
697 HLTInfo("Adding blocks to the asynchroneous block list");
703 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
704 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
705 GetBlkType(), GetBlkSpecification() );
708 fAsyncBlockList->Add( block );
710 } while( GetNextBlk() );
714 //__________________________________________________________________________________
715 void AliHLTHOMERManager::AddToBlockList() {
716 // see header file for class documentation
717 HLTInfo("Adding blocks to the synchroneous block list");
719 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
721 if ( fEventId == eventID ) {
722 HLTInfo(Form("Event 0x%016lX (%lu) already in buffer.", eventID, eventID));
731 AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
732 block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
733 GetBlkType(), GetBlkSpecification() );
734 fBlockList->Add( block );
736 } while( GetNextBlk() );
739 //__________________________________________________________________________________
740 TList* AliHLTHOMERManager::GetBlockListEventBuffer() {
741 // see header file for class documentation
752 //__________________________________________________________________________________
753 Int_t AliHLTHOMERManager::HandleBlocks() {
754 // see header file for class documentation
758 // -- Get blockCnt and eventID
759 fNBlks = static_cast<ULong_t>(fCurrentReader->GetBlockCnt());
760 ULong_t eventID = static_cast<ULong64_t>(fCurrentReader->GetEventID());
763 // -- Check if blocks present
765 HLTWarning(Form("Event 0x%016lX (%lu) with no blocks", eventID, eventID));
769 HLTInfo(Form("Event 0x%016lX (%lu) with %lu blocks", eventID, eventID, fNBlks));
771 if ( IsSyncBlocks() ) {
772 //AddBlockListToBuffer();
776 AddToAsyncBlockList();
782 //__________________________________________________________________________________
783 Bool_t AliHLTHOMERManager::IsSyncBlocks() {
784 // see header file for class documentation
786 Bool_t bResult = kFALSE;
792 if ( !GetBlkType().CompareTo("ALIESDV0")) {
797 if ( !GetBlkType().CompareTo("GLOBTRIG")) {
802 if ( !GetBlkType().CompareTo("ROOTTOBJ") ) {
803 AliHLTHOMERBlockDesc blockDesc;
805 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
806 GetBlkType(), GetBlkSpecification() );
807 if ( !blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
814 } while( GetNextBlk() );
820 //##################################################################################
821 void* AliHLTHOMERManager::GetBlk( Int_t ndx ) {
822 // see header file for class documentation
823 // Get pointer to current block in current event
825 if ( !fCurrentReader || !IsConnected() ) {
826 HLTError(Form("Not connected yet."));
829 if ( ndx < static_cast<Int_t>(fNBlks) )
830 return const_cast<void*> (fCurrentReader->GetBlockData(ndx));
835 //##################################################################################
836 ULong_t AliHLTHOMERManager::GetBlkSize( Int_t ndx ) {
837 // see header file for class documentation
839 if ( !fCurrentReader || !IsConnected() ) {
840 HLTError(Form("Not connected yet."));
844 if ( ndx < static_cast<Int_t>(fNBlks) )
845 return static_cast<ULong_t> (fCurrentReader->GetBlockDataLength(ndx));
850 //##################################################################################
851 TString AliHLTHOMERManager::GetBlkOrigin( Int_t ndx ) {
852 // see header file for class documentation
856 // -- Check for Connection
857 if ( !fCurrentReader || ! IsConnected() ) {
858 HLTError(Form("Not connected yet."));
862 // -- Check block index
863 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
864 HLTError(Form("Block index %d out of range.", ndx ));
874 reverseOrigin.data = static_cast<UInt_t>(fCurrentReader->GetBlockDataOrigin(ndx));
876 // -- Reverse the order
877 for (Int_t ii = 3; ii >= 0; ii-- )
878 if ( reverseOrigin.array[ii] != ' ')
879 origin.Append( reverseOrigin.array[ii] );
881 origin.Remove( TString::kTrailing, ' ' );
886 //##################################################################################
887 TString AliHLTHOMERManager::GetBlkType( Int_t ndx ) {
888 // see header file for class documentation
892 // -- Check for Connection
893 if ( !fCurrentReader || ! IsConnected() ) {
894 HLTError(Form("Not connected yet."));
898 // -- Check block index
899 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
900 HLTError(Form("Block index %d out of range.", ndx ));
910 reverseType.data = static_cast<ULong64_t> (fCurrentReader->GetBlockDataType(ndx));
912 // -- Reverse the order
913 for (Int_t ii = 7; ii >= 0; ii-- )
914 if ( reverseType.array[ii] != ' ')
915 type.Append( reverseType.array[ii] );
917 type.Remove( TString::kTrailing, ' ' );
922 //##################################################################################
923 ULong_t AliHLTHOMERManager::GetBlkSpecification( Int_t ndx ) {
924 // see header file for class documentation
926 // -- Check for Connection
927 if ( !fCurrentReader || ! IsConnected() ) {
928 HLTError(Form("Not connected yet."));
932 // -- Check block index
933 if ( ndx >= static_cast<Int_t>(fNBlks) ) {
934 HLTError(Form("Block index %d out of range.", ndx ));
938 return static_cast<ULong_t>(fCurrentReader->GetBlockDataSpec(ndx));
941 //##################################################################################
942 Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
943 // see header file for class documentation
945 Bool_t requested = kFALSE;
947 AliHLTHOMERSourceDesc * source= NULL;
949 // -- Read all sources and check if they should be read out
950 TIter next( fSourceList );
951 while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
953 // -- Check if source is selected
954 if ( ! source->IsSelected() )
957 // -- Check if detector matches
958 if ( source->GetSourceName().CompareTo( block->GetBlockName() ) )
964 } // while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
968 HLTInfo(Form("Block requested : %s", block->GetBlockName().Data()));
971 HLTInfo(Form("Block NOT requested : %s", block->GetBlockName().Data()));
978 /* ---------------------------------------------------------------------------------
979 * Trigger Handling - private
980 * ---------------------------------------------------------------------------------
983 //##################################################################################
984 Bool_t AliHLTHOMERManager::CheckTriggerDecision() {
985 // see header file for class documentation
987 Bool_t triggered = kFALSE;
989 if ( !fCurrentReader || !IsConnected() ) {
990 HLTError(Form("Not connected yet."));
994 AliHLTHOMERBlockDesc blockDesc;
998 // -- Fill block list
999 Bool_t foundTriggerBlock = kFALSE;
1002 if ( (GetBlkType().CompareTo("ROOTTOBJ") == 0) ) {
1003 blockDesc.SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
1004 GetBlkType(), GetBlkSpecification() );
1006 if ( ! blockDesc.GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
1008 foundTriggerBlock = kTRUE;
1013 } while( GetNextBlk() );
1015 if ( !foundTriggerBlock ) {
1016 HLTError(Form("No trigger decision object found"));
1020 // -- Get the global decision object
1021 AliHLTGlobalTriggerDecision* globalDecision =
1022 static_cast<AliHLTGlobalTriggerDecision*>(blockDesc.GetTObject());
1024 if ( fTriggerString.CompareTo("HLTGlobalTrigger") == 0 ) {
1025 triggered = globalDecision->EventTriggered();
1029 for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1031 const AliHLTTriggerDecision* triggerDecision =
1032 reinterpret_cast<const AliHLTTriggerDecision*>(globalDecision->InputObject(idx));
1034 if ( !(fTriggerString.CompareTo(triggerDecision->Description())) ) {
1035 triggered = triggerDecision->EventTriggered();
1038 } // for (Int_t idx = 0; idx < globalDecision->NumberOfInputObjects(); idx++) {
1044 fRetryNextEvent = kFALSE;
1045 fNEventsNotTriggered = 0;
1048 fRetryNextEvent = kTRUE;
1049 ++fNEventsNotTriggered;