Hi Yannick, The simplest solution to prototype quickly a user class deriving from a ROOT class is to use ACLIC, the automatic interface to the compiler and linker. In your case, do, eg root > .L p2d.cxx+ root > TProfile2DY p; root > etc //file p2d.cxx #include "TProfile2D.h" class TProfile2DY : public TProfile2D { public: TProfile2DY(); virtual ~TProfile2DY() {;} void Add(TProfile2DY *p); ClassDef(TProfile2DY,1) }; ClassImp(TProfile2DY) TProfile2DY::TProfile2DY() { } void TProfile2DY::Add(TProfile2DY *p) { } Rene Brun On Sat, 2 Jun 2001, Patois Yannick wrote: > Hi Rooters, > > Thanx to Rene for his latest answers :) > There is a few more question... > > I wanted to use TPRofile2D to represent the average of a value depending > on two differents parameters (until now, I fill 2 TH2F and Divide). > > But, this value has to be zeroed at some point (there is some noise > offset to correct from). It seems to me that TProfile2D::Add, with a > constant function is the way to go... But it was not implemented. > > Could it be implemented this way ?: > > (significativ extract -unchecked- for the loop, the rest is a mix of > TH1::Add(TH1*,Double_t) and TProfile::Add(TProfile*,Double_t)) > <<<< > cu = c1*f1->EvalPar(xx); > fArray[bin] += cu*fBinEntries.fArray[bin]; > >>>> > For me, errors doesnt have to change in such an operation, that would > only shift the mean. > > I tried to derivate a 'TProfile2DY' from TProfile2D with only this > method changed, but it seems that I also have to write a lot of things I > really dont know about, because at link I got: > > /home/patois/work/root/analyse_tree/TProfile2DY.cpp:24: undefined > reference to `TProfile2DY::TAttLine virtual table' > [snip a few other similar lines with AttFill and such] > > The above line is when I dont try to generate a dictionnary for the > class, if I do, and link with it: > > TProfile2DY.o: In function `TProfile2DY::Dictionary(void)': > /home/patois/work/root/analyse_tree/TProfile2DY.cpp:21: undefined > reference to `TProfile2DY::DeclFileLine(void)' > > And a lot more errors... Well the easiest for me would be that > TProfile2D::Add(TF1..) would be implemented in ROOT :) > > Yannick > > -- > _/ Yannick Patois _________________ Address (home) __________________ > | irc(undernet): Garp on #france25+ | La Villa des Sciences | > | email : patois@calvix.org | 12, avenue de Cambridge | > | http://garp.feelingsurfer.net/ | 14200 Herouville-Saint-Clair | > | Tel/Fax-home:+33 (0)2 31 94 50 32 | FRANCE | > | Petit Portail en Bois, Modeste et Génial : http://www.rezo.net/ | >
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:47 MET