ATLAS Offline Software
DetailedTrackTruthCollectionCnv_p3.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // T/P converter for DetailedTrackTruthCollection.
6 //
7 // Andrei Gaponenko <agaponenko@lbl.gov>, 2008
8 // Olivier.Arnaez@cern.ch, 2015
9 
11 
14 
17 
18 #include "StoreGate/StoreGateSvc.h"
19 
21 
22 namespace {
23  const DataLinkCnv_p1<DataLink<TrackCollection> > dataLinkConverter;
24  const DetailedTrackTruthCnv_p3 detailedTruthConverter;
25 }
26 
29  MsgStream& msg )
30 {
31  msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::persToTrans(): PERS size = "<<pers->m_entries.size()<<endmsg;
32 
33  trans->clear();
34 
35  dataLinkConverter.persToTrans(pers->m_trackCollectionLink, TrackTruthCollectionAccessor::trackCollectionLink(trans), msg);
36 
37  for(Trk::DetailedTrackTruthCollection_p3::CollectionType::const_iterator i=pers->m_entries.begin(); i!=pers->m_entries.end(); ++i) {
39  detailedTruthConverter.persToTrans(&i->detailedTruth, &dt, msg);
40  trans->insert(trans->end(), std::make_pair(i->key.m_index, dt) );
41  }
42 
43  msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::persToTrans() DONE"<<endmsg;
44 }
45 
48  MsgStream& msg )
49 {
50  msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers()"<<endmsg;
51  msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers(): input size = "<<trans->size()<<endmsg;
52 
53  dataLinkConverter.transToPers(trans->trackCollectionLink(), pers->m_trackCollectionLink, msg);
54 
55  pers->m_entries.resize(trans->size());
56  Trk::DetailedTrackTruthCollection_p3::CollectionType::size_type ipers(0);
57 
58  for(DetailedTrackTruthCollection::const_iterator itrans=trans->begin(); itrans!=trans->end(); ++itrans, ++ipers) {
60  current.key.m_index = itrans->first.index(); // extract index from ElementLink
61  detailedTruthConverter.transToPers(&itrans->second, &current.detailedTruth, msg);
62  }
63 
64  msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers() DONE"<<endmsg;
65 }
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
DataLinkCnv_p1.h
This file contains the class definition for the DataLinkCnv_p1 class and DataLinkVectorCnv_p1 class.
DetailedTrackTruthCollectionCnv_p3::persToTrans
virtual void persToTrans(const Trk::DetailedTrackTruthCollection_p3 *persObj, DetailedTrackTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::DetailedTrackTruthCollection from its persi...
Definition: DetailedTrackTruthCollectionCnv_p3.cxx:27
Trk::DetailedTrackTruthCollection_p3::m_trackCollectionLink
DataLink_p1 m_trackCollectionLink
Definition: DetailedTrackTruthCollection_p3.h:27
Trk::DetailedTrackTruthCollection_p3::Entry
Definition: DetailedTrackTruthCollection_p3.h:32
DetailedTrackTruthCollection.h
Trk::DetailedTrackTruthCollection_p3
Definition: DetailedTrackTruthCollection_p3.h:24
TrackTruthCollectionAccessor::trackCollectionLink
static DataLink< TrackCollection > & trackCollectionLink(TrackTruthCollection *truthColl)
Definition: TrackTruthCollectionAccessor.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
DetailedTrackTruthCnv_p3
Definition: DetailedTrackTruthCnv_p3.h:24
Trk::DetailedTrackTruthCollection_p3::m_entries
CollectionType m_entries
Definition: DetailedTrackTruthCollection_p3.h:38
DetailedTrackTruth
Definition: DetailedTrackTruth.h:16
DetailedTrackTruthCnv_p3.h
TrackTruthCollectionAccessor.h
DetailedTrackTruthCollectionCnv_p3::transToPers
virtual void transToPers(const DetailedTrackTruthCollection *transObj, Trk::DetailedTrackTruthCollection_p3 *persObj, MsgStream &msg)
Method creating the persistent representation DetailedTrackTruthCollection_p3 from its transient repr...
Definition: DetailedTrackTruthCollectionCnv_p3.cxx:46
DetailedTrackTruthCollection::trackCollectionLink
DataLink< TrackCollection > trackCollectionLink() const
Definition: DetailedTrackTruthCollection.h:25
DEBUG
#define DEBUG
Definition: page_access.h:11
DetailedTrackTruthCollection
Definition: DetailedTrackTruthCollection.h:20
DetailedTrackTruthCollection_p3.h
StoreGateSvc.h
DetailedTrackTruthCollectionCnv_p3.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
DataLinkCnv_p1
Definition: DataLinkCnv_p1.h:23