Belle II Software development
VXDMomentumEstimationMeasurementCreator< HitType, detector > Class Template Reference

Creator for VXDMeasurements with momentum estimation based on the dEdX information. More...

#include <VXDMomentumEstimationMeasurementCreator.h>

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

Public Member Functions

 VXDMomentumEstimationMeasurementCreator (const genfit::MeasurementFactory< genfit::AbsMeasurement > &measurementFactory)
 Constructor.
 
virtual ~VXDMomentumEstimationMeasurementCreator ()
 Desctructor.
 
void setParameter (const std::string &parameterName, const std::string &parameterValue) override
 Set the parameters of the fit functions and whether to use the thickness or not or the tracking seeds or not.
 
std::vector< genfit::TrackPoint * > createMeasurementPoints (HitType *hit, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const override
 Create measurements based on coordinate measurements.
 

Protected Member Functions

virtual std::vector< genfit::AbsMeasurement * > createMeasurementFromCoordinateMeasurement (HitType *hit, const RecoTrack &recoTrack, const RecoHitInformation &, genfit::AbsMeasurement *coordinateMeasurement) const override
 Create a measurement based on the momentum estimation given by the VXDMomentumEstimation class.
 
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

VXDMomentumEstimation< HitType >::FitParameters m_fitParameters
 Parameters for the main function.
 
VXDMomentumEstimation< HitType >::CorrectionFitParameters m_correctionFitParameters
 Parameters for the correction function.
 
bool m_useMCInformation = false
 Use the seeds of the track finder or the seeds of the MC particles.
 
bool m_useThickness = false
 Use the thickness of the clusters of the path length for estimating dX.
 
double m_minimumMomentum = 0.1
 Minimal value for the momentum below the estimation is used.
 
double m_sigma = 0.03
 Sigma of the measurement.
 
bool m_useTrackingSeeds = false
 Use the tracking seeds in the origin for calculating the path length rather than the current state.
 
const genfit::MeasurementFactory< genfit::AbsMeasurement > & m_measurementFactory
 A reference to the prefilled measurement factory.
 

Detailed Description

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

Creator for VXDMeasurements with momentum estimation based on the dEdX information.

Can use different possibilities to calculate the path length needed for the dEdX calculation. Needs the transformation fit parameters fitParameters and correctionFitParameters which can be calculated using the IPython notebook Analyse_Hitwise.ipynb.

Definition at line 27 of file VXDMomentumEstimationMeasurementCreator.h.

Constructor & Destructor Documentation

◆ VXDMomentumEstimationMeasurementCreator()

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

Constructor.

Definition at line 30 of file VXDMomentumEstimationMeasurementCreator.h.

30 :
31 BaseMeasurementCreatorFromCoordinateMeasurement<HitType, detector>(measurementFactory) {}

◆ ~VXDMomentumEstimationMeasurementCreator()

virtual ~VXDMomentumEstimationMeasurementCreator ( )
inlinevirtual

Desctructor.

Definition at line 34 of file VXDMomentumEstimationMeasurementCreator.h.

34{ }

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 ,
genfit::AbsMeasurement *  coordinateMeasurement 
) const
inlineoverrideprotectedvirtual

Create a measurement based on the momentum estimation given by the VXDMomentumEstimation class.

Implements BaseMeasurementCreatorFromCoordinateMeasurement< HitType, detector >.

Definition at line 74 of file VXDMomentumEstimationMeasurementCreator.h.

