Belle II Software  release-06-00-14
SPTC2GFTCConverterModule.h
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 #pragma once
10 
11 #include <framework/core/FrameworkExceptions.h>
12 #include <framework/core/Module.h>
13 
14 #include <tracking/spacePointCreation/SpacePoint.h>
15 
16 namespace Belle2 {
29 
30  public:
31 
34  void initialize() override;
36  void event() override;
38  void terminate() override;
40  protected:
41 
42  std::string m_SPTCName;
44  std::string m_genfitTCName;
46  std::string m_PXDClustersName;
48  std::string m_SVDClustersName;
50  // some counters for summary output
51  unsigned int m_SpacePointTCCtr;
53  unsigned int m_genfitTCCtr;
55  unsigned int m_skippedSPsCtr;
57  void initializeCounters();
63  template<typename ClusterType>
64  std::vector<int> getRelatedClusters(const Belle2::SpacePoint* spacePoint, const std::string& clusterNames = "ALL");
65 
66  BELLE2_DEFINE_EXCEPTION(ClusterNotFound,
67  "No related Cluster to a SpacePoint was found.");
68  };
70 }
Base class for Modules.
Definition: Module.h:72
Module for converting SpacePointTrackCands to genfit::SpacePointTrackCands.
unsigned int m_skippedSPsCtr
Counter for SpacePoints that were not converted.
void initialize() override
initialize module
std::string m_SVDClustersName
SVD Clusters collection name.
void event() override
event: convert SpacePointTrackCand to genfit::TrackCand
void terminate() override
terminate: some summary information on the processed events
unsigned int m_genfitTCCtr
Counter for genfit::TrackCands that were actually created by the module.
std::vector< int > getRelatedClusters(const Belle2::SpacePoint *spacePoint, const std::string &clusterNames="ALL")
get all related Clusters to a SpacePoint
std::string m_genfitTCName
genfit::TrackCand collection name
std::string m_PXDClustersName
PXD Clusters collection name.
std::string m_SPTCName
SpacePointTrackCand collection name.
unsigned int m_SpacePointTCCtr
Counter for SpacePointTrackCands presented to the module.
BELLE2_DEFINE_EXCEPTION(ClusterNotFound, "No related Cluster to a SpacePoint was found.")
Exception thrown, when no related Cluster can be found for a SpacePoint.
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:42
Abstract base class for different kinds of events.