29 athena> it = mc.particles_begin() # GenEvent::particles_begin() and _end() give ietrators
30 athena> itE = mc.particles_end()
31 athena> while (it != itE): # loop over all particles
32 ... p = it.next() # dereference and increment the ietrator
33 ... print p.pdg_id()
34 ... # just hit return key
35
36
37 **Note:** Some methods of GenEvent_/GenVertex_, e.g., particles_begin(), give an iterator. One may use it like as a python iterator. But don't try 'for i in iterator:'. It should cause a crash since an iterator of C++ doesn't know it's boundary.