Hi ,
I’m trying to read an ASCII file and fill in a Tree some data and ojects; the single data doesn’t worry me at all , but with the object I’m getting trouble. Here is the part of the code who caused the segmentation violation during the run of the executable(compilation is ok)
#include “io_gcc.hh”
#include “Track.hh”
#include “HitsEvent.hh”
#include “OfflineTrigger.hh”
#include “TFILE.h”
#include “TH1.h”
#include “TFile.h”
#include “TTree.h”
#include “TBranch.h”
int main(int argc, char *argv[])
{
TFile *outputfile = new TFile(“prova.root”,“RECREATE”);
TTree *ttr = new TTree(“ttr”,“Physics”);
TBranch *bra = ttr->BranchOld(“neutrino”,“Neutrino”,&nu,4000,1);
//makes me problem
ttr->Branch(“num_hit”,&num_hit,“num_hit/i”);
//does work
…
…
…
and here is the output during the run
*** Break *** segmentation violation
Generating stack trace…
0x003061e8 in G__CallFunc::Exec(void*) + 0x6e from /usr/local/root/lib/libCint.so
0x00c33e2b in TClass::BuildRealData(void*) + 0x2f7 from /usr/local/root/lib/libCore.so
0x00803571 in TTree::BuildStreamerInfo(TClass*, void*) + 0x31 from /usr/local/root/lib/libTree.so
0x007e9577 in TBranchObject::TBranchObject[in-charge](char const*, char const*, void*, int, int, int) + 0xb7 from /usr/local/root/lib/libTree.so
0x00801fd1 in TTree::BranchOld(char const*, char const*, void*, int, int) + 0x8f from /usr/local/root/lib/libTree.so
0x08050708 in main + 0x3d0 from ./analisi
0x0838d770 in __libc_start_main + 0xf0 from /lib/tls/libc.so.6
0x080502a9 in __gxx_personality_v0 + 0x1b1 from ./analisi
Aborted