Belle II Software development
ClusterBackgroundDetector.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#include <tracking/trackFindingCDC/findlets/minimal/ClusterBackgroundDetector.h>
9
10#include <tracking/trackFindingCDC/eventdata/segments/CDCWireHitCluster.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
12
13#include <vector>
14#include <string>
15
16using namespace Belle2;
17using namespace TrackFindingCDC;
18
20{
22}
23
25{
26 return "Marks clusters as background if the used filter detects them as such";
27}
28
30 const std::string& prefix)
31{
32 m_clusterFilter.exposeParameters(moduleParamList, prefix);
33}
34
35void ClusterBackgroundDetector::apply(std::vector<CDCWireHitCluster>& outputClusters)
36{
37 for (CDCWireHitCluster& cluster : outputClusters) {
38 Weight clusterWeight = m_clusterFilter(cluster);
39 if (std::isnan(clusterWeight)) {
40 // Cluster detected as background
41 cluster.setBackgroundFlag(true);
42 for (const CDCWireHit* wireHit : cluster) {
43 wireHit->getAutomatonCell().setBackgroundFlag();
44 wireHit->getAutomatonCell().setTakenFlag();
45 }
46 }
47 }
48}
The Module parameter list class.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
ClusterBackgroundDetector()
Constructor adding the filter as a subordinary processing signal listener.
std::string getDescription() final
Short description of the findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
ChooseableClusterFilter m_clusterFilter
Chooseable cluster filter to be used to filter background.
void apply(std::vector< CDCWireHitCluster > &outputClusters) final
Main algorithm applying the cluster background detection.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Abstract base class for different kinds of events.