Belle II Software development
|
TrackBuilder class to create the Track/TrackFitResult mdst output from the RecoTrack. More...
#include <TrackBuilder.h>
Public Member Functions | |
TrackBuilder (const std::string &trackColName, const std::string &trackFitResultColName, const B2Vector3D &beamSpot=B2Vector3D(0., 0., 0.), const B2Vector3D &beamAxis=B2Vector3D(0., 0., 1.)) | |
Constructor of the class. | |
bool | storeTrackFromRecoTrack (RecoTrack &recoTrack, const bool useClosestHitToIP=false, const bool useBFieldAtHit=false) |
Stores a Belle2 Track from a Reco Track. | |
Static Public Member Functions | |
static uint32_t | getHitPatternVXDInitializer (const RecoTrack &recoTrack, const genfit::AbsTrackRep *representation=nullptr) |
Get the HitPattern in the VXD. | |
static uint64_t | getHitPatternCDCInitializer (const RecoTrack &recoTrack, const genfit::AbsTrackRep *representation=nullptr) |
Get the HitPattern in the CDC. | |
Private Attributes | |
std::string | m_trackColName |
TrackColName (output). | |
std::string | m_trackFitResultColName |
TrackFitResultColName (output). | |
B2Vector3D | m_beamSpot |
Extrapolation target, origin. | |
B2Vector3D | m_beamAxis |
Extrapolation target, positive z direction. | |
TrackBuilder class to create the Track/TrackFitResult mdst output from the RecoTrack.
To use this class, iterate over all Reco tracks and call trackBuilder.storeTrackFromRecoTrack. All fitted hypotheses will be stored into one Track with the TrackFitResult array indices stored in the Track. for (auto& recoTrack : recoTracks) { trackBuilder.storeTrackFromRecoTrack(recoTrack); }
If you want to make sure that all hypotheses are fitted and stored, call the fitter again. If the tracks are fitted already, this produces no overhead. TrackFitter trackFitter; TrackBuilder trackBuilder; for (auto& recoTrack : recoTracks) { for (const auto& pdg : m_pdgCodes) { trackFitter.fit(recoTrack, Const::ParticleType(abs(pdg))); } trackBuilder.storeTrackFromRecoTrack(recoTrack); }
Definition at line 41 of file TrackBuilder.h.
|
inline |
Constructor of the class.
trackColName | Name of the store array for tracks (output). |
trackFitResultColName | Name of the store array for track fit results (output). |
beamSpot | Origin. |
beamAxis | Positive z-direction. |
Definition at line 50 of file TrackBuilder.h.
|
static |
Get the HitPattern in the CDC.
Definition at line 211 of file TrackBuilder.cc.
|
static |
Get the HitPattern in the VXD.
Definition at line 142 of file TrackBuilder.cc.
bool storeTrackFromRecoTrack | ( | RecoTrack & | recoTrack, |
const bool | useClosestHitToIP = false , |
||
const bool | useBFieldAtHit = false |
||
) |
Stores a Belle2 Track from a Reco Track.
Every fitted hypothesis will be extrapolated to the perigee and stored as a TrackFitResult when the fit and the extrapolation were successful. We will only create a Track mdst object, when we are sure that we have at least one valid hypothesis available. If we do not have this, we discard the track no matter what.
The StoreArrayIndex is stored in the Belle2 Track, no relation is set.
recoTrack | The reco track the fit results are stored for |
useClosestHitToIP | Flag to turn on special handling which measurement to choose; especially useful for Cosmics |
useBFieldAtHit | Flag to calculate the BField at the used hit (closest to IP or first one), instead of the one at the POCA. This is also useful for cosmics only. |
Definition at line 34 of file TrackBuilder.cc.
|
private |
Extrapolation target, positive z direction.
Definition at line 93 of file TrackBuilder.h.
|
private |
Extrapolation target, origin.
Definition at line 91 of file TrackBuilder.h.
|
private |
TrackColName (output).
Definition at line 87 of file TrackBuilder.h.
|
private |
TrackFitResultColName (output).
Definition at line 89 of file TrackBuilder.h.