Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:24

0001 #ifndef FastSimulation_TrackingRecHitProducer_TrackingRecHitPipe_H
0002 #define FastSimulation_TrackingRecHitProducer_TrackingRecHitPipe_H
0003 
0004 #include "FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h"
0005 #include "FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitProduct.h"
0006 
0007 #include <vector>
0008 
0009 class TrackingRecHitPipe {
0010 protected:
0011   std::vector<TrackingRecHitAlgorithm*> _algorithms;
0012 
0013 public:
0014   TrackingRecHitPipe() {}
0015 
0016   TrackingRecHitProductPtr produce(TrackingRecHitProductPtr product) const {
0017     for (unsigned int ialgo = 0; product && (ialgo < _algorithms.size()); ++ialgo) {
0018       product = _algorithms[ialgo]->process(product);
0019     }
0020     return product;
0021   }
0022 
0023   inline unsigned int size() const { return _algorithms.size(); }
0024 
0025   inline void addAlgorithm(TrackingRecHitAlgorithm* algorithm) { _algorithms.push_back(algorithm); }
0026 };
0027 
0028 #endif