39 : Algorithm(name, pSvcLocator),
41 m_pPoissonGenerator(0)
44 declareProperty(
"FixedMode",m_fixedMode=
true);
45 declareProperty(
"MeanInt",m_meanInteractions=1.0);
46 declareProperty(
"RandomSeed",m_randomSeed=1234567);
47 declareProperty(
"StripPartons",m_StripVector);
48 m_StripVector.push_back(0);
67 MsgStream log(messageService(), name());
79 IPartPropSvc* p_PartPropSvc;
82 StatusCode PartPropStatus = service(
"PartPropSvc", p_PartPropSvc);
83 if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
84 log << MSG::ERROR <<
" Could not initialize Particle Properties Service" << endreq;
85 return PartPropStatus;
94 log << MSG::INFO <<
"Standard Initialization: Single Interaction Mode "
98 log << MSG::INFO <<
"Fixed Number of Interactions per Event is: "
107 "Poisson Distribution of Interactions per Event with Mean: "
112 if (status.isFailure()) {
113 log << MSG::ERROR <<
"Could not initialize Generator properly" << endreq;
117 if (status1.isFailure()) {
118 log << MSG::ERROR <<
"Could not initialize user part properly" << endreq;
131 MsgStream log(messageService(), name());
133 log << MSG::DEBUG <<
"GenModule::execute()" << endreq;
144 for(
int i=0; i<numToGenerate; i++) {
150 GenEvent* evt =
new GenEvent(1,1);
157 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
160 MsgStream log(messageService(), name());
161 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
163 anMcCol->push_back(mcEvent);
169 mcColl->push_back(mcEvent);
171 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
173 if (sc != StatusCode::SUCCESS) {
174 MsgStream log(messageService(), name());
175 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
179 return StatusCode::FAILURE;
189 IIncidentSvc *incSvc;
190 service(
"IncidentSvc",incSvc);
191 incSvc->fireIncident( Incident( name(),
"McGenEvent Generated") );
295 for ( HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin();
296 vtx != evt->vertices_end(); ++vtx ) {
298 for ( HepMC::GenVertex::particle_iterator p = (*vtx)-> particles_begin(HepMC::children);
299 p != (*vtx)->particles_end(HepMC::children);
304 if ( (*p)->end_vertex() ) (*p)->end_vertex()->remove_particle(*p);
305 if ( (*p)->production_vertex() ) (*p)->production_vertex()->remove_particle(*p);
310 for ( HepMC::GenVertex::particle_iterator p = (*vtx)-> particles_begin(HepMC::parents);
311 p != (*vtx)->particles_end(HepMC::parents);
316 if ( (*p)->end_vertex() ) (*p)->end_vertex()->remove_particle(*p);
317 if ( (*p)->production_vertex() ) (*p)->production_vertex()->remove_particle(*p);