Add truth counters to xAODParticleEvent's CompositeParticle
The CompositeParticle class holds multiple particles. It has useful methods like std::size_t nElectrons() const;
to count the number of a given particle species.
When running over truth derivations, these methods return 0, because all particles are xAOD::TruthParticle
s rather than xAOD::Electron
etc. To be able to use similar methods for a truth analysis, this MR adds methods of the form std::size_t nTruthElectrons() const;
. They count the number of xAOD::TruthParticle
s, whose pdgId matches the corresponding particle.
The additional methods are:
nTruthPhotons()
nTruthElectrons()
nTruthMuons()
nTruthTaus()
nOtherTruthPhotons()
nOtherTruthElectrons()
nOtherTruthMuons()
nOtherTruthTaus()
Note that no additional methods are needed for jets, because truth jets are xAOD::Jet
objects.
Edited by Konstantin Lehmann