Belle II Software  release-05-02-19
RT2SPTCConverterModuleDev.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jonas Wagner *
7  * *
8  **************************************************************************/
9 
10 # pragma once
11 
12 #include <framework/core/Module.h>
13 #include <tracking/spacePointCreation/SpacePoint.h>
14 
15 #include <tracking/trackFindingVXD/sectorMapTools/NoKickRTSel.h>
16 
17 #include <boost/optional.hpp>
18 #include <bitset>
19 
20 namespace Belle2 {
35  class RT2SPTCConverterModule : public Module {
36 
37  public:
38 
41 
44 
46  void initialize() override;
47 
49  void event() override;
50 
52  void endRun() override;
53 
55  void terminate() override;
56 
57  protected:
58 
62  enum conversionFlags {
63  c_singleCluster = 0,
64  c_undefinedError = 1
65  };
66 
67  using ConversionState = std::bitset<2>;
70  std::pair<std::vector<const SpacePoint*>, ConversionState>
71  getSpacePointsFromRecoHitInformations(std::vector<RecoHitInformation*> hitInfos);
72 
74  std::pair<std::vector<const SpacePoint*>, ConversionState>
75  getSpacePointsFromRecoHitInformationViaTrueHits(std::vector<RecoHitInformation*> hitInfos);
76 
78  void initializeCounters()
79  {
80  m_noFailCtr = 0;
84  m_minSPCtr = 0;
86  }
87 
88  std::string m_SVDClusterName;
90  boost::optional<std::string> m_pxdSpacePointsStoreArrayName;
91  boost::optional<std::string> m_svdSpacePointsStoreArrayName;
93  std::string m_SVDSingleClusterSPName;
95  std::string m_RecoTracksName;
97  std::string m_SPTCName;
99  // parameters
102  int m_minSP;
103  bool m_useTrueHits;
105  bool m_useSingleClusterSP;
106  bool m_markRecoTracks;
109  bool m_convertFittedOnly = false;
110 
113  std::string m_noKickCutsFile;
114  bool m_noKickOutput;
117  int m_ncut = 0;
118  int m_npass = 0;
121  // state variables
122  bool m_mcParticlesPresent;
123  unsigned int m_minSPCtr;
124  unsigned int m_noFailCtr;
125  unsigned int m_singleClusterUseCtr;
126  unsigned int m_undefinedErrorCtr;
127  unsigned int m_missingTrueHitCtr;
128  };
130 }
Belle2::RT2SPTCConverterModule::m_singleClusterUseCtr
unsigned int m_singleClusterUseCtr
Counts how many tracks contained a single cluster.
Definition: RT2SPTCConverterModuleDev.h:132
Belle2::RT2SPTCConverterModule::m_ignorePXDHits
bool m_ignorePXDHits
PXD hits will be ignored when creating the SP track candidate.
Definition: RT2SPTCConverterModuleDev.h:107
Belle2::RT2SPTCConverterModule::RT2SPTCConverterModule
RT2SPTCConverterModule()
Constructor.
Definition: RT2SPTCConverterModuleDev.cc:28
Belle2::RT2SPTCConverterModule::m_minSPCtr
unsigned int m_minSPCtr
Counts how many tracks didn't contain enough SpacePoints after conversion.
Definition: RT2SPTCConverterModuleDev.h:130
Belle2::RT2SPTCConverterModule::ConversionState
std::bitset< 2 > ConversionState
Used to store conversionFlags and pass them between methods.
Definition: RT2SPTCConverterModuleDev.h:74
Belle2::RT2SPTCConverterModule::m_SVDClusterName
std::string m_SVDClusterName
SVDCluster collection name.
Definition: RT2SPTCConverterModuleDev.h:95
Belle2::RT2SPTCConverterModule::getSpacePointsFromRecoHitInformationViaTrueHits
std::pair< std::vector< const SpacePoint * >, ConversionState > getSpacePointsFromRecoHitInformationViaTrueHits(std::vector< RecoHitInformation * > hitInfos)
Convert Clusters to SpacePoints using the Relation: Cluster->TrueHit->SpacePoint.
Definition: RT2SPTCConverterModuleDev.cc:244
Belle2::RT2SPTCConverterModule::m_noKickOutput
bool m_noKickOutput
true=produce TFile with effects of NoKickCuts on tracks
Definition: RT2SPTCConverterModuleDev.h:121
Belle2::RT2SPTCConverterModule::m_RecoTracksName
std::string m_RecoTracksName
Name of collection of RecoTrack StoreArray.
Definition: RT2SPTCConverterModuleDev.h:102
Belle2::RT2SPTCConverterModule::m_useTrueHits
bool m_useTrueHits
If true the method getSpacePointsFromSVDClustersViaTrueHits is utilized.
Definition: RT2SPTCConverterModuleDev.h:110
Belle2::RT2SPTCConverterModule::m_SVDSingleClusterSPName
std::string m_SVDSingleClusterSPName
Single Cluster SVD SpacePoints collection name.
Definition: RT2SPTCConverterModuleDev.h:100
Belle2::RT2SPTCConverterModule::m_skipProblematicCluster
bool m_skipProblematicCluster
If true problematic clusters are ignored.
Definition: RT2SPTCConverterModuleDev.h:111
Belle2::RT2SPTCConverterModule::conversionFlags
conversionFlags
enum for differentiating reasons why a conversion failed
Definition: RT2SPTCConverterModuleDev.h:69
Belle2::RT2SPTCConverterModule::m_noKickCutsFile
std::string m_noKickCutsFile
name of TFile of the cuts
Definition: RT2SPTCConverterModuleDev.h:120
Belle2::RT2SPTCConverterModule::getSpacePointsFromRecoHitInformations
std::pair< std::vector< const SpacePoint * >, ConversionState > getSpacePointsFromRecoHitInformations(std::vector< RecoHitInformation * > hitInfos)
Convert Clusters to SpacePoints using the Relation: Cluster->SpacePoint.
Definition: RT2SPTCConverterModuleDev.cc:326
Belle2::RT2SPTCConverterModule::m_npass
int m_npass
counter of the selected tracks
Definition: RT2SPTCConverterModuleDev.h:125
Belle2::RT2SPTCConverterModule::m_useSingleClusterSP
bool m_useSingleClusterSP
If true use single cluster SpacePoint collection as fallback.
Definition: RT2SPTCConverterModuleDev.h:112
Belle2::RT2SPTCConverterModule::~RT2SPTCConverterModule
~RT2SPTCConverterModule()
Destructor.
Definition: RT2SPTCConverterModuleDev.cc:86
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RT2SPTCConverterModule::terminate
void terminate() override
Terminate: print some summary information on the processed events.
Definition: RT2SPTCConverterModuleDev.cc:430
Belle2::RT2SPTCConverterModule::endRun
void endRun() override
End Run function.
Definition: RT2SPTCConverterModuleDev.cc:421
Belle2::RT2SPTCConverterModule::m_trackSel
NoKickRTSel * m_trackSel
data members used fot the NoKickCuts method
Definition: RT2SPTCConverterModuleDev.h:119
Belle2::RT2SPTCConverterModule::m_pxdSpacePointsStoreArrayName
boost::optional< std::string > m_pxdSpacePointsStoreArrayName
PXD SpacePoints collection names.
Definition: RT2SPTCConverterModuleDev.h:97
Belle2::RT2SPTCConverterModule::initialize
void initialize() override
Initialize module (e.g. check if all required StoreArrays are present or registering new StoreArrays)
Definition: RT2SPTCConverterModuleDev.cc:92
Belle2::RT2SPTCConverterModule::m_undefinedErrorCtr
unsigned int m_undefinedErrorCtr
Counts how many tracks failed to be converted.
Definition: RT2SPTCConverterModuleDev.h:133
Belle2::RT2SPTCConverterModule::m_minSP
int m_minSP
parameter for specifying a minimal number of SpacePoints a SpacePointTrackCand has to have in order t...
Definition: RT2SPTCConverterModuleDev.h:109
Belle2::NoKickRTSel
This class implement some methods useful for the application of cuts evaluated in NoKickCutsEval modu...
Definition: NoKickRTSel.h:43
Belle2::RT2SPTCConverterModule::m_convertFittedOnly
bool m_convertFittedOnly
if true only RecoTracks with successful fit will be converted
Definition: RT2SPTCConverterModuleDev.h:116
Belle2::RT2SPTCConverterModule::m_mcParticlesPresent
bool m_mcParticlesPresent
If MCParticles are available.
Definition: RT2SPTCConverterModuleDev.h:129
Belle2::RT2SPTCConverterModule::event
void event() override
Event: convert RecoTracks to SpacePointTrackCands.
Definition: RT2SPTCConverterModuleDev.cc:134
Belle2::RT2SPTCConverterModule::m_markRecoTracks
bool m_markRecoTracks
If True RecoTracks where conversion problems occurred are marked dirty.
Definition: RT2SPTCConverterModuleDev.h:113
Belle2::RT2SPTCConverterModule::m_svdSpacePointsStoreArrayName
boost::optional< std::string > m_svdSpacePointsStoreArrayName
Non SingleCluster SVD SpacePoints collection names.
Definition: RT2SPTCConverterModuleDev.h:98
Belle2::RT2SPTCConverterModule::m_ncut
int m_ncut
counter of the cuttet tracks
Definition: RT2SPTCConverterModuleDev.h:124
Belle2::RT2SPTCConverterModule::m_SPTCName
std::string m_SPTCName
Name of collection under which SpacePointTrackCands will be stored in the StoreArray.
Definition: RT2SPTCConverterModuleDev.h:104
Belle2::RT2SPTCConverterModule::m_noFailCtr
unsigned int m_noFailCtr
Counts how many tracks could be converted without any problems.
Definition: RT2SPTCConverterModuleDev.h:131
Belle2::RT2SPTCConverterModule::initializeCounters
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
Definition: RT2SPTCConverterModuleDev.h:85
Belle2::RT2SPTCConverterModule::m_missingTrueHitCtr
unsigned int m_missingTrueHitCtr
Counts how many times a SpacePoint had no relation to a SVDTrueHit.
Definition: RT2SPTCConverterModuleDev.h:134