ATLAS Offline Software
TrigVertexCnv_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 
9 
10 //-----------------------------------------------------------------------------
11 // Persistent to transient
12 //-----------------------------------------------------------------------------
14  TrigVertex *transObj,
15  MsgStream &log )
16 {
17  log << MSG::DEBUG << "TrigVertexCnv_p1::persToTrans called " << endmsg;
18 
19  transObj->m_x = persObj->m_x ;
20  transObj->m_y = persObj->m_y ;
21  transObj->m_z = persObj->m_z ;
22  transObj->m_mass = persObj->m_mass ;
23  transObj->m_massVar = persObj->m_massVar ;
24  transObj->m_energyFraction = persObj->m_energyFraction ;
25  transObj->m_nTwoTracksSecVtx = persObj->m_nTwoTracksSecVtx ;
26  transObj->m_chiSquared = persObj->m_chiSquared ;
27  transObj->m_nDOF = persObj->m_nDOF ;
28  for(int i=0;i<6;i++){
29  transObj->m_cov[i] = persObj->m_cov[i] ;
30  }
31 
32  transObj->m_algId = static_cast<TrigVertex::AlgoId>(persObj->m_algId) ;
33 
35  if(!m_trackInVertexVector.empty()) {
36  if (transObj->m_tracks)
37  transObj->m_tracks->assign (m_trackInVertexVector.begin(),
38  m_trackInVertexVector.end());
39  else
40  transObj->m_tracks =
42  m_trackInVertexVector.end());
43  transObj->m_ownTracks = true;
44  }
45 }
46 
47 //-----------------------------------------------------------------------------
48 // Transient to persistent
49 //-----------------------------------------------------------------------------
51  TrigVertex_p1 *persObj ,
52  MsgStream &log )
53 {
54  log << MSG::DEBUG << "TrigVertexCnv_p1::transToPers called " << endmsg;
55 
56  persObj->m_x = transObj->m_x ;
57  persObj->m_y = transObj->m_y ;
58  persObj->m_z = transObj->m_z ;
59  persObj->m_mass = transObj->m_mass ;
60  persObj->m_massVar = transObj->m_massVar ;
61  persObj->m_energyFraction = transObj->m_energyFraction ;
62  persObj->m_nTwoTracksSecVtx = transObj->m_nTwoTracksSecVtx ;
63  persObj->m_chiSquared = transObj->m_chiSquared ;
64  persObj->m_nDOF = transObj->m_nDOF ;
65  for(int i=0;i<6;i++){
66  persObj->m_cov[i] = transObj->m_cov[i] ;
67  }
68 
69  persObj->m_algId = static_cast<TrigVertex_p1::AlgoId_p1>(transObj->m_algId) ;
70 
71  if(transObj->m_tracks!=NULL ){
72 
73  TrackInVertexList L = *(transObj->m_tracks);
74  TrackInVertexList::const_iterator iBeg = L.begin();
75  TrackInVertexList::const_iterator iEnd = L.end();
76  m_trackInVertexVector.clear();
77  m_trackInVertexVector.reserve(L.size());
78 
79  for(; iBeg != iEnd; ++iBeg){
80  m_trackInVertexVector.push_back(*iBeg);
81  }
82 
83  //TrackInVertexVector::const_iterator iVBeg = m_trackInVertexVector.begin();
84  //TrackInVertexVector::const_iterator iVEnd = m_trackInVertexVector.end();
85 
87 
88  } else {
89  log << MSG::DEBUG << "TrigVertexCnv_p1::transToPers: No tracks associated to the vertex" << endmsg;
90  }
91 
92 }
TrigVertexCnv_p1.h
TrigVertex_p1.h
TrigVertex_p1::m_energyFraction
float m_energyFraction
Definition: TrigVertex_p1.h:59
TrigVertex::m_x
double m_x
Definition: TrigVertex.h:167
TrigVertex_p1::m_massVar
float m_massVar
Definition: TrigVertex_p1.h:57
TrigVertex::m_mass
double m_mass
Definition: TrigVertex.h:167
TrigVertex_p1::m_x
float m_x
Definition: TrigVertex_p1.h:53
TrigVertex_p1::m_nDOF
int m_nDOF
Definition: TrigVertex_p1.h:62
TrigVertex::m_chiSquared
double m_chiSquared
Definition: TrigVertex.h:178
TrigVertex_p1::m_tracks
std::vector< TPObjRef > m_tracks
Definition: TrigVertex_p1.h:63
TrigVertex::m_massVar
double m_massVar
Definition: TrigVertex.h:167
TrigVertexCnv_p1::m_TrigInDetTrackVectorCnv
TrigInDetTrackVectorCnv_p1 m_TrigInDetTrackVectorCnv
Definition: TrigVertexCnv_p1.h:59
TrigVertex::m_algId
AlgoId m_algId
Definition: TrigVertex.h:181
TrigVertex_p1::m_nTwoTracksSecVtx
int m_nTwoTracksSecVtx
Definition: TrigVertex_p1.h:60
TrigVertex::m_z
double m_z
Definition: TrigVertex.h:167
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TPPtrVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:948
TPPtrVectorCnv::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:929
TrigVertex_p1
Definition: TrigVertex_p1.h:26
TrigVertex::m_nDOF
int m_nDOF
Definition: TrigVertex.h:179
TrigVertexCnv_p1::m_trackInVertexVector
TrackInVertexVector m_trackInVertexVector
Definition: TrigVertexCnv_p1.h:60
TrigVertex::m_y
double m_y
Definition: TrigVertex.h:167
TrigVertex_p1::m_chiSquared
float m_chiSquared
Definition: TrigVertex_p1.h:61
TrigVertex_p1::m_z
float m_z
Definition: TrigVertex_p1.h:55
TrigVertex::m_tracks
TrackInVertexList * m_tracks
Definition: TrigVertex.h:180
TrigVertex_p1::m_mass
float m_mass
Definition: TrigVertex_p1.h:56
TrigVertex::m_cov
double m_cov[6]
Definition: TrigVertex.h:168
TrigVertexCnv_p1::persToTrans
virtual void persToTrans(const TrigVertex_p1 *persObj, TrigVertex *transObj, MsgStream &log)
Definition: TrigVertexCnv_p1.cxx:13
TrackInVertexList
std::list< const TrigInDetTrack * > TrackInVertexList
Definition: TrigVertex.h:26
TrigVertex.h
TrigVertex::m_nTwoTracksSecVtx
int m_nTwoTracksSecVtx
number of 2-track vertices
Definition: TrigVertex.h:172
TrigVertex
Definition: TrigVertex.h:28
TrigVertex_p1::AlgoId_p1
AlgoId_p1
Definition: TrigVertex_p1.h:44
TrigVertex_p1::m_y
float m_y
Definition: TrigVertex_p1.h:54
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigVertex_p1::m_cov
double m_cov[6]
Definition: TrigVertex_p1.h:58
TrigVertex::m_energyFraction
double m_energyFraction
energy ratio E(secondary vertex)/E(jet)
Definition: TrigVertex.h:170
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigVertex_p1::m_algId
AlgoId_p1 m_algId
Definition: TrigVertex_p1.h:64
TrigVertexCnv_p1::transToPers
virtual void transToPers(const TrigVertex *transObj, TrigVertex_p1 *persObj, MsgStream &log)
Definition: TrigVertexCnv_p1.cxx:50
TrigVertex::AlgoId
AlgoId
Definition: TrigVertex.h:31
TrigVertex::m_ownTracks
bool m_ownTracks
Definition: TrigVertex.h:183