problems with modified Event example

Steffen A. Bass (bass@phy.duke.edu)
Wed, 17 Jun 1998 15:03:07 -0400 (EDT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--60313270-1084943501-898110187=:840
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello rooters,
I have modified the Event example from the root distribution for
my own purposes. It works fine as long as I only write a small number of
event objects with small array sizes. If I increase the number of events
and their size I get a segmentation violation.
My main program is given below, the class definitions and implementations
are in the attachments (beware, the stuff is not compilable since I
truncated the main program to the parts relevant for my problem).

I'd be grateful for any hints on what is going wrong.
Thanks a lot,
Steffen

--------------------------------------------------------------------------
Dr. Steffen A. Bass phone : [01] 919 660 2570
Duke University, Dept. of Physics fax : [01] 919 660 2464
Box 90305, Durham N.C. 27708-0305, USA e-mail: bass@phy.duke.edu
--------------------------------------------------------------------------

// globals and include files
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>

#include "TROOT.h"
#include "TFile.h"
#include "TBranch.h"
#include "TTree.h"
#include "TClonesArray.h"
#include "TMath.h"

#include "TOscarEvent.h" // here are the new event classes

//--------------------------------------------------------------------------
main()
{
TROOT simple("simple","tree for OSCAR events");

Int_t nevent = 0;
Int_t comp = 2; // by default file is compressed
Int_t split = 1; // by default, split Event in sub branches

TOscarEvent *event=0; // create event, header and particle objects
TOscarFileHeader *fheader;
TParticle *particle;

Int_t nb = 0;
Int_t bufsize;

// Create a new ROOT binary machine independent file.
// Note that this file may contain any kind of ROOT objects, histograms,
// pictures, graphics objects, detector geometries, tracks, events, etc..
// This file is now becoming the current directory.

TFile *hfile = new TFile("Event.root","RECREATE","TTree ROOT file");
hfile->SetCompressionLevel(comp);

// Create a ROOT Tree
TTree *tree = new TTree("T","ROOT tree");
tree->SetAutoSave(100000); // autosave when 1 Mbyte written
bufsize = 400000;
if (split) bufsize /= 4;

tree->Branch("fHeaderBranch","TOscarFileHeader", &fheader, bufsize,split);

fheader = new TOscarFileHeader();

// ... initialize fheader object

tree->Branch("EventBranch", "TOscarEvent", &event, bufsize,split);

while(... generating event data ...)
{

event = new TOscarEvent();

for (Int_t i = 0; i < part_mult ; i++)
{
particle = new TParticle();

... filling particle object ...

event->AddParticle(particle);

delete particle;
}

nb += tree->Fill(); //fill the branch - the segmentation violation
// happens here

delete event;

nevent++;
cout << "processing event # " << nevent << endl;

}

hfile->Write(); // write tree to file
// tree->Print();

Double_t mbytes = 0.000001*nb;

printf("\n%d events and %f Mbytes processed.\n",nevent,mbytes);
printf("file compression factor = %f\n",hfile->GetCompressionFactor());

hfile->Close();
return 0;
}

--60313270-1084943501-898110187=:840
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="TOscarEvent.cc"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.980617150307.840C@lakshmi.phy.duke.edu>
Content-Description:

I2luY2x1ZGUgIlRPc2NhckV2ZW50LmgiDQojaW5jbHVkZSAiVFJhbmRvbS5o
Ig0KDQpDbGFzc0ltcChUT3NjYXJGaWxlSGVhZGVyKQ0KQ2xhc3NJbXAoVE9z
Y2FyRXZlbnQpDQpDbGFzc0ltcChUUGFydGljbGUpDQoNClRDbG9uZXNBcnJh
eSAqZ1BhcnRpY2xlczsNCkludF90IGdQYXJ0Q291bnQ7DQpJbnRfdCBnQXJy
YXlTaXplPTUwMDAwOw0KDQovL19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18NCiBUT3NjYXJFdmVudDo6VE9zY2FyRXZlbnQoKQ0Kew0KLy8gICBD
cmVhdGUgb25lIEV2ZW50IG9iamVjdA0KLy8gICBXaGVuIHRoZSBjb25zdHJ1
Y3RvciBpcyBpbnZva2VkIGZvciB0aGUgZmlyc3QgdGltZSwgdGhlIGdsb2Jh
bA0KLy8gICB2YXJpYWJsZSBnUGFydGljbGVzIGlzIE5VTEwuIFRoZSBUQ2xv
bmVzQXJyY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gPSAgcGFydC0+ZlJ6Ow0KICBmTnVt
ICA9ICBwYXJ0LT5mTnVtOw0KICBmSWQgICA9ICBwYXJ0LT5mSWQ7DQogIC8v
DQogIGZQdCAgID0gIHBhcnQtPmZQdDsNCiAgZlkgICAgPSAgcGFydC0+Zlk7
DQogIGZQaGkgID0gIHBhcnQtPmZQaGk7DQogIGZUaGV0YT0gIHBhcnQtPmZU
aGV0YTsNCiAgZlBhYnMgPSAgcGFydC0+ZlBhYnM7DQp9DQoNCg0K
--60313270-1084943501-898110187=:840
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="TOscarEvent.h"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.980617150307.840D@lakshmi.phy.duke.edu>
Content-Description:

I2luY2x1ZGUgIlRPYmplY3QuaCINCiNpbmNsdWRlICJUQ2xvbmVzQXJyYXku
aCINCiNpbmNsdWRlICJUTWF0aC5oIg0KI2luY2x1ZGUgPGlvc3RyZWFtLmg+
DQoNCg0KY2xhc3MgVFBhcnRpY2xlOiBwdWJsaWMgVE9iamVjdCB7DQovLyBT
dGVmZmVuIEEuIEJhc3MNCi8vIHNpbXBsZSBwYXJ0aWNsZSBjbGFzcywgY29u
dGFpbnMgb25lIFRDbG9uZXNBcnJheSwgb3RoZXJ3aXNlIG9ubHkNCi8vIGJh
c2ljIHR5cGVzIGluIG9yZGVyIG5vdCB0byBoYXZlIGFueSBwcm9ibGVtcyBp
biBST09UDQoNCnByaXZhdGU6DQogICAgICAgIERvdWJsZV90ICAgICAgZlAw
OyAgICAgICAgICAgLy8gZW5lcmd5IA0KICAgICAgICBEb3VibGVfdCAgICAg
IGZQeDsgICAgICAgICAgIC8vIFggY29tcG9uZW50IG9mIHRoZSBtb21lbnR1
bQ0KICAgICAgICBEb3VibGVfdCAgICAgIGZQeTsgICAgICAgICAgIC8vIFkg
Y29tcG9uZW50IG9mIHRoZSBtb21lbnR1bQ0KICAgICAgICBEb3VibGVfdCAg
ICAgIGZQejsgICAgICAgICAgIC8vIFogY29tcG9uZW50IG9mIHRoZSBtb21l
bnR1bQ0KICAgICAgICBEb3VibGVfdCAgICAgIGZNYXNzOyAgICAgICAgIC8v
IG1hc3Mgb2YgcGFydGljbGUNCiAgICAgICAgRG91YmxlX3QgICAgICBmUjA7
ICAgICAgICAgICAvLyByXzAgb2YgcGFydGljbGUNCiAgICAgICAgRG91Ymxl
X3QgICAgICBmUng7ICAgICAgICAgICAvLyBYIGxvY2F0aW9uIA0KICAgICAg
ICBEb3VibGVfdCAgICAgIGZSeTsgICAgICAgICAgIC8vIFkgDQogICAgICAg
IERvdWJsZV90ICAgICAgZlJ6OyAgICAgICAgICAgLy8gWg0KICAgICAgICBJ
bnRfdCAgICAgICAgIGZOdW07ICAgICAgICAgIC8vIHBhcnRpY2xlIG51bWJl
cg0KICAgICAgICBJbnRfdCAgICAgICAgIGZJZDsgICAgICAgICAgIC8vIHBh
cnRpY2xlIElEDQoJLy8gbWVtYmVycyB0byBiZSBjYWxjdWxhdGVkDQoJRG91
YmxlX3QgICAgICBmUHQ7ICAgICAgICAgICAvLyB0cmFuc3ZlcnNlIG1vbWVu
dHVtDQoJRG91YmxlX3QgICAgICBmWTsgICAgICAgICAgICAvLyByYXBpZGl0
eQ0KCURvdWJsZV90ICAgICAgZlBoaTsgICAgICAgICAgLy8gYXppbXV0aGFs
IGFuZ2xlDQoJRG91YmxlX3QgICAgICBmVGhldGE7ICAgICAgICAvLyBwb2xh
ciBhbmdsZQ0KCURvdWJsZV90ICAgICAgZlBhYnM7ICAgICAgICAgLy8gdG90
YWwgbW9tZW50dW0NCg0KcHVibGljOg0KICAgICAgICBUUGFydGljbGUoKSB7
O30NCiAgICAgICAgVFBhcnRpY2xlKFRQYXJ0aWNsZSAqcGFydCk7DQogICAg
ICAgIH5UUGFydGljbGUoKSB7O30NCg0KICAgICAgICBEb3VibGVfdCAgICAg
ICBHZXRQeCgpICAgIHtyZXR1cm4gZlB4O30NCiAgICAgICAgRG91YmxlX3Qg
ICAgICAgR2V0UHkoKSAgICB7cmV0dXJuIGZQeTt9DQogICAgICAgIERvdWJs
ZV90ICAgICAgIEdldFB6KCkgICAge3JldHVybiBmUHo7fQ0KICAgICAgICBE
b3VibGVfdCAgICAgICBHZXRQMCgpICAgIHtyZXR1cm4gZlAwO30NCiAgICAg
ICAgRG91YmxlX3QgICAgICAgR2V0UjAoKSAgICB7cmV0dXJuIGZSMDt9DQog
ICAgICAgIERvdWJsZV90ICAgICAgIEdldFJ4KCkgICAge3JldHVybiBmUng7
fQ0KICAgICAgICBEb3VibGVfdCAgICAgICBHZXRSeSgpICAgIHtyZXR1cm4g
ZlJ5O30NCiAgICAgICAgRG91YmxlX3QgICAgICAgR2V0UnooKSAgICB7cmV0
dXJuIGZSejt9DQogICAgICAgIERvdWJsZV90ICAgICAgIEdldE1hc3MoKSAg
e3JldHVybiBmTWFzczt9DQogICAgICAgIEludF90ICAgICAgICAgIEdldE51
bSgpICAge3JldHVybiBmTnVtO30NCiAgICAgICAgSW50X3QgICAgICAgICAg
R2V0SWQoKSAgICB7cmV0dXJuIGZJZDt9DQoJRG91YmxlX3QgICAgICAgR2V0
UHQoKSAgICB7cmV0dXJuIGZQdDt9DQoJRG91YmxlX3QgICAgICAgR2V0WSgp
ICAgICB7cmV0dXJuIGZZO30NCglEb3VibGVfdCAgICAgICBHZXRQaGkoKSAg
IHtyZXR1cm4gZlBoaTt9DQoJRG91YmxlX3QgICAgICAgR2V0VGhldGEoKSB7
cmV0dXJuIGZUaGV0YTt9DQoJRG91YmxlX3QgICAgICAgR2V0UGFicygpICB7
cmV0dXJuIGZQYWJzO30NCg0KICAgICAgICB2b2lkIFNldE1vbWVudGEoRG91
YmxlX3QgcHgsIERvdWJsZV90IHB5LCBEb3VibGVfdCBweikNCiAgICAgICAg
ICB7DQogICAgICAgICAgICBmUHg9cHg7IA0KICAgICAgICAgICAgZlB5PXB5
OyANCiAgICAgICAgICAgIGZQej1wejsNCiAgICAgICAgICB9DQoNCiAgICAg
IC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9FdmVudCBzdHJ1Y3R1cmUN
Cn07DQoNCg0KDQo=
--60313270-1084943501-898110187=:840--