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

Baseclass to create measurement track points based on the coordinate measurements. More...

#include <BaseMeasurementCreatorFromCoordinateMeasurement.h>

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

Public Member Functions

 BaseMeasurementCreatorFromCoordinateMeasurement (const genfit::MeasurementFactory< genfit::AbsMeasurement > &measurementFactory)
 Needs the genfit MeasurementFactory for this.
 
std::vector< genfit::TrackPoint * > createMeasurementPoints (HitType *hit, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const override
 Create measurements based on coordinate measurements.
 
virtual ~BaseMeasurementCreatorFromCoordinateMeasurement ()
 Destructor.
 
virtual void setParameter (const std::string &parameterName, const std::string &parameterValue)
 Use this to set the parameters of the creator.
 

Protected Member Functions

virtual std::vector< genfit::AbsMeasurement * > createMeasurementFromCoordinateMeasurement (HitType *hit, const RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation, genfit::AbsMeasurement *coordinateMeasurement) const =0
 Overload this method if you want to create measurements from coordinate measurements.
 
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 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::BaseMeasurementCreatorFromCoordinateMeasurement< HitType, detector >

Baseclass to create measurement track points based on the coordinate measurements.

Use this class as a base class as in VXDMomentumEstimationMeasurementCreator. All measurements that you create by overloading the createMeasurementFromCoordinateMeasurement function get their own TrackPoint.

Definition at line 24 of file BaseMeasurementCreatorFromCoordinateMeasurement.h.

Constructor & Destructor Documentation

◆ BaseMeasurementCreatorFromCoordinateMeasurement()

BaseMeasurementCreatorFromCoordinateMeasurement ( const genfit::MeasurementFactory< genfit::AbsMeasurement > &  measurementFactory)
inlineexplicit

Needs the genfit MeasurementFactory for this.

Definition at line 28 of file BaseMeasurementCreatorFromCoordinateMeasurement.h.

29 :
30 BaseMeasurementCreatorFromHit<HitType, detector>(measurementFactory) {}

◆ ~BaseMeasurementCreatorFromCoordinateMeasurement()

Destructor.

Definition at line 54 of file BaseMeasurementCreatorFromCoordinateMeasurement.h.

54{ }

Member Function Documentation

◆ createCoordinateMeasurement()

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

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}
const genfit::MeasurementFactory< genfit::AbsMeasurement > & m_measurementFactory
A reference to the prefilled measurement factory.

◆ createMeasurementFromCoordinateMeasurement()

virtual std::vector< genfit::AbsMeasurement * > createMeasurementFromCoordinateMeasurement ( HitType *  hit,
const RecoTrack recoTrack,
const RecoHitInformation recoHitInformation,
genfit::AbsMeasurement *  coordinateMeasurement 
) const
protectedpure virtual

Overload this method if you want to create measurements from coordinate measurements.

You have to delete the content of the coordinateMeasurement if you do not plan to use them. This method gets called in the createMeasurements method.

Parameters
hit
recoTrack
recoHitInformation
coordinateMeasurement
Returns
a vector of measurements that get used to create as many track points.

Implemented in VXDMomentumEstimationMeasurementCreator< HitType, detector >.

◆ createMeasurementPoints()

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

Create measurements based on coordinate measurements.

Implements BaseMeasurementCreatorFromHit< HitType, detector >.

Definition at line 33 of file BaseMeasurementCreatorFromCoordinateMeasurement.h.

35 {
36 genfit::AbsMeasurement* coordinateMeasurement = this->createCoordinateMeasurement(hit,
37 recoHitInformation);
38
39 const std::vector<genfit::AbsMeasurement*>& measurements =
40 this->createMeasurementFromCoordinateMeasurement(hit, recoTrack, recoHitInformation, coordinateMeasurement);
41
42 // TODO: Do we want to create one track point for each or one track point for all?
43 // TODO: This is especially important in the question to which the track point should be related!
44 std::vector<genfit::TrackPoint*> trackPoints;
45 trackPoints.reserve(measurements.size());
46 for (genfit::AbsMeasurement* measurement : measurements) {
47 trackPoints.push_back(this->createTrackPointWithRecoHitInformation(measurement, recoTrack, recoHitInformation));
48 }
49
50 return trackPoints;
51 }
virtual std::vector< genfit::AbsMeasurement * > createMeasurementFromCoordinateMeasurement(HitType *hit, const RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation, genfit::AbsMeasurement *coordinateMeasurement) const =0
Overload this method if you want to create measurements from coordinate measurements.
genfit::AbsMeasurement * createCoordinateMeasurement(HitType *hit, const RecoHitInformation &recoHitInformation) const
You probably need a coordinate measurement on which you can base your measurements in createMeasureme...
genfit::TrackPoint * createTrackPointWithRecoHitInformation(genfit::AbsMeasurement *coordinateMeasurement, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const
Helper: Create a TrackPoint from a measurement with a given RecoHitInformation.

◆ createTrackPointWithRecoHitInformation()

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

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
privateinherited

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 file: