yes, i do:
(//my 2-D array is really called "Tbextal" ..i just used the name of the
1-D array i had from my last question for example purposes)
root [5] TLeaf *l_phioffset = t->GetLeaf("Tbextal");
root [6] double *phioffset = (double*)l_phioffset->GetValuepointer();
..then i get:
Error: Can't call TLeaf::GetValuepointer() in current scope
FILE:/tmp/fileESpzPC_cint LINE:1
Possible candidates are...
filename line:size busy function type and name (in TLeaf)
filename line:size busy function type and name (in TNamed)
filename line:size busy function type and name (in TObject)
Error: Symbol l_phioffset is not defined in current scope
FILE:/tmp/fileESpzPC_cint LINE:1
Error: Failed to evaluate l_phioffset->GetValuepointer()Possible
candidates are...
filename line:size busy function type and name
*** Interpreter error recovered ***
CMS-Bristol
http://cern.ch/dan.holmes
On Fri, 29 Nov 2002, Rene Brun wrote:
> Hi Daniel,
>
> Did you really try my suggestion?
>
> TLeaf *l_phioffset = t->GetLeaf(("phioffset");
> double *phioffset = (double*)l_phioffset->GetValuepointer();
> for (int i=0;i<nentries;i++) {
> l_phioffset->GetBranch()->GetEntry(i);
> cout<<phioffset[o], etc
> }
>
>
> On Fri, 29 Nov 2002, Daniel Holmes wrote:
>
> > Hi Rene,
> >
> > hmm, no i don't think this was quite what i wanted (or i have not
> > sufficiently understood it.
> >
> > In short what i have is a 2-D array (converted from hbook->root) stored in
> > 1 leaf
> > ie for each phioffset[i] (i=1->100) there are 1000 entries.. i need to be
> > able to return any given entry for a given phioffset[i].
> >
> > ((if i do t->Draw("phioffset[3]"); then i get a 1-D histo with 1000
> > entries))
> >
> > the code :
> > TLeaf *l_phioffset = t->GetLeaf(("phioffset");
> > l_phioffset->GetBranch()->GetEntry(5); //to read entry 5
> > double phioffset = l_phioffset->GetValue();
> >
> > works fine for a 1-D array but in fact i need to be able to define an
> > index of phioffset before i loop over its entries.
> >
> > If this was what you sent in your last email then perhaps you could
> > clarify exactly how i should input the code as i don't seem to be able to
> > run it without errors,..
> >
> > many thanks for your ongoing support,
> >
> > Dan.
> >
> >
> >
> > CMS-Bristol
> > http://cern.ch/dan.holmes
> >
> > On Thu, 28 Nov 2002, Rene Brun wrote:
> >
> > > Hi Dan,
> > >
> > > You can do
> > > double phioffset3 = l_phioffset->GetValue(3);
> > > or
> > > double *phioffset = (double*)l_phioffset->GetValuepointer();
> > > and then access pihioffset[3];
> > >
> > > Rene Brun
> > >
> > > On Thu, 28 Nov 2002, Daniel Holmes wrote:
> > >
> > > > thanks Rene,
> > > >
> > > > How do i change the code below so i can read a 2-D, array.. i can plot :
> > > > t->Draw("phioffset[3]"); using the "phioffset" leaf.
> > > >
> > > > cheers,
> > > >
> > > > Dan.
> > > >
> > > >
> > > > > With your example, you can do
> > > > > TLeaf *l_phioffset = t->GetLeaf(("phioffset");
> > > > > l_phioffset->GetBranch()->GetEntry(5); //to read entry 5
> > > > > double phioffset = l_phioffset->GetValue();
> > > > >
> > > > > Rene Brun
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:21 MET