Belle II Software  release-08-01-10
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 #include <tracking/spacePointCreation/SpacePointTrackCand.h>
14 #include <tracking/trackFindingVXD/sectorMapTools/NoKickRTSel.h>
15 #include <svd/dataobjects/SVDCluster.h>
16 #include <mdst/dataobjects/MCParticle.h>
17 #include <svd/dataobjects/SVDTrueHit.h>
18 #include <pxd/dataobjects/PXDTrueHit.h>
19 
20 #include <bitset>
21 
22 namespace Belle2 {
37  class RT2SPTCConverterModule : public Module {
38 
39  public:
40 
43 
46 
48  void initialize() override;
49 
51  void event() override;
52 
54  void endRun() override;
55 
57  void terminate() override;
58 
59  protected:
60 
65  c_singleCluster = 0,
66  c_undefinedError = 1
67  };
68 
69  using ConversionState = std::bitset<2>;
72  std::pair<std::vector<const SpacePoint*>, ConversionState>
73  getSpacePointsFromRecoHitInformations(std::vector<RecoHitInformation*> hitInfos);
74 
76  std::pair<std::vector<const SpacePoint*>, ConversionState>
77  getSpacePointsFromRecoHitInformationViaTrueHits(std::vector<RecoHitInformation*> hitInfos);
78 
81  {
82  m_noFailCtr = 0;
86  m_minSPCtr = 0;
87  m_mcParticlesPresent = false;
88  }
89 
90  std::string m_SVDClusterName;
92  std::optional<std::string> m_pxdSpacePointsStoreArrayName;
93  std::optional<std::string> m_svdSpacePointsStoreArrayName;
97  std::string m_RecoTracksName;
99  std::string m_SPTCName;
109  // parameters
112  int m_minSP;
119  bool m_convertFittedOnly = false;
120 
123  std::string m_noKickCutsFile;
127  int m_ncut = 0;
128  int m_npass = 0;
131  // state variables
133  unsigned int m_minSPCtr;
134  unsigned int m_noFailCtr;
135  unsigned int m_singleClusterUseCtr;
136  unsigned int m_undefinedErrorCtr;
137  unsigned int m_missingTrueHitCtr;
138  };
140 }
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.
bool m_noKickOutput
true=produce TFile with effects of NoKickCuts on tracks
StoreArray< SVDCluster > m_SVDClusters
SVDClusters StoreArray.
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
StoreArray< SpacePointTrackCand > m_SpacePointTrackCands
SpacePointTrackCands StoreArray.
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.
StoreArray< SpacePoint > m_SVDSpacePoints
SVDSpacePoints StoreArray.
std::string m_noKickCutsFile
name of TFile of the cuts
std::optional< std::string > m_pxdSpacePointsStoreArrayName
PXD SpacePoints collection names.
StoreArray< SVDTrueHit > m_SVDTrueHit
SVDTrueHits StoreArray.
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
std::optional< std::string > m_svdSpacePointsStoreArrayName
Non SingleCluster SVD SpacePoints collection names.
StoreArray< RecoTrack > m_RecoTracks
RecoTracks StoreArray.
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.
StoreArray< SpacePoint > m_PXDSpacePoints
PXDSpacePoints StoreArray.
int m_ncut
counter of the cuttet tracks
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
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.