diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f5e96ecc2fa50ee6d50e886521fe077ece17f8ce --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/CMakeLists.txt @@ -0,0 +1,23 @@ +################################################################################ +# Package: MuonCnvToolInterfaces +################################################################################ + +# Declare the package name: +atlas_subdir( MuonCnvToolInterfaces ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/CLIDSvc + Control/DataModel + Control/SGTools + DetectorDescription/Identifier + Event/ByteStreamCnvSvcBase + Event/ByteStreamData + GaudiKernel ) + +# External dependencies: +find_package( tdaq-common ) + +# Install files from the package: +atlas_install_headers( MuonCnvToolInterfaces ) + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ICSC_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ICSC_RDOtoByteStreamTool.h new file mode 100755 index 0000000000000000000000000000000000000000..3276091fecab158d4af0df7140aa24908648f23a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ICSC_RDOtoByteStreamTool.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_ICSC_RDOTOBYTESTREAMTOOL_H +#define MUONCNVTOOLINTERFACES_ICSC_RDOTOBYTESTREAMTOOL_H + +#include "GaudiKernel/IAlgTool.h" +#include "ByteStreamCnvSvcBase/FullEventAssembler.h" + +class CscRawDataContainer; +class MsgStream ; +//class RawEventWrite; + +static const InterfaceID IID_ICSC_RDOtoByteStreamTool( "Muon::ICSC_RDOtoByteStreamTool", 1, 0 ); + +namespace Muon { +/* + An AlgTool to provide conversion between CSC RDO <---> ByteStream, + and fill it in RawEvent. + + @author Ketevi A. Assamagan BNL December 27 2003 +*/ +class ICSC_RDOtoByteStreamTool : virtual public IAlgTool +{ + +public: + + + static const InterfaceID& interfaceID( ) { return IID_ICSC_RDOtoByteStreamTool; }; + + /** to read the cosmic data */ + virtual bool isCosmic () const =0; + + /** for the old cosmic data before the ROB id=ROD id fix */ + virtual bool isOldCosmic () const =0; + + virtual StatusCode convert(const CscRawDataContainer* cont, RawEventWrite* re, MsgStream& log)=0; +}; +} + +#endif + + + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.h new file mode 100644 index 0000000000000000000000000000000000000000..260cd27f1da7e55bf36438cd98d28591f62b0eb9 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONRDOTOPREPDATA_IDC_HELPER_H +#define MUONRDOTOPREPDATA_IDC_HELPER_H + +// Base classes +#include "Identifier/Identifier.h" +#include "Identifier/Identifiable.h" +#include "Identifier/IdentifierHash.h" +#include "DataModel/DataVector.h" + +#include "CLIDSvc/CLASS_DEF.h" + +namespace Muon{ + +namespace IDC_Helper { + +template< class IDC, class IDHELPER > +//DRDR static should match implementation in IDC_Helper.icc (clang32) +static +typename IDC::IDENTIFIABLE* +getCollection( const Identifier collId, + IDC* idc, + const IDHELPER* idHelper, + MsgStream& log); + +} +} + +#include "IDC_Helper.icc" + +#endif + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.icc b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.icc new file mode 100644 index 0000000000000000000000000000000000000000..5d46456ad6d370e5d821dff01703dffbdb69844b --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IDC_Helper.icc @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//DR #include "IDC_Helper.h" +#include "Identifier/IdentifierHash.h" +template< class IDC, class IDHELPER > +static +typename IDC::IDENTIFIABLE* +Muon::IDC_Helper::getCollection( const Identifier collId, IDC* idc, const IDHELPER* idHelper, MsgStream& log){ + IdentifierHash idHash; + if (idHelper->get_module_hash( collId, idHash )) { + log << MSG::ERROR << "Unable to get CSC hash id from CSC RDO collection " + << " the identifier is " + << endreq; + collId.show(); + } + + typename IDC::IDENTIFIABLE* collection=0; + typename IDC::const_iterator collIt = idc->indexFind(idHash); + if (collIt==idc->end()) { + collection = new typename IDC::IDENTIFIABLE(idHash); + collection->setIdentifier(collId); + StatusCode status = idc->addCollection(collection, idHash ); + if (status.isFailure()) + log << MSG::ERROR << "Couldn't add collection to IDC" << endreq; + } else { + collection = const_cast<typename IDC::IDENTIFIABLE*>( &(**collIt) ); + //cscHashId = collection->identifyHash(); + } + return collection; +} + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h new file mode 100755 index 0000000000000000000000000000000000000000..7489fc4b5de155a38c0fc6f1dc6781d962fdb30d --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMDT_RDOtoByteStreamTool.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H +#define MUONCNVTOOLINTERFACES_IMDT_RDOTOBYTESTREAMTOOL_H + +#include "GaudiKernel/IAlgTool.h" + +class MdtCsmContainer; +class MsgStream ; +class RawEventWrite; + +static const InterfaceID IID_IMDT_RDOtoByteStreamTool( "Muon::IMDT_RDOtoByteStreamTool", 1, 0 ); + +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 + * Conversion of Rpc Pad Container to byte stream + */ +class IMDT_RDOtoByteStreamTool: public IAlgTool { + +public: + + static const InterfaceID& interfaceID() { return IID_IMDT_RDOtoByteStreamTool; }; + + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + /** 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. + */ + StatusCode convert(MdtCsmContainer* cont, RawEventWrite* re, MsgStream& log )=0; + +}; +} +#endif + + + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRawDataProviderTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRawDataProviderTool.h new file mode 100644 index 0000000000000000000000000000000000000000..57448797ec2cac4087dabf692160f96e0315d0a3 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRawDataProviderTool.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_IMUONRAWDATAPROVIDERTOOL_H +#define MUONCNVTOOLINTERFACES_IMUONRAWDATAPROVIDERTOOL_H + +#include "GaudiKernel/IAlgTool.h" +#include "ByteStreamData/RawEvent.h" +#include "Identifier/IdentifierHash.h" +#include <vector> + +using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; + +static const InterfaceID IID_IMuonRawDataProviderTool( "Muon::IMuonRawDataProviderTool", 1, 0 ); + +namespace Muon +{ + +/**Interface defining the tools used to convert Muon BS to MuonRDOs. +*/ +class IMuonRawDataProviderTool : virtual public IAlgTool +{ +public: + static const InterfaceID& interfaceID() + { + return IID_IMuonRawDataProviderTool; + }; + +public: + /** Decoding method. - current methods: let's keep them! */ + typedef std::vector<const ROBFragment*> ROBFragmentList; + virtual StatusCode convert(const ROBFragmentList&) = 0; + virtual StatusCode convert(const ROBFragmentList&, const std::vector<IdentifierHash>&) = 0; + /** the new ones */ + virtual StatusCode convert() = 0; //!< for the entire event + virtual StatusCode convert(const std::vector<IdentifierHash>&) = 0; //!< for a selection of rdo collections + virtual StatusCode convert(const std::vector<uint32_t>&){return StatusCode::FAILURE;} +}; +} + +#endif // !MUONCNVTOOLINTERFACES_IMUONRDOTOPREPDATATOOL_H diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRdoToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRdoToPrepDataTool.h new file mode 100755 index 0000000000000000000000000000000000000000..f3e01a5f9455a99aa4cd2527475d0210ce70f6de --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IMuonRdoToPrepDataTool.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_IMUONRDOTOPREPDATATOOL_H +#define MUONCNVTOOLINTERFACES_IMUONRDOTOPREPDATATOOL_H + +#include "GaudiKernel/IAlgTool.h" +#include <vector> + +class IdentifierHash; + +static const InterfaceID IID_IMuonRdoToPrepDataTool( "Muon::IMuonRdoToPrepDataTool", 1, 0 ); + +namespace Muon { + +/**Interface defining the tools used to convert Muon RDOs to MuonPrepRawData. +For the concrete implementations look at e.g. +- Muon::MdtRdoToPrepDataTool +- Muon::CscRdoToPrepDataTool +- Muon::TgcRdoToPrepDataTool +- Muon::RpcRdoToPrepDataTool +*/ +class IMuonRdoToPrepDataTool : virtual public IAlgTool { + public: + static const InterfaceID& interfaceID() {return IID_IMuonRdoToPrepDataTool;}; + + public: + /** Decoding method. A vector of IdentifierHash are passed in, and the data corresponding to this list (i.e. in a Region of Interest) are converted. + @param idVect Vector of hashes to convert i.e. the hashes of ROD collections in a 'Region of Interest' + @return selectedIdVect This is the subset of idVect which were actually found to contain data (i.e. if you want you can use + this vector of hashes to optimise the retrieval of data in subsequent steps.) */ + virtual StatusCode decode( std::vector<IdentifierHash>& idVect, std::vector<IdentifierHash>& selectedIdVect) = 0; + + //Method for ROB based decoding. Shold decode all chambers asociated with the inputted ROB list. + virtual StatusCode decode( const std::vector<uint32_t>& /*robIds*/ ) {return StatusCode::FAILURE;} + + /** Method used for debugging*/ + virtual void printPrepData() = 0; + virtual void printInputRdo() = 0; +}; +} + + +#endif // !MUONCNVTOOLINTERFACES_IMUONRDOTOPREPDATATOOL_H diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRPC_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRPC_RDOtoByteStreamTool.h new file mode 100755 index 0000000000000000000000000000000000000000..a1f329e25d69794d15c124ab2a09eff3d22dfbb0 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRPC_RDOtoByteStreamTool.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_IRPC_RDOTOBYTESTREAMTOOL_H +#define MUONCNVTOOLINTERFACES_IRPC_RDOTOBYTESTREAMTOOL_H + +#include "GaudiKernel/IAlgTool.h" + +class RpcPadContainer; +class MsgStream ; +class RawEventWrite; + +static const InterfaceID IID_IRPC_RDOtoByteStreamTool( "Muon::IRPC_RDOtoByteStreamTool", 1, 0 ); + +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 + * Conversion of Rpc Pad Container to byte stream + */ +class IRPC_RDOtoByteStreamTool: public IAlgTool { + +public: + + static const InterfaceID& interfaceID() { return IID_IRPC_RDOtoByteStreamTool; }; + + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + /** 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. + */ + StatusCode convert(RpcPadContainer* cont, RawEventWrite* re, MsgStream& log )=0; + +}; +} +#endif + + + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRpcROD_Decoder.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRpcROD_Decoder.h new file mode 100644 index 0000000000000000000000000000000000000000..4a35ffae8c533d1a677c02e48217ffee8ce67b17 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/IRpcROD_Decoder.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef IMUONRPCRODDECODER_H +#define IMUONRPCRODDECODER_H + +#include "GaudiKernel/IAlgTool.h" +#include "ByteStreamData/RawEvent.h" +#include "eformat/SourceIdentifier.h" + + +using eformat::helper::SourceIdentifier; + + +class RpcPadContainer; + +using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; + +namespace Muon +{ + +static const InterfaceID IID_IRpcROD_Decoder("Muon::IRpcROD_Decoder", 1, 0); + +class IRpcROD_Decoder : virtual public IAlgTool +{ +public: + static const InterfaceID& interfaceID(){ return IID_IRpcROD_Decoder; } + + // enter declaration of your interface-defining member functions here + virtual StatusCode fillCollections( const ROBFragment& robFrag, + RpcPadContainer& rdoIdc, + std::vector<IdentifierHash>collections) const = 0; + +}; + +} // end of namespace + +#endif diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ITGC_RDOtoByteStreamTool.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ITGC_RDOtoByteStreamTool.h new file mode 100755 index 0000000000000000000000000000000000000000..17fd080170704f32b4d2a0ac8291b2a80d2f4237 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/MuonCnvToolInterfaces/ITGC_RDOtoByteStreamTool.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H +#define MUONCNVTOOLINTERFACES_ITGC_RDOTOBYTESTREAMTOOL_H + +#include "GaudiKernel/IAlgTool.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 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 + * Conversion of Rpc Pad Container to byte stream + */ +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 + + + diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/cmt/requirements b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/cmt/requirements new file mode 100644 index 0000000000000000000000000000000000000000..31690e86943ed3df0542baaee77c9092393e7495 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/cmt/requirements @@ -0,0 +1,12 @@ +package MuonCnvToolInterfaces + +author Edward.Moyse@cern.ch + +use AtlasPolicy AtlasPolicy-* +use DataCollection DataCollection-* External +use GaudiInterface GaudiInterface-* External +use CLIDSvc CLIDSvc-* Control +use DataModel DataModel-* Control +use Identifier Identifier-* DetectorDescription +use ByteStreamCnvSvcBase ByteStreamCnvSvcBase-* Event +use ByteStreamData ByteStreamData-* Event diff --git a/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/doc/mainpage.h b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/doc/mainpage.h new file mode 100644 index 0000000000000000000000000000000000000000..457e88a53aceba39f88f3a073130ccc9ee63a6d2 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonCnvToolInterfaces/doc/mainpage.h @@ -0,0 +1,15 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + + <i>This page has been automatically generated by the tool. Please remove this line when you start creating your own mainpage</i> + +@mainpage + +@htmlinclude used_packages.html + +@include requirements + +*/