Belle II Software development
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
22namespace Belle2 {
38
39 public:
40
43
45 ~RT2SPTCConverterModule() override;
46
49
52
54 void initialize() override;
55
57 void event() override;
58
60 void endRun() override;
61
63 void terminate() override;
64
65 protected:
66
71 c_singleCluster = 0,
72 c_undefinedError = 1
73 };
74
75 using ConversionState = std::bitset<2>;
76
78 std::pair<std::vector<const SpacePoint*>, ConversionState>
79 getSpacePointsFromRecoHitInformations(std::vector<RecoHitInformation*> hitInfos);
80
82 std::pair<std::vector<const SpacePoint*>, ConversionState>
83 getSpacePointsFromRecoHitInformationViaTrueHits(const std::vector<RecoHitInformation*>& hitInfos);
84
95
96 std::string m_SVDClusterName;
97
98 std::optional<std::string> m_pxdSpacePointsStoreArrayName;
99 std::optional<std::string> m_svdSpacePointsStoreArrayName;
100
102
103 std::string m_RecoTracksName;
104
105 std::string m_SPTCName;
106
114
115 // parameters
117
123
126
129 std::string m_noKickCutsFile;
131
132
133 int m_ncut = 0;
134 int m_npass = 0;
135
136
137 // state variables
139 unsigned int m_minSPCtr;
140 unsigned int m_noFailCtr;
142 unsigned int m_undefinedErrorCtr;
143 unsigned int m_missingTrueHitCtr;
144 };
145
146}
Module()
Constructor.
Definition Module.cc:30
This class implement some methods useful for the application of cuts evaluated in NoKickCutsEval modu...
Definition NoKickRTSel.h:33
unsigned int m_singleClusterUseCtr
Counts how many tracks contained a single cluster.
RT2SPTCConverterModule(const RT2SPTCConverterModule &)=delete
copy constructor, deleted since the class owns a bare pointer
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.
std::pair< std::vector< const SpacePoint * >, ConversionState > getSpacePointsFromRecoHitInformationViaTrueHits(const std::vector< RecoHitInformation * > &hitInfos)
Convert Clusters to SpacePoints using the Relation: Cluster->TrueHit->SpacePoint.
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 for the NoKickCuts method
std::optional< std::string > m_svdSpacePointsStoreArrayName
Non SingleCluster SVD SpacePoints collection names.
RT2SPTCConverterModule & operator=(const RT2SPTCConverterModule &)=delete
assignment operator, deleted since the class owns a bare pointer
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 cut tracks
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
bool m_markRecoTracks
If True RecoTracks where conversion problems occurred are marked dirty.
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Abstract base class for different kinds of events.