ATLAS Offline Software
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"
17 #include "StoreGate/StoreGateSvc.h"
18 
20 
21 namespace {
22  HepMcParticleLinkCnv_p1 particleLinkConverter;
23 }
24 
26  TrackTruthCollection* trans,
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 }
TrackTruthVector
Definition: TrackTruthCollection_p0.h:24
TrackTruthCollection
Definition: TrackTruthCollection.h:21
TrackTruthCollection.h
TrackTruthCollectionAccessor::trackCollectionLink
static DataLink< TrackCollection > & trackCollectionLink(TrackTruthCollection *truthColl)
Definition: TrackTruthCollectionAccessor.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrackTruthCollection_p0.h
HepMcParticleLinkCnv_p1.h
HepMcParticleLinkCnv_p1
Definition: HepMcParticleLinkCnv_p1.h:33
TrackTruthCollectionCnv_p0::persToTrans
virtual void persToTrans(const Trk::TrackTruthCollection_p0 *persObj, TrackTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::TrackTruthCollection from its persistent re...
Definition: TrackTruthCollectionCnv_p0.cxx:25
TrackTruthCollectionCnv_p0.h
TrackTruthCollectionAccessor.h
DEBUG
#define DEBUG
Definition: page_access.h:11
StoreGateSvc.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrackTruthCollectionCnv_p0::transToPers
virtual void transToPers(const TrackTruthCollection *transObj, Trk::TrackTruthCollection_p0 *persObj, MsgStream &msg)
Method creating the persistent representation TrackTruthCollection_p0 from its transient representati...
Definition: TrackTruthCollectionCnv_p0.cxx:45