I’m posting this question here because the section, newbies hasn’t gotten a response in three days. I need to manipulate the raubold lynch method in TGenPhaseSpace. The very first thing that I did was just to copy the code and change the name of the class form TGenPhaseSpace to TMyGen. In https://root.cern.ch/root/Using.html you guys say that a new class need to have
ClassDef(ClassName,ClassVersionID) //The class title
in the .h file, and also
ClassImp(ClassName)
in the .cxx file.
Nevertheless, I get a message like this:
IncrementalExecutor::executeFunction: symbol '_ZN6TMyGen8GenerateEv' unresolved while linking function '_GLOBAL__sub_I_cling_module_4'!
You are probably missing the definition of TMyGen::Generate()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN6TMyGen8GetDecayEi' unresolved while linking function '_GLOBAL__sub_I_cling_module_4'!
You are probably missing the definition of TMyGen::GetDecay(int)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN6TMyGen8SetDecayER14TLorentzVectoriPKdPKc' unresolved while linking function '_GLOBAL__sub_I_cling_module_4'!
You are probably missing the definition of TMyGen::SetDecay(TLorentzVector&, int, double const*, char const*)
Maybe you need to load the corresponding shared library?
I must remark the fact that I have not manipulated the TGenPhaseSpace archives except in changing names.
I’ll post here the exact copies of TGenPhaseSpace* (TMyGen.C and TMyGen.h) that I manipulated, and the file I’m trying to compile using the changed TGenPhaseSpace*. TMyGen.C (6.5 KB) TMyGen.h (1.5 KB) Omega_2018_myclass.C (15.9 KB)
So if I understand correctly, you basically copied TGenPhaseSpace.h and TGenPhaseSpace.cxx into TMyGen.C and TMyGen.h, and then modified the implementation of some method in TMyGen.C?
If that is what you would like to do, you could also make TMyGen a subclass of TGenPhaseSpace and override the methods whose behaviour you want to change.
I have not modified the implementation of any method in TMyGen.C yet. I just wanted to check it would do the same as TGenPhaseSpace, before going into changing anything else. But yes, you are correct, so, now my question would be how can I make TMyGen a subclass of TGenPhaseSpace?