// $Id$ // // File: DBCAL_THit_factory.cc // Created: Thu Aug 10 14:47:17 EDT 2006 // Creator: davidl (on Darwin swire-b241.jlab.org 8.7.0 powerpc) // #include #include "DBCAL_THit_factory.h" //------------------ // evnt //------------------ jerror_t DBCAL_THit_factory::evnt(JEventLoop *loop, int eventnumber) { // _data should be emptied before this method gets called assert( _data.size() == 0 ); // Code to generate factory data goes here. Add it like: // // DBCAL_THit *myDBCAL_THit = new DBCAL_THit; // myDBCAL_THit->x = x; // myDBCAL_THit->y = y; // ... // _data.push_back(myDBCAL_THit); // // Note that the objects you create here will be deleted later // by the system and the _data vector will be cleared automatically. return NOERROR; } //------------------ // toString //------------------ const string DBCAL_THit_factory::toString(void) { // Ensure our Get method has been called so _data is up to date Get(); if(_data.size()<=0)return string(); // don't print anything if we have no data! // Put the class specific code to produce nicely formatted ASCII here. // The DFactory_base class has several methods defined to help. They // rely on positions of colons (:) in the header. Here's an example: // // printheader("row: x: y:"); // // for(int i=0; i<_data.size(); i++){ // DBCAL_THit *myDBCAL_THit = _data[i]; // // printnewrow(); // printcol("%d", i); // printcol("%1.3f", myDBCAL_THit->x); // printcol("%3.2f", myDBCAL_THit->y); // printrow(); // } // return _table; }