Belle II Software  release-08-01-10
WireHitBackgroundDetector.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/WireHitBackgroundDetector.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
11 
12 #include <framework/core/ModuleParamList.templateDetails.h>
13 
14 #include <vector>
15 
16 using namespace Belle2;
17 using namespace TrackFindingCDC;
18 
20 {
23 }
24 
26 {
27  return "Marks hits as background based on the result of a filter.";
28 }
29 
31  const std::string& prefix)
32 {
33  m_wireHitFilter.exposeParameters(moduleParamList, prefix);
34 }
35 
36 void WireHitBackgroundDetector::apply(std::vector<CDCWireHit>& wireHits)
37 {
38  for (CDCWireHit& wireHit : wireHits) {
39 
40  Weight wireHitWeight = m_wireHitFilter(wireHit);
41 
42  if (std::isnan(wireHitWeight)) {
43  wireHit->setBackgroundFlag();
44  wireHit->setTakenFlag();
45  wireHit->setBadADCOrTOTFlag();
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.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
void apply(std::vector< CDCWireHit > &wireHits) final
Main algorithm marking hit as background.
std::string getDescription() final
Short description of the findlet.
ChooseableWireHitFilter m_wireHitFilter
Chooseable WireHit filter to be used to filter background.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Abstract base class for different kinds of events.