Belle II Software development
SpacePointLoader.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/ckf/svd/findlets/SpacePointLoader.h>
9#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
10#include <tracking/spacePointCreation/SpacePoint.h>
11
12#include <framework/core/ModuleParamList.templateDetails.h>
13
14#include <tracking/ckf/general/utilities/ClassMnemomics.h>
15
16using namespace Belle2;
17
19{
21}
22
23void SpacePointLoader::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
24{
25 Super::exposeParameters(moduleParamList, prefix);
26
27 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "useAssignedHits"), m_param_useAssignedHits,
28 "Use only already assigned hits",
30
31 m_storeArrayLoader.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "hits"));
32}
33
34void SpacePointLoader::apply(std::vector<const SpacePoint*>& spacePoints)
35{
36 m_storeArrayLoader.apply(spacePoints);
37
39 const auto hitIsNotAlreadyUsed = [](const auto & hit) {
40 return not hit->getAssignmentState();
41 };
42 TrackFindingCDC::erase_remove_if(spacePoints, hitIsNotAlreadyUsed);
43 } else {
44 const auto hitIsAlreadyUsed = [](const auto & hit) {
45 return hit->getAssignmentState();
46 };
47 TrackFindingCDC::erase_remove_if(spacePoints, hitIsAlreadyUsed);
48 }
49
50 B2DEBUG(29, "Starting with " << spacePoints.size() << " hits.");
51}
The Module parameter list class.
SpacePointLoader()
Add the sub findlet as a listener.
void apply(std::vector< const SpacePoint * > &spacePoints) final
Do the space point retrieval.
TrackFindingCDC::StoreArrayLoader< const SpacePoint > m_storeArrayLoader
Findlet for actually loading the hits.
bool m_param_useAssignedHits
Use only already used hits.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
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.