Hi Ricardo,
You need to declare your object to CINT.
for example you can do
TString declare = Form("inclDstarDstar t* = %p;",&p);
gROOT->ProcessLine( declare );
Cheers,
Philippe
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Riccardo de Sangro
Sent: Friday, October 18, 2002 10:39 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] running precompiled code
Hello,
I have made the following program to be able to pre-compile my analysis
code and run under root:
// Original Author: Rene Brun (bench.cxx)
//
// This little file is a wrapper for a .cc file containing
// a ROOT job.
////////////////////////////////////////////////////////////////////
#include "TROOT.h"
#include "TTree.h"
#include "TRint.h"
#include "inclDstarDstar.hh"
#include "inclDstarDstar.cc"
int main(int argc, char** argv)
{
TRint *theApp = new TRint("Rint", &argc, argv, 0, 0);
TTree::SetBranchStyle(1); // use the new Branch style
inclDstarDstar t(0,1,"signal.list");
t.BookHistos();
t.Loop(100000);
// t.DrawHistos("eps");
// the following line will give back the root prompt to the user,
// but he/she won't have -AFAIK- available "t" for t->Draw("eps").
theApp->Run();
return 0;
}
My analysis code is in inclDstarDstar.cc/.hh.
Everything runs fine (and indeed a good factor faster than the usual
interpreted version), and at the end of the job
I am left with a root prompt, I believe inside the Run() loop of the
TRint application.
The question is: how (if ever) can I access my "t" object? I have not
been able to figure out.
thanks for any help
Riccardo
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:15 MET