Belle II Software  release-08-01-10
WireHitBackgroundBlocker.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/WireHitBackgroundBlocker.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
11 
12 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13 
14 #include <framework/core/ModuleParamList.templateDetails.h>
15 
16 #include <vector>
17 
18 using namespace Belle2;
19 using namespace TrackFindingCDC;
20 
22 {
23  return "Marks hits as background based on simple heuristics.";
24 }
25 
27  const std::string& prefix)
28 {
29  moduleParamList->addParameter(prefixed(prefix, "blockNegativeDriftLength"),
31  "Switch to drop wire hits with negative "
32  "drift lengths from output",
34 
35  moduleParamList->addParameter(prefixed(prefix, "noiseChargeDeposit"),
37  "Threshold energy below which the hit is considered "
38  "to be electronic noise",
40 }
41 
42 void WireHitBackgroundBlocker::apply(std::vector<CDCWireHit>& wireHits)
43 {
44  for (CDCWireHit& wireHit : wireHits) {
45  bool markAsBackground = false;
46 
48  if (wireHit.getRefDriftLength() < 0) {
49  markAsBackground = true;
50  }
51  }
52 
53  if (wireHit.getRefChargeDeposit() < m_param_noiseChargeDeposit) {
54  markAsBackground = true;
55  }
56 
57  if (markAsBackground) {
58  wireHit->setBackgroundFlag();
59  wireHit->setTakenFlag();
60  }
61  }
62 }
The Module parameter list class.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
void apply(std::vector< CDCWireHit > &wireHits) final
Main algorithm marking hit as background.
double m_param_noiseChargeDeposit
Parameter : Threshold below, which hits are consider electronic noise background.
std::string getDescription() final
Short description of the findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
bool m_param_blockNegativeDriftLength
Parameter : Switch to drop negative drift lengths from the created wire hits.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.