Skip to content
Snippets Groups Projects
Commit a8890818 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'tgcconst2.MuonTGC_CnvTools-20210319' into 'master'

MuonTGC_CnvTools+MuonCnvToolInterfaces: const fixes.

See merge request !41762
parents c3849bf8 93193bf5
No related branches found
No related tags found
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,!41762MuonTGC_CnvTools+MuonCnvToolInterfaces: const fixes.
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MuonByteStream/TgcRdoContByteStreamCnv.h" #include "MuonByteStream/TgcRdoContByteStreamCnv.h"
...@@ -84,9 +84,6 @@ TgcRdoContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) ...@@ -84,9 +84,6 @@ TgcRdoContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr)
{ {
MsgStream log(msgSvc(), const_cnvName); MsgStream log(msgSvc(), const_cnvName);
// get Raw Event data
RawEventWrite* re = m_byteStreamEventAccess->getRawEvent();
// retrieve TGC RDO container // retrieve TGC RDO container
TgcRdoContainer * cont(NULL); TgcRdoContainer * cont(NULL);
StoreGateSvc::fromStorable(pObj, cont); StoreGateSvc::fromStorable(pObj, cont);
...@@ -103,5 +100,5 @@ TgcRdoContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) ...@@ -103,5 +100,5 @@ TgcRdoContByteStreamCnv::createRep(DataObject* pObj, IOpaqueAddress*& pAddr)
pAddr = addr; pAddr = addr;
// convert // convert
return m_tool->convert(cont, re, log); return m_tool->convert(cont);
} }
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H #ifndef MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
class TgcRdoContainer; class TgcRdoContainer;
class MsgStream ; class MsgStream ;
static const InterfaceID IID_ITGC_RDOtoByteStreamTool( "Muon::ITGC_RDOtoByteStreamTool", 1, 0 );
namespace Muon { namespace Muon {
/** An AlgTool class to provide conversion from LArRawChannelContainer /** An AlgTool class to provide conversion from LArRawChannelContainer
...@@ -29,18 +27,12 @@ class ITGC_RDOtoByteStreamTool: virtual public IAlgTool { ...@@ -29,18 +27,12 @@ class ITGC_RDOtoByteStreamTool: virtual public IAlgTool {
public: public:
static const InterfaceID& interfaceID() { return IID_ITGC_RDOtoByteStreamTool; }; DeclareInterfaceID( ITGC_RDOtoByteStreamTool, 1, 0 );
virtual StatusCode initialize()=0;
virtual StatusCode finalize()=0;
/** Conversion method, which takes the RDO container and converts it into raw data, filled into RawEventWrite. /** 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 @param cont RDO container which will be used to fill the raw event
@param re Raw event to be filled by this method.
@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.
*/ */
virtual StatusCode convert(const TgcRdoContainer* cont, RawEventWrite* re, MsgStream& log )=0; virtual StatusCode convert(const TgcRdoContainer* cont) const =0;
}; };
} }
#endif #endif
......
...@@ -19,7 +19,7 @@ atlas_add_component( MuonTGC_CnvTools ...@@ -19,7 +19,7 @@ atlas_add_component( MuonTGC_CnvTools
src/*.cxx src/*.cxx
src/components/*.cxx src/components/*.cxx
INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces MuonCnvToolInterfacesLib MuonTGC_CnvToolsLib ) LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces MuonCnvToolInterfacesLib MuonTGC_CnvToolsLib ByteStreamCnvSvcLib )
# Install files from the package: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_joboptions( share/*.py )
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H #ifndef MUONTGC_CNVTOOLS_ITGC_RDOTOBYTESTREAMTOOL_H
#define MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H #define MUONTGC_CNVTOOLS_ITGC_RDOTOBYTESTREAMTOOL_H
#include "GaudiKernel/IAlgTool.h" #include "MuonCnvToolInterfaces/ITGC_RDOtoByteStreamTool.h"
#include "ByteStreamCnvSvcBase/FullEventAssembler.h"
class TgcRdoContainer;
class MsgStream ;
static const InterfaceID IID_ITGC_RDOtoByteStreamTool( "Muon::ITGC_RDOtoByteStreamTool", 1, 0 );
namespace Muon {
/** An AlgTool class to provide conversion from TgcRdoContainer
* to ByteStream, and fill it in RawEvent
*
* @author Susumu Oda <Susumu.Oda@cern.ch>
*
* This code was adapted from LAr by Ketevi A. Assamagan
* on Jan-14-2003.
*/
class ITGC_RDOtoByteStreamTool: virtual public IAlgTool {
public:
static const InterfaceID& interfaceID() { return IID_ITGC_RDOtoByteStreamTool; };
virtual StatusCode initialize()=0;
virtual StatusCode finalize()=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
* @param re Raw event to be filled by this method.
* @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.
*/
virtual StatusCode convert(const TgcRdoContainer* cont, RawEventWrite* re, MsgStream& log )=0;
};
}
#endif #endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "TgcRdoContByteStreamTool.h" #include "TgcRdoContByteStreamTool.h"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// contructor // contructor
Muon::TgcRdoContByteStreamTool::TgcRdoContByteStreamTool Muon::TgcRdoContByteStreamTool::TgcRdoContByteStreamTool
(const std::string& type, const std::string& name, const IInterface* parent) (const std::string& type, const std::string& name, const IInterface* parent)
: AthAlgTool(type,name,parent), : base_class(type,name,parent),
m_hid2re(0) m_hid2re(0)
{ {
declareInterface<Muon::ITGC_RDOtoByteStreamTool>(this); declareInterface<Muon::ITGC_RDOtoByteStreamTool>(this);
...@@ -34,6 +34,8 @@ StatusCode Muon::TgcRdoContByteStreamTool::initialize() ...@@ -34,6 +34,8 @@ StatusCode Muon::TgcRdoContByteStreamTool::initialize()
// create TGC RDO ID to source ID mapper // create TGC RDO ID to source ID mapper
m_hid2re = new TGC_Hid2RESrcID; m_hid2re = new TGC_Hid2RESrcID;
ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -46,11 +48,12 @@ StatusCode Muon::TgcRdoContByteStreamTool::finalize() ...@@ -46,11 +48,12 @@ StatusCode Muon::TgcRdoContByteStreamTool::finalize()
// convert TGC RDO to ByteStream // convert TGC RDO to ByteStream
StatusCode Muon::TgcRdoContByteStreamTool::convert(const TgcRdoContainer* cont, RawEventWrite* re, StatusCode Muon::TgcRdoContByteStreamTool::convert(const TgcRdoContainer* cont) const
MsgStream& log)
{ {
// clear FullEventAssembler // Get the event assembler
m_fea.clear(); FullEventAssembler<TGC_Hid2RESrcID>* fea = nullptr;
ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
"TgcRdoContByteStream") );
// event assembler // event assembler
FullEventAssembler<TGC_Hid2RESrcID>::RODDATA * theROD; FullEventAssembler<TGC_Hid2RESrcID>::RODDATA * theROD;
...@@ -76,14 +79,11 @@ StatusCode Muon::TgcRdoContByteStreamTool::convert(const TgcRdoContainer* cont, ...@@ -76,14 +79,11 @@ StatusCode Muon::TgcRdoContByteStreamTool::convert(const TgcRdoContainer* cont,
for(; it_map != it_map_end; ++it_map) for(; it_map != it_map_end; ++it_map)
{ {
// get ROD data address // get ROD data address
theROD = m_fea.getRodData((*it_map).first); theROD = fea->getRodData((*it_map).first);
// fill ROD data // fill ROD data
((*it_map).second).fillROD( *theROD ) ; ((*it_map).second).fillROD( *theROD ) ;
} }
// Finnally, fill full event
m_fea.fill(re,log);
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef MUONTGC_CNVTOOLS_TGCRDOCONTRAWEVENTTOOL_H #ifndef MUONTGC_CNVTOOLS_TGCRDOCONTRAWEVENTTOOL_H
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "MuonTGC_CnvTools/ITGC_RDOtoByteStreamTool.h" #include "MuonTGC_CnvTools/ITGC_RDOtoByteStreamTool.h"
#include "ByteStreamData/RawEvent.h" #include "ByteStreamData/RawEvent.h"
#include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
#include "TGC_Hid2RESrcID.h" #include "TGC_Hid2RESrcID.h"
class TgcRdoContainer; class TgcRdoContainer;
...@@ -29,8 +30,7 @@ namespace Muon { ...@@ -29,8 +30,7 @@ namespace Muon {
*/ */
class TgcRdoContByteStreamTool : class TgcRdoContByteStreamTool :
public AthAlgTool, public extends<AthAlgTool, ITGC_RDOtoByteStreamTool>
virtual public ITGC_RDOtoByteStreamTool
{ {
public: public:
...@@ -41,20 +41,19 @@ namespace Muon { ...@@ -41,20 +41,19 @@ namespace Muon {
/** Destructor */ /** Destructor */
virtual ~TgcRdoContByteStreamTool(); virtual ~TgcRdoContByteStreamTool();
/** AthAlgTool InterfaceID */
static const InterfaceID& interfaceID( ) ;
/** Initializer */ /** Initializer */
virtual StatusCode initialize(); virtual StatusCode initialize() override;
/** Finalizer */ /** Finalizer */
virtual StatusCode finalize(); virtual StatusCode finalize() override;
/** Convert RDO container to Byte Stream */ /** Convert RDO container to Byte Stream */
StatusCode convert(const TgcRdoContainer* cont, RawEventWrite* re, MsgStream& log); virtual StatusCode convert(const TgcRdoContainer* cont) const override;
private: private:
ServiceHandle<ByteStreamCnvSvc> m_byteStreamCnvSvc
{ this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
TGC_Hid2RESrcID * m_hid2re; TGC_Hid2RESrcID * m_hid2re;
FullEventAssembler<TGC_Hid2RESrcID> m_fea;
}; };
} // end of namespace } // end of namespace
......
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