Adapter from Genfit to Pnd objects checked in [message #8796] |
Thu, 04 June 2009 19:58 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Hi,
I checked in the promised code (r5722). There are still two issues to be solved. The first is that I put the files PndAdapters.{cxx,h} which contain the two functions in trackrep. They should not stay there. But it was the only place where the dependencies allowed me to put them. Could a framework expert, please make a suggestion on where to put this.
The other issue is more complicated: In PndTrack I save for the first and last point a FairTrackPar*. I have to use the pointer to be able to also put FairTrackParP (polymorphism). But this means that I can not write a proper copy ctor, because calling FairTrackPar(const FairTrackPar&) is not sufficient, because this will not copy the data in FairTrackParP. There is no solution to this problem unless FairTrackPar becomes purely virtual, and we have a method
virtual FairTrackPar FairTrackPar::clone()=0;
which calls the copy ctor in the derived classes, like
FairTrackPar* FairTrackParP::clone(){return FairTrackParP(*this);}
I have the same problem with the Print method: If we use FairTrackPar* in the PndTrack, a call to FairTrackPar::Print() inside PndTrack::Print() will never reach the implementation in FairTrackParP::Print() like it has to. For this we absolutely need a purely FairTrackPar.
Here is what I propose:
- We make FairTrackPar purely virtual
- We make another derived class like the P/H classes to replace the simple behaviour, which is now in FairTrackPar.
I'm looking forward to your comments.
Oh, and BTW, this 5722 commit contained a lot of changes, I coded since the meeting. So I hopw I didnt skrew up. Please test if all your fitting code still works. I will be out for a long weekend (starting tomorrow noon).
CU, Christian
|
|
|
|
|
Re: Adapter from Genfit to Pnd objects checked in [message #8843 is a reply to message #8796] |
Thu, 11 June 2009 09:57 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Hi everybody,
I was wondering why there are no answers to my message from 1 week ago about the problem with PndTrack and FairTrackParX. These are important issues, and they can not be left to me alone to deal with. I neither have the responsibility nor the experience to decide these things on my own.
The track parameters are a very central part of the framework. If you would like to keep them as they are now, please tell me how to implement them in PndTrack.
I still suggest to change the way they are implemented, but as I said: My opinion on this can not be the only one. And there is a lot of code which already depends on these classes, so any changes are a lot of work for a lot of people.
Cheers, Christian
|
|
|
|
Re: Adapter from Genfit to Pnd objects checked in [message #8845 is a reply to message #8844] |
Thu, 11 June 2009 11:27 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Hi Ralf,
I want create a PndTrack from a Genfit Track. Do you suggest that I book TClonesArrays in the framework in the process of doing that? It would be better, if the PndTrack directly contains the track parameters.
Ans what is the problem about storing pointers? ROOT understands that.
Cheers, Christian
|
|
|
Re: Adapter from Genfit to Pnd objects checked in [message #8846 is a reply to message #8796] |
Thu, 11 June 2009 11:54 |
Ralf Kliemt
Messages: 507 Registered: May 2007 Location: GSI, Darmstadt
|
first-grade participant |
From: *to.infn.it
|
|
Hello again,
Surely you will have to register at least the TClonesArray which stores the PndTrack objects (I tell it just to avoid confusion). What I meant is to store the track parameter objects as well in TCAs and reference them by storing an index in the PndTrack.
Anyway you're right that the PndTrack should carry these objects by itself.
Can root carry these pointers even into a root file and recover it later on? I thought that not. If yes, there is no big point in discussing further - do it as you like.
Greetings, Ralf.
[Updated on: Thu, 11 June 2009 11:57] Report message to a moderator
|
|
|
Re: Adapter from Genfit to Pnd objects checked in [message #8848 is a reply to message #8846] |
Thu, 11 June 2009 13:46 |
StefanoSpataro
Messages: 2736 Registered: June 2005 Location: Torino
|
first-grade participant |
From: *to.infn.it
|
|
I think that for ROOT the problem is when the memory address of the pointer is not available anymore (i.e. it is pointing to an object which is stored in a friend file which is not loaded). In such a case, when analysing the first event of the tree, even if you are not using the initial information which has this kind of problem, root does and could crash. Storing indexes is much safer, an integer is always an integer and even if you click on it you will never crash.
But I don't know if this was solved in recent root versions.
[Updated on: Thu, 11 June 2009 13:48] Report message to a moderator
|
|
|
|
Re: Adapter from Genfit to Pnd objects checked in [message #8852 is a reply to message #8851] |
Thu, 11 June 2009 20:17 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Hi,
I agree with what Sebastian said. But let me try to bring your focus back to the open problems.
If I do not use pointers, I have to make a definite choice whether to use FairTrackPar, FairTrackParP, or FairTrackParH in PndTrack. This seems unfavorable. If I use points, there remains the problem that FairTrackParam (the base class) is not a abstract interface class, which brings problems, like the impossibility of coying PndTrack (please see the first message of this thread).
Mohammad, what is your opinion on this issue?
Cheers, Christian
|
|
|