ATLAS Offline Software
Loading...
Searching...
No Matches
TrigVertexCnv_p2.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#include <fenv.h>
9
10
11//-----------------------------------------------------------------------------
12// Persistent to transient
13//-----------------------------------------------------------------------------
15 TrigVertex *transObj,
16 MsgStream &log )
17{
18 log << MSG::DEBUG << "TrigVertexCnv_p2::persToTrans called " << endmsg;
19
20 // Disable FPEs for this bit ... avoids crashes when reading some
21 // 16.0.1 data.
22 fenv_t fenv;
23 feholdexcept (&fenv);
24
25 transObj->m_x = persObj->m_allFloats[0];
26 transObj->m_y = persObj->m_allFloats[1];
27 transObj->m_z = persObj->m_allFloats[2];
28 transObj->m_mass = persObj->m_allFloats[3];
29 transObj->m_massVar = persObj->m_allFloats[4];
30 for(int i=0;i<6;i++){
31 if (isnan(persObj->m_allFloats[5+i])) {
32 transObj->m_cov[i] = 0;
33 }
34 else {
35 transObj->m_cov[i] = persObj->m_allFloats[5+i];
36 }
37 }
38 transObj->m_energyFraction = persObj->m_allFloats[11];
39 transObj->m_chiSquared = persObj->m_allFloats[12];
40
41 transObj->m_nTwoTracksSecVtx = persObj->m_allInts[0];
42 transObj->m_nDOF = persObj->m_allInts[1];
43 transObj->m_algId = static_cast<TrigVertex::AlgoId>(persObj->m_allInts[2]) ;
44
45 fesetenv (&fenv);
46
47 m_TrigInDetTrackVectorCnv.persToTrans( &(persObj->m_tracks), &m_trackInVertexVector, log);
48 if(!m_trackInVertexVector.empty()) {
49
50 if (transObj->m_tracks)
51 transObj->m_tracks->assign (m_trackInVertexVector.begin(),
53 else
54 transObj->m_tracks =
57 transObj->m_ownTracks = true;
58 }
59}
60
61//-----------------------------------------------------------------------------
62// Transient to persistent
63//-----------------------------------------------------------------------------
65 TrigVertex_p2 *persObj ,
66 MsgStream &log )
67{
68 log << MSG::DEBUG << "TrigVertexCnv_p2::transToPers called " << endmsg;
69
70 persObj->m_allFloats[0] = transObj->m_x ;
71 persObj->m_allFloats[1] = transObj->m_y ;
72 persObj->m_allFloats[2] = transObj->m_z ;
73 persObj->m_allFloats[3] = transObj->m_mass ;
74 persObj->m_allFloats[4] = transObj->m_massVar ;
75 persObj->m_allFloats[5] = transObj->m_cov[0] ;
76 persObj->m_allFloats[6] = transObj->m_cov[1] ;
77 persObj->m_allFloats[7] = transObj->m_cov[2] ;
78 persObj->m_allFloats[8] = transObj->m_cov[3] ;
79 persObj->m_allFloats[9] = transObj->m_cov[4] ;
80 persObj->m_allFloats[10] = transObj->m_cov[5] ;
81 persObj->m_allFloats[11] = transObj->m_energyFraction ;
82 persObj->m_allFloats[12] = transObj->m_chiSquared ;
83
84 persObj->m_allInts[0] = transObj->m_nTwoTracksSecVtx ;
85 persObj->m_allInts[1] = transObj->m_nDOF ;
86 persObj->m_allInts[2] = transObj->m_algId ;
87
88 if(transObj->m_tracks!=NULL ){
89
90 TrackInVertexList L = *(transObj->m_tracks);
91 TrackInVertexList::const_iterator iBeg = L.begin();
92 TrackInVertexList::const_iterator iEnd = L.end();
94 m_trackInVertexVector.reserve(L.size());
95
96 for(; iBeg != iEnd; ++iBeg){
97 m_trackInVertexVector.push_back(*iBeg);
98 }
99
100 //TrackInVertexVector::const_iterator iVBeg = m_trackInVertexVector.begin();
101 //TrackInVertexVector::const_iterator iVEnd = m_trackInVertexVector.end();
102
103 m_TrigInDetTrackVectorCnv.transToPers( &m_trackInVertexVector, &(persObj->m_tracks), log);
104
105 } else {
106 log << MSG::DEBUG << "TrigVertexCnv_p2::transToPers: No tracks associated to the vertex" << endmsg;
107 }
108
109}
#define endmsg
std::list< const TrigInDetTrack * > TrackInVertexList
Definition TrigVertex.h:26
TrackInVertexVector m_trackInVertexVector
virtual void persToTrans(const TrigVertex_p2 *persObj, TrigVertex *transObj, MsgStream &log)
TrigInDetTrackVectorCnv_p3 m_TrigInDetTrackVectorCnv
virtual void transToPers(const TrigVertex *transObj, TrigVertex_p2 *persObj, MsgStream &log)
std::vector< TPObjRef > m_tracks
float m_allFloats[13]
encapsulates LVL2 vertex parameters (in the global reference frame), covariance matrix,...
Definition TrigVertex.h:28
double m_energyFraction
energy ratio E(secondary vertex)/E(jet)
Definition TrigVertex.h:170
double m_mass
Definition TrigVertex.h:167
double m_x
Definition TrigVertex.h:167
AlgoId m_algId
Definition TrigVertex.h:181
double m_chiSquared
Definition TrigVertex.h:178
int m_nTwoTracksSecVtx
number of 2-track vertices
Definition TrigVertex.h:172
double m_z
Definition TrigVertex.h:167
bool m_ownTracks
Definition TrigVertex.h:183
double m_cov[6]
Definition TrigVertex.h:168
TrackInVertexList * m_tracks
Definition TrigVertex.h:180
double m_y
Definition TrigVertex.h:167
double m_massVar
Definition TrigVertex.h:167