153{
154 if ( m_logLevel <= int(MSG::DEBUG) ) {
155 std::cout << "AthenaHepMCtoG4EventAction: - Generating Primaries"
156 << std::endl;
157 }
158
159
160 p_evt = (const HepMC::GenEvent *)(*p_evtCollItr);
161
162
163 if (p_evt == 0) {
164
165 if ( m_logLevel <= int(MSG::WARNING) ) {
166 std::cout << "AthenaHepMCtoG4EventAction: - HepMC ptr == null"
167 << std::endl;
168 }
169
170 return;
171
172 }
173
174 G4PrimaryVertex* vertex = new G4PrimaryVertex(0.,0.,0.,0.);
175
177 for ( HepMC::GenEvent::vertex_const_iterator
v = p_evt->vertices_begin();
178 v != p_evt->vertices_end(); ++
v ) {
179 bool IsGood=false;
180 for (HepMC::GenVertex::particle_iterator it=
181 (*v)->particles_begin(HepMC::children);
182 it!=(*v)->particles_end(HepMC::children);
183 it++) {
184
185 if (!(*it)->end_vertex() && (*it)->status()==1 ) {
186 IsGood=true;
187 break;
188 }
189 }
190
191 if (IsGood) {
192
193
194
195 for (HepMC::GenVertex::particle_iterator it=
196 (*v)->particles_begin(HepMC::children);
197 it!=(*v)->particles_end(HepMC::children);
198 it++) {
199
200 if ( (*it)->status() != 1) continue;
201
202 int pdgcode=(*it)->pdg_id();
203
204
205
206
207
208
209
210
211
212
213
214 const G4ThreeVector& p=(*it)->momentum();
215 G4PrimaryParticle *part;
216 if (pdgcode!=999) {
217 part=new G4PrimaryParticle (pdgcode,p.x()*GeV,p.y()*GeV,p.z()*GeV);
218 } else {
219 G4ParticleDefinition *pdef = G4Geantino::GeantinoDefinition();
220 part=new G4PrimaryParticle (pdef,p.x()*GeV,p.y()*GeV,p.z()*GeV);
221 }
222
223 vertex->SetPosition((*v)->position().x(),
224 (*v)->position().y(),
225 (*v)->position().z());
226 vertex->SetT0((*v)->position().t());
227
228 vertex->SetPrimary(part);
229
231 }
232 }
233 }
234 anEvent->AddPrimaryVertex(vertex);
235
236 if ( m_logLevel <= int(MSG::DEBUG) ) {
237 std::cout << "AthenaHepMCtoG4EventAction: - done. G4Event has "
238 <<
n <<
" particles. "
239 << std::endl;
240 }
241
242 p_evtCollItr++;
243
244}
**********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