ATLAS Offline Software
DataModelCompatSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
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  IIncidentSvc* incsvc = 0;
52  ATH_MSG_DEBUG("running");
53  CHECK( service("IncidentSvc", incsvc) );
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 
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());
81  });
82  }
83 }
84 
85 
90 void DataModelCompatSvc::debug (const char* msg)
91 {
93 }
94 
95 
100 void DataModelCompatSvc::error (const char* msg)
101 {
103 }
TConvertingBranchElement.h
A variant of TBranchElement that can call converters when reading objects in split mode.
DataModelAthenaPool::CLHEPConverters::initialize
static void initialize()
Register all CLHEP converters.
Definition: CLHEPConverters.cxx:100
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
VectorConverters.h
Define converters for some standard vector types, needed to read old data files and for cross-platfor...
TConvertingStreamerInfo.h
Variant of TStreamerInfo to handle conversions.
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:469
DataModelAthenaPool::installPackedContainerConverters
void installPackedContainerConverters()
Install converters for supported instantiations.
Definition: PackedContainerConverter.cxx:136
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RootConversions::VectorConverters::initialize
static void initialize()
Register all CLHEP converters.
Definition: VectorConverters.cxx:31
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthService
Definition: AthService.h:32
master.flag
bool flag
Definition: master.py:29
TConvertingStreamerInfo::Initialize
static void Initialize()
Set up conversions.
Definition: TConvertingStreamerInfo.cxx:39
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CLHEPConverters.h
Define converters for CLHEP types needed to read old data files.
DataModelCompatSvc::handle
virtual void handle(const Incident &inc)
Handle incidents.
Definition: DataModelCompatSvc.cxx:72
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
TConvertingBranchElement::Initialize
static void Initialize()
Set up to allow for conversions in split mode.
Definition: TConvertingBranchElement.cxx:335
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
DataVectorConvert.h
Provide backwards compatibility for reading DataVector classes.
PackedContainerConverter.h
Allow converting std::vector to SG::PackedContainer.
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
DataModelCompatSvc::debug
virtual void debug(const char *msg)
Log a debugging message.
Definition: DataModelCompatSvc.cxx:90
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
DataModelCompatSvc.h
Provides backwards compatibility for reading DataVector (and other) classes.
DataModelCompatSvc::error
virtual void error(const char *msg)
Log an error message.
Definition: DataModelCompatSvc.cxx:100