Belle II Software  release-05-01-25
SpacePointLoader.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/ckf/svd/findlets/SpacePointLoader.h>
11 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12 #include <tracking/spacePointCreation/SpacePoint.h>
13 
14 #include <framework/core/ModuleParamList.templateDetails.h>
15 
16 #include <tracking/ckf/general/utilities/ClassMnemomics.h>
17 
18 using namespace Belle2;
19 
21 {
23 }
24 
25 void SpacePointLoader::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
26 {
27  Super::exposeParameters(moduleParamList, prefix);
28 
29  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "useAssignedHits"), m_param_useAssignedHits,
30  "Use only already assigned hits",
32 
33  m_storeArrayLoader.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "hits"));
34 }
35 
36 void SpacePointLoader::apply(std::vector<const SpacePoint*>& spacePoints)
37 {
38  m_storeArrayLoader.apply(spacePoints);
39 
41  const auto hitIsNotAlreadyUsed = [](const auto & hit) {
42  return not hit->getAssignmentState();
43  };
44  TrackFindingCDC::erase_remove_if(spacePoints, hitIsNotAlreadyUsed);
45  } else {
46  const auto hitIsAlreadyUsed = [](const auto & hit) {
47  return hit->getAssignmentState();
48  };
49  TrackFindingCDC::erase_remove_if(spacePoints, hitIsAlreadyUsed);
50  }
51 
52  B2DEBUG(50, "Starting with " << spacePoints.size() << " hits.");
53 }
Belle2::SpacePointLoader::m_param_useAssignedHits
bool m_param_useAssignedHits
Use only already used hits.
Definition: SpacePointLoader.h:56
Belle2::SpacePointLoader::SpacePointLoader
SpacePointLoader()
Add the sub findlet as a listener.
Definition: SpacePointLoader.cc:20
Belle2::TrackFindingCDC::CompositeProcessingSignalListener::addProcessingSignalListener
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Definition: CompositeProcessingSignalListener.cc:57
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::Findlet< const SpacePoint * >::exposeParameters
virtual void exposeParameters(ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused)))
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:79
Belle2::SpacePointLoader::m_storeArrayLoader
TrackFindingCDC::StoreArrayLoader< const SpacePoint > m_storeArrayLoader
Findlet for actually loading the hits.
Definition: SpacePointLoader.h:53
Belle2::SpacePointLoader::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Definition: SpacePointLoader.cc:25
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::SpacePointLoader::apply
void apply(std::vector< const SpacePoint * > &spacePoints) final
Do the space point retrieval.
Definition: SpacePointLoader.cc:36