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