ATLAS Offline Software
MuonCalibStreamCnvSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
6 
7 #include "GaudiKernel/GenericAddress.h"
8 #include "GaudiKernel/IClassIDSvc.h"
9 #include "GaudiKernel/IConversionSvc.h"
10 #include "GaudiKernel/IConverter.h"
11 #include "GaudiKernel/IDataSelector.h"
12 #include "GaudiKernel/IOpaqueAddress.h"
13 #include "GaudiKernel/ISvcLocator.h"
14 
15 // External definitions
16 //extern const long MuonCalibStream_StorageType = 0x43;
17 
19 MuonCalibStreamCnvSvc::MuonCalibStreamCnvSvc(const std::string &name, ISvcLocator *svc) :
20  AthCnvSvc(name, svc, MuonCalibStreamAddress::storageType()) //, m_calibEvent(nullptr)
21 {
22  m_initCnvs.push_back("xAOD::EventInfo");
23 
24  declareProperty("InitCnvs", m_initCnvs);
25 }
26 
29 
32  ATH_MSG_INFO("Initializing MuonCalibStreamCnvSvc");
33 
35 
36  SmartIF<IClassIDSvc> clidSvc{service("ClassIDSvc")};
37  ATH_CHECK( clidSvc.isValid() );
38 
39  // Initialize the converters
40  std::vector<std::string>::const_iterator it = m_initCnvs.begin();
41  std::vector<std::string>::const_iterator it_e = m_initCnvs.end();
42  for (; it != it_e; ++it) {
43  CLID id;
44  ATH_MSG_DEBUG(" Try to obtain CLID for " << (*it));
45  ATH_CHECK(clidSvc->getIDOfTypeName(*it, id));
46 
47  ATH_MSG_DEBUG(" " << *it << " has CLID " << id);
48  IConverter *cnv = converter(id);
49  if (!cnv) {
50  ATH_MSG_WARNING(" Cannot get converter for " << (*it));
51  } else {
52  ATH_MSG_DEBUG(" Converter " << cnv->objType() << " for " << (*it));
53  }
54  }
55  return StatusCode::SUCCESS;
56 }
57 
60  if (pAddress != 0) {
61  GenericAddress *pAddr = dynamic_cast<GenericAddress *>(pAddress);
62  if (pAddr != 0) { return StatusCode::SUCCESS; }
63  }
64  return StatusCode::FAILURE;
65 }
MuonCalibStreamCnvSvc::MuonCalibStreamCnvSvc
MuonCalibStreamCnvSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
Definition: MuonCalibStreamCnvSvc.cxx:19
MuonCalibStreamAddress.h
MuonCalibStreamCnvSvc.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonCalibStreamCnvSvc::updateServiceState
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress) override
Update state of the service.
Definition: MuonCalibStreamCnvSvc.cxx:59
MuonCalibStreamCnvSvc::initialize
virtual StatusCode initialize() override
Initialize the service.
Definition: MuonCalibStreamCnvSvc.cxx:31
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonCalibStreamCnvSvc::~MuonCalibStreamCnvSvc
virtual ~MuonCalibStreamCnvSvc()
Standard Destructor.
Definition: MuonCalibStreamCnvSvc.cxx:28
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
MuonCalibStreamCnvSvc::m_initCnvs
std::vector< std::string > m_initCnvs
Definition: MuonCalibStreamCnvSvc.h:18
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthCnvSvc::converter
virtual IConverter * converter(const CLID &wanted) override
Retrieve converter from list.
Definition: AthCnvSvc.cxx:365
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonCalibStreamAddress
Definition: MuonCalibStreamAddress.h:14
AthCnvSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition: AthCnvSvc.cxx:104
AthCnvSvc
Definition: AthCnvSvc.h:66