-
Notifications
You must be signed in to change notification settings - Fork 10
Reco Particle ‐ Lower object architecture sketch
This is a design sketch of how to implement a SRRecoParticle-to- mapping, as described in #23. It consists of 4 major components.
Just as in branch feature/reco_linkage, every low-level reco object (SRTrack, SRShower, SRECalCluster, ...) needs to become a subclass of a SRRecoObjBase. The commit 4d74e0c from that branch makes this an empty class.
However, we can also add another "back-reference" field to it so that the low-level object can point back to the SRRecoParticle. This would entail:
- Introducing a class
RecoParticleIDintoSREnums.h, in analogy toTrueParticleID, containing fields:- the
SRInteractionindex - An enum corresponding to top-level
SRRecoParticlecollections (Pandora, DLP/SPINE, SAND reco) - the
SRRecoParticleindex
- the
- Adding a field to the
SRRecoObjBasethat consists of aRecoParticleIDinstance
This class will be very like the SRRecoParticleID from the previous bullet, except its job is to identify which collection of underlying reco objects the target object lives in.
There are lots of possibilities, which will make it rather tedious to enumerate them all, but after a lot of reflection (see discussion at #23 I don't think there's another way to do it.
The enum will have entries like
...
kFDPandoraTrack,
KFDPandoraShower,
...
kNDLArDLPTrack,
kNDLArDLPShower,
kNDLArPandoraTrack,
kNDLARPandoraShower,
...
kTMSTrack,
...
kSANDTrack,
kSANDShower,
kSANDECalCluster,
...
- Obviously a new field containing a
SRRecoBaseIDwill need to be added toSRRecoParticle. - At the same time, the current field
origRecoObjType(and its corresponding enumRecoObjType) will need to be extended to have an entry for all possible reco object types enumerated in the previous bullet.
These new classes will be a pain for users to actually use, so it's best to build some functions to traverse the hierarchy for them. There are examples of this sort of thing already for truth-matching: https://github.com/DUNE/duneanaobj/blob/main/duneanaobj/StandardRecord/Navigate.h#L18-L25
We'll need
- a
const SRRecoParticle * FindRecoParticle(const StandardRecord & sr, const RecoParticleID& partid)(which is intended to be used with the new field added toSRRecoObjBasein the first bullet) - a
const SRRecoObjBase * FindRecoObjBase(const StandardRecord & sr, const SRRecoBaseID& baseid)(which is intended to be used with the new field added toSRRecoParticlein the second bullet)
Users of the second signature will then need to dynamic_cast<> the resulting pointer to the actual type they expect (SRTrack, etc.). The origRecoObjType field should help them decide whether they want to do that.