Belle II Software development
CDCHitsRemover.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
9#include <tracking/trackFindingCDC/findlets/complete/CDCHitsRemover.h>
10#include <framework/core/ModuleParamList.templateDetails.h>
11
12using namespace Belle2;
13using namespace TrackingUtilities;
14
15void CDCHitsRemover::initialize()
16{
18 m_cdcHits.isRequired();
20};
21
22
23void CDCHitsRemover::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
24{
25 Super::exposeParameters(moduleParamList, prefix);
26 moduleParamList->getParameter<std::string>("inputWireHits").setDefaultValue("CDCWireHitVector");
27}
28
30{
31 return "Removes CDCHits which are marked as background";
32}
33
34
35void CDCHitsRemover::apply(const std::vector<CDCWireHit>& wireHits)
36{
37
38 // Selector
39 auto selector = [wireHits](const RelationsObject * p) -> bool {
40 int idx = p->getArrayIndex();
41 auto it = std::ranges::find(wireHits, idx, &CDCWireHit::getStoreIHit);
42 if (it != wireHits.end())
43 {
44 const CDCWireHit& hit = *it;
45 return not hit->hasBackgroundFlag();
46 } else
47 {
48 B2WARNING("Un-matched CDCHit -- CDCWireHit");
49 return false;
50 }
51 };
52
53 m_cdc_selector.select(selector);
54};
@ c_WriteOut
Object/array should be saved by output modules.
Definition DataStore.h:70
bool hasBackgroundFlag() const
Gets the current state of the do not use flag marker flag.
SelectSubset< CDCHit > m_cdc_selector
Selector for CDC hits.
std::string getDescription() final
Short description of the findlet.
void apply(const std::vector< CDCWireHit > &wireHits) override
Event processor.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
StoreArray< CDCHit > m_cdcHits
CDC hits.
Index getStoreIHit() const
Getter for the index of the hit in the StoreArray holding this hit.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Abstract base class for different kinds of events.