9 #include <analysis/modules/SkimFilter/SkimFilterModule.h>
10 #include <analysis/dataobjects/ParticleList.h>
11 #include <framework/core/Environment.h>
12 #include <framework/datastore/StoreObjPtr.h>
13 #include <boost/algorithm/string/split.hpp>
14 #include <boost/algorithm/string/replace.hpp>
15 #include <boost/algorithm/string/classification.hpp>
20 using namespace boost::algorithm;
28 setDescription(
"Filter based on ParticleLists, by setting return value to true if at least one of the given lists is not empty.");
29 setPropertyFlags(c_ParallelProcessingCertified);
31 addParam(
"particleLists", m_strParticleLists,
"List of ParticleLists", vector<string>());
37 void SkimFilterModule::initialize()
40 int nParticleLists = m_strParticleLists.size();
41 B2INFO(
"Number of ParticleLists studied " << nParticleLists <<
" ");
46 void SkimFilterModule::event()
52 int nParticleLists = m_strParticleLists.size();
54 for (
int iList = 0; iList < nParticleLists; ++iList) {
58 B2INFO(
"ParticleList " << m_strParticleLists[iList] <<
" not found");
61 if (particlelist->getListSize() == 0)
continue;
73 void SkimFilterModule::terminate()
75 B2INFO(
"SkimFilter Summary: \n");
76 std::ostringstream stream;
77 stream <<
"\n=======================================================\n";
78 stream <<
"Total Retention: " << Form(
"%6.4f\n", (
float)m_nPass / (
float)Environment::Instance().getNumberOfEvents());
79 stream <<
"\n=======================================================\n";
This module filters events based on presence of candidates in a list of ParticleLists.
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.