ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetEventTPCnv
src
JetKeyDescriptorCnv_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
5
6
#include "
JetEventTPCnv/JetKeyDescriptorCnv_p1.h
"
7
8
void
JetKeyDescriptorCnv_p1::persToTrans
(
const
JetKeyDescriptor_p1
* persObj,
9
JetKeyDescriptor
* transObj,
10
MsgStream&
msg
)
const
11
{
12
msg
<< MSG::DEBUG <<
"JetKeyDescriptorCnv persToTrans Begin "
<<
endmsg
;
13
14
msg
<< MSG::DEBUG <<
" Size : "
<< (persObj->
m_catStore
).
size
() <<
endmsg
;
15
if
(
msg
.level() <= MSG::VERBOSE ){
16
for
( std::vector<std::string>::const_iterator it = (persObj->
m_catStore
).begin();
17
it != (persObj->
m_catStore
).end(); ++it )
18
{
19
msg
<< MSG::VERBOSE <<
" "
<< *it <<
endmsg
;
20
}
21
}
22
if
( (persObj->
m_keyStoreLength
).size() != (persObj->
m_catStore
).size() )
23
{
24
msg
<< MSG::ERROR <<
"Length of KeyStore and CategoryStore do not match !"
25
<<
endmsg
;
26
return
;
27
}
28
29
JetKeyDescriptorInstance
*
instance
=
JetKeyDescriptorInstance::instance
();
30
31
transObj->
m_keyStore
.clear();
32
transObj->
m_catStore
.clear();
33
// if(bool( instance->m_Stores ) ) delete instance->m_Stores; // to avoid memory link
34
instance
->m_Stores = transObj;
// global instance points to the store being read.
35
instance
->m_ConstStores = transObj;
36
37
38
unsigned
int
index
(0);
39
for
(
unsigned
int
n = 0; n < (persObj->
m_keyStoreLength
).size(); n++ )
40
{
41
if
(
msg
.level() <= MSG::VERBOSE )
msg
<< MSG::VERBOSE <<
" "
42
<< (persObj->
m_keyStoreLength
)[n] <<
" "
43
<< (persObj->
m_catStore
)[n] <<
endmsg
;
44
// (persObj->m_keyStore).resize((persObj->m_keyStoreLength)[n]);
45
for
(
unsigned
int
m = 0; m < (persObj->
m_keyStoreLength
)[n]; m++ )
46
{
47
size_t
index2 =
instance
->getIndex( (persObj->
m_catStore
)[n],
48
(persObj->
m_keyStore
)[
index
]);
49
if
(
msg
.level() <= MSG::VERBOSE )
msg
<< MSG::VERBOSE <<
" "
50
<< m <<
" "
51
<< (persObj->
m_keyStore
)[
index
]
52
<<
" stored at index "
53
<< index2
54
<<
endmsg
;
55
index
++;
56
}
57
}
58
59
// These have to exist, because some of the Jet converters try to set them.
60
// But they weren't there for some old files --- so make sure here that
61
// we know about these.
62
instance
->getIndex (
"JetShapes"
,
"Timing"
,
true
);
63
instance
->getIndex (
"JetShapes"
,
"LArQuality"
,
true
);
64
instance
->getIndex (
"JetInfo"
,
"TrigJetRec"
,
true
);
65
66
msg
<< MSG::DEBUG <<
"JetKeyDescriptorCnv persToTrans End"
<<
endmsg
;
67
}
68
69
70
71
void
JetKeyDescriptorCnv_p1::transToPers
(
const
JetKeyDescriptor
* transObj,
72
JetKeyDescriptor_p1
* persObj,
73
MsgStream&
msg
)
const
74
{
75
msg
<< MSG::DEBUG <<
"JetKeyDescriptorCnv transToPers Begin "
<<
endmsg
;
76
77
persObj->
m_keyStoreLength
.resize((transObj->
m_catStore
).size(),0);
78
msg
<< MSG::DEBUG <<
" Size : "
<< (transObj->
m_catStore
).
size
()
79
<<
endmsg
;
80
81
for
( JetKeyDescriptor::catlist_t::const_iterator it = (transObj->
m_catStore
).begin();
82
it != (transObj->
m_catStore
).end(); ++it )
83
{
84
if
(
msg
.level() <= MSG::VERBOSE )
msg
<< MSG::VERBOSE <<
" "
<< *it <<
endmsg
;
85
persObj->
m_catStore
.push_back(*it);
86
}
87
88
unsigned
int
n(0);
89
for
( JetKeyDescriptor::storelist_t::const_iterator iti = (transObj->
m_keyStore
).begin();
90
iti != (transObj->
m_keyStore
).end(); ++iti )
91
{
92
for
( JetKeyDescriptor::keystore_t::const_iterator ito = (*iti).begin();
93
ito != (*iti).end(); ++ito )
94
{
95
if
(
msg
.level() <= MSG::VERBOSE )
msg
<< MSG::VERBOSE <<
" "
<< *ito <<
" : "
<< n <<
endmsg
;
96
persObj->
m_keyStore
.push_back(*ito);
97
persObj->
m_keyStoreLength
[n]++;
98
}
99
n++;
100
}
101
msg
<< MSG::DEBUG <<
"JetKeyDescriptorCnv transToPers End"
<<
endmsg
;
102
}
103
104
105
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
JetKeyDescriptorCnv_p1.h
instance
std::map< std::string, double > instance
Definition
Run_To_Get_Tags.h:8
size
size_t size() const
Number of registered mappings.
JetKeyDescriptorCnv_p1::persToTrans
virtual void persToTrans(const JetKeyDescriptor_p1 *persObj, JetKeyDescriptor *transObj, MsgStream &msg) const override
Method creating the transient representation of JetKeyDescriptor from its persistent representation J...
Definition
JetKeyDescriptorCnv_p1.cxx:8
JetKeyDescriptorCnv_p1::transToPers
virtual void transToPers(const JetKeyDescriptor *transObj, JetKeyDescriptor_p1 *persObj, MsgStream &msg) const override
Method creating the persistent representation JetKeyDescriptor_p1 from its transient representation J...
Definition
JetKeyDescriptorCnv_p1.cxx:71
JetKeyDescriptorInstance
Theses classes implement a mapping between string and index used by jets.
Definition
JetKeyDescriptor.h:100
JetKeyDescriptorInstance::instance
static JetKeyDescriptorInstance * instance()
Definition
JetKeyDescriptor.h:123
JetKeyDescriptor_p1
Definition
JetKeyDescriptor_p1.h:12
JetKeyDescriptor_p1::m_catStore
std::vector< std::string > m_catStore
Definition
JetKeyDescriptor_p1.h:21
JetKeyDescriptor_p1::m_keyStore
std::vector< std::string > m_keyStore
Definition
JetKeyDescriptor_p1.h:20
JetKeyDescriptor_p1::m_keyStoreLength
std::vector< unsigned int > m_keyStoreLength
Definition
JetKeyDescriptor_p1.h:19
JetKeyDescriptor
//////////////////////////////////////////////////
Definition
JetKeyDescriptor.h:44
JetKeyDescriptor::m_catStore
catlist_t m_catStore
Definition
JetKeyDescriptor.h:77
JetKeyDescriptor::m_keyStore
storelist_t m_keyStore
Definition
JetKeyDescriptor.h:75
index
Definition
index.py:1
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0