Version `LHCb::Track` object
The following is copied from @graven in Rec!826 (comment 1705016).
I'd start by introducing the basic infrastructure to version LHCb::Track
, do that in master, and then rebase TDR on top of that master.
One way to do that is defining the current LHCb::Track
as:
namespace LHCb {
inline namespace v1 {
class Track { ... };
}
}
The inline
part will make sure that when code refers to LHCb::Track
it will actually refer to LHCb::v1::Track
. If done on the master branch, all current code will continue to compile and function 'as is' -- so this is probably the first thing to do.
Next, make sure that the track currently used in the TDR branch becomes
namespace LHCb {
namespace v2 {
class Track { ... };
}
}
and (still) in the TDR branch, start explicitly referring to LHCb::v2::Track
instead of plain LHCb::Track
-- i.e. the code in the TDR branch which uses the 'TDR version' of LHCb::Track
will have to be updated to use LHCb::v2::Track
instead. And once that is done in the TDR branch, with a bit of luck, it can be merged with a minimal amount of breakage... (i.e. only updates to the configuration, with the insertion of converters, and with renaming some TES locations)
Now, one could think of variations on this theme to make it more convenient eg. push things in yet another namespace, and alias LHCb::Track
either to LHCb::Event::v1::Track
or LHCb::Event::v2::Track
depending on whether the code in question is 'master' or 'TDR' (making the difference less visible, which can depending on your point of view be good or bad) -- this could be done by eg. providing two headers Event/v1/Track.h
and Event/v2/Track.h
, which contain the two different aliases, so that in the actual code one can still refer to LHCb::Track
, but depending on which header is included this is either defined as LHCb::v1::Track
or LHCb::v2::Track
, but maybe that is to implicit, so maybe explicitly using LHCb::v2::Track
while more verbose would avoid confusion...
ps. the introduction of an inline namespace
and the version namespaces should be done by GOD, for as long as we will use GOD... This may push things in a direction of having separate header files for each version, to have a one-to-one correspondence between xml and header files, but then the 'versioned' headers can easy be included in a single header, eg. Event/Track.h
could just contain:
#include "Event/v1/Track.h"
#include "Event/v2/Track.h"