Belle II Software development
PruneRecoTracksModule.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/modules/pruneRecoTracks/PruneRecoTracksModule.h>
10
11using namespace Belle2;
12
13REG_MODULE(PruneRecoTracks);
14
16 Module()
17{
18 setDescription("Prunes RecoTracks.");
20
21 addParam("storeArrayName", m_storeArrayName,
22 "Name of the StoreArray which is pruned",
24
25 addParam("removeHits", m_do_remove_hits,
26 "Remove hits in the module or leave it for PruneRecoHitsModule"
28}
29
31{
33 m_RecoHitInformations.isRequired();
34
36 }
37}
38
40{
41 if (m_RecoTracks.getEntries() > 0) {
42 for (auto& t : m_RecoTracks) {
43 t.prune();
44 }
45
46 if (m_do_remove_hits) {
47 m_subsetOfUnprunedRecoHitInformation.select([](const RecoHitInformation * recoHitInformation) {
48 return recoHitInformation->getFlag() != RecoHitInformation::RecoHitFlag::c_pruned;
49 });
50 }
51 }
52}
53
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Definition: DataStore.h:71
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
PruneRecoTracksModule()
Constructor of the module. Setting up parameters and description.
void initialize() override
Declare required StoreArray.
void event() override
Event processing, prunes the RecoTracks contained in each event.
bool m_do_remove_hits
Remove pruned reco hits or leave this for PruneRecoHitsModule.
std::string m_storeArrayName
Name of the StoreArray to prune.
StoreArray< RecoHitInformation > m_RecoHitInformations
RecoHitInformations StoreArray.
StoreArray< RecoTrack > m_RecoTracks
RecoTracks StoreArray.
SelectSubset< RecoHitInformation > m_subsetOfUnprunedRecoHitInformation
We use SelectSubset here to delete all pruned RecoHitInformation.
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
RecoHitFlag getFlag() const
Get the additional flag.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.