ATLAS Offline Software
TrigInDetTrackTruthCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
9 
11  TrigInDetTrackTruth* transObj,
12  MsgStream &log)
13 {
14  log << MSG::DEBUG << "TrigInDetTrackTruthCnv_p1::persToTrans called " << endmsg;
15 
16  transObj->m_best_match_hits = persObj->best_match_hits ;
17  transObj->m_best_Si_match_hits = persObj->best_Si_match_hits ;
18  transObj->m_best_TRT_match_hits = persObj->best_TRT_match_hits;
19 
20  //convert m_true_part_vec
21 
22  int n_true_part = persObj->m_true_part_vec.size();
23  transObj->m_true_part_vec.clear();
24  transObj->m_true_part_vec.resize( n_true_part );
25  int index=0;
26  for(std::vector<TPObjRef>::const_iterator it = persObj->m_true_part_vec.begin();
27  it!=persObj->m_true_part_vec.end();++it)
28  {
30  index++;
31  }
32  //convert m_nr_common_hits
33  int n_hits = (persObj->m_nr_common_hits).size();
34  transObj->m_nr_common_hits.clear();
35  transObj->m_nr_common_hits.resize( n_hits );
36  index=0;
37  for(std::vector<TPObjRef>::const_iterator it = persObj->m_nr_common_hits.begin();
38  it!=persObj->m_nr_common_hits.end();++it)
39  {
41  index++;
42  }
43 
44  //convert m_family_tree
45 
46  transObj->m_family_tree = persObj->m_family_tree;
47 
48 }
49 
50 
52  TrigInDetTrackTruth_p1* persObj,
53  MsgStream &log)
54 {
55  log << MSG::DEBUG << "TrigInDetTrackTruthCnv_p1::transToPers called " << endmsg;
56 
57 
58  persObj->best_match_hits = transObj->m_best_match_hits ;
59  persObj->best_Si_match_hits = transObj->m_best_Si_match_hits ;
60  persObj->best_TRT_match_hits = transObj->m_best_TRT_match_hits;
61 
62  //convert m_true_part_vec
63 
64  int n_true_part = transObj->m_true_part_vec.size();
65  persObj->m_true_part_vec.clear();
66  persObj->m_true_part_vec.reserve( n_true_part );
67 
68  for(std::vector<HepMcParticleLink>::const_iterator it = transObj->m_true_part_vec.begin();
69  it!=transObj->m_true_part_vec.end();++it)
70  {
71  persObj->m_true_part_vec.push_back(toPersistent( &m_hepMcParticleLinkCnv_p1, &(*it), log ));
72  }
73 
74  //convert m_nr_common_hits
75  int n_hits = (transObj->m_nr_common_hits).size();
76  persObj->m_nr_common_hits.clear();
77  persObj->m_nr_common_hits.reserve( n_hits );
78 
79  for(std::vector<TrigIDHitStats>::const_iterator it = transObj->m_nr_common_hits.begin();
80  it!=transObj->m_nr_common_hits.end();++it)
81  {
82  persObj->m_nr_common_hits.push_back(toPersistent( &m_trigIDHitStatsCnv_p1, &(*it), log ));
83  }
84 
85  //convert m_family_tree
86  persObj->m_family_tree = transObj->m_family_tree;
87 
88 
89 }
TrigInDetTrackTruth::m_best_match_hits
int m_best_match_hits
Definition: TrigInDetTrackTruth.h:109
TrigInDetTrackTruth::m_true_part_vec
std::vector< HepMcParticleLink > m_true_part_vec
Definition: TrigInDetTrackTruth.h:114
TrigInDetTrackTruth_p1
Definition: TrigInDetTrackTruth_p1.h:24
index
Definition: index.py:1
TrigInDetTrackTruth_p1::m_true_part_vec
std::vector< TPObjRef > m_true_part_vec
Definition: TrigInDetTrackTruth_p1.h:42
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigInDetTrackTruth::m_family_tree
std::vector< std::pair< unsigned int, unsigned int > > m_family_tree
Definition: TrigInDetTrackTruth.h:118
TrigInDetTrackTruth::m_best_Si_match_hits
int m_best_Si_match_hits
Definition: TrigInDetTrackTruth.h:110
TrigInDetTrackTruthCnv_p1::transToPers
virtual void transToPers(const TrigInDetTrackTruth *transObj, TrigInDetTrackTruth_p1 *persObj, MsgStream &log)
Definition: TrigInDetTrackTruthCnv_p1.cxx:51
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
TrigInDetTrackTruth_p1::best_TRT_match_hits
int best_TRT_match_hits
Definition: TrigInDetTrackTruth_p1.h:40
TrigInDetTrackTruthCnv_p1::m_trigIDHitStatsCnv_p1
ITPConverterFor< TrigIDHitStats > * m_trigIDHitStatsCnv_p1
Definition: TrigInDetTrackTruthCnv_p1.h:46
TrigInDetTrackTruth.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigInDetTrackTruth_p1::best_Si_match_hits
int best_Si_match_hits
Definition: TrigInDetTrackTruth_p1.h:39
TrigInDetTrackTruth_p1::best_match_hits
int best_match_hits
Definition: TrigInDetTrackTruth_p1.h:38
TrigInDetTrackTruth
Definition: TrigInDetTrackTruth.h:36
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
TrigInDetTrackTruth_p1::m_nr_common_hits
std::vector< TPObjRef > m_nr_common_hits
Definition: TrigInDetTrackTruth_p1.h:43
TrigInDetTrackTruth::m_nr_common_hits
std::vector< TrigIDHitStats > m_nr_common_hits
Definition: TrigInDetTrackTruth.h:115
TrigInDetTrackTruthCnv_p1::m_hepMcParticleLinkCnv_p1
ITPConverterFor< HepMcParticleLink > * m_hepMcParticleLinkCnv_p1
Definition: TrigInDetTrackTruthCnv_p1.h:45
TrigInDetTrackTruthCnv_p1::persToTrans
virtual void persToTrans(const TrigInDetTrackTruth_p1 *persObj, TrigInDetTrackTruth *transObj, MsgStream &log)
Definition: TrigInDetTrackTruthCnv_p1.cxx:10
TrigInDetTrackTruth::m_best_TRT_match_hits
int m_best_TRT_match_hits
Definition: TrigInDetTrackTruth.h:111
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigInDetTrackTruthCnv_p1.h
TrigInDetTrackTruth_p1::m_family_tree
std::vector< std::pair< unsigned int, unsigned int > > m_family_tree
Definition: TrigInDetTrackTruth_p1.h:44