]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/OnlineDisplay/AliHLTPHOSOnlineDisplayTab.cxx
Changed files ti use the new standalone version of HOMER (AliHLTHOMER)
[u/mrichter/AliRoot.git] / HLT / PHOS / OnlineDisplay / AliHLTPHOSOnlineDisplayTab.cxx
CommitLineData
59b4cd9a 1#include "AliHLTPHOSOnlineDisplayTab.h"
6af3dade 2#include "AliHLTHOMERReader.h"
59b4cd9a 3#include <iostream>
4#include "AliHLTDataTypes.h"
5
6
7using namespace std;
8
9
b3abda11 10AliHLTPHOSOnlineDisplayTab::AliHLTPHOSOnlineDisplayTab():AliHLTPHOSBase(),
11 fgSyncronize(kFALSE)
59b4cd9a 12{
13
14}
15
16AliHLTPHOSOnlineDisplayTab::~AliHLTPHOSOnlineDisplayTab()
17{
18
19}
20
21
22void
6af3dade 23AliHLTPHOSOnlineDisplayTab::PrintBlockInfo(AliHLTHOMERReader *homeReaderPtr, int i)
59b4cd9a 24{
25 char tmp1[9], tmp2[5];
26 memset( tmp1, 0, 9 );
27 memset( tmp2, 0, 5);
28 void *tmp11 = tmp1;
29 ULong64_t* tmp12 = (ULong64_t*)tmp11;
30 *tmp12 =homeReaderPtr->GetBlockDataType( i );
31 void *tmp21 = tmp2;
32 ULong_t* tmp22 = (ULong_t*)tmp21;
33 *tmp22 = homeReaderPtr->GetBlockDataOrigin( i );
34 cout << "Dataype for block: "<< i<<" is: "<< tmp1<<tmp2 <<endl;
35}
36
37
38int
6af3dade 39AliHLTPHOSOnlineDisplayTab::GetEventInfo(AliHLTHOMERReader *homeReaderPtr, int i)
59b4cd9a 40{
41 int ret = 0;
42 ret =homeReaderPtr->ReadNextEvent();
43 if( ret )
44 {
45 int ndx = homeReaderPtr->GetErrorConnectionNdx();
46 printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
6af3dade 47 cout << "AliHLTHOMER getconncetioNdx status = " << ndx << endl;
59b4cd9a 48 return -1;
49 }
50 else
51 {
52 unsigned long blockCnt = homeReaderPtr->GetBlockCnt();
53 cout << "AliHLTPHOSOnlineDisplayEventTab::GetNextEvent: blockCnt =" << blockCnt <<endl;
54 return blockCnt;
55 }
56}
57
58
59int
60AliHLTPHOSOnlineDisplayTab::DoGetNextEvent()
61{
6af3dade 62 AliHLTHOMERReader* CurrentReaderPtr;
59b4cd9a 63 int ret = 0;
64 unsigned long ndx;
65 const AliHLTComponentBlockData* iter = NULL;
66 Bool_t nextSwitch=kTRUE;
67 int nLoops=0;
68
69 if(fgSyncronize == kTRUE)
70 {
71 nLoops = 1;
72 }
73 else
74 {
75 nLoops = fgNHosts;
76 }
77
78 for(int reader = 0; reader < nLoops; reader ++)
79 {
80 if(fgSyncronize == kTRUE)
81 {
82 CurrentReaderPtr =fgHomerReaderPtr;
83 }
84 else
85 {
86 CurrentReaderPtr =fgHomerReadersPtr[reader];
87 }
88
89 ret = GetEventInfo(CurrentReaderPtr, reader);
90
91 if( ret < 0)
92 {
93 return ret;
94 }
95 else
96 {
97 unsigned long blockCnt = ret;
98 for ( unsigned long i = 0; i < blockCnt; i++ )
99 {
100 PrintBlockInfo(CurrentReaderPtr, i);
101 }
102 ReadBlockData(CurrentReaderPtr);
103 }
104 }
105}