//modified by Elisabetta Prencipe 19/5/2014 #ifndef PNDSTTRECOHITPRODUCER_H #define PNDSTTRECOHITPRODUCER_H #include #include #include #include #include "TClonesArray.h" #include "Exception.h" #include "TrackCandHit.h" #include "MeasurementProducer.h" #include "AbsMeasurement.h" template class PndSttRecoHitProducer : public genfit::AbsMeasurementProducer { private: TClonesArray* hitArrayTClones; TClonesArray* tubeArrayTClones; public: PndSttRecoHitProducer(TClonesArray*, TClonesArray*); virtual ~PndSttRecoHitProducer(); virtual genfit::AbsMeasurement* produce(int index, const genfit::TrackCandHit* hit); }; template PndSttRecoHitProducer::PndSttRecoHitProducer(TClonesArray* theArr, TClonesArray* theTubeArr) { hitArrayTClones = theArr; tubeArrayTClones = theTubeArr; } template PndSttRecoHitProducer::~PndSttRecoHitProducer() { } template genfit::AbsMeasurement* PndSttRecoHitProducer::produce(int index, const genfit::TrackCandHit* hit) { assert(hitArrayTClones!=NULL); assert(tubeArrayTClones!=NULL); if(hitArrayTClones->At(index) == 0) { genfit::Exception e("In PndSttRecoHitProducer: index for hit in TClonesArray out of bounds",__LINE__,__FILE__); e.setFatal(); throw e; } return ( new measurement_T( (hit_T*) hitArrayTClones->At(index), hit, tubeArrayTClones ) ); } #endif