36 #ifndef genfit_MeasurementFactory_h 37 #define genfit_MeasurementFactory_h 60 template <
class measurement_T>
63 std::map<int, AbsMeasurementProducer<measurement_T> *> hitProdMap_;
103 template <
class measurement_T>
106 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::iterator it = hitProdMap_.find(detID);
107 if (it == hitProdMap_.end()) {
108 hitProdMap_[detID] = hitProd;
110 Exception exc(
"MeasurementFactory: detID already in use", __LINE__, __FILE__);
112 std::vector<double> numbers;
113 numbers.push_back(detID);
119 template <
class measurement_T>
122 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::iterator it = hitProdMap_.begin();
123 while (it != hitProdMap_.end()) {
130 template <
class measurement_T>
133 typename std::map<int, AbsMeasurementProducer<measurement_T> *>::const_iterator it = hitProdMap_.find(detID);
135 if (it != hitProdMap_.end()) {
136 return it->second->produce(index, hit);
138 Exception exc(
"MeasurementFactory: no hitProducer for this detID available", __LINE__, __FILE__);
140 std::vector<double> numbers;
141 numbers.push_back(detID);
147 template <
class measurement_T>
150 typename std::vector<measurement_T *> hitVec;
151 unsigned int nHits = cand.
getNHits();
152 for (
unsigned int i = 0;
i < nHits;
i++) {
164 #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.