I have a problem in running a root macro which was compiled.
Following macro compiles without no error, but it crashes with
the segmentation violation error when it is exected the line
Asymmetry->cd(); The gDirectory->ls(); command shows
adequate directory strucuture,
TFile* rootfile.root ROOT Histogram file
KEY: TDirectory Kinema;1 Kinema
KEY: TDirectory Bunch;1 Bunch
KEY: TDirectory ErrDet;1 ErrDet
KEY: TDirectory Asymmetry;1 Asymmetry
So I think file is open properly at least, but somehow crashes
when it tried to change directory.
This macro doesn’t crashes and runs fine if I execute without
compilation on root prompt.
Any suggestions/advices are appliciated.
Thanks,
#ifndef CINT
#include
#include
#include
#include
#include
#include
#include
#include
#include “TString.h”
#include “TMath.h”
#endif
#ifndef CINT
int main(int argc, char **argv)
#else
Int_t RootMacro()
#endif
{
// Root file open
TFile * rootfile = new TFile();
rootfile->Open(“rootfile.root”);
gDirectory->ls();
Asymmetry->cd();
return 0;
}