Hi Rene,
I tried the method you told to Nico, but it failed.
I use Root v5-11-06
Processing get.C...
Warning in <TTreePlayer::DrawScript>: TTreeProxy does not work in
interpreted mode yet. The script will to compiled.
Info in <TTreePlayer::DrawScript>: Will process tree/chain using
generatedSel.h+
Info in <TUnixSystem::ACLiC>: creating shared library
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/./generatedSel_h.so
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/fileldrYq8.cxx:
In
member function `ROOT::TBranchProxy& ROOT::TBranchProxy::operator=(const
ROOT::TBranchProxy&)':
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/fileldrYq8.cxx:458:
non-static
const member `const TString ROOT::TBranchProxy::fBranchName', can't use
default assignment operator
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/fileldrYq8.cxx:458:
non-static
const member `const TString ROOT::TBranchProxy::fDataMember', can't use
default assignment operator
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/fileldrYq8.cxx:458:
non-static
const member `const Bool_t ROOT::TBranchProxy::fIsMember', can't use default
assignment operator
g++:
/direct/data01/ALICE/dinght/HVQMuon/QuenchCodes/results/0-5/beauty/run001/./fileldrYq8.o:
No such file or directory
Error in <ACLiC>: Compilation failed!
Error in <TSelector::GetSelector>: file generatedSel.h+ does not have a
valid class deriving from TSelector
Another question about the method of the Draw(), one can use , for example,
tree-> Draw("pp[1]","weightpp*(pp[2]>30.))
to draw pp[1] weighted as weighpp and within cut "pp[2] > 30."
in which pp[1] pp[2] and weightpp are stored in the tree.
But I want to draw other variables within a cut, for example "pp[1]+pp[2] >30" (also with the weight), like Nico's case, how could I do that ?
Best regards,
Hengtong
On Thu, 18 Jan 2007, Rene Brun wrote:
> Hi Nico,
>
> Create a small script, say sum.C with
> double sum() {return a+b;}
>
> and do:
> tree.Draw("sum.C")
>
> Rene Brun
>
>
>
> Nico De Simone wrote:
> > Dear Rooters,
> > Using TTree::Draw() I can access member variables and methods defined
> > in the class used to build the tree.
> >
> > How can I create new methods or new variables, in a new class, and use
> > it in the same Draw()? Eg: the original class gives me the ints a and
> > b and I want to create c=a+b and do tree-> Draw("c"). With MakeClass I
> > only get member variables of the original class but not the methods
> > and add them is not trivial. Is there a better way?
> >
> > Thanks for any help.
> > Nico
> >
>
-- ************************************************ * Hengtong Ding * * * * Address: Institute of Particle Physics, * * Central China Normal University * * Wuhan, 430079, P. R. China * * Tel: 0086 27 6786 7946 (lab) * * 0086 27 8715 0351 (dormitory) * * Fax: 0086 27 6786 3213 * * Email: dinght_at_iopp.ccnu.edu.cn * * dinghengtong_at_hotmail.com * ************************************************Received on Fri Jan 19 2007 - 07:25:36 CET
This archive was generated by hypermail 2.2.0 : Fri Jan 19 2007 - 17:50:01 CET