ATLAS Offline Software
TrackParticleTruthCollectionCnv_p0.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 
11 
12 #include "AthLinks/DataLink.h"
13 #include "StoreGate/StoreGateSvc.h"
14 
16 
17 namespace {
18  HepMcParticleLinkCnv_p1 particleLinkConverter;
19 }
20 
23  MsgStream& msg )
24 {
25  msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans(): PERS size = "<<pers->size()<<endmsg;
26 
27  if(pers->empty()) {
28  msg<<MSG::WARNING<<"persToTrans(): can't find out the corresponding TrackCollection for the empty TrackParticleTruthCollection_p0 (old-format)"<<endmsg;
29  }
30  else {
31  //static (const) DataLink<Rec::TrackParticleContainer> =
32  TrackParticleTruthCollectionAccessor::trackParticleContainerLink(trans) = dynamic_cast<const Rec::TrackParticleContainer*>((*pers)[0].first.getStorableObjectPointer());
33 
34  for (const auto& p : *pers) {
35  trans->insert(trans->end(), std::make_pair(p.first, p.second));
36  }
37  }
38 
39  msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans() DONE"<<endmsg;
40 }
41 
44  MsgStream& msg )
45 {
46  msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers()"<<endmsg;
47  throw std::runtime_error("TrackParticleTruthCollectionCnv_p0::transToPers() is not implemented, _p1 or later is meant to be used.");
48  //never reached msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers() DONE"<<endmsg;
49 }
TrackParticleTruthCollection.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrackParticleTruthCollectionCnv_p0::persToTrans
virtual void persToTrans(const Rec::TrackParticleTruthCollection_p0 *persObj, TrackParticleTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::TrackParticleTruthCollection from its persi...
Definition: TrackParticleTruthCollectionCnv_p0.cxx:21
HepMcParticleLinkCnv_p1.h
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
HepMcParticleLinkCnv_p1
Definition: HepMcParticleLinkCnv_p1.h:33
TrackParticleTruthCollection_p0.h
TrackParticleTruthCollectionAccessor.h
TrackParticleTruthCollection
Definition: TrackParticleTruthCollection.h:18
DEBUG
#define DEBUG
Definition: page_access.h:11
TrackParticleTruthCollectionCnv_p0.h
TrackParticleTruthVector
Definition: TrackParticleTruthVector.h:16
TrackParticleTruthCollectionCnv_p0::transToPers
virtual void transToPers(const TrackParticleTruthCollection *transObj, Rec::TrackParticleTruthCollection_p0 *persObj, MsgStream &msg)
Method creating the persistent representation TrackParticleTruthCollection_p0 from its transient repr...
Definition: TrackParticleTruthCollectionCnv_p0.cxx:42
TrackParticleTruthCollectionAccessor::trackParticleContainerLink
static DataLink< Rec::TrackParticleContainer > & trackParticleContainerLink(TrackParticleTruthCollection *truthColl)
Definition: TrackParticleTruthCollectionAccessor.h:13
StoreGateSvc.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7