Hi Carlos,
The file mass.C should not have any include directive. Instead create a file name mass.h which contains the include directive you need.
Cheers,
Philippe.
///////////mass.h //////////////
#include "TLorentzVector.h"
/////////////////
///////////mass.C //////////////
double mass() {
TLorentzVector a(x,y,z,e);
return a.M();
}
/////////////////
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
On Behalf Of Carlos Munoz Camacho
Sent: Wednesday, April 27, 2005 10:08 AM
To: roottalk_at_cern.ch
Subject: [ROOT] TTree::Draw(myfunction.C+)
Hi,
I am trying to use TTree::Draw() to plot the function below. I have a ntuple (called tree) with variables x:y:z:e, and I try to plot the function mass.C (just for testing, it will of course more complicated later). I have problems at compilation (see below). Can you please give me a hint of what I'm doing wrong? This is root 4.03/04 on Linux.
Carlos
///////////mass.C //////////////
#include "TLorentzVector.h"
double mass() {
TLorentzVector a(x,y,z,e);
return a.M();
}
/////////////////
tree->Draw("mass.C+");
Info in <TUnixSystem::ACLiC>: creating shared library
/home/dvcs/bertin/PIO_AVRIL/./generatedSel_h.so
In file included from /work/dvcs/root/include/TVector3.h:16, from /work/dvcs/root/include/TLorentzVector.h:38, from /home/dvcs/bertin/PIO_AVRIL/sum.C:1, from /home/dvcs/bertin/PIO_AVRIL/generatedSel.h:133, from /home/dvcs/bertin/PIO_AVRIL/file5FfYpG.h:32, from /home/dvcs/bertin/PIO_AVRIL/file5FfYpG.cxx:16:
generatedSel::TVector2::operator=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:126: cannot declare member function `
generatedSel::TVector2::operator+=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:127: cannot declare member function `
generatedSel::TVector2::operator-=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:131: cannot declare member function `
generatedSel::TVector2::operator*=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:133: cannot declare member function `
generatedSel::TVector2::operator*=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:134: cannot declare member function `
generatedSel::TVector2::operator/=' within `generatedSel'
/work/dvcs/root/include/TVector2.h:138: `generatedSel::TVector2
etc etc.... Received on Wed Apr 27 2005 - 19:01:58 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:07 MET