Belle II Software  release-08-01-10
BaseMeasurementCreatorFromCoordinateMeasurement.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 <tracking/trackFitting/measurementCreator/creators/BaseMeasurementCreatorFromHit.h>
11 
12 namespace Belle2 {
23  template <class HitType, Const::EDetector detector>
25  public:
26 
29  measurementFactory) :
30  BaseMeasurementCreatorFromHit<HitType, detector>(measurementFactory) {}
31 
33  std::vector<genfit::TrackPoint*> createMeasurementPoints(HitType* hit, RecoTrack& recoTrack,
34  const RecoHitInformation& recoHitInformation) const override
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  }
52 
55 
56  protected:
66  virtual std::vector<genfit::AbsMeasurement*> createMeasurementFromCoordinateMeasurement(HitType* hit,
67  const RecoTrack& recoTrack, const RecoHitInformation& recoHitInformation,
68  genfit::AbsMeasurement* coordinateMeasurement) const = 0;
69 
70  };
72 }
Baseclass to create measurement track points based on the coordinate measurements.
std::vector< genfit::TrackPoint * > createMeasurementPoints(HitType *hit, RecoTrack &recoTrack, const RecoHitInformation &recoHitInformation) const override
Create measurements based on coordinate measurements.
BaseMeasurementCreatorFromCoordinateMeasurement(const genfit::MeasurementFactory< genfit::AbsMeasurement > &measurementFactory)
Needs the genfit MeasurementFactory for this.
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.
Base Class to create measurements based on a given hit related to the RecoTrack.
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.
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for different kinds of events.