16#include "G4Svc/AthenaHepMCtoG4EventAction.h"
18#include "HepMC/GenEvent.h"
21#include "G4UImanager.hh"
24#include "G4PrimaryParticle.hh"
25#include "G4PrimaryVertex.hh"
26#include "G4LorentzVector.hh"
27#include "G4Geantino.hh"
29#include "GaudiKernel/IMessageSvc.h"
38m_logLevel( int(MSG::
INFO) ) {
50 if ( m_logLevel <=
int(MSG::DEBUG) ) {
51 std::cout <<
"AthenaHepMCtoG4EventAction: - Setting HepMC Event ptr"
154 if ( m_logLevel <=
int(MSG::DEBUG) ) {
155 std::cout <<
"AthenaHepMCtoG4EventAction: - Generating Primaries"
160 p_evt = (
const HepMC::GenEvent *)(*p_evtCollItr);
165 if ( m_logLevel <=
int(MSG::WARNING) ) {
166 std::cout <<
"AthenaHepMCtoG4EventAction: - HepMC ptr == null"
174 G4PrimaryVertex* vertex =
new G4PrimaryVertex(0.,0.,0.,0.);
177 for ( HepMC::GenEvent::vertex_const_iterator
v = p_evt->vertices_begin();
178 v != p_evt->vertices_end(); ++
v ) {
180 for (HepMC::GenVertex::particle_iterator it=
181 (*v)->particles_begin(HepMC::children);
182 it!=(*v)->particles_end(HepMC::children);
185 if (!(*it)->end_vertex() && (*it)->status()==1 ) {
195 for (HepMC::GenVertex::particle_iterator it=
196 (*v)->particles_begin(HepMC::children);
197 it!=(*v)->particles_end(HepMC::children);
200 if ( (*it)->status() != 1)
continue;
202 int pdgcode=(*it)->pdg_id();
214 const G4ThreeVector& p=(*it)->momentum();
215 G4PrimaryParticle *part;
217 part=
new G4PrimaryParticle (pdgcode,p.x()*GeV,p.y()*GeV,p.z()*GeV);
219 G4ParticleDefinition *pdef = G4Geantino::GeantinoDefinition();
220 part=
new G4PrimaryParticle (pdef,p.x()*GeV,p.y()*GeV,p.z()*GeV);
223 vertex->SetPosition((*v)->position().x(),
224 (*v)->position().y(),
225 (*v)->position().z());
226 vertex->SetT0((*v)->position().t());
228 vertex->SetPrimary(part);
234 anEvent->AddPrimaryVertex(vertex);
236 if ( m_logLevel <=
int(MSG::DEBUG) ) {
237 std::cout <<
"AthenaHepMCtoG4EventAction: - done. G4Event has "
238 <<
n <<
" particles. "
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
void GeneratePrimaries(G4Event *anEvent)
AthenaHepMCtoG4EventAction()
~AthenaHepMCtoG4EventAction()
void SetHepMCEvent(McEventCol::iterator)