List event tab embedded in left panel of ED + other minor changes.
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / alistoragegetpoints.cxx
CommitLineData
164d3d29 1#include "AliStorageEventManager.h"
2#include "AliStorageTypes.h"
3#include <iostream>
4#include <sstream>
5#include <ostream>
6#include <AliTrackPointArray.h>
7#include <TXMLEngine.h>
8
9using namespace std;
10
11TXMLEngine* xml = new TXMLEngine;
12
13stringstream& getXml(AliESDEvent *event)
14{
15 // Create main node of document tree
16 XMLNodePointer_t mainnode = xml->NewChild(0, 0, "main");
17
18 cout<<"tracks:"<<event->GetNumberOfTracks()<<endl;
19 XMLNodePointer_t tracks[event->GetNumberOfTracks()];
20
21 for(int i=0;i<event->GetNumberOfTracks();i++)
22 {
23 AliESDtrack *track = event->GetTrack(i);
24 tracks[i] = xml->NewChild(mainnode, 0, Form("track%d",i));
25 const AliTrackPointArray *array = track->GetTrackPointArray();
26 if(array)
27 {
28 const float *x = array->GetX();
29 const float *y = array->GetY();
30 const float *z = array->GetZ();
31 int n = array->GetNPoints();
32
33 for(int j=0;j<n;j++)
34 {
35 cout<<"3"<<endl;
36 xml->NewChild(tracks[i], 0,Form("point%d",j),Form("%f\t%f\t%f\n",x[j],y[j],z[j]));
37 }
38 }
39 else cout<<"no array"<<endl;
40 }
41
42 stringstream streamXml;
43 xml->SavePrimitive(streamXml);
44 delete xml;
45 return streamXml;
46}
47
48int main()
49{
50 AliStorageEventManager *manager = AliStorageEventManager::GetEventManagerInstance();
51 manager->CreateSocket(EVENTS_SERVER_SUB);
52 AliESDEvent *event;
53
54 while(1)
55 {
56 event = manager->GetEvent(EVENTS_SERVER_SUB);
57 cout<<"sending xml"<<endl;
58 manager->Send(getXml(event),XML_PUB);
59 cout<<"xml sent"<<endl;
60 }
61 return 0;
62}
63
64