ATLAS Offline Software
Loading...
Searching...
No Matches
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
21#include "GaudiKernel/IIncidentSvc.h"
22
23#include <mutex>
24
25//============================================================================
26// Standard service methods.
27//
28
29
36 ISvcLocator* svc)
37 : AthService (name, svc)
38{
39}
40
41
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.
63
64 return StatusCode::SUCCESS;
65}
66
67
72void 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());
81 });
82 }
83}
84
85
91{
93}
94
95
101{
103}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Define converters for CLHEP types needed to read old data files.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Provides backwards compatibility for reading DataVector (and other) classes.
Provide backwards compatibility for reading DataVector classes.
Allow converting std::vector to SG::PackedContainer.
A variant of TBranchElement that can call converters when reading objects in split mode.
Variant of TStreamerInfo to handle conversions.
Define converters for some standard vector types, needed to read old data files and for cross-platfor...
MsgStream & msg() const
static void initialize()
Register all CLHEP converters.
static void initialize(RootUtils::ILogger *logfn=0)
Scan all known DataVector classes and fix up the Root data for any that need conversion.
DataModelCompatSvc(const std::string &name, ISvcLocator *svc)
Constructor.
virtual StatusCode initialize()
Service initialization; called at the beginning of the job.
virtual void handle(const Incident &inc)
Handle incidents.
virtual void error(const char *msg)
Log an error message.
virtual void debug(const char *msg)
Log a debugging message.
static void initialize()
Register all CLHEP converters.
static void Initialize()
Set up to allow for conversions in split mode.
static void Initialize()
Set up conversions.
void installPackedContainerConverters()
Install converters for supported instantiations.