Belle II Software development
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
24namespace Belle2 {
44
45 public:
52
56 void initialize() override;
57
60 void beginRun() override;
61
65 void event() override;
68 void endRun() override;
69
70 private:
71
78 template<class THit, class TSimHit>
79 bool isWithinNLoops(double Bz, const THit* aHit, double nLoops);
80
88 template<class THit, class TSimHit>
89 bool didParticleExitCDC(const THit* aHit);
90
101 std::vector<std::string>
104 0;
105 double m_energyCut;
110 double m_smearing;
111 std::vector<double>
113 TMatrixDSym
116 0;
118 0;
127 std::vector<int>
129 std::vector<int>
137
139 false;
144 std::vector<uint> m_param_useCDCSuperLayers;
146 std::vector<uint> m_param_useCDCLayers;
148 std::vector<uint> m_param_ignoreCDCLayers;
150 std::array<bool, 9> m_useCDCSuperLayers{};
152 std::array<bool, 56> m_useCDCLayers{};
162 };
164}
165
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
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 didParticleExitCDC(const THit *aHit)
helper function which returns true if the current hit has a creation time after the MCParticle left t...
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.
double m_splitAfterDeltaT
Minimal time delay between two sim hits (in ns) after which MC reco track will be split into separate...
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 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.