// $Id$ // // File: DTOFGeometry_factory.cc // Created: Mon Jul 18 11:43:31 EST 2005 // Creator: remitche (on Linux mantrid00 2.4.20-18.8 i686) // #include "DTOFGeometry_factory.h" jerror_t DTOFGeometry_factory::init(void) { flags = PERSISTANT; DTOFGeometry *myDTOFGeometry = new DTOFGeometry; myDTOFGeometry->NLONGBARS = 40; myDTOFGeometry->NSHORTBARS = 4; myDTOFGeometry->LONGBARLENGTH = 252.0; myDTOFGeometry->SHORTBARLENGTH = 120.0; myDTOFGeometry->BARWIDTH = 6.0; _data.push_back(myDTOFGeometry); return NOERROR; } //------------------ // evnt //------------------ jerror_t DTOFGeometry_factory::evnt(JEventLoop *loop, int eventnumber) { // Code to generate factory data goes here. Add it like: // // DTOFGeometry *myDTOFGeometry = new DTOFGeometry; // myDTOFGeometry->x = x; // myDTOFGeometry->y = y; // ... // _data.push_back(myDTOFGeometry); // // 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 DTOFGeometry_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 JFactory_base class has several methods defined to help. They // rely on positions of colons (:) in the header. Here's an example: // printheader("NLONGBARS: NSHORTBARS: LONGBARLENGTH: SHORTBARLENGTH: BARWIDTH:"); for(unsigned int i=0; i<_data.size(); i++){ DTOFGeometry *myDTOFGeometry = _data[i]; printnewrow(); printcol("%d",myDTOFGeometry->NLONGBARS); printcol("%d",myDTOFGeometry->NSHORTBARS); printcol("%6.3f",myDTOFGeometry->LONGBARLENGTH); printcol("%6.3f",myDTOFGeometry->SHORTBARLENGTH); printcol("%6.3f",myDTOFGeometry->BARWIDTH); printrow(); } return _table; }