ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigInDetEventTPCnv
src
TrigVertexCnv_p2.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigInDetEvent/TrigVertex.h
"
6
#include "
TrigInDetEventTPCnv/TrigVertex_p2.h
"
7
#include "
TrigInDetEventTPCnv/TrigVertexCnv_p2.h
"
8
#include <fenv.h>
9
10
11
//-----------------------------------------------------------------------------
12
// Persistent to transient
13
//-----------------------------------------------------------------------------
14
void
TrigVertexCnv_p2::persToTrans
(
const
TrigVertex_p2
*persObj,
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(),
52
m_trackInVertexVector
.end());
53
else
54
transObj->
m_tracks
=
55
std::make_unique<TrackInVertexList> (
m_trackInVertexVector
.begin(),
56
m_trackInVertexVector
.end());
57
transObj->
m_ownTracks
=
true
;
58
}
59
}
60
61
//-----------------------------------------------------------------------------
62
// Transient to persistent
63
//-----------------------------------------------------------------------------
64
void
TrigVertexCnv_p2::transToPers
(
const
TrigVertex
*transObj,
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();
93
m_trackInVertexVector
.clear();
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
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TrigVertexCnv_p2.h
TrigVertex.h
TrackInVertexList
std::list< const TrigInDetTrack * > TrackInVertexList
Definition
TrigVertex.h:27
TrigVertex_p2.h
TrigVertexCnv_p2::m_trackInVertexVector
TrackInVertexVector m_trackInVertexVector
Definition
TrigVertexCnv_p2.h:57
TrigVertexCnv_p2::persToTrans
virtual void persToTrans(const TrigVertex_p2 *persObj, TrigVertex *transObj, MsgStream &log)
Definition
TrigVertexCnv_p2.cxx:14
TrigVertexCnv_p2::m_TrigInDetTrackVectorCnv
TrigInDetTrackVectorCnv_p3 m_TrigInDetTrackVectorCnv
Definition
TrigVertexCnv_p2.h:56
TrigVertexCnv_p2::transToPers
virtual void transToPers(const TrigVertex *transObj, TrigVertex_p2 *persObj, MsgStream &log)
Definition
TrigVertexCnv_p2.cxx:64
TrigVertex_p2
Definition
TrigVertex_p2.h:27
TrigVertex_p2::m_tracks
std::vector< TPObjRef > m_tracks
Definition
TrigVertex_p2.h:40
TrigVertex_p2::m_allFloats
float m_allFloats[13]
Definition
TrigVertex_p2.h:37
TrigVertex_p2::m_allInts
int m_allInts[3]
Definition
TrigVertex_p2.h:38
TrigVertex
encapsulates LVL2 vertex parameters (in the global reference frame), covariance matrix,...
Definition
TrigVertex.h:29
TrigVertex::m_energyFraction
double m_energyFraction
energy ratio E(secondary vertex)/E(jet)
Definition
TrigVertex.h:168
TrigVertex::m_mass
double m_mass
Definition
TrigVertex.h:165
TrigVertex::m_x
double m_x
Definition
TrigVertex.h:165
TrigVertex::m_algId
AlgoId m_algId
Definition
TrigVertex.h:179
TrigVertex::m_chiSquared
double m_chiSquared
Definition
TrigVertex.h:176
TrigVertex::AlgoId
AlgoId
Definition
TrigVertex.h:32
TrigVertex::m_nTwoTracksSecVtx
int m_nTwoTracksSecVtx
number of 2-track vertices
Definition
TrigVertex.h:170
TrigVertex::m_tracks
std::unique_ptr< TrackInVertexList > m_tracks
Definition
TrigVertex.h:178
TrigVertex::m_z
double m_z
Definition
TrigVertex.h:165
TrigVertex::m_ownTracks
bool m_ownTracks
Definition
TrigVertex.h:181
TrigVertex::m_cov
double m_cov[6]
Definition
TrigVertex.h:166
TrigVertex::m_y
double m_y
Definition
TrigVertex.h:165
TrigVertex::m_nDOF
int m_nDOF
Definition
TrigVertex.h:177
TrigVertex::m_massVar
double m_massVar
Definition
TrigVertex.h:165
Generated on
for ATLAS Offline Software by
1.17.0