// $Id$ // // File: DChargedTrack_factory.cc // Created: Thu Dec 3 17:27:55 EST 2009 // Creator: staylor (on Linux ifarml6 2.6.18-128.el5 x86_64) // #include #include using namespace std; #include "DChargedTrack_factory.h" using namespace jana; //------------------ // init //------------------ jerror_t DChargedTrack_factory::init(void) { return NOERROR; } //------------------ // brun //------------------ jerror_t DChargedTrack_factory::brun(jana::JEventLoop *locEventLoop, int runnumber) { return NOERROR; } //------------------ // evnt //------------------ jerror_t DChargedTrack_factory::evnt(jana::JEventLoop *locEventLoop, int eventnumber) { vector locChargedTrackHypotheses; locEventLoop->Get(locChargedTrackHypotheses); map > locHypothesesByTrackID; for(size_t loc_i = 0; loc_i < locChargedTrackHypotheses.size(); loc_i++) locHypothesesByTrackID[locChargedTrackHypotheses[loc_i]->candidateid].push_back(locChargedTrackHypotheses[loc_i]); map >::iterator locIterator = locHypothesesByTrackID.begin(); for(; locIterator != locHypothesesByTrackID.end(); ++locIterator) { DChargedTrack* locChargedTrack = new DChargedTrack(); locChargedTrack->dChargedTrackHypotheses = locIterator->second; _data.push_back(locChargedTrack); } return NOERROR; } //------------------ // erun //------------------ jerror_t DChargedTrack_factory::erun(void) { return NOERROR; } //------------------ // fini //------------------ jerror_t DChargedTrack_factory::fini(void) { return NOERROR; }