5#include "BesGenModule/BesGenModule.h"
6#include "GeneratorModule/GeneratorName.h"
9#include "GaudiKernel/MsgStream.h"
10#include "GaudiKernel/DataSvc.h"
11#include "GaudiKernel/SmartDataPtr.h"
18#include "GeneratorObject/McGenEvent.h"
19#include "McTruth/DecayMode.h"
22#include "HepMC/GenEvent.h"
26#include "HepMC/IO_HEPEVT.h"
28#include "HepMC/HEPEVT_Wrapper.h"
29#include "McTruth/McEvent.h"
32#include "GeneratorObject/McGenEvent.h"
33#include "GeneratorUtil/StringParse.h"
39#include "GaudiKernel/ISvcLocator.h"
40#include "GaudiKernel/Bootstrap.h"
41#include "GaudiKernel/IDataProviderSvc.h"
42#include "BesKernel/IBesRndmGenSvc.h"
46#include "CLHEP/Random/RandFlat.h"
63using HepMC::IO_HEPEVT;
64using HepMC::HEPEVT_Wrapper;
74 ISvcLocator* pSvcLocator):
GenModule(name,pSvcLocator)
80 declareProperty(
"Runcards",
runname =
"run.cards");
81 declareProperty(
"Ratio",
Nr = 1);
107 MsgStream log(messageService(), name());
108 log << MSG::INFO <<
" BES PHOTOS INITIALISING. \n" << endreq;
112 StatusCode RndmStatus = service(
"BesRndmGenSvc",
p_BesRndmGenSvc,
true);
115 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
134 HepMC::HEPEVT_Wrapper::set_sizeof_int(4);
135 HepMC::HEPEVT_Wrapper::set_sizeof_real(4);
136 HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
139 return StatusCode::SUCCESS;
145 MsgStream log(messageService(), name());
146 log << MSG::INFO <<
" BesGenModule generating. \n" << endreq;
148 StatusCode status = StatusCode::SUCCESS;
163 StatusCode sc = eventSvc()->registerObject(
"/Event/MC",aMcEvent);
166 SmartDataPtr<DecayMode> anMcCol(eventSvc(),
"/Event/MC/DecayMode");
174 StatusCode sc = eventSvc()->registerObject(
"/Event/MC/DecayMode",decayMode);
178 SmartDataPtr<DecayMode> aMcCol(eventSvc(),
"/Event/MC/DecayMode");
192 log << MSG::INFO <<
" BESGenModule generating done. \n" << endreq;
200 MsgStream log(messageService(), name());
202 log << MSG:: INFO <<
" BESGenModule Ending... \n" << endreq;
203 return StatusCode::SUCCESS;
208 MsgStream log(messageService(), name());
209 log << MSG:: INFO <<
" BESGenModule Filling... \n" << endreq;
212 HepMC::IO_HEPEVT hepio;
213 hepio.fill_next_event(evt);
218 return StatusCode::SUCCESS;
void mainexe_(int *, int *mvec)
void mainini_(int *, const char *)
virtual StatusCode fillEvt(GenEvent *evt)
static std::string besMcGen_stream
IBesRndmGenSvc * p_BesRndmGenSvc
virtual StatusCode genInitialize()
virtual StatusCode callGenerator()
virtual StatusCode genFinalize()
BesGenModule(const std::string &name, ISvcLocator *pSvcLocator)
void putData(int *data, unsigned int size)
virtual void setGenseed(long)=0