[ROOT] class used in a branch

From: GENTIT Francois-Xavier DAPNIA (GENTIT@DAPNIA.CEA.FR)
Date: Wed Aug 09 2000 - 09:08:47 MEST


   Dear Rooters,
   If I define the following file "MyClass.C" :

class TMyClass : public TNamed {
public:
  Int_t    fRun;       //run number
  TRunResults() { ; }
  TRunResults(Text_t *,Text_t *);
};
TMyClass::TMyClass(Text_t *name,Text_t *title):TNamed(name,title)
{
  fRun = 0;
}


   and the following file "testa.C" :

{
  TTree *tree = new TTree("T","Tree for GLAST");
  TMyClass *p;
  p = new TMyClass("runstat","runstat");
  tree->Branch("RunBranch","TMyClass",&p,64000,1);
}

   and if I do :

root[0]> .L MyClass.C
root[1]> .x testa.C

I get the error message, after the line tree->Branch(...)  :

Error in <TTree::BranchObject>: Cannot find class:TMyClass

Is it so that one cannot use class defined in CINT, but only compiled class
in a branch ?
I am using ROOT 2.25 on Windows NT. Thanks very much for your help.

          F.X. Gentit
          DAPNIA/SPP CEN Saclay
          tel : 01 69 08 30 38     fax : 01 69 08 64 28
          web : http://home.cern.ch/~gentit/
 <<MyClass.C>>  <<testa.C>> 






This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET