Belle II Software  release-08-01-10
TrackFinderMCTruthRecoTracksModule.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 #pragma once
9 
10 #include <framework/core/Module.h>
11 #include <framework/datastore/StoreArray.h>
12 #include <mdst/dataobjects/MCParticle.h>
13 #include <cdc/dataobjects/CDCHit.h>
14 #include <cdc/dataobjects/CDCSimHit.h>
15 #include <pxd/dataobjects/PXDTrueHit.h>
16 #include <pxd/dataobjects/PXDCluster.h>
17 #include <svd/dataobjects/SVDTrueHit.h>
18 #include <svd/dataobjects/SVDCluster.h>
19 #include <tracking/dataobjects/RecoTrack.h>
20 
21 #include <TMatrixDSym.h>
22 #include <string>
23 
24 namespace Belle2 {
47 
48  public:
55 
59  void initialize() override;
60 
63  void beginRun() override;
64 
68  void event() override;
71  void endRun() override;
72 
73  private:
74 
81  template<class THit, class TSimHit>
82  bool isWithinNLoops(double Bz, const THit* aHit, double nLoops);
83 
84  bool m_usePXDHits;
85  bool m_useSVDHits;
86  bool m_useCDCHits;
89  float m_useNLoops;
94  std::vector<std::string>
97  0;
98  double m_energyCut;
99  bool m_neutrals;
103  double m_smearing;
104  std::vector<double>
106  TMatrixDSym
109  0;
111  0;
112  int m_nRecoTracks = 0;
120  std::vector<int>
122  std::vector<int>
130 
132  false;
135  bool m_discardAuxiliaryHits = false;
137  std::vector<uint> m_param_useCDCSuperLayers;
139  std::vector<uint> m_param_useCDCLayers;
141  std::vector<uint> m_param_ignoreCDCLayers;
143  std::array<bool, 9> m_useCDCSuperLayers{};
145  std::array<bool, 56> m_useCDCLayers{};
155  };
157 }
158 
Base class for Modules.
Definition: Module.h:72
This module uses the simulated truth information (MCParticles and their relations) to determine which...
bool m_useCDCHits
Boolean to select if CDCHits should be used.
bool m_enforceTrueHit
If set true only cluster hits that have a relation to a TrueHit will be included in the track candida...
std::vector< int > m_fromPdgCodes
if size() is not 0, only for particles having an ancestor (parent or parent of parent etc) with PDG c...
std::vector< int > m_particlePdgCodes
if size() is not 0, only for particles with PDG codes same as in this vector a track candidate will b...
StoreArray< SVDCluster > m_SVDClusters
SVDTrueHits StoreArray.
double m_energyCut
Create track candidates only for MCParticles with energy above this cut.
std::vector< std::string > m_whichParticles
List of keywords to mark what properties particles must have to get a track candidate .
bool m_discardAuxiliaryHits
if true hits marked as auxiliary will not be included in the RecoTrack
void event() override
This method is the core of the module.
int m_minimalNdf
Minimum number of total hits per track to allow track candidate creation.
StoreArray< PXDTrueHit > m_PXDTrueHits
PXDTrueHits StoreArray.
void endRun() override
This method is called if the current run ends.
int m_particleProperties
Internal encoding of m_whichParticles to avoid string comparisons.
bool m_useReassignedHits
Boolean to select the inclusion of hits form discarded secondary daughters.
std::vector< double > m_smearingCov
Covariance matrix used to smear the true pos and mom before passed to track candidate.
bool m_mcParticlesPresent
This flag is set to false if there are no MC Particles in the data store (probably data run?...
bool m_allowFirstCDCSuperLayerOnly
Boolean to allow tracks to pass the stereo hit requirement if they touched only the first (axial) CDC...
bool m_onlyCheckDirectParentPdgCode
To be used together with WhichParticles to select the ancestor and daughters.
bool m_mergeDecayInFlight
Boolean to merge decay in flight chains that involve a single charged particle.
bool m_setTimeSeed
Boolean to forward the production time as seed time.
float m_useNLoops
Number of loops to include in the MC tracks - effects only CDC.
double m_splitAfterDeltaT
Minimal time delay between two sim hits (in ns) after which MC reco track will be split into seperate...
bool m_useSecondCDCHits
Also includes the CDC 2nd hit information in the mc tracks.
StoreArray< CDCSimHit > m_CDCSimHits
CDCSimHits StoreArray.
int m_minCDCStereoHits
Minimum number of CDC hits from stereo wires per track to allow track candidate creation.
StoreArray< PXDCluster > m_PXDClusters
PXDClusters StoreArray.
bool m_usePXDHits
Boolean to select if PXDHits should be used.
void beginRun() override
Called when entering a new run.
std::vector< uint > m_param_useCDCLayers
List of layers to be used.
bool m_useOnlyBeforeTOP
Boolean to select if CDC hits after TOP detector are discarded.
std::vector< uint > m_param_ignoreCDCLayers
List of layers to be ignored in tracking.
std::vector< uint > m_param_useCDCSuperLayers
List of super layers to be used.
int m_minCDCAxialHits
Minimum number of CDC hits from axial wires per track to allow track candidate creation.
int m_noTrueHitCounter
will hold number of cluster hits that do not have a corresponding true hit
int m_minSVDHits
Minimum number of SVD hits per track to allow track candidate creation.
int m_notEnoughtHitsCounter
will hold number of tracks that do not have enough hits to form a track candidate (total NDF less tha...
bool m_useOnlyAxialCDCHits
Boolean to select if only axial CDCHits should be used.
StoreArray< RecoTrack > m_RecoTracks
RecoTracks StoreArray.
std::array< bool, 56 > m_useCDCLayers
Bits for the used layers ATTENTION: hardcoded value for number of layers.
double m_smearing
Smearing of MCMomentum and MCVertex in %.
std::array< bool, 9 > m_useCDCSuperLayers
Bits for the used super layers ATTENTION: hardcoded value for number of super layers.
std::string m_recoTracksStoreArrayName
RecoTracks StoreArray name.
int m_minPXDHits
Minimum number of PXD hits per track to allow track candidate creation.
bool m_neutrals
Boolean to mark if track candidates should also be created for neutral particles.
TMatrixDSym m_initialCov
The std::vector m_smearingCov will be translated into this TMatrixD.
StoreArray< SVDTrueHit > m_SVDTrueHits
SVDTrueHits StoreArray.
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
int m_nRecoTracks
will hold the total number of created track candidates
bool isWithinNLoops(double Bz, const THit *aHit, double nLoops)
helper function which returns true if the current hit is within n loops the template give the hit typ...
bool m_useSVDHits
Boolean to select if SVDHits should be used.
Abstract base class for different kinds of events.