Overhaul of physics event model
Currently, selections are made based on ParKalmanFilter::FittedTrack
and VertexFit::TrackMVAVertex
objects. In this MR, these are replaced by BasicParticle
and CompositeParticle
views. The views include pointers to Kalman/vertex fit results and the PV associated to the particle. BasicParticle
s also include pointers to particle ID information and information about the hits used to create the underlying tracks. CompositeParticle
s are composable and (in theory) can be constructed from arbitrary combinations of BasicParticle
s and other CompositeParticle
s.
Because of difficulties handling recursive function calls in HIP, the CompositeParticle
member functions only explicitly handle two levels of recursion, for example a composition that looks like:
CompositeParticle
CompositeParticle
BasicParticle
BasicParticle
BasicParticle
CompositeParticle
s with arbitrary substructure can still be constructed and used in selections, but some built-in member functions will not be able to traverse the decay tree automatically.
The new event model consists of the following views:
- SciFi views similar to those used in the VELO and UT event models (also introduced in !678 (closed))
-
Allen::Views::Physics::KalmanState
: a view for accessing kalman fit results -
Allen::Views::Physics::KalmanStates
: a view for accessing allKalmanState
s in an event -
Allen::Views::Physics::SecondaryVertex
: a view for accessing SV fit results -
Allen::Views::Physics::SecondaryVertices
: a view of accessing allSecondaryVertex
s in an event -
Allen::Views::Physics::Track
: Includes pointers to the velo, UT, and SciFi segments of a track, if they exist. This was introduced in order to avoid using virtual functions to access LHCbIDs, which was causing compilation errors with HIP and runtime failures with CUDA. -
Allen::Views::Physics::Particle
: Base particle struct. Has a data member for storing the number of substructures. If aParticle
has 1 substructure, it is always aBasicParticle
. If it has more than 1 substructure, it is always aCompositeParticle
-
Allen::Views::Physics::ParticleContainer
: A view for accessing all of theParticle
s in an event. -
Allen::Views::Physics::IMultiEventParticleContainer
: A view for accessing particles from multiple events. -
Allen::Views::Physics::BasicParticle
: A charged particle view. Includes pointers to the underlyingTrack
,KalmanState
, lepton ID results, and associated PV (minimum IP chi2) -
Allen::Views::Physics::BasicParticles
: A view for accessing allBasicParticle
s in an event -
Allen::Views::Physics::MultiEventBasicParticles
: A view for accessingBasicParticle
s from multiple events. The input particle container for 1-track lines. -
Allen::Views::Physics::CompositeParticle
: A composite particle view. Includes pointers to pointers to the constituent particles, aSecondaryVertex
, and the associated PV (minimum FD chi2) -
Allen::Views::Physics::CompositeParticles
: A view for accessing allCompositeParticle
s in an event -
Allen::Views::Physics::MultiEventCompositeParticles
: A view for accessingCompositeParticle
s from multiple events. The input particle container for 2-track lines.
A few new algorithms are introduced:
-
make_lepton_id
: Combines electron ID and muon ID results. See note below on lepton ID. -
make_long_track_particles
: CreatesBasicParticle
andBasicParticles
views from SciFi tracks, kalman fit results, and associated PVs -
particle_container_life_support
: Dummy algorithm that is used to trick the sequence into keeping particle containers alive until after the SelReports are created
There are some other changes in this MR to note:
-
BasicParticle::ip()
returns the IP with respect to the PV that minimizes IP chi2, not the PV that minimizes IP. This is because only the pointer to the associated PV is stored. The minimum IP could still be calculated within a selection if it's necessary. - Electron ID and muon ID results are now stored as
uint8_t
. The muon ID result is stored in the first bit and the electron ID result is stored in the second bit. The algorithmmake_lepton_id
combines them into a singleuint8_t
. This allowsBasicParticle
s to be constructed in a single algorithmmake_long_track_particles
regardless of whether or not electron ID was performed. This change does not affect selection rates. - The TwoKsLine has been almost completely rewritten. The event model changes make this line extremely slow without some optimization.
All selections have been updated to use the new event model, but not all unused Parameters
have been removed from the selection header files. The SelReport writer has been generalized to handle arbitrary CompositeParticle
s, as well as particle containers from multiple different reconstruction sequences. This will allow creating SelReports for a high-pT muon line running with no GEC, for example. In addition, the more flexible event model can produce SelReports for tracks missing a UT segment. This solves all remaining to-do items for #173 (closed), except for implementing SelReports for ECAL clusters.
For now, the old ParKalmanFilter::FittedTrack
and VertexFit::TrackMVAVertex
objects are still created so they can still be used in checkers and converters.
FYI @dcampora