ATLAS Offline Software
Loading...
Searching...
No Matches
HepMcParticleLinkCnv_p3.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7// Framework includes
8#include "GaudiKernel/MsgStream.h"
10
12
13
31
33 HepMcParticleLink_p3* persObj,
34 MsgStream &msg ) const
35{
36 // In the case that the standard production workflow is being used
37 // then the first event in the McEventCollection is the only one
38 // where the eventIndex could exceed the maximum value of unsigned
39 // short. In this case we can work around the issue by using an
40 // m_mcEvtIndex of zero as a special case, in which m_mcEvtIndex
41 // should be interpreted as the position in the McEventCollection
42 // rather than the value of GenEvent::event_number().
44 unsigned short index{0};
45 const HepMcParticleLink::index_type position =
47 proxy).at(0);
48 if (position!=0) {
49 index = transObj->eventIndex();
50 if(transObj->eventIndex()!=static_cast<HepMcParticleLink::index_type>(index)) {
51 msg << MSG::WARNING << "Attempting to persistify an eventIndex larger than max unsigned short!" << endmsg;
52 }
53 }
54 persObj->m_mcEvtIndex = index;
55 persObj->m_id = transObj->id();
56 persObj->m_truthSupp = transObj->getTruthSuppressionTypeAsChar();
57}
58
#define endmsg
virtual void transToPers(const HepMcParticleLink *transObj, HepMcParticleLink_p3 *persObj, MsgStream &msg) const override
Method creating the persistent representation HepMcParticleLink_p3 from its transient representation ...
virtual void persToTrans(const HepMcParticleLink_p3 *persObj, HepMcParticleLink *transObj, MsgStream &msg) const override
Method creating the transient representation of HepMcParticleLink from its persistent representation ...
IProxyDict * proxyDictFromEventContext()
Return the IProxyDict for this thread's current context.
Definition index.py:1
Some out-of-line helpers for ExtendedEventContext.
MsgStream & msg
Definition testRead.cxx:32