From 697ea8e758127fe5643bd705aea66e36e8d7b590 Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Thu, 8 Dec 2016 04:42:44 +0100 Subject: [PATCH] 'Update reference files for PyDumper-00-01-92.' (MuonEventAthenaPool-00-32-10) * Tagging MuonEventAthenaPool-00-32-10. 2016-11-29 scott snyder <snyder@bnl.gov> * Tagging MuonEventAthenaPool-00-32-09. * Revert -06: not needed with MuonRDO-01-06-08. * Tagging MuonEventAthenaPool-00-32-08. * Fix cmake build of unit tests. * Tagging MuonEventAthenaPool-00-32-07. * Add unit tests. --- .../MuonEventAthenaPool/CMakeLists.txt | 47 ++ .../CscRawDataCollection_p1.h | 2 +- .../MuonEventAthenaPool/CscRawData_p1.h | 2 +- .../MuonEventAthenaPool/TgcRawData_p1.h | 2 +- .../MuonEventAthenaPool/TgcRdo_p1.h | 2 +- .../MuonEventAthenaPool/cmt/requirements | 41 ++ .../share/CscRawDataCnv_p1_test.ref | 1 + .../share/CscRawDataCnv_p2_test.ref | 1 + .../share/CscRawDataCnv_p3_test.ref | 1 + .../share/CscRawDataCollectionCnv_p1_test.ref | 1 + .../share/CscRawDataCollectionCnv_p2_test.ref | 1 + .../share/CscRawDataCollectionCnv_p3_test.ref | 1 + .../share/MdtAmtHitCnv_p1_test.ref | 1 + .../share/MdtCsmCnv_p1_test.ref | 1 + .../share/MuonEventAthenaPool_test.txt | 4 + .../share/RpcCoinMatrixCnv_p1_test.ref | 1 + .../share/RpcFiredChannelCnv_p1_test.ref | 1 + .../share/RpcPadCnv_p1_test.ref | 1 + .../share/RpcPadContainerCnv_p1_test.ref | 29 ++ .../share/RpcPadContainerCnv_p2_test.ref | 30 ++ .../RpcSectorLogicContainerCnv_p1_test.ref | 1 + .../share/TgcRawDataCnv_p1_test.ref | 1 + .../share/TgcRawDataCnv_p2_test.ref | 1 + .../share/TgcRawDataCnv_p3_test.ref | 1 + .../share/TgcRdoCnv_p1_test.ref | 22 + .../share/TgcRdoCnv_p2_test.ref | 22 + .../share/TgcRdoCnv_p3_test.ref | 22 + .../src/CscRawDataCnv_p1.cxx | 4 +- .../MuonEventAthenaPool/src/MdtCsmCnv_p1.cxx | 16 +- .../src/RpcCoinMatrixCnv_p1.cxx | 16 +- .../MuonEventAthenaPool/src/RpcPadCnv_p1.cxx | 13 +- .../src/RpcPadContainerCnv_p1.cxx | 27 +- .../src/RpcPadContainerCnv_p1.h | 2 +- .../src/RpcPadContainerCnv_p2.cxx | 28 +- .../src/RpcPadContainerCnv_p2.h | 2 +- .../src/RpcSectorLogicContainerCnv_p1.cxx | 2 +- .../src/TgcRawDataCnv_p2.cxx | 47 +- .../test/CscRawDataCnv_p1_test.cxx | 74 +++ .../test/CscRawDataCnv_p2_test.cxx | 66 +++ .../test/CscRawDataCnv_p3_test.cxx | 66 +++ .../test/CscRawDataCollectionCnv_p1_test.cxx | 147 ++++++ .../test/CscRawDataCollectionCnv_p2_test.cxx | 115 +++++ .../test/CscRawDataCollectionCnv_p3_test.cxx | 115 +++++ .../test/MdtAmtHitCnv_p1_test.cxx | 68 +++ .../test/MdtCsmCnv_p1_test.cxx | 60 +++ .../test/RpcCoinMatrixCnv_p1_test.cxx | 83 ++++ .../test/RpcFiredChannelCnv_p1_test.cxx | 62 +++ .../test/RpcPadCnv_p1_test.cxx | 116 +++++ .../test/RpcPadContainerCnv_p1_test.cxx | 432 ++++++++++++++++++ .../test/RpcPadContainerCnv_p2_test.cxx | 432 ++++++++++++++++++ .../RpcSectorLogicContainerCnv_p1_test.cxx | 114 +++++ .../test/TgcRawDataCnv_p1_test.cxx | 141 ++++++ .../test/TgcRawDataCnv_p2_test.cxx | 112 +++++ .../test/TgcRawDataCnv_p3_test.cxx | 112 +++++ .../test/TgcRdoCnv_p1_test.cxx | 253 ++++++++++ .../test/TgcRdoCnv_p2_test.cxx | 210 +++++++++ .../test/TgcRdoCnv_p3_test.cxx | 210 +++++++++ .../MuonEventAthenaPool/test/make_dd.icc | 47 ++ 58 files changed, 3345 insertions(+), 87 deletions(-) create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p2_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p3_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p2_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p3_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtAmtHitCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtCsmCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventAthenaPool_test.txt create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcCoinMatrixCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcFiredChannelCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p2_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcSectorLogicContainerCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p2_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p3_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p1_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p2_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p3_test.ref create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p2_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p3_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p2_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p3_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtAmtHitCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtCsmCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcCoinMatrixCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcFiredChannelCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p2_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcSectorLogicContainerCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p2_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p3_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p1_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p2_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p3_test.cxx create mode 100644 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/make_dd.icc diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt index a576f71a08b..56288f7d98c 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt @@ -21,6 +21,7 @@ atlas_depends_on_subdirs( PUBLIC Control/StoreGate Database/AthenaPOOL/AthenaPoolCnvSvc DetectorDescription/Identifier + DetectorDescription/IdDictParser GaudiKernel MuonSpectrometer/MuonCablings/RPCcablingInterface MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent @@ -45,6 +46,14 @@ atlas_add_poolcnv_library( MuonEventAthenaPoolPoolCnv INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaPoolUtilities AtlasSealCLHEP MuonRDO MuonRIO_OnTrack MuonSegment DataModel SGTools StoreGateLib SGtests AthenaPoolCnvSvcLib Identifier GaudiKernel RPCcablingInterfaceLib CscCalibEvent MuonEventTPCnv MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonChamberT0s MuonPrepRawData MuonTrigCoinData MuonSimData ) +# We need to build a separate library for unit testing, since we can't link +# against the PoolCnv library. +atlas_add_library( MuonEventAthenaPoolTestLib + src/*Cnv_p*.cxx + NO_PUBLIC_HEADERS + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaPoolUtilities AtlasSealCLHEP MuonRDO MuonRIO_OnTrack MuonSegment DataModel SGTools StoreGateLib SGtests AthenaPoolCnvSvcLib Identifier GaudiKernel RPCcablingInterfaceLib CscCalibEvent MuonEventTPCnv MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonChamberT0s MuonPrepRawData MuonTrigCoinData MuonSimData ) + atlas_add_dictionary( MuonRDOCnvDict MuonEventAthenaPool/MuonRDOCnvDict.h MuonEventAthenaPool/selection.xml @@ -68,3 +77,41 @@ if( ATHENAPOOLUTILITIESTEST_FOUND ) else() message( WARNING "Couldn't find AthenaPoolUtilitiesTest. No test(s) set up." ) endif() + + +# Helper variable for running the tests: +set( _jobOPath "${CMAKE_CURRENT_SOURCE_DIR}/share" ) +set( _jobOPath "${_jobOPath}:${CMAKE_JOBOPT_OUTPUT_DIRECTORY}" ) +set( _jobOPath "${_jobOPath}:$ENV{JOBOPTSEARCHPATH}" ) + +# Set up the tests of the package: +foreach( name + CscRawDataCnv_p1_test + CscRawDataCnv_p2_test + CscRawDataCnv_p3_test + CscRawDataCollectionCnv_p1_test + CscRawDataCollectionCnv_p2_test + CscRawDataCollectionCnv_p3_test + MdtAmtHitCnv_p1_test + MdtCsmCnv_p1_test + RpcCoinMatrixCnv_p1_test + RpcFiredChannelCnv_p1_test + RpcPadCnv_p1_test + RpcPadContainerCnv_p1_test + RpcPadContainerCnv_p2_test + RpcSectorLogicContainerCnv_p1_test + TgcRawDataCnv_p1_test + TgcRawDataCnv_p2_test + TgcRawDataCnv_p3_test + TgcRdoCnv_p1_test + TgcRdoCnv_p2_test + TgcRdoCnv_p3_test ) + + atlas_add_test( ${name} + SOURCES test/${name}.cxx + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaPoolUtilities AtlasSealCLHEP MuonRDO MuonRIO_OnTrack MuonSegment DataModel SGTools StoreGateLib SGtests AthenaPoolCnvSvcLib Identifier GaudiKernel RPCcablingInterfaceLib CscCalibEvent MuonEventTPCnv MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonChamberT0s MuonPrepRawData MuonTrigCoinData MuonSimData MuonEventAthenaPoolTestLib IdDictParser + PROPERTIES TIMEOUT 300 + ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" ) + +endforeach() + diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawDataCollection_p1.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawDataCollection_p1.h index 02efb75ea5e..563956c18f9 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawDataCollection_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawDataCollection_p1.h @@ -60,7 +60,7 @@ public: friend class CscRawDataCollectionCnv_p1; -private: +//private: // Identifier of this collection uint32_t m_id; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawData_p1.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawData_p1.h index 2f9817eea4a..66571f55812 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawData_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/CscRawData_p1.h @@ -26,7 +26,7 @@ public: const std::vector<uint16_t> getSamples() const { return m_amps; } friend class CscRawDataCnv_p1; -private: +//private: /// persistent data members std::vector<uint16_t> m_amps; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRawData_p1.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRawData_p1.h index 3811fbe33d7..7469e1f46c7 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRawData_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRawData_p1.h @@ -30,7 +30,7 @@ public: friend class TgcRawDataCnv_p1; -private: + //private: /********** common attributes */ diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRdo_p1.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRdo_p1.h index 8a860ec0b6b..f4e5db49ef0 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRdo_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/MuonEventAthenaPool/TgcRdo_p1.h @@ -40,7 +40,7 @@ public: friend class TgcRdoCnv_p1; -private: +//private: // ID of this instance uint16_t m_id; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/cmt/requirements b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/cmt/requirements index e84e0090a48..8fc52d76602 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/cmt/requirements +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/cmt/requirements @@ -89,6 +89,47 @@ private use TestTools TestTools-* AtlasTest -no_auto_imports +apply_pattern UnitTest_run unit_test=RpcFiredChannelCnv_p1 +macro_append RpcFiredChannelCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=RpcCoinMatrixCnv_p1 +macro_append RpcCoinMatrixCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=RpcPadCnv_p1 +macro_append RpcPadCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=RpcPadContainerCnv_p1 +macro_append RpcPadContainerCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=RpcPadContainerCnv_p2 +macro_append RpcPadContainerCnv_p2_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=RpcSectorLogicContainerCnv_p1 +macro_append RpcSectorLogicContainerCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCnv_p1 +macro_append CscRawDataCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCnv_p2 +macro_append CscRawDataCnv_p2_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCnv_p3 +macro_append CscRawDataCnv_p3_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCollectionCnv_p1 +macro_append CscRawDataCollectionCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCollectionCnv_p2 +macro_append CscRawDataCollectionCnv_p2_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=CscRawDataCollectionCnv_p3 +macro_append CscRawDataCollectionCnv_p3_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRawDataCnv_p1 +macro_append TgcRawDataCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRawDataCnv_p2 +macro_append TgcRawDataCnv_p2_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRawDataCnv_p3 +macro_append TgcRawDataCnv_p3_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRdoCnv_p1 +macro_append TgcRdoCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRdoCnv_p2 +macro_append TgcRdoCnv_p2_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=TgcRdoCnv_p3 +macro_append TgcRdoCnv_p3_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=MdtCsmCnv_p1 +macro_append MdtCsmCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " +apply_pattern UnitTest_run unit_test=MdtAmtHitCnv_p1 +macro_append MdtAmtHitCnv_p1_test_dependencies " MuonEventAthenaPoolPoolCnv " + apply_pattern athenarun_test \ name="MuonEventTPCnv_17.0.0" \ options="MuonEventAthenaPool/MuonEventTPCnv_17.0.0_test.py" \ diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p2_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p2_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p3_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCnv_p3_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p2_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p2_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p3_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/CscRawDataCollectionCnv_p3_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtAmtHitCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtAmtHitCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtAmtHitCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtCsmCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtCsmCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MdtCsmCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventAthenaPool_test.txt b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventAthenaPool_test.txt new file mode 100644 index 00000000000..ece7c5043ba --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventAthenaPool_test.txt @@ -0,0 +1,4 @@ +ApplicationMgr.DLLs += { "StoreGate", "CLIDComps" }; +ApplicationMgr.ExtSvc += { "StoreGateSvc", "StoreGateSvc/DetectorStore" }; +TGCcablingServerSvc.forcedUse = true; +#include "IOVSvc/IOVSvc.txt" diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcCoinMatrixCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcCoinMatrixCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcCoinMatrixCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcFiredChannelCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcFiredChannelCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcFiredChannelCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p1_test.ref new file mode 100644 index 00000000000..510a8677bab --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p1_test.ref @@ -0,0 +1,29 @@ + + +Initializing Gaudi ApplicationMgr using job opts ../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # =======> /home/sss/nobackup/atlas/build/../tests/../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # (1,1): ApplicationMgr.DLLs += ["StoreGate", "CLIDComps"] +JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "StoreGateSvc/DetectorStore"] +JobOptionsSvc INFO Job options successfully read in from ../share/MuonEventAthenaPool_test.txt +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Sun Nov 27 21:30:09 2016 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps +ApplicationMgr INFO Application Manager Configured successfully +ClassIDSvc INFO getRegistryEntries: read 4235 CLIDRegistry entries for module ALL +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready + AtlasDetectorID::initialize_from_dictionary - OK +RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 259 +RpcIdHelper INFO Initializing RPC hash indices ... +RpcIdHelper INFO The element hash max is 600 +RpcIdHelper INFO The detector element hash max is 1122 +RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p2_test.ref new file mode 100644 index 00000000000..f052388a582 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcPadContainerCnv_p2_test.ref @@ -0,0 +1,30 @@ + + +Initializing Gaudi ApplicationMgr using job opts ../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # =======> /home/sss/nobackup/atlas/build/../tests/../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # (1,1): ApplicationMgr.DLLs += ["StoreGate", "CLIDComps"] +JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "StoreGateSvc/DetectorStore"] +JobOptionsSvc INFO Job options successfully read in from ../share/MuonEventAthenaPool_test.txt +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Mon Nov 28 00:40:43 2016 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps +ApplicationMgr INFO Application Manager Configured successfully +ClassIDSvc INFO getRegistryEntries: read 4235 CLIDRegistry entries for module ALL +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready + AtlasDetectorID::initialize_from_dictionary - OK +RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 259 +RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 259 +RpcIdHelper INFO Initializing RPC hash indices ... +RpcIdHelper INFO The element hash max is 600 +RpcIdHelper INFO The detector element hash max is 1122 +RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... +test1 +test INFO RPCcablingSvc obtained - hashmax = 3 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcSectorLogicContainerCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcSectorLogicContainerCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/RpcSectorLogicContainerCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p1_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p1_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p2_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p2_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p3_test.ref new file mode 100644 index 00000000000..a5bce3fd256 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRawDataCnv_p3_test.ref @@ -0,0 +1 @@ +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p1_test.ref new file mode 100644 index 00000000000..28eace07793 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p1_test.ref @@ -0,0 +1,22 @@ + + +Initializing Gaudi ApplicationMgr using job opts ../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # =======> /home/sss/nobackup/atlas/build/../tests/../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # (1,1): ApplicationMgr.DLLs += ["StoreGate", "CLIDComps"] +JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "StoreGateSvc/DetectorStore"] +JobOptionsSvc INFO # (3,1): TGCcablingServerSvc.forcedUse = 1 +JobOptionsSvc INFO Job options successfully read in from ../share/MuonEventAthenaPool_test.txt +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Mon Nov 28 20:41:58 2016 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps +ApplicationMgr INFO Application Manager Configured successfully +ClassIDSvc INFO getRegistryEntries: read 4183 CLIDRegistry entries for module ALL +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p2_test.ref new file mode 100644 index 00000000000..967d3b76e38 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p2_test.ref @@ -0,0 +1,22 @@ + + +Initializing Gaudi ApplicationMgr using job opts ../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # =======> /home/sss/nobackup/atlas/build/../tests/../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # (1,1): ApplicationMgr.DLLs += ["StoreGate", "CLIDComps"] +JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "StoreGateSvc/DetectorStore"] +JobOptionsSvc INFO # (3,1): TGCcablingServerSvc.forcedUse = 1 +JobOptionsSvc INFO Job options successfully read in from ../share/MuonEventAthenaPool_test.txt +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Mon Nov 28 20:29:06 2016 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps +ApplicationMgr INFO Application Manager Configured successfully +ClassIDSvc INFO getRegistryEntries: read 4183 CLIDRegistry entries for module ALL +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p3_test.ref new file mode 100644 index 00000000000..94f40ab9550 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/TgcRdoCnv_p3_test.ref @@ -0,0 +1,22 @@ + + +Initializing Gaudi ApplicationMgr using job opts ../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # =======> /home/sss/nobackup/atlas/build/../tests/../share/MuonEventAthenaPool_test.txt +JobOptionsSvc INFO # (1,1): ApplicationMgr.DLLs += ["StoreGate", "CLIDComps"] +JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "StoreGateSvc/DetectorStore"] +JobOptionsSvc INFO # (3,1): TGCcablingServerSvc.forcedUse = 1 +JobOptionsSvc INFO Job options successfully read in from ../share/MuonEventAthenaPool_test.txt +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Mon Nov 28 20:00:16 2016 +==================================================================================================================================== +ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps +ApplicationMgr INFO Application Manager Configured successfully +ClassIDSvc INFO getRegistryEntries: read 4183 CLIDRegistry entries for module ALL +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscRawDataCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscRawDataCnv_p1.cxx index 6d93f149f09..2c418953f5a 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscRawDataCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscRawDataCnv_p1.cxx @@ -26,7 +26,7 @@ CscRawDataCnv_p1::persToTrans(const CscRawData_p1* pers, CscRawData* trans, MsgS amps[i] = pers->m_amps[i] + 2048; - /** conversion of the chamnerLayer index into the new format */ + /** conversion of the chamberLayer index into the new format */ int stationName = ( ( pers->m_address & 0x00010000) >> 16 ) + 50; int stationEta = ( ((pers->m_address & 0x00001000) >> 12 ) == 0x0) ? -1 : 1; int stationPhi = ( ( pers->m_address & 0x0000E000) >> 13 ) + 1; @@ -39,6 +39,8 @@ CscRawDataCnv_p1::persToTrans(const CscRawData_p1* pers, CscRawData* trans, MsgS uint32_t nameIndex = uint32_t(stationName-50); uint32_t etaIndex = (stationEta == -1) ? 0 : 1; uint32_t phiIndex = uint32_t (stationPhi-1); + /// ??? This looks wrong! chamberLayer is either 1 or 2, but then this + /// gets packed into a 1-bit field. Should this be -1? uint32_t chamberIndex = uint32_t (chamberLayer-0); uint32_t layerIndex = uint32_t (wireLayer-1); uint32_t stripType = uint32_t (measuresPhi); diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MdtCsmCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MdtCsmCnv_p1.cxx index 4fc9b49ebae..9696c744307 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MdtCsmCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MdtCsmCnv_p1.cxx @@ -10,17 +10,11 @@ void MdtCsmCnv_p1::persToTrans(const MdtCsm_p1* persColl, MdtCsm* transColl, MsgStream &log) { - transColl->m_Id = Identifier(Identifier32(persColl->m_Id)); - transColl->m_idHash = persColl->m_idHash; - transColl->m_SubDetId = persColl->m_SubDetId; - transColl->m_MrodId = persColl->m_MrodId; - transColl->m_CsmId = persColl->m_CsmId; - - // *transColl = MdtCsm (Identifier(Identifier32(persColl->m_Id)), - // persColl->m_idHash, - // persColl->m_SubDetId, - // persColl->m_MrodId, - // persColl->m_CsmId); + *transColl = MdtCsm (Identifier(Identifier32(persColl->m_Id)), + persColl->m_idHash, + persColl->m_SubDetId, + persColl->m_MrodId, + persColl->m_CsmId); // Invoke vector converter from the base template MdtCsm_Cnvp1_base_t::persToTrans( persColl, transColl, log ); diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcCoinMatrixCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcCoinMatrixCnv_p1.cxx index 7b9439f73b1..829b1abbf74 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcCoinMatrixCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcCoinMatrixCnv_p1.cxx @@ -14,9 +14,9 @@ RpcCoinMatrixCnv_p1::transToPers(const RpcCoinMatrix* transColl, RpcCoinMatrix_p if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " *** Writing out RpcCoinMatrix" << endmsg; persColl->m_id = transColl->identify().get_identifier32().get_compact(); - persColl->m_onlineId = transColl->onlineId(); - persColl->m_crc = transColl->crc(); - persColl->m_fel1Id = transColl->fel1Id(); + persColl->m_onlineId = transColl->onlineId(); + persColl->m_crc = transColl->crc(); + persColl->m_fel1Id = transColl->fel1Id(); persColl->m_febcId = transColl->febcId(); // Invoke vector converter from the base template @@ -28,11 +28,11 @@ RpcCoinMatrixCnv_p1::persToTrans(const RpcCoinMatrix_p1* persColl, RpcCoinMatrix { if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " *** Reading RpcCoinMatrix" << endmsg; - transColl->m_id = Identifier(Identifier32(persColl->m_id)); - transColl->m_onlineId = persColl->m_onlineId; - transColl->m_crc = persColl->m_crc; - transColl->m_fel1Id = persColl->m_fel1Id; - transColl->m_febcId = persColl->m_febcId; + *transColl = RpcCoinMatrix (Identifier(Identifier32(persColl->m_id)), + persColl->m_onlineId, + persColl->m_crc, + persColl->m_fel1Id, + persColl->m_febcId); // Invoke vector converter from the base template RpcCoinMatrixCnv_p1_basetype::persToTrans( persColl, transColl, log ); diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadCnv_p1.cxx index 13f6b1d6f89..8cf9b92a089 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadCnv_p1.cxx @@ -27,13 +27,12 @@ RpcPadCnv_p1::transToPers(const RpcPad* transColl, RpcPad_p1* persColl, MsgStrea void RpcPadCnv_p1::persToTrans(const RpcPad_p1* persColl, RpcPad* transColl, MsgStream &log) { - // std::cout<<"RpcPadCnv_p1::persToTrans with transColl="<<transColl<<std::endl; - transColl->m_id = Identifier(Identifier32(persColl->m_id)); - transColl->m_idHash = persColl->m_idHash; - transColl->m_onlineId = persColl->m_onlineId; - transColl->m_status = persColl->m_status; - transColl->m_errorCode = persColl->m_errorCode; - transColl->m_sector = persColl->m_sector; + *transColl = RpcPad (Identifier(Identifier32(persColl->m_id)), + persColl->m_idHash, + persColl->m_onlineId, + persColl->m_status, + persColl->m_errorCode, + persColl->m_sector); // Invoke vector converter from the base template RpcPadCnv_p1_basetype::persToTrans( persColl, transColl, log ); diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.cxx index e52749864fc..9efaa44555a 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.cxx @@ -29,7 +29,8 @@ #include "RPCcablingInterface/RpcPadIdHash.h" #include "RPCcablingInterface/IRPCcablingSvc.h" -StatusCode RpcPadContainerCnv_p1::initialize(MsgStream &log) { +StatusCode RpcPadContainerCnv_p1::initialize(MsgStream &log, + IRPCcablingSvc* cabling /*= nullptr*/) { // Do not initialize again: m_isInitialized=true; @@ -37,23 +38,27 @@ StatusCode RpcPadContainerCnv_p1::initialize(MsgStream &log) { ISvcLocator* svcLocator = Gaudi::svcLocator(); - // get RPC cablingSvc - const IRPCcablingServerSvc* RpcCabGet = 0; - StatusCode sc = svcLocator->service("RPCcablingServerSvc", RpcCabGet); - if (sc.isFailure()) { + if (cabling) + m_rpcCabling = cabling; + else { + // get RPC cablingSvc + const IRPCcablingServerSvc* RpcCabGet = 0; + StatusCode sc = svcLocator->service("RPCcablingServerSvc", RpcCabGet); + if (sc.isFailure()) { log<<MSG::FATAL << "Could not get RPCcablingServerSvc !" << endmsg; return StatusCode::FAILURE; - } - else log <<MSG::VERBOSE << " RPCcablingServerSvc retrieved" << endmsg; + } + else log <<MSG::VERBOSE << " RPCcablingServerSvc retrieved" << endmsg; - sc = RpcCabGet->giveCabling(m_rpcCabling); - if (sc.isFailure()) { + sc = RpcCabGet->giveCabling(m_rpcCabling); + if (sc.isFailure()) { log << MSG::FATAL << "Could not get RPCcablingSvc from the Server !" << endmsg; m_rpcCabling = 0; return StatusCode::FAILURE; - } - else { + } + else { log <<MSG::VERBOSE << " RPCcablingSvc obtained " << endmsg; + } } log << MSG::DEBUG << "Converter initialized." << endmsg; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.h index a7b3900fcef..2046a5562d4 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p1.h @@ -29,8 +29,8 @@ public: virtual void persToTrans(const PERS* persCont, TRANS* transCont, MsgStream &log); virtual void transToPers(const TRANS* transCont, PERS* persCont, MsgStream &log); virtual RpcPadContainer* createTransient(const RpcPadContainer_p1* persObj, MsgStream& log); + StatusCode initialize(MsgStream &log, IRPCcablingSvc* cabling = nullptr); private: - StatusCode initialize(MsgStream &log); const IRPCcablingSvc *m_rpcCabling; bool m_isInitialized; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.cxx index 1b6c1d80c0d..ad659a03fc9 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.cxx @@ -29,29 +29,36 @@ #include "RPCcablingInterface/RpcPadIdHash.h" #include "RPCcablingInterface/IRPCcablingSvc.h" -StatusCode RpcPadContainerCnv_p2::initialize(MsgStream &log) { +StatusCode RpcPadContainerCnv_p2::initialize(MsgStream &log, + IRPCcablingSvc* cabling /*= nullptr*/) { + // Do not initialize again: m_isInitialized=true; // Get Storegate, ID helpers, and so on ISvcLocator* svcLocator = Gaudi::svcLocator(); - // get RPC cablingSvc - const IRPCcablingServerSvc* RpcCabGet = 0; - StatusCode sc = svcLocator->service("RPCcablingServerSvc", RpcCabGet); - if (sc.isFailure()) { + if (cabling) + m_rpcCabling = cabling; + else { + // get RPC cablingSvc + const IRPCcablingServerSvc* RpcCabGet = 0; + StatusCode sc = svcLocator->service("RPCcablingServerSvc", RpcCabGet); + if (sc.isFailure()) { log<<MSG::FATAL << "Could not get RPCcablingServerSvc !" << endmsg; return StatusCode::FAILURE; - } - else log <<MSG::VERBOSE << " RPCcablingServerSvc retrieved" << endmsg; + } + else log <<MSG::VERBOSE << " RPCcablingServerSvc retrieved" << endmsg; - sc = RpcCabGet->giveCabling(m_rpcCabling); - if (sc.isFailure()) { + sc = RpcCabGet->giveCabling(m_rpcCabling); + if (sc.isFailure()) { log << MSG::FATAL << "Could not get RPCcablingSvc from the Server !" << endmsg; m_rpcCabling = 0; return StatusCode::FAILURE; + } } - else { + + { if (!m_rpcCabling->padHashFunction()) { m_padhashmax = 1000; @@ -112,6 +119,7 @@ void RpcPadContainerCnv_p2::persToTrans(const RpcPadContainer_p2* persCont, Rpc } } } + log << MSG::DEBUG << " *** Reading RpcPadContainer" << endmsg; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.h index f12777e88db..72f605be839 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcPadContainerCnv_p2.h @@ -29,8 +29,8 @@ public: virtual void persToTrans(const PERS* persCont, TRANS* transCont, MsgStream &log); virtual void transToPers(const TRANS* transCont, PERS* persCont, MsgStream &log); virtual RpcPadContainer* createTransient(const RpcPadContainer_p2* persObj, MsgStream& log); + StatusCode initialize(MsgStream &log, IRPCcablingSvc* cabling = nullptr); private: - StatusCode initialize(MsgStream &log); const IRPCcablingSvc *m_rpcCabling; bool m_isInitialized; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcSectorLogicContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcSectorLogicContainerCnv_p1.cxx index c0d32471927..d707aace7dd 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcSectorLogicContainerCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/RpcSectorLogicContainerCnv_p1.cxx @@ -55,7 +55,7 @@ void RpcSectorLogicContainerCnv_p1::transToPers(const RpcSectorLogicContainer* t persCont->m_slVariables[slVariableIndex++]=tCsize; // 1st element is number of SLs. Format is defined in RpcSectorLogicContainer_p1.h //std::cout<<"B"<<std::endl; - persCont->m_hasMoreThan2TriggerCand.resize(tCsize); + persCont->m_hasMoreThan2TriggerCand.reserve(tCsize); //unsigned int indexSL=0; for (; it_Coll != it_CollEnd; it_Coll++) { //std::cout<<"Processing SL :"<<indexSL++<<", slVariableIndex="<<slVariableIndex<<std::endl; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/TgcRawDataCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/TgcRawDataCnv_p2.cxx index e081bdc2dd6..757a55564ec 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/TgcRawDataCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/TgcRawDataCnv_p2.cxx @@ -10,38 +10,21 @@ void TgcRawDataCnv_p2::persToTrans(const TgcRawData_p2* persObj, TgcRawData* transObj, MsgStream &/*log*/) { - - transObj-> m_bcTag = persObj->m_bcTag; - transObj-> m_subDetectorId = persObj->m_subDetectorId; - transObj-> m_rodId = persObj->m_rodId; - transObj-> m_l1Id = persObj->m_l1Id; - transObj-> m_bcId = persObj->m_bcId; - transObj-> m_strip = persObj->m_strip; - transObj-> m_forward = persObj->m_forward; - transObj-> m_sector = persObj->m_sector; - transObj-> m_chip = persObj->m_chip; - transObj-> m_index = persObj->m_index; - transObj-> m_hipt = persObj->m_hipt; - transObj-> m_hitId = persObj->m_hitId; - transObj-> m_hsub = persObj->m_hsub; - transObj-> m_delta = persObj->m_delta; - transObj-> m_inner = 0; - // m_inner - // *transObj = TgcRawData (persObj->m_bcTag, - // persObj->m_subDetectorId, - // persObj->m_rodId, - // persObj->m_l1Id, - // persObj->m_bcId, - // persObj->m_strip, - // persObj->m_forward, - // persObj->m_sector, - // persObj->m_chip, - // persObj->m_index, - // persObj->m_hipt, - // persObj->m_hitId, - // persObj->m_hsub, - // persObj->m_delta, - // 0); + *transObj = TgcRawData (persObj->m_bcTag, + persObj->m_subDetectorId, + persObj->m_rodId, + persObj->m_l1Id, + persObj->m_bcId, + persObj->m_strip, + persObj->m_forward, + persObj->m_sector, + persObj->m_chip, + persObj->m_index, + persObj->m_hipt, + persObj->m_hitId, + persObj->m_hsub, + persObj->m_delta, + 0); transObj->m_sswId = persObj->m_sswId; transObj->m_slbId = persObj->m_slbId; diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p1_test.cxx new file mode 100644 index 00000000000..e51b35736c8 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p1_test.cxx @@ -0,0 +1,74 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + //assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + //assert (p1.width() == p2.width()); + assert (1 == p2.width()); + //assert (p1.isTimeComputed() == p2.isTimeComputed()); + //assert (p1.hashId() == p2.hashId()); +} + + +void testit (const CscRawData& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCnv_p1 cnv; + CscRawData_p1 pers; + //cnv.transToPers (&trans1, &pers, log); + + pers.m_id = trans1.identify(); + for (uint32_t amp : trans1.samples()) + pers.m_amps.push_back (amp - 2048); + int strip = trans1.address() & 0xff; + pers.m_address = strip; + CscRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + // nb see comment in CscRawDataCnv_p1.cxx on chamberIndex + CscRawData trans1 (std::vector<uint16_t>(3001, 3002), + 2048+3, 4, 0, 6); + testit (trans1); + CscRawData trans2 (std::vector<uint16_t>(3011, 3012), + 2048+13, 14, 15, 0, 17, 18); + testit (trans2); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p2_test.cxx new file mode 100644 index 00000000000..38acfa57503 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p2_test.cxx @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.width() == p2.width()); + assert (p1.isTimeComputed() == p2.isTimeComputed()); + assert (p1.hashId() == p2.hashId()); +} + + +void testit (const CscRawData& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCnv_p2 cnv; + CscRawData_p2 pers; + cnv.transToPers (&trans1, &pers, log); + CscRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + CscRawData trans1 (std::vector<uint16_t>(3001, 3002), + 3, 4, 5, 6); + testit (trans1); + CscRawData trans2 (std::vector<uint16_t>(3011, 3012), + 13, 14, 15, 16, 17, 18); + testit (trans2); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p3_test.cxx new file mode 100644 index 00000000000..3add0ec5f7c --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCnv_p3_test.cxx @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCnv_p3.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.width() == p2.width()); + assert (p1.isTimeComputed() == p2.isTimeComputed()); + assert (p1.hashId() == p2.hashId()); +} + + +void testit (const CscRawData& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCnv_p3 cnv; + CscRawData_p3 pers; + cnv.transToPers (&trans1, &pers, log); + CscRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + CscRawData trans1 (std::vector<uint16_t>(3001, 3002), + 3, 4, 5, 6); + testit (trans1); + CscRawData trans2 (std::vector<uint16_t>(3011, 3012), + 13, 14, 15, 16, 17, 18); + testit (trans2); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p1_test.cxx new file mode 100644 index 00000000000..d68f4bc3a25 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p1_test.cxx @@ -0,0 +1,147 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCollectionCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCollectionCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + //assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + //assert (p1.width() == p2.width()); + assert (1 == p2.width()); + //assert (p1.isTimeComputed() == p2.isTimeComputed()); + //assert (p1.hashId() == p2.hashId()); +} + + +void compare (const CscRawDataCollection& p1, + const CscRawDataCollection& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.rodId() == p2.rodId()); + assert (p1.subDetectorId() == p2.subDetectorId()); + //assert (p1.numRPU() == p2.numRPU()); + //assert (p1.samplingPhase() == p2.samplingPhase()); + //assert (p1.triggerType() == p2.triggerType()); + //assert (p1.firstBitSummary() == p2.firstBitSummary()); + assert (p1.eventType() == p2.eventType()); + //assert (p1.rpuID() == p2.rpuID()); + //assert (p1.dataType() == p2.dataType()); + //assert (p1.spuCount() == p2.spuCount()); + //assert (p1.scaAddress() == p2.scaAddress()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const CscRawDataCollection& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCollectionCnv_p1 cnv; + CscRawDataCollection_p1 pers; + //cnv.transToPers (&trans1, &pers, log); + + pers.m_rate = 20; + pers.m_numSamples = trans1.numSamples(); + pers.m_latency = trans1.latency(); + pers.m_numDPU = trans1.numRPU(); + pers.m_id = trans1.identify(); + pers.m_subDetectorId = trans1.subDetectorId(); + switch (trans1.rodId()) { + case 0x0005: pers.m_rodId = 0; break; + case 0x0007: pers.m_rodId = 1; break; + case 0x0009: pers.m_rodId = 2; break; + case 0x0011: pers.m_rodId = 3; break; + case 0x0015: pers.m_rodId = 4; break; + case 0x0017: pers.m_rodId = 5; break; + case 0x0019: pers.m_rodId = 6; break; + case 0x0021: pers.m_rodId = 7; break; + default: std::abort(); + } + + pers.resize (trans1.size()); + for (size_t i=0; i < trans1.size(); i++) { + const CscRawData& telt = *trans1[i]; + CscRawData_p1& pelt = pers[i]; + + pelt.m_id = telt.identify(); + for (uint32_t amp : telt.samples()) + pelt.m_amps.push_back (amp - 2048); + int strip = telt.address() & 0xff; + pelt.m_address = strip; + } + + CscRawDataCollection trans2; + trans2.setIdentifyHash(trans1.identifyHash()); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + CscRawDataCollection trans1 (123); + trans1.setIdentifyHash (123); + trans1.setRodId (0x11); + trans1.setSubDetectorId (456); + trans1.set_samplingPhase (true); + trans1.set_triggerType (true); + trans1.set_firstBitSummary (56); + trans1.set_eventType (78); + trans1.setRPUID (std::vector<uint16_t> {321, 432, 53}); + trans1.addDataType (32); + trans1.addDataType (43); + for (int i=0; i < 10; i++) + trans1.set_spuCount (i, i+11); + trans1.set_scaAddress (789); + + for (int i=0; i < 4; i++) { + int ioffs = i*20; + std::unique_ptr<CscRawData> csc; + // nb see comment in CscRawDataCnv_p1.cxx on chamberIndex + if ((i&1) != 0) { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3001+ioffs, 3002+ioffs), + 2048+3+ioffs, 4+ioffs, 0, 6+ioffs); + } + else { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3011+ioffs, 3012+ioffs), + 2048+13+ioffs, 14+ioffs, 15+ioffs, 0, 17+ioffs, 18+ioffs); + } + trans1.push_back (std::move(csc)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p2_test.cxx new file mode 100644 index 00000000000..34da424b7e6 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p2_test.cxx @@ -0,0 +1,115 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCollectionCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.width() == p2.width()); + assert (p1.isTimeComputed() == p2.isTimeComputed()); + assert (p1.hashId() == p2.hashId()); +} + + +void compare (const CscRawDataCollection& p1, + const CscRawDataCollection& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.rodId() == p2.rodId()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.numRPU() == p2.numRPU()); + assert (p1.samplingPhase() == p2.samplingPhase()); + assert (p1.triggerType() == p2.triggerType()); + assert (p1.firstBitSummary() == p2.firstBitSummary()); + assert (p1.eventType() == p2.eventType()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.dataType() == p2.dataType()); + assert (p1.spuCount() == p2.spuCount()); + assert (p1.scaAddress() == p2.scaAddress()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); + +} + + +void testit (const CscRawDataCollection& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCollectionCnv_p2 cnv; + CscRawDataCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + CscRawDataCollection trans2; + trans2.setIdentifyHash(trans1.identifyHash()); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + CscRawDataCollection trans1 (123); + trans1.setIdentifyHash (234); + trans1.setRodId (345); + trans1.setSubDetectorId (456); + trans1.set_samplingPhase (true); + trans1.set_triggerType (true); + trans1.set_firstBitSummary (56); + trans1.set_eventType (678); + trans1.setRPUID (std::vector<uint16_t> {321, 432, 53}); + trans1.addDataType (32); + trans1.addDataType (43); + for (int i=0; i < 10; i++) + trans1.set_spuCount (i, i+11); + trans1.set_scaAddress (789); + + for (int i=0; i < 4; i++) { + int ioffs = i*20; + std::unique_ptr<CscRawData> csc; + if ((i&1) != 0) { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3001+ioffs, 3002+ioffs), + 3+ioffs, 4+ioffs, 5+ioffs, 6+ioffs); + } + else { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3011+ioffs, 3012+ioffs), + 13+ioffs, 14+ioffs, 15+ioffs, 16+ioffs, 17+ioffs, 18+ioffs); + } + trans1.push_back (std::move(csc)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p3_test.cxx new file mode 100644 index 00000000000..ef3c1cc849d --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/CscRawDataCollectionCnv_p3_test.cxx @@ -0,0 +1,115 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/CscRawDataCollectionCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/CscRawDataCollectionCnv_p3.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const CscRawData& p1, + const CscRawData& p2) +{ + assert (p1.samples() == p2.samples()); + assert (p1.address() == p2.address()); + assert (p1.identify() == p2.identify()); + assert (p1.time() == p2.time()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.width() == p2.width()); + assert (p1.isTimeComputed() == p2.isTimeComputed()); + assert (p1.hashId() == p2.hashId()); +} + + +void compare (const CscRawDataCollection& p1, + const CscRawDataCollection& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.rodId() == p2.rodId()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.numRPU() == p2.numRPU()); + assert (p1.samplingPhase() == p2.samplingPhase()); + assert (p1.triggerType() == p2.triggerType()); + assert (p1.firstBitSummary() == p2.firstBitSummary()); + assert (p1.eventType() == p2.eventType()); + assert (p1.rpuID() == p2.rpuID()); + assert (p1.dataType() == p2.dataType()); + assert (p1.spuCount() == p2.spuCount()); + assert (p1.scaAddress() == p2.scaAddress()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); + +} + + +void testit (const CscRawDataCollection& trans1) +{ + MsgStream log (0, "test"); + CscRawDataCollectionCnv_p3 cnv; + CscRawDataCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + CscRawDataCollection trans2; + trans2.setIdentifyHash(trans1.identifyHash()); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + CscRawDataCollection trans1 (123); + trans1.setIdentifyHash (234); + trans1.setRodId (345); + trans1.setSubDetectorId (456); + trans1.set_samplingPhase (true); + trans1.set_triggerType (true); + trans1.set_firstBitSummary (56); + trans1.set_eventType (678); + trans1.setRPUID (std::vector<uint16_t> {321, 432, 53}); + trans1.addDataType (32); + trans1.addDataType (43); + for (int i=0; i < 10; i++) + trans1.set_spuCount (i, i+11); + trans1.set_scaAddress (789); + + for (int i=0; i < 4; i++) { + int ioffs = i*20; + std::unique_ptr<CscRawData> csc; + if ((i&1) != 0) { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3001+ioffs, 3002+ioffs), + 3+ioffs, 4+ioffs, 5+ioffs, 6+ioffs); + } + else { + csc = std::make_unique<CscRawData> (std::vector<uint16_t>(3011+ioffs, 3012+ioffs), + 13+ioffs, 14+ioffs, 15+ioffs, 16+ioffs, 17+ioffs, 18+ioffs); + } + trans1.push_back (std::move(csc)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtAmtHitCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtAmtHitCnv_p1_test.cxx new file mode 100644 index 00000000000..65e07aec6f5 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtAmtHitCnv_p1_test.cxx @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/MdtAmtHitCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/MdtAmtHitCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const MdtAmtHit& p1, + const MdtAmtHit& p2) +{ + assert (p1.tdcId() == p2.tdcId()); + assert (p1.channelId() == p2.channelId()); + assert (p1.leading() == p2.leading()); + assert (p1.coarse() == p2.coarse()); + assert (p1.fine() == p2.fine()); + assert (p1.width() == p2.width()); + assert (p1.isMasked() == p2.isMasked()); + assert (*p1.dataWords() == *p2.dataWords()); +} + + +void testit (const MdtAmtHit& trans1) +{ + MsgStream log (0, "test"); + MdtAmtHitCnv_p1 cnv; + MdtAmtHit_p1 pers; + cnv.transToPers (&trans1, &pers, log); + MdtAmtHit trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + MdtAmtHit trans1 (123, 234, true); + trans1.setTdcCounts (345, 456); + trans1.setWidth (567); + trans1.setLeading (678); + trans1.addData (32); + trans1.addData (43); + trans1.addData (54); + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtCsmCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtCsmCnv_p1_test.cxx new file mode 100644 index 00000000000..abb2379971e --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/MdtCsmCnv_p1_test.cxx @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/MdtCsmCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/MdtCsmCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const MdtCsm& p1, + const MdtCsm& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.SubDetId() == p2.SubDetId()); + assert (p1.MrodId() == p2.MrodId()); + assert (p1.CsmId() == p2.CsmId()); +} + + +void testit (const MdtCsm& trans1) +{ + MsgStream log (0, "test"); + MdtCsmCnv_p1 cnv; + MdtCsm_p1 pers; + cnv.transToPers (&trans1, &pers, log); + MdtCsm trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + MdtCsm trans1 (Identifier(123), 234, + 345, 456, 567); + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcCoinMatrixCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcCoinMatrixCnv_p1_test.cxx new file mode 100644 index 00000000000..8266f68a08a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcCoinMatrixCnv_p1_test.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcCoinMatrixCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcCoinMatrixCnv_p1.h" +#include "GaudiKernel/MsgStream.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +void compare (const RpcFiredChannel& p1, + const RpcFiredChannel& p2) +{ + assert (p1.bcid() == p2.bcid()); + assert (p1.time() == p2.time()); + assert (p1.ijk() == p2.ijk()); + assert (p1.channel() == p2.channel()); + assert (p1.ovl() == p2.ovl()); + assert (p1.thr() == p2.thr()); +} + + +void compare (const RpcCoinMatrix& p1, + const RpcCoinMatrix& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.onlineId() == p2.onlineId()); + assert (p1.crc() == p2.crc()); + assert (p1.fel1Id() == p2.fel1Id()); + assert (p1.febcId() == p2.febcId()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const RpcCoinMatrix& trans1) +{ + MsgStream log (0, "test"); + RpcCoinMatrixCnv_p1 cnv; + RpcCoinMatrix_p1 pers; + cnv.transToPers (&trans1, &pers, log); + RpcCoinMatrix trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + RpcCoinMatrix trans1 (Identifier (123), + 234, 345, 456, 576); + for (int i=0; i < 10; i++) { + int offs = 1000*i; + if (i < 7) + trans1.push_back (new RpcFiredChannel (321+offs, 432+offs, i, 534+offs)); + else + trans1.push_back (new RpcFiredChannel (213+offs, 324+offs, 7, + 435+offs, 546+offs)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcFiredChannelCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcFiredChannelCnv_p1_test.cxx new file mode 100644 index 00000000000..48ea22aa027 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcFiredChannelCnv_p1_test.cxx @@ -0,0 +1,62 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcFiredChannelCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcFiredChannelCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const RpcFiredChannel& p1, + const RpcFiredChannel& p2) +{ + assert (p1.bcid() == p2.bcid()); + assert (p1.time() == p2.time()); + assert (p1.ijk() == p2.ijk()); + assert (p1.channel() == p2.channel()); + assert (p1.ovl() == p2.ovl()); + assert (p1.thr() == p2.thr()); +} + + +void testit (const RpcFiredChannel& trans1) +{ + MsgStream log (0, "test"); + RpcFiredChannelCnv_p1 cnv; + RpcFiredChannel_p1 pers; + cnv.transToPers (&trans1, &pers, log); + RpcFiredChannel trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + RpcFiredChannel trans1 (123, 234, 2, 345); + testit (trans1); + RpcFiredChannel trans2 (456, 567, 7, 678, 789); + testit (trans2); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadCnv_p1_test.cxx new file mode 100644 index 00000000000..2aab37e5c8c --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadCnv_p1_test.cxx @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcPad_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcPadCnv_p1.h" +#include "GaudiKernel/MsgStream.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +void compare (const RpcFiredChannel& p1, + const RpcFiredChannel& p2) +{ + assert (p1.bcid() == p2.bcid()); + assert (p1.time() == p2.time()); + assert (p1.ijk() == p2.ijk()); + assert (p1.channel() == p2.channel()); + assert (p1.ovl() == p2.ovl()); + assert (p1.thr() == p2.thr()); +} + + +void compare (const RpcCoinMatrix& p1, + const RpcCoinMatrix& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.onlineId() == p2.onlineId()); + assert (p1.crc() == p2.crc()); + assert (p1.fel1Id() == p2.fel1Id()); + assert (p1.febcId() == p2.febcId()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcPad& p1, + const RpcPad& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.onlineId() == p2.onlineId()); + //assert (p1.lvl1Id() == p2.lvl1Id()); + //assert (p1.bcId() == p2.bcId()); + assert (p1.status() == p2.status()); + assert (p1.errorCode() == p2.errorCode()); + assert (p1.sector() == p2.sector()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const RpcPad& trans1) +{ + MsgStream log (0, "test"); + RpcPadCnv_p1 cnv; + RpcPad_p1 pers; + cnv.transToPers (&trans1, &pers, log); + RpcPad trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + RpcPad trans1 (Identifier(987), + 986, + 985, + 984, + 983, + 982, + 981, + 980); + + for (int j=0; j < 5; j++) { + int offs = j*100; + auto cm = std::make_unique<RpcCoinMatrix> (Identifier (123+offs), + 234+offs, 345+offs, + 456+offs, 576+offs); + + for (int i=0; i < 10; i++) { + int offs = 1000*i; + if (i < 7) + cm->push_back (new RpcFiredChannel (321+offs, 432+offs, i, 534+offs)); + else + cm->push_back (new RpcFiredChannel (213+offs, 324+offs, 7, + 435+offs, 546+offs)); + } + trans1.push_back (std::move (cm)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p1_test.cxx new file mode 100644 index 00000000000..ee5d18970ad --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p1_test.cxx @@ -0,0 +1,432 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcPadContainerCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcPadContainerCnv_p1.h" +#include "AthenaBaseComps/AthService.h" +#include "RPCcablingInterface/IRPCcablingSvc.h" +#include "RPCcablingInterface/RpcPadIdHash.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/DeclareFactoryEntries.h" +#include "TestTools/initGaudi.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "make_dd.icc" + + +class TestRPC_CablingSvc + : public extends<AthService, IRPCcablingSvc> +{ +public: + TestRPC_CablingSvc(const std::string& name,ISvcLocator* sl); + virtual StatusCode initialize(); + + virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface ); + + virtual const CablingRPCBase* getRPCCabling() const { std::abort(); } + virtual StatusCode initMappingModel(IOVSVC_CALLBACK_ARGS) { std::abort(); } + virtual const CablingRPCBase::RDOmap& give_RDOs() const; + virtual const CMAparameters::CMAlist give_CMAs(const int,const ViewType, + const int,const int) const + { std::abort(); } + + virtual void printType(int,int,std::string,bool)const + { std::abort(); } + + virtual void printSector(int,int,std::string,bool)const + { std::abort(); } + + virtual bool give_global_address(unsigned int,int&,int&,int&,int&) const + { std::abort(); } + + virtual bool give_RoI_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_RoI_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + virtual bool give_LowPt_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_LowPt_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + + virtual bool give_HighPt_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_HighPt_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + virtual bool give_Pad_Parameters(unsigned short int /*logic_sector*/, + unsigned short int /*PADId*/, + bool & /*feet*/, + bool & /*eta_and_phi*/, + unsigned short int & /*cma_mask*/, + unsigned short int & /*feet_th0*/, + unsigned short int & /*feet_th1*/, + unsigned short int & /*feet_th2*/ ) const + { std::abort(); } + + + virtual unsigned long int strip_code_fromOffId (std::string /*stationName*/, + int /*stationEta*/, + int /*stationPhi*/, + int /*doubletR*/, int /*doubletZ*/, int /*doubletPhi*/, + int /*gasGap*/, int /*measuresPhi*/, int /*strip*/) const + { std::abort(); } + + virtual Identifier strip_OffId_fromCode(unsigned long int /*strip_code_cab*/) const + { std::abort(); } + + virtual std::list<unsigned int> give_strip_code + (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*PADId*/, + unsigned short int /*CMAId*/, + unsigned short /*ijk*/, + unsigned short int /*Channel*/) const + { std::abort(); } + + virtual std::list<Identifier> give_strip_id + (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*PADId*/, + unsigned short int /*CMAId*/, + unsigned short /*ijk*/, + unsigned short int /*Channel*/) const + { std::abort(); } + + //give access to onlineID from compact OfflineID (return == true if OK) + virtual bool giveOnlineID(const Identifier /*compactID*/, + unsigned short int& /*ROBid*/, + unsigned short int& /*RODid*/, + unsigned short int& /*side*/, + unsigned short int& /*SLid*/, + unsigned short int& /*RXid*/, + unsigned short int& /*PADid*/) const + { std::abort(); } + + virtual bool giveOnlineID(const unsigned int /*hashID*/, + unsigned short int& /*ROBid*/, + unsigned short int& /*RODid*/, + unsigned short int& /*side*/, + unsigned short int& /*SLid*/, + unsigned short int& /*RXid*/, + unsigned short int& /*PADid*/) const + { std::abort(); } + + virtual bool giveOffflineID(unsigned short int /*Side*/, + unsigned short int /*Sector*/, + unsigned short int /*PADID*/, + Identifier& /*ID*/) const + { std::abort(); } + + + //map a single PRD HashId into a vector of RDO HashIds + virtual StatusCode giveRDO_fromPRD(const IdentifierHash /*prdHashId*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a vector of PRD HashIds into a vector of RDO HashIds + virtual StatusCode giveRDO_fromPRD(const std::vector<IdentifierHash>& /*prdHashVec*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a single ROB Id into a vector of RDO HashIds + virtual StatusCode giveRDO_fromROB(const uint32_t /*robId*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a vector of ROB Ids into a vector of RDO HashIds + virtual StatusCode giveRDO_fromROB(const std::vector<uint32_t>& /*robIdVec*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a single PRD HashId into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromPRD(const IdentifierHash /*prdHashId*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //map a vector of PRD HashIds into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromPRD(const std::vector<IdentifierHash>& /*prdHashVec*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //map a single RDO HashId into a single ROB Id + virtual StatusCode giveROB_fromRDO(const IdentifierHash /*rdoHashId*/, + uint32_t& /*robId*/) const + { std::abort(); } + + //map a vector of RDO HashIds into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromRDO(const std::vector<IdentifierHash>& /*rdoHashVec*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //provide the full list of ROB id + virtual std::vector<uint32_t> giveFullListOfRobIds() const + { std::abort(); } + + // method used in RPCgeometry + virtual std::vector<const RDOindex*> GiveHashVec() const + { std::abort(); } + + // hash function + virtual RpcPadIdHash* padHashFunction() const + { return m_hash.get(); } + + // access to service name + virtual std::string rpcCabSvcType() const + { std::abort(); } + +private: + std::unique_ptr<RpcPadIdHash> m_hash; + CablingRPCBase::RDOmap m_rdomap; // map<int, RDOindex> +}; + + +TestRPC_CablingSvc::TestRPC_CablingSvc(const std::string& name,ISvcLocator* sl) + : extends<AthService, IRPCcablingSvc> (name, sl) +{ + // lvl1 code: + // strip_number + rpc_z_index*100 + rpc_layer*10*1000 + + // lvl1_station*100*1000 + logic_sector*1000*1000 + + // strip_type*100*1000*1000 + // 1 <= strip_type <= 2 + // 0 <= logic_sector <= 63 + // 1 <= station_value <= 3 + // 0 <= rpc_layer <= 1 + int code0= 0 + 1*100 + 0*10*1000 + 1*100*1000 + 1*1000*1000 + 1*100*1000*1000; + int code1= 1 + 2*100 + 0*10*1000 + 2*100*1000 + 2*1000*1000 + 1*100*1000*1000; + int code2= 2 + 3*100 + 0*10*1000 + 3*100*1000 + 3*1000*1000 + 1*100*1000*1000; + // pad code name station_eta[-8:8] station_phi[1:8] doubletR[1:2] + // doubletZ[1:3] doubletPhi[1:2] + m_rdomap.emplace (0, RDOindex (0, code0, "BIL", 1, 2, 1, 1, 2)); + m_rdomap.emplace (1, RDOindex (1, code1, "BIL", 6, 7, 2, 2, 1)); + m_rdomap.emplace (2, RDOindex (2, code2, "BIL", 7, 5, 1, 3, 2)); + m_rdomap.find(0)->second.set_hash(0); + m_rdomap.find(1)->second.set_hash(1); + m_rdomap.find(2)->second.set_hash(2); + + //IDs: 0x6024c40000000000 0x603b680000000000 0x603e540000000000 +} + + +StatusCode TestRPC_CablingSvc::queryInterface(const InterfaceID& riid, void** ppvIF) +{ + msg(MSG::VERBOSE) << "queryInterface Start" << endmsg; + if(IRPCcablingSvc::interfaceID().versionMatch(riid) ) + { + msg(MSG::VERBOSE) << "versionMatch=true" << endmsg; + *ppvIF = (IRPCcablingSvc*)(this); + } else { + msg(MSG::VERBOSE) << "cannot find the interface!" << endmsg; + return AthService::queryInterface(riid, ppvIF); + } + msg(MSG::VERBOSE) << "queryInterface succesfull" << endmsg; + addRef(); // is this needed ?? yes it is ! + return StatusCode::SUCCESS; +} + + +StatusCode TestRPC_CablingSvc::initialize() +{ + m_hash = std::make_unique<RpcPadIdHash> (this); + return StatusCode::SUCCESS; +} + + +const CablingRPCBase::RDOmap& TestRPC_CablingSvc::give_RDOs() const +{ + return m_rdomap; +} + + +DECLARE_SERVICE_FACTORY( TestRPC_CablingSvc ) + + +//**************************************************************************** + + +void compare (const RpcFiredChannel& p1, + const RpcFiredChannel& p2) +{ + assert (p1.bcid() == p2.bcid()); + assert (p1.time() == p2.time()); + assert (p1.ijk() == p2.ijk()); + assert (p1.channel() == p2.channel()); + assert (p1.ovl() == p2.ovl()); + assert (p1.thr() == p2.thr()); +} + + +void compare (const RpcCoinMatrix& p1, + const RpcCoinMatrix& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.onlineId() == p2.onlineId()); + assert (p1.crc() == p2.crc()); + assert (p1.fel1Id() == p2.fel1Id()); + assert (p1.febcId() == p2.febcId()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcPad& p1, + const RpcPad& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.onlineId() == p2.onlineId()); + //assert (p1.lvl1Id() == p2.lvl1Id()); + //assert (p1.bcId() == p2.bcId()); + assert (p1.status() == p2.status()); + assert (p1.errorCode() == p2.errorCode()); + assert (p1.sector() == p2.sector()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcPadContainer& p1, + const RpcPadContainer& p2) +{ + RpcPadContainer::const_iterator it1 = p1.begin(); + RpcPadContainer::const_iterator end1 = p1.end(); + RpcPadContainer::const_iterator it2 = p2.begin(); + RpcPadContainer::const_iterator end2 = p2.end(); + for (; it1 != end1; ++it1, ++it2) { + assert (it2 != end2); + assert (it1.hashId() == it2.hashId()); + compare (**it1, **it2); + } + assert (it2 == end2); +} + + +void testit (const RpcPadContainer& trans1, IRPCcablingSvc* cabling) +{ + MsgStream log (0, "test"); + RpcPadContainerCnv_p1 cnv; + cnv.initialize (log, cabling); + RpcPadContainer_p1 pers; + cnv.transToPers (&trans1, &pers, log); + std::unique_ptr<RpcPadContainer> trans2 (cnv.createTransient (&pers, log)); + compare (trans1, *trans2); +} + + +void test1 (IRPCcablingSvc* cabling) +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + RpcPadContainer trans1 (3); + unsigned int ids[3] = {0x6024c400, 0x603b6800, 0x603e5400}; + for (int k=0; k < 3; k++) { + int koffs = k*50; + auto pad = std::make_unique<RpcPad> (Identifier(ids[k]), + k, + 985+koffs, + 984+koffs, + 983+koffs, + 982+koffs, + 981+koffs, + 980+koffs); + + for (int j=0; j < 5; j++) { + int joffs = j*100; + auto cm = std::make_unique<RpcCoinMatrix> (Identifier (123+joffs), + 234+joffs, 345+joffs, + 456+joffs, 576+joffs); + + for (int i=0; i < 10; i++) { + int ioffs = 1000*i; + if (i < 7) + cm->push_back (new RpcFiredChannel (321+ioffs, 432+ioffs, + i, 534+ioffs)); + else + cm->push_back (new RpcFiredChannel (213+ioffs, 324+ioffs, 7, + 435+ioffs, 546+ioffs)); + } + + pad->push_back (std::move (cm)); + } + trans1.addCollection (pad.release(), k); + } + + testit (trans1, cabling); +} + + +int main() +{ + ISvcLocator* pSvcLoc; + if (!Athena_test::initGaudi("MuonEventAthenaPool_test.txt", pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + make_dd(); + + ServiceHandle<IRPCcablingSvc> cabling ("TestRPC_CablingSvc", "test"); + if (cabling.retrieve().isFailure()) { + std::cerr << "Cannot get cabling\n"; + return 0; + } + + test1 (cabling.get()); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p2_test.cxx new file mode 100644 index 00000000000..67888fe9cc2 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcPadContainerCnv_p2_test.cxx @@ -0,0 +1,432 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcPadContainerCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcPadContainerCnv_p2.h" +#include "AthenaBaseComps/AthService.h" +#include "RPCcablingInterface/IRPCcablingSvc.h" +#include "RPCcablingInterface/RpcPadIdHash.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/DeclareFactoryEntries.h" +#include "TestTools/initGaudi.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "make_dd.icc" + + +class TestRPC_CablingSvc + : public extends<AthService, IRPCcablingSvc> +{ +public: + TestRPC_CablingSvc(const std::string& name,ISvcLocator* sl); + virtual StatusCode initialize(); + + virtual StatusCode queryInterface(const InterfaceID & riid, void** ppvInterface ); + + virtual const CablingRPCBase* getRPCCabling() const { std::abort(); } + virtual StatusCode initMappingModel(IOVSVC_CALLBACK_ARGS) { std::abort(); } + virtual const CablingRPCBase::RDOmap& give_RDOs() const; + virtual const CMAparameters::CMAlist give_CMAs(const int,const ViewType, + const int,const int) const + { std::abort(); } + + virtual void printType(int,int,std::string,bool)const + { std::abort(); } + + virtual void printSector(int,int,std::string,bool)const + { std::abort(); } + + virtual bool give_global_address(unsigned int,int&,int&,int&,int&) const + { std::abort(); } + + virtual bool give_RoI_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_RoI_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + virtual bool give_LowPt_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_LowPt_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + + virtual bool give_HighPt_borders (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + unsigned int& /*EtaLowBorder*/, + unsigned int& /*EtaHighBorder*/, + unsigned int& /*PhiLowBorder*/, + unsigned int& /*PhiHighBorder*/) const + { std::abort(); } + + virtual bool give_HighPt_borders_id (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*RoIId*/, + Identifier& /*EtaLowBorder_id*/, + Identifier& /*EtaHighBorder_id*/, + Identifier& /*PhiLowBorder_id*/, + Identifier& /*PhiHighBorder_id*/) const + { std::abort(); } + + virtual bool give_Pad_Parameters(unsigned short int /*logic_sector*/, + unsigned short int /*PADId*/, + bool & /*feet*/, + bool & /*eta_and_phi*/, + unsigned short int & /*cma_mask*/, + unsigned short int & /*feet_th0*/, + unsigned short int & /*feet_th1*/, + unsigned short int & /*feet_th2*/ ) const + { std::abort(); } + + + virtual unsigned long int strip_code_fromOffId (std::string /*stationName*/, + int /*stationEta*/, + int /*stationPhi*/, + int /*doubletR*/, int /*doubletZ*/, int /*doubletPhi*/, + int /*gasGap*/, int /*measuresPhi*/, int /*strip*/) const + { std::abort(); } + + virtual Identifier strip_OffId_fromCode(unsigned long int /*strip_code_cab*/) const + { std::abort(); } + + virtual std::list<unsigned int> give_strip_code + (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*PADId*/, + unsigned short int /*CMAId*/, + unsigned short /*ijk*/, + unsigned short int /*Channel*/) const + { std::abort(); } + + virtual std::list<Identifier> give_strip_id + (unsigned short int /*SubsystemId*/, + unsigned short int /*SectorId*/, + unsigned short int /*PADId*/, + unsigned short int /*CMAId*/, + unsigned short /*ijk*/, + unsigned short int /*Channel*/) const + { std::abort(); } + + //give access to onlineID from compact OfflineID (return == true if OK) + virtual bool giveOnlineID(const Identifier /*compactID*/, + unsigned short int& /*ROBid*/, + unsigned short int& /*RODid*/, + unsigned short int& /*side*/, + unsigned short int& /*SLid*/, + unsigned short int& /*RXid*/, + unsigned short int& /*PADid*/) const + { std::abort(); } + + virtual bool giveOnlineID(const unsigned int /*hashID*/, + unsigned short int& /*ROBid*/, + unsigned short int& /*RODid*/, + unsigned short int& /*side*/, + unsigned short int& /*SLid*/, + unsigned short int& /*RXid*/, + unsigned short int& /*PADid*/) const + { std::abort(); } + + virtual bool giveOffflineID(unsigned short int /*Side*/, + unsigned short int /*Sector*/, + unsigned short int /*PADID*/, + Identifier& /*ID*/) const + { std::abort(); } + + + //map a single PRD HashId into a vector of RDO HashIds + virtual StatusCode giveRDO_fromPRD(const IdentifierHash /*prdHashId*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a vector of PRD HashIds into a vector of RDO HashIds + virtual StatusCode giveRDO_fromPRD(const std::vector<IdentifierHash>& /*prdHashVec*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a single ROB Id into a vector of RDO HashIds + virtual StatusCode giveRDO_fromROB(const uint32_t /*robId*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a vector of ROB Ids into a vector of RDO HashIds + virtual StatusCode giveRDO_fromROB(const std::vector<uint32_t>& /*robIdVec*/, + std::vector<IdentifierHash>& /*rdoHashVec*/) const + { std::abort(); } + + //map a single PRD HashId into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromPRD(const IdentifierHash /*prdHashId*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //map a vector of PRD HashIds into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromPRD(const std::vector<IdentifierHash>& /*prdHashVec*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //map a single RDO HashId into a single ROB Id + virtual StatusCode giveROB_fromRDO(const IdentifierHash /*rdoHashId*/, + uint32_t& /*robId*/) const + { std::abort(); } + + //map a vector of RDO HashIds into a vector of corresponding ROB Ids + virtual StatusCode giveROB_fromRDO(const std::vector<IdentifierHash>& /*rdoHashVec*/, + std::vector<uint32_t>& /*robIdVec*/) const + { std::abort(); } + + //provide the full list of ROB id + virtual std::vector<uint32_t> giveFullListOfRobIds() const + { std::abort(); } + + // method used in RPCgeometry + virtual std::vector<const RDOindex*> GiveHashVec() const + { std::abort(); } + + // hash function + virtual RpcPadIdHash* padHashFunction() const + { return m_hash.get(); } + + // access to service name + virtual std::string rpcCabSvcType() const + { std::abort(); } + +private: + std::unique_ptr<RpcPadIdHash> m_hash; + CablingRPCBase::RDOmap m_rdomap; // map<int, RDOindex> +}; + + +TestRPC_CablingSvc::TestRPC_CablingSvc(const std::string& name,ISvcLocator* sl) + : extends<AthService, IRPCcablingSvc> (name, sl) +{ + // lvl1 code: + // strip_number + rpc_z_index*100 + rpc_layer*10*1000 + + // lvl1_station*100*1000 + logic_sector*1000*1000 + + // strip_type*100*1000*1000 + // 1 <= strip_type <= 2 + // 0 <= logic_sector <= 63 + // 1 <= station_value <= 3 + // 0 <= rpc_layer <= 1 + int code0= 0 + 1*100 + 0*10*1000 + 1*100*1000 + 1*1000*1000 + 1*100*1000*1000; + int code1= 1 + 2*100 + 0*10*1000 + 2*100*1000 + 2*1000*1000 + 1*100*1000*1000; + int code2= 2 + 3*100 + 0*10*1000 + 3*100*1000 + 3*1000*1000 + 1*100*1000*1000; + // pad code name station_eta[-8:8] station_phi[1:8] doubletR[1:2] + // doubletZ[1:3] doubletPhi[1:2] + m_rdomap.emplace (0, RDOindex (0, code0, "BIL", 1, 2, 1, 1, 2)); + m_rdomap.emplace (1, RDOindex (1, code1, "BIL", 6, 7, 2, 2, 1)); + m_rdomap.emplace (2, RDOindex (2, code2, "BIL", 7, 5, 1, 3, 2)); + m_rdomap.find(0)->second.set_hash(0); + m_rdomap.find(1)->second.set_hash(1); + m_rdomap.find(2)->second.set_hash(2); + + //IDs: 0x6024c40000000000 0x603b680000000000 0x603e540000000000 +} + + +StatusCode TestRPC_CablingSvc::queryInterface(const InterfaceID& riid, void** ppvIF) +{ + msg(MSG::VERBOSE) << "queryInterface Start" << endmsg; + if(IRPCcablingSvc::interfaceID().versionMatch(riid) ) + { + msg(MSG::VERBOSE) << "versionMatch=true" << endmsg; + *ppvIF = (IRPCcablingSvc*)(this); + } else { + msg(MSG::VERBOSE) << "cannot find the interface!" << endmsg; + return AthService::queryInterface(riid, ppvIF); + } + msg(MSG::VERBOSE) << "queryInterface succesfull" << endmsg; + addRef(); // is this needed ?? yes it is ! + return StatusCode::SUCCESS; +} + + +StatusCode TestRPC_CablingSvc::initialize() +{ + m_hash = std::make_unique<RpcPadIdHash> (this); + return StatusCode::SUCCESS; +} + + +const CablingRPCBase::RDOmap& TestRPC_CablingSvc::give_RDOs() const +{ + return m_rdomap; +} + + +DECLARE_SERVICE_FACTORY( TestRPC_CablingSvc ) + + +//**************************************************************************** + + +void compare (const RpcFiredChannel& p1, + const RpcFiredChannel& p2) +{ + assert (p1.bcid() == p2.bcid()); + assert (p1.time() == p2.time()); + assert (p1.ijk() == p2.ijk()); + assert (p1.channel() == p2.channel()); + assert (p1.ovl() == p2.ovl()); + assert (p1.thr() == p2.thr()); +} + + +void compare (const RpcCoinMatrix& p1, + const RpcCoinMatrix& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.onlineId() == p2.onlineId()); + assert (p1.crc() == p2.crc()); + assert (p1.fel1Id() == p2.fel1Id()); + assert (p1.febcId() == p2.febcId()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcPad& p1, + const RpcPad& p2) +{ + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.onlineId() == p2.onlineId()); + //assert (p1.lvl1Id() == p2.lvl1Id()); + //assert (p1.bcId() == p2.bcId()); + assert (p1.status() == p2.status()); + assert (p1.errorCode() == p2.errorCode()); + assert (p1.sector() == p2.sector()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcPadContainer& p1, + const RpcPadContainer& p2) +{ + RpcPadContainer::const_iterator it1 = p1.begin(); + RpcPadContainer::const_iterator end1 = p1.end(); + RpcPadContainer::const_iterator it2 = p2.begin(); + RpcPadContainer::const_iterator end2 = p2.end(); + for (; it1 != end1; ++it1, ++it2) { + assert (it2 != end2); + assert (it1.hashId() == it2.hashId()); + compare (**it1, **it2); + } + assert (it2 == end2); +} + + +void testit (const RpcPadContainer& trans1, IRPCcablingSvc* cabling) +{ + MsgStream log (0, "test"); + RpcPadContainerCnv_p2 cnv; + cnv.initialize (log, cabling); + RpcPadContainer_p2 pers; + cnv.transToPers (&trans1, &pers, log); + std::unique_ptr<RpcPadContainer> trans2 (cnv.createTransient (&pers, log)); + compare (trans1, *trans2); +} + + +void test1 (IRPCcablingSvc* cabling) +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + RpcPadContainer trans1 (3); + unsigned int ids[3] = {0x6024c400, 0x603b6800, 0x603e5400}; + for (int k=0; k < 3; k++) { + int koffs = k*50; + auto pad = std::make_unique<RpcPad> (Identifier(ids[k]), + k, + 985+koffs, + 984+koffs, + 983+koffs, + 982+koffs, + 981+koffs, + 980+koffs); + + for (int j=0; j < 5; j++) { + int joffs = j*100; + auto cm = std::make_unique<RpcCoinMatrix> (Identifier (123+joffs), + 234+joffs, 345+joffs, + 456+joffs, 576+joffs); + + for (int i=0; i < 10; i++) { + int ioffs = 1000*i; + if (i < 7) + cm->push_back (new RpcFiredChannel (321+ioffs, 432+ioffs, + i, 534+ioffs)); + else + cm->push_back (new RpcFiredChannel (213+ioffs, 324+ioffs, 7, + 435+ioffs, 546+ioffs)); + } + + pad->push_back (std::move (cm)); + } + trans1.addCollection (pad.release(), k); + } + + testit (trans1, cabling); +} + + +int main() +{ + ISvcLocator* pSvcLoc; + if (!Athena_test::initGaudi("MuonEventAthenaPool_test.txt", pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + make_dd(); + + ServiceHandle<IRPCcablingSvc> cabling ("TestRPC_CablingSvc", "test"); + if (cabling.retrieve().isFailure()) { + std::cerr << "Cannot get cabling\n"; + return 0; + } + + test1 (cabling.get()); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcSectorLogicContainerCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcSectorLogicContainerCnv_p1_test.cxx new file mode 100644 index 00000000000..79d944347b8 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/RpcSectorLogicContainerCnv_p1_test.cxx @@ -0,0 +1,114 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/RpcSectorLogicContainerCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/RpcSectorLogicContainerCnv_p1.h" +#include "GaudiKernel/MsgStream.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +void compare (const RpcSLTriggerHit& p1, + const RpcSLTriggerHit& p2) +{ + assert (p1.rowinBcid() == p2.rowinBcid()); + assert (p1.padId() == p2.padId()); + assert (p1.ptId() == p2.ptId()); + assert (p1.roi() == p2.roi()); + + assert (p1.outerPlane() == p2.outerPlane()); + assert (p1.overlapPhi() == p2.overlapPhi()); + assert (p1.overlapEta() == p2.overlapEta()); + + assert (p1.triggerBcid() == p2.triggerBcid()); + assert (p1.isInput() == p2.isInput()); +} + + +void compare (const RpcSectorLogic& p1, + const RpcSectorLogic& p2) +{ + assert (p1.sectorId() == p2.sectorId()); + assert (p1.fel1Id() == p2.fel1Id()); + assert (p1.bcid() == p2.bcid()); + assert (p1.errorCode() == p2.errorCode()); + assert (p1.crc() == p2.crc()); + assert (p1.hasMoreThan2TriggerCand() == p2.hasMoreThan2TriggerCand()); + assert (p1.counters() == p2.counters()); + assert (p1.triggerRates() == p2.triggerRates()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void compare (const RpcSectorLogicContainer& p1, + const RpcSectorLogicContainer& p2) +{ + assert (p1.sectorList()[0] == p2.sectorList()[0]); + assert (p1.sectorList()[1] == p2.sectorList()[1]); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const RpcSectorLogicContainer& trans1) +{ + MsgStream log (0, "test"); + RpcSectorLogicContainerCnv_p1 cnv; + RpcSectorLogicContainer_p1 pers; + cnv.transToPers (&trans1, &pers, log); + RpcSectorLogicContainer trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + RpcSectorLogicContainer trans1; + RpcSectorLogicContainer::SectorList_t sectorList { 123, 345 }; + trans1.setSectorList (sectorList); + for (int i=0; i < 3; i++) { + int ioffs = 10*i; + auto sl = std::make_unique<RpcSectorLogic> (321+ioffs, 432+ioffs, 543+ioffs, 654+ioffs, 765+ioffs); + sl->setHasMoreThan2TriggerCand ((i&1) != 0); + sl->addCounter (ioffs); + sl->addCounter (ioffs+1); + sl->addTriggerRate (ioffs + 55.5); + sl->addTriggerRate (ioffs + 56.5); + + for (int j=0; j < 5; j++) { + int joffs = j*100 + ioffs; + auto hit = std::make_unique<RpcSLTriggerHit>(1+joffs, 2+joffs, 3+joffs, 4+joffs, 5+joffs, 6+joffs, 7+joffs, 8+joffs); + hit->setIsInput ((j&1) == 0); + sl->push_back (std::move(hit)); + } + + trans1.push_back (std::move (sl)); + } + + testit (trans1); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p1_test.cxx new file mode 100644 index 00000000000..114f4408dc7 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p1_test.cxx @@ -0,0 +1,141 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRawDataCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRawDataCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + //assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + //assert (p1.tracklet() == p2.tracklet()); + //assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + //assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + //assert (p1.segment() == p2.segment()); + //assert (p1.subMatrix() == p2.subMatrix()); + //assert (p1.sector() == p2.sector()); + //assert (p1.chip() == p2.chip()); + //assert (p1.isHipt() == p2.isHipt()); + //assert (p1.hitId() == p2.hitId()); + //assert (p1.hsub() == p2.hsub()); + //assert (p1.isStrip() == p2.isStrip()); + //assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + //assert (p1.threshold() == p2.threshold()); + //assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + //assert (p1.roi() == p2.roi()); +} + + +void testit (const TgcRawData& trans1) +{ + MsgStream log (0, "test"); + TgcRawDataCnv_p1 cnv; + TgcRawData_p1 pers; + //cnv.transToPers (&trans1, &pers, log); + + pers.m_bcTag = trans1.bcTag(); + pers.m_subDetectorId = trans1.subDetectorId(); + pers.m_rodId = trans1.rodId(); + pers.m_l1Id = trans1.l1Id(); + pers.m_bcId = trans1.bcId(); + pers.m_index = trans1.index(); + pers.m_delta = trans1.delta(); + pers.m_sswId = trans1.sswId(); + pers.m_slbId = trans1.slbId(); + pers.m_bitpos = trans1.bitpos(); + pers.m_pos = trans1.position(); + pers.m_isCoincidence = true; + pers.m_type = 99; + if (trans1.type() == TgcRawData::TYPE_TRACKLET) { + if (trans1.slbType() == TgcRawData::SLB_TYPE_DOUBLET_WIRE) + pers.m_type = 0; + else if (trans1.slbType() == TgcRawData::SLB_TYPE_TRIPLET_WIRE) + pers.m_type = 1; + else if (trans1.slbType() == TgcRawData::SLB_TYPE_TRIPLET_STRIP) + pers.m_type = 2; + } + else if (trans1.type() == TgcRawData::TYPE_HIPT) + pers.m_type = 3; + else if (trans1.type() == TgcRawData::TYPE_SL) + pers.m_type = 4; + else if (trans1.type() == TgcRawData::TYPE_HIT) + pers.m_type = 10; + + TgcRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + // hit + TgcRawData trans1 (1, 2, 3, 4, 5, 6, 7, 8); + testit (trans1); + + // trigger coincidence + TgcRawData trans2 (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21); + testit (trans2); + + // P2 hits + TgcRawData trans3 (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39); + testit (trans3); + + // tracklets + TgcRawData trans4 (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51); + testit (trans4); + + // high-pt + TgcRawData trans5 (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72); + testit (trans5); + + // sector logic + TgcRawData trans6 (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79); + testit (trans6); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p2_test.cxx new file mode 100644 index 00000000000..43ad4227635 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p2_test.cxx @@ -0,0 +1,112 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRawDataCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRawDataCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + assert (p1.tracklet() == p2.tracklet()); + assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + assert (p1.segment() == p2.segment()); + assert (p1.subMatrix() == p2.subMatrix()); + assert (p1.sector() == p2.sector()); + assert (p1.chip() == p2.chip()); + assert (p1.isHipt() == p2.isHipt()); + assert (p1.hitId() == p2.hitId()); + assert (p1.hsub() == p2.hsub()); + assert (p1.isStrip() == p2.isStrip()); + //assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + assert (p1.threshold() == p2.threshold()); + assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + assert (p1.roi() == p2.roi()); +} + + +void testit (const TgcRawData& trans1) +{ + MsgStream log (0, "test"); + TgcRawDataCnv_p2 cnv; + TgcRawData_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TgcRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + // hit + TgcRawData trans1 (1, 2, 3, 4, 5, 6, 7, 8); + testit (trans1); + + // trigger coincidence + TgcRawData trans2 (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21); + testit (trans2); + + // P2 hits + TgcRawData trans3 (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39); + testit (trans3); + + // tracklets + TgcRawData trans4 (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51); + testit (trans4); + + // high-pt + TgcRawData trans5 (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72); + testit (trans5); + + // sector logic + TgcRawData trans6 (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79); + testit (trans6); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p3_test.cxx new file mode 100644 index 00000000000..dfb466dc000 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRawDataCnv_p3_test.cxx @@ -0,0 +1,112 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRawDataCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRawDataCnv_p3.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + assert (p1.tracklet() == p2.tracklet()); + assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + assert (p1.segment() == p2.segment()); + assert (p1.subMatrix() == p2.subMatrix()); + assert (p1.sector() == p2.sector()); + assert (p1.chip() == p2.chip()); + assert (p1.isHipt() == p2.isHipt()); + assert (p1.hitId() == p2.hitId()); + assert (p1.hsub() == p2.hsub()); + assert (p1.isStrip() == p2.isStrip()); + assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + assert (p1.threshold() == p2.threshold()); + assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + assert (p1.roi() == p2.roi()); +} + + +void testit (const TgcRawData& trans1) +{ + MsgStream log (0, "test"); + TgcRawDataCnv_p3 cnv; + TgcRawData_p3 pers; + cnv.transToPers (&trans1, &pers, log); + TgcRawData trans2; + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + Athena_test::Leakcheck check; + + // hit + TgcRawData trans1 (1, 2, 3, 4, 5, 6, 7, 8); + testit (trans1); + + // trigger coincidence + TgcRawData trans2 (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21); + testit (trans2); + + // P2 hits + TgcRawData trans3 (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39); + testit (trans3); + + // tracklets + TgcRawData trans4 (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51); + testit (trans4); + + // high-pt + TgcRawData trans5 (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72); + testit (trans5); + + // sector logic + TgcRawData trans6 (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79); + testit (trans6); +} + + +int main() +{ + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p1_test.cxx new file mode 100644 index 00000000000..03135b5bb0d --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p1_test.cxx @@ -0,0 +1,253 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRdoCnv_p1_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRdoCnv_p1.h" +#include "TestTools/leakcheck.h" +#include "TestTools/initGaudi.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + //assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + //assert (p1.tracklet() == p2.tracklet()); + //assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + //assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + //assert (p1.segment() == p2.segment()); + //assert (p1.subMatrix() == p2.subMatrix()); + //assert (p1.sector() == p2.sector()); + //assert (p1.chip() == p2.chip()); + //assert (p1.isHipt() == p2.isHipt()); + //assert (p1.hitId() == p2.hitId()); + //assert (p1.hsub() == p2.hsub()); + //assert (p1.isStrip() == p2.isStrip()); + //assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + //assert (p1.threshold() == p2.threshold()); + //assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + //assert (p1.roi() == p2.roi()); +} + + +void compare (const TgcRdo::Errors& p1, + const TgcRdo::Errors& p2) +{ + assert (p1.badBcID == p2.badBcID); + assert (p1.badL1Id == p2.badL1Id); + assert (p1.timedout == p2.timedout); + assert (p1.badData == p2.badData); + assert (p1.overflow == p2.overflow); +} + + +void compare (const TgcRdo::RodStatus& p1, + const TgcRdo::RodStatus& p2) +{ + assert (p1.EC_RXsend == p2.EC_RXsend); + assert (p1.EC_FELdown == p2.EC_FELdown); + assert (p1.EC_frame == p2.EC_frame); + assert (p1.EC_Glnk == p2.EC_Glnk); + assert (p1.EC_xor == p2.EC_xor); + assert (p1.EC_ovfl == p2.EC_ovfl); + assert (p1.EC_timeout == p2.EC_timeout); + assert (p1.EC_xormezz == p2.EC_xormezz); + assert (p1.EC_wc0 == p2.EC_wc0); + assert (p1.EC_L1ID == p2.EC_L1ID); + assert (p1.EC_nohdr == p2.EC_nohdr); + assert (p1.EC_rectype == p2.EC_rectype); + assert (p1.EC_null == p2.EC_null); + assert (p1.EC_order == p2.EC_order); + assert (p1.EC_LDB == p2.EC_LDB); + assert (p1.EC_RXovfl == p2.EC_RXovfl); + assert (p1.EC_SSWerr == p2.EC_SSWerr); + assert (p1.EC_sbid == p2.EC_sbid); + assert (p1.EC_unxsbid == p2.EC_unxsbid); + assert (p1.EC_dupsb == p2.EC_dupsb); + assert (p1.EC_ec4 == p2.EC_ec4); + assert (p1.EC_bc == p2.EC_bc); + assert (p1.EC_celladr == p2.EC_celladr); + assert (p1.EC_hitovfl == p2.EC_hitovfl); + assert (p1.EC_trgbit == p2.EC_trgbit); + assert (p1.EC_badEoE == p2.EC_badEoE); + assert (p1.EC_endWCnot0 == p2.EC_endWCnot0); + assert (p1.EC_noEoE == p2.EC_noEoE); +} + + +void compare (const TgcRdo::LocalStatus& p1, + const TgcRdo::LocalStatus& p2) +{ + assert (p1.mergedHitBCs == p2.mergedHitBCs); + assert (p1.mergedTrackletBCs == p2.mergedTrackletBCs); + assert (p1.sortedHits == p2.sortedHits); + assert (p1.sortedTracklets == p2.sortedTracklets); + assert (p1.hasRoI == p2.hasRoI); + assert (p1.fakeSsw == p2.fakeSsw); + assert (p1.fill1 == p2.fill1); +} + + +void compare (const TgcRdo& p1, + const TgcRdo& p2) +{ + //assert (p1.version() == p2.version()); + assert (p2.version() == 0); + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.triggerType() == p2.triggerType()); + assert (p1.bcId() == p2.bcId()); + assert (p1.l1Id() == p2.l1Id()); + //compare (p1.errors(), p2.errors()); + //compare (p1.rodStatus(), p2.rodStatus()); + //compare (p1.localStatus(), p2.localStatus()); + //assert (p1.orbit() == p2.orbit()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const TgcRdo& trans1) +{ + MsgStream log (0, "test"); + TgcRdoCnv_p1 cnv; + TgcRdo_p1 pers; + //cnv.transToPers (&trans1, &pers, log); + + pers.m_id = trans1.identify(); + pers.m_subDetectorId = trans1.subDetectorId(); + pers.m_rodId = trans1.rodId(); + pers.m_triggerType = trans1.triggerType(); + pers.m_bcId = trans1.bcId(); + pers.m_l1Id = trans1.l1Id(); + + pers.resize (trans1.size()); + for (size_t i = 0; i < trans1.size(); i++) { + TgcRawData_p1& pelt = pers[i]; + const TgcRawData& telt = *trans1[i]; + + pelt.m_bcTag = telt.bcTag(); + pelt.m_subDetectorId = telt.subDetectorId(); + pelt.m_rodId = telt.rodId(); + pelt.m_l1Id = telt.l1Id(); + pelt.m_bcId = telt.bcId(); + pelt.m_index = telt.index(); + pelt.m_delta = telt.delta(); + pelt.m_sswId = telt.sswId(); + pelt.m_slbId = telt.slbId(); + pelt.m_bitpos = telt.bitpos(); + pelt.m_pos = telt.position(); + pelt.m_isCoincidence = true; + pelt.m_type = 99; + if (telt.type() == TgcRawData::TYPE_TRACKLET) { + if (telt.slbType() == TgcRawData::SLB_TYPE_DOUBLET_WIRE) + pelt.m_type = 0; + else if (telt.slbType() == TgcRawData::SLB_TYPE_TRIPLET_WIRE) + pelt.m_type = 1; + else if (telt.slbType() == TgcRawData::SLB_TYPE_TRIPLET_STRIP) + pelt.m_type = 2; + } + else if (telt.type() == TgcRawData::TYPE_HIPT) + pelt.m_type = 3; + else if (telt.type() == TgcRawData::TYPE_SL) + pelt.m_type = 4; + else if (telt.type() == TgcRawData::TYPE_HIT) + pelt.m_type = 10; + } + + TgcRdo trans2 (0, 234); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + TgcRdo dum; + // Creates services --- call it once now to avoid tripping the leak checker. + dum.setOnlineId (3, 4); + + Athena_test::Leakcheck check; + + TgcRdo trans1 (123, 234); + trans1.setVersion (345); + trans1.setOnlineId (456, 567); + trans1.setTriggerType (678); + trans1.setBcId (789); + trans1.setL1Id (987); + trans1.setOrbit (876); + trans1.setErrors (0x0c); + trans1.setRodStatus (0x35); + trans1.setLocalStatus (0x0a); + + // hit + trans1.push_back (new TgcRawData (1, 2, 3, 4, 5, 6, 7, 8)); + + // trigger coincidence + trans1.push_back (new TgcRawData (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)); + + // P2 hits + trans1.push_back (new TgcRawData (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39)); + + // tracklets + trans1.push_back (new TgcRawData (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51)); + + // high-pt + trans1.push_back (new TgcRawData (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72)); + + // sector logic + trans1.push_back (new TgcRawData (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79)); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc; + if (!Athena_test::initGaudi("MuonEventAthenaPool_test.txt", pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p2_test.cxx new file mode 100644 index 00000000000..6aef49c64fc --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p2_test.cxx @@ -0,0 +1,210 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRdoCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRdoCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "TestTools/initGaudi.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + assert (p1.tracklet() == p2.tracklet()); + assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + assert (p1.segment() == p2.segment()); + assert (p1.subMatrix() == p2.subMatrix()); + assert (p1.sector() == p2.sector()); + assert (p1.chip() == p2.chip()); + assert (p1.isHipt() == p2.isHipt()); + assert (p1.hitId() == p2.hitId()); + assert (p1.hsub() == p2.hsub()); + assert (p1.isStrip() == p2.isStrip()); + //assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + assert (p1.threshold() == p2.threshold()); + assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + assert (p1.roi() == p2.roi()); +} + + +void compare (const TgcRdo::Errors& p1, + const TgcRdo::Errors& p2) +{ + assert (p1.badBcID == p2.badBcID); + assert (p1.badL1Id == p2.badL1Id); + assert (p1.timedout == p2.timedout); + assert (p1.badData == p2.badData); + assert (p1.overflow == p2.overflow); +} + + +void compare (const TgcRdo::RodStatus& p1, + const TgcRdo::RodStatus& p2) +{ + assert (p1.EC_RXsend == p2.EC_RXsend); + assert (p1.EC_FELdown == p2.EC_FELdown); + assert (p1.EC_frame == p2.EC_frame); + assert (p1.EC_Glnk == p2.EC_Glnk); + assert (p1.EC_xor == p2.EC_xor); + assert (p1.EC_ovfl == p2.EC_ovfl); + assert (p1.EC_timeout == p2.EC_timeout); + assert (p1.EC_xormezz == p2.EC_xormezz); + assert (p1.EC_wc0 == p2.EC_wc0); + assert (p1.EC_L1ID == p2.EC_L1ID); + assert (p1.EC_nohdr == p2.EC_nohdr); + assert (p1.EC_rectype == p2.EC_rectype); + assert (p1.EC_null == p2.EC_null); + assert (p1.EC_order == p2.EC_order); + assert (p1.EC_LDB == p2.EC_LDB); + assert (p1.EC_RXovfl == p2.EC_RXovfl); + assert (p1.EC_SSWerr == p2.EC_SSWerr); + assert (p1.EC_sbid == p2.EC_sbid); + assert (p1.EC_unxsbid == p2.EC_unxsbid); + assert (p1.EC_dupsb == p2.EC_dupsb); + assert (p1.EC_ec4 == p2.EC_ec4); + assert (p1.EC_bc == p2.EC_bc); + assert (p1.EC_celladr == p2.EC_celladr); + assert (p1.EC_hitovfl == p2.EC_hitovfl); + assert (p1.EC_trgbit == p2.EC_trgbit); + assert (p1.EC_badEoE == p2.EC_badEoE); + assert (p1.EC_endWCnot0 == p2.EC_endWCnot0); + assert (p1.EC_noEoE == p2.EC_noEoE); +} + + +void compare (const TgcRdo::LocalStatus& p1, + const TgcRdo::LocalStatus& p2) +{ + assert (p1.mergedHitBCs == p2.mergedHitBCs); + assert (p1.mergedTrackletBCs == p2.mergedTrackletBCs); + assert (p1.sortedHits == p2.sortedHits); + assert (p1.sortedTracklets == p2.sortedTracklets); + assert (p1.hasRoI == p2.hasRoI); + assert (p1.fakeSsw == p2.fakeSsw); + assert (p1.fill1 == p2.fill1); +} + + +void compare (const TgcRdo& p1, + const TgcRdo& p2) +{ + assert (p1.version() == p2.version()); + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.triggerType() == p2.triggerType()); + assert (p1.bcId() == p2.bcId()); + assert (p1.l1Id() == p2.l1Id()); + compare (p1.errors(), p2.errors()); + compare (p1.rodStatus(), p2.rodStatus()); + compare (p1.localStatus(), p2.localStatus()); + assert (p1.orbit() == p2.orbit()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const TgcRdo& trans1) +{ + MsgStream log (0, "test"); + TgcRdoCnv_p2 cnv; + TgcRdo_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TgcRdo trans2 (0, 234); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + TgcRdo dum; + // Creates services --- call it once now to avoid tripping the leak checker. + dum.setOnlineId (3, 4); + + Athena_test::Leakcheck check; + + TgcRdo trans1 (123, 234); + trans1.setVersion (345); + trans1.setOnlineId (456, 567); + trans1.setTriggerType (678); + trans1.setBcId (789); + trans1.setL1Id (987); + trans1.setOrbit (876); + trans1.setErrors (0x0c); + trans1.setRodStatus (0x35); + trans1.setLocalStatus (0x0a); + + // hit + trans1.push_back (new TgcRawData (1, 2, 3, 4, 5, 6, 7, 8)); + + // trigger coincidence + trans1.push_back (new TgcRawData (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)); + + // P2 hits + trans1.push_back (new TgcRawData (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39)); + + // tracklets + trans1.push_back (new TgcRawData (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51)); + + // high-pt + trans1.push_back (new TgcRawData (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72)); + + // sector logic + trans1.push_back (new TgcRawData (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79)); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc; + if (!Athena_test::initGaudi("MuonEventAthenaPool_test.txt", pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p3_test.cxx new file mode 100644 index 00000000000..6739a98d7fa --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/TgcRdoCnv_p3_test.cxx @@ -0,0 +1,210 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/TgcRdoCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "../src/TgcRdoCnv_p3.h" +#include "TestTools/leakcheck.h" +#include "TestTools/initGaudi.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +void compare (const TgcRawData& p1, + const TgcRawData& p2) +{ + assert (p1.bcTag() == p2.bcTag()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.sswId() == p2.sswId()); + assert (p1.slbId() == p2.slbId()); + assert (p1.l1Id() == p2.l1Id()); + assert (p1.bcId() == p2.bcId()); + assert (p1.slbType() == p2.slbType()); + assert (p1.bitpos() == p2.bitpos()); + assert (p1.tracklet() == p2.tracklet()); + assert (p1.isAdjacent() == p2.isAdjacent()); + assert (p1.type() == p2.type()); + assert (p1.isForward() == p2.isForward()); + assert (p1.index() == p2.index()); + assert (p1.position() == p2.position()); + assert (p1.delta() == p2.delta()); + assert (p1.segment() == p2.segment()); + assert (p1.subMatrix() == p2.subMatrix()); + assert (p1.sector() == p2.sector()); + assert (p1.chip() == p2.chip()); + assert (p1.isHipt() == p2.isHipt()); + assert (p1.hitId() == p2.hitId()); + assert (p1.hsub() == p2.hsub()); + assert (p1.isStrip() == p2.isStrip()); + assert (p1.inner() == p2.inner()); + assert (p1.cand3plus() == p2.cand3plus()); + assert (p1.isMuplus() == p2.isMuplus()); + assert (p1.threshold() == p2.threshold()); + assert (p1.isOverlap() == p2.isOverlap()); + assert (p1.isVeto() == p2.isVeto()); + assert (p1.roi() == p2.roi()); +} + + +void compare (const TgcRdo::Errors& p1, + const TgcRdo::Errors& p2) +{ + assert (p1.badBcID == p2.badBcID); + assert (p1.badL1Id == p2.badL1Id); + assert (p1.timedout == p2.timedout); + assert (p1.badData == p2.badData); + assert (p1.overflow == p2.overflow); +} + + +void compare (const TgcRdo::RodStatus& p1, + const TgcRdo::RodStatus& p2) +{ + assert (p1.EC_RXsend == p2.EC_RXsend); + assert (p1.EC_FELdown == p2.EC_FELdown); + assert (p1.EC_frame == p2.EC_frame); + assert (p1.EC_Glnk == p2.EC_Glnk); + assert (p1.EC_xor == p2.EC_xor); + assert (p1.EC_ovfl == p2.EC_ovfl); + assert (p1.EC_timeout == p2.EC_timeout); + assert (p1.EC_xormezz == p2.EC_xormezz); + assert (p1.EC_wc0 == p2.EC_wc0); + assert (p1.EC_L1ID == p2.EC_L1ID); + assert (p1.EC_nohdr == p2.EC_nohdr); + assert (p1.EC_rectype == p2.EC_rectype); + assert (p1.EC_null == p2.EC_null); + assert (p1.EC_order == p2.EC_order); + assert (p1.EC_LDB == p2.EC_LDB); + assert (p1.EC_RXovfl == p2.EC_RXovfl); + assert (p1.EC_SSWerr == p2.EC_SSWerr); + assert (p1.EC_sbid == p2.EC_sbid); + assert (p1.EC_unxsbid == p2.EC_unxsbid); + assert (p1.EC_dupsb == p2.EC_dupsb); + assert (p1.EC_ec4 == p2.EC_ec4); + assert (p1.EC_bc == p2.EC_bc); + assert (p1.EC_celladr == p2.EC_celladr); + assert (p1.EC_hitovfl == p2.EC_hitovfl); + assert (p1.EC_trgbit == p2.EC_trgbit); + assert (p1.EC_badEoE == p2.EC_badEoE); + assert (p1.EC_endWCnot0 == p2.EC_endWCnot0); + assert (p1.EC_noEoE == p2.EC_noEoE); +} + + +void compare (const TgcRdo::LocalStatus& p1, + const TgcRdo::LocalStatus& p2) +{ + assert (p1.mergedHitBCs == p2.mergedHitBCs); + assert (p1.mergedTrackletBCs == p2.mergedTrackletBCs); + assert (p1.sortedHits == p2.sortedHits); + assert (p1.sortedTracklets == p2.sortedTracklets); + assert (p1.hasRoI == p2.hasRoI); + assert (p1.fakeSsw == p2.fakeSsw); + assert (p1.fill1 == p2.fill1); +} + + +void compare (const TgcRdo& p1, + const TgcRdo& p2) +{ + assert (p1.version() == p2.version()); + assert (p1.identify() == p2.identify()); + assert (p1.identifyHash() == p2.identifyHash()); + assert (p1.subDetectorId() == p2.subDetectorId()); + assert (p1.rodId() == p2.rodId()); + assert (p1.triggerType() == p2.triggerType()); + assert (p1.bcId() == p2.bcId()); + assert (p1.l1Id() == p2.l1Id()); + compare (p1.errors(), p2.errors()); + compare (p1.rodStatus(), p2.rodStatus()); + compare (p1.localStatus(), p2.localStatus()); + assert (p1.orbit() == p2.orbit()); + + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (*p1[i], *p2[i]); +} + + +void testit (const TgcRdo& trans1) +{ + MsgStream log (0, "test"); + TgcRdoCnv_p3 cnv; + TgcRdo_p3 pers; + cnv.transToPers (&trans1, &pers, log); + TgcRdo trans2 (0, 234); + cnv.persToTrans (&pers, &trans2, log); + compare (trans1, trans2); +} + + +void test1() +{ + std::cout << "test1\n"; + + TgcRdo dum; + // Creates services --- call it once now to avoid tripping the leak checker. + dum.setOnlineId (3, 4); + + Athena_test::Leakcheck check; + + TgcRdo trans1 (123, 234); + trans1.setVersion (345); + trans1.setOnlineId (456, 567); + trans1.setTriggerType (678); + trans1.setBcId (789); + trans1.setL1Id (987); + trans1.setOrbit (876); + trans1.setErrors (0x0c); + trans1.setRodStatus (0x35); + trans1.setLocalStatus (0x0a); + + // hit + trans1.push_back (new TgcRawData (1, 2, 3, 4, 5, 6, 7, 8)); + + // trigger coincidence + trans1.push_back (new TgcRawData (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)); + + // P2 hits + trans1.push_back (new TgcRawData (31, 32, 33, 34, 35, 36, 37, + TgcRawData::SLB_TYPE_DOUBLET_STRIP, + true, 38, 39)); + + // tracklets + trans1.push_back (new TgcRawData (41, 42, 43, 44, 45, 46, 47, + TgcRawData::SLB_TYPE_TRIPLET_WIRE, + 48, 49, 50, 51)); + + // high-pt + trans1.push_back (new TgcRawData (61, 62, 63, 64, 65, true, false, 66, 67, 68, true, + 69, 70, 71, 72)); + + // sector logic + trans1.push_back (new TgcRawData (71, 72, 73, 74, 75, false, true, 76, 77, false, + 78, true, false, 79)); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc; + if (!Athena_test::initGaudi("MuonEventAthenaPool_test.txt", pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/make_dd.icc b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/make_dd.icc new file mode 100644 index 00000000000..ff5c04a57a9 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/test/make_dd.icc @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventAthenaPool/test/make_dd.icc + * @author scott snyder <snyder@bnl.gov> + * @date Nov, 2016 + * @brief Helper for regression tests. + */ + + +#include "MuonIdHelpers/RpcIdHelper.h" +#include "RPCcablingInterface/RDOindex.h" +#include "IdDictParser/IdDictParser.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ISvcLocator.h" + + + +void make_dd() +{ + ISvcLocator* svcLoc = Gaudi::svcLocator(); + StoreGateSvc* sg = 0; + assert ( svcLoc->service("DetectorStore", sg).isSuccess() ); + + static IdDictParser parser; + parser.register_external_entity ("InnerDetector", + "IdDictInnerDetector.xml"); + parser.register_external_entity ("MuonSpectrometer", + "IdDictMuonSpectrometer_S.02.xml"); + parser.register_external_entity ("Calorimeter", + "IdDictCalorimeter_L1Onl.xml"); + parser.register_external_entity ("LArCalorimeter", + "IdDictLArCalorimeter.xml"); + IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml"); + + + auto rpc_id = std::make_unique<RpcIdHelper>(); + rpc_id->initialize_from_dictionary (idd); + RDOindex::setRpcIdHelper (rpc_id.get()); + assert ( sg->record (std::move (rpc_id), "RPCIDHELPER") ); + +} + + -- GitLab