Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Make JetFilterPlugin ignore "additional" jets
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-popov committed Mar 6, 2014
1 parent 85dd713 commit b0987f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion extensions/include/JetFilterPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* \brief Filters events based on the number of jets that pass a generic selection
*
* The plugin selects an event if it contains a desired number of jets that pass a selection. The
* selection is specified with the help of std::function and, therefore, can be very general.
* selection is specified with the help of std::function and, therefore, can be very general. It
* checks only jets in the PECReader::GetJets collection.
*/
class JetFilterPlugin: public Plugin
{
Expand Down
8 changes: 3 additions & 5 deletions extensions/src/JetFilterPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@ void JetFilterPlugin::BeginRun(Dataset const &)
bool JetFilterPlugin::ProcessEvent()
{
auto const &jets = (*reader)->GetJets();
auto const &softJets = (*reader)->GetAdditionalJets();


// Count the number of jets that pass the selection
unsigned nPassed = 0;

for (auto const &jetCollection: {jets, softJets})
for (Jet const &j: jetCollection)
if (selection(j))
++nPassed;
for (Jet const &j: jets)
if (selection(j))
++nPassed;


return (nPassed >= minNumJets and nPassed <= maxNumJets);
Expand Down

0 comments on commit b0987f2

Please sign in to comment.