00001 #include "LotsaGens.h"
00002 #include "Context/TimeStamp.h"
00003 #include "Event/GenHeader.h"
00004 #include "Event/SimHeader.h"
00005 #include "TString.h"
00006 #include <string>
00007
00008 using namespace DayaBay;
00009 using namespace std;
00010
00011
00012 LotsaGens::LotsaGens(const std::string& name, ISvcLocator* pSvcLocator)
00013 : GaudiAlgorithm(name,pSvcLocator)
00014 , m_count(0)
00015 {
00016 }
00017
00018 LotsaGens::~LotsaGens()
00019 {
00020 }
00021
00022 StatusCode LotsaGens::initialize()
00023 {
00024 return StatusCode::SUCCESS;
00025 }
00026
00027 StatusCode LotsaGens::execute()
00028 {
00029 ++m_count;
00030
00031 vector<GenHeader*> genheaders;
00032
00033 info() << "Making LotsaGens at " << m_count << endreq;
00034 for (int ind=0; ind<10; ++ind) {
00035 GenHeader* gh = new GenHeader();
00036 gh->setGeneratorName(Form("Lotsa%d",ind));
00037 gh->setExecNumber(m_count);
00038 gh->setTimeStamp(TimeStamp(m_count,ind));
00039 this->put(gh,Form("/Event/Gen/GenHeader%d",ind));
00040 genheaders.push_back(gh);
00041 }
00042
00043 for (int ind=0; ind<10; ++ind) {
00044 SimHeader* sh = new SimHeader();
00045 sh->addInputHeader(genheaders[ind]);
00046 sh->setExecNumber(m_count);
00047 sh->setTimeStamp(TimeStamp(m_count,ind*10));
00048 this->put(sh,Form("/Event/Sim/SimHeader%d",ind));
00049 }
00050 return StatusCode::SUCCESS;
00051 }
00052
00053 StatusCode LotsaGens::finalize()
00054 {
00055 return StatusCode::SUCCESS;
00056 }
00057