ATLAS Offline Software
Loading...
Searching...
No Matches
TrackTruthCollectionCnv_p0.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// T/P converter for TrackTruthCollection.
6// Andrei Gaponenko <agaponenko@lbl.gov>, 2007
7
8
10
13
15
16#include "AthLinks/DataLink.h"
18
20
21namespace {
22 HepMcParticleLinkCnv_p1 particleLinkConverter;
23}
24
27 MsgStream& msg )
28{
29 msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p0::persToTrans(): PERS size = "<<pers->size()<<endmsg;
30
31 if(pers->empty()) {
32 msg<<MSG::WARNING<<"persToTrans(): can't find out the corresponding TrackCollection for the empty TrackTruthCollection_p0 (old-format)"<<endmsg;
33 }
34 else {
35 TrackTruthCollectionAccessor::trackCollectionLink(trans) = (*pers)[0].first.getStorableObjectPointer();
36
37 for(Trk::TrackTruthCollection_p0::const_iterator i=pers->begin(); i!=pers->end(); ++i) {
38 trans->insert(trans->end(), std::make_pair(i->first, i->second));
39 }
40 }
41
42 msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p0::persToTrans() DONE"<<endmsg;
43}
44
47 MsgStream& /* msg */ )
48{
49 throw std::runtime_error("TrackTruthCollectionCnv_p0::transToPers() is not implemented, _p1 or later is meant to be used.");
50}
#define endmsg
static DataLink< TrackCollection > & trackCollectionLink(TrackTruthCollection *truthColl)
virtual void transToPers(const TrackTruthCollection *transObj, Trk::TrackTruthCollection_p0 *persObj, MsgStream &msg)
Method creating the persistent representation TrackTruthCollection_p0 from its transient representati...
virtual void persToTrans(const Trk::TrackTruthCollection_p0 *persObj, TrackTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::TrackTruthCollection from its persistent re...
TrackTruthVector TrackTruthCollection_p0
MsgStream & msg
Definition testRead.cxx:32