25 gSystem->Load(
"libTable");
50 for (i=0; i<100; i++) {
51 a.energy = sin(i*0.1);
63 for (i=0; i<20; i++) {
64 t.curvature = gRandom->Rndm();
71 const char *h = allHits->GetArray();
74 for (indx = 0;indx < len; indx++ ) {
75 if (gRandom->Rndm() < 0.2 )
76 t.hitList.Push_back(indx);
83 allTracks->
Print(0,5);
89 event->Add(allTracks);
94 TFile ff(
"generic.root",
"RECREATE");
98 printf(
" One event has been written out\n");
102 printf(
"\n ----- \n Now we will try to read it back\n");
106 TFile newFile(
"generic.root");
107 event = (
TDataSet *)newFile.Get(
"event");
110 rdTracks->
Print(0,5);
114 TH1F *ehist =
new TH1F(
"ehist",
"Energy deposit",30,-1,1);
115 track &firstTrack = *(
track *)rdTracks->GetTable();
118 for (;fHit != lHit; fHit++) {
119 hit &nextHit = *(
hit *)fHit.rowPtr();
122 ehist->Fill(nextHit.energy);
125 printf(
"\n ------------ >> finish !!! << ---------------- \n");
virtual Long_t GetNRows() const
Returns the number of the used rows for the wrapped table.
virtual Int_t AddAt(const void *c)
virtual Char_t * Print(Char_t *buf, Int_t n) const
Create IDL table defintion (to be used for XDF I/O)