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