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/trackingUtilities/eventdata/segments/CDCWireHitCluster.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
12
13#include <vector>
14#include <string>
15
16using namespace Belle2;
17using namespace TrackFindingCDC;
18using namespace TrackingUtilities;
19
24
26{
27 return "Marks clusters as background if the used filter detects them as such";
28}
29
31 const std::string& prefix)
32{
33 m_clusterFilter.exposeParameters(moduleParamList, prefix);
34}
35
36void ClusterBackgroundDetector::apply(std::vector<CDCWireHitCluster>& outputClusters)
37{
38 for (CDCWireHitCluster& cluster : outputClusters) {
39 Weight clusterWeight = m_clusterFilter(cluster);
40 if (std::isnan(clusterWeight)) {
41 // Cluster detected as background
42 cluster.setBackgroundFlag(true);
43 for (const CDCWireHit* wireHit : cluster) {
44 wireHit->getAutomatonCell().setBackgroundFlag();
45 wireHit->getAutomatonCell().setTakenFlag();
46 }
47 }
48 }
49}
The Module parameter list class.
void apply(std::vector< TrackingUtilities::CDCWireHitCluster > &outputClusters) final
Main algorithm applying the cluster background detection.
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.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:58
Abstract base class for different kinds of events.