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