Re: How to link with GEANT part of ROOT (2)

From: Rene Brun (brun@hpbrun.cern.ch)
Date: Mon Jul 06 1998 - 21:33:10 MEST


Witold,
OK, you have found that Root must be initialized by invoking
the Root constructor; This is OK.
Where is the crash happening? after file->Close ?

This information may be of interest for several collaborations
using Root and Geant.
In the LHC ALICE collaboration, we have developped recently
an interface between Geant3 and Root.
We have a class TGeant3 providing a complete interface in C++
to all Geant3 routines and data structures (including ZEBRA
and labelled common blocks).
The kinematics and the hits are stored in a Root Tree.
The kinematics is based on a new class GParticle replacing
the JVERTX/JKINE structures with the possibility to keep
the complete history parent/daughter.
The hits structure does not use at all the existing GEANT3 JHITS
but in GUSTEP one has the possibility to fill directly
hits detectors containers.
A nice and functional event display is provided with all
possible operations of zooming,unzooming, sliders, picking
and inspectors. The displqy provides 2D and 3D functions
with interfaces to X3D and OpenGL.
We are currently in the process of releasing this package
to the collaboration and the WEB pages are nearly ready.
I will post the URL as soon as it is available.

Rene Brun



On Mon, 6 Jul 1998, Witold Przygoda wrote:

> 
> 
> Hi all Rooters.
> 
> Excuse me to bother (all of you) once more.
> I have added before my root-c++ code a line
> TROOT root("Rint","The ROOT Interactive Interface");
> which seems to initialize ROOT.
> 
> File opens, a tree with branches/leaves creates,
> it even seems to fill (as I print it respectively in each event)
> but when I want to call Write() /of TFile variable/ it crashes.
> In particular of course it crashes if I finish GEANT with 'exit'
> and the message I get is:
> 
> TFile Writing Name=rich.root Title=Simulation data
> CustomReAlloc2: oldsize != size
> Fatal in <CustomReAlloc2>: unreasonable size (-1056)
> aborting
> forrtl: error (76): IOT trap signal
> Resources lost
> 
> 
> Any help is wanted!
> (please Reply to my e-mail, too)
> Witold P.
> 
> p.s. let me include my c++ code below:
> 
> --------------------------------------------------------------
> 
> #include "cfortran.h"
> #include <stdlib.h>
> #include "TROOT.h"
> #include "TRint.h"
> #include "TFile.h"
> #include "TTree.h"
> #include "TBranch.h"
> #include "TSystem.h"
> #include "TObject.h"
> 
> 
> 
> struct dataset0 {
> int idevt;
> int ncer;
> float xcer;
> float ycer;
> float ecer;
> float parentcer;
> };
> 
> 
> TROOT root("Rint","The ROOT Interactive Interface");
> static TFile *hfile;
> static TTree *tre;
> static TBranch *bre[1];
> static dataset0 mytup0;
> 
> 
> void booktree() {
> 
> hfile = new TFile("rich.root","RECREATE","Simulation data");
> tre = new TTree("TRich","RICH tree");
> bre[0]=tre->Branch("cerenkov",&mytup0.idevt,"idevt/I:ncer/I:xcer/F:ycer:ecer:parentcer");
> hfile->Print();
> }
> FCALLSCSUB0(booktree,BOOKTREE,booktree)
> 
> 
> void filltree(float sdata[18]) {
> 
> mytup0.idevt = (int)sdata[0];
> mytup0.ncer = (int)sdata[1];
> mytup0.xcer = sdata[2];
> mytup0.ycer = sdata[3];
> mytup0.ecer = sdata[4];
> mytup0.parentcer = sdata[5];
> tre->Fill();
> hfile->Print();
> }
> FCALLSCSUB1(filltree,FILLTREE,filltree,FLOATV)
> 
> 
> void closetree() {
> 
> hfile->Write();
> hfile->Close();
> }
> FCALLSCSUB0(closetree,CLOSETREE,closetree)
> 
> --------------------------------------------------------
> 
> 
> 
> Function booktree is called inside ubook (geant part)
> and closetree inside entry (last) of ubook called at the end.
> 
> Function filltree is called in udigi (geant part)
> with the float array parameter containing data to be stored.
> 
> - - - -
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:34 MET