Belle II Software development
BaseMeasurementCreatorFromHit< HitType, detector > Class Template Referenceabstract

Base Class to create measurements based on a given hit related to the RecoTrack. More...

#include <BaseMeasurementCreatorFromHit.h>

Inheritance diagram for BaseMeasurementCreatorFromHit< HitType, detector >:
BaseMeasurementCreator BaseMeasurementCreatorFromCoordinateMeasurement< HitType, detector > CoordinateMeasurementCreator< HitType, detector > VXDMomentumEstimationMeasurementCreator< HitType, detector >

Public Member Functions

 BaseMeasurementCreatorFromHit (const genfit::MeasurementFactory< genfit::AbsMeasurement > &measurementFactory)
 Creates a MeasurementCreator which handles the creation of measurements of a given kind.
 
virtual ~BaseMeasurementCreatorFromHit ()
 Destructor.
 
virtual std::vector< genfit::TrackPoint * > createMeasurementPoints (HitType *hit, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const =0
 Overload this method to create measurement track points from a given hit.
 
virtual void setParameter (const std::string &parameterName, const std::string &parameterValue)
 Use this to set the parameters of the creator.
 

Protected Member Functions

genfit::AbsMeasurement * createCoordinateMeasurement (HitType *hit, const RecoHitInformation &recoHitInformation) const
 You probably need a coordinate measurement on which you can base your measurements in createMeasurements.
 
genfit::TrackPoint * createTrackPointWithRecoHitInformation (genfit::AbsMeasurement *coordinateMeasurement, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const
 Helper: Create a TrackPoint from a measurement with a given RecoHitInformation.
 

Private Member Functions

std::vector< genfit::TrackPoint * > createMeasurementPoints (RecoTrack &) const override final
 We do not need this method in this overload.
 

Private Attributes

const genfit::MeasurementFactory< genfit::AbsMeasurement > & m_measurementFactory
 A reference to the prefilled measurement factory.
 

Detailed Description

template<class HitType, Const::EDetector detector>
class Belle2::BaseMeasurementCreatorFromHit< HitType, detector >

Base Class to create measurements based on a given hit related to the RecoTrack.

Use this class as a base class if you want to add TrackPoints with measurements that are created for each svd/pxd/cdc hit. If you do not relate to a specific hit from the track finders (for example for ECL energy measurements as a TrackPoint) you should not use this class as a base class but rather use BaseMeasurementCreator directly.

TODO: It would be better to skip the genfit::MeasurementFactory completely and just implement the conversion here directly!

Definition at line 40 of file BaseMeasurementCreatorFromHit.h.

Constructor & Destructor Documentation

◆ BaseMeasurementCreatorFromHit()

BaseMeasurementCreatorFromHit ( const genfit::MeasurementFactory< genfit::AbsMeasurement > &  measurementFactory)
explicit

Creates a MeasurementCreator which handles the creation of measurements of a given kind.

Definition at line 16 of file BaseMeasurementCreatorFromHit.cc.

17 :
18 BaseMeasurementCreator(), m_measurementFactory(measurementFactory) {}
const genfit::MeasurementFactory< genfit::AbsMeasurement > & m_measurementFactory
A reference to the prefilled measurement factory.
BaseMeasurementCreator()
Creates a MeasurementCreator which handles the creation of track points with measurements of a given ...

◆ ~BaseMeasurementCreatorFromHit()

virtual ~BaseMeasurementCreatorFromHit ( )
inlinevirtual

Destructor.

Definition at line 46 of file BaseMeasurementCreatorFromHit.h.

46{ }

Member Function Documentation

◆ createCoordinateMeasurement()

genfit::AbsMeasurement * createCoordinateMeasurement ( HitType *  hit,
const RecoHitInformation recoHitInformation 
) const
protected

You probably need a coordinate measurement on which you can base your measurements in createMeasurements.

This function uses the measurementFactory to create one. Please be aware that this creates two new objects on the heap: the measurement and the track point. If you do not plan to use those two in a track, please delete them! The track point can be deleted by accessing the measurements GetTrackPoints function.

Parameters
hit
recoHitInformation
Returns
a coordinate AbsMeasurement as pointer.

Definition at line 21 of file BaseMeasurementCreatorFromHit.cc.

23{
24 // No one is using the trackCandHit (neither in SVDRecoHit nor in PXDRecoHit). So we do not provide any here!
25 genfit::AbsMeasurement* coordinateMeasurement = m_measurementFactory.createOne(detector, hit->getArrayIndex(),
26 nullptr);
27
28 return coordinateMeasurement;
29}

◆ createMeasurementPoints() [1/2]

virtual std::vector< genfit::TrackPoint * > createMeasurementPoints ( HitType *  hit,
RecoTrack recoTrack,
const RecoHitInformation recoHitInformation 
) const
pure virtual

Overload this method to create measurement track points from a given hit.

Implemented in BaseMeasurementCreatorFromCoordinateMeasurement< HitType, detector >, and CoordinateMeasurementCreator< HitType, detector >.

◆ createMeasurementPoints() [2/2]

std::vector< genfit::TrackPoint * > createMeasurementPoints ( RecoTrack ) const
inlinefinaloverrideprivatevirtual

We do not need this method in this overload.

Implements BaseMeasurementCreator.

Definition at line 75 of file BaseMeasurementCreatorFromHit.h.

76 {
77 return {};
78 }

◆ createTrackPointWithRecoHitInformation()

genfit::TrackPoint * createTrackPointWithRecoHitInformation ( genfit::AbsMeasurement *  coordinateMeasurement,
RecoTrack recoTrack,
const RecoHitInformation recoHitInformation 
) const
protected

Helper: Create a TrackPoint from a measurement with a given RecoHitInformation.

Definition at line 32 of file BaseMeasurementCreatorFromHit.cc.

35{
36 genfit::TrackPoint* coordinateTrackPoint = new genfit::TrackPoint(coordinateMeasurement,
38 coordinateTrackPoint->setSortingParameter(recoHitInformation.getSortingParameter());
39
40 return coordinateTrackPoint;
41}
unsigned int getSortingParameter() const
Get the sorting parameter.
static genfit::Track & getGenfitTrack(RecoTrack &recoTrack)
Give access to the RecoTrack's genfit::Track.
Definition: RecoTrack.cc:404

◆ setParameter()

virtual void setParameter ( const std::string &  parameterName,
const std::string &  parameterValue 
)
inlinevirtualinherited

Use this to set the parameters of the creator.

Does nothing per default.

Reimplemented in VXDMomentumEstimationMeasurementCreator< HitType, detector >.

Definition at line 47 of file BaseMeasurementCreator.h.

48 {
49 B2FATAL("A parameter with the name " << parameterName << " and the value " << parameterValue << " could not be set.");
50 }

Member Data Documentation

◆ m_measurementFactory

const genfit::MeasurementFactory<genfit::AbsMeasurement>& m_measurementFactory
private

A reference to the prefilled measurement factory.

Definition at line 72 of file BaseMeasurementCreatorFromHit.h.


The documentation for this class was generated from the following files: