Skip to content
Snippets Groups Projects
Commit 524bd1f8 authored by Scott Snyder's avatar Scott Snyder Committed by Walter Lampl
Browse files

MuonMDT_CnvTools: const fixes.

Make interface of MsgCsmContByteStreamTool const.
Remove duplicate declaration of IMDT_RDOtoByteStreamTool.
parent b68eee3d
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!42065MuonMDT_CnvTools+MuonCnvToolInterfaces: const fixes.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H
#define MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H
#include "GaudiKernel/IAlgTool.h"
#include "ByteStreamData/RawEvent.h"
class MdtCsmContainer;
class MsgStream ;
class RawEventWrite;
static const InterfaceID IID_IMDT_RDOtoByteStreamTool( "Muon::IMDT_RDOtoByteStreamTool", 1, 0 );
namespace Muon {
......@@ -25,14 +23,11 @@ namespace Muon {
* Jan-14-2003, BNL
* Conversion of Rpc Pad Container to byte stream
*/
class IMDT_RDOtoByteStreamTool: public IAlgTool {
class IMDT_RDOtoByteStreamTool: virtual public IAlgTool {
public:
static const InterfaceID& interfaceID() { return IID_IMDT_RDOtoByteStreamTool; };
virtual StatusCode initialize();
virtual StatusCode finalize();
DeclareInterfaceID( IMDT_RDOtoByteStreamTool, 1, 0 );
/** Conversion method, which takes the RDO container and converts it into raw data, filled into RawEventWrite.
@param cont RDO container which will be used to fill the raw event
......@@ -40,10 +35,12 @@ public:
@param log MsgStream to be filled by method.
@todo Do we really need to pass in a logfile? This is a AlgTool and so can provide its own log objects.
*/
StatusCode convert(MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log )=0;
virtual StatusCode convert (const MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log ) const = 0;
};
}
} // namespace Muon
#endif
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name.
atlas_subdir( MuonMDT_CnvTools )
......@@ -20,4 +20,4 @@ atlas_add_component( MuonMDT_CnvTools
AthenaBaseComps StoreGateLib AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib
MdtCalibSvcLib MuonCalibEvent MuonReadoutGeometry MuonDigitContainer
MuonIdHelpersLib MuonRDO MuonPrepRawData MuonCablingData GeoModelUtilities
MuonCnvToolInterfacesLib MuonMDT_CnvToolsLib )
MuonCnvToolInterfacesLib MuonMDT_CnvToolsLib ByteStreamCnvSvcLib )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MUONMDT_CNVTOOLS_IMDT_RDOTOBYTESTREAMTOOL_H
#define MUONMDT_CNVTOOLS_IMDT_RDOTOBYTESTREAMTOOL_H
#include "GaudiKernel/IAlgTool.h"
#include "ByteStreamData/RawEvent.h"
class MdtCsmContainer;
class MsgStream ;
#include "MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h"
static const InterfaceID IID_IMDT_RDOtoByteStreamTool("Muon::IMDT_RDOtoByteStreamTool", 1, 0);
namespace Muon {
class IMDT_RDOtoByteStreamTool: virtual public IAlgTool {
public:
// IMdtCsmContByteStreamTool() {};
typedef MdtCsmContainer CONTAINER ;
/** AlgTool InterfaceID
*/
static const InterfaceID& interfaceID( );
virtual StatusCode convert(CONTAINER* cont, RawEventWrite* re, MsgStream& log )=0;
};
}
inline const InterfaceID& Muon::IMDT_RDOtoByteStreamTool::interfaceID()
{
return IID_IMDT_RDOtoByteStreamTool;
}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "MDT_Hid2RESrcID.h"
......@@ -35,7 +35,7 @@ StatusCode MDT_Hid2RESrcID::set(const MdtIdHelper* mdtId) {
return StatusCode::SUCCESS;
}
uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) const {
// this method returns a RESrcID for the ROD, for a
// given MDT ID offline ID
......@@ -116,7 +116,7 @@ uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
/** mapping SrcID from ROD to ROB
*/
uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) {
uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) const {
SourceIdentifier id = SourceIdentifier(rod_id);
SourceIdentifier id2 = SourceIdentifier(id.subdetector_id(),id.module_id());
......@@ -131,7 +131,7 @@ uint32_t MDT_Hid2RESrcID::getRobID( uint32_t rod_id) {
/** mapping SrcID from ROB to ROS
*/
uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) {
uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) const {
// Change Module Type to ROS, moduleid = 0
SourceIdentifier id (rob_id);
......@@ -141,7 +141,7 @@ uint32_t MDT_Hid2RESrcID::getRosID( uint32_t rob_id) {
/** mapping SrcID from ROS to Det
*/
uint32_t MDT_Hid2RESrcID::getDetID ( uint32_t ros_id) {
uint32_t MDT_Hid2RESrcID::getDetID ( uint32_t ros_id) const {
// ROS to DET
SourceIdentifier id (ros_id);
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __MDT_HID2RESRCID__
......@@ -44,19 +44,19 @@ public:
void setSpecialROBNumber(int specialROBNumber) {m_specialROBNumber=specialROBNumber;}
/**
*/
uint32_t getRodID(const Identifier& offlineId);
uint32_t getRodID(const Identifier& offlineId) const;
/** Make a ROB Source ID from a ROD source ID
*/
uint32_t getRobID ( uint32_t rod_id);
uint32_t getRobID ( uint32_t rod_id) const;
/** Make a ROS Source ID from a ROB source ID
*/
uint32_t getRosID ( uint32_t rob_id);
uint32_t getRosID ( uint32_t rob_id) const;
/** Make a SubDetector ID from ROS source ID
*/
uint32_t getDetID ( uint32_t ros_id);
uint32_t getDetID ( uint32_t ros_id) const;
private:
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "MdtCsmContByteStreamTool.h"
......@@ -14,35 +14,35 @@
Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
( const std::string& type, const std::string& name,const IInterface* parent )
:
AthAlgTool(type,name,parent),
m_hid2re(0)
base_class(type,name,parent)
{
declareInterface< Muon::IMDT_RDOtoByteStreamTool >( this );
}
StatusCode Muon::MdtCsmContByteStreamTool::initialize() {
ATH_CHECK( m_idHelperSvc.retrieve() );
m_hid2re = new MDT_Hid2RESrcID ();
StatusCode status = m_hid2re->set(&m_idHelperSvc->mdtIdHelper());
if ( status.isFailure() ){
ATH_MSG_FATAL("Could not initialize MDT mapping !");
return StatusCode::FAILURE;
}
m_hid2re = std::make_unique<MDT_Hid2RESrcID> ();
ATH_CHECK( m_hid2re->set(&m_idHelperSvc->mdtIdHelper()) );
ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
return StatusCode::SUCCESS;
}
StatusCode Muon::MdtCsmContByteStreamTool::finalize() {
delete m_hid2re;
return StatusCode::SUCCESS;
}
StatusCode Muon::MdtCsmContByteStreamTool::convert(CONTAINER* cont, RawEventWrite* re,
MsgStream& log ) {
StatusCode Muon::MdtCsmContByteStreamTool::convert(const MdtCsmContainer* cont, RawEventWrite* re,
MsgStream& /*log*/ ) const {
m_fea.clear();
StatusCode status = m_fea.idMap().set(&m_idHelperSvc->mdtIdHelper());
// Get the event assembler
FullEventAssembler<MDT_Hid2RESrcID>* fea = nullptr;
ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
"MdtCsmContByteStream") );
StatusCode status = fea->idMap().set(&m_idHelperSvc->mdtIdHelper());
if ( status.isFailure() ){
ATH_MSG_FATAL("Could not initialize MDT mapping !");
return StatusCode::FAILURE;
......@@ -69,14 +69,10 @@ StatusCode Muon::MdtCsmContByteStreamTool::convert(CONTAINER* cont, RawEventWrit
ATH_MSG_DEBUG(" start to fill Rod ");
for (auto& p : mapEncoder) {
theROD = m_fea.getRodData( p.first );
theROD = fea->getRodData( p.first );
p.second.fillROD( *theROD ) ;
}
ATH_MSG_DEBUG(" filling the Raw Event ... ");
m_fea.fill(re,log);
ATH_MSG_DEBUG(" RawEvent size in 32 bit word " << re->size_word());
// log <<MSG::DEBUG<<" RawEvent header " << re->header() << endmsg;
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MUONMDT_CNVTOOLS_MDTCSMCONTRAWEVENTTOOL_H
......@@ -11,7 +11,8 @@
#include "MDT_Hid2RESrcID.h"
#include "ByteStreamData/RawEvent.h"
#include "ByteStreamCnvSvcBase/FullEventAssembler.h"
#include "MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h"
#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
#include "MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h"
#include "MuonIdHelpers/IMuonIdHelperSvc.h"
class MdtCsmContainer;
......@@ -23,8 +24,6 @@ namespace Muon {
/** An AlgTool class to provide conversion from LArRawChannelContainer
* to ByteStream, and fill it in RawEvent
* created: Sept 25, 2002, by Hong Ma
* requirements: typedef for CONTAINER class method
* statusCode convert(CONTAINER* cont, RawEvent* re, MsgStream& log );
*
* Adapted for Muons by Ketevi A. Assamagan
* Jan-14-2003, BNL
......@@ -35,32 +34,32 @@ namespace Muon {
* Conversion of a Mdt Csm to ByteStream
*/
class MdtCsmContByteStreamTool: public AthAlgTool, virtual public IMDT_RDOtoByteStreamTool
class MdtCsmContByteStreamTool: public extends<AthAlgTool, IMDT_RDOtoByteStreamTool>
{
public:
typedef MdtCsmContainer CONTAINER ;
/** constructor
*/
MdtCsmContByteStreamTool( const std::string& type, const std::string& name, const IInterface* parent ) ;
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode initialize() override;
virtual StatusCode finalize() override;
StatusCode convert(CONTAINER* cont, RawEventWrite* re, MsgStream& log );
virtual StatusCode convert(const MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log ) const override;
private:
MDT_Hid2RESrcID* m_hid2re;
std::unique_ptr<MDT_Hid2RESrcID> m_hid2re;
ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
FullEventAssembler<MDT_Hid2RESrcID> m_fea ;
ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
{ this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
};
}
} // namespace Muon
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment