Belle II Software  release-05-01-25
ClusterBackgroundDetector.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/findlets/minimal/ClusterBackgroundDetector.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/segments/CDCWireHitCluster.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14 
15 #include <vector>
16 #include <string>
17 
18 using namespace Belle2;
19 using namespace TrackFindingCDC;
20 
22 {
24 }
25 
27 {
28  return "Marks clusters as background if the used filter detectes them as such";
29 }
30 
32  const std::string& prefix)
33 {
34  m_clusterFilter.exposeParameters(moduleParamList, prefix);
35 }
36 
37 void ClusterBackgroundDetector::apply(std::vector<CDCWireHitCluster>& outputClusters)
38 {
39  for (CDCWireHitCluster& cluster : outputClusters) {
40  Weight clusterWeight = m_clusterFilter(cluster);
41  if (std::isnan(clusterWeight)) {
42  // Cluster detected as background
43  cluster.setBackgroundFlag(true);
44  for (const CDCWireHit* wireHit : cluster) {
45  wireHit->getAutomatonCell().setBackgroundFlag();
46  wireHit->getAutomatonCell().setTakenFlag();
47  }
48  }
49  }
50 }
Belle2::TrackFindingCDC::ClusterBackgroundDetector::getDescription
std::string getDescription() final
Short description of the findlet.
Definition: ClusterBackgroundDetector.cc:26
Belle2::TrackFindingCDC::ClusterBackgroundDetector::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: ClusterBackgroundDetector.cc:31
Belle2::TrackFindingCDC::ClusterBackgroundDetector::apply
void apply(std::vector< CDCWireHitCluster > &outputClusters) final
Main algorithm applying the cluster background detection.
Definition: ClusterBackgroundDetector.cc:37
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
Belle2::TrackFindingCDC::ClusterBackgroundDetector::ClusterBackgroundDetector
ClusterBackgroundDetector()
Constructor adding the filter as a subordinary processing signal listener.
Definition: ClusterBackgroundDetector.cc:21
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCWireHitCluster
An aggregation of CDCWireHits.
Definition: CDCWireHitCluster.h:31
Belle2::TrackFindingCDC::ClusterBackgroundDetector::m_clusterFilter
ChooseableClusterFilter m_clusterFilter
Chooseable cluster filter to be used to filter background.
Definition: ClusterBackgroundDetector.h:59
Belle2::TrackFindingCDC::Chooseable::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
Definition: ChooseableFilter.icc.h:58
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46