ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelAthenaPool
src
DataModelCompatSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
11
12
13
#include "
DataModelAthenaPool/DataModelCompatSvc.h
"
14
#include "
DataModelAthenaPool/DataVectorConvert.h
"
15
#include "
DataModelAthenaPool/CLHEPConverters.h
"
16
#include "
DataModelAthenaPool/PackedContainerConverter.h
"
17
#include "
RootConversions/VectorConverters.h
"
18
#include "
RootConversions/TConvertingStreamerInfo.h
"
19
#include "
RootConversions/TConvertingBranchElement.h
"
20
#include "
AthenaKernel/errorcheck.h
"
21
#include "GaudiKernel/IIncidentSvc.h"
22
23
#include <mutex>
24
25
//============================================================================
26
// Standard service methods.
27
//
28
29
35
DataModelCompatSvc::DataModelCompatSvc
(
const
std::string& name,
36
ISvcLocator* svc)
37
:
AthService
(name, svc)
38
{
39
}
40
41
45
StatusCode
DataModelCompatSvc::initialize
()
46
{
47
// We're going to want to scan all types, looking for @c DataVector
48
// instantiations. We can't do that, though, until the data file
49
// has been open and we've set up the proxies. So defer the real
50
// work until there's a BeginProcessing/BeginEvent incident.
51
SmartIF<IIncidentSvc> incsvc{service(
"IncidentSvc"
)};
52
ATH_MSG_DEBUG
(
"running"
);
53
CHECK
( incsvc.isValid() );
54
incsvc->addListener (
this
,
"BeginProcessing"
);
55
incsvc->addListener (
this
,
"BeginEvent"
);
56
57
// This, however, we need to do before opening any files.
58
TConvertingStreamerInfo::Initialize
();
59
TConvertingBranchElement::Initialize
();
60
DataModelAthenaPool::CLHEPConverters::initialize
();
61
RootConversions::VectorConverters::initialize
();
62
DataModelAthenaPool::installPackedContainerConverters
();
63
64
return
StatusCode::SUCCESS;
65
}
66
67
72
void
DataModelCompatSvc::handle
(
const
Incident& inc)
73
{
74
if
(inc.type() ==
"BeginProcessing"
|| inc.type() ==
"BeginEvent"
)
75
{
76
static
std::once_flag flag;
77
std::call_once(flag, [&]() {
78
// Do our initialization.
79
ATH_MSG_DEBUG
(
"handling incident "
<< inc.type());
80
DataModelAthenaPool::DataVectorConvert::initialize
(
this
);
81
});
82
}
83
}
84
85
90
void
DataModelCompatSvc::debug
(
const
char
*
msg
)
91
{
92
ATH_MSG_DEBUG
(
msg
);
93
}
94
95
100
void
DataModelCompatSvc::error
(
const
char
*
msg
)
101
{
102
ATH_MSG_ERROR
(
msg
);
103
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CLHEPConverters.h
Define converters for CLHEP types needed to read old data files.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DataModelCompatSvc.h
Provides backwards compatibility for reading DataVector (and other) classes.
DataVectorConvert.h
Provide backwards compatibility for reading DataVector classes.
PackedContainerConverter.h
Allow converting std::vector to SG::PackedContainer.
TConvertingBranchElement.h
A variant of TBranchElement that can call converters when reading objects in split mode.
TConvertingStreamerInfo.h
Variant of TStreamerInfo to handle conversions.
VectorConverters.h
Define converters for some standard vector types, needed to read old data files and for cross-platfor...
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
AthService::AthService
AthService()
DataModelAthenaPool::CLHEPConverters::initialize
static void initialize()
Register all CLHEP converters.
Definition
CLHEPConverters.cxx:100
DataModelAthenaPool::DataVectorConvert::initialize
static void initialize(RootUtils::ILogger *logfn=0)
Scan all known DataVector classes and fix up the Root data for any that need conversion.
Definition
DataVectorConvert.cxx:480
DataModelCompatSvc::DataModelCompatSvc
DataModelCompatSvc(const std::string &name, ISvcLocator *svc)
Constructor.
Definition
DataModelCompatSvc.cxx:35
DataModelCompatSvc::initialize
virtual StatusCode initialize()
Service initialization; called at the beginning of the job.
Definition
DataModelCompatSvc.cxx:45
DataModelCompatSvc::handle
virtual void handle(const Incident &inc)
Handle incidents.
Definition
DataModelCompatSvc.cxx:72
DataModelCompatSvc::error
virtual void error(const char *msg)
Log an error message.
Definition
DataModelCompatSvc.cxx:100
DataModelCompatSvc::debug
virtual void debug(const char *msg)
Log a debugging message.
Definition
DataModelCompatSvc.cxx:90
RootConversions::VectorConverters::initialize
static void initialize()
Register all CLHEP converters.
Definition
VectorConverters.cxx:31
TConvertingBranchElement::Initialize
static void Initialize()
Set up to allow for conversions in split mode.
Definition
TConvertingBranchElement.cxx:336
TConvertingStreamerInfo::Initialize
static void Initialize()
Set up conversions.
Definition
TConvertingStreamerInfo.cxx:39
DataModelAthenaPool::installPackedContainerConverters
void installPackedContainerConverters()
Install converters for supported instantiations.
Definition
PackedContainerConverter.cxx:136
Generated on
for ATLAS Offline Software by
1.17.0