Dear ROOTers,
How much can I customize the skeleton class produced by TTree::MakeClass? Can i add other member fuctions to do all my analysis instead of using only Loop?
Thx
Matteo
Dear ROOTers,
How much can I customize the skeleton class produced by TTree::MakeClass? Can i add other member fuctions to do all my analysis instead of using only Loop?
Thx
Matteo
The best way to customize the output of MakeClass is to implement
a class deriving from the standard code generated by MakeClass.
You add your function(s) to the derived class.
This has the advantage that you can regenerate the code of
the base class if your Tree definition changes without affecting
the code in the derived class.
Rene
[quote=“brun”]The best way to customize the output of MakeClass is to implement
a class deriving from the standard code generated by MakeClass.
You add your function(s) to the derived class.
This has the advantage that you can regenerate the code of
the base class if your Tree definition changes without affecting
the code in the derived class.
Rene[/quote]
Ok. Thx.
But how should i load the derived class? I have to write the derived class in another file to use this advantage, so i think that in my ROOT session i have to “.L baseclass.c” and then “.L derivedclass.c”. Is it right?
Thx again
Matteo
No, In your derivedclass.h 9or .C) #include "baseclass.h"
where baseclass.h is teh file generated by MakeClass
Rene