Belle II Software  release-05-01-25
WireHitBackgroundDetector.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost, Cyrille Praz *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/findlets/minimal/WireHitBackgroundDetector.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
13 
14 #include <framework/core/ModuleParamList.templateDetails.h>
15 
16 #include <vector>
17 
18 using namespace Belle2;
19 using namespace TrackFindingCDC;
20 
22 {
25 }
26 
28 {
29  return "Marks hits as background based on the result of a filter.";
30 }
31 
33  const std::string& prefix)
34 {
35  m_wireHitFilter.exposeParameters(moduleParamList, prefix);
36 }
37 
38 void WireHitBackgroundDetector::apply(std::vector<CDCWireHit>& wireHits)
39 {
40  for (CDCWireHit& wireHit : wireHits) {
41 
42  Weight wireHitWeight = m_wireHitFilter(wireHit);
43 
44  if (std::isnan(wireHitWeight)) {
45  wireHit->setBackgroundFlag();
46  wireHit->setTakenFlag();
47  wireHit->setBadADCOrTOTFlag();
48  }
49  }
50 }
Belle2::TrackFindingCDC::WireHitBackgroundDetector::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: WireHitBackgroundDetector.cc:32
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
Belle2::TrackFindingCDC::WireHitBackgroundDetector::getDescription
std::string getDescription() final
Short description of the findlet.
Definition: WireHitBackgroundDetector.cc:27
Belle2::TrackFindingCDC::WireHitBackgroundDetector::m_wireHitFilter
ChooseableWireHitFilter m_wireHitFilter
Chooseable WireHit filter to be used to filter background.
Definition: WireHitBackgroundDetector.h:57
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::WireHitBackgroundDetector::apply
void apply(std::vector< CDCWireHit > &wireHits) final
Main algorithm marking hit as background.
Definition: WireHitBackgroundDetector.cc:38
Belle2::TrackFindingCDC::WireHitBackgroundDetector::WireHitBackgroundDetector
WireHitBackgroundDetector()
Default constructor.
Definition: WireHitBackgroundDetector.cc:21
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