7 __doc__ =
'''Re-order the McEventCollection so the first GenEvent is the signal event.
8 IMPORTANT : this alg must be run before any other algs invoking TruthParticleCnvToolContainer.
11 __version__ =
'$Revision: 1.5 $'
12 __author__ =
'P-A Delsart'
14 import AthenaPython.PyAthena
as PyAthena
15 from AthenaPython.PyAthena
import StatusCode
20 def __init__(self, name='FixMcEventCollection', **kw):
23 super(FixMcEventCollection, self).
__init__(**kw)
30 self.
msg.
info(
'==> initialize...')
31 self.
sg = PyAthena.py_svc (
'StoreGateSvc')
32 return StatusCode.Success
38 mcevt0 = sg.retrieve(
'McEventCollection',
"GEN_AOD")
42 if genEvt.particles_size()>1:
43 return StatusCode.Success
48 if evt.particles_size()>1:
53 etmp = ROOT.HepMC.GenEvent()
54 correctOrder = [sigEvt] + puEvts
55 for i, e
in enumerate(correctOrder):
56 mcevt0.swapElement(i,e,etmp)
58 return StatusCode.Success
61 self.
msg.
info(
'==> finalize...')
62 return StatusCode.Success