9 #include <analysis/modules/RemoveParticlesNotInLists/RemoveParticlesNotInLists.h>
10 #include <analysis/dataobjects/ParticleList.h>
12 #include <framework/logging/Logger.h>
13 #include <framework/datastore/StoreObjPtr.h>
23 setDescription(
"Removes all Particles that are not in one of the given ParticleLists (or daughters of Particles in the lists). All relations from/to Particles, daughter indices, and other ParticleLists are fixed. Note that this does not currently touch any data used to create final state particles, which might make up a large fraction of the total file size.");
24 setPropertyFlags(c_ParallelProcessingCertified);
26 addParam(
"particleLists", m_particleLists,
"Keep the Particles and their daughters in these ParticleLists.");
29 void RemoveParticlesNotInListsModule::initialize()
31 m_particles.isRequired();
32 m_subset.registerSubset(m_particles);
34 for (
const auto& l : m_particleLists) {
39 void RemoveParticlesNotInListsModule::event()
41 const int nBefore = m_particles.getEntries();
43 m_subset.removeParticlesNotInLists(m_particleLists);
45 const int nAfter = m_particles.getEntries();
48 m_nRemoved += nBefore - nAfter;
51 void RemoveParticlesNotInListsModule::terminate()
53 double perc = double(m_nRemoved) / m_nTotal * 100.0;
54 B2INFO(getName() <<
": removed " << m_nRemoved <<
" Particles (" << perc <<
" % of total amount).");
Removes all Particles that are not in a given list of ParticleLists (or daughters of those).
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Type-safe access to single objects in the data store.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.