ATLAS Offline Software
Loading...
Searching...
No Matches
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
19MuonCalibStreamCnvSvc::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
59StatusCode MuonCalibStreamCnvSvc::updateServiceState(IOpaqueAddress *pAddress) {
60 if (pAddress != 0) {
61 GenericAddress *pAddr = dynamic_cast<GenericAddress *>(pAddress);
62 if (pAddr != 0) { return StatusCode::SUCCESS; }
63 }
64 return StatusCode::FAILURE;
65}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
uint32_t CLID
The Class ID type.
AthCnvSvc(const std::string &name, ISvcLocator *pSvcLocator, long type)
Constructor with parameters:
Definition AthCnvSvc.cxx:46
virtual StatusCode initialize() override
Gaudi Service Implementation.
virtual IConverter * converter(const CLID &wanted) override
Retrieve converter from list.
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress) override
Update state of the service.
std::vector< std::string > m_initCnvs
MuonCalibStreamCnvSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
virtual ~MuonCalibStreamCnvSvc()
Standard Destructor.
virtual StatusCode initialize() override
Initialize the service.