Belle II Software  release-06-00-14
RT2SPTCConverterModuleDev.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/Module.h>
12 #include <tracking/spacePointCreation/SpacePoint.h>
13 
14 #include <tracking/trackFindingVXD/sectorMapTools/NoKickRTSel.h>
15 
16 #include <boost/optional.hpp>
17 #include <bitset>
18 
19 namespace Belle2 {
34  class RT2SPTCConverterModule : public Module {
35 
36  public:
37 
40 
43 
45  void initialize() override;
46 
48  void event() override;
49 
51  void endRun() override;
52 
54  void terminate() override;
55 
56  protected:
57 
62  c_singleCluster = 0,
63  c_undefinedError = 1
64  };
65 
66  using ConversionState = std::bitset<2>;
69  std::pair<std::vector<const SpacePoint*>, ConversionState>
70  getSpacePointsFromRecoHitInformations(std::vector<RecoHitInformation*> hitInfos);
71 
73  std::pair<std::vector<const SpacePoint*>, ConversionState>
74  getSpacePointsFromRecoHitInformationViaTrueHits(std::vector<RecoHitInformation*> hitInfos);
75 
78  {
79  m_noFailCtr = 0;
83  m_minSPCtr = 0;
84  m_mcParticlesPresent = false;
85  }
86 
87  std::string m_SVDClusterName;
89  boost::optional<std::string> m_pxdSpacePointsStoreArrayName;
90  boost::optional<std::string> m_svdSpacePointsStoreArrayName;
94  std::string m_RecoTracksName;
96  std::string m_SPTCName;
98  // parameters
101  int m_minSP;
108  bool m_convertFittedOnly = false;
109 
112  std::string m_noKickCutsFile;
116  int m_ncut = 0;
117  int m_npass = 0;
120  // state variables
122  unsigned int m_minSPCtr;
123  unsigned int m_noFailCtr;
124  unsigned int m_singleClusterUseCtr;
125  unsigned int m_undefinedErrorCtr;
126  unsigned int m_missingTrueHitCtr;
127  };
129 }
Base class for Modules.
Definition: Module.h:72
This class implement some methods useful for the application of cuts evaluated in NoKickCutsEval modu...
Definition: NoKickRTSel.h:33
Module for converting RecoTracks to SpacePointTrackCands.
unsigned int m_singleClusterUseCtr
Counts how many tracks contained a single cluster.
bool m_ignorePXDHits
PXD hits will be ignored when creating the SP track candidate.
boost::optional< std::string > m_pxdSpacePointsStoreArrayName
PXD SpacePoints collection names.
boost::optional< std::string > m_svdSpacePointsStoreArrayName
Non SingleCluster SVD SpacePoints collection names.
bool m_noKickOutput
true=produce TFile with effects of NoKickCuts on tracks
conversionFlags
enum for differentiating reasons why a conversion failed
unsigned int m_minSPCtr
Counts how many tracks didn't contain enough SpacePoints after conversion.
void initialize() override
Initialize module (e.g. check if all required StoreArrays are present or registering new StoreArrays)
int m_npass
counter of the selected tracks
void event() override
Event: convert RecoTracks to SpacePointTrackCands.
int m_minSP
parameter for specifying a minimal number of SpacePoints a SpacePointTrackCand has to have in order t...
void endRun() override
End Run function.
bool m_mcParticlesPresent
If MCParticles are available.
void terminate() override
Terminate: print some summary information on the processed events.
bool m_skipProblematicCluster
If true problematic clusters are ignored.
std::string m_SVDSingleClusterSPName
Single Cluster SVD SpacePoints collection name.
bool m_useTrueHits
If true the method getSpacePointsFromSVDClustersViaTrueHits is utilized.
std::pair< std::vector< const SpacePoint * >, ConversionState > getSpacePointsFromRecoHitInformations(std::vector< RecoHitInformation * > hitInfos)
Convert Clusters to SpacePoints using the Relation: Cluster->SpacePoint.
std::string m_noKickCutsFile
name of TFile of the cuts
std::string m_SPTCName
Name of collection under which SpacePointTrackCands will be stored in the StoreArray.
std::string m_RecoTracksName
Name of collection of RecoTrack StoreArray.
unsigned int m_missingTrueHitCtr
Counts how many times a SpacePoint had no relation to a SVDTrueHit.
bool m_convertFittedOnly
if true only RecoTracks with successful fit will be converted
std::string m_SVDClusterName
SVDCluster collection name.
std::bitset< 2 > ConversionState
Used to store conversionFlags and pass them between methods.
NoKickRTSel * m_trackSel
data members used fot the NoKickCuts method
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
unsigned int m_undefinedErrorCtr
Counts how many tracks failed to be converted.
bool m_useSingleClusterSP
If true use single cluster SpacePoint collection as fallback.
unsigned int m_noFailCtr
Counts how many tracks could be converted without any problems.
int m_ncut
counter of the cuttet tracks
bool m_markRecoTracks
If True RecoTracks where conversion problems occurred are marked dirty.
std::pair< std::vector< const SpacePoint * >, ConversionState > getSpacePointsFromRecoHitInformationViaTrueHits(std::vector< RecoHitInformation * > hitInfos)
Convert Clusters to SpacePoints using the Relation: Cluster->TrueHit->SpacePoint.
Abstract base class for different kinds of events.