24 #ifndef genfit_MeasurementFactory_h 25 #define genfit_MeasurementFactory_h 48 template <
class measurement_T>
51 std::map<int, AbsMeasurementProducer<measurement_T> *> hitProdMap_;
91 template <
class measurement_T>
94 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::iterator it = hitProdMap_.find(detID);
95 if (it == hitProdMap_.end()) {
96 hitProdMap_[detID] = hitProd;
98 Exception exc(
"MeasurementFactory: detID already in use", __LINE__, __FILE__);
100 std::vector<double> numbers;
101 numbers.push_back(detID);
107 template <
class measurement_T>
110 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::iterator it = hitProdMap_.begin();
111 while (it != hitProdMap_.end()) {
118 template <
class measurement_T>
121 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::const_iterator it = hitProdMap_.find(detID);
123 if (it != hitProdMap_.end()) {
124 return it->second->produce(index, hit);
126 Exception exc(
"MeasurementFactory: no hitProducer for this detID available", __LINE__, __FILE__);
128 std::vector<double> numbers;
129 numbers.push_back(detID);
135 template <
class measurement_T>
138 typename std::vector<measurement_T *> hitVec;
139 unsigned int nHits = cand.
getNHits();
140 for (
unsigned int i = 0;
i < nHits;
i++) {
152 #endif // genfit_MeasurementFactory_h Track candidate – seed values and indices.
void addProducer(int detID, AbsMeasurementProducer< measurement_T > *hitProd)
Register a producer module to the factory.
Factory object to create AbsMeasurement objects from digitized and clustered data.
Abstract interface class for MeasurementProducer.
void clear()
Clear all hit producers.
measurement_T * createOne(int detID, int index, const TrackCandHit *hit) const
Create a Measurement.
TrackCandHit * getHit(int i) const
void setNumbers(std::string, const std::vector< double > &)
Set list of numbers with description.
Hit object for use in TrackCand. Provides IDs and sorting parameters.
virtual ~MeasurementFactory()
unsigned int getNHits() const
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
void setFatal(bool b=true)
Set fatal flag.
std::vector< measurement_T * > createMany(const TrackCand &cand) const
Create a collection of Measurements.