Belle II Software  release-08-01-10
BestCandidateSelectionModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/core/Module.h>
12 
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 
16 #include <analysis/dataobjects/Particle.h>
17 #include <analysis/dataobjects/ParticleList.h>
18 #include <analysis/VariableManager/Manager.h>
19 #include <analysis/VariableManager/Utility.h>
20 
21 #include <string>
22 
23 namespace Belle2 {
28  class Particle;
29 
36  public:
37 
41  virtual ~BestCandidateSelectionModule() override;
43  virtual void initialize() override;
45  virtual void event() override;
46 
47  private:
48  std::string m_inputListName;
49  std::string m_variableName;
50  std::string m_outputVariableName;
53  int m_numBest;
54  std::string m_cutParameter;
55  std::unique_ptr<Variable::Cut> m_cut;
62  };
63 
65 } // Belle2 namespace
Ranks particles by the values of a variable.
bool m_allowMultiRank
Give the same rank to candidates with the same value.
virtual void initialize() override
Initialize the module (set up datastore)
virtual void event() override
Process an event.
std::string m_variableName
Variable which defines the candidate ranking.
StoreArray< Particle > m_particles
StoreArray of Particle objects.
bool m_selectLowest
Select the candidate with the lowest value (instead of highest).
virtual ~BestCandidateSelectionModule() override
Destructor.
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
StoreObjPtr< ParticleList > m_inputList
input particle list
const Variable::Manager::Var * m_variable
Variable which defines the candidate ranking.
std::string m_cutParameter
Selection for candidates to be ranked.
int m_numBest
Number of best candidates to keep.
bool m_overwriteRank
If true, the extraInfo of rank is overwritten when the particle has already the extraInfo.
std::string m_outputVariableName
Name of generated Ranking-Variable, if specified by user.
std::string m_inputListName
name of input particle list.
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.
A variable returning a floating-point value for a given Particle.
Definition: Manager.h:146