Belle II Software  release-08-01-10
MeasurementFactory< measurement_T > Class Template Reference

Factory object to create AbsMeasurement objects from digitized and clustered data. More...

#include <MeasurementFactory.h>

Collaboration diagram for MeasurementFactory< measurement_T >:

Public Member Functions

void addProducer (int detID, AbsMeasurementProducer< measurement_T > *hitProd)
 Register a producer module to the factory. More...
 
void clear ()
 Clear all hit producers.
 
measurement_T * createOne (int detID, int index, const TrackCandHit *hit) const
 Create a Measurement. More...
 
std::vector< measurement_T * > createMany (const TrackCand &cand) const
 Create a collection of Measurements. More...
 

Private Attributes

std::map< int, AbsMeasurementProducer< measurement_T > * > hitProdMap_
 

Detailed Description

template<class measurement_T>
class genfit::MeasurementFactory< measurement_T >

Factory object to create AbsMeasurement objects from digitized and clustered data.

The MeasurementFactory is used to automatically fill Track objects with hit data. For each detector type used an AbsMeasurementProducer has to be registered in the factory. The factory can then use the index information from a TrackCand object to load the indexed hits into the Track.

See also
AbsMeasurementProducer
TrackCand

Definition at line 51 of file MeasurementFactory.h.

Member Function Documentation

◆ addProducer()

void addProducer ( int  detID,
AbsMeasurementProducer< measurement_T > *  hitProd 
)

Register a producer module to the factory.

For each type of hit a separate producer is needed. The type of hit is identified by the detector ID (detID). This index corresponds to the detector ID that is stored in the TrackCand.

Definition at line 97 of file MeasurementFactory.h.

97  {
98  typename std::map<int, AbsMeasurementProducer<measurement_T>*>::iterator it = hitProdMap_.find(detID);
99  if(it == hitProdMap_.end()) {
100  hitProdMap_[detID] = hitProd;
101  } else {
102  Exception exc("MeasurementFactory: detID already in use",__LINE__,__FILE__);
103  exc.setFatal();
104  std::vector<double> numbers;
105  numbers.push_back(detID);
106  exc.setNumbers("detID",numbers);
107  throw exc;
108  }
109 }

◆ createMany()

std::vector< measurement_T * > createMany ( const TrackCand cand) const

Create a collection of Measurements.

This is the standard way to prepare the hit collection for a Track. The resulting collection can contain hits from several detectors. The order of the hits is the same as in the TrackCand. It is assumed that this order is already along the Track.

Measurements have to implement a constructor which takes the cluster object from which the Measurement is built as the only parameter.

See also
AbsMeasurementProducer

Definition at line 138 of file MeasurementFactory.h.

◆ createOne()

measurement_T * createOne ( int  detID,
int  index,
const TrackCandHit hit 
) const

Create a Measurement.

Measurements have to implement a Constructor which takes the cluster object from which the Measurement is built as the only parameter.

See also
AbsMeasurementProducer

Definition at line 122 of file MeasurementFactory.h.


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