#include "Level3Mods/AddLargeBankModule.hh" #include "Edm/Handle.hh" #include "Edm/GenericConstHandle.hh" #include "StorableBanks/PESE_StorableBank.hh" #ifdef DEFECT_OLD_IOSTREAM_HEADERS #include #else #include # ifndef DEFECT_NO_STDLIB_NAMESPACES using std::dec; using std::cout; using std::endl; # endif #endif AddLargeBankModule::AddLargeBankModule(const char* const theName, const char* const theDescription) : AppModule(theName, theDescription), _sizeOfBankInBytes("SizeOfBankInBytes",this,1024), _debug("debug",this,false) { // Define parameters for talk-to // ----------------------------- _sizeOfBankInBytes.addDescription("\tThe size of the bank to be appended to each event."); commands()->append(&_sizeOfBankInBytes); commands()->append(&_debug); } AddLargeBankModule::~AddLargeBankModule() { } AppResult AddLargeBankModule::beginJob(AbsEvent* aJob) { return AppResult::OK; } AppResult AddLargeBankModule::beginRun(AbsEvent* aRun) { return AppResult::OK; } AppResult AddLargeBankModule::event(AbsEvent* anEvent) { // Add a bank of the required size to the event : Handle PESE_H(new PESE_StorableBank()); // Each additional bank element takes up 8 bytes : PESE_H->set_n_channels(int(_sizeOfBankInBytes.value()/8)); PESE_H->set_description("L3 Test Bank"); GenericConstHandle PESE_GCH = anEvent->append(PESE_H); return AppResult::OK; } AppResult AddLargeBankModule::endRun(AbsEvent* aRun) { return AppResult::OK; } AppResult AddLargeBankModule::endJob(AbsEvent* aJob) { return AppResult::OK; } AppResult AddLargeBankModule::abortJob(AbsEvent* aJob) { return AppResult::OK; } AppModule* AddLargeBankModule::clone(const char* cloneName) { return new AddLargeBankModule(cloneName,"this module is a clone of AddLargeBankModule"); }