Belle II Software development
VXDTrackCandidatesQualityIndicatorCutterModule.cc
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#include "tracking/modules/trackSetEvaluatorVXD/VXDTrackCandidatesQualityIndicatorCutterModule.h"
10#include <vector>
11
12using namespace Belle2;
13
14
15REG_MODULE(VXDTrackCandidatesQualityIndicatorCutter);
16
18{
19 setDescription("Module that selects a subset out of all SpacePointTrackCandidates. Based on qualityIndicator requirement.");
20
21 addParam("NameSpacePointTrackCands", m_nameSpacePointTrackCands, "Name of expected StoreArray.", std::string(""));
22 addParam("minRequiredQuality", m_minRequiredQuality, "Minimum value of qualityIndicator to keep candidate active.", float(0));
23 addParam("SubsetCreation", m_subsetCreation,
24 "If True copy selected SpacePoints to new StoreArray, if False deactivate remaining SpacePoints.", bool(false));
25 addParam("NewNameSpacePointTrackCands", m_newNameSpacePointTrackCands,
26 "Only required if 'CreateNewStoreArray' is true. Name of StoreArray to store the subset. If the target name is equal to the source candidates not matching the selection criteria are deleted.",
27 std::string("BestSpacePointTrackCands"));
28}
29
31{
33 if (m_subsetCreation) {
36 } else {
38 m_goodCandidates.inheritAllRelations();
39 }
40 }
41}
42
44{
47}
48
50{
52 if (sptc.getQualityIndicator() < m_minRequiredQuality) {
53 sptc.removeRefereeStatus(SpacePointTrackCand::c_isActive);
54 // Note: assignment state of individual hits does not have to be changed here (assignment not set until SPTC2RTConverterModule)
55 }
56 }
57}
58
60{
61 m_goodCandidates.select([this](const SpacePointTrackCand * sptc) {return sptc->getQualityIndicator() >= this->m_minRequiredQuality;});
62}
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
Storage for (VXD) SpacePoint-based track candidates.
double getQualityIndicator() const
returns the current status of the estimated quality of this track candidate.
@ c_isActive
bit 11: SPTC is active (i.e.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
std::string m_newNameSpacePointTrackCands
Name of optional output StoreArray containing SpacePointTrackCands.
SelectSubset< SpacePointTrackCand > m_goodCandidates
SubsetSelector operating on a custom selection criteria.
void selectSubset()
Copy or delete candidates to achieve a subset creation.
bool m_subsetCreation
If True copy selected SpacePointTrackCands to new StoreArray, If False deactivate remaining SpacePoin...
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
StoreArray for input SpacePointTrackCands.
void deactivateCandidates()
Don't copy/delete candidates but rather deactivate them by setting a SpacePointTrackCandidate flag.
std::string m_nameSpacePointTrackCands
Name of input StoreArray containing SpacePointTrackCands.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.