ATLAS Offline Software
TrigInDetTrackTruthMapCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
10 
12 //static TrigInDetTrackTruthCnv_p1 trigInDetTrackTruthCnv;
13 
14 
15 //-----------------------------------------------------------------------------
16 // Persistent to transient
17 //-----------------------------------------------------------------------------
19  TrigInDetTrackTruthMap *transObj,
20  MsgStream &log )
21 {
22  log << MSG::DEBUG << "TrigInDetTrackTruthMapCnv_p1::persToTrans called " << endmsg;
23 
24  transObj->m_elink_vec.clear();
25  trackVectCnv.persToTrans(&persObj->m_elink_vec, &transObj->m_elink_vec, log);
26 
27  int n_tracks = (persObj->m_truth_vec).size();
28  transObj->m_truth_vec.clear();
29  transObj->m_truth_vec.resize( n_tracks );
30 
31  int index=0;
32  for(std::vector<TPObjRef>::const_iterator it = persObj->m_truth_vec.begin();
33  it!=persObj->m_truth_vec.end();++it)
34  {
36  index++;
37  }
38 }
39 
40 //-----------------------------------------------------------------------------
41 // Transient to persistent
42 //-----------------------------------------------------------------------------
45  MsgStream &log )
46 {
47  log << MSG::DEBUG << "TrigInDetTrackTruthMapCnv_p1::transToPers called " << endmsg;
48 
49  trackVectCnv.transToPers(&transObj->m_elink_vec, &persObj->m_elink_vec, log);
50 
51  int n_tracks = transObj->m_truth_vec.size();
52  persObj->m_truth_vec.clear();
53  persObj->m_truth_vec.reserve( n_tracks );
54 
55  for(std::vector<TrigInDetTrackTruth>::const_iterator it = transObj->m_truth_vec.begin();
56  it!=transObj->m_truth_vec.end();++it)
57  {
58  persObj->m_truth_vec.push_back(toPersistent( &m_trigInDetTrackTruthCnv, &(*it), log ));
59  }
60 
61 }
TrigInDetTrackTruthMap_p1::m_elink_vec
ElementLinkIntVector_p1 m_elink_vec
Definition: TrigInDetTrackTruthMap_p1.h:46
index
Definition: index.py:1
ElementLinkVectorCnv_p1
Definition: ElementLinkVectorCnv_p1.h:28
skel.it
it
Definition: skel.GENtoEVGEN.py:423
ElementLinkVectorCnv_p1.h
This file contains the class definition for the ElementLinkVectorCnv_p1 class. NOTE: it should be inc...
ITPConverterFor::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigInDetTrackTruthMapCnv_p1::transToPers
virtual void transToPers(const TrigInDetTrackTruthMap *transObj, TrigInDetTrackTruthMap_p1 *persObj, MsgStream &log)
Definition: TrigInDetTrackTruthMapCnv_p1.cxx:43
ElementLinkVector::clear
void clear()
Definition: AthLinks/ElementLinkVector.h:341
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigInDetTrackTruthMap
Definition: TrigInDetTrackTruthMap.h:38
TrigInDetTrackTruthMap::m_elink_vec
ElementLinkVector< TrigInDetTrackCollection > m_elink_vec
Definition: TrigInDetTrackTruthMap.h:103
ITPConverterFor::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
TrigInDetTrackTruthMap_p1
Definition: TrigInDetTrackTruthMap_p1.h:23
TrigInDetTrackTruthMap.h
TrigInDetTrackTruthMapCnv_p1.h
TrigInDetTrackTruthMapCnv_p1::persToTrans
virtual void persToTrans(const TrigInDetTrackTruthMap_p1 *persObj, TrigInDetTrackTruthMap *transObj, MsgStream &log)
Definition: TrigInDetTrackTruthMapCnv_p1.cxx:18
TrigInDetTrackTruthMapCnv_p1::m_trigInDetTrackTruthCnv
ITPConverterFor< TrigInDetTrackTruth > * m_trigInDetTrackTruthCnv
Definition: TrigInDetTrackTruthMapCnv_p1.h:41
TrigInDetTrackTruthMap::m_truth_vec
std::vector< TrigInDetTrackTruth > m_truth_vec
Definition: TrigInDetTrackTruthMap.h:104
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigInDetTrackTruthCnv_p1.h
TrigInDetTrackTruthMap_p1::m_truth_vec
std::vector< TPObjRef > m_truth_vec
Definition: TrigInDetTrackTruthMap_p1.h:47