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