ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODTrigMuonAthenaPool
src
xAODL2StandAloneMuonAuxContainerCnv_v1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id: xAODL2StandAloneMuonAuxContainerCnv_v1.cxx 707606 2015-11-12 19:59:49Z krasznaa $
6
7
// System include(s):
8
#include <stdexcept>
9
10
// Gaudi/Athena include(s):
11
#include "GaudiKernel/MsgStream.h"
12
13
// Core EDM include(s):
14
#include "
AthContainers/tools/copyAuxStoreThinned.h
"
15
16
// Local include(s):
17
#include "
xAODL2StandAloneMuonAuxContainerCnv_v1.h
"
18
#include "
xAODTrigMuon/L2StandAloneMuonAuxContainer.h
"
19
#include "
xAODTrigMuon/versions/L2StandAloneMuonAuxContainer_v1.h
"
20
22
#define MSGLVL MSG::DEBUG
23
25
#define ATH_MSG( MSG ) \
26
do { \
27
if( log.level() <= MSGLVL ) { \
28
log << MSGLVL << MSG << endmsg; \
29
} \
30
} while( 0 )
31
32
xAODL2StandAloneMuonAuxContainerCnv_v1::xAODL2StandAloneMuonAuxContainerCnv_v1
()
33
{
34
}
35
36
37
namespace
{
38
39
void
migrateVector (
const
SG::IConstAuxStore& oldObj,
40
SG::IAuxStore
& newObj,
41
const
char
* oldName,
42
const
char
* newName)
43
{
44
size_t
sz
= oldObj.size();
45
if
(!
sz
)
return
;
46
47
SG::AuxTypeRegistry
& reg =
SG::AuxTypeRegistry::instance
();
48
SG::auxid_t
oldId = reg.getAuxID<uint32_t> (oldName);
49
SG::auxid_t
newId = reg.getAuxID<
float
> (newName);
50
51
const
uint32_t* oldPtr =
reinterpret_cast<
const
uint32_t*
>
(oldObj.getData (oldId));
52
float
* newPtr =
reinterpret_cast<
float
*
>
(newObj.
getData
(newId,
sz
,
sz
));
53
if
(oldPtr && newPtr) {
54
std::copy (oldPtr, oldPtr+
sz
, newPtr);
55
}
56
}
57
58
59
}
60
61
void
xAODL2StandAloneMuonAuxContainerCnv_v1::
62
persToTrans
(
const
xAOD::L2StandAloneMuonAuxContainer_v1
* oldObj,
63
xAOD::L2StandAloneMuonAuxContainer
* newObj,
64
MsgStream& log )
const
65
{
66
// Greet the user:
67
ATH_MSG
(
"Converting xAOD::L2StandAloneMuonAuxContainer_v1 to current version..."
);
68
69
// Clear the transient object:
70
newObj->
resize
( 0 );
71
72
// Copy the payload of the v1 object into the latest one by misusing
73
// the thinning code a bit...
74
SG::copyAuxStoreThinned
( *oldObj, *newObj,
nullptr
);
75
76
size_t
sz
= oldObj->
size
();
77
newObj->
resize
(
sz
);
78
migrateVector (*oldObj, *newObj,
"roiEtaUint"
,
"roiEta"
);
79
migrateVector (*oldObj, *newObj,
"roiPhiUint"
,
"roiPhi"
);
80
81
82
// Print what happened:
83
ATH_MSG
(
"Converting xAOD::L2StandAloneMuonAuxContainer_v1 to current version "
84
"[OK]"
);
85
86
return
;
87
}
88
92
void
xAODL2StandAloneMuonAuxContainerCnv_v1::
93
transToPers
(
const
xAOD::L2StandAloneMuonAuxContainer
*,
94
xAOD::L2StandAloneMuonAuxContainer_v1
*,
95
MsgStream& log )
const
{
96
97
log << MSG::ERROR
98
<<
"Somebody called xAODL2StandAloneMuonAuxContainer_v1::transToPers"
99
<<
endmsg
;
100
throw
std::runtime_error(
"Somebody called xAODL2StandAloneMuonAuxContainer_v1::"
101
"transToPers"
);
102
103
return
;
104
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG
#define ATH_MSG(lvl)
Definition
AthMsgStreamMacros.h:52
L2StandAloneMuonAuxContainer.h
L2StandAloneMuonAuxContainer_v1.h
sz
static Double_t sz
Definition
LArPhysWaveHECTool.cxx:37
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition
AuxTypeRegistry.h:61
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition
AuxTypeRegistry.cxx:640
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition
IAuxStore.h:51
SG::IAuxStore::getData
virtual void * getData(auxid_t auxid, size_t size, size_t capacity)=0
Return the data vector for one aux data item.
xAODL2StandAloneMuonAuxContainerCnv_v1::transToPers
virtual void transToPers(const xAOD::L2StandAloneMuonAuxContainer *, xAOD::L2StandAloneMuonAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
Definition
xAODL2StandAloneMuonAuxContainerCnv_v1.cxx:93
xAODL2StandAloneMuonAuxContainerCnv_v1::persToTrans
virtual void persToTrans(const xAOD::L2StandAloneMuonAuxContainer_v1 *oldObj, xAOD::L2StandAloneMuonAuxContainer *newObj, MsgStream &log) const override
Function converting from the old type to the current one.
Definition
xAODL2StandAloneMuonAuxContainerCnv_v1.cxx:62
xAODL2StandAloneMuonAuxContainerCnv_v1::xAODL2StandAloneMuonAuxContainerCnv_v1
xAODL2StandAloneMuonAuxContainerCnv_v1()
Default constructor.
Definition
xAODL2StandAloneMuonAuxContainerCnv_v1.cxx:32
xAOD::AuxContainerBase::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition
AuxContainerBase.cxx:530
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition
AuxContainerBase.cxx:455
xAOD::L2StandAloneMuonAuxContainer_v1
Auxiliary container for muon SA containers.
Definition
L2StandAloneMuonAuxContainer_v1.h:32
copyAuxStoreThinned.h
Helper to copy an aux store while applying thinning.
SG::copyAuxStoreThinned
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition
AuxTypes.h:27
xAOD::L2StandAloneMuonAuxContainer
L2StandAloneMuonAuxContainer_v2 L2StandAloneMuonAuxContainer
Define the latest version of the muon SA auxiliary container.
Definition
L2StandAloneMuonAuxContainer.h:16
xAODL2StandAloneMuonAuxContainerCnv_v1.h
Generated on
for ATLAS Offline Software by
1.17.0