77 {
78 genfit::PlanarMeasurement* planarMeasurement = dynamic_cast<genfit::PlanarMeasurement*>(coordinateMeasurement);
79 if (planarMeasurement == nullptr) {
80 B2FATAL("Can only add VXD hits which are based on PlanarMeasurements with momentum estimation!");
81 // Make CPP check happy
82 return {};
83 }
84
85 const ROOT::Math::XYZVector& momentum = recoTrack.getMomentumSeed();
86
87 if (momentum.R() > m_minimumMomentum) {
88 return {};
89 }
90
91 // cppcheck-suppress nullPointerRedundantCheck
92 PlanarVXDMomentumMeasurement<HitType>* momentumMeasurement = new PlanarVXDMomentumMeasurement<HitType>(*planarMeasurement, hit,
93 &recoTrack);
94 momentumMeasurement->setCorrectionFitParameters(m_correctionFitParameters);
95 momentumMeasurement->setFitParameters(m_fitParameters);
96 momentumMeasurement->setSigma(m_sigma);
97 momentumMeasurement->setUseMCInformation(m_useMCInformation);
98 momentumMeasurement->setUseThickness(m_useThickness);
99 momentumMeasurement->setUseTrackingSeeds(m_useTrackingSeeds);
100 return {momentumMeasurement};
101 }
VXDMomentumEstimation< HitType >::CorrectionFitParameters m_correctionFitParameters
Parameters for the correction function.
bool m_useMCInformation
Use the seeds of the track finder or the seeds of the MC particles.
bool m_useTrackingSeeds
Use the tracking seeds in the origin for calculating the path length rather than the current state.
VXDMomentumEstimation< HitType >::FitParameters m_fitParameters
Parameters for the main function.
double m_minimumMomentum
Minimal value for the momentum below the estimation is used.
bool m_useThickness
Use the thickness of the clusters of the path length for estimating dX.

◆ createMeasurementPoints()

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

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()

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

Set the parameters of the fit functions and whether to use the thickness or not or the tracking seeds or not.

Reimplemented from BaseMeasurementCreator.

Definition at line 37 of file VXDMomentumEstimationMeasurementCreator.h.

38 {
39 if (parameterName == "minimumMomentum") {
40 m_minimumMomentum = std::stod(parameterValue);
41 } else if (parameterName == "aE") {
42 m_fitParameters.aE = std::stod(parameterValue);
43 } else if (parameterName == "bE") {
44 m_fitParameters.bE = std::stod(parameterValue);
45 } else if (parameterName == "cE") {
46 m_fitParameters.cE = std::stod(parameterValue);
47 } else if (parameterName == "dE") {
48 m_fitParameters.dE = std::stod(parameterValue);
49 } else if (parameterName == "aM") {
50 m_correctionFitParameters.aM = std::stod(parameterValue);
51 } else if (parameterName == "bM") {
52 m_correctionFitParameters.bM = std::stod(parameterValue);
53 } else if (parameterName == "cM") {
54 m_correctionFitParameters.cM = std::stod(parameterValue);
55 } else if (parameterName == "dM") {
56 m_correctionFitParameters.dM = std::stod(parameterValue);
57 } else if (parameterName == "useMCInformation") {
58 m_useMCInformation = std::stoi(parameterValue);
59 } else if (parameterName == "useThickness") {
60 m_useThickness = std::stoi(parameterValue);
61 } else if (parameterName == "sigma") {
62 m_sigma = std::stod(parameterValue);
63 } else if (parameterName == "useTrackingSeeds") {
64 m_useTrackingSeeds = std::stoi(parameterValue);
65 } else {
66 B2FATAL("A parameter with the name " << parameterName << " and the value " << parameterValue << " could not be set.");
67 }
68 }

Member Data Documentation

◆ m_correctionFitParameters

VXDMomentumEstimation<HitType>::CorrectionFitParameters m_correctionFitParameters
private

Parameters for the correction function.

Set them to zero to not use a correction function.

Definition at line 107 of file VXDMomentumEstimationMeasurementCreator.h.

◆ m_fitParameters

VXDMomentumEstimation<HitType>::FitParameters m_fitParameters
private

Parameters for the main function.

Definition at line 105 of file VXDMomentumEstimationMeasurementCreator.h.

◆ 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.

◆ m_minimumMomentum

double m_minimumMomentum = 0.1
private

Minimal value for the momentum below the estimation is used.

Definition at line 113 of file VXDMomentumEstimationMeasurementCreator.h.

◆ m_sigma

double m_sigma = 0.03
private

Sigma of the measurement.

Definition at line 115 of file VXDMomentumEstimationMeasurementCreator.h.

◆ m_useMCInformation

bool m_useMCInformation = false
private

Use the seeds of the track finder or the seeds of the MC particles.

Definition at line 109 of file VXDMomentumEstimationMeasurementCreator.h.

◆ m_useThickness

bool m_useThickness = false
private

Use the thickness of the clusters of the path length for estimating dX.

Definition at line 111 of file VXDMomentumEstimationMeasurementCreator.h.

◆ m_useTrackingSeeds

bool m_useTrackingSeeds = false
private

Use the tracking seeds in the origin for calculating the path length rather than the current state.

Definition at line 117 of file VXDMomentumEstimationMeasurementCreator.h.


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