From 9a811ecd5fe91e7fff00d0176a797413e5447f87 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 09:55:53 +0200 Subject: [PATCH 01/56] CxxUtils: add checkergcc plugins config file Add a configuration file for the gcc checker plugins. Enable the thread-checker for those directory trees that are (mostly) clean. --- Control/CxxUtils/CMakeLists.txt | 6 +++--- Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in | 6 ++++-- Control/CxxUtils/share/checkergcc.config | 13 +++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 Control/CxxUtils/share/checkergcc.config diff --git a/Control/CxxUtils/CMakeLists.txt b/Control/CxxUtils/CMakeLists.txt index d1717711cd2..ae7b3ce7e41 100644 --- a/Control/CxxUtils/CMakeLists.txt +++ b/Control/CxxUtils/CMakeLists.txt @@ -148,13 +148,13 @@ if( ATLAS_RELEASE_MODE ) return() endif() -# Install the ubsan.supp file already during the CMake configuration. +# Install the ubsan and gccchecker config files already during the CMake configuration. # This is necessary because the file may be needed very early during the # build, and we don't explicitly make everything else wait for this # file's installation. Creating a race condition. -file( INSTALL share/ubsan.supp +file( INSTALL share/ubsan.supp share/checkergcc.config DESTINATION ${CMAKE_SHARE_OUTPUT_DIRECTORY} ) -install( FILES share/ubsan.supp +install( FILES share/ubsan.supp share/checkergcc.config DESTINATION ${CMAKE_INSTALL_SHAREDIR} ) # Set the directory to put the configured environment setup file into: diff --git a/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in b/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in index 00f62a107f0..c69e0a771d5 100644 --- a/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in +++ b/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in @@ -1,4 +1,4 @@ -# $Id$ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # # This module is used to set up run-time environment variables relating # to the compiler. @@ -9,7 +9,9 @@ # Set the environment variables: set( CXXUTILSENVIRONMENT_ENVIRONMENT FORCESET UBSAN_OPTIONS - suppressions=\${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/ubsan.supp ) + suppressions=\${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/ubsan.supp + FORCESET CHECKERGCCPLUGINS_CONFIG + \${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/checkergcc.config ) # Silently declare the module found: set( CXXUTILSENVIRONMENT_FOUND TRUE ) diff --git a/Control/CxxUtils/share/checkergcc.config b/Control/CxxUtils/share/checkergcc.config new file mode 100644 index 00000000000..07162ae4bd8 --- /dev/null +++ b/Control/CxxUtils/share/checkergcc.config @@ -0,0 +1,13 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# +# Configuration file for the checkergcc plugins. +# see https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins + +[thread.check_paths] +Calorimeter +-Calorimeter/CaloRec +-Calorimeter/CaloCnv/CaloJiveXML +HLT +MagneticField +Tools +-Tools/LWHists -- GitLab From 1a4e718126ab2db10243f41ec99ba09c970cb89c Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 12:10:44 +0200 Subject: [PATCH 02/56] TrigGpuTest: enable thread-checker and fixes --- .../TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY | 1 + Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..48b5dadb7c8 --- /dev/null +++ b/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigAccel/TrigGpuTest diff --git a/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx b/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx index 83dca524a5a..12a0086fdf2 100644 --- a/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx +++ b/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) { if(argc < 4) { std::cout<<"trigGpuTest usage: ./trigGpuTest nevents"<run(); -- GitLab From 11f066a72d6bdecf0dfe13e3b7b50b5c5601fd9f Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 12:25:21 +0200 Subject: [PATCH 03/56] TrigT1EventAthenaPool: enable thread-checker and fixes --- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../src/CMMCPHitsCollectionCnv.cxx | 2 +- .../src/CMMEtSumsCollectionCnv.cxx | 2 +- .../src/CMMJetHitsCollectionCnv.cxx | 2 +- .../TrigT1EventAthenaPool/src/CMMRoICnv.cxx | 2 +- .../src/CMXCPHitsCollectionCnv.cxx | 2 +- .../src/CMXCPTobCollectionCnv.cxx | 2 +- .../src/CMXEtSumsCollectionCnv.cxx | 2 +- .../src/CMXJetHitsCollectionCnv.cxx | 2 +- .../src/CMXJetTobCollectionCnv.cxx | 2 +- .../TrigT1EventAthenaPool/src/CMXRoICnv.cxx | 2 +- .../src/CPMHitsCollectionCnv.cxx | 2 +- .../src/CPMRoICollectionCnv.cxx | 2 +- .../src/CPMTobRoICollectionCnv.cxx | 2 +- .../src/CPMTowerCollectionCnv.cxx | 2 +- .../TrigT1EventAthenaPool/src/CTP_RDOCnv.cxx | 23 ++++++------------- .../TrigT1EventAthenaPool/src/CTP_RDOCnv.h | 11 ++++++--- .../src/JEMEtSumsCollectionCnv.cxx | 2 +- .../src/JEMHitsCollectionCnv.cxx | 2 +- .../src/JEMRoICollectionCnv.cxx | 2 +- .../src/JEMTobRoICollectionCnv.cxx | 2 +- .../src/JetElementCollectionCnv.cxx | 4 ++-- .../src/MuCTPI_RDOCnv.cxx | 17 ++++---------- .../TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.h | 7 +++--- .../src/RODHeaderCollectionCnv.cxx | 2 +- .../src/RoIBResultCnv.cxx | 17 ++++---------- .../TrigT1EventAthenaPool/src/RoIBResultCnv.h | 8 ++++--- .../src/TriggerTowerCollectionCnv.cxx | 4 ++-- 28 files changed, 58 insertions(+), 72 deletions(-) create mode 100644 Trigger/TrigT1/TrigT1EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigT1/TrigT1EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..f9085f6660a --- /dev/null +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigT1/TrigT1EventAthenaPool diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMCPHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMCPHitsCollectionCnv.cxx index ca90ee7e2d2..c2b2728f9c5 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMCPHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMCPHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMMCPHitsCollection * CMMCPHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMMCPHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "8C6E0191-FAE9-4C2E-BD0A-E6A5518145E2" ); + static const pool::Guid tlp1_guid( "8C6E0191-FAE9-4C2E-BD0A-E6A5518145E2" ); CMMCPHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMEtSumsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMEtSumsCollectionCnv.cxx index 9914c53bbf3..e18ddfe83c5 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMEtSumsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMEtSumsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMMEtSumsCollection * CMMEtSumsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMMEtSumsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "DAB02AE0-736D-4C24-AC21-E6F12B3A4FE3" ); + static const pool::Guid tlp1_guid( "DAB02AE0-736D-4C24-AC21-E6F12B3A4FE3" ); CMMEtSumsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMJetHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMJetHitsCollectionCnv.cxx index a1cad083c70..f02f542577a 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMJetHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMJetHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMMJetHitsCollection * CMMJetHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMMJetHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "972519B8-F2B3-4205-A0B1-06678460918F" ); + static const pool::Guid tlp1_guid( "972519B8-F2B3-4205-A0B1-06678460918F" ); CMMJetHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMRoICnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMRoICnv.cxx index da096d3b598..5c5db6c9633 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMRoICnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMMRoICnv.cxx @@ -34,7 +34,7 @@ CMMRoI * CMMRoICnv::createTransient() //mlog << MSG::DEBUG << "CMMRoICnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "AF2D0BF8-8B28-4BFD-92B1-67F4708039C3" ); + static const pool::Guid p1_guid( "AF2D0BF8-8B28-4BFD-92B1-67F4708039C3" ); if ( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPHitsCollectionCnv.cxx index 8bc7cea1aec..0f7c9be6c54 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMXCPHitsCollection * CMXCPHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMXCPHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "1A1F6DEF-0233-453C-8614-E7B82EFCEDC6" ); + static const pool::Guid tlp1_guid( "1A1F6DEF-0233-453C-8614-E7B82EFCEDC6" ); CMXCPHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPTobCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPTobCollectionCnv.cxx index f3ef4ae3454..75eaed09452 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPTobCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXCPTobCollectionCnv.cxx @@ -32,7 +32,7 @@ CMXCPTobCollection * CMXCPTobCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMXCPTobCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "0E42AA28-7C10-4934-9E54-97C38C249544" ); + static const pool::Guid tlp1_guid( "0E42AA28-7C10-4934-9E54-97C38C249544" ); CMXCPTobCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXEtSumsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXEtSumsCollectionCnv.cxx index 047ae1060be..462ff03c02b 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXEtSumsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXEtSumsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMXEtSumsCollection * CMXEtSumsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMXEtSumsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "8CC9CAAB-5A8B-4581-BA66-C762BA7CB565" ); + static const pool::Guid tlp1_guid( "8CC9CAAB-5A8B-4581-BA66-C762BA7CB565" ); CMXEtSumsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetHitsCollectionCnv.cxx index 7807e012110..5594b0af430 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ CMXJetHitsCollection * CMXJetHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMXJetHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "29388465-59FE-452C-9462-45C3022F5F2B" ); + static const pool::Guid tlp1_guid( "29388465-59FE-452C-9462-45C3022F5F2B" ); CMXJetHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetTobCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetTobCollectionCnv.cxx index 470cf5bdda2..1b4af36271f 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetTobCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXJetTobCollectionCnv.cxx @@ -32,7 +32,7 @@ CMXJetTobCollection * CMXJetTobCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CMXJetTobCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "3FD32EB7-6573-4BCD-A510-6A5549E495A4" ); + static const pool::Guid tlp1_guid( "3FD32EB7-6573-4BCD-A510-6A5549E495A4" ); CMXJetTobCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXRoICnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXRoICnv.cxx index 0a8a4cc6380..a2e6d74a8e7 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXRoICnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CMXRoICnv.cxx @@ -36,7 +36,7 @@ CMXRoI * CMXRoICnv::createTransient() //mlog << MSG::DEBUG << "CMXRoICnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "6EE27E92-E8DE-4F07-810F-025A1450E3BE" ); + static const pool::Guid p1_guid( "6EE27E92-E8DE-4F07-810F-025A1450E3BE" ); if ( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMHitsCollectionCnv.cxx index 485f4c1808a..0353e268fa2 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ CPMHitsCollection * CPMHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CPMHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "4A309D12-C11D-4666-8253-72522BF7948E" ); + static const pool::Guid tlp1_guid( "4A309D12-C11D-4666-8253-72522BF7948E" ); CPMHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMRoICollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMRoICollectionCnv.cxx index 317fa826f3c..941b3b06750 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMRoICollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMRoICollectionCnv.cxx @@ -32,7 +32,7 @@ CPMRoICollection * CPMRoICollectionCnv::createTransient() //mlog << MSG::DEBUG << "CPMRoICollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "A5867077-621F-4B04-8777-56846085E550" ); + static const pool::Guid tlp1_guid( "A5867077-621F-4B04-8777-56846085E550" ); CPMRoICollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTobRoICollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTobRoICollectionCnv.cxx index 4fcfcf2d174..bf3a0415f3f 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTobRoICollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTobRoICollectionCnv.cxx @@ -32,7 +32,7 @@ CPMTobRoICollection * CPMTobRoICollectionCnv::createTransient() //mlog << MSG::DEBUG << "CPMTobRoICollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "E575088B-8CD0-471C-A278-EA6E508A171E" ); + static const pool::Guid tlp1_guid( "E575088B-8CD0-471C-A278-EA6E508A171E" ); CPMTobRoICollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTowerCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTowerCollectionCnv.cxx index fc9ecd9c13c..a2c8331dd7c 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTowerCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CPMTowerCollectionCnv.cxx @@ -32,7 +32,7 @@ CPMTowerCollection * CPMTowerCollectionCnv::createTransient() //mlog << MSG::DEBUG << "CPMTowerCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "AF950A9C-D929-4E3D-8B95-53D0B36B78D8" ); + static const pool::Guid tlp1_guid( "AF950A9C-D929-4E3D-8B95-53D0B36B78D8" ); CPMTowerCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.cxx index 74dad229b89..70dd85a4fc7 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.cxx @@ -1,23 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // Gaudi/Athena include(s): #include "GaudiKernel/MsgStream.h" -// TrigT1 include(s): -#include "TrigT1EventTPCnv/CTP_RDOCnv_p1.h" -#include "TrigT1EventTPCnv/CTP_RDOCnv_p2.h" - // Local include(s): #include "CTP_RDOCnv.h" -/// The converter for translating the information between -/// transient and persistent objects -static CTP_RDOCnv_p2 TPConverter; -static CTP_RDOCnv_p1 TPConverter_p1; - /** * Function creating a persistent CTP_RDO_PERS object from a transient * CTP_RDO one. @@ -25,7 +16,7 @@ static CTP_RDOCnv_p1 TPConverter_p1; CTP_RDO_PERS* CTP_RDOCnv::createPersistent( CTP_RDO* transObj ) { MsgStream log( this->msgSvc(), "CTP_RDOCnv" ); - return TPConverter.createPersistent( transObj, log ); + return m_converter.createPersistent( transObj, log ); } @@ -35,21 +26,21 @@ CTP_RDO_PERS* CTP_RDOCnv::createPersistent( CTP_RDO* transObj ) { */ CTP_RDO* CTP_RDOCnv::createTransient() { - static pool::Guid p2_guid( "12717F15-E516-4ECD-BC07-82C72B524AD5" ); - static pool::Guid p1_guid( "5E6D3E52-952F-4144-BC68-83ACE605AA45" ); - static pool::Guid p0_guid( "56C714CC-DC17-4927-B413-9151C82792BB" ); + static const pool::Guid p2_guid( "12717F15-E516-4ECD-BC07-82C72B524AD5" ); + static const pool::Guid p1_guid( "5E6D3E52-952F-4144-BC68-83ACE605AA45" ); + static const pool::Guid p0_guid( "56C714CC-DC17-4927-B413-9151C82792BB" ); if( this->compareClassGuid( p2_guid ) ) { std::unique_ptr< CTP_RDO_p2 > pers_ref( this->poolReadObject< CTP_RDO_p2 >() ); MsgStream log( this->msgSvc(), "CTP_RDOCnv" ); - return TPConverter.createTransient( pers_ref.get(), log ); + return m_converter.createTransient( pers_ref.get(), log ); } else if( this->compareClassGuid( p1_guid ) ) { std::unique_ptr< CTP_RDO_p1 > pers_ref( this->poolReadObject< CTP_RDO_p1 >() ); MsgStream log( this->msgSvc(), "CTP_RDOCnv" ); - return TPConverter_p1.createTransient( pers_ref.get(), log ); + return m_converter_p1.createTransient( pers_ref.get(), log ); } else if( this->compareClassGuid( p0_guid ) ) { diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.h b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.h index 75f5634be0f..6cacd8c1d65 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.h +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/CTP_RDOCnv.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1EVENTATHENAPOOL_CTP_RDOCNV_H @@ -14,6 +14,9 @@ #include "TrigT1Result/CTP_RDO.h" #include "TrigT1EventTPCnv/CTP_RDO_p1.h" #include "TrigT1EventTPCnv/CTP_RDO_p2.h" +#include "TrigT1EventTPCnv/CTP_RDOCnv_p1.h" +#include "TrigT1EventTPCnv/CTP_RDOCnv_p2.h" + // Define the latest persistent representation of CTP_RDO: typedef CTP_RDO_p2 CTP_RDO_PERS; @@ -25,8 +28,6 @@ typedef T_AthenaPoolCustomCnv< CTP_RDO, CTP_RDO_PERS > CTP_RDOCnvBase; * Custom POOL converter for the CTP_RDO object that implements the * T/P separation for the LVL1 object. * - * @version $Revision: 1.2 $ - * @date $Date: 2008-02-28 13:41:01 $ * @author Attila Krasznahorkay Jr., Wolfgang Ehrenfeld */ class CTP_RDOCnv : public CTP_RDOCnvBase { @@ -40,6 +41,10 @@ protected: virtual CTP_RDO_PERS* createPersistent( CTP_RDO* transObj ); virtual CTP_RDO* createTransient(); +private: + CTP_RDOCnv_p2 m_converter; + CTP_RDOCnv_p1 m_converter_p1; + }; // class CTP_RDOCnv diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMEtSumsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMEtSumsCollectionCnv.cxx index 35a86240b0a..b0ecd5a694c 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMEtSumsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMEtSumsCollectionCnv.cxx @@ -32,7 +32,7 @@ JEMEtSumsCollection * JEMEtSumsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "JEMEtSumsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "FFEF6FF1-31E5-492A-9A44-4AD5B79DB22B" ); + static const pool::Guid tlp1_guid( "FFEF6FF1-31E5-492A-9A44-4AD5B79DB22B" ); JEMEtSumsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMHitsCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMHitsCollectionCnv.cxx index 9a48dc4616f..66d552e0d9f 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMHitsCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMHitsCollectionCnv.cxx @@ -32,7 +32,7 @@ JEMHitsCollection * JEMHitsCollectionCnv::createTransient() //mlog << MSG::DEBUG << "JEMHitsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "A9D89195-219E-4F33-9B19-4684639CCA5B" ); + static const pool::Guid tlp1_guid( "A9D89195-219E-4F33-9B19-4684639CCA5B" ); JEMHitsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMRoICollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMRoICollectionCnv.cxx index b5a8154d4d6..00560c00cc5 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMRoICollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMRoICollectionCnv.cxx @@ -32,7 +32,7 @@ JEMRoICollection * JEMRoICollectionCnv::createTransient() //mlog << MSG::DEBUG << "JEMRoICollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "B82ECDA7-30FE-4F02-9BF3-EC507BA8CB04" ); + static const pool::Guid tlp1_guid( "B82ECDA7-30FE-4F02-9BF3-EC507BA8CB04" ); JEMRoICollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMTobRoICollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMTobRoICollectionCnv.cxx index bb99244a0f2..1cf61b86113 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMTobRoICollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JEMTobRoICollectionCnv.cxx @@ -32,7 +32,7 @@ JEMTobRoICollection * JEMTobRoICollectionCnv::createTransient() //mlog << MSG::DEBUG << "JEMTobRoICollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "49790040-16E0-4CAB-96A2-31DC010FFB06" ); + static const pool::Guid tlp1_guid( "49790040-16E0-4CAB-96A2-31DC010FFB06" ); JEMTobRoICollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JetElementCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JetElementCollectionCnv.cxx index 6e20e2bbecb..0f2d8c3a9de 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/JetElementCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/JetElementCollectionCnv.cxx @@ -32,8 +32,8 @@ JetElementCollection * JetElementCollectionCnv::createTransient() //mlog << MSG::DEBUG << "JetElementCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "132ABB53-1F89-4E0E-83A3-382338B278F3" ); - static pool::Guid p0_guid( "48B92167-4892-4694-9E9E-E201F1E1FFFE" ); + static const pool::Guid tlp1_guid( "132ABB53-1F89-4E0E-83A3-382338B278F3" ); + static const pool::Guid p0_guid( "48B92167-4892-4694-9E9E-E201F1E1FFFE" ); JetElementCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.cxx index 09071fbcb2c..ea47add722f 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.cxx @@ -1,21 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // Gaudi/Athena include(s): #include "GaudiKernel/MsgStream.h" -// TrigT1 include(s): -#include "TrigT1EventTPCnv/MuCTPI_RDOCnv_p1.h" - // Local include(s): #include "MuCTPI_RDOCnv.h" -/// The converter for translating the information between -/// transient and persistent objects -static MuCTPI_RDOCnv_p1 TPConverter; - /** * Function creating a persistent MuCTPI_RDO_PERS object from a transient * MuCTPI_RDO one. @@ -23,7 +16,7 @@ static MuCTPI_RDOCnv_p1 TPConverter; MuCTPI_RDO_PERS* MuCTPI_RDOCnv::createPersistent( MuCTPI_RDO* transObj ) { MsgStream log( this->msgSvc(), "MuCTPI_RDOCnv" ); - return TPConverter.createPersistent( transObj, log ); + return m_converter.createPersistent( transObj, log ); } @@ -33,14 +26,14 @@ MuCTPI_RDO_PERS* MuCTPI_RDOCnv::createPersistent( MuCTPI_RDO* transObj ) { */ MuCTPI_RDO* MuCTPI_RDOCnv::createTransient() { - static pool::Guid p1_guid( "406BC4C7-56B6-4956-A66A-B749BCD35009" ); - static pool::Guid p0_guid( "5BE3FA7E-CC70-4842-A095-CA046164764D" ); + static const pool::Guid p1_guid( "406BC4C7-56B6-4956-A66A-B749BCD35009" ); + static const pool::Guid p0_guid( "5BE3FA7E-CC70-4842-A095-CA046164764D" ); if( this->compareClassGuid( p1_guid ) ) { std::unique_ptr< MuCTPI_RDO_p1 > pers_ref( this->poolReadObject< MuCTPI_RDO_p1 >() ); MsgStream log( this->msgSvc(), "MuCTPI_RDOCnv" ); - return TPConverter.createTransient( pers_ref.get(), log ); + return m_converter.createTransient( pers_ref.get(), log ); } else if( this->compareClassGuid( p0_guid ) ) { diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.h b/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.h index 5f82e428c67..b6be81f6cf3 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.h +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/MuCTPI_RDOCnv.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1EVENTATHENAPOOL_MUCTPI_RDOCNV_H @@ -13,6 +13,7 @@ // TrigT1 include(s): #include "TrigT1Result/MuCTPI_RDO.h" #include "TrigT1EventTPCnv/MuCTPI_RDO_p1.h" +#include "TrigT1EventTPCnv/MuCTPI_RDOCnv_p1.h" // Define the latest persistent representation of MuCTPI_RDO: typedef MuCTPI_RDO_p1 MuCTPI_RDO_PERS; @@ -24,8 +25,6 @@ typedef T_AthenaPoolCustomCnv< MuCTPI_RDO, MuCTPI_RDO_PERS > MuCTPI_RDOCnvBase; * Custom POOL converter for the MuCTPI_RDO object that implements the * T/P separation for the LVL1 object. * - * @version $Revision: 1.1 $ - * @date $Date: 2007-10-12 14:42:11 $ * @author Attila Krasznahorkay Jr. */ class MuCTPI_RDOCnv : public MuCTPI_RDOCnvBase { @@ -39,6 +38,8 @@ protected: virtual MuCTPI_RDO_PERS* createPersistent( MuCTPI_RDO* transObj ); virtual MuCTPI_RDO* createTransient(); +private: + MuCTPI_RDOCnv_p1 m_converter; }; // class MuCTPI_RDOCnv diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RODHeaderCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RODHeaderCollectionCnv.cxx index 21dd6bfe637..f552dd3b858 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RODHeaderCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RODHeaderCollectionCnv.cxx @@ -32,7 +32,7 @@ RODHeaderCollection * RODHeaderCollectionCnv::createTransient() //mlog << MSG::DEBUG << "RODHeaderCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "8226F1B6-374D-424D-B059-E0A1B18A1DA7" ); + static const pool::Guid tlp1_guid( "8226F1B6-374D-424D-B059-E0A1B18A1DA7" ); RODHeaderCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.cxx index 819e0001046..8ac2b229990 100755 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.cxx @@ -1,21 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // Gaudi/Athena include(s): #include "GaudiKernel/MsgStream.h" -// TrigT1 include(s): -#include "TrigT1EventTPCnv/RoIBResultCnv_p1.h" - // Local include(s): #include "RoIBResultCnv.h" -/// The converter for translating the information between -/// transient and persistent objects -static RoIBResultCnv_p1 TPConverter; - /** * Function creating a persistent RoIBResult_PERS object from a transient * ROIB::RoIBResult one. @@ -23,7 +16,7 @@ static RoIBResultCnv_p1 TPConverter; RoIBResult_PERS* RoIBResultCnv::createPersistent( ROIB::RoIBResult* transObj ) { MsgStream log( this->msgSvc(), "RoIBResultCnv" ); - return TPConverter.createPersistent( transObj, log ); + return m_converter.createPersistent( transObj, log ); } @@ -33,14 +26,14 @@ RoIBResult_PERS* RoIBResultCnv::createPersistent( ROIB::RoIBResult* transObj ) { */ ROIB::RoIBResult* RoIBResultCnv::createTransient() { - static pool::Guid p1_guid( "A9FF18A0-E5A2-4F24-82C7-605CAA9EA1F8" ); - static pool::Guid p0_guid( "E9F89B95-329A-4FF1-9110-4CE48D1D7176" ); + static const pool::Guid p1_guid( "A9FF18A0-E5A2-4F24-82C7-605CAA9EA1F8" ); + static const pool::Guid p0_guid( "E9F89B95-329A-4FF1-9110-4CE48D1D7176" ); if( this->compareClassGuid( p1_guid ) ) { std::unique_ptr< RoIBResult_p1 > pers_ref( this->poolReadObject< RoIBResult_p1 >() ); MsgStream log( this->msgSvc(), "RoIBResultCnv" ); - return TPConverter.createTransient( pers_ref.get(), log ); + return m_converter.createTransient( pers_ref.get(), log ); } else if( this->compareClassGuid( p0_guid ) ) { diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.h b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.h index b384f1aac16..3e90dea92ce 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.h +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/RoIBResultCnv.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1EVENTATHENAPOOL_ROIBRESULTCNV_H @@ -13,6 +13,8 @@ // TrigT1 include(s): #include "TrigT1Result/RoIBResult.h" #include "TrigT1EventTPCnv/RoIBResult_p1.h" +#include "TrigT1EventTPCnv/RoIBResultCnv_p1.h" + // Define the latest persistent representation of ROIB::RoIBResult: typedef RoIBResult_p1 RoIBResult_PERS; @@ -24,8 +26,6 @@ typedef T_AthenaPoolCustomCnv< ROIB::RoIBResult, RoIBResult_PERS > RoIBResultCnv * Custom POOL converter for the ROIB::RoIBResult object that implements the * T/P separation for the LVL1 object. * - * @version $Revision: 1.3 $ - * @date $Date: 2007-10-12 14:42:11 $ * @author Attila Krasznahorkay Jr. */ class RoIBResultCnv : public RoIBResultCnvBase { @@ -39,6 +39,8 @@ protected: virtual RoIBResult_PERS* createPersistent( ROIB::RoIBResult* transObj ); virtual ROIB::RoIBResult* createTransient(); +private: + RoIBResultCnv_p1 m_converter; }; // class RoIBResultCnv diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/src/TriggerTowerCollectionCnv.cxx b/Trigger/TrigT1/TrigT1EventAthenaPool/src/TriggerTowerCollectionCnv.cxx index da1ab601db7..723c00e9282 100644 --- a/Trigger/TrigT1/TrigT1EventAthenaPool/src/TriggerTowerCollectionCnv.cxx +++ b/Trigger/TrigT1/TrigT1EventAthenaPool/src/TriggerTowerCollectionCnv.cxx @@ -32,8 +32,8 @@ TriggerTowerCollection * TriggerTowerCollectionCnv::createTransient() //mlog << MSG::DEBUG << "TriggerTowerCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "CDF34B04-7594-4A52-8EE0-FE85CF2C2A18" ); - static pool::Guid p0_guid( "1B6DA81A-2F27-4B50-ACF6-D3FC19B40ADB" ); + static const pool::Guid tlp1_guid( "CDF34B04-7594-4A52-8EE0-FE85CF2C2A18" ); + static const pool::Guid p0_guid( "1B6DA81A-2F27-4B50-ACF6-D3FC19B40ADB" ); TriggerTowerCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) -- GitLab From c51bb906186454182bd56c34a086d1f477e9bc62 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 13:46:33 +0200 Subject: [PATCH 04/56] TrigSteeringEventTPCnv: make Lvl1ResultCnv a const-converter --- .../TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h | 12 +++++++----- .../TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h | 12 +++++++----- .../TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p1.cxx | 6 +++--- .../TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p2.cxx | 6 +++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h b/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h index e174554e093..15b75222ae8 100755 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -13,7 +13,6 @@ * @author Francesca Bucci - U. of Geneva, Switzerland * * File and Version Information: - * $Id: Lvl1ResultCnv_p1.h,v 1.2 2009-04-01 22:14:57 salvator Exp $ **********************************************************************************/ #ifndef TrigSteeringEventTPCnv_Lvl1ResultCnv_H @@ -30,12 +29,15 @@ namespace LVL1CTP { namespace LVL1CTP { - class Lvl1ResultCnv_p1 : public T_AthenaPoolTPCnvBase { + class Lvl1ResultCnv_p1 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + Lvl1ResultCnv_p1() {} - void persToTrans(const Lvl1Result_p1* persObj, Lvl1Result* transObj, MsgStream& log); - void transToPers(const Lvl1Result* transObj, Lvl1Result_p1* persObj, MsgStream& log); + virtual void persToTrans(const Lvl1Result_p1* persObj, Lvl1Result* transObj, MsgStream& log) const override; + virtual void transToPers(const Lvl1Result* transObj, Lvl1Result_p1* persObj, MsgStream& log) const override; }; } diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h b/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h index 835a0d31025..14465fbc662 100755 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -13,7 +13,6 @@ * @author Francesca Bucci - U. of Geneva, Switzerland * * File and Version Information: - * $Id: Lvl1ResultCnv_p2.h,v 1.2 2009-04-01 22:14:57 salvator Exp $ **********************************************************************************/ #ifndef TrigSteeringEventTPCnv_Lvl1ResultCnv_p2_H @@ -30,12 +29,15 @@ namespace LVL1CTP { namespace LVL1CTP { - class Lvl1ResultCnv_p2 : public T_AthenaPoolTPCnvBase { + class Lvl1ResultCnv_p2 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + Lvl1ResultCnv_p2() {} - void persToTrans(const Lvl1Result_p2* persObj, Lvl1Result* transObj, MsgStream& log); - void transToPers(const Lvl1Result* transObj, Lvl1Result_p2* persObj, MsgStream& log); + virtual void persToTrans(const Lvl1Result_p2* persObj, Lvl1Result* transObj, MsgStream& log) const override; + virtual void transToPers(const Lvl1Result* transObj, Lvl1Result_p2* persObj, MsgStream& log) const override; }; } diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p1.cxx b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p1.cxx index 15b8bed95d2..3c1b2bce7d6 100755 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p1.cxx +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSteeringEvent/Lvl1Result.h" @@ -9,7 +9,7 @@ using namespace LVL1CTP; void Lvl1ResultCnv_p1::transToPers(const LVL1CTP::Lvl1Result* trans, - Lvl1Result_p1* pers, MsgStream &log ) + Lvl1Result_p1* pers, MsgStream &log ) const { log << MSG::DEBUG << "Lvl1ResultCnv_p1::transToPers called " << endmsg; @@ -21,7 +21,7 @@ void Lvl1ResultCnv_p1::transToPers(const LVL1CTP::Lvl1Result* trans, } void Lvl1ResultCnv_p1::persToTrans(const LVL1CTP::Lvl1Result_p1* pers, - Lvl1Result* trans, MsgStream &log ) + Lvl1Result* trans, MsgStream &log ) const { log << MSG::DEBUG << "Lvl1ResultCnv_p1::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p2.cxx b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p2.cxx index e2ae6b1e625..f28b58bd0cf 100755 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/Lvl1ResultCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSteeringEvent/Lvl1Result.h" @@ -9,7 +9,7 @@ using namespace LVL1CTP; void Lvl1ResultCnv_p2::transToPers(const LVL1CTP::Lvl1Result* trans, - Lvl1Result_p2* pers, MsgStream &log ) + Lvl1Result_p2* pers, MsgStream &log ) const { log << MSG::DEBUG << "Lvl1ResultCnv_p2::transToPers called " << endmsg; @@ -22,7 +22,7 @@ void Lvl1ResultCnv_p2::transToPers(const LVL1CTP::Lvl1Result* trans, } void Lvl1ResultCnv_p2::persToTrans(const LVL1CTP::Lvl1Result_p2* pers, - Lvl1Result* trans, MsgStream &log ) + Lvl1Result* trans, MsgStream &log ) const { log << MSG::DEBUG << "Lvl1ResultCnv_p2::persToTrans called " << endmsg; -- GitLab From b5b660f69ee9f553c499fd47881fdc15bd78f33f Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 14:01:30 +0200 Subject: [PATCH 05/56] TrigDecisionEventTPCnv: enable thread-checker and fix warnings Fix thread-checker warnings. Also remove unused HLT converters. --- .../TrigDecisionEventTPCnv/CMakeLists.txt | 4 ++-- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h | 16 +++++++--------- .../TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h | 16 +++++++--------- .../TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h | 16 +++++++--------- .../TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h | 16 +++++++--------- .../src/TrigDecisionCnv_p2.cxx | 8 ++++---- .../src/TrigDecisionCnv_p3.cxx | 8 ++++---- .../src/TrigDecisionCnv_p4.cxx | 8 ++++---- .../src/TrigDecisionCnv_p5.cxx | 8 ++++---- .../test/TrigDecisionCnv_p1_test.cxx | 5 +++-- .../test/TrigDecisionCnv_p2_test.cxx | 5 +++-- .../test/TrigDecisionCnv_p3_test.cxx | 5 +++-- .../test/TrigDecisionCnv_p4_test.cxx | 5 +++-- .../test/TrigDecisionCnv_p5_test.cxx | 5 +++-- 15 files changed, 62 insertions(+), 64 deletions(-) create mode 100644 Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt index bd6dffa70cf..286d926a073 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigDecisionEventTPCnv ) @@ -7,7 +7,7 @@ atlas_subdir( TrigDecisionEventTPCnv ) atlas_add_tpcnv_library( TrigDecisionEventTPCnv src/*.cxx PUBLIC_HEADERS TrigDecisionEventTPCnv - LINK_LIBRARIES AthenaPoolCnvSvcLib DataModelAthenaPoolLib TrigDecisionEvent TrigSteeringEventTPCnv + LINK_LIBRARIES AthenaPoolCnvSvcLib CxxUtils DataModelAthenaPoolLib TrigDecisionEvent TrigSteeringEventTPCnv PRIVATE_LINK_LIBRARIES AthenaKernel ) atlas_add_dictionary( TrigDecisionEventTPCnvDict diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..acda2466d2a --- /dev/null +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigDecisionEventTPCnv diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h index e66bbba8e2e..d56dc47a06c 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p2.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p2_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p2 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p2 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p2() {} - void persToTrans(const TrigDecision_p2* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p2* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p2* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p2* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p1 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h index 0bbcd22e4f3..a20b5a06d92 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p3.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p3_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p3 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p3 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p3() {} - void persToTrans(const TrigDecision_p3* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p3* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p3* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p3* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h index 0fa3895563d..013a536cf98 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p4.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p4_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p4 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p4 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p4() {} - void persToTrans(const TrigDecision_p4* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p4* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p4* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p4* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h index bc8c5f40018..ad25d203690 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p5.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p5_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p5 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p5 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p5() {} - void persToTrans(const TrigDecision_p5* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p5* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p5* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p5* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx index 464c705baef..7c1e795cf28 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p2::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p2* pers, MsgStream &log) + TrigDecision_p2* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p2::transToPers called " << trans << " " << pers << endmsg; @@ -34,7 +34,7 @@ void TrigDecisionCnv_p2::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p2::persToTrans(const TrigDec::TrigDecision_p2* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p2::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx index 8e43bc389bb..71d72561442 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p3::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p3* pers, MsgStream &log) + TrigDecision_p3* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p3::transToPers called " << trans << " " << pers << endmsg; @@ -34,7 +34,7 @@ void TrigDecisionCnv_p3::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p3::persToTrans(const TrigDec::TrigDecision_p3* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p3::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx index 105bc92e305..e6de15c7e60 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p4::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p4* pers, MsgStream &log) + TrigDecision_p4* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p4::transToPers called " << trans << " " << pers << endmsg; @@ -31,7 +31,7 @@ void TrigDecisionCnv_p4::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p4::persToTrans(const TrigDec::TrigDecision_p4* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p4::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx index 5bab2245a22..ae22fb08aa1 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h" #include "DataModelAthenaPool/DataLinkCnv_p2.h" namespace { -DataLinkCnv_p2 > dataLinkConverter; + const DataLinkCnv_p2 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p5::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p5* pers, MsgStream &log) + TrigDecision_p5* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p5::transToPers called " << trans << " " << pers << endmsg; @@ -32,7 +32,7 @@ void TrigDecisionCnv_p5::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p5::persToTrans(const TrigDec::TrigDecision_p5* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p5::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx index a5c2011101c..4d73a690706 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx @@ -18,6 +18,7 @@ #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -82,7 +83,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx index 883a9b84b17..be07cec9b4d 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -81,7 +82,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx index 4dfb7f62368..dd37c9bbe6d 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -81,7 +82,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx index 4fa12b65437..8ef8c120166 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -80,7 +81,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx index 84040786815..5dcfaca8533 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -80,7 +81,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); -- GitLab From 2407a882ccde1d2f63d038776d33760ad98ad214 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 14:54:10 +0200 Subject: [PATCH 06/56] TrigTruthEventAthenaPool: enable thread-checker and fix warnings --- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../src/TrigInDetTrackTruthMapCnv.cxx | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..d1a814bf329 --- /dev/null +++ b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigTruthEvent/TrigTruthEventAthenaPool diff --git a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/src/TrigInDetTrackTruthMapCnv.cxx b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/src/TrigInDetTrackTruthMapCnv.cxx index 7786a39c8dd..5d147941787 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/src/TrigInDetTrackTruthMapCnv.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/src/TrigInDetTrackTruthMapCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigInDetTrackTruthMapCnv.h" @@ -73,14 +73,23 @@ TrigInDetTrackTruthMap* TrigInDetTrackTruthMapCnv::createTransient() { } -StatusCode TrigInDetTrackTruthMapCnv::initialize() -{ - static bool did_rootcnv = false; - if (!did_rootcnv) { - did_rootcnv = true; +namespace { + // Helper to be able to call thread-unsafe code during initialize as we + // currently cannot mark Converter::initialize() as thread-unsafe. + StatusCode loadConverter ATLAS_NOT_THREAD_SAFE() { gROOT->GetClass("TrigInDetTrackTruthMap_old"); static TrigInDetTrackTruthMap_old_cnv cnv; TConverterRegistry::Instance()->AddConverter (&cnv); + return StatusCode::SUCCESS; } +} + +StatusCode TrigInDetTrackTruthMapCnv::initialize() +{ + [[maybe_unused]] static const bool did_rootcnv = []{ + StatusCode sc ATLAS_THREAD_SAFE = loadConverter(); + return sc.isSuccess(); + }(); return TrigInDetTrackTruthMapCnvBase::initialize(); } + -- GitLab From ce0421b85ce0bfa79d5dc4d4a4cc53bd4729eac1 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 14:55:12 +0200 Subject: [PATCH 07/56] TrigEvent: enable thread-checker for some TPCnv packages --- .../TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigTopoEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + 4 files changed, 4 insertions(+) create mode 100644 Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY create mode 100644 Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY create mode 100644 Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY create mode 100644 Trigger/TrigEvent/TrigTopoEventTPCnv/TrigTopoEventTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..e46feecdceb --- /dev/null +++ b/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigCombinedEventTPCnv diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..28bcc933626 --- /dev/null +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMissingEtEventTPCnv diff --git a/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..b12ac7d4896 --- /dev/null +++ b/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMonitoringEventTPCnv diff --git a/Trigger/TrigEvent/TrigTopoEventTPCnv/TrigTopoEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigTopoEventTPCnv/TrigTopoEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..277827c2d18 --- /dev/null +++ b/Trigger/TrigEvent/TrigTopoEventTPCnv/TrigTopoEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigTopoEventTPCnv -- GitLab From 5246c59714c1324ceaf8b66ef0633ca89eb8b2aa Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 16:09:05 +0200 Subject: [PATCH 08/56] TrigEventAthenaPool: enable thread-checker and fix warnings Replace static converter instances with member instances. --- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../src/CombinedMuonFeatureCnv.cxx | 4 +- .../src/CombinedMuonFeatureContainerCnv.cxx | 35 +++++--------- .../src/CombinedMuonFeatureContainerCnv.h | 12 ++++- .../src/ElectronMuonTopoInfoContainerCnv.cxx | 11 ++--- .../src/ElectronMuonTopoInfoContainerCnv.h | 9 ++-- .../src/IsoMuonFeatureCnv.cxx | 4 +- .../src/IsoMuonFeatureContainerCnv.cxx | 29 ++++-------- .../src/IsoMuonFeatureContainerCnv.h | 12 ++++- .../src/MuonFeatureCnv.cxx | 6 +-- .../src/MuonFeatureContainerCnv.cxx | 26 ++++------ .../src/MuonFeatureContainerCnv.h | 10 +++- .../src/MuonFeatureDetailsCnv.cxx | 2 +- .../src/MuonFeatureDetailsContainerCnv.cxx | 19 +++----- .../src/MuonFeatureDetailsContainerCnv.h | 9 +++- .../src/RingerRingsCnv.cxx | 2 +- .../src/RingerRingsContainerCnv.cxx | 17 +++---- .../src/RingerRingsContainerCnv.h | 12 +++-- .../src/TileMuFeatureCnv.cxx | 4 +- .../src/TileMuFeatureContainerCnv.cxx | 18 +++---- .../src/TileMuFeatureContainerCnv.h | 8 +++- .../src/TileTrackMuFeatureContainerCnv.cxx | 18 +++---- .../src/TileTrackMuFeatureContainerCnv.h | 10 +++- .../src/TrigCaloClusterContainerCnv.cxx | 11 ++--- .../src/TrigCaloClusterContainerCnv.h | 7 ++- .../src/TrigCompositeCnv.cxx | 2 +- .../src/TrigCompositeContainerCnv.cxx | 11 ++--- .../src/TrigCompositeContainerCnv.h | 7 ++- .../src/TrigDecisionCnv.cxx | 10 ++-- .../src/TrigEFBjetContainerCnv.cxx | 8 ++-- .../src/TrigEFBphysContainerCnv.cxx | 8 ++-- .../src/TrigEMClusterCnv.cxx | 6 +-- .../src/TrigEMClusterContainerCnv.cxx | 22 ++++----- .../src/TrigEMClusterContainerCnv.h | 15 ++++-- .../src/TrigElectronContainerCnv.cxx | 28 ++++------- .../src/TrigElectronContainerCnv.h | 11 ++++- .../src/TrigHisto1DCnv.cxx | 2 +- .../src/TrigHisto1DContainerCnv.cxx | 6 +-- .../src/TrigHisto2DCnv.cxx | 2 +- .../src/TrigHisto2DContainerCnv.cxx | 6 +-- .../src/TrigInDetTrackCollectionCnv.cxx | 10 ++-- .../src/TrigL2BjetContainerCnv.cxx | 28 ++++------- .../src/TrigL2BjetContainerCnv.h | 10 +++- .../src/TrigL2BphysContainerCnv.cxx | 8 ++-- .../src/TrigMissingETCnv.cxx | 6 +-- .../src/TrigMissingETContainerCnv.cxx | 20 +++----- .../src/TrigMissingETContainerCnv.h | 8 +++- .../src/TrigMonConfigCnv.cxx | 2 +- .../src/TrigMonConfigCollectionCnv.cxx | 4 +- .../src/TrigMonEventCnv.cxx | 4 +- .../src/TrigMonEventCollectionCnv.cxx | 4 +- .../src/TrigMuonClusterFeatureCnv.cxx | 13 ++--- .../src/TrigMuonClusterFeatureCnv.h | 8 ++-- .../TrigMuonClusterFeatureContainerCnv.cxx | 4 +- .../src/TrigMuonEFContainerCnv.cxx | 21 +++------ .../src/TrigMuonEFContainerCnv.h | 8 +++- .../src/TrigMuonEFInfoContainerCnv.cxx | 4 +- .../src/TrigMuonEFIsolationContainerCnv.cxx | 17 +++---- .../src/TrigMuonEFIsolationContainerCnv.h | 9 +++- .../src/TrigPhotonContainerCnv.cxx | 30 +++++------- .../src/TrigPhotonContainerCnv.h | 10 +++- .../src/TrigRNNOutputCnv.cxx | 2 +- .../src/TrigRNNOutputContainerCnv.cxx | 19 +++----- .../src/TrigRNNOutputContainerCnv.h | 8 +++- .../src/TrigSpacePointCountsCnv.cxx | 47 ++++++++++--------- .../src/TrigSpacePointCountsCnv.h | 13 +++-- .../src/TrigSpacePointCountsCollectionCnv.cxx | 21 ++++----- .../src/TrigSpacePointCountsCollectionCnv.h | 10 +++- .../TrigEventAthenaPool/src/TrigT2JetCnv.cxx | 4 +- .../src/TrigT2JetContainerCnv.cxx | 19 +++----- .../src/TrigT2JetContainerCnv.h | 13 +++-- .../src/TrigT2MbtsBitsCnv.cxx | 4 +- .../src/TrigT2MbtsBitsContainerCnv.cxx | 24 ++++------ .../src/TrigT2MbtsBitsContainerCnv.h | 12 +++-- .../src/TrigTauClusterCnv.cxx | 6 +-- .../src/TrigTauClusterContainerCnv.cxx | 36 +++++--------- .../src/TrigTauClusterContainerCnv.h | 15 ++++-- .../src/TrigTauClusterDetailsCnv.cxx | 4 +- .../src/TrigTauClusterDetailsContainerCnv.cxx | 17 +++---- .../src/TrigTauClusterDetailsContainerCnv.h | 8 +++- .../TrigEventAthenaPool/src/TrigTauCnv.cxx | 8 ++-- .../src/TrigTauContainerCnv.cxx | 17 +++---- .../src/TrigTauContainerCnv.h | 12 +++-- .../src/TrigTauTracksInfo.cxx | 4 +- .../src/TrigTauTracksInfoCollectionCnv.cxx | 19 +++----- .../src/TrigTauTracksInfoCollectionCnv.h | 11 ++++- .../src/TrigTrackCountsCnv.cxx | 6 +-- .../src/TrigTrackCountsCollectionCnv.cxx | 4 +- .../src/TrigTrtHitCountsCnv.cxx | 2 +- .../src/TrigTrtHitCountsCollectionCnv.cxx | 26 ++++------ .../src/TrigTrtHitCountsCollectionCnv.h | 12 ++++- .../src/TrigVertexCollectionCnv.cxx | 8 ++-- .../src/TrigVertexCountsCnv.cxx | 2 +- .../src/TrigVertexCountsCollectionCnv.cxx | 6 +-- 94 files changed, 551 insertions(+), 536 deletions(-) create mode 100644 Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..23805cf0e71 --- /dev/null +++ b/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigEventAthenaPool diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx index 211500b60e6..213d83f9c77 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx @@ -45,8 +45,8 @@ CombinedMuonFeature *CombinedMuonFeatureCnv::createTransient() CombinedMuonFeature *transObj(0); - static pool::Guid p1_guid( "7B8452AC-DDD8-42C5-85BD-D2CE183065A1" ); - static pool::Guid p0_guid( "9DFC54CA-4799-4BCB-A95B-919E7E761112" ); + static const pool::Guid p1_guid( "7B8452AC-DDD8-42C5-85BD-D2CE183065A1" ); + static const pool::Guid p0_guid( "9DFC54CA-4799-4BCB-A95B-919E7E761112" ); if( compareClassGuid( p1_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx index 732bb0b6f48..6969b11cf2e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx @@ -1,32 +1,21 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "CombinedMuonFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p2.h" - #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p3.h" - #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p4.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p4.h" - -static CombinedMuonFeatureContainerCnv_tlp1 TLPconverter1; -static CombinedMuonFeatureContainerCnv_p2 TPconverter2; -static CombinedMuonFeatureContainerCnv_p3 TPconverter3; -static CombinedMuonFeatureContainerCnv_p4 TPconverter; -//createPersistent +//createPersistent CombinedMuonFeatureContainer_PERS * CombinedMuonFeatureContainerCnv::createPersistent( CombinedMuonFeatureContainer *transObj) { MsgStream mlog(msgSvc(), "CombinedMuonFeatureContainerConverter" ); mlog << MSG::DEBUG << "CombinedMuonFeatureContainerCnv::createPersistent called" << endmsg; - CombinedMuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + CombinedMuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -40,34 +29,34 @@ CombinedMuonFeatureContainer * CombinedMuonFeatureContainerCnv::createTransient( mlog << MSG::DEBUG << "CombinedMuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p4_guid( "A06B9B51-FFA9-4AC1-9079-8AF49C4A9B87" ); - static pool::Guid p3_guid( "02262E5F-7645-4919-9CD9-66D88796DCFA" ); - static pool::Guid p2_guid( "E9D9F99E-D64F-4114-90EA-236FAF9063BB" ); - static pool::Guid tlp1_guid( "9C558B18-1B1D-4186-AF26-A5F3EACCBE1B" ); - static pool::Guid p0_guid( "574BFA1C-ADB8-40DB-B538-0CA20E20CAAD" ); + static const pool::Guid p4_guid( "A06B9B51-FFA9-4AC1-9079-8AF49C4A9B87" ); + static const pool::Guid p3_guid( "02262E5F-7645-4919-9CD9-66D88796DCFA" ); + static const pool::Guid p2_guid( "E9D9F99E-D64F-4114-90EA-236FAF9063BB" ); + static const pool::Guid tlp1_guid( "9C558B18-1B1D-4186-AF26-A5F3EACCBE1B" ); + static const pool::Guid p0_guid( "574BFA1C-ADB8-40DB-B538-0CA20E20CAAD" ); //CombinedMuonFeatureContainer *p_collection = 0; if( compareClassGuid( p4_guid ) ){ std::unique_ptr< CombinedMuonFeatureContainer_p4 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p4 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p3_guid ) ){ std::unique_ptr< CombinedMuonFeatureContainer_p3 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p3 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter3.createTransient( col_vect.get(), mlog ) ; + return m_converter3.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p2_guid ) ) { std::unique_ptr< CombinedMuonFeatureContainer_p2 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p2 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< CombinedMuonFeatureContainer_tlp1 > col_vect( poolReadObject< CombinedMuonFeatureContainer_tlp1 >() ); // std::cout << "Reading CMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h index 1fb1fd1c035..81a75c0177e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_COMBINEDMUONFEATURECONTAINER_CNV_H @@ -10,6 +10,10 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p2.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p3.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p4.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p2.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p3.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p4.h" typedef CombinedMuonFeatureContainer_p4 CombinedMuonFeatureContainer_PERS; @@ -27,6 +31,12 @@ protected: virtual CombinedMuonFeatureContainer_PERS *createPersistent( CombinedMuonFeatureContainer *transObj); virtual CombinedMuonFeatureContainer *createTransient(); +private: + CombinedMuonFeatureContainerCnv_tlp1 m_converter1; + CombinedMuonFeatureContainerCnv_p2 m_converter2; + CombinedMuonFeatureContainerCnv_p3 m_converter3; + CombinedMuonFeatureContainerCnv_p4 m_converter; + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx index 5965ed9f62d..172b047f4ce 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "ElectronMuonTopoInfoContainerCnv.h" -#include "TrigTopoEventTPCnv/ElectronMuonTopoInfoContainerCnv_p1.h" - -static ElectronMuonTopoInfoContainerCnv_p1 TPConverter; //createPersistent ElectronMuonTopoInfoContainer_PERS * ElectronMuonTopoInfoContainerCnv::createPersistent( ElectronMuonTopoInfoContainer *transObj) @@ -14,7 +11,7 @@ ElectronMuonTopoInfoContainer_PERS * ElectronMuonTopoInfoContainerCnv::createPer mlog << MSG::DEBUG << "ElectronMuonTopoInfoContainerCnv::createPersistent called" << endmsg; - ElectronMuonTopoInfoContainer_PERS * p_emTopoCont = TPConverter.createPersistent( transObj, mlog ); + ElectronMuonTopoInfoContainer_PERS * p_emTopoCont = m_converter.createPersistent( transObj, mlog ); return p_emTopoCont; @@ -27,11 +24,11 @@ ElectronMuonTopoInfoContainer * ElectronMuonTopoInfoContainerCnv::createTransien mlog << MSG::DEBUG << "ElectronMuonTopoInfoContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "0A775717-3FC9-4FF4-A18B-3F520B2D4DAC" ); + static const pool::Guid p1_guid( "0A775717-3FC9-4FF4-A18B-3F520B2D4DAC" ); if( compareClassGuid( p1_guid ) ){ std::unique_ptr< ElectronMuonTopoInfoContainer_p1 > col_vect( poolReadObject< ElectronMuonTopoInfoContainer_p1 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of ElectronMuonTopoInfoContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h index 232acfe3d38..2eb26b0cf88 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_ELECTRONMUONTOPOINFO_CNV_H @@ -11,7 +11,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigTopoEvent/ElectronMuonTopoInfoContainer.h" #include "TrigTopoEventTPCnv/ElectronMuonTopoInfoContainerCnv_p1.h" - + typedef ElectronMuonTopoInfoContainer_p1 ElectronMuonTopoInfoContainer_PERS; typedef T_AthenaPoolCustomCnv ElectronMuonTopoInfoContainerCnvBase; @@ -30,7 +30,10 @@ protected: virtual ElectronMuonTopoInfoContainer_PERS *createPersistent( ElectronMuonTopoInfoContainer *transObj); virtual ElectronMuonTopoInfoContainer *createTransient(); - + +private: + ElectronMuonTopoInfoContainerCnv_p1 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx index da404d04fb0..685d9125eaa 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx @@ -44,8 +44,8 @@ IsoMuonFeature *IsoMuonFeatureCnv::createTransient() IsoMuonFeature *transObj(0); - static pool::Guid p1_guid("31A90EEE-AF5A-4CAF-9A83-F523D141C4CF"); - static pool::Guid p0_guid("60ECF1E1-408A-43CA-9858-62AAFE8041FF"); + static const pool::Guid p1_guid("31A90EEE-AF5A-4CAF-9A83-F523D141C4CF"); + static const pool::Guid p0_guid("60ECF1E1-408A-43CA-9858-62AAFE8041FF"); if( compareClassGuid( p1_guid ) ) { std::unique_ptr< IsoMuonFeature_tlp1 > ptr_tlp1( this->poolReadObject< IsoMuonFeature_tlp1 >() ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx index 1c9121ec0b8..5866b1100df 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx @@ -1,29 +1,20 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "IsoMuonFeatureContainerCnv.h" #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_tlp1.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p2.h" - #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p3.h" - -static IsoMuonFeatureContainerCnv_tlp1 TLPconverter1; -static IsoMuonFeatureContainerCnv_p2 TPconverter2; -static IsoMuonFeatureContainerCnv_p3 TPconverter; -//createPersistent +//createPersistent IsoMuonFeatureContainer_PERS * IsoMuonFeatureContainerCnv::createPersistent( IsoMuonFeatureContainer *transObj) { MsgStream mlog(msgSvc(), "IsoMuonFeatureContainerConverter" ); mlog << MSG::DEBUG << "IsoMuonFeatureContainerCnv::createPersistent called" << endmsg; - IsoMuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + IsoMuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -36,26 +27,26 @@ IsoMuonFeatureContainer * IsoMuonFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "IsoMuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "291897DE-5380-424C-AE8F-FFE69DCC8F15" ); - static pool::Guid p2_guid( "A9A660B1-DEFD-4B56-A10D-9F41178715BD" ); - static pool::Guid tlp1_guid( "B9543660-E776-405D-8DB7-06AD06A24BAB" ); - static pool::Guid p0_guid( "3962B221-2A36-4160-AEE5-3BB6BC29BB46" ); + static const pool::Guid p3_guid( "291897DE-5380-424C-AE8F-FFE69DCC8F15" ); + static const pool::Guid p2_guid( "A9A660B1-DEFD-4B56-A10D-9F41178715BD" ); + static const pool::Guid tlp1_guid( "B9543660-E776-405D-8DB7-06AD06A24BAB" ); + static const pool::Guid p0_guid( "3962B221-2A36-4160-AEE5-3BB6BC29BB46" ); //IsoMuonFeatureContainer *p_collection = 0; if( compareClassGuid( p3_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_p3 > col_vect( poolReadObject< IsoMuonFeatureContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p2_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_p2 > col_vect( poolReadObject< IsoMuonFeatureContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_tlp1 > col_vect( poolReadObject< IsoMuonFeatureContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ return poolReadObject< IsoMuonFeatureContainer >(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h index 0d98a273dc0..e6706655fed 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_ISOMUONFEATURECONTAINER_CNV_H @@ -8,7 +8,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/IsoMuonFeatureContainer.h" #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p2.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p3.h" typedef IsoMuonFeatureContainer_p3 IsoMuonFeatureContainer_PERS; @@ -27,6 +30,11 @@ protected: virtual IsoMuonFeatureContainer_PERS *createPersistent( IsoMuonFeatureContainer *transObj); virtual IsoMuonFeatureContainer *createTransient(); +private: + IsoMuonFeatureContainerCnv_tlp1 m_converter1; + IsoMuonFeatureContainerCnv_p2 m_converter2; + IsoMuonFeatureContainerCnv_p3 m_converter; + }; #endif //ISOMUONFEATURECONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx index 57e39ffbae3..c9bf6346d29 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx @@ -27,9 +27,9 @@ MuonFeature* MuonFeatureCnv::createTransient() { mlog << MSG::DEBUG << "MuonFeatureCnv::createTransient " << endmsg; - static pool::Guid p2_guid("3785A9E4-7845-4B54-B49F-DCC2A24409C0"); - static pool::Guid p1_guid("3DFFECBF-3251-4BE7-9D12-B3A9FCAC486E"); - static pool::Guid p0_guid("295FBAFB-ED82-43EA-8B63-6E3D3F4D2A9F"); + static const pool::Guid p2_guid("3785A9E4-7845-4B54-B49F-DCC2A24409C0"); + static const pool::Guid p1_guid("3DFFECBF-3251-4BE7-9D12-B3A9FCAC486E"); + static const pool::Guid p0_guid("295FBAFB-ED82-43EA-8B63-6E3D3F4D2A9F"); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx index a6abfc3909b..37ec46aacb8 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp1.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp2.h" - #include "TrigMuonEventTPCnv/MuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_p3.h" - -static MuonFeatureContainerCnv_tlp1 TPconverter1; -static MuonFeatureContainerCnv_tlp2 TPconverter2; -static MuonFeatureContainerCnv_p3 TPconverter; //createPersistent MuonFeatureContainer_PERS * MuonFeatureContainerCnv::createPersistent( MuonFeatureContainer *transObj) @@ -20,7 +12,7 @@ MuonFeatureContainer_PERS * MuonFeatureContainerCnv::createPersistent( MuonFeatu mlog << MSG::DEBUG << "MuonFeatureContainerCnv::createPersistent called" << endmsg; - MuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + MuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -34,28 +26,28 @@ MuonFeatureContainer * MuonFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "MuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "5B571BCD-FE49-4C56-A357-1B535FE65829" ); - static pool::Guid tlp2_guid( "2F4ABBC8-EA77-487B-820F-76179BB3828C" ); - static pool::Guid tlp1_guid( "039BE61C-DE27-48B3-A2AE-7172BB755CEE" ); - static pool::Guid p0_guid( "45225F26-A517-4E8B-BA93-DDFD1217B9A8" ); + static const pool::Guid p3_guid( "5B571BCD-FE49-4C56-A357-1B535FE65829" ); + static const pool::Guid tlp2_guid( "2F4ABBC8-EA77-487B-820F-76179BB3828C" ); + static const pool::Guid tlp1_guid( "039BE61C-DE27-48B3-A2AE-7172BB755CEE" ); + static const pool::Guid p0_guid( "45225F26-A517-4E8B-BA93-DDFD1217B9A8" ); if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< MuonFeatureContainer_tlp1 > col_vect( poolReadObject< MuonFeatureContainer_tlp1 >() ); // std::cout << "Reading MFC p1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ) ; + return m_converter1.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< MuonFeatureContainer_tlp2 > col_vect( poolReadObject< MuonFeatureContainer_tlp2 >() ); // std::cout << "Reading MFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p3_guid ) ) { std::unique_ptr< MuonFeatureContainer_p3 > col_vect( poolReadObject< MuonFeatureContainer_p3 >() ); // std::cout << "Reading MFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p0_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h index 1d7659f7b99..eed23b05eb2 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_MUONFEATURECONTAINER_CNV_H @@ -7,7 +7,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/MuonFeatureContainer.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp2.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_p3.h" typedef MuonFeatureContainer_p3 MuonFeatureContainer_PERS; @@ -25,6 +27,10 @@ protected: virtual MuonFeatureContainer_PERS *createPersistent( MuonFeatureContainer *transObj); virtual MuonFeatureContainer *createTransient(); +private: + MuonFeatureContainerCnv_tlp1 m_converter1; + MuonFeatureContainerCnv_tlp2 m_converter2; + MuonFeatureContainerCnv_p3 m_converter; }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx index 8e43e2e6808..4bf20ab6f6c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx @@ -26,7 +26,7 @@ MuonFeatureDetails* MuonFeatureDetailsCnv::createTransient() { mlog << MSG::DEBUG << "MuonFeatureDetailsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("E841B555-766B-48EF-96F8-F4BE39EE8BCB"); + static const pool::Guid p1_guid("E841B555-766B-48EF-96F8-F4BE39EE8BCB"); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx index 9ccb1f5c701..6b66b0b0b3b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx @@ -1,22 +1,17 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonFeatureDetailsContainerCnv.h" #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_tlp1.h" -#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_p2.h" -#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_p2.h" -static MuonFeatureDetailsContainerCnv_tlp1 TLPconverter1; -static MuonFeatureDetailsContainerCnv_p2 TPconverter; - + MuonFeatureDetailsContainer_PERS * MuonFeatureDetailsContainerCnv::createPersistent( MuonFeatureDetailsContainer *transObj) { MsgStream mlog(msgSvc(), "MuonFeatureDetailsContainerConverter" ); mlog << MSG::DEBUG << "MuonFeatureDetailsContainerCnv::createPersistent called" << endmsg; - MuonFeatureDetailsContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + MuonFeatureDetailsContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; } @@ -27,18 +22,18 @@ MuonFeatureDetailsContainer * MuonFeatureDetailsContainerCnv::createTransient() MsgStream mlog(msgSvc(), "MuonFeatureDetailsContainerConverter" ); // mlog << MSG::DEBUG << "MuonFeatureDetailsContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "CF2FFCB2-3936-4800-9146-52B203A47478" ); - static pool::Guid p2_guid( "95327E52-C8B2-45E4-9EAF-C65A17AB27F5" ); + static const pool::Guid tlp1_guid( "CF2FFCB2-3936-4800-9146-52B203A47478" ); + static const pool::Guid p2_guid( "95327E52-C8B2-45E4-9EAF-C65A17AB27F5" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< MuonFeatureDetailsContainer_p2 > col_vect( poolReadObject< MuonFeatureDetailsContainer_p2 >() ); // std::cout << "Reading MFDC p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ){ std::unique_ptr< MuonFeatureDetailsContainer_tlp1 > col_vect( poolReadObject< MuonFeatureDetailsContainer_tlp1 >() ); // std::cout << "Reading MFDC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of MuonFeatureDetailsContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h index 9849c8d4c35..d976f1679bd 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h @@ -1,14 +1,15 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_MUONFEATUREDETAILSCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_MUONFEATUREDETAILSCONTAINER_CNV_H -// #include "GaudiKernel/MsgStream.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/MuonFeatureDetailsContainer.h" #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_p2.h" +#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_p2.h" typedef MuonFeatureDetailsContainer_p2 MuonFeatureDetailsContainer_PERS; @@ -27,6 +28,10 @@ protected: virtual MuonFeatureDetailsContainer_PERS *createPersistent( MuonFeatureDetailsContainer *transObj); virtual MuonFeatureDetailsContainer *createTransient(); +private: + MuonFeatureDetailsContainerCnv_tlp1 m_converter1; + MuonFeatureDetailsContainerCnv_p2 m_converter; + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx index d58d04835c6..d2f96216fe0 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx @@ -30,7 +30,7 @@ RingerRings* RingerRingsCnv::createTransient() { MsgStream mlog(msgSvc(), "RingerRingsConverter" ); mlog << MSG::DEBUG << "RingerRingsCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("7A3BC015-8ECE-44A9-A2BD-9D52B3D2B354"); + static const pool::Guid tlp1_guid("7A3BC015-8ECE-44A9-A2BD-9D52B3D2B354"); RingerRings *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx index aa56757579d..0e4e086d414 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx @@ -1,21 +1,16 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RingerRingsContainerCnv.h" -#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_p2.h" -static RingerRingsContainerCnv_tlp1 TPConverter_tlp1; -static RingerRingsContainerCnv_p2 TPConverter; - // createPersistent RingerRingsContainer_PERS *RingerRingsContainerCnv::createPersistent(RingerRingsContainer *transObj) { MsgStream mlog(msgSvc(), "RingerRingsContainerConverter"); mlog << MSG::DEBUG << "RingerRingsContainerCnv::createPersistent called" << endmsg; - RingerRingsContainer_PERS *p_RingerRingsCont = TPConverter.createPersistent(transObj, mlog); + RingerRingsContainer_PERS *p_RingerRingsCont = m_converter.createPersistent(transObj, mlog); return p_RingerRingsCont; @@ -28,17 +23,17 @@ RingerRingsContainer *RingerRingsContainerCnv::createTransient() { mlog << MSG::DEBUG << "RingerRingsContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid("30D29B68-6D41-429E-AC16-930ACF71280D"); - static pool::Guid tlp1_guid("B5587828-50D8-4DAA-97F3-5E41A7F3E3FE"); + static const pool::Guid p2_guid("30D29B68-6D41-429E-AC16-930ACF71280D"); + static const pool::Guid tlp1_guid("B5587828-50D8-4DAA-97F3-5E41A7F3E3FE"); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< RingerRingsContainer_p2 > col_vect( poolReadObject< RingerRingsContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if (compareClassGuid(tlp1_guid)) { std::unique_ptr< RingerRingsContainer_tlp1 > col_vect( poolReadObject< RingerRingsContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error("Unsupported persistent version of RingerRingsContainer"); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h index b966e649277..3435ed7d539 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_RINGERRINGSCONTAINER_CNV_H @@ -10,8 +10,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/RingerRingsContainer.h" +#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/RingerRingsContainerCnv_p2.h" - + + typedef RingerRingsContainer_p2 RingerRingsContainer_PERS; typedef T_AthenaPoolCustomCnv RingerRingsContainerCnvBase; @@ -28,7 +30,11 @@ protected: virtual RingerRingsContainer_PERS *createPersistent(RingerRingsContainer *transObj); virtual RingerRingsContainer *createTransient(); - + +private: + RingerRingsContainerCnv_tlp1 m_converter_tlp1; + RingerRingsContainerCnv_p2 m_converter; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx index ce93887d1d2..e5ed38cf80c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx @@ -32,10 +32,10 @@ TileMuFeature* TileMuFeatureCnv::createTransient() { mlog << MSG::DEBUG << "TileMuFeatureCnv::createTransient " << endmsg; - static pool::Guid p1_guid("F853E605-AFD5-44F9-98BC-4D777CBCBEE4"); + static const pool::Guid p1_guid("F853E605-AFD5-44F9-98BC-4D777CBCBEE4"); // from "TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/selection.xml" - static pool::Guid p0_guid("526B0709-442D-4D2C-8C1F-8C3922149656"); + static const pool::Guid p0_guid("526B0709-442D-4D2C-8C1F-8C3922149656"); // from "TrigEvent/TrigMuonEvent/TrigMuonEvent/selection.xml" if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx index 5538eb575ca..15737280da8 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx @@ -1,15 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TileMuFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/TileMuFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_p2.h" -static TileMuFeatureContainerCnv_tlp1 TLPconverter1; -static TileMuFeatureContainerCnv_p2 TPconverter; //createPersistent TileMuFeatureContainer_PERS * TileMuFeatureContainerCnv::createPersistent( TileMuFeatureContainer *transObj) @@ -18,7 +14,7 @@ TileMuFeatureContainer_PERS * TileMuFeatureContainerCnv::createPersistent( TileM mlog << MSG::DEBUG << "TileMuFeatureContainerCnv::createPersistent called" << endmsg; - TileMuFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + TileMuFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -31,17 +27,17 @@ TileMuFeatureContainer * TileMuFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "TileMuFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "D7B3C086-B471-47EE-B8EC-E58DC4CD2AD9" ); - static pool::Guid tlp1_guid( "4684172D-3590-4464-BCA6-477725ADD755" ); - static pool::Guid p0_guid( "8B428EC4-339C-4517-A047-C0F5F98B820B" ); + static const pool::Guid p2_guid( "D7B3C086-B471-47EE-B8EC-E58DC4CD2AD9" ); + static const pool::Guid tlp1_guid( "4684172D-3590-4464-BCA6-477725ADD755" ); + static const pool::Guid p0_guid( "8B428EC4-339C-4517-A047-C0F5F98B820B" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TileMuFeatureContainer_p2 > col_vect( poolReadObject< TileMuFeatureContainer_p2 >() ); - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TileMuFeatureContainer_tlp1 > col_vect( poolReadObject< TileMuFeatureContainer_tlp1 >() ); - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h index d431f36fcfd..e1eb61a304b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TILEMUFEATURECONTAINER_CNV_H @@ -8,6 +8,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TileMuFeatureContainer.h" #include "TrigMuonEventTPCnv/TileMuFeatureContainer_p2.h" +#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_p2.h" typedef TileMuFeatureContainer_p2 TileMuFeatureContainer_PERS; @@ -26,6 +28,10 @@ protected: virtual TileMuFeatureContainer_PERS *createPersistent( TileMuFeatureContainer *transObj); virtual TileMuFeatureContainer *createTransient(); +private: + TileMuFeatureContainerCnv_tlp1 m_converter1; + TileMuFeatureContainerCnv_p2 m_converter; + }; #endif //TILEMUFEATURECONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx index a15e8fd4656..1578eb9e87d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx @@ -1,15 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TileTrackMuFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/TileTrackMuFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_p3.h" -static TileTrackMuFeatureContainerCnv_tlp1 TLPconverter1; -static TileTrackMuFeatureContainerCnv_p3 TPconverter; //createPersistent TileTrackMuFeatureContainer_PERS * TileTrackMuFeatureContainerCnv::createPersistent( TileTrackMuFeatureContainer *transObj) @@ -18,7 +14,7 @@ TileTrackMuFeatureContainer_PERS * TileTrackMuFeatureContainerCnv::createPersist mlog << MSG::DEBUG << "TileTrackMuFeatureContainerCnv::createPersistent called" << endmsg; - TileTrackMuFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + TileTrackMuFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -32,17 +28,17 @@ TileTrackMuFeatureContainer * TileTrackMuFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "TileTrackMuFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "25018D00-1D18-4B4C-9C07-37993260EADB"); - static pool::Guid tlp1_guid( "983ED5FE-D0A2-43AE-90A9-268C8B61E8B3"); - static pool::Guid p0_guid( "1AFABC18-EB97-412D-B27C-C744ABA6E1DC"); + static const pool::Guid p3_guid( "25018D00-1D18-4B4C-9C07-37993260EADB"); + static const pool::Guid tlp1_guid( "983ED5FE-D0A2-43AE-90A9-268C8B61E8B3"); + static const pool::Guid p0_guid( "1AFABC18-EB97-412D-B27C-C744ABA6E1DC"); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TileTrackMuFeatureContainer_p3 > col_vect( poolReadObject< TileTrackMuFeatureContainer_p3 >() ); - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TileTrackMuFeatureContainer_tlp1 > col_vect( poolReadObject< TileTrackMuFeatureContainer_tlp1 >() ); - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h index 47b884c47e6..8e2abc349ba 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -22,6 +22,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TileTrackMuFeatureContainer.h" #include "TrigMuonEventTPCnv/TileTrackMuFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_p3.h" //----------------------------------------------------------------------------- // Base class definition @@ -45,7 +47,11 @@ protected: virtual TileTrackMuFeatureContainer_PERS *createPersistent( TileTrackMuFeatureContainer *transObj); virtual TileTrackMuFeatureContainer *createTransient(); - + +private: + TileTrackMuFeatureContainerCnv_tlp1 m_converter1; + TileTrackMuFeatureContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx index aa52a59064a..4815ba3a62f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigCaloClusterContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigCaloClusterContainerCnv_p3.h" - -static TrigCaloClusterContainerCnv_p3 TPConverter; //createPersistent TrigCaloClusterContainer_PERS * TrigCaloClusterContainerCnv::createPersistent( TrigCaloClusterContainer *transObj) @@ -14,7 +11,7 @@ TrigCaloClusterContainer_PERS * TrigCaloClusterContainerCnv::createPersistent( T mlog << MSG::DEBUG << "TrigCaloClusterContainerCnv::createPersistent called" << endmsg; - TrigCaloClusterContainer_PERS * p_CaloClusterCont = TPConverter.createPersistent( transObj, mlog ); + TrigCaloClusterContainer_PERS * p_CaloClusterCont = m_converter.createPersistent( transObj, mlog ); return p_CaloClusterCont; @@ -27,12 +24,12 @@ TrigCaloClusterContainer * TrigCaloClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigCaloClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "98A28943-662A-4141-82C3-537447264DA3" ); + static const pool::Guid p3_guid( "98A28943-662A-4141-82C3-537447264DA3" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigCaloClusterContainer_p3 > col_vect( poolReadObject< TrigCaloClusterContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of TrigCaloClusterContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h index 06d37510fdb..bc41e170ef6 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGCALOCLUSTERCONTAINER_CNV_H @@ -30,7 +30,10 @@ protected: virtual TrigCaloClusterContainer_PERS *createPersistent( TrigCaloClusterContainer *transObj); virtual TrigCaloClusterContainer *createTransient(); - + +private: + TrigCaloClusterContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx index 288ca8bab48..3844415e5db 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx @@ -37,7 +37,7 @@ TrigComposite* TrigCompositeCnv::createTransient() MsgStream mlog(msgSvc(), "TrigCompositeConverter" ); mlog << MSG::DEBUG << "TrigCompositeCnv::createTransient " << endmsg; - static pool::Guid p1_guid("53F70884-38EE-4D08-9F03-FA8BED725B63"); + static const pool::Guid p1_guid("53F70884-38EE-4D08-9F03-FA8BED725B63"); TrigComposite *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx index 5421db0bc9c..ce89297f692 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigCompositeContainerCnv.h" -#include "TrigCombinedEventTPCnv/TrigCompositeContainerCnv_p1.h" - -static TrigCompositeContainerCnv_p1 TPConverter; //createPersistent TrigCompositeContainer_PERS * TrigCompositeContainerCnv::createPersistent( TrigCompositeContainer *transObj) @@ -14,7 +11,7 @@ TrigCompositeContainer_PERS * TrigCompositeContainerCnv::createPersistent( TrigC mlog << MSG::DEBUG << "TrigCompositeContainerCnv::createPersistent called" << endmsg; - TrigCompositeContainer_PERS * p_CompositeCont = TPConverter.createPersistent( transObj, mlog ); + TrigCompositeContainer_PERS * p_CompositeCont = m_converter.createPersistent( transObj, mlog ); return p_CompositeCont; @@ -27,13 +24,13 @@ TrigCompositeContainer * TrigCompositeContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigCompositeContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "6D16EA6B-968C-41F0-B5E8-9CC6D5BD7F9A" ); + static const pool::Guid p1_guid( "6D16EA6B-968C-41F0-B5E8-9CC6D5BD7F9A" ); if( compareClassGuid( p1_guid ) ){ std::unique_ptr< TrigCompositeContainer_p1 > col_vect( poolReadObject< TrigCompositeContainer_p1 >() ); // std::cout << "Reading IMFC p1" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of TrigCompositeContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h index 9c6e066c247..43ec13c545b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGCOMPOSITECONTAINER_CNV_H @@ -11,7 +11,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCombinedEvent/TrigCompositeContainer.h" #include "TrigCombinedEventTPCnv/TrigCompositeContainerCnv_p1.h" - + typedef TrigCompositeContainer_p1 TrigCompositeContainer_PERS; typedef T_AthenaPoolCustomCnv TrigCompositeContainerCnvBase; @@ -30,6 +30,9 @@ protected: virtual TrigCompositeContainer_PERS *createPersistent( TrigCompositeContainer *transObj); virtual TrigCompositeContainer *createTransient(); + +private: + TrigCompositeContainerCnv_p1 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx index 1cfe1701696..e14adab344a 100755 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx @@ -37,11 +37,11 @@ TrigDec::TrigDecision* TrigDecisionCnv::createTransient() { MsgStream log(msgSvc(), "TrigDecisionConverter" ); - static pool::Guid p1_guid("83D7E08D-CF8C-47A0-963F-5618A9509334"); - static pool::Guid p2_guid("6BE81E51-B42B-4783-957D-84E7F383E9D5"); - static pool::Guid p3_guid("1C0527B6-1B94-4F47-ADE4-D24E7BF91D3E"); - static pool::Guid p4_guid("78F57689-0902-4E47-BB04-9BD10C7EF8B5"); - static pool::Guid p5_guid("DA3DEF39-2401-4A8E-ACD2-851B0DF10AFA"); + static const pool::Guid p1_guid("83D7E08D-CF8C-47A0-963F-5618A9509334"); + static const pool::Guid p2_guid("6BE81E51-B42B-4783-957D-84E7F383E9D5"); + static const pool::Guid p3_guid("1C0527B6-1B94-4F47-ADE4-D24E7BF91D3E"); + static const pool::Guid p4_guid("78F57689-0902-4E47-BB04-9BD10C7EF8B5"); + static const pool::Guid p5_guid("DA3DEF39-2401-4A8E-ACD2-851B0DF10AFA"); if ( compareClassGuid(p1_guid) ) { // using unique_ptr ensures deletion of the persistent object diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx index 556ddd52fb6..59e6a07859d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx @@ -46,10 +46,10 @@ TrigEFBjetContainer * TrigEFBjetContainerCnv::createTransient() { mlog << MSG::DEBUG << "TrigEFBjetContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "91EA22B6-9273-4206-AEB5-FE23A269C5AA" ); - static pool::Guid tlp1_guid( "F933A067-5788-4AD6-B696-C8B0E988EF2D" ); - static pool::Guid p0_guid( "EDAFEE8F-968E-44A4-BEED-7E7F5C86F397" ); - static pool::Guid p0_guid2( "D08290EE-4CB3-4570-BF7E-0FA008668A24" ); + static const pool::Guid tlp2_guid( "91EA22B6-9273-4206-AEB5-FE23A269C5AA" ); + static const pool::Guid tlp1_guid( "F933A067-5788-4AD6-B696-C8B0E988EF2D" ); + static const pool::Guid p0_guid( "EDAFEE8F-968E-44A4-BEED-7E7F5C86F397" ); + static const pool::Guid p0_guid2( "D08290EE-4CB3-4570-BF7E-0FA008668A24" ); TrigEFBjetContainer *p_collection = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx index 152f59622bd..4491433eaa3 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx @@ -46,10 +46,10 @@ TrigEFBphysContainer * TrigEFBphysContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigEFBphysContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "D93906C2-4F81-44A7-98BE-71302891FE44" ); - static pool::Guid tlp1_guid( "5F5B068F-32DB-4CC9-BA9E-C74C076AAAA1" ); - static pool::Guid p0_guid( "033EAD89-6721-46F2-9D32-2670BA63B901" ); - static pool::Guid p0_guid2( "760BB4E7-61C1-4365-BE20-C8251E808BA4" ); + static const pool::Guid tlp2_guid( "D93906C2-4F81-44A7-98BE-71302891FE44" ); + static const pool::Guid tlp1_guid( "5F5B068F-32DB-4CC9-BA9E-C74C076AAAA1" ); + static const pool::Guid p0_guid( "033EAD89-6721-46F2-9D32-2670BA63B901" ); + static const pool::Guid p0_guid2( "760BB4E7-61C1-4365-BE20-C8251E808BA4" ); TrigEFBphysContainer *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx index ccfec204ac3..4511889e587 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx @@ -38,9 +38,9 @@ TrigEMCluster* TrigEMClusterCnv::createTransient() MsgStream mlog(msgSvc(), "TrigEMClusterConverter" ); mlog << MSG::DEBUG << "TrigEMClusterCnv::createTransient " << endmsg; - static pool::Guid tlp2_guid("61D02BB3-0F97-4809-AC93-72B2DC2DF624"); - static pool::Guid tlp1_guid("EF5124F2-7B9C-4CBE-8D7F-1AD368A8A125"); - static pool::Guid p0_guid("E60986AE-938E-4256-A100-CD99158ADE9E"); + static const pool::Guid tlp2_guid("61D02BB3-0F97-4809-AC93-72B2DC2DF624"); + static const pool::Guid tlp1_guid("EF5124F2-7B9C-4CBE-8D7F-1AD368A8A125"); + static const pool::Guid p0_guid("E60986AE-938E-4256-A100-CD99158ADE9E"); TrigEMCluster *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx index 1b3b7686b5a..a7bfebacd27 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx @@ -1,15 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigEMClusterContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p4.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p3.h" -static TrigEMClusterContainerCnv_tlp1 TPConverter_tlp1; -static TrigEMClusterContainerCnv_p4 TPConverter; -static TrigEMClusterContainerCnv_p3 TPConverter_p3; //createPersistent TrigEMClusterContainer_PERS * TrigEMClusterContainerCnv::createPersistent( TrigEMClusterContainer *transObj) @@ -18,7 +12,7 @@ TrigEMClusterContainer_PERS * TrigEMClusterContainerCnv::createPersistent( TrigE mlog << MSG::DEBUG << "TrigEMClusterContainerCnv::createPersistent called" << endmsg; - TrigEMClusterContainer_PERS * p_EMClusterCont = TPConverter.createPersistent( transObj, mlog ); + TrigEMClusterContainer_PERS * p_EMClusterCont = m_converter.createPersistent( transObj, mlog ); return p_EMClusterCont; @@ -31,20 +25,20 @@ TrigEMClusterContainer * TrigEMClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigEMClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "0BF627E6-52A0-4F10-9FFD-A513DF2DBC31" ); - static pool::Guid p4_guid( "7B430CA8-5D16-4E26-B0A4-461F983610EB" ); - static pool::Guid tlp1_guid( "CAA8145E-F382-4727-A114-26E137D4B27E" ); + static const pool::Guid p3_guid( "0BF627E6-52A0-4F10-9FFD-A513DF2DBC31" ); + static const pool::Guid p4_guid( "7B430CA8-5D16-4E26-B0A4-461F983610EB" ); + static const pool::Guid tlp1_guid( "CAA8145E-F382-4727-A114-26E137D4B27E" ); if( compareClassGuid( p4_guid ) ){ std::unique_ptr< TrigEMClusterContainer_p4 > col_vect( poolReadObject< TrigEMClusterContainer_p4 >() ); // std::cout << "Reading IMFC p4" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigEMClusterContainer_p3 > col_vect( poolReadObject< TrigEMClusterContainer_p3 >() ); - return TPConverter_p3.createTransient( col_vect.get(), mlog ) ; + return m_converter_p3.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigEMClusterContainer_tlp1 > col_vect( poolReadObject< TrigEMClusterContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error( "Unsupported persistent version of TrigEMClusterContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h index 724d17182b4..127b8ea146f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGEMCLUSTERCONTAINER_CNV_H @@ -10,8 +10,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigEMClusterContainer.h" +#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p3.h" #include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p4.h" - + typedef TrigEMClusterContainer_p4 TrigEMClusterContainer_PERS; typedef T_AthenaPoolCustomCnv TrigEMClusterContainerCnvBase; @@ -26,11 +28,16 @@ class TrigEMClusterContainerCnv : public TrigEMClusterContainerCnvBase public: TrigEMClusterContainerCnv( ISvcLocator *svcloc ): TrigEMClusterContainerCnvBase(svcloc){} protected: - virtual TrigEMClusterContainer_PERS *createPersistent( TrigEMClusterContainer *transObj); virtual TrigEMClusterContainer *createTransient(); - + +private: + TrigEMClusterContainerCnv_tlp1 m_converter_tlp1; + TrigEMClusterContainerCnv_p4 m_converter; + TrigEMClusterContainerCnv_p3 m_converter_p3; + + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx index 6ad7d1cfb4d..716af26f65b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigElectronContainerCnv.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp2.h" - #include "TrigParticleTPCnv/TrigElectronContainer_p3.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_p3.h" - -static TrigElectronContainerCnv_tlp1 TPConverter_tlp1; -static TrigElectronContainerCnv_tlp2 TPConverter_tlp2; -static TrigElectronContainerCnv_p3 TPConverter; //create persistent TrigElectronContainer_PERS* TrigElectronContainerCnv::createPersistent(TrigElectronContainer* transCont) @@ -19,7 +11,7 @@ TrigElectronContainer_PERS* TrigElectronContainerCnv::createPersistent(TrigElect MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" ); mlog << MSG::DEBUG << "TrigElectronContainerCnv::createPersistent" << endmsg; - TrigElectronContainer_PERS *persObj = TPConverter.createPersistent( transCont, mlog ); + TrigElectronContainer_PERS *persObj = m_converter.createPersistent( transCont, mlog ); return persObj; } @@ -30,26 +22,26 @@ TrigElectronContainer* TrigElectronContainerCnv::createTransient() MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" ); mlog << MSG::DEBUG << "TrigElectronContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid("F2E0066A-3BC5-44F2-A18C-57C63481988D"); - static pool::Guid tlp2_guid("2EDB14B9-0B61-4014-90C2-20AEB7AAFEBE"); - static pool::Guid tlp1_guid("8831D2A9-F4B6-40BE-97C1-4BD7F9468267"); - static pool::Guid p0_guid2("2F97E0FB-7C93-4616-B322-1A01BF65D331"); - static pool::Guid p0_guid1("EA6EA1A5-16FC-4DBF-896E-D933B25E65E0"); + static const pool::Guid p3_guid("F2E0066A-3BC5-44F2-A18C-57C63481988D"); + static const pool::Guid tlp2_guid("2EDB14B9-0B61-4014-90C2-20AEB7AAFEBE"); + static const pool::Guid tlp1_guid("8831D2A9-F4B6-40BE-97C1-4BD7F9468267"); + static const pool::Guid p0_guid2("2F97E0FB-7C93-4616-B322-1A01BF65D331"); + static const pool::Guid p0_guid1("EA6EA1A5-16FC-4DBF-896E-D933B25E65E0"); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigElectronContainer_p3 > col_vect( poolReadObject< TrigElectronContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid(tlp2_guid) ) { std::unique_ptr< TrigElectronContainer_tlp2 > col_vect( poolReadObject< TrigElectronContainer_tlp2 >() ); - return TPConverter_tlp2.createTransient( col_vect.get(), mlog ); + return m_converter_tlp2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(tlp1_guid) ) { std::unique_ptr< TrigElectronContainer_tlp1 > col_vect( poolReadObject< TrigElectronContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(p0_guid1) || compareClassGuid(p0_guid2) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h index 4b44a8168bb..bd16e3e4d90 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGELECTRONCONTAINERCNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigElectronContainer.h" #include "TrigParticleTPCnv/TrigElectronContainer_p3.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_p3.h" typedef TrigElectronContainer_p3 TrigElectronContainer_PERS; typedef T_AthenaPoolCustomCnv TrigElectronContainerCnvBase; @@ -27,6 +30,12 @@ protected: virtual TrigElectronContainer_PERS* createPersistent(TrigElectronContainer* transCont); virtual TrigElectronContainer* createTransient (); +private: + TrigElectronContainerCnv_tlp1 m_converter_tlp1; + TrigElectronContainerCnv_tlp2 m_converter_tlp2; + TrigElectronContainerCnv_p3 m_converter; + + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx index 0bb9292a0c4..43ef6a2ac4f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx @@ -22,7 +22,7 @@ TrigHisto1D* TrigHisto1DCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigHisto1DConverter" ); mlog << MSG::DEBUG << "TrigHisto1DCnv::createTransient " << endmsg; - static pool::Guid p1_guid("C304621E-2266-4863-9B47-7C3450B00399"); + static const pool::Guid p1_guid("C304621E-2266-4863-9B47-7C3450B00399"); TrigHisto1D *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx index bbc30868d65..98e0dad11c1 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx @@ -39,9 +39,9 @@ TrigHisto1DContainer* TrigHisto1DContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigHisto1DContainerCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "CDC70E22-85DF-45B4-B69E-FC7FD70987A9" ); - static pool::Guid p1_guid( "B6240954-1842-45F5-AB5B-50934C633B1E" ); - static pool::Guid trans_guid( "B5752F0C-EF7A-4330-8413-1CCF0FC58AC8" ); + static const pool::Guid tlp1_guid( "CDC70E22-85DF-45B4-B69E-FC7FD70987A9" ); + static const pool::Guid p1_guid( "B6240954-1842-45F5-AB5B-50934C633B1E" ); + static const pool::Guid trans_guid( "B5752F0C-EF7A-4330-8413-1CCF0FC58AC8" ); TrigHisto1DContainer *p_container = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx index a606b4ba13c..8152eebd78f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx @@ -22,7 +22,7 @@ TrigHisto2D* TrigHisto2DCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigHisto2DConverter" ); mlog << MSG::DEBUG << "TrigHisto2DCnv::createTransient " << endmsg; - static pool::Guid p1_guid("8CF4D0A0-2957-4014-AEB2-140D1A013E7F"); + static const pool::Guid p1_guid("8CF4D0A0-2957-4014-AEB2-140D1A013E7F"); TrigHisto2D *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx index ff37fc7b4fd..ac9a89d248d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx @@ -38,9 +38,9 @@ TrigHisto2DContainer* TrigHisto2DContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigHisto2DContainerCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "59C6A169-C537-4DEC-984D-41CE2544F96E" ); - static pool::Guid p1_guid( "C9FE79CB-6875-4E35-A1E3-23DFA6F94DFE" ); - static pool::Guid trans_guid( "E43A29FA-3BC9-4B08-9A94-735E1EC53951" ); + static const pool::Guid tlp1_guid( "59C6A169-C537-4DEC-984D-41CE2544F96E" ); + static const pool::Guid p1_guid( "C9FE79CB-6875-4E35-A1E3-23DFA6F94DFE" ); + static const pool::Guid trans_guid( "E43A29FA-3BC9-4B08-9A94-735E1EC53951" ); TrigHisto2DContainer *p_container = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx index 269c1cd30b7..e92832a5401 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx @@ -46,11 +46,11 @@ TrigInDetTrackCollection* TrigInDetTrackCollectionCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigInDetTrackCollectionConverter" ); mlog << MSG::DEBUG << "TrigInDetTrackCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp4_guid("E1B8EE19-4F7B-4EF2-8FDC-45AA871BD628"); - static pool::Guid tlp3_guid("196F811B-382D-47A9-8551-D2038343BFFA"); - static pool::Guid tlp2_guid("4DBBB46F-33C9-4571-AE5E-A2335D7A2976"); - static pool::Guid tlp1_guid("0B5CA4CA-0A0F-43DC-8973-0E2212B2E8DA"); - static pool::Guid p0_guid("5F6029E6-764B-4126-891D-73BFC3CC391C"); + static const pool::Guid tlp4_guid("E1B8EE19-4F7B-4EF2-8FDC-45AA871BD628"); + static const pool::Guid tlp3_guid("196F811B-382D-47A9-8551-D2038343BFFA"); + static const pool::Guid tlp2_guid("4DBBB46F-33C9-4571-AE5E-A2335D7A2976"); + static const pool::Guid tlp1_guid("0B5CA4CA-0A0F-43DC-8973-0E2212B2E8DA"); + static const pool::Guid p0_guid("5F6029E6-764B-4126-891D-73BFC3CC391C"); TrigInDetTrackCollection *transObj = 0; if( compareClassGuid(tlp4_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx index 725533960b9..0a02a950d89 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2BjetContainerCnv.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" - #include "TrigParticleTPCnv/TrigL2BjetContainer_p3.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_p3.h" - -static TrigL2BjetContainerCnv_tlp1 TLPconverter1; -static TrigL2BjetContainerCnv_tlp2 TLPconverter2; -static TrigL2BjetContainerCnv_p3 TPconverter; //* createPersistent *// TrigL2BjetContainer_PERS * TrigL2BjetContainerCnv::createPersistent( TrigL2BjetContainer *transObj) { @@ -20,7 +12,7 @@ TrigL2BjetContainer_PERS * TrigL2BjetContainerCnv::createPersistent( TrigL2BjetC mlog << MSG::DEBUG << "TrigL2BjetContainerCnv::createPersistent called" << endmsg; - TrigL2BjetContainer_PERS * p_L2BjetCont = TPconverter.createPersistent( transObj, mlog ); + TrigL2BjetContainer_PERS * p_L2BjetCont = m_converter.createPersistent( transObj, mlog ); return p_L2BjetCont; @@ -33,28 +25,28 @@ TrigL2BjetContainer * TrigL2BjetContainerCnv::createTransient() { mlog << MSG::DEBUG << "TrigL2BjetContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "65534D07-EECA-46B1-A6AA-A4DA4DFEAAEF" ); - static pool::Guid tlp2_guid( "67162A5D-CEC3-4D9B-AF43-1858D6F1558E" ); - static pool::Guid tlp1_guid( "716A64FC-6EAF-4851-A0C8-8CE73C43C051" ); - static pool::Guid p0_guid( "B4842D15-7BFB-476E-8C68-F2F38E588380" ); - static pool::Guid p0_guid2( "F6ACED03-42F3-4192-A4E2-47FA9A9B9D49" ); + static const pool::Guid p3_guid( "65534D07-EECA-46B1-A6AA-A4DA4DFEAAEF" ); + static const pool::Guid tlp2_guid( "67162A5D-CEC3-4D9B-AF43-1858D6F1558E" ); + static const pool::Guid tlp1_guid( "716A64FC-6EAF-4851-A0C8-8CE73C43C051" ); + static const pool::Guid p0_guid( "B4842D15-7BFB-476E-8C68-F2F38E588380" ); + static const pool::Guid p0_guid2( "F6ACED03-42F3-4192-A4E2-47FA9A9B9D49" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigL2BjetContainer_p3 > col_vect( poolReadObject< TrigL2BjetContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< TrigL2BjetContainer_tlp2 > col_vect( poolReadObject< TrigL2BjetContainer_tlp2 >() ); // std::cout << "Reading IMFC tlp2" << std::endl; - return TLPconverter2.createTransient( col_vect.get(), mlog ); + return m_converter2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigL2BjetContainer_tlp1 > col_vect( poolReadObject< TrigL2BjetContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) || compareClassGuid( p0_guid2 ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h index d2d7d8c7ec9..cd7a603087c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGL2BJETCONTAINER_CNV_H @@ -9,6 +9,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigL2BjetContainer.h" #include "TrigParticleTPCnv/TrigL2BjetContainer_p3.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_p3.h" typedef TrigL2BjetContainer_p3 TrigL2BjetContainer_PERS; @@ -26,6 +29,11 @@ protected: virtual TrigL2BjetContainer_PERS *createPersistent( TrigL2BjetContainer *transObj); virtual TrigL2BjetContainer *createTransient(); +private: + TrigL2BjetContainerCnv_tlp1 m_converter1; + TrigL2BjetContainerCnv_tlp2 m_converter2; + TrigL2BjetContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx index a13bffb12cf..f4963854b8c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx @@ -50,10 +50,10 @@ TrigL2BphysContainer * TrigL2BphysContainerCnv::createTransient() m_impl->m_log << MSG::DEBUG << "TrigL2BphysContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "2E35788D-BE17-4FE1-9DB5-709E05880CEC" ); - static pool::Guid tlp1_guid( "E8AA6B0A-B057-4058-B5A9-AC0B719626AF" ); - static pool::Guid p0_guid( "23296C53-6811-4D19-BD32-816B5DD0508F" ); - static pool::Guid p0_guid2( "390F41C1-CCFA-4A1D-B046-F9F462FD64D0" ); + static const pool::Guid tlp2_guid( "2E35788D-BE17-4FE1-9DB5-709E05880CEC" ); + static const pool::Guid tlp1_guid( "E8AA6B0A-B057-4058-B5A9-AC0B719626AF" ); + static const pool::Guid p0_guid( "23296C53-6811-4D19-BD32-816B5DD0508F" ); + static const pool::Guid p0_guid2( "390F41C1-CCFA-4A1D-B046-F9F462FD64D0" ); TrigL2BphysContainer *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx index e5a70cd76e2..8149807d6ad 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx @@ -32,9 +32,9 @@ TrigMissingET* TrigMissingETCnv::createTransient() { mlog << MSG::DEBUG << "TrigMissingETCnv::createTransient " << endmsg; - static pool::Guid p2_guid("9972F10B-2B6A-42A7-AF71-D8FB60F07C6D"); - static pool::Guid p1_guid("A65F0499-A789-4D66-9930-E8651FE91F8A"); - static pool::Guid p0_guid("1403772C-7444-4340-930B-ABD51C243A09"); + static const pool::Guid p2_guid("9972F10B-2B6A-42A7-AF71-D8FB60F07C6D"); + static const pool::Guid p1_guid("A65F0499-A789-4D66-9930-E8651FE91F8A"); + static const pool::Guid p0_guid("1403772C-7444-4340-930B-ABD51C243A09"); if( compareClassGuid(p2_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx index aa3f7b32553..54e1fadd1dd 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx @@ -1,25 +1,19 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMissingETContainerCnv.h" -#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_tlp1.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p1.h" - -#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_p3.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p3.h" -static TrigMissingETContainerCnv_tlp1 converter_tlp1; -static TrigMissingETContainerCnv_p3 TPConverter; - -//createPersistent +//createPersistent TrigMissingETContainer_PERS * TrigMissingETContainerCnv::createPersistent( TrigMissingETContainer *transObj) { MsgStream mlog(msgSvc(), "TrigMissingETContainerConverter" ); mlog << MSG::DEBUG << "TrigMissingETContainerCnv::createPersistent" << endmsg; - TrigMissingETContainer_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigMissingETContainer_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -33,18 +27,18 @@ TrigMissingETContainer* TrigMissingETContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigMissingETContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid( "F5C98A61-4F40-4FE6-A1A9-D5EF00FFFBF0" ); - static pool::Guid tlp1_guid( "23EC84A7-8614-42D6-B82D-B0861D3CE08D" ); + static const pool::Guid p3_guid( "F5C98A61-4F40-4FE6-A1A9-D5EF00FFFBF0" ); + static const pool::Guid tlp1_guid( "23EC84A7-8614-42D6-B82D-B0861D3CE08D" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigMissingETContainer_p3 > col_vect( poolReadObject< TrigMissingETContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigMissingETContainer_tlp1 > col_vect( poolReadObject< TrigMissingETContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return converter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigMissingETContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h index 7b64e9fcc77..85923dc8217 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMISSINGETCONTAINER_CNV_H @@ -11,6 +11,8 @@ #include "TrigMissingEtEvent/TrigMissingETContainer.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p3.h" +#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_tlp1.h" +#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_p3.h" typedef TrigMissingETContainer_p3 TrigMissingETContainer_PERS; @@ -28,6 +30,10 @@ protected: virtual TrigMissingETContainer_PERS *createPersistent( TrigMissingETContainer *transObj); virtual TrigMissingETContainer *createTransient(); +private: + TrigMissingETContainerCnv_tlp1 m_converter_tlp1; + TrigMissingETContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx index 972a3c5698b..01e6d324037 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx @@ -37,7 +37,7 @@ TrigMonConfig* TrigMonConfigCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonConfigCnv::createTransient " << endmsg; - static pool::Guid p1_guid("E841D3CA-AB5A-4955-850A-B368DE66A987"); + static const pool::Guid p1_guid("E841D3CA-AB5A-4955-850A-B368DE66A987"); TrigMonConfig *trans_obj(0); if(compareClassGuid(p1_guid)) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx index 3de8e1497a2..5b88a426071 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx @@ -45,8 +45,8 @@ TrigMonConfigCollection* TrigMonConfigCollectionCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonConfigCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("887A60C5-BD4D-467C-9629-9F0EE818398A"); - static pool::Guid p1_guid("77FAC318-137E-4563-A681-68356299E397"); + static const pool::Guid tlp1_guid("887A60C5-BD4D-467C-9629-9F0EE818398A"); + static const pool::Guid p1_guid("77FAC318-137E-4563-A681-68356299E397"); TrigMonConfigCollection *trans_obj(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx index ac6fa9328ef..bb84fdd101b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ @@ -37,7 +37,7 @@ TrigMonEvent* TrigMonEventCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonEventCnv::createTransient " << endmsg; - static pool::Guid p1_guid("AECD5837-E8DA-4FF3-8601-44B4C17355ED"); + static const pool::Guid p1_guid("AECD5837-E8DA-4FF3-8601-44B4C17355ED"); TrigMonEvent *trans_obj(0); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx index a7cb47941ab..e0b37206c32 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx @@ -45,8 +45,8 @@ TrigMonEventCollection* TrigMonEventCollectionCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonEventCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("F224B21A-0CE8-40F1-B88B-027DA832A2A5"); - static pool::Guid p1_guid("9A0D41EB-9A40-42A1-8CDA-C80845FC7271"); + static const pool::Guid tlp1_guid("F224B21A-0CE8-40F1-B88B-027DA832A2A5"); + static const pool::Guid p1_guid("9A0D41EB-9A40-42A1-8CDA-C80845FC7271"); TrigMonEventCollection *trans_obj(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx index 0b2eaa8100e..6ca5bc429d6 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx @@ -1,12 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonClusterFeatureCnv.h" #include "TrigMuonEventTPCnv/TrigMuonClusterFeature_tlp1.h" -#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" - -static TrigMuonClusterFeatureCnv_tlp1 TPConverter; //----------------------------------------------------------------------------- // Create persistent @@ -19,7 +16,7 @@ TrigMuonClusterFeatureCnv::createPersistent( TrigMuonClusterFeature *transObj) mlog << MSG::DEBUG << "TrigMuonClusterFeatureCnv::createPersistent" << endmsg; - TrigMuonClusterFeature_PERS *persObj = TPConverter.createPersistent( transObj, mlog ); + TrigMuonClusterFeature_PERS *persObj = m_converter.createPersistent( transObj, mlog ); return persObj; } @@ -33,12 +30,12 @@ TrigMuonClusterFeature *TrigMuonClusterFeatureCnv::createTransient() mlog << MSG::DEBUG << "TrigMuonClusterFeatureCnv::createTransient " << endmsg; - static pool::Guid p1_guid("AE4D5D57-689D-40CB-83B3-CB047884952F"); - static pool::Guid p0_guid("A7B1865B-55D0-49D2-9778-5E0797FB06FE"); + static const pool::Guid p1_guid("AE4D5D57-689D-40CB-83B3-CB047884952F"); + static const pool::Guid p0_guid("A7B1865B-55D0-49D2-9778-5E0797FB06FE"); if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigMuonClusterFeature_tlp1 > col_vect( poolReadObject< TrigMuonClusterFeature_tlp1 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ); + return m_converter.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid(p0_guid) ) { // old version from before TP separation, just return it diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h index 08db4ed8007..ee5fa2f0b81 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONCLUSTERFEATURECNV_H @@ -8,7 +8,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonClusterFeature.h" -#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" //----------------------------------------------------------------------------- // Base class definition @@ -29,7 +29,9 @@ protected: virtual TrigMuonClusterFeature_PERS* createPersistent( TrigMuonClusterFeature *transObj); virtual TrigMuonClusterFeature* createTransient(); - +private: + TrigMuonClusterFeatureCnv_tlp1 m_converter; + }; #endif // TRIGMUONCLUSTERFEATURE_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx index 6bde5df819c..58a2478e4a4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx @@ -39,8 +39,8 @@ TrigMuonClusterFeatureContainer * TrigMuonClusterFeatureContainerCnv::createTran mlog << MSG::DEBUG << "TrigMuonClusterFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "036D8CC1-5FBD-4676-9D84-F233567F52D2" ); - static pool::Guid p0_guid( "5B09201A-D1CD-43BA-A1B5-786189444579" ); + static const pool::Guid tlp1_guid( "036D8CC1-5FBD-4676-9D84-F233567F52D2" ); + static const pool::Guid p0_guid( "5B09201A-D1CD-43BA-A1B5-786189444579" ); TrigMuonClusterFeatureContainer *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx index 0dd67fd734e..3450bbf973e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx @@ -1,16 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEFContainerCnv.h" -#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/TrigMuonEFContainer_p2.h" -#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_p2.h" - - -static TrigMuonEFContainerCnv_tlp1 TPConverter_tlp1; -static TrigMuonEFContainerCnv_p2 TPConverter; //createPersistent TrigMuonEFContainer_PERS * TrigMuonEFContainerCnv::createPersistent( TrigMuonEFContainer *transObj) @@ -19,7 +12,7 @@ TrigMuonEFContainer_PERS * TrigMuonEFContainerCnv::createPersistent( TrigMuonEFC mlog << MSG::DEBUG << "TrigMuonEFContainerCnv::createPersistent called" << endmsg; - TrigMuonEFContainer_PERS * p_muEFcont = TPConverter.createPersistent( transObj, mlog ); + TrigMuonEFContainer_PERS * p_muEFcont = m_converter.createPersistent( transObj, mlog ); return p_muEFcont; @@ -33,19 +26,19 @@ TrigMuonEFContainer * TrigMuonEFContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigMuonEFContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "3BB5C107-2975-4F9E-AACC-9FD948C3D2A8" ); - static pool::Guid p1_guid( "567E65A0-23E8-469F-94F7-A03F6E9C1C2E" ); - static pool::Guid p0_guid( "BB866230-C9D8-437A-A11B-A0CC08ACD97B" ); + static const pool::Guid p2_guid( "3BB5C107-2975-4F9E-AACC-9FD948C3D2A8" ); + static const pool::Guid p1_guid( "567E65A0-23E8-469F-94F7-A03F6E9C1C2E" ); + static const pool::Guid p0_guid( "BB866230-C9D8-437A-A11B-A0CC08ACD97B" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigMuonEFContainer_p2 > col_vect( poolReadObject< TrigMuonEFContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigMuonEFContainer_tlp1 > col_vect( poolReadObject< TrigMuonEFContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h index c7f835fd17e..bb0eb6d68be 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONEFCONTAINER_CNV_H @@ -10,6 +10,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonEFContainer.h" #include "TrigMuonEventTPCnv/TrigMuonEFContainer_p2.h" +#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_p2.h" typedef TrigMuonEFContainer_p2 TrigMuonEFContainer_PERS; @@ -27,6 +29,10 @@ protected: virtual TrigMuonEFContainer_PERS *createPersistent( TrigMuonEFContainer *transObj); virtual TrigMuonEFContainer *createTransient(); + +private: + TrigMuonEFContainerCnv_tlp1 m_converter_tlp1; + TrigMuonEFContainerCnv_p2 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx index e1af37b26f5..65024464e01 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx @@ -38,8 +38,8 @@ TrigMuonEFInfoContainer * TrigMuonEFInfoContainerCnv::createTransient(){ mlog << MSG::DEBUG << "TrigMuonEFInfoContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "B768E99D-9CC3-4368-ADD5-36816D2A0298" ); - static pool::Guid p2_guid( "AF8CBEC0-4BBF-438A-82DE-873F133F4821" ); + static const pool::Guid p1_guid( "B768E99D-9CC3-4368-ADD5-36816D2A0298" ); + static const pool::Guid p2_guid( "AF8CBEC0-4BBF-438A-82DE-873F133F4821" ); TrigMuonEFInfoContainer *p_collection = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx index 14a8f36dab4..7b4d005700a 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx @@ -1,15 +1,10 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEFIsolationContainerCnv.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p1.h" -#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p1.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p2.h" -#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p2.h" - -static TrigMuonEFIsolationContainerCnv_p1 TPconverter_p1; -static TrigMuonEFIsolationContainerCnv_p2 TPconverter_p2; TrigMuonEFIsolationContainerCnv::TrigMuonEFIsolationContainerCnv(ISvcLocator* svcloc) : @@ -25,7 +20,7 @@ TrigMuonEFIsolationContainer_PERS* TrigMuonEFIsolationContainerCnv::createPersis MsgStream mlog(msgSvc(), "TrigMuonEFIsolationContainerConverter" ); mlog << MSG::DEBUG << "TrigMuonEFIsolationContainerCnv::createPersistent" << endmsg; - TrigMuonEFIsolationContainer_PERS *persObj = TPconverter_p2.createPersistent(transCont, mlog); + TrigMuonEFIsolationContainer_PERS *persObj = m_converter_p2.createPersistent(transCont, mlog); return persObj; } @@ -36,17 +31,17 @@ TrigMuonEFIsolationContainer* TrigMuonEFIsolationContainerCnv::createTransient() MsgStream mlog(msgSvc(), "TrigMuonEFIsolationContainerConverter" ); mlog << MSG::DEBUG << "TrigMuonEFIsolationContainerCnv::createTransient" << endmsg; - static pool::Guid p1_guid("5C3ECE20-F26F-4811-BA76-B2DC567858BC"); - static pool::Guid p2_guid("B24570F4-BB65-4D5C-A8E2-C44E36E7B0B5"); + static const pool::Guid p1_guid("5C3ECE20-F26F-4811-BA76-B2DC567858BC"); + static const pool::Guid p2_guid("B24570F4-BB65-4D5C-A8E2-C44E36E7B0B5"); TrigMuonEFIsolationContainer* trans_cont(0); if ( compareClassGuid(p2_guid) ) { std::unique_ptr< TrigMuonEFIsolationContainer_p2 > col_vect( this->poolReadObject< TrigMuonEFIsolationContainer_p2 >() ); - trans_cont = TPconverter_p2.createTransient( col_vect.get(), mlog ); + trans_cont = m_converter_p2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(p1_guid) ) { std::unique_ptr< TrigMuonEFIsolationContainer_p1 > col_vect( this->poolReadObject< TrigMuonEFIsolationContainer_p1 >() ); - trans_cont = TPconverter_p1.createTransient( col_vect.get(), mlog ); + trans_cont = m_converter_p1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error("Unsupported persistent version of Data container"); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h index 82f506c08d9..aed7c9bd0e1 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONEFISOLATIONCONTAINERCNV_H__ @@ -16,6 +16,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonEFIsolationContainer.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p2.h" +#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p1.h" +#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p2.h" // typedef to the latest persistent version typedef TrigMuonEFIsolationContainer_p2 TrigMuonEFIsolationContainer_PERS; @@ -38,6 +40,11 @@ protected: TrigMuonEFIsolationContainer* createTransient(); +private: + TrigMuonEFIsolationContainerCnv_p1 m_converter_p1; + TrigMuonEFIsolationContainerCnv_p2 m_converter_p2; + + };//class TrigMuonEFIsolationContainerCnv diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx index 32a8f30b311..b7ac648c7e6 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx @@ -1,28 +1,20 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigPhotonContainerCnv.h" #include "TrigParticleTPCnv/TrigPhotonContainer_tlp1.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp1.h" #include "TrigParticleTPCnv/TrigPhotonContainer_tlp2.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp2.h" #include "TrigParticleTPCnv/TrigPhotonContainer_p3.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_p3.h" -static TrigPhotonContainerCnv_tlp1 TPConverter_tlp1; -static TrigPhotonContainerCnv_tlp2 TPConverter_tlp2; -static TrigPhotonContainerCnv_p3 TPConverter; - - -//createPersistent +//createPersistent TrigPhotonContainer_PERS * TrigPhotonContainerCnv::createPersistent( TrigPhotonContainer *transObj) { MsgStream mlog(msgSvc(), "TrigPhotonContainerConverter" ); mlog << MSG::DEBUG << "TrigPhotonContainerCnv::createPersistent called" << endmsg; - TrigPhotonContainer_PERS * p_PhotonCont = TPConverter.createPersistent( transObj, mlog ); + TrigPhotonContainer_PERS * p_PhotonCont = m_converter.createPersistent( transObj, mlog ); return p_PhotonCont; @@ -36,26 +28,26 @@ TrigPhotonContainer * TrigPhotonContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigPhotonContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "40192614-E7C5-4BAF-825F-CB9F3E023315" ); - static pool::Guid tlp2_guid( "96487DD7-9CF7-4351-BF33-011E6CA515F0" ); - static pool::Guid tlp1_guid( "7F4B4EF4-D7F6-4208-B522-4003A34EC664" ); - static pool::Guid p0_guid2( "65F1CCA1-B672-4E26-B74E-397CE6C8F617" ); - static pool::Guid p0_guid( "CB04DF3E-C363-49E3-9BE1-AD25230AB1EA" ); + static const pool::Guid p3_guid( "40192614-E7C5-4BAF-825F-CB9F3E023315" ); + static const pool::Guid tlp2_guid( "96487DD7-9CF7-4351-BF33-011E6CA515F0" ); + static const pool::Guid tlp1_guid( "7F4B4EF4-D7F6-4208-B522-4003A34EC664" ); + static const pool::Guid p0_guid2( "65F1CCA1-B672-4E26-B74E-397CE6C8F617" ); + static const pool::Guid p0_guid( "CB04DF3E-C363-49E3-9BE1-AD25230AB1EA" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigPhotonContainer_p3 > col_vect( poolReadObject< TrigPhotonContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< TrigPhotonContainer_tlp2 > col_vect( poolReadObject< TrigPhotonContainer_tlp2 >() ); - return TPConverter_tlp2.createTransient( col_vect.get(), mlog ); + return m_converter_tlp2.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigPhotonContainer_tlp1 > col_vect( poolReadObject< TrigPhotonContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) || compareClassGuid( p0_guid2 ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h index 817e38b851d..4cb3642fde1 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGPHOTONCONTAINER_CNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigPhotonContainer.h" #include "TrigParticleTPCnv/TrigPhotonContainer_p3.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_p3.h" typedef TrigPhotonContainer_p3 TrigPhotonContainer_PERS; @@ -27,6 +30,11 @@ protected: virtual TrigPhotonContainer_PERS *createPersistent( TrigPhotonContainer *transObj); virtual TrigPhotonContainer *createTransient(); + +private: + TrigPhotonContainerCnv_tlp1 m_converter_tlp1; + TrigPhotonContainerCnv_tlp2 m_converter_tlp2; + TrigPhotonContainerCnv_p3 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx index 22671b9852a..27c606fa0a4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx @@ -36,7 +36,7 @@ TrigRNNOutput* TrigRNNOutputCnv::createTransient() MsgStream mlog(msgSvc(), "TrigRNNOutputConverter" ); mlog << MSG::DEBUG << "TrigRNNOutputCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("BA106EC3-F776-DE11-BCB3-000423DD5A1A"); + static const pool::Guid tlp1_guid("BA106EC3-F776-DE11-BCB3-000423DD5A1A"); TrigRNNOutput *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx index 8dba2c7ebd6..f8cc73b6df2 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx @@ -1,14 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigRNNOutputContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigRNNOutputContainer_p2.h" -#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_p2.h" - -static TrigRNNOutputContainerCnv_tlp1 TPConverter_tlp1; -static TrigRNNOutputContainerCnv_p2 TPConverter; //createPersistent TrigRNNOutputContainer_PERS * TrigRNNOutputContainerCnv::createPersistent( TrigRNNOutputContainer *transObj) @@ -17,7 +12,7 @@ TrigRNNOutputContainer_PERS * TrigRNNOutputContainerCnv::createPersistent( TrigR mlog << MSG::DEBUG << "TrigRNNOutputContainerCnv::createPersistent called" << endmsg; - TrigRNNOutputContainer_PERS * p_Cont = TPConverter.createPersistent( transObj, mlog ); + TrigRNNOutputContainer_PERS * p_Cont = m_converter.createPersistent( transObj, mlog ); return p_Cont; @@ -31,17 +26,17 @@ TrigRNNOutputContainer * TrigRNNOutputContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigRNNOutputContainerCnv::createTransient called" << endmsg; - static pool::Guid tr_guid("FED72B55-6275-DE11-8F1B-000423DD5A1A"); - static pool::Guid tlp1_guid("86A89E9D-F776-DE11-B65D-000423DD5A1A"); - static pool::Guid p2_guid("B10FA1AF-F38F-4025-83C4-3A83A3F3AE71"); + static const pool::Guid tr_guid("FED72B55-6275-DE11-8F1B-000423DD5A1A"); + static const pool::Guid tlp1_guid("86A89E9D-F776-DE11-B65D-000423DD5A1A"); + static const pool::Guid p2_guid("B10FA1AF-F38F-4025-83C4-3A83A3F3AE71"); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigRNNOutputContainer_p2 > col_vect( poolReadObject< TrigRNNOutputContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigRNNOutputContainer_tlp1 > col_vect( poolReadObject< TrigRNNOutputContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if (compareClassGuid(tr_guid)) { // regular object from before the T/P separation return poolReadObject(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h index f770ad1d05a..a231a5f8b38 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGRNNOUTPUTCONTAINERCNV_H @@ -10,6 +10,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigRNNOutputContainer.h" #include "TrigCaloEventTPCnv/TrigRNNOutputContainer_p2.h" +#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_p2.h" typedef TrigRNNOutputContainer_p2 TrigRNNOutputContainer_PERS; @@ -27,6 +29,10 @@ protected: virtual TrigRNNOutputContainer_PERS *createPersistent( TrigRNNOutputContainer *transObj); virtual TrigRNNOutputContainer *createTransient(); + +private: + TrigRNNOutputContainerCnv_tlp1 m_converter_tlp1; + TrigRNNOutputContainerCnv_p2 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx index 15fc501afca..283f141e140 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx @@ -1,16 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSpacePointCountsCnv.h" #include "RootConversions/TConverterRegistry.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p1_old_cnv.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p1.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p1.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p2.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p2.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p3.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p3.h" + TrigSpacePointCountsCnv::TrigSpacePointCountsCnv(ISvcLocator *svcloc): TrigSpacePointCountsCnvBase(svcloc) {} TrigSpacePointCountsCnv::~TrigSpacePointCountsCnv(){} @@ -20,10 +18,8 @@ TrigSpacePointCounts_PERS* TrigSpacePointCountsCnv::createPersistent(TrigSpacePo MsgStream mlog(msgSvc(), "TrigSpacePointCountsConverter" ); mlog << MSG::DEBUG << "TrigSpacePointCountsCnv::createPersistent" << endmsg; - - TrigSpacePointCountsCnv_p3 converter; - TrigSpacePointCounts_PERS *persObj = converter.createPersistent( transObj, mlog ); + TrigSpacePointCounts_PERS *persObj = m_converter_p3.createPersistent( transObj, mlog ); return persObj; } @@ -34,25 +30,22 @@ TrigSpacePointCounts* TrigSpacePointCountsCnv::createTransient() { mlog << MSG::DEBUG << "TrigSpacePointCountsCnv::createTransient " << endmsg; - static pool::Guid p3_guid("43E61EDF-2902-4F64-8A89-F625DB7DA7CC"); - static pool::Guid p2_guid("3A6CFBCF-E2AE-4E3D-A965-091718A5CB9F"); - static pool::Guid p1_guid("8BF48F79-C6C2-4AA7-8180-16BC6C39280F"); - static pool::Guid p0_guid("1BCAD9FD-DAFE-4E50-9A37-C75E822E6D02"); + static const pool::Guid p3_guid("43E61EDF-2902-4F64-8A89-F625DB7DA7CC"); + static const pool::Guid p2_guid("3A6CFBCF-E2AE-4E3D-A965-091718A5CB9F"); + static const pool::Guid p1_guid("8BF48F79-C6C2-4AA7-8180-16BC6C39280F"); + static const pool::Guid p0_guid("1BCAD9FD-DAFE-4E50-9A37-C75E822E6D02"); if(compareClassGuid(p3_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p3 >() ); - TrigSpacePointCountsCnv_p3 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p3.createTransient( pers_ptr.get(), mlog ); } if(compareClassGuid(p2_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p2 >() ); - TrigSpacePointCountsCnv_p2 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p2.createTransient( pers_ptr.get(), mlog ); } if(compareClassGuid(p1_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p1 >() ); - TrigSpacePointCountsCnv_p1 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p1.createTransient( pers_ptr.get(), mlog ); } else if( compareClassGuid(p0_guid) ) { // old version from before TP separation, just return it @@ -64,15 +57,23 @@ TrigSpacePointCounts* TrigSpacePointCountsCnv::createTransient() { } - -StatusCode TrigSpacePointCountsCnv::initialize() -{ - static bool did_rootcnv = false; - if (!did_rootcnv) { - did_rootcnv = true; +namespace { + // Helper to be able to call thread-unsafe code during initialize as we + // currently cannot mark Converter::initialize() as thread-unsafe. + StatusCode loadConverter ATLAS_NOT_THREAD_SAFE() { static TrigSpacePointCounts_p1_old_cnv cnv; TConverterRegistry::Instance()->AddConverter (&cnv); + return StatusCode::SUCCESS; } +} + +StatusCode TrigSpacePointCountsCnv::initialize() +{ + [[maybe_unused]] static const bool did_rootcnv = []{ + StatusCode sc ATLAS_THREAD_SAFE = loadConverter(); + return sc.isSuccess(); + }(); + return TrigSpacePointCountsCnvBase::initialize(); } diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h index 4743556760f..eee329f99da 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,14 +12,16 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * - * File and Version Information: - * $Id: TrigSpacePointCountsCnv.h,v 1.4 2009-02-23 18:59:20 ssnyder Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCNV_H #define TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCNV_H #include "TrigInDetEvent/TrigSpacePointCounts.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p1.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p2.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p3.h" + class TrigSpacePointCounts_p3; // typedef to the latest persistent version @@ -41,6 +43,11 @@ public: protected: virtual TrigSpacePointCounts_PERS *createPersistent(TrigSpacePointCounts *transObj); virtual TrigSpacePointCounts *createTransient(); + +private: + TrigSpacePointCountsCnv_p1 m_converter_p1; + TrigSpacePointCountsCnv_p2 m_converter_p2; + TrigSpacePointCountsCnv_p3 m_converter_p3; }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx index 08f21dc69f0..7655a69d406 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx @@ -1,24 +1,19 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSpacePointCountsCollectionCnv.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_tlp1.h" #include "TrigInDetEventTPCnv/TrigSpacePointCountsCollection_p4.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_p4.h" -static TrigSpacePointCountsCollectionCnv_tlp1 TPConverter_tlp1; -static TrigSpacePointCountsCollectionCnv_p4 TPConverter; - -//createPersistent +//createPersistent TrigSpacePointCountsCollection_PERS * TrigSpacePointCountsCollectionCnv::createPersistent( TrigSpacePointCountsCollection *transObj) { MsgStream mlog(msgSvc(), "TrigSpacePointCountsCollectionConverter" ); mlog << MSG::DEBUG << "TrigSpacePointCountsCollectionCnv::createPersistent called" << endmsg; - TrigSpacePointCountsCollection_PERS * p_cont = TPConverter.createPersistent( transObj, mlog ); + TrigSpacePointCountsCollection_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -32,19 +27,19 @@ TrigSpacePointCountsCollection * TrigSpacePointCountsCollectionCnv::createTransi mlog << MSG::DEBUG << "TrigSpacePointCountsCollectionCnv::createTransient called" << endmsg; - static pool::Guid p4_guid( "ACEDF654-09D7-49F6-9054-8E2CEE767367" ); - static pool::Guid tlp1_guid( "55733D7E-0054-4785-ADA8-3EA70D7477F2" ); - static pool::Guid p0_guid( "633C9739-C3D1-4F5D-9678-887445DA42B6" ); + static const pool::Guid p4_guid( "ACEDF654-09D7-49F6-9054-8E2CEE767367" ); + static const pool::Guid tlp1_guid( "55733D7E-0054-4785-ADA8-3EA70D7477F2" ); + static const pool::Guid p0_guid( "633C9739-C3D1-4F5D-9678-887445DA42B6" ); if( compareClassGuid( p4_guid ) ) { std::unique_ptr< TrigSpacePointCountsCollection_p4 > col_vect( poolReadObject< TrigSpacePointCountsCollection_p4 >() ); // std::cout << "Reading IMFC p4" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigSpacePointCountsCollection_tlp1 > col_vect( poolReadObject< TrigSpacePointCountsCollection_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ) { return poolReadObject< TrigSpacePointCountsCollection >(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h index 15faddcd491..9efb975aad5 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCOLLECTION_CNV_H @@ -9,6 +9,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigSpacePointCountsCollection.h" #include "TrigInDetEventTPCnv/TrigSpacePointCountsCollection_p4.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_p4.h" typedef TrigSpacePointCountsCollection_p4 TrigSpacePointCountsCollection_PERS; @@ -31,7 +33,11 @@ protected: virtual TrigSpacePointCountsCollection_PERS *createPersistent( TrigSpacePointCountsCollection *transObj); virtual TrigSpacePointCountsCollection *createTransient(); - + +private: + TrigSpacePointCountsCollectionCnv_tlp1 m_converter_tlp1; + TrigSpacePointCountsCollectionCnv_p4 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx index 242aa8a5819..e27c614a868 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx @@ -40,8 +40,8 @@ TrigT2Jet * TrigT2JetCnv::createTransient() mlog << MSG::DEBUG << "TrigT2JetCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "EAF10B4D-AD26-4030-AF0C-1060A39D663D" ); - static pool::Guid p0_guid( "242473A8-A320-49F1-A680-136EA26C1FAF" ); + static const pool::Guid tlp1_guid( "EAF10B4D-AD26-4030-AF0C-1060A39D663D" ); + static const pool::Guid p0_guid( "242473A8-A320-49F1-A680-136EA26C1FAF" ); TrigT2Jet *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx index 2558c680e00..8aeb6fcac12 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx @@ -1,17 +1,10 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigT2JetContainerCnv.h" #include "TrigCaloEventTPCnv/TrigT2JetContainer_tlp1.h" -#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_tlp1.h" - #include "TrigCaloEventTPCnv/TrigT2JetContainer_p3.h" -#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_p3.h" - - -static TrigT2JetContainerCnv_tlp1 TPConverter_tlp1; -static TrigT2JetContainerCnv_p3 TPConverter; //createPersistent TrigT2JetContainer_PERS * TrigT2JetContainerCnv::createPersistent( TrigT2JetContainer *transObj) @@ -21,7 +14,7 @@ TrigT2JetContainer_PERS * TrigT2JetContainerCnv::createPersistent( TrigT2JetCont mlog << MSG::DEBUG << "TrigT2JetContainerCnv::createPersistent" << endmsg; - TrigT2JetContainer_PERS* p_T2JetCont = TPConverter.createPersistent( transObj, mlog ); + TrigT2JetContainer_PERS* p_T2JetCont = m_converter.createPersistent( transObj, mlog ); return p_T2JetCont; @@ -36,18 +29,18 @@ TrigT2JetContainer * TrigT2JetContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigT2JetContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "3B670168-C5AA-48A1-9813-C94530980EBF" ); - static pool::Guid p3_guid( "6215BEE2-45E7-4681-9089-9BD470CDAF4D" ); + static const pool::Guid tlp1_guid( "3B670168-C5AA-48A1-9813-C94530980EBF" ); + static const pool::Guid p3_guid( "6215BEE2-45E7-4681-9089-9BD470CDAF4D" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigT2JetContainer_p3 > col_vect( poolReadObject< TrigT2JetContainer_p3 >() ); //std::cout << "Reading TTCC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigT2JetContainer_tlp1 > col_vect( poolReadObject< TrigT2JetContainer_tlp1 >() ); //std::cout << "Reading TTC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigT2JetContainer" ); }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h index da7ce06ba0b..80da760cbb3 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,8 +12,6 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * - * File and Version Information: - * $Id: TrigT2JetContainerCnv.h,v 1.2 2009-02-23 18:59:20 ssnyder Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGT2JETCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_TRIGT2JETCONTAINER_CNV_H @@ -23,6 +21,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigT2JetContainer.h" #include "TrigCaloEventTPCnv/TrigT2JetContainer_p3.h" +#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_p3.h" + typedef TrigT2JetContainer_p3 TrigT2JetContainer_PERS; @@ -41,7 +42,11 @@ protected: virtual TrigT2JetContainer_PERS *createPersistent( TrigT2JetContainer *transObj); virtual TrigT2JetContainer *createTransient(); - + +private: + TrigT2JetContainerCnv_tlp1 m_converter_tlp1; + TrigT2JetContainerCnv_p3 m_converter; + };//end of class definitions #endif //TRIGT2JETCONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx index 2f5734c09f2..0ed7428508e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx @@ -25,8 +25,8 @@ TrigT2MbtsBits* TrigT2MbtsBitsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigT2MbtsBitsConverter" ); mlog << MSG::DEBUG << "TrigT2MbtsBitsCnv::createTransient " << endmsg; - static pool::Guid p2_guid("6D130C0D-20A2-4304-8E70-6775892217A6"); - static pool::Guid p1_guid("32E86328-15EB-42F5-A93F-6F891220A626"); + static const pool::Guid p2_guid("6D130C0D-20A2-4304-8E70-6775892217A6"); + static const pool::Guid p1_guid("32E86328-15EB-42F5-A93F-6F891220A626"); TrigT2MbtsBits *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx index c7944ba8171..4d3858946d1 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx @@ -1,14 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigT2MbtsBitsContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_p3.h" - -static TrigT2MbtsBitsContainerCnv_tlp1 TPConverter_tlp1; -static TrigT2MbtsBitsContainerCnv_p3 TPConverter; -static TrigT2MbtsBitsContainerCnv_p1 TP1Converter; //createPersistent TrigT2MbtsBitsContainer_PERS * TrigT2MbtsBitsContainerCnv::createPersistent( TrigT2MbtsBitsContainer *transObj) @@ -17,7 +11,7 @@ TrigT2MbtsBitsContainer_PERS * TrigT2MbtsBitsContainerCnv::createPersistent( Tri mlog << MSG::DEBUG << "TrigT2MbtsBitsContainerCnv::createPersistent" << endmsg; - TrigT2MbtsBitsContainer_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigT2MbtsBitsContainer_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -31,27 +25,27 @@ TrigT2MbtsBitsContainer* TrigT2MbtsBitsContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigT2MbtsBitsContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid( "60BD805D-F64E-46DF-87CD-0B4443660C97" ); - static pool::Guid tlp1_guid( "82BAAC80-62FC-4E6D-9BD7-1619064FF7AC" ); - static pool::Guid p1_guid( "139D9BFE-0944-44A6-8D9E-10CEEF8B30B9" ); - static pool::Guid trans_guid( "BBB00ED0-1D5C-4C73-8785-6BF239D07816" ); + static const pool::Guid p3_guid( "60BD805D-F64E-46DF-87CD-0B4443660C97" ); + static const pool::Guid tlp1_guid( "82BAAC80-62FC-4E6D-9BD7-1619064FF7AC" ); + static const pool::Guid p1_guid( "139D9BFE-0944-44A6-8D9E-10CEEF8B30B9" ); + static const pool::Guid trans_guid( "BBB00ED0-1D5C-4C73-8785-6BF239D07816" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigT2MbtsBitsContainer_p3 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigT2MbtsBitsContainer_tlp1 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(p1_guid)) { std::unique_ptr< TrigT2MbtsBitsContainer_p1 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_p1 >() ); - return TP1Converter.createTransient( col_vect.get(), mlog ); + return m_converter_p1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(trans_guid)) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h index 3056b3b28ac..934210626fe 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGT2MBTSBITSCONTAINER_CNV_H @@ -8,8 +8,9 @@ #include "GaudiKernel/MsgStream.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigT2MbtsBitsContainer.h" +#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_p3.h" - + typedef TrigT2MbtsBitsContainer_p3 TrigT2MbtsBitsContainer_PERS; typedef T_AthenaPoolCustomCnv TrigT2MbtsBitsContainerCnvBase; @@ -26,7 +27,12 @@ protected: virtual TrigT2MbtsBitsContainer_PERS *createPersistent( TrigT2MbtsBitsContainer *transObj); virtual TrigT2MbtsBitsContainer *createTransient(); - + +private: + TrigT2MbtsBitsContainerCnv_tlp1 m_converter_tlp1; + TrigT2MbtsBitsContainerCnv_p1 m_converter_p1; + TrigT2MbtsBitsContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx index 4191b898dbf..c61c69e8eca 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx @@ -44,9 +44,9 @@ TrigTauCluster* TrigTauClusterCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauClusterConverter" ); mlog << MSG::DEBUG << "TrigTauClusterCnv::createTransient " << endmsg; - static pool::Guid tlp2_guid("CEDD0095-1134-4CEC-91CC-61028B214F6C"); - static pool::Guid tlp1_guid("60C9B591-CE4B-473C-9CB9-8C4F99271D76"); - static pool::Guid p0_guid("9B3B6AE8-9CE6-44AB-8B31-8B39FED52607"); + static const pool::Guid tlp2_guid("CEDD0095-1134-4CEC-91CC-61028B214F6C"); + static const pool::Guid tlp1_guid("60C9B591-CE4B-473C-9CB9-8C4F99271D76"); + static const pool::Guid p0_guid("9B3B6AE8-9CE6-44AB-8B31-8B39FED52607"); TrigTauCluster *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx index 66139bd7e5f..05eeb790678 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx @@ -1,33 +1,21 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauClusterContainerCnv.h" #include "TrigCaloEventTPCnv/TrigTauClusterContainer_tlp1.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_tlp1.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p3.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p3.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p4.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p4.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p5.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p5.h" - -static TrigTauClusterContainerCnv_tlp1 TPconverter1; -static TrigTauClusterContainerCnv_p3 TPconverter3; -static TrigTauClusterContainerCnv_p4 TPconverter4; -static TrigTauClusterContainerCnv_p5 TPconverter5; -//createPersistent +//createPersistent TrigTauClusterContainer_PERS* TrigTauClusterContainerCnv::createPersistent(TrigTauClusterContainer *transObj) { MsgStream mlog(msgSvc(), "TrigTauClusterContainerConverter"); mlog << MSG::DEBUG << "TrigTauClusterContainerCnv::createPersistent called" << endmsg; - TrigTauClusterContainer_PERS* p_TauClusterCont = TPconverter5.createPersistent(transObj, mlog); + TrigTauClusterContainer_PERS* p_TauClusterCont = m_converter5.createPersistent(transObj, mlog); return p_TauClusterCont; @@ -41,35 +29,35 @@ TrigTauClusterContainer* TrigTauClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigTauClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p5_guid("8384F60B-952E-4DE4-B307-1AC1C405E156"); - static pool::Guid p4_guid("D41E29BA-0FE8-4319-85F4-93EA68AD9195"); - static pool::Guid p3_guid("3BB1A500-2188-47D4-9352-6638DEA3FC7D"); - static pool::Guid tlp1_guid("E1FC5307-A747-42D7-9542-998A9AACB445"); - static pool::Guid tlp2_guid("07437EBD-7637-4C3F-B177-6D640AE36FAD"); + static const pool::Guid p5_guid("8384F60B-952E-4DE4-B307-1AC1C405E156"); + static const pool::Guid p4_guid("D41E29BA-0FE8-4319-85F4-93EA68AD9195"); + static const pool::Guid p3_guid("3BB1A500-2188-47D4-9352-6638DEA3FC7D"); + static const pool::Guid tlp1_guid("E1FC5307-A747-42D7-9542-998A9AACB445"); + static const pool::Guid tlp2_guid("07437EBD-7637-4C3F-B177-6D640AE36FAD"); if(compareClassGuid(p5_guid)) { std::unique_ptr< TrigTauClusterContainer_p5 > col_vect(poolReadObject< TrigTauClusterContainer_p5 >()); //std::cout << "Reading TTCC p5" << std::endl; - return TPconverter5.createTransient(col_vect.get(), mlog); + return m_converter5.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(p4_guid)) { std::unique_ptr< TrigTauClusterContainer_p4 > col_vect(poolReadObject< TrigTauClusterContainer_p4 >()); //std::cout << "Reading TTCC p4" << std::endl; - return TPconverter4.createTransient(col_vect.get(), mlog); + return m_converter4.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(p3_guid)) { std::unique_ptr< TrigTauClusterContainer_p3 > col_vect(poolReadObject< TrigTauClusterContainer_p3 >()); //std::cout << "Reading TTCC p3" << std::endl; - return TPconverter3.createTransient(col_vect.get(), mlog); + return m_converter3.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigTauClusterContainer_tlp1 > col_vect(poolReadObject< TrigTauClusterContainer_tlp1 >()); //std::cout << "Reading TTC tlp1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h index 056ba1aeaad..61ab0ac1693 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,8 +12,6 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * -* File and Version Information: -* $Id: TrigTauClusterContainerCnv.h,v 1.5 2009-03-06 18:08:44 masik Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERCONTAINER_CNV_H @@ -22,6 +20,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigTauClusterContainer.h" #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p5.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p3.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p4.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p5.h" typedef TrigTauClusterContainer_p5 TrigTauClusterContainer_PERS; @@ -38,6 +40,13 @@ protected: virtual TrigTauClusterContainer_PERS* createPersistent(TrigTauClusterContainer *transObj); virtual TrigTauClusterContainer* createTransient(); + +private: + TrigTauClusterContainerCnv_tlp1 m_converter1; + TrigTauClusterContainerCnv_p3 m_converter3; + TrigTauClusterContainerCnv_p4 m_converter4; + TrigTauClusterContainerCnv_p5 m_converter5; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx index 3df3c4cebe6..01cf33749ab 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx @@ -34,8 +34,8 @@ TrigTauClusterDetails* TrigTauClusterDetailsCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauClusterDetailsConverter" ); mlog << MSG::DEBUG << "TrigTauClusterDetailsCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("4F82A265-04F7-4BE9-9DB1-42C00A574778"); - static pool::Guid p0_guid("1C8021CB-F4FB-473A-B379-9BEF3FC7FEB9"); + static const pool::Guid tlp1_guid("4F82A265-04F7-4BE9-9DB1-42C00A574778"); + static const pool::Guid p0_guid("1C8021CB-F4FB-473A-B379-9BEF3FC7FEB9"); TrigTauClusterDetails *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx index 4b77c2b1f3c..c5789d1af47 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx @@ -1,14 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauClusterDetailsContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainer_p2.h" -#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_p2.h" - -static TrigTauClusterDetailsContainerCnv_tlp1 TPconverter1; -static TrigTauClusterDetailsContainerCnv_p2 TPconverter; //createPersistent TrigTauClusterDetailsContainer_PERS * TrigTauClusterDetailsContainerCnv::createPersistent( TrigTauClusterDetailsContainer *transObj) @@ -17,7 +12,7 @@ TrigTauClusterDetailsContainer_PERS * TrigTauClusterDetailsContainerCnv::createP mlog << MSG::DEBUG << "TrigTauClusterDetailsContainerCnv::createPersistent called" << endmsg; - TrigTauClusterDetailsContainer_PERS * p_TauClusterCont = TPconverter.createPersistent( transObj, mlog ); + TrigTauClusterDetailsContainer_PERS * p_TauClusterCont = m_converter.createPersistent( transObj, mlog ); return p_TauClusterCont; @@ -30,19 +25,19 @@ TrigTauClusterDetailsContainer * TrigTauClusterDetailsContainerCnv::createTransi mlog << MSG::DEBUG << "TrigTauClusterDetailsContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "AAEE63E0-BA47-45AD-AC28-E07EC68812C4" ); - static pool::Guid tlp1_guid( "D7DA2036-9F38-4060-A5C9-75C72AF104C4" ); + static const pool::Guid p2_guid( "AAEE63E0-BA47-45AD-AC28-E07EC68812C4" ); + static const pool::Guid tlp1_guid( "D7DA2036-9F38-4060-A5C9-75C72AF104C4" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTauClusterDetailsContainer_p2 > col_vect( poolReadObject< TrigTauClusterDetailsContainer_p2 >() ); //std::cout << "Reading TTCD p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigTauClusterDetailsContainer_tlp1 > col_vect( poolReadObject< TrigTauClusterDetailsContainer_tlp1 >() ); //std::cout << "Reading TTCD tlp1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigTauClusterDetailsContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h index 110609990c9..aae5bb8b4b7 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERDETAILSCONTAINER_CNV_H @@ -12,6 +12,8 @@ #include "TrigCaloEvent/TrigTauClusterDetailsContainer.h" #include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainer_p2.h" +#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_p2.h" typedef TrigTauClusterDetailsContainer_p2 TrigTauClusterDetailsContainer_PERS; @@ -30,6 +32,10 @@ protected: virtual TrigTauClusterDetailsContainer_PERS *createPersistent( TrigTauClusterDetailsContainer *transObj); virtual TrigTauClusterDetailsContainer *createTransient(); +private: + TrigTauClusterDetailsContainerCnv_tlp1 m_converter1; + TrigTauClusterDetailsContainerCnv_p2 m_converter; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx index 360b6cfa920..36d27d22980 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx @@ -42,10 +42,10 @@ TrigTau* TrigTauCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauConverter" ); mlog << MSG::DEBUG << "TrigTauCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("82AE3333-5398-4590-A51A-616832332D9B"); - static pool::Guid p0_guid("F95B5B76-13D3-4EB4-94BB-1383B8571ADD"); - static pool::Guid tlp2_guid("B2619D46-FB89-4961-8A57-6A980A2EFB33"); - static pool::Guid p2_guid("9CA7EFF2-DB12-4E06-A425-01B1D8367BE3"); + static const pool::Guid tlp1_guid("82AE3333-5398-4590-A51A-616832332D9B"); + static const pool::Guid p0_guid("F95B5B76-13D3-4EB4-94BB-1383B8571ADD"); + static const pool::Guid tlp2_guid("B2619D46-FB89-4961-8A57-6A980A2EFB33"); + static const pool::Guid p2_guid("9CA7EFF2-DB12-4E06-A425-01B1D8367BE3"); TrigTau *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx index b1c0047f5af..ee9f9c1bc9d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx @@ -1,13 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauContainerCnv.h" -#include "TrigParticleTPCnv/TrigTauContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" - -static TrigTauContainerCnv_tlp1 TPConverter_tlp1; -static TrigTauContainerCnv_p3 TPConverter; //createPersistent TrigTauContainer_PERS * TrigTauContainerCnv::createPersistent( TrigTauContainer *transObj) @@ -16,7 +11,7 @@ TrigTauContainer_PERS * TrigTauContainerCnv::createPersistent( TrigTauContainer mlog << MSG::DEBUG << "TrigTauContainerCnv::createPersistent called" << endmsg; - TrigTauContainer_PERS * p_TauCont = TPConverter.createPersistent( transObj, mlog ); + TrigTauContainer_PERS * p_TauCont = m_converter.createPersistent( transObj, mlog ); return p_TauCont; @@ -29,16 +24,16 @@ TrigTauContainer * TrigTauContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigTauContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "32FE95F3-F85E-481E-9DD6-7BBA08ABDBD7" ); - static pool::Guid tlp1_guid( "1551CECC-52C7-4B5B-876C-27005A8DCCC8" ); + static const pool::Guid p3_guid( "32FE95F3-F85E-481E-9DD6-7BBA08ABDBD7" ); + static const pool::Guid tlp1_guid( "1551CECC-52C7-4B5B-876C-27005A8DCCC8" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigTauContainer_p3 > col_vect( poolReadObject< TrigTauContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigTauContainer_tlp1 > col_vect( poolReadObject< TrigTauContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error( "Unsupported persistent version of TrigTauContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h index 8baf76302a9..6c9b7d5b498 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCONTAINER_CNV_H @@ -11,7 +11,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigTauContainer.h" #include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" - + #include "TrigParticleTPCnv/TrigTauContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" + typedef TrigTauContainer_p3 TrigTauContainer_PERS; typedef T_AthenaPoolCustomCnv TrigTauContainerCnvBase; @@ -30,7 +32,11 @@ protected: virtual TrigTauContainer_PERS *createPersistent( TrigTauContainer *transObj); virtual TrigTauContainer *createTransient(); - + +private: + TrigTauContainerCnv_tlp1 m_converter_tlp1; + TrigTauContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx index 91df9b42460..23284316529 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx @@ -32,8 +32,8 @@ TrigTauTracksInfo* TrigTauTracksInfoCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauTracksInfoConverter" ); mlog << MSG::DEBUG << "TrigTauTracksInfoCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("ABF3C91C-A007-440E-8AEE-753FAA453352"); - static pool::Guid p0_guid("630E4944-7EDE-4938-B189-020DBC0436AE"); + static const pool::Guid tlp1_guid("ABF3C91C-A007-440E-8AEE-753FAA453352"); + static const pool::Guid p0_guid("630E4944-7EDE-4938-B189-020DBC0436AE"); TrigTauTracksInfo *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx index ca0218949bb..df4047f8cdb 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx @@ -1,13 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauTracksInfoCollectionCnv.h" -#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_tlp1.h" -#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_p2.h" - -static TrigTauTracksInfoCollectionCnv_tlp1 TPConverter_tlp1; -static TrigTauTracksInfoCollectionCnv_p2 TPConverter; //createPersistent TrigTauTracksInfoCollection_PERS * TrigTauTracksInfoCollectionCnv::createPersistent( TrigTauTracksInfoCollection *transObj) @@ -16,7 +11,7 @@ TrigTauTracksInfoCollection_PERS * TrigTauTracksInfoCollectionCnv::createPersist mlog << MSG::DEBUG << "TrigTauTracksInfoCollectionCnv::createPersistent called" << endmsg; - TrigTauTracksInfoCollection_PERS * p_cont = TPConverter.createPersistent( transObj, mlog ); + TrigTauTracksInfoCollection_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -30,16 +25,16 @@ TrigTauTracksInfoCollection * TrigTauTracksInfoCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTauTracksInfoCollectionCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "1AF8C4E5-4862-4625-B9B6-D9B53E716B17" ); - static pool::Guid p1_guid( "8A208FA7-C52F-4CD3-AE20-EF1C99FC92A6" ); - static pool::Guid p0_guid( "27E95E77-0D99-417D-83C7-7F1B8E6DE511" ); + static const pool::Guid p2_guid( "1AF8C4E5-4862-4625-B9B6-D9B53E716B17" ); + static const pool::Guid p1_guid( "8A208FA7-C52F-4CD3-AE20-EF1C99FC92A6" ); + static const pool::Guid p0_guid( "27E95E77-0D99-417D-83C7-7F1B8E6DE511" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTauTracksInfoCollection_p2 > col_vect( poolReadObject< TrigTauTracksInfoCollection_p2 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigTauTracksInfoCollection_tlp1 > col_vect( poolReadObject< TrigTauTracksInfoCollection_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ){ return poolReadObject< TrigTauTracksInfoCollection >(); } else throw std::runtime_error( "Unsupported persistent version of TrigTauTracksInfoCollection" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h index a4068cca1f4..e9e149b8b30 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUTRACKSINFOCOLLECTION_CNV_H @@ -9,6 +9,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigTauTracksInfoCollection.h" #include "TrigInDetEventTPCnv/TrigTauTracksInfoCollection_p2.h" +#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_p2.h" + typedef TrigTauTracksInfoCollection_p2 TrigTauTracksInfoCollection_PERS; @@ -26,7 +29,11 @@ protected: virtual TrigTauTracksInfoCollection_PERS *createPersistent( TrigTauTracksInfoCollection *transObj); virtual TrigTauTracksInfoCollection *createTransient(); - + +private: + TrigTauTracksInfoCollectionCnv_tlp1 m_converter_tlp1; + TrigTauTracksInfoCollectionCnv_p2 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx index 5952febbbdb..51abedf0de1 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx @@ -30,9 +30,9 @@ TrigTrackCounts* TrigTrackCountsCnv::createTransient() { mlog << MSG::DEBUG << "TrigTrackCountsCnv::createTransient " << endmsg; - static pool::Guid p2_guid("BD8BB599-AE38-45CC-93DB-27F67C23DB62"); - static pool::Guid p1_guid("2DCA396C-5CC1-4B6A-8B76-E3EBA4F81A61"); - static pool::Guid p0_guid("6277C97C-0EAA-4922-892E-E88C1FA01BA0"); + static const pool::Guid p2_guid("BD8BB599-AE38-45CC-93DB-27F67C23DB62"); + static const pool::Guid p1_guid("2DCA396C-5CC1-4B6A-8B76-E3EBA4F81A61"); + static const pool::Guid p0_guid("6277C97C-0EAA-4922-892E-E88C1FA01BA0"); if(compareClassGuid(p2_guid)) { std::unique_ptr< TrigTrackCounts_p2 > pers_ptr( poolReadObject< TrigTrackCounts_p2 >() ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx index d1c218728e0..367dd92c9eb 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx @@ -38,8 +38,8 @@ TrigTrackCountsCollection * TrigTrackCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTrackCountsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "FCEB4390-F8FB-4C93-9538-105BCABE487C" ); - static pool::Guid p0_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); + static const pool::Guid tlp1_guid( "FCEB4390-F8FB-4C93-9538-105BCABE487C" ); + static const pool::Guid p0_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); TrigTrackCountsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx index 9723f856f03..ce1b244402d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx @@ -23,7 +23,7 @@ TrigTrtHitCounts* TrigTrtHitCountsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigTrtHitCountsConverter" ); mlog << MSG::DEBUG << "TrigTrtHitCountsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("FB33CC3C-74B8-43DF-ABDA-E56BEA1D9D61"); + static const pool::Guid p1_guid("FB33CC3C-74B8-43DF-ABDA-E56BEA1D9D61"); TrigTrtHitCounts *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx index 70404fe2a86..3a416cb4b1d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx @@ -1,16 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p1.h" -#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_tlp1.h" -#include "TrigTrtHitCountsCollectionCnv.h" - #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p2.h" -#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p2.h" -static TrigTrtHitCountsCollectionCnv_tlp1 TPConverter_tlp1; -static TrigTrtHitCountsCollectionCnv_p2 TPConverter; +#include "TrigTrtHitCountsCollectionCnv.h" //createPersistent TrigTrtHitCountsCollection_PERS * TrigTrtHitCountsCollectionCnv::createPersistent( TrigTrtHitCountsCollection *transObj) @@ -19,7 +14,7 @@ TrigTrtHitCountsCollection_PERS * TrigTrtHitCountsCollectionCnv::createPersisten mlog << MSG::DEBUG << "TrigTrtHitCountsCollectionCnv::createPersistent" << endmsg; - TrigTrtHitCountsCollection_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigTrtHitCountsCollection_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -32,26 +27,25 @@ TrigTrtHitCountsCollection* TrigTrtHitCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTrtHitCountsCollectionCnv::createTransient" << endmsg; - static pool::Guid p2_guid( "47CBB4D9-381C-423E-A560-A7B5C325A5DD" ); - static pool::Guid tlp1_guid( "A0763CCA-553C-4365-8091-04CA2036FD97" ); - static pool::Guid p1_guid( "0CC00AC1-FB95-4E69-8C6E-29B6BB713AAE" ); - static pool::Guid trans_guid( "7631C2C2-612F-4245-8C8B-D40F59222E1E" ); + static const pool::Guid p2_guid( "47CBB4D9-381C-423E-A560-A7B5C325A5DD" ); + static const pool::Guid tlp1_guid( "A0763CCA-553C-4365-8091-04CA2036FD97" ); + static const pool::Guid p1_guid( "0CC00AC1-FB95-4E69-8C6E-29B6BB713AAE" ); + static const pool::Guid trans_guid( "7631C2C2-612F-4245-8C8B-D40F59222E1E" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTrtHitCountsCollection_p2 > col_vect( poolReadObject< TrigTrtHitCountsCollection_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigTrtHitCountsCollection_tlp1 > col_vect( poolReadObject< TrigTrtHitCountsCollection_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(p1_guid)) { std::unique_ptr< TrigTrtHitCountsCollection_p1 > col_vect( poolReadObject< TrigTrtHitCountsCollection_p1 >() ); - TrigTrtHitCountsCollectionCnv_p1 converter; - return converter.createTransient( col_vect.get(), mlog ); + return m_converter_p1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(trans_guid)) { return poolReadObject(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h index 1de02a315f7..d8c42d283f5 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTRTHITCOUNTSCOLLECTION_CNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigTrtHitCountsCollection.h" #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p2.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p1.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p2.h" typedef TrigTrtHitCountsCollection_p2 TrigTrtHitCountsCollection_PERS; @@ -27,7 +30,12 @@ protected: virtual TrigTrtHitCountsCollection_PERS *createPersistent( TrigTrtHitCountsCollection *transObj); virtual TrigTrtHitCountsCollection *createTransient(); - + +private: + TrigTrtHitCountsCollectionCnv_tlp1 m_converter_tlp1; + TrigTrtHitCountsCollectionCnv_p1 m_converter_p1; + TrigTrtHitCountsCollectionCnv_p2 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx index 8c06b4aed98..5843406c13c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx @@ -42,10 +42,10 @@ TrigVertexCollection * TrigVertexCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigVertexCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "438C9232-0F3E-4A8B-A16E-6F6275388DE4" ); - static pool::Guid tlp1_guid( "10E18C4E-9BCA-4F25-993C-EBDF0642C119" ); - static pool::Guid p0_guid( "0974DF97-5B51-4416-8FBE-42BAE0C54010" ); - static pool::Guid p0_guid2( "E2C600D6-CD4B-4B7B-9C09-93CE9FF435A1" ); + static const pool::Guid tlp2_guid( "438C9232-0F3E-4A8B-A16E-6F6275388DE4" ); + static const pool::Guid tlp1_guid( "10E18C4E-9BCA-4F25-993C-EBDF0642C119" ); + static const pool::Guid p0_guid( "0974DF97-5B51-4416-8FBE-42BAE0C54010" ); + static const pool::Guid p0_guid2( "E2C600D6-CD4B-4B7B-9C09-93CE9FF435A1" ); TrigVertexCollection *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx index 8e8f3b3a5ed..c1af33a35de 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx @@ -23,7 +23,7 @@ TrigVertexCounts* TrigVertexCountsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigVertexCountsConverter" ); mlog << MSG::DEBUG << "TrigVertexCountsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("33E83FBA-83F1-4DC5-87BE-81A09D0FD8F8"); + static const pool::Guid p1_guid("33E83FBA-83F1-4DC5-87BE-81A09D0FD8F8"); TrigVertexCounts *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx index 7cf3ac8e50e..b0b7b82e363 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx @@ -37,9 +37,9 @@ TrigVertexCountsCollection* TrigVertexCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigVertexCountsCollectionCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "2A1D4A4E-D566-4C71-B051-D5D79A856753" ); - static pool::Guid p1_guid( "232B47D0-65CA-4883-AC51-0D76EAEA3194" ); - static pool::Guid trans_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); + static const pool::Guid tlp1_guid( "2A1D4A4E-D566-4C71-B051-D5D79A856753" ); + static const pool::Guid p1_guid( "232B47D0-65CA-4883-AC51-0D76EAEA3194" ); + static const pool::Guid trans_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); TrigVertexCountsCollection *p_container = 0; -- GitLab From f6776e7ccdd8e22378160db1593437abcd61a2ef Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 16:15:25 +0200 Subject: [PATCH 09/56] LumiBlockAthenaPool: enable thread-checker and fix warnings --- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../src/LumiBlockCollectionCnv.cxx | 18 ++++++------------ .../src/LumiBlockCollectionCnv.h | 9 +++++---- 3 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..1af1a992381 --- /dev/null +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +LumiBlock/LumiBlockPers/LumiBlockAthenaPool diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx index 441d55c5e28..a56be5acb65 100755 --- a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -8,13 +8,11 @@ ///////////////////////////////////////////////////////////////// #include "LumiBlockCollectionCnv.h" -#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p1.h" -#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p2.h" LumiBlockCollection_PERS* LumiBlockCollectionCnv::createPersistent(LumiBlockCollection* transCont) { MsgStream log(msgSvc(), "LumiBlockCollectionConverter" ); - LumiBlockCollection_PERS * persObj = m_TPConverter.createPersistent( transCont, log ); + LumiBlockCollection_PERS * persObj = m_converter.createPersistent( transCont, log ); log << MSG::DEBUG << "Success" << endmsg; return persObj; @@ -22,20 +20,16 @@ LumiBlockCollection_PERS* LumiBlockCollectionCnv::createPersistent(LumiBlockColl LumiBlockCollection* LumiBlockCollectionCnv::createTransient() { MsgStream log(msgSvc(), "LumiBlockCollectionConverter" ); - static pool::Guid p1_guid("CF1F40C9-6125-4C35-87FF-DDA2C319000C"); - static pool::Guid p2_guid("DEF9282A-F174-4382-8248-B94567CD869F"); - - static LumiBlockCollectionCnv_p1 TPConverter_p1; - static LumiBlockCollectionCnv_p2 TPConverter_p2; - + static const pool::Guid p1_guid("CF1F40C9-6125-4C35-87FF-DDA2C319000C"); + static const pool::Guid p2_guid("DEF9282A-F174-4382-8248-B94567CD869F"); if( compareClassGuid(p2_guid) ) { std::unique_ptr< LumiBlockCollection_p2 > col_vect( poolReadObject< LumiBlockCollection_p2 >() ); - return TPConverter_p2.createTransient( col_vect.get(), log ); + return m_converter.createTransient( col_vect.get(), log ); } else if( compareClassGuid(p1_guid) ) { std::unique_ptr< LumiBlockCollection_p1 > col_vect( poolReadObject< LumiBlockCollection_p1 >() ); - return TPConverter_p1.createTransient( col_vect.get(), log ); + return m_converter_p1.createTransient( col_vect.get(), log ); } else { throw std::runtime_error("Unsupported persistent version of LumiBlockCollection"); diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h index c753371b4d9..a6f7dc9df17 100644 --- a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,6 +13,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "LumiBlockData/LumiBlockCollection.h" +#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p1.h" #include "LumiBlockTPCnv/LumiBlockCollectionCnv_p2.h" // the latest persistent representation type of LumiBlockCollection @@ -29,10 +30,10 @@ protected: virtual LumiBlockCollection_PERS* createPersistent (LumiBlockCollection* transCont); virtual LumiBlockCollection* createTransient (); - // virtual AthenaPoolTopLevelTPCnvBase* getTopLevelTPCnv() { return &m_TPConverter; } - private: - LumiBlockCollectionCnv_p2 m_TPConverter; + LumiBlockCollectionCnv_p1 m_converter_p1; + LumiBlockCollectionCnv_p2 m_converter; + }; #endif // LUMIBLOCKCOLLECTIONCNV__H -- GitLab From d2a58d9793e6b5f696cd81cf49488994203f8b2a Mon Sep 17 00:00:00 2001 From: Johannes Elmsheuser Date: Mon, 23 May 2022 17:26:22 +0200 Subject: [PATCH 10/56] Update version.txt --- Projects/AthSimulation/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt index 25ddf3ab9c6..84b76f4d1c5 100644 --- a/Projects/AthSimulation/version.txt +++ b/Projects/AthSimulation/version.txt @@ -1 +1 @@ -22.0.68 +23.0.0 -- GitLab From 10cb40442d56de10f1c5bcfb0f73ba69ebd5f737 Mon Sep 17 00:00:00 2001 From: Johannes Elmsheuser Date: Mon, 23 May 2022 17:26:46 +0200 Subject: [PATCH 11/56] Update version.txt --- Projects/Athena/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index 25ddf3ab9c6..84b76f4d1c5 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -22.0.68 +23.0.0 -- GitLab From 290c6a6be8ff6eb5a6f128dc63e6da4903192eea Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 17:27:28 +0200 Subject: [PATCH 12/56] HGTD_EventAthenaPool: enable thread-checker and fix warnings --- .../HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY | 1 + .../HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx | 2 +- .../HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..f0f8a2553df --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx index 074de514a5a..0554ba10ee1 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx @@ -19,7 +19,7 @@ HGTD_ClusterContainerCnv::HGTD_ClusterContainerCnv(ISvcLocator* svcloc) HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() { - static pool::Guid p1_guid( + static const pool::Guid p1_guid( "7B3D57D6-F590-4266-974D-A0807122DA5F"); // with HGTD_Cluster_p1 ATH_MSG_DEBUG("createTransient(): main converter"); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx index 72997a44237..9e35dbf13e5 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx @@ -16,7 +16,7 @@ HGTD_RDO_ContainerCnv::HGTD_RDO_ContainerCnv(ISvcLocator* svcloc) HGTD_RDO_Container* HGTD_RDO_ContainerCnv::createTransient() { - static pool::Guid p1_guid( + static const pool::Guid p1_guid( "C25315CC-F0A2-43D6-8F42-012BE34B0107"); // with HGTD_RDO_p1 ATH_MSG_DEBUG("createTransient(): main converter"); -- GitLab From bb7a9b5bebcef115acf76a01da6c09bb83e9c039 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 17:50:54 +0200 Subject: [PATCH 13/56] HGTD_GeoModelXml: enable thread-checker --- .../HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY | 1 + 1 file changed, 1 insertion(+) create mode 100644 HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..893641d49bc --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml -- GitLab From 24745cb94f87824fb61593a8836e542cd3b598ec Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Mon, 23 May 2022 17:51:11 +0200 Subject: [PATCH 14/56] HGTD_Digitization: remove mutable pulse shape and enable thread-checker Enable the thread-checker. Explicitly pass the pulse waveform instead of storing it in a mutable member. --- .../ATLAS_CHECK_THREAD_SAFETY | 1 + .../src/HGTD_TimingResolution.cxx | 25 +++++++++++-------- .../src/HGTD_TimingResolution.h | 17 +++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..7b5406ab9a6 --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx index d3700e7f4b4..962424c5e25 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx @@ -256,9 +256,10 @@ void HGTD_TimingResolution::print() { } } -void HGTD_TimingResolution::simulatePulse( +HGTD_TimingResolution::PulseWaveform HGTD_TimingResolution::simulatePulse( CLHEP::HepRandomEngine *rndm_engine) const { + PulseWaveform pulseWaveform{}; float pulseParameter[4] = {0}; pulseParameter[0] = 0.036; // Width (scale) parameter of Landau density pulseParameter[1] = @@ -288,23 +289,25 @@ void HGTD_TimingResolution::simulatePulse( float p_time; // Convolution integral of Landau and Gaussian by sum - for (int i = 412; i < 527; i++) { + for (size_t i = 412; i < 527; i++) { fland = TMath::Landau(3.5 + (i * 0.005), mpc, pulseParameter[0]) / pulseParameter[0]; p_time = (1.5 + (i % 6 - i) * 0.005) / (sqrt(2) * pulseParameter[3]); - for (int point = i % 6; point < 400; point += 6) { + for (size_t point = i % 6; point < pulseWaveform.size(); point += 6) { p_time += step_par; - m_pulseWaveform[point] += fland * exp16(-p_time * p_time); + pulseWaveform[point] += fland * exp16(-p_time * p_time); } } - for (int point = 0; point < 400; point++) { - m_pulseWaveform[point] = f_weight * m_pulseWaveform[point]; + for (size_t point = 0; point < pulseWaveform.size(); point++) { + pulseWaveform[point] = f_weight * pulseWaveform[point]; } + + return pulseWaveform; } -void HGTD_TimingResolution::calculatePulse( +void HGTD_TimingResolution::calculatePulse(const PulseWaveform& pulseWaveform, std::map> &pulsebin, const float t, const float E, float *max, CLHEP::HepRandomEngine *rndm_engine) const { @@ -312,9 +315,9 @@ void HGTD_TimingResolution::calculatePulse( float energy = 0; float time = 0; - for (int point = 0; point < 400; point++) { + for (size_t point = 0; point < pulseWaveform.size(); point++) { - energy = m_pulseWaveform[point] * E + + energy = pulseWaveform[point] * E + CLHEP::RandGaussZiggurat::shoot(rndm_engine, 0, 0.015) * E; time = t + point * 0.005; timebin = (int)(t / 0.005) + point; @@ -340,8 +343,8 @@ float HGTD_TimingResolution::calculateTime( CLHEP::HepRandomEngine *rndm_engine) const { std::map> pulseBins; float max_hit[4] = {0}; - simulatePulse(rndm_engine); - calculatePulse(pulseBins, t, E, max_hit, rndm_engine); + const PulseWaveform pulse = simulatePulse(rndm_engine); + calculatePulse(pulse, pulseBins, t, E, max_hit, rndm_engine); for (auto &pulse : pulseBins) { pulse.second.first = pulse.second.first / pulse.second.second; // We look the the time when E=Emax/2 to get the time diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h index e43e4f88071..4ea71299765 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h @@ -13,6 +13,7 @@ #ifndef HGTD_TIMINGRESOLUTION_H #define HGTD_TIMINGRESOLUTION_H +#include #include #include #include @@ -40,6 +41,8 @@ public: private: + typedef std::array PulseWaveform; //> &pulsebin, + void calculatePulse(const PulseWaveform& pulseWaveform, + std::map> &pulsebin, float t, float E, float *max, CLHEP::HepRandomEngine* rndm_engine) const; std::string m_version{""}; @@ -91,14 +95,11 @@ private: std::vector> m_doseResolution{}; std::vector> m_doseGain{}; - float m_sensorNoiseFactor = + const float m_sensorNoiseFactor = 0.0229; // factor use to simulate the electronic noise (1mm*1mm) - float m_cfdThreshold = 0.5; // fraction of max amplitude at which the time is - // extracted (default: 50%) - - float mutable m_pulseWaveform[400] = {0}; // Signal Pulse - + const float m_cfdThreshold = 0.5; // fraction of max amplitude at which the time is + // extracted (default: 50%) }; #endif -- GitLab From ff9b8ca2ef5c13c94c139b22bf8877a96e6c1765 Mon Sep 17 00:00:00 2001 From: Christos Anastopoulos Date: Tue, 24 May 2022 08:59:56 +0200 Subject: [PATCH 15/56] CxxUtils: Try to bundle common checks together CxxUtils: Try to bundle common checks together --- Control/CxxUtils/CxxUtils/features.h | 34 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Control/CxxUtils/CxxUtils/features.h b/Control/CxxUtils/CxxUtils/features.h index dc8c0a34ce7..51c7222e942 100644 --- a/Control/CxxUtils/CxxUtils/features.h +++ b/Control/CxxUtils/CxxUtils/features.h @@ -14,20 +14,28 @@ #include +/// Do we support the compatible set of GCC and clang extensions +/// These are our main compilers. +#if (defined(__GNUC__) || defined(__clang__)) && \ + !(defined(__ICC) || defined(__COVERITY__) || \ + defined(__CUDACC__) || defined(__CLING__)) +# define HAVE_GCC_CLANG_EXTENSIONS 1 +#else +# define HAVE_GCC_CLANG_EXTENSIONS 0 +#endif -/// Do we have function multiversioning? GCC and clang > 7 support -/// the target attribute -#if ( defined(__i386__) || defined(__x86_64__) ) && defined(__ELF__) && \ - defined(__GNUC__) && !(defined(__clang__) && __clang_major__ < 8) && \ - !defined(__CLING__) && !defined(__ICC) && !defined(__COVERITY__) && \ - !defined(__CUDACC__) && !defined(CL_SYCL_LANGUAGE_VERSION) && \ - !defined(SYCL_LANGUAGE_VERSION) && !defined(__HIP__) -# define HAVE_FUNCTION_MULTIVERSIONING 1 +/// Do we have function multiversioning? +/// GCC and clang support the target attribute +#if HAVE_GCC_CLANG_EXTENSIONS && \ + (defined(__i386__) || defined(__x86_64__)) && defined(__ELF__) && \ + !defined(__HIP__) && !defined(CL_SYCL_LANGUAGE_VERSION) && \ + !defined(SYCL_LANGUAGE_VERSION) +#define HAVE_FUNCTION_MULTIVERSIONING 1 #else # define HAVE_FUNCTION_MULTIVERSIONING 0 #endif -/// Do we also have the target_clones attribute? +/// Do we additionally have the target_clones attribute? /// GCC and clang >=14 support it. /// ...But at least for GCC11 and clang 14 in /// order to work for both we have to apply @@ -39,8 +47,7 @@ #endif /// Do we have support for all GCC intrinsics? -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && \ - !defined(__COVERITY__) && !defined(__CUDACC__) +#if HAVE_GCC_CLANG_EXTENSIONS && !defined(__clang__) # define HAVE_GCC_INTRINSICS 1 #else # define HAVE_GCC_INTRINSICS 0 @@ -56,7 +63,7 @@ // __builtin_popcount // __builtin_popcountl // __builtin_popcountll -#if defined(__GNUC__) || defined(__clang__) +#if HAVE_GCC_CLANG_EXTENSIONS # define HAVE_BITCOUNT_INTRINSICS 1 #else # define HAVE_BITCOUNT_INTRINSICS 0 @@ -64,8 +71,7 @@ // Do we have the vector_size attribute for writing explicitly // vectorized code? -#if (defined(__GNUC__) || defined(__clang__)) && !defined(__CLING__) && \ - !defined(__ICC) && !defined(__COVERITY__) && !defined(__CUDACC__) +#if HAVE_GCC_CLANG_EXTENSIONS # define HAVE_VECTOR_SIZE_ATTRIBUTE 1 #else # define HAVE_VECTOR_SIZE_ATTRIBUTE 0 -- GitLab From d370a12929afda722e03063c9f87ca2ded1a87b2 Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 09:32:56 +0200 Subject: [PATCH 16/56] TrigSteeringEventTPCnv: Fix cppcheck warning. TrigSteeringEventTPCnv: Fix cppcheck warning. Undefined signed int shift. --- .../TrigSteeringEventTPCnv/src/TrigPassFlagsCnv_p1.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/TrigPassFlagsCnv_p1.cxx b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/TrigPassFlagsCnv_p1.cxx index c8205a27e68..6454288897a 100644 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/TrigPassFlagsCnv_p1.cxx +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/TrigPassFlagsCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSteeringEvent/TrigPassFlags.h" @@ -33,7 +33,7 @@ void TrigPassFlagsCnv_p1::persToTrans(const TrigPassFlags_p1* persObj, // loop over bits in the word for(unsigned int bit = 0;bit < bitsPerWord;++bit){ - if(persObj->m_serialized[word] & (1 << bit) ) + if(persObj->m_serialized[word] & (1u << bit) ) transObj->m_flagsPerObject[object][flag] = true; flag++; -- GitLab From 6d841d57073eeb06f9f9c4206f0a3a73e71e7f0a Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 09:37:18 +0200 Subject: [PATCH 17/56] TrkTruthTPCnv: Fix cppcheck warnings. TrkTruthTPCnv: Fix cppcheck warnings. Prefer range-for. --- .../src/PRD_MultiTruthCollectionCnv_p1.cxx | 17 ++++++++--------- .../src/PRD_MultiTruthCollectionCnv_p2.cxx | 14 +++++++------- .../src/PRD_MultiTruthCollectionCnv_p3.cxx | 12 ++++++------ 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx index 43f341d6803..6078f8e1074 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx @@ -25,10 +25,9 @@ void PRD_MultiTruthCollectionCnv_p1::persToTrans( const Trk::PRD_MultiTruthColle { msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + for (const Trk::PRD_MultiTruthCollection_p1::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - //trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); if(!m_isInitialized) { if (this->initialize(msg) != StatusCode::SUCCESS) { @@ -37,11 +36,11 @@ void PRD_MultiTruthCollectionCnv_p1::persToTrans( const Trk::PRD_MultiTruthColle } Identifier chanId; - if (m_pixId->is_shortened_pixel_id(i->id)) { - chanId = m_pixId->pixel_id_from_shortened(i->id); + if (m_pixId->is_shortened_pixel_id(ent.id)) { + chanId = m_pixId->pixel_id_from_shortened(ent.id); } else { - chanId = i->id; + chanId = ent.id; } trans->insert(trans->end(), std::make_pair(chanId, link) ); } @@ -57,10 +56,10 @@ void PRD_MultiTruthCollectionCnv_p1::transToPers( const PRD_MultiTruthCollection pers->m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p1 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p1::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p1::Entry(p.first.get_compact(), link)); } msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + + for (const Trk::PRD_MultiTruthCollection_p2::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); + trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) ); } msg<m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p1 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p2::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p2::Entry(p.first.get_compact(), link)); } msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + for (const Trk::PRD_MultiTruthCollection_p3::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); + trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) ); } msg<m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p2 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p3::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p3::Entry(p.first.get_compact(), link)); } msg< Date: Tue, 24 May 2022 09:38:39 +0200 Subject: [PATCH 18/56] TrkNeuralNetworkUtils: Fix cppcheck warnings. TrkNeuralNetworkUtils: Fix cppcheck warnings. Fix cppcheck warnings and clean up some naming convention violations. --- .../TrkNeuralNetworkUtils/TTrainedNetwork.h | 44 ++--- .../src/TTrainedNetwork.cxx | 170 +++++++++--------- .../src/TargetBuffer_t.h | 38 ++-- 3 files changed, 127 insertions(+), 125 deletions(-) diff --git a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/TrkNeuralNetworkUtils/TTrainedNetwork.h b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/TrkNeuralNetworkUtils/TTrainedNetwork.h index 3ba579d2aa1..71f640c33bb 100644 --- a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/TrkNeuralNetworkUtils/TTrainedNetwork.h +++ b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/TrkNeuralNetworkUtils/TTrainedNetwork.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ //-*-c++-*- -#ifndef __TTrainedNetwork_ -#define __TTrainedNetwork_ +#ifndef TRKNEURALNETWORKUTILS_TTRAINEDNETWORK_H +#define TRKNEURALNETWORKUTILS_TTRAINEDNETWORK_H #include "TObject.h" #include "TMatrixD.h" @@ -84,24 +84,24 @@ public: void setNewWeights(std::vector & thresholdVectors, std::vector & weightMatrices); - Int_t getnInput() const {return mnInput;}; + Int_t getnInput() const {return m_nInput;}; - Int_t getnHidden() const {return mnHidden;}; + Int_t getnHidden() const {return m_nHidden;}; - Int_t getnOutput() const {return mnOutput;}; + Int_t getnOutput() const {return m_nOutput;}; const std::vector & getnHiddenLayerSize() const { - return mnHiddenLayerSize; + return m_nHiddenLayerSize; }; - Int_t getActivationFunction() const {return mActivationFunction;}; + Int_t getActivationFunction() const {return m_ActivationFunction;}; const std::vector & getThresholdVectors() const { - return mThresholdVectors; + return m_ThresholdVectors; }; const std::vector & weightMatrices() const { - return mWeightMatrices; + return m_WeightMatrices; }; // these methods should be optimized. @@ -114,16 +114,16 @@ public: // optimized code. DVec calculateNormalized(const DMap & input) const; - bool getIfLinearOutput() const { return mLinearOutput; }; + bool getIfLinearOutput() const { return m_LinearOutput; }; - bool getIfNormalizeOutput() const { return mNormalizeOutput; }; + bool getIfNormalizeOutput() const { return m_NormalizeOutput; }; private: - unsigned mnInput; - unsigned mnHidden; - unsigned mnOutput; + unsigned m_nInput; + unsigned m_nHidden; + unsigned m_nOutput; // in an ideal world these would be one object in a vector, but // storing classes within classes in root is ugly @@ -132,20 +132,20 @@ private: std::map m_inputStringToNode; - std::vector mnHiddenLayerSize; + std::vector m_nHiddenLayerSize; - std::vector mThresholdVectors; - std::vector mWeightMatrices; + std::vector m_ThresholdVectors; + std::vector m_WeightMatrices; unsigned int m_bufferSizeMax; //! cache of the maximum needed size, not persisitified - Int_t mActivationFunction; + Int_t m_ActivationFunction; - bool mLinearOutput; + bool m_LinearOutput; - bool mNormalizeOutput; + bool m_NormalizeOutput; - double maxExpValue; + double m_maxExpValue; Double_t sigmoid(Double_t x) const; diff --git a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx index 7db6d1caf5f..2dc058a164b 100644 --- a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx +++ b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkNeuralNetworkUtils/TTrainedNetwork.h" @@ -15,15 +15,15 @@ #include "TargetBuffer_t.icc" TTrainedNetwork::TTrainedNetwork() + : m_nInput(0), + m_nHidden(0), + m_nOutput(0), + m_bufferSizeMax(0), + m_ActivationFunction(1), + m_LinearOutput(false), + m_NormalizeOutput(false), + m_maxExpValue(log(std::numeric_limits::max())) { - mnInput=0; - mnHidden=0; - mnOutput=0; - mActivationFunction=1; - mLinearOutput=false; - mNormalizeOutput=false; - maxExpValue=log(std::numeric_limits::max()); - m_bufferSizeMax=0; } TTrainedNetwork::TTrainedNetwork(Int_t nInput, @@ -39,24 +39,24 @@ TTrainedNetwork::TTrainedNetwork(Int_t nInput, assert(nInput >= 0); assert(nOutput >= 0); assert(nHidden >= 0); - mnInput = nInput; - mnHidden = nHidden; - mnOutput = nOutput; - mnHiddenLayerSize = nHiddenLayerSize; - mThresholdVectors = thresholdVectors; - mWeightMatrices = weightMatrices; - mActivationFunction = activationFunction; - mLinearOutput = linearOutput; - mNormalizeOutput = normalizeOutput; - maxExpValue = log(std::numeric_limits::max()); - - auto maxElement = *(std::max_element(mnHiddenLayerSize.begin(), mnHiddenLayerSize.end())); - int nlayer_max = std::max(static_cast(mnOutput), maxElement); + m_nInput = nInput; + m_nHidden = nHidden; + m_nOutput = nOutput; + m_nHiddenLayerSize = nHiddenLayerSize; + m_ThresholdVectors = thresholdVectors; + m_WeightMatrices = weightMatrices; + m_ActivationFunction = activationFunction; + m_LinearOutput = linearOutput; + m_NormalizeOutput = normalizeOutput; + m_maxExpValue = log(std::numeric_limits::max()); + + auto maxElement = *(std::max_element(m_nHiddenLayerSize.begin(), m_nHiddenLayerSize.end())); + int nlayer_max = std::max(static_cast(m_nOutput), maxElement); // - std::vector::const_iterator hidden_layer_threshold_vector_end = mThresholdVectors.end(); + std::vector::const_iterator hidden_layer_threshold_vector_end = m_ThresholdVectors.end(); --hidden_layer_threshold_vector_end; // - for (std::vector::const_iterator tr_itr= mThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ + for (std::vector::const_iterator tr_itr= m_ThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ nlayer_max = std::max(nlayer_max, (*tr_itr)->GetNrows()); } m_bufferSizeMax=nlayer_max; @@ -80,25 +80,25 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, ActivationFunction activationFunction, unsigned options) { - mnInput = inputs.size(); - mnHidden = thresholdVectors.size() - 1; - mnOutput = nOutput; - mThresholdVectors = thresholdVectors; - mWeightMatrices = weightMatrices; - mActivationFunction = activationFunction; - mLinearOutput = options & linearOutput; - mNormalizeOutput = options & normalizeOutput; - maxExpValue = log(std::numeric_limits::max()); + m_nInput = inputs.size(); + m_nHidden = thresholdVectors.size() - 1; + m_nOutput = nOutput; + m_ThresholdVectors = thresholdVectors; + m_WeightMatrices = weightMatrices; + m_ActivationFunction = activationFunction; + m_LinearOutput = options & linearOutput; + m_NormalizeOutput = options & normalizeOutput; + m_maxExpValue = log(std::numeric_limits::max()); std::vector::const_iterator hidden_layer_threshold_vector_end = - mThresholdVectors.end(); + m_ThresholdVectors.end(); --hidden_layer_threshold_vector_end; for (std::vector::const_iterator tr_itr - = mThresholdVectors.begin(); + = m_ThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ - mnHiddenLayerSize.push_back((*tr_itr)->GetNrows()); + m_nHiddenLayerSize.push_back((*tr_itr)->GetNrows()); } unsigned node_n = 0; @@ -123,9 +123,9 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, throw std::runtime_error("Names for NN inputs must be unique (if given)"); } - int nlayer_max(mnOutput); - for (unsigned i = 0; i < mnHiddenLayerSize.size(); ++i) - nlayer_max = std::max(nlayer_max, mnHiddenLayerSize[i]); + int nlayer_max(m_nOutput); + for (unsigned i = 0; i < m_nHiddenLayerSize.size(); ++i) + nlayer_max = std::max(nlayer_max, m_nHiddenLayerSize[i]); m_bufferSizeMax=nlayer_max; unsigned n_zero = std::count(m_input_node_scale.begin(), @@ -140,8 +140,8 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, TTrainedNetwork::~TTrainedNetwork() { - std::vector::const_iterator vectBegin=mThresholdVectors.begin(); - std::vector::const_iterator vectEnd=mThresholdVectors.end(); + std::vector::const_iterator vectBegin=m_ThresholdVectors.begin(); + std::vector::const_iterator vectEnd=m_ThresholdVectors.end(); for (std::vector::const_iterator vectIter=vectBegin; vectIter!=vectEnd; @@ -150,8 +150,8 @@ TTrainedNetwork::~TTrainedNetwork() delete *vectIter; } - std::vector::const_iterator matrixBegin=mWeightMatrices.begin(); - std::vector::const_iterator matrixEnd=mWeightMatrices.end(); + std::vector::const_iterator matrixBegin=m_WeightMatrices.begin(); + std::vector::const_iterator matrixEnd=m_WeightMatrices.end(); for (std::vector::const_iterator matrixIter=matrixBegin; matrixIter!=matrixEnd; @@ -165,7 +165,7 @@ TTrainedNetwork::~TTrainedNetwork() std::vector TTrainedNetwork::getInputs() const { assert(m_inputStringToNode.size() == 0 || - m_inputStringToNode.size() == mnInput); + m_inputStringToNode.size() == m_nInput); assert(m_input_node_scale.size() == m_input_node_offset.size()); std::map input_n_to_name; @@ -176,10 +176,10 @@ std::vector TTrainedNetwork::getInputs() const { } std::vector inputs_vector; - if (m_input_node_offset.size() != mnInput) { + if (m_input_node_offset.size() != m_nInput) { return inputs_vector; } - for (unsigned input_n = 0; input_n < mnInput; input_n++){ + for (unsigned input_n = 0; input_n < m_nInput; input_n++){ std::map::const_iterator name_itr = input_n_to_name.find(input_n); Input the_input; @@ -197,8 +197,8 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, std::vector & weightMatrices) { - std::vector::const_iterator vectBegin=mThresholdVectors.begin(); - std::vector::const_iterator vectEnd=mThresholdVectors.end(); + std::vector::const_iterator vectBegin=m_ThresholdVectors.begin(); + std::vector::const_iterator vectEnd=m_ThresholdVectors.end(); for (std::vector::const_iterator vectIter=vectBegin; vectIter!=vectEnd; @@ -207,8 +207,8 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, delete *vectIter; } - std::vector::const_iterator matrixBegin=mWeightMatrices.begin(); - std::vector::const_iterator matrixEnd=mWeightMatrices.end(); + std::vector::const_iterator matrixBegin=m_WeightMatrices.begin(); + std::vector::const_iterator matrixEnd=m_WeightMatrices.end(); for (std::vector::const_iterator matrixIter=matrixBegin; matrixIter!=matrixEnd; @@ -217,11 +217,11 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, delete *matrixIter; } - mThresholdVectors.clear(); - mWeightMatrices.clear(); + m_ThresholdVectors.clear(); + m_WeightMatrices.clear(); - mThresholdVectors=thresholdVectors; - mWeightMatrices=weightMatrices; + m_ThresholdVectors=thresholdVectors; + m_WeightMatrices=weightMatrices; } @@ -229,7 +229,7 @@ std::vector TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DMap& in) const { - std::vector inputs(mnInput); + std::vector inputs(m_nInput); size_t n_filled = 0; for (std::map::const_iterator itr = in.begin(); itr != in.end(); @@ -256,7 +256,7 @@ TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DMap& in) if (n_filled != m_inputStringToNode.size() ) { assert(n_filled < m_inputStringToNode.size() ); std::set input_set; - for (DMapI itr = in.begin(); itr != in.end(); itr++) { + for (DMapI itr = in.begin(); itr != in.end(); ++itr) { input_set.insert(itr->first); } std::string err = "nodes not filled in NN: "; @@ -278,11 +278,11 @@ TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DVec& input) { // asserts can be turned off in optomized code anyway, // use them to be safe without having to call vector.at() - assert(mnInput == input.size()); - assert(mnInput == m_input_node_scale.size()); - assert(mnInput == m_input_node_offset.size()); + assert(m_nInput == input.size()); + assert(m_nInput == m_input_node_scale.size()); + assert(m_nInput == m_input_node_offset.size()); std::vector transformed_inputs(input); - for (unsigned input_n = 0; input_n < mnInput; input_n++) { + for (unsigned input_n = 0; input_n < m_nInput; input_n++) { transformed_inputs[input_n] += m_input_node_offset[input_n]; transformed_inputs[input_n] *= m_input_node_scale[input_n]; } @@ -298,19 +298,19 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) // Pixel clusterization - Thomas Kittelmann, Oct 2011. - if (input.size() != mnInput) + if (input.size() != m_nInput) { std::cerr << "TTrainedNetwork WARNING Input size: " << input.size() - << " does not match with network: " << mnInput << std::endl; + << " does not match with network: " << m_nInput << std::endl; return {}; } TTN::DoubleBuffer_t tmp_array; tmp_array.clear(m_bufferSizeMax); // make sure it is big enough and initialise with zero - const unsigned nTargetLayers(mnHidden+1); - const unsigned lastTargetLayer(mnHidden); - unsigned nSource = mnInput, nTarget(0); + const unsigned nTargetLayers(m_nHidden+1); + const unsigned lastTargetLayer(m_nHidden); + unsigned nSource = m_nInput, nTarget(0); TTN::ConstBuffer_t source(input); const double * weights(nullptr); const double * thresholds(nullptr); @@ -319,13 +319,13 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) for (unsigned iLayer = 0; iLayer < nTargetLayers; ++iLayer) { //Find data area for target layer: nTarget = ( iLayer == lastTargetLayer ? - mnOutput : - mnHiddenLayerSize[iLayer] ); + m_nOutput : + m_nHiddenLayerSize[iLayer] ); TTN::Buffer_t target( tmp_array[iLayer] ); //Transfer the input nodes to the output nodes in this layer transition: - weights = mWeightMatrices[iLayer]->GetMatrixArray(); - thresholds = mThresholdVectors[iLayer]->GetMatrixArray(); + weights = m_WeightMatrices[iLayer]->GetMatrixArray(); + thresholds = m_ThresholdVectors[iLayer]->GetMatrixArray(); for (unsigned inodeTarget=0;inodeTarget& input) weights_tmp += nTarget; } nodeVal += *thresholds++;//see remark above. - target[inodeTarget] = ( mLinearOutput && iLayer == lastTargetLayer ) + target[inodeTarget] = ( m_LinearOutput && iLayer == lastTargetLayer ) ? nodeVal : sigmoid(nodeVal); } //Prepare for next layer transition: @@ -349,7 +349,7 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) } //std::vector result(nTarget); - if (!mNormalizeOutput) { + if (!m_NormalizeOutput) { // std::memcpy(&result[0], target, sizeof(*target)*nTarget); // the result is already in the buffer half with index (nTargetLayers-1)%2 // copy this to the front of the full buffer and shrink the array @@ -372,31 +372,31 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) Double_t TTrainedNetwork::sigmoid(Double_t x) const { - if (-2*x >= maxExpValue){ + if (-2*x >= m_maxExpValue){ return 0.; } return 1./(1.+exp(-2*x)); } bool TTrainedNetwork::is_consistent() const { - if (mThresholdVectors.size() != mWeightMatrices.size()) { + if (m_ThresholdVectors.size() != m_WeightMatrices.size()) { std::cerr << "ERROR: " - << "n threshold vectors: " << mThresholdVectors.size() - << " n weight matrices: " << mWeightMatrices.size() + << "n threshold vectors: " << m_ThresholdVectors.size() + << " n weight matrices: " << m_WeightMatrices.size() << std::endl; return false; } - int nodes_last_layer = mnInput; - for (unsigned layer_n = 0; layer_n < mThresholdVectors.size(); layer_n++){ - int n_threshold_nodes = mThresholdVectors.at(layer_n)->GetNrows(); - int n_weights_nodes = mWeightMatrices.at(layer_n)->GetNcols(); + int nodes_last_layer = m_nInput; + for (unsigned layer_n = 0; layer_n < m_ThresholdVectors.size(); layer_n++){ + int n_threshold_nodes = m_ThresholdVectors.at(layer_n)->GetNrows(); + int n_weights_nodes = m_WeightMatrices.at(layer_n)->GetNcols(); if (n_threshold_nodes != n_weights_nodes) { std::cerr << "ERROR: in layer " << layer_n << " --- n threshold: " << n_threshold_nodes << " n_weights: " << n_weights_nodes << std::endl; return false; } - int n_incoming_connections = mWeightMatrices.at(layer_n)->GetNrows(); + int n_incoming_connections = m_WeightMatrices.at(layer_n)->GetNrows(); if (n_incoming_connections != nodes_last_layer) { std::cerr << "ERROR: in layer " << layer_n << " --- last layer nodes: " << nodes_last_layer @@ -407,10 +407,10 @@ bool TTrainedNetwork::is_consistent() const { nodes_last_layer = n_weights_nodes; } - if (mThresholdVectors.size() - 1 != mnHiddenLayerSize.size() ){ + if (m_ThresholdVectors.size() - 1 != m_nHiddenLayerSize.size() ){ std::cerr << "ERROR: " - << "size mThresholdVectors: " << mThresholdVectors.size() - << " size mnHiddenLayerSize: " << mnHiddenLayerSize.size() + << "size m_ThresholdVectors: " << m_ThresholdVectors.size() + << " size m_nHiddenLayerSize: " << m_nHiddenLayerSize.size() << std::endl; return false; } @@ -419,8 +419,8 @@ bool TTrainedNetwork::is_consistent() const { } bool TTrainedNetwork::check_norm_size(unsigned size) const { - if (size != mnInput) { - std::cerr << "ERROR: TTrainedNetwork has " << mnInput << " inputs, " + if (size != m_nInput) { + std::cerr << "ERROR: TTrainedNetwork has " << m_nInput << " inputs, " << size << " normalization values provided\n"; return false; } diff --git a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h index 15985134a15..6db56357403 100644 --- a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h +++ b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TargetBuffer_t_H #define TargetBuffer_t_H @@ -24,14 +24,16 @@ namespace TTN { template friend class BufferBase_t; public: - BufferBase_t(T_VectorType &buffer) { - m_ptr=&(buffer[0]); + BufferBase_t(T_VectorType &buffer) + : m_ptr (&(buffer[0])) #ifndef NDEBUG - // debug code - m_maxIndex=buffer.size(); - m_bufferStart=buffer.data(); - m_bufferEnd=m_bufferStart + buffer.size();//assumed contiguous + // debug code + , m_maxIndex(buffer.size()) + , m_bufferStart(buffer.data()) + , m_bufferEnd(m_bufferStart + buffer.size())//assumed contiguous #endif + { + // cppcheck-suppress missingReturn; false positive } protected: @@ -44,7 +46,9 @@ namespace TTN { , m_bufferStart(buffer.m_bufferStart) , m_bufferEnd(buffer.m_bufferEnd) #endif - {} + { + // cppcheck-suppress missingReturn; false positive + } template BufferBase_t & @@ -61,18 +65,16 @@ namespace TTN { // last two arguments are only needed for the optional range check. BufferBase_t(T_BufferType *buffer, - typename std::vector::size_type max_idx, - const std::vector &full_vector) - { - (void) max_idx; //prevent unused argument warnings - (void) full_vector; - m_ptr=buffer; + typename std::vector::size_type max_idx [[maybe_unused]], + const std::vector & full_vector [[maybe_unused]]) + : m_ptr(buffer) #ifndef NDEBUG - // debug code - m_maxIndex=max_idx; - m_bufferStart=full_vector.data(); - m_bufferEnd=m_bufferStart+full_vector.size();//assumed contiguous + // debug code + , m_maxIndex(max_idx) + , m_bufferStart(full_vector.data()) + , m_bufferEnd(m_bufferStart+full_vector.size())//assumed contiguous #endif + { } public: -- GitLab From 0a1ee7deb69e2b6e29feb67ad8a0e8d52e1adcad Mon Sep 17 00:00:00 2001 From: Shaun Roe Date: Tue, 24 May 2022 10:11:31 +0200 Subject: [PATCH 19/56] 22.0-coverity-InDetCoolCoralClientUtils 22.0-coverity-InDetCoolCoralClientUtils --- .../InDetCoolCoralClientUtils/src/CoolCoralClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp index 9f7efd52a28..0fcafd18023 100644 --- a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp +++ b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp @@ -1366,8 +1366,8 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ struct timeval start_time{}, end_time{}; int total_usecs=0; gettimeofday(&start_time, nullptr); - TTCobj_t *ttc_param; - std::vector ttc_params; + std::unique_ptr ttc_param; + std::vector> ttc_params; TTCGroupobj_t ttcgr_param; DTMROCobj_t dtmroc_param; @@ -1538,7 +1538,7 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ int nRows = 0; while ( cursor0.next() ) { const coral::AttributeList &row0 = cursor0.currentRow(); - ttc_param = new TTCobj_t; + ttc_param = std::make_unique(); ttc_param->VMEslot = row0[1].data(); ttc_param->Delay = row0[2].data(); @@ -1634,7 +1634,7 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ } delete query2; query2=nullptr; printf("Total %d DTMROC records\n", nRows2); - ttc_params.push_back(ttc_param); + ttc_params.push_back(std::move(ttc_param)); ++nRows; } delete query0; query0=nullptr; -- GitLab From fcd93d460d75e5e8de22bfb10d9db549318d5a40 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste De Vivie De Regie Date: Tue, 24 May 2022 10:41:08 +0200 Subject: [PATCH 20/56] ATLASRECTS-7064 : cppcheck for IsolationCorrections ATLASRECTS-7064 : cppcheck for IsolationCorrections --- .../Root/IsolationCorrection.cxx | 110 ++++-------------- 1 file changed, 24 insertions(+), 86 deletions(-) diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx index 6833821188a..31240ab692b 100644 --- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx @@ -305,8 +305,6 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { << " dR = 0.2, conv " << m_graph_dd_cone20_conv_photon_shift->at(ieta)->GetName()); } - file_ptleakagecorr->Close(); - m_corrInitialized[ii][jj] = true; } @@ -600,8 +598,6 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin8_extrap") ); m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin9_extrap") ); } - - file_ptleakagecorr->Close(); } void IsolationCorrection::set2015Corr() { @@ -764,16 +760,13 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { } // root file : no good format } // root file not found - - file_ptleakagecorr->Close(); - } void IsolationCorrection::setDDCorr() { if( !m_corr_ddshift_file.empty() && !m_corr_ddsmearing_file.empty()){ loadDDCorr(); }else{ - ATH_MSG_WARNING("Data-driven correction files not specified, tool not initialized for data-driven corrections\n"); + ATH_MSG_WARNING("Data-driven correction files not specified, tool not initialized for data-driven corrections\n"); } } @@ -787,93 +780,38 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { m_corr_ddsmearing_file = ""; }else{ - // ********************************** - // Data driven corrections ********** - // https://cds.cern.ch/record/2008664 - // ********************************** - - // Photon shift corrections - std::vector< std::shared_ptr > graph_shift; - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_0"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_1"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_2"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_3"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_4"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_5"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_6"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_7"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_8"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_9"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_10"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_11"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_12"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_13"))) ); - - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(0)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(1)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(2)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(3)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(4)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(5)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(6)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(7)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(8)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(9)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(10)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(11)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(12)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(13)->GetFunction("f_2") ); - - // Photon smearing corrections (to be applied in end caps only) + // ********************************** + // Data driven corrections ********** + // https://cds.cern.ch/record/2008664 + // ********************************** + + // Photon shift corrections + std::vector< std::shared_ptr > graph_shift; + // Photon smearing corrections (to be applied in end caps only) std::vector< std::shared_ptr > graph_smearing; - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_0"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_1"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_2"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_3"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_4"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_5"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_6"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_7"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_8"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_9"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_10"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_11"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_12"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_13"))) ); - - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(0)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(1)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(2)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(3)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(4)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(5)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(6)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(7)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(8)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(9)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(10)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(11)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(12)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(13)->GetFunction("f_3") ); - - for (const auto& gr : graph_shift) { + for (int ig = 0; ig <= 13; ig++) { + graph_shift.emplace_back( dynamic_cast(file_ddshift_corr->Get(Form("graph_%i",ig))) ); + graph_smearing.emplace_back( dynamic_cast(file_ddsmearingcorr->Get(Form("graph_%i",ig))) ); + } + for (int ig = 0; ig <= 13; ig++) { + if (ig <= 7) + m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f") ); + else + m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f_2") ); + m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(ig)->GetFunction("f_3") ); + } + + for (const auto& gr : graph_shift) { if (gr == nullptr) - ATH_MSG_ERROR("Null pointer for one of the DD correction graphs"); + ATH_MSG_ERROR("Null pointer for one of the DD correction graphs"); } for (const auto& gr : graph_smearing) { if (gr == nullptr) - ATH_MSG_ERROR("Null pointer for one of the smearing graphs"); + ATH_MSG_ERROR("Null pointer for one of the smearing graphs"); } - } - - file_ddshift_corr->Close(); - file_ddsmearingcorr->Close(); - } - - template void IsolationCorrection::FreeClear( T & cntr ) { ATH_MSG_DEBUG("FreeClearing the container " << cntr.size()); for ( typename T::iterator it = cntr.begin(); -- GitLab From c9cb92092da111a469dd9a57c380a0234959c10a Mon Sep 17 00:00:00 2001 From: Minlin Wu Date: Tue, 24 May 2022 10:44:43 +0200 Subject: [PATCH 21/56] MuonPRDTest: Migrate the Testers MuonPRDTest: Migrate the Testers --- .../MuonValidation/MuonPRDTest/CMakeLists.txt | 2 +- .../MuonPRDTest/CSCDigitVariables.h | 1 - .../MuonPRDTest/MuonPRDTest/CSCPRDVariables.h | 34 ++ .../MuonPRDTest/MuonPRDTest/CSCRDOVariables.h | 43 ++ .../MuonPRDTest/MMDigitVariables.h | 45 ++ .../MuonPRDTest/MuonPRDTest/MMPRDVariables.h | 42 ++ .../MuonPRDTest/MuonPRDTest/MMRDOVariables.h | 35 ++ .../MuonPRDTest/MuonPRDTest/MMSDOVariables.h | 37 ++ .../MuonPRDTest/MMSimHitVariables.h | 40 ++ .../MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h | 14 + .../MuonPRDTest/MuonPRDTest/TGCPRDVariables.h | 32 ++ .../MuonPRDTest/MuonPRDTest/TGCRDOVariables.h | 34 ++ .../MuonPRDTest/sTGCDigitVariables.h | 40 ++ .../MuonPRDTest/sTGCPRDVariables.h | 36 ++ .../MuonPRDTest/sTGCRDOVariables.h | 37 ++ .../MuonPRDTest/sTGCSDOVariables.h | 39 ++ .../MuonPRDTest/sTGCSimHitVariables.h | 45 ++ .../MuonPRDTest/Root/CSCDigitVariables.cxx | 39 +- .../MuonPRDTest/Root/CSCPRDVariables.cxx | 60 +++ .../MuonPRDTest/Root/CSCRDOVariables.cxx | 73 +++ .../MuonPRDTest/Root/CSCSDOVariables.cxx | 7 +- .../MuonPRDTest/Root/MDTDigitVariables.cxx | 9 +- .../MuonPRDTest/Root/MMDigitVariables.cxx | 163 +++++++ .../MuonPRDTest/Root/MMPRDVariables.cxx | 96 ++++ .../MuonPRDTest/Root/MMRDOVariables.cxx | 64 +++ .../MuonPRDTest/Root/MMSDOVariables.cxx | 57 +++ .../MuonPRDTest/Root/MMSimHitVariables.cxx | 164 +++++++ .../MuonPRDTest/Root/RPCDigitVariables.cxx | 9 +- .../MuonPRDTest/Root/TGCDigitVariables.cxx | 11 +- .../MuonPRDTest/Root/TGCPRDVariables.cxx | 57 +++ .../MuonPRDTest/Root/TGCRDOVariables.cxx | 80 ++++ .../MuonPRDTest/Root/sTGCDigitVariables.cxx | 83 ++++ .../MuonPRDTest/Root/sTGCPRDVariables.cxx | 69 +++ .../MuonPRDTest/Root/sTGCRDOVariables.cxx | 66 +++ .../MuonPRDTest/Root/sTGCSDOVariables.cxx | 75 +++ .../MuonPRDTest/Root/sTGCSimHitVariables.cxx | 186 ++++++++ .../MuonPRDTest/src/CSCPRDVariables.cxx | 138 ------ .../MuonPRDTest/src/CSCPRDVariables.h | 67 --- .../MuonPRDTest/src/CSCRDOVariables.cxx | 190 -------- .../MuonPRDTest/src/CSCRDOVariables.h | 65 --- .../MuonPRDTest/src/MMDigitVariables.cxx | 451 ------------------ .../MuonPRDTest/src/MMDigitVariables.h | 113 ----- .../MuonPRDTest/src/MMPRDVariables.cxx | 290 ----------- .../MuonPRDTest/src/MMPRDVariables.h | 100 ---- .../MuonPRDTest/src/MMRDOVariables.cxx | 218 --------- .../MuonPRDTest/src/MMRDOVariables.h | 84 ---- .../MuonPRDTest/src/MMSDOVariables.cxx | 190 -------- .../MuonPRDTest/src/MMSDOVariables.h | 87 ---- .../MuonPRDTest/src/MMSimHitVariables.cxx | 340 ------------- .../MuonPRDTest/src/MMSimHitVariables.h | 141 ------ .../MuonPRDTest/src/NSWPRDValAlg.cxx | 86 +--- .../MuonPRDTest/src/NSWPRDValAlg.h | 17 +- .../MuonPRDTest/src/TGCPRDVariables.cxx | 119 ----- .../MuonPRDTest/src/TGCPRDVariables.h | 63 --- .../MuonPRDTest/src/TGCRDOVariables.cxx | 169 ------- .../MuonPRDTest/src/TGCRDOVariables.h | 63 --- .../MuonPRDTest/src/sTGCDigitVariables.cxx | 386 --------------- .../MuonPRDTest/src/sTGCDigitVariables.h | 135 ------ .../MuonPRDTest/src/sTGCPRDVariables.cxx | 209 -------- .../MuonPRDTest/src/sTGCPRDVariables.h | 90 ---- .../MuonPRDTest/src/sTGCRDOVariables.cxx | 234 --------- .../MuonPRDTest/src/sTGCRDOVariables.h | 88 ---- .../MuonPRDTest/src/sTGCSDOVariables.cxx | 228 --------- .../MuonPRDTest/src/sTGCSDOVariables.h | 94 ---- .../MuonPRDTest/src/sTGCSimHitVariables.cxx | 390 --------------- .../MuonPRDTest/src/sTGCSimHitVariables.h | 167 ------- .../MuonTesterTree/IdentifierBranch.h | 29 +- .../MuonTesterTree/Root/IdentifierBranch.cxx | 25 + 68 files changed, 1969 insertions(+), 5021 deletions(-) create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx delete mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt index 0c6d9aa593c..5f68b8b5606 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt @@ -10,7 +10,7 @@ find_package( CLHEP ) atlas_add_library (MuonPRDTestLib MuonPRDTest/*.h Root/*.cxx PUBLIC_HEADERS MuonPRDTest - LINK_LIBRARIES AthenaBaseComps GeneratorObjects MuonDigitContainer MuonIdHelpersLib MuonReadoutGeometry MuonSimData MuonSimEvent MuonTesterTreeLib StoreGateLib + LINK_LIBRARIES AthenaBaseComps GeneratorObjects MuonDigitContainer MuonIdHelpersLib MuonReadoutGeometry MuonSimData MuonSimEvent MuonPrepRawData MuonRDO MuonCSC_CnvToolsLib MuonTesterTreeLib StoreGateLib PRIVATE_LINK_LIBRARIES AthenaKernel AtlasHepMCLib ) # Component(s) in the package: diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h index 8bf4eb36712..b9f928428c0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h @@ -23,7 +23,6 @@ namespace MuonPRDTest{ ScalarBranch& m_CSC_nDigits{parent().newScalar("N_Digits_CSC")}; VectorBranch& m_CSC_dig_localPosX{parent().newVector("Digits_CSC_localPosX")}; VectorBranch& m_CSC_dig_localPosY{parent().newVector("Digits_CSC_localPosY")}; - VectorBranch& m_CSC_dig_stripNumber{parent().newVector("Digits_CSC_stripNumber")}; ThreeVectorBranch m_CSC_dig_globalPos{parent(), "Digits_CSC_globalPos"}; CscIdentifierBranch m_CSC_dig_id{parent(), "Digits_CSC"}; }; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h new file mode 100644 index 00000000000..bb6af1be7c2 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_CSCPRDVARIABLES_H +#define MuonPRDTEST_CSCPRDVARIABLES_H + +#include "MuonPrepRawData/CscPrepDataContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class CSCPRDVariables : public PrdTesterModule { + public: + CSCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~CSCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_CSC_nPRD{parent().newScalar("N_PRD_CSC")}; + VectorBranch& m_CSC_PRD_localPosX{parent().newVector("PRD_CSC_localPosX")}; + VectorBranch& m_CSC_PRD_localPosY{parent().newVector("PRD_CSC_localPosY")}; + ThreeVectorBranch m_CSC_PRD_globalPos{parent(), "PRD_CSC_globalPos"}; + VectorBranch& m_CSC_PRD_time{parent().newVector("PRD_CSC_time")}; + VectorBranch& m_CSC_PRD_charge{parent().newVector("PRD_CSC_charge")}; + CscIdentifierBranch m_CSC_PRD_id{parent(), "PRD_CSC"}; + }; +}; + +#endif // MuonPRDTEST_CSCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h new file mode 100644 index 00000000000..f02cf959dfb --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_CSCRDOVARIABLES_H +#define MuonPRDTEST_CSCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/CscRawDataContainer.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" +#include "MuonIdHelpers/CscIdHelper.h" + +namespace MuonPRDTest{ + class CSCRDOVariables : public PrdTesterModule { + public: + CSCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const MuonIdHelper* idhelper, const Muon::ICSC_RDO_Decoder* rdo_decoder); + + ~CSCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + void setHelper(const MuonIdHelper* idhelper){ + m_CscIdHelper = dynamic_cast(idhelper); + if(!m_CscIdHelper) { + throw std::runtime_error("casting IdHelper to CscIdHelper failed"); + } + } + SG::ReadHandleKey m_key{}; + const CscIdHelper* m_CscIdHelper{nullptr}; + const Muon::ICSC_RDO_Decoder* m_rdo_decoder{nullptr}; + ScalarBranch& m_CSC_nRDO{parent().newScalar("N_RDO_CSC")}; + VectorBranch& m_CSC_rdo_localPosX{parent().newVector("RDO_CSC_localPosX")}; + VectorBranch& m_CSC_rdo_localPosY{parent().newVector("RDO_CSC_localPosY")}; + VectorBranch& m_CSC_rdo_time{parent().newVector("RDO_CSC_time")}; + ThreeVectorBranch m_CSC_rdo_globalPos{parent(), "RDO_CSC_globalPos"}; + CscIdentifierBranch m_CSC_rdo_id{parent(), "RDO_CSC"}; + }; +}; + +#endif // MuonPRDTEST_CSCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h new file mode 100644 index 00000000000..63f2714238f --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMDigitVARIABLES_H +#define MuonPRDTEST_MMDigitVARIABLES_H + +#include "MuonDigitContainer/MmDigitContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class MMDigitVariables : public PrdTesterModule { + public: + MMDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMDigitVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWMM_nDigits{parent().newScalar("N_Digits_MM")}; + VectorBranch>& m_NSWMM_dig_time{parent().newVector>("Digits_MM_time")}; + VectorBranch>& m_NSWMM_dig_charge{parent().newVector>("Digits_MM_charge")}; + VectorBranch>& m_NSWMM_dig_stripPosition{parent().newVector>("Digits_MM_stripPosition")}; + VectorBranch>& m_NSWMM_dig_sr_time{parent().newVector>("Digits_MM_stripResponse_time")}; + VectorBranch>& m_NSWMM_dig_sr_charge{parent().newVector>("Digits_MM_stripResponse_charge")}; + VectorBranch>& m_NSWMM_dig_sr_stripPosition{parent().newVector>("Digits_MM_stripResponse_stripPosition")}; + VectorBranch>& m_NSWMM_dig_time_trigger{parent().newVector>("Digits_MM_time_trigger")}; + VectorBranch>& m_NSWMM_dig_charge_trigger{parent().newVector>("Digits_MM_charge_trigger")}; + VectorBranch>& m_NSWMM_dig_position_trigger{parent().newVector>("Digits_MM_position_trigger")}; + VectorBranch>& m_NSWMM_dig_MMFE_VMM_id_trigger{parent().newVector>("Digits_MM_MMFE_VMM_id_trigger")}; + VectorBranch>& m_NSWMM_dig_VMM_id_trigger{parent().newVector>("Digits_MM_VMM_id_trigger")}; + VectorBranch& m_NSWMM_dig_stripLposX{parent().newVector("Digits_MM_stripLposX")}; + VectorBranch& m_NSWMM_dig_stripLposY{parent().newVector("Digits_MM_stripLposY")}; + ThreeVectorBranch m_NSWMM_dig_stripGpos{parent(), "Digits_MM_stripGpos"}; + VectorBranch& m_NSWMM_dig_sr_stripLposX{parent().newVector("Digits_MM_stripResponse_stripLposX")}; + VectorBranch& m_NSWMM_dig_sr_stripLposY{parent().newVector("Digits_MM_stripResponse_stripLposY")}; + ThreeVectorBranch m_NSWMM_dig_sr_stripGpos{parent(), "Digits_MM_stripResponse_stripGpos"}; + MmIdentifierBranch m_NSWMM_dig_id{parent(), "Digits_MM"}; + }; +}; +#endif // MuonPRDTEST_MMDigitVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h new file mode 100644 index 00000000000..6e6a041e4f3 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMPRDVARIABLES_H +#define MuonPRDTEST_MMPRDVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonPrepRawData/MMPrepDataContainer.h" +#include "MuonRDO/MM_RawDataContainer.h" + +namespace MuonPRDTest{ + class MMPRDVariables : public PrdTesterModule { + public: + MMPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + SG::ReadHandleKey m_rdokey{}; + ScalarBranch& m_NSWMM_nPRD{parent().newScalar("N_PRD_MM")}; + VectorBranch& m_NSWMM_PRD_time{parent().newVector("PRD_MM_time")}; + VectorBranch& m_NSWMM_PRD_covMatrix_1_1{parent().newVector("PRD_MM_covMatrix_1_1")}; + VectorBranch& m_NSWMM_PRD_nRdos{parent().newVector("PRD_MM_nRdos")}; + VectorBranch& m_NSWMM_PRD_localPosX{parent().newVector("PRD_MM_localPosX")}; + VectorBranch& m_NSWMM_PRD_localPosY{parent().newVector("PRD_MM_localPosY")}; + ThreeVectorBranch m_NSWMM_PRD_globalPos{parent(), "PRD_MM_globalPos"}; + VectorBranch& m_NSWMM_PRD_rdos_time{parent().newVector("PRD_MM_rdos_time")}; + VectorBranch& m_NSWMM_PRD_rdos_charge{parent().newVector("PRD_MM_rdos_charge")}; + VectorBranch& m_NSWMM_PRD_rdos_channel{parent().newVector("PRD_MM_rdos_channel")}; + VectorBranch& m_NSWMM_PRD_uTPCAngle{parent().newVector("PRD_MM_uTPCAngle")}; + VectorBranch& m_NSWMM_PRD_uTPCChiSqProb{parent().newVector("PRD_MM_uTPCChiSqProb")}; + MmIdentifierBranch m_NSWMM_PRD_id{parent(), "PRD_MM"}; + }; +}; + +#endif // MuonPRDTEST_MMPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h new file mode 100644 index 00000000000..50c29a60bab --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMRDOVARIABLES_H +#define MuonPRDTEST_MMRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/MM_RawDataContainer.h" + +namespace MuonPRDTest{ + class MMRDOVariables : public PrdTesterModule { + public: + MMRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_rdokey{}; + ScalarBranch& m_NSWMM_nRDO{parent().newScalar("N_RDO_MM")}; + VectorBranch& m_NSWMM_rdo_time{parent().newVector("RDO_MM_time")}; + VectorBranch& m_NSWMM_rdo_charge{parent().newVector("RDO_MM_charge")}; + VectorBranch& m_NSWMM_rdo_relBcid{parent().newVector("RDO_MM_relBcid")}; + VectorBranch& m_NSWMM_rdo_localPosX{parent().newVector("RDO_MM_localPosX")}; + VectorBranch& m_NSWMM_rdo_localPosY{parent().newVector("RDO_MM_localPosY")}; + ThreeVectorBranch m_NSWMM_rdo_globalPos{parent(), "RDO_MM_globalPos"}; + MmIdentifierBranch m_NSWMM_rdo_id{parent(), "RDO_MM"}; + }; +}; + +#endif // MuonPRDTEST_MMRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h new file mode 100644 index 00000000000..4ff79081d97 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONPRDTEST_MMSDOVARIABLES_H +#define MUONPRDTEST_MMSDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonSimData/MuonSimDataCollection.h" + +namespace MuonPRDTest{ + class MMSDOVariables : public PrdTesterModule { + public: + MMSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMSDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + + ScalarBranch& m_NSWMM_nsdo{parent().newScalar("nSDO_MM")}; + MmIdentifierBranch m_NSWMM_sdo_id{parent(), "SDO_MM"}; + VectorBranch& m_NSWMM_sdo_word{parent().newVector("SDO_MM_word")}; + VectorBranch& m_NSWMM_sdo_barcode{parent().newVector("SDO_MM_barcode")}; + VectorBranch& m_NSWMM_sdo_globaltime{parent().newVector("SDO_MM_global_time")}; + + ThreeVectorBranch m_NSWMM_dig_globalPos{parent(), "SDO_MM_globalPos"}; + VectorBranch& m_NSWMM_sdo_localPosX{parent().newVector("SDO_MM_localPosX")}; + VectorBranch& m_NSWMM_sdo_localPosY{parent().newVector("SDO_MM_localPosY")}; + }; +}; + +#endif // MMSDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h new file mode 100644 index 00000000000..27969a57d5c --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MMSimHitVariables_H +#define MMSimHitVariables_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonIdHelpers/MmIdHelper.h" +#include "MuonSimEvent/MMSimHitCollection.h" + +namespace MuonPRDTest{ + class MMSimHitVariables : public PrdTesterModule { + public: + MMSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + bool fill(const EventContext& ctx) override final; + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ThreeVectorBranch m_NSWMM_hitGlobalPosition{parent(), "Hits_MM_GlobalPosition"}; + ThreeVectorBranch m_NSWMM_hitGlobalDirection{parent(), "Hits_MM_GlobalDirection"}; + VectorBranch& m_NSWMM_particleEncoding{parent().newVector("Hits_MM_particleEncoding")}; + VectorBranch& m_NSWMM_kineticEnergy{parent().newVector("Hits_MM_kineticEnergy")}; + VectorBranch& m_NSWMM_depositEnergy{parent().newVector("Hits_MM_depositEnergy")}; + VectorBranch& m_NSWMM_isInsideBounds{parent().newVector("Hits_MM_isInsideBounds")}; + VectorBranch& m_NSWMM_trackId{parent().newVector("Hits_MM_trackId")}; + ScalarBranch& m_NSWMM_nSimHits{parent().newScalar("Hits_MM_nHits")}; + MmIdentifierBranch m_NSWMM_Id{parent(), "Hits_MM_off"}; + VectorBranch& m_NSWMM_globalTime{parent().newVector("Hits_MM_globalTime")}; + ThreeVectorBranch m_NSWMM_detector_globalPosition{parent(), "Hits_MM_detector_globalPosition"}; + ThreeVectorBranch m_NSWMM_hitToDsurfacePosition{parent(), "Hits_MM_hitToDsurfacePosition"}; + ThreeVectorBranch m_NSWMM_hitToRsurfacePosition{parent(), "Hits_MM_hitToRsurfacePosition"}; + VectorBranch& m_NSWMM_FastDigitRsurfacePositionX{parent().newVector("Hits_MM_FastDigitRsurfacePositionX")}; + VectorBranch& m_NSWMM_FastDigitRsurfacePositionY{parent().newVector("Hits_MM_FastDigitRsurfacePositionY")}; + }; +}; + +#endif // MMSimHitVariables_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h index 008541ca6eb..39faa32f0a0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h @@ -9,11 +9,25 @@ #include #include #include +#include +#include #include #include #include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h new file mode 100644 index 00000000000..63531130691 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_TGCPRDVARIABLES_H +#define MuonPRDTEST_TGCPRDVARIABLES_H + +#include "MuonPrepRawData/TgcPrepDataContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class TGCPRDVariables : public PrdTesterModule { + public: + TGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~TGCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_TGC_nPRD{parent().newScalar("N_PRD_TGC")}; + VectorBranch& m_TGC_PRD_localPosX{parent().newVector("PRD_TGC_localPosX")}; + VectorBranch& m_TGC_PRD_localPosY{parent().newVector("PRD_TGC_localPosY")}; + ThreeVectorBranch m_TGC_PRD_globalPos{parent(), "PRD_TGC_globalPos"}; + TgcIdentifierBranch m_TGC_PRD_id{parent(), "PRD_TGC"}; + }; +}; + +#endif // MuonPRDTEST_TGCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h new file mode 100644 index 00000000000..9845312f39e --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_TGCRDOVARIABLES_H +#define MuonPRDTEST_TGCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/TgcRdoContainer.h" +#include "TGCcablingInterface/ITGCcablingSvc.h" + +namespace MuonPRDTest{ + class TGCRDOVariables : public PrdTesterModule { + public: + TGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const ITGCcablingSvc* cabling_svc); + + ~TGCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + const ITGCcablingSvc* m_tgcCabling{nullptr}; + ScalarBranch& m_TGC_nRDO{parent().newScalar("N_RDO_TGC")}; + VectorBranch& m_TGC_rdo_localPosX{parent().newVector("RDO_TGC_localPosX")}; + VectorBranch& m_TGC_rdo_localPosY{parent().newVector("RDO_TGC_localPosY")}; + ThreeVectorBranch m_TGC_rdo_globalPos{parent(), "RDO_TGC_globalPos"}; + TgcIdentifierBranch m_TGC_rdo_id{parent(), "RDO_TGC"}; + }; +}; + +#endif // MuonPRDTEST_TGCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h new file mode 100644 index 00000000000..f07003b4fef --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCDigitVARIABLES_H +#define MuonPRDTEST_sTGCDigitVARIABLES_H + +#include "MuonDigitContainer/sTgcDigitContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class sTgcDigitVariables : public PrdTesterModule { + public: + sTgcDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTgcDigitVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nDigits{parent().newScalar("N_Digits_sTGC")}; + VectorBranch& m_NSWsTGC_dig_localPosX{parent().newVector("Digits_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_dig_localPosY{parent().newVector("Digits_sTGC_localPosY")}; + VectorBranch& m_NSWsTGC_dig_time{parent().newVector("Digits_sTGC_time")}; + VectorBranch& m_NSWsTGC_dig_bctag{parent().newVector("Digits_sTGC_bctag")}; + VectorBranch& m_NSWsTGC_dig_charge{parent().newVector("Digits_sTGC_charge")}; + VectorBranch& m_NSWsTGC_dig_isDead{parent().newVector("Digits_sTGC_isDead")}; + VectorBranch& m_NSWsTGC_dig_isPileup{parent().newVector("Digits_sTGC_isPileup")}; + VectorBranch& m_NSWsTGC_dig_channelNumber{parent().newVector("Digits_sTGC_channelNumber")}; + ThreeVectorBranch m_NSWsTGC_dig_globalPos{parent(), "Digits_sTGC_globalPos"}; + ThreeVectorBranch m_NSWsTGC_dig_PadglobalCornerPos{parent(), "Digits_sTGC_PadglobalCornerPos"}; + VectorBranch& m_NSWsTGC_dig_channelPosX{parent().newVector("Digits_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_dig_channelPosY{parent().newVector("Digits_sTGC_localPosY")}; + sTgcIdentifierBranch m_NSWsTGC_dig_id{parent(), "Digits_sTGC"}; + }; +}; +#endif // MuonPRDTEST_sTGCDigitVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h new file mode 100644 index 00000000000..ed4ab0c78d8 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCPRDVARIABLES_H +#define MuonPRDTEST_sTGCPRDVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonPrepRawData/sTgcPrepDataContainer.h" + +namespace MuonPRDTest{ + class sTGCPRDVariables : public PrdTesterModule { + public: + sTGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTGCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nPRD{parent().newScalar("N_PRD_sTGC")}; + VectorBranch& m_NSWsTGC_PRD_charge{parent().newVector("PRD_sTGC_charge")}; + VectorBranch& m_NSWsTGC_PRD_bcTag{parent().newVector("RDO_sTGC_bcTag")}; + VectorBranch& m_NSWsTGC_PRD_localPosX{parent().newVector("PRD_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_PRD_localPosY{parent().newVector("PRD_sTGC_localPosY")}; + ThreeVectorBranch m_NSWsTGC_PRD_globalPos{parent(), "PRD_sTGC_globalPos"}; + VectorBranch& m_NSWsTGC_PRD_covMatrix_1_1{parent().newVector("PRD_sTGC_covMatrix_1_1")}; + VectorBranch& m_NSWsTGC_PRD_covMatrix_2_2{parent().newVector("PRD_sTGC_covMatrix_2_2")}; + sTgcIdentifierBranch m_NSWsTGC_PRD_id{parent(), "PRD_sTGC"}; + }; +}; + +#endif // MuonPRDTEST_sTGCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h new file mode 100644 index 00000000000..654bc26a4c3 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCRDOVARIABLES_H +#define MuonPRDTEST_sTGCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/STGC_RawDataContainer.h" + +namespace MuonPRDTest{ + class sTGCRDOVariables : public PrdTesterModule { + public: + sTGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTGCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nRDO{parent().newScalar("N_RDO_sTGC")}; + VectorBranch& m_NSWsTGC_rdo_time{parent().newVector("RDO_sTGC_time")}; + VectorBranch& m_NSWsTGC_rdo_charge{parent().newVector("RDO_sTGC_charge")}; + VectorBranch& m_NSWsTGC_rdo_tdo{parent().newVector("RDO_sTGC_tdo")}; + VectorBranch& m_NSWsTGC_rdo_bcTag{parent().newVector("RDO_sTGC_bcTag")}; + VectorBranch& m_NSWsTGC_rdo_isDead{parent().newVector("RDO_sTGC_isDead")}; + VectorBranch& m_NSWsTGC_rdo_localPosX{parent().newVector("RDO_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_rdo_localPosY{parent().newVector("RDO_sTGC_localPosY")}; + ThreeVectorBranch m_NSWsTGC_rdo_globalPos{parent(), "RDO_sTGC_globalPos"}; + sTgcIdentifierBranch m_NSWsTGC_rdo_id{parent(), "RDO_sTGC"}; + }; +}; + +#endif // MuonPRDTEST_sTGCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h new file mode 100644 index 00000000000..64f60cd384b --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONPRDTEST_sTGCSDOVARIABLES_H +#define MUONPRDTEST_sTGCSDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonSimData/MuonSimDataCollection.h" + +namespace MuonPRDTest{ + class sTgcSDOVariables : public PrdTesterModule { + public: + sTgcSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTgcSDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + + ScalarBranch& m_NSWsTGC_nsdo{parent().newScalar("nSDO_sTGC")}; + sTgcIdentifierBranch m_NSWsTGC_sdo_id{parent(), "SDO_sTGC"}; + VectorBranch& m_NSWsTGC_sdo_word{parent().newVector("SDO_sTGC_word")}; + VectorBranch& m_NSWsTGC_sdo_barcode{parent().newVector("SDO_sTGC_barcode")}; + VectorBranch& m_NSWsTGC_sdo_globaltime{parent().newVector("SDO_sTGC_global_time")}; + + ThreeVectorBranch m_NSWsTGC_dig_globalPos{parent(), "SDO_sTGC_globalPos"}; + VectorBranch& m_NSWsTGC_sdo_E{parent().newVector("SDO_sTGC_E")}; + VectorBranch& m_NSWsTGC_sdo_tof{parent().newVector("SDO_sTGC_tof")}; + VectorBranch& m_NSWsTGC_sdo_localPosX{parent().newVector("SDO_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_sdo_localPosY{parent().newVector("SDO_sTGC_localPosY")}; + }; +}; + +#endif // sTGCSDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h new file mode 100644 index 00000000000..d8de256f578 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef sTGCSimHitVariables_H +#define sTGCSimHitVariables_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" + +namespace MuonPRDTest{ + class sTGCSimHitVariables : public PrdTesterModule { + public: + sTGCSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + bool fill(const EventContext& ctx) override final; + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ThreeVectorBranch m_NSWsTGC_hitGlobalPosition{parent(), "Hits_sTGC_GlobalPosition"}; + ThreeVectorBranch m_NSWsTGC_hitGlobalDirection{parent(), "Hits_sTGC_GlobalDirection"}; + ThreeVectorBranch m_NSWsTGC_hitGlobalPrePosition{parent(), "Hits_sTGC_GlobalPrePosition"}; + VectorBranch& m_NSWsTGC_particleEncoding{parent().newVector("Hits_sTGC_particleEncoding")}; + VectorBranch& m_NSWsTGC_kineticEnergy{parent().newVector("Hits_sTGC_kineticEnergy")}; + VectorBranch& m_NSWsTGC_depositEnergy{parent().newVector("Hits_sTGC_depositEnergy")}; + VectorBranch& m_NSWsTGC_isInsideBounds{parent().newVector("Hits_sTGC_isInsideBounds")}; + VectorBranch& m_NSWsTGC_trackId{parent().newVector("Hits_sTGC_trackId")}; + ScalarBranch& m_NSWsTGC_nSimHits{parent().newScalar("Hits_sTGC_nHits")}; + sTgcIdentifierBranch m_NSWsTGC_Id{parent(), "Hits_sTGC_off"}; + VectorBranch& m_NSWsTGC_globalTime{parent().newVector("Hits_sTGC_globalTime")}; + VectorBranch& m_NSWsTGC_detectorNumber{parent().newVector("Hits_sTGC_detectorNumber")}; + VectorBranch& m_NSWsTGC_wedgeId{parent().newVector("Hits_sTGC_wedgeId")}; + VectorBranch& m_NSWsTGC_wedgeType{parent().newVector("Hits_sTGC_wedgeType")}; + ThreeVectorBranch m_NSWsTGC_detector_globalPosition{parent(), "Hits_sTGC_detector_globalPosition"}; + ThreeVectorBranch m_NSWsTGC_hitToDsurfacePosition{parent(), "Hits_sTGC_hitToDsurfacePosition"}; + ThreeVectorBranch m_NSWsTGC_hitToRsurfacePosition{parent(), "Hits_sTGC_hitToRsurfacePosition"}; + VectorBranch& m_NSWsTGC_FastDigitRsurfacePositionX{parent().newVector("Hits_sTGC_FastDigitRsurfacePositionX")}; + VectorBranch& m_NSWsTGC_FastDigitRsurfacePositionY{parent().newVector("Hits_sTGC_FastDigitRsurfacePositionY")}; + VectorBranch& m_NSWsTGC_stripNumber{parent().newVector("Hits_sTGC_stripNumber")}; + }; +}; + +#endif // sTGCSimHitVariables_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx index 60b67a96600..39765fe6c3c 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx @@ -16,13 +16,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle CscDigitContainer{m_key, ctx}; if (!CscDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved CSC Digit Container with size " << CscDigitContainer->digit_size()); - if (CscDigitContainer->size() == 0) ATH_MSG_DEBUG(" CSC Digit Continer empty "); + if (CscDigitContainer->size() == 0) ATH_MSG_DEBUG(" CSC Digit Container empty "); unsigned int n_digits{0}; for (const CscDigitCollection* coll : *CscDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -33,31 +33,38 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("CSC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("CSCDigitVariables::fillVariables() - Failed to retrieve CSCReadoutElement for "<cscIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); - const bool stripPosition = rdoEl->stripPosition(Id, lpos); - int stripNumber = rdoEl->stripNumber(lpos, Id); - - if (!stripPosition) { - ATH_MSG_WARNING("CSCDigitVariables: failed to associate a valid local position for strip n. " - << stripNumber << "; associated positions will be set to 0.0."); - continue; - } - rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); m_CSC_dig_globalPos.push_back(gpos); - m_CSC_dig_localPosX.push_back(lpos.x()); - m_CSC_dig_localPosY.push_back(lpos.y()); m_CSC_dig_id.push_back(Id); - m_CSC_dig_stripNumber.push_back(stripNumber); ++n_digits; } - m_CSC_nDigits = n_digits; + // Local digit position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const CscDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + ATH_MSG_DEBUG("CSC Digit Offline id: " << idHelperSvc()->toString(Id)); + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) return false; + + Amg::Vector3D glpos{0., 0., 0.}; + Amg::Vector2D lopos(0., 0.); + + rdoEl->surface(Id).globalToLocal(glpos, glpos, lopos); + m_CSC_dig_localPosX.push_back(lopos.x()); + m_CSC_dig_localPosX.push_back(lopos.y()); + } } + m_CSC_nDigits = n_digits; ATH_MSG_DEBUG(" finished fillCscDigitVariables()"); return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx new file mode 100644 index 00000000000..76424a1f334 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/CSCPRDVariables.h" + +#include "MuonReadoutGeometry/CscReadoutElement.h" + +namespace MuonPRDTest { + CSCPRDVariables::CSCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_CSC", true, msglvl), m_key{container_name} {} + bool CSCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool CSCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillCSCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle cscprdContainer{m_key, ctx}; + if (!cscprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved CSC PRD Container with size " << cscprdContainer->size()); + + if (cscprdContainer->size() == 0) ATH_MSG_DEBUG(" CSC PRD Container empty "); + unsigned int n_PRD{0}; + for(auto it : *cscprdContainer ) { + const Muon::CscPrepDataCollection*coll = it; + for (auto prd: *coll) { + Identifier Id = prd->identify(); + + const MuonGM::CscReadoutElement* det = MuonDetMgr->getCscReadoutElement(Id); + if (!det) { + ATH_MSG_ERROR("The CSC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_CSC_PRD_id.push_back(Id); + m_CSC_PRD_charge.push_back(prd->charge()); + m_CSC_PRD_time.push_back(prd->time()); + + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + m_CSC_PRD_globalPos.push_back(pos); + + m_CSC_PRD_localPosX.push_back(loc_pos[0]); + m_CSC_PRD_localPosY.push_back(loc_pos[1]); + + ++n_PRD; + } + } + m_CSC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillCSCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx new file mode 100644 index 00000000000..0703b4b40b9 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/CSCRDOVariables.h" +#include "MuonSimData/MuonSimDataCollection.h" +#include "MuonIdHelpers/CscIdHelper.h" +#include "MuonReadoutGeometry/CscReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + CSCRDOVariables::CSCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const MuonIdHelper* idhelper, const Muon::ICSC_RDO_Decoder* rdo_decoder) : + PrdTesterModule(tree, "RDO_CSC", true, msglvl), m_key{container_name}, m_rdo_decoder{rdo_decoder} {setHelper(idhelper);} + bool CSCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool CSCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillCSCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle cscrdoContainer{m_key, ctx}; + if (!cscrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve csc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved CSC rdo Container with size " << cscrdoContainer->size()); + + if (cscrdoContainer->size() == 0) ATH_MSG_DEBUG(" CSC rdo Container empty "); + unsigned int n_rdo{0}; + for (const CscRawDataCollection* coll : *cscrdoContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + int strip_num{0}; + for (const CscRawData* rdo: *coll) { + const Identifier Id { m_rdo_decoder->channelIdentifier(rdo,m_CscIdHelper,strip_num) }; + ++strip_num; + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The CSC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_CSC_rdo_time.push_back(rdo->time()); + + Amg::Vector3D gpos{0., 0., 0.}; + Amg::Vector2D lpos(0., 0.); + + rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); + m_CSC_rdo_globalPos.push_back(gpos); + m_CSC_rdo_id.push_back(Id); + + ++n_rdo; + } + // Local RDO position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions + for (const CscRawData* rdo: *coll) { + const Identifier Id { m_rdo_decoder->channelIdentifier(rdo,m_CscIdHelper,strip_num) }; + ++strip_num; + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) return false; + + Amg::Vector2D loPos(0.,0.); + Amg::Vector3D glPos(0., 0., 0.); + + rdoEl->surface(Id).globalToLocal(glPos,glPos,loPos); + m_CSC_rdo_localPosX.push_back(loPos.x()); + m_CSC_rdo_localPosY.push_back(loPos.y()); + } + } + m_CSC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillCSCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx index 30fd41e361b..89b0d4ec09a 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx @@ -17,7 +17,7 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle cscSdoContainer{m_key, ctx}; if (!cscSdoContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } unsigned int n_sdo{0}; @@ -40,7 +40,10 @@ namespace MuonPRDTest { m_csc_sdo_word.push_back( csc_sdo.word() ); const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("CSCSDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for " << idHelperSvc()->toString(id)); + return false; + } Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY); Amg::Vector3D hit_gpos(0., 0., 0.); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx index 37844d27375..4b3bf0810dc 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx @@ -16,12 +16,12 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle MdtDigitContainer{m_digitKey, ctx}; if (!MdtDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_digitKey.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_digitKey.fullKey()); return false; } ATH_MSG_DEBUG("retrieved MDT Digit Container with size " << MdtDigitContainer->digit_size()); - if (MdtDigitContainer->size() == 0) ATH_MSG_DEBUG(" MDT Digit Continer empty "); + if (MdtDigitContainer->size() == 0) ATH_MSG_DEBUG(" MDT Digit Container empty "); unsigned int n_digits{0}; for (const MdtDigitCollection* coll : *MdtDigitContainer) { @@ -31,7 +31,10 @@ namespace MuonPRDTest { Identifier Id = digit->identify(); const MuonGM::MdtReadoutElement* rdoEl = MuonDetMgr->getMdtReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("MDTDigitVariables::fillVariables() - Failed to retrieve MDTReadoutElement for "<mdtIdHelper().print_to_string(Id).c_str()); + return false; + } const Identifier first_ml = idHelperSvc()->mdtIdHelper().channelID( idHelperSvc()->stationName(Id), idHelperSvc()->stationEta(Id), idHelperSvc()->stationPhi(Id), 1, 1, 1); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx new file mode 100644 index 00000000000..e931a5baf46 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx @@ -0,0 +1,163 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMDigitVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +namespace MuonPRDTest { + MMDigitVariables::MMDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "Digits_MM", true, msglvl), m_key{container_name} {} + + bool MMDigitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + bool MMDigitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMDigitHitVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle MMDigitContainer{m_key, ctx}; + if (!MMDigitContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved MM Digit Container with size " << MMDigitContainer->digit_size()); + + if (MMDigitContainer->size() == 0) ATH_MSG_DEBUG(" MM Digit Container empty "); + unsigned int n_digits{0}; + for (const MmDigitCollection* coll : *MMDigitContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const MmDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + + const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("MMDigitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<mmIdHelper().print_to_string(Id).c_str()); + return false; + } + + m_NSWMM_dig_id.push_back(Id); + m_NSWMM_dig_time.push_back(digit->chipResponseTime()); + m_NSWMM_dig_charge.push_back(digit->chipResponseCharge()); + m_NSWMM_dig_stripPosition.push_back(digit->chipResponsePosition()); + + m_NSWMM_dig_sr_time.push_back(digit->stripResponseTime()); + m_NSWMM_dig_sr_charge.push_back(digit->stripResponseCharge()); + m_NSWMM_dig_sr_stripPosition.push_back(digit->stripResponsePosition()); + + m_NSWMM_dig_time_trigger.push_back(digit->stripTimeForTrigger()); + m_NSWMM_dig_charge_trigger.push_back(digit->stripChargeForTrigger()); + m_NSWMM_dig_position_trigger.push_back(digit->stripPositionForTrigger()); + m_NSWMM_dig_MMFE_VMM_id_trigger.push_back(digit->MMFE_VMM_idForTrigger()); + m_NSWMM_dig_VMM_id_trigger.push_back(digit->VMM_idForTrigger()); + + if ( digit->chipResponsePosition().size() != digit->stripResponsePosition().size() ) + ATH_MSG_DEBUG("MicroMegas digitization: number of strip out from the strip response different from that out from the chip response"); + + bool isValid; + // Geant4 hit converted into digit might have fired more than one strip: + // iterating on all strips associated to that digit (from chip response) + for (unsigned int i=0;ichipResponsePosition().size();i++) { + // take strip index form chip information + int cr_strip = digit->chipResponsePosition().at(i); + //retrieve the detailed identifier for the strip form the chip response + Identifier cr_id = idHelperSvc()->mmIdHelper().channelID(idHelperSvc()->mmIdHelper().stationName(Id),idHelperSvc()->mmIdHelper().stationEta(Id), + idHelperSvc()->mmIdHelper().stationPhi(Id),idHelperSvc()->mmIdHelper().multilayer(Id),idHelperSvc()->mmIdHelper().gasGap(Id),cr_strip,isValid); + if (!isValid) { + ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << cr_strip + << "; associated positions will be set to 0.0."); + continue; + } + + // asking the detector element to get local position of strip + Amg::Vector2D cr_strip_pos(0., 0.); + if ( !rdoEl->stripPosition(cr_id,cr_strip_pos) ) { + ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << cr_strip + << "; associated positions will be set to 0.0."); + continue; + } + m_NSWMM_dig_stripLposX.push_back(cr_strip_pos.x()); + m_NSWMM_dig_stripLposY.push_back(cr_strip_pos.y()); + + // asking the detector element to transform this local to the global position + Amg::Vector3D cr_strip_gpos(0., 0., 0.); + rdoEl->surface(cr_id).localToGlobal(cr_strip_pos, Amg::Vector3D(0., 0., 0.), cr_strip_gpos); + m_NSWMM_dig_stripGpos.push_back(cr_strip_gpos); + + // check if local and global position are congruent with the transform + Amg::Vector3D lpos = rdoEl->transform(cr_id).inverse() * cr_strip_gpos; + double dx = cr_strip_pos.x() - lpos.x(); + double dy = cr_strip_pos.y() - lpos.y(); + + if ( std::abs(dx)>0.1 || std::abs(dy)>0.1 ) { + ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); + ATH_MSG_WARNING(" X from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.x() + << ", X from global*transform(id).inverse(): " << lpos.x() ); + ATH_MSG_WARNING(" Y from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.y() + << ", Y from global*transform(Id).inverse(): " << lpos.y() ); + } + } + + // Geant4 hit converted into digit might have fired more than one strip: + // iterating on all strips associated to that digit (from strip response) + for (unsigned int i=0;istripResponsePosition().size();i++) { + int sr_strip = digit->stripResponsePosition().at(i); + + //retrieve the detailed identifier for the strip form the strip response + Identifier sr_id = idHelperSvc()->mmIdHelper().channelID(idHelperSvc()->mmIdHelper().stationName(Id),idHelperSvc()->mmIdHelper().stationEta(Id), + idHelperSvc()->mmIdHelper().stationPhi(Id),idHelperSvc()->mmIdHelper().multilayer(Id),idHelperSvc()->mmIdHelper().gasGap(Id),sr_strip,isValid); + if (!isValid) { + ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << sr_strip + << "; associated positions will be set to 0.0."); + continue; + } + + // asking the detector element to transform this local to the global position + Amg::Vector2D sr_strip_pos(0., 0.); + if ( !rdoEl->stripPosition(sr_id,sr_strip_pos) ) { + ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << sr_strip + << "; associated positions will be set to 0.0."); + continue; + } + m_NSWMM_dig_sr_stripLposX.push_back(sr_strip_pos.x()); + m_NSWMM_dig_sr_stripLposY.push_back(sr_strip_pos.y()); + + // asking the detector element to transform this local to the global position + Amg::Vector3D sr_strip_gpos(0., 0., 0.); + rdoEl->surface(sr_id).localToGlobal(sr_strip_pos, Amg::Vector3D(0., 0., 0.), sr_strip_gpos); + m_NSWMM_dig_stripGpos.push_back(sr_strip_gpos); + + // check if local and global position are congruent with the transform + Amg::Vector3D sr_lpos = rdoEl->transform(sr_id).inverse() * sr_strip_gpos; + double dx = sr_strip_pos.x() - sr_lpos.x(); + double dy = sr_strip_pos.y() - sr_lpos.y(); + + if ( std::abs(dx)>0.1 || std::abs(dy)>0.1 ) { + ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); + ATH_MSG_WARNING(" X from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.x() + << ", X from local*transform: " << sr_lpos.x() ); + ATH_MSG_WARNING(" Y from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.y() + << ", Y from local*transform: " << sr_lpos.y() ); + } + + unsigned int cl = (digit->chipResponseTime().size()<=digit->stripResponseTime().size()) ? digit->chipResponseTime().size() : digit->stripResponseTime().size(); + + for (unsigned int i=0;ichipResponseTime().at(i) + << ", strip response time :" << std::setw(6) << std::setprecision(2) << digit->stripResponseTime().at(i)); + ATH_MSG_DEBUG("MicroMegas Digit, chip response charge :" << std::setw(6) << std::setprecision(2) << digit->chipResponseCharge().at(i) + << ", strip response charge :" << std::setw(6) << std::setprecision(2) << digit->stripResponseCharge().at(i)); + ATH_MSG_DEBUG("MicroMegas Digit, chip response position:" << std::setw(6) << std::setprecision(2) << digit->chipResponsePosition().at(i) + << ", strip response position:" << std::setw(6) << std::setprecision(2) << digit->stripResponsePosition().at(i)); + } + + } + ++n_digits; + } + } + m_NSWMM_nDigits = n_digits; + ATH_MSG_DEBUG(" finished fillMMDigitVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx new file mode 100644 index 00000000000..6e2c37d76c9 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMPRDVariables.h" +#include "MuonPRDTest/MMRDOVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +namespace MuonPRDTest { + MMPRDVariables::MMPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_MM", true, msglvl), m_key{container_name} {} + bool MMPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle mmprdContainer{m_key, ctx}; + if (!mmprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM PRD Container with size " << mmprdContainer->size()); + + if (mmprdContainer->size() == 0) ATH_MSG_DEBUG(" MM PRD Container empty "); + + SG::ReadHandle mmrdoContainer{m_rdokey, ctx}; + if (!mmrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve rdo container " << m_rdokey.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM RDO Container with size " << mmrdoContainer->size()); + + if (mmrdoContainer->size() == 0) ATH_MSG_DEBUG(" MM RDO Container empty "); + + unsigned int n_PRD{0}; + for(const Muon::MMPrepDataCollection* coll : *mmprdContainer) { + const Muon::MM_RawDataCollection* rdo_coll = mmrdoContainer->indexFindPtr(coll->identifyHash()); + + if(rdo_coll==nullptr){ + ATH_MSG_ERROR("Did not find rdo collection " << coll->identifyHash()); + return false; + } + ATH_MSG_DEBUG("Found rdo_coll at "<size(); item++) { + const Muon::MMPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + m_NSWMM_PRD_time.push_back(prd->time()); + + const MuonGM::MMReadoutElement* det = prd->detectorElement();; + if (!det) { + ATH_MSG_ERROR("The micromega hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWMM_PRD_id.push_back(Id); + Amg::Vector3D pos = prd->globalPosition(); + const Amg::MatrixX & cov = prd->localCovariance(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + ATH_MSG_DEBUG( "MicroMegas PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); + + m_NSWMM_PRD_globalPos.push_back(pos); + + m_NSWMM_PRD_localPosX.push_back(loc_pos[0]); + m_NSWMM_PRD_localPosY.push_back(loc_pos[1]); + m_NSWMM_PRD_covMatrix_1_1.push_back(cov(0,0)); + m_NSWMM_PRD_nRdos.push_back((prd->rdoList()).size()); + + for(const Identifier &id_rdo:prd->rdoList()){ + const Muon::MM_RawData* rdo=nullptr; + for(auto it :*rdo_coll){if(it->identify() == id_rdo) rdo=it;} + if(rdo==nullptr){ + ATH_MSG_ERROR("Did not find rdo for identifier in rdo list"); + return false; + } + m_NSWMM_PRD_rdos_charge.push_back(rdo->charge()); + m_NSWMM_PRD_rdos_time.push_back(rdo->time()); + m_NSWMM_PRD_rdos_channel.push_back(idHelperSvc()->mmIdHelper().channel(id_rdo)); + } + m_NSWMM_PRD_uTPCAngle.push_back(prd->angle()); + m_NSWMM_PRD_uTPCChiSqProb.push_back(prd->chisqProb()); + + ++n_PRD; + } + } + m_NSWMM_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillMMPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx new file mode 100644 index 00000000000..6b141e6db41 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx @@ -0,0 +1,64 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMRDOVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + MMRDOVariables::MMRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "RDO_MM", true, msglvl), m_rdokey{container_name} {} + bool MMRDOVariables::declare_keys() { return m_rdokey.initialize().isSuccess(); } + + bool MMRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle mmrdoContainer{m_rdokey, ctx}; + if (!mmrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve MM rdo container " << m_rdokey.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM rdo Container with size " << mmrdoContainer->size()); + + if (mmrdoContainer->size() == 0) ATH_MSG_DEBUG(" MM rdo Container empty "); + unsigned int n_rdo{0}; + for (const MM_RawDataCollection* coll : *mmrdoContainer) { + for (unsigned int item=0; itemsize(); item++) { + const MM_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + m_NSWMM_rdo_time.push_back(rdo->time()); + m_NSWMM_rdo_relBcid.push_back(rdo->relBcid()); + m_NSWMM_rdo_charge.push_back(rdo->charge()); + + const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The micromega hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWMM_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_NSWMM_rdo_localPosX.push_back(localStripPos.x()); + m_NSWMM_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("MM RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("MM RDO: local Strip position not defined"); + } + + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_NSWMM_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_NSWMM_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillMMRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx new file mode 100644 index 00000000000..345c0229c1f --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMSDOVariables.h" + +namespace MuonPRDTest { + MMSDOVariables::MMSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "SDO_MM", false, msglvl), m_key{container_name} {} + + bool MMSDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMSDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill MMSDOVariables()"); + SG::ReadHandle mmSdoContainer{m_key, ctx}; + if (!mmSdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + unsigned int n_sdo{0}; + for (const auto& coll : *mmSdoContainer) { + const Identifier& id = coll.first; + const MuonSimData& mm_sdo = coll.second; + + m_NSWMM_sdo_globaltime.push_back(mm_sdo.getTime()); + m_NSWMM_sdo_word.push_back(mm_sdo.word()); + + ATH_MSG_DEBUG("Get the truth deposits from the SDO."); + std::vector deposits; + mm_sdo.deposits(deposits); + + m_NSWMM_sdo_id.push_back(id); + const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); + m_NSWMM_dig_globalPos.push_back(hit_gpos); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("MM SDO barcode=" << barcode); + ATH_MSG_DEBUG("MM SDO local position X=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", local position Y=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWMM_sdo_barcode.push_back(barcode); + + m_NSWMM_sdo_localPosX.push_back(MuonMCdata_firstentry); + m_NSWMM_sdo_localPosY.push_back(MuonMCdata_secondentry); + + ++n_sdo; + } + m_NSWMM_nsdo = n_sdo; + + ATH_MSG_DEBUG("Processed " << n_sdo << "MM SDOs"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx new file mode 100644 index 00000000000..659b5233154 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx @@ -0,0 +1,164 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ +#include "MuonPRDTest/MMSimHitVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" +#include "MuonSimEvent/MicromegasHitIdHelper.h" + +namespace MuonPRDTest { + MMSimHitVariables::MMSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "MM_Sim", false, msglvl), m_key{container_name} {} + + bool MMSimHitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMSimHitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill MmSimHitVariables()"); + SG::ReadHandle mmContainer{m_key, ctx}; + if (!mmContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_hits{0}; + // Get the MM Id hit helper + MicromegasHitIdHelper* mmhhelper = MicromegasHitIdHelper::GetHelper(); + if (!mmContainer->size()) ATH_MSG_DEBUG("MM Sim container is empty"); + for (const MMSimHit& hit : *mmContainer) { + int simId = hit.MMId(); + + if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. + + // connect the hit with the MC truth + int barcode = hit.particleLink().barcode(); + m_NSWMM_trackId.push_back(barcode); + m_NSWMM_globalTime.push_back(hit.globalTime()); + + const Amg::Vector3D& globalPosition = hit.globalPosition(); + m_NSWMM_hitGlobalPosition.push_back(globalPosition); + + const Amg::Vector3D& globalDirection = hit.globalDirection(); + m_NSWMM_hitGlobalDirection.push_back(globalDirection); + + m_NSWMM_particleEncoding.push_back(hit.particleEncoding()); + m_NSWMM_kineticEnergy.push_back(hit.kineticEnergy()); + m_NSWMM_depositEnergy.push_back(hit.depositEnergy()); + + std::string stname = mmhhelper->GetStationName(simId); + int steta = mmhhelper->GetZSector(simId); + int stphi = mmhhelper->GetPhiSector(simId); + int multilayer = mmhhelper->GetMultiLayer(simId); + int layer = mmhhelper->GetLayer(simId); + int side = mmhhelper->GetSide(simId); + + if( stphi == 0 ){ + ATH_MSG_ERROR("MicroMegas validation: unexpected phi range " << stphi); + return false; + } + + Identifier offId = idHelperSvc()->mmIdHelper().channelID( stname[2] == 'L' ? "MML" : "MMS", + side == 1 ? steta+1 : -steta-1, + (stphi-1)/2+1,multilayer,layer,1 ); + m_NSWMM_Id.push_back(offId); + + // sanity checks + if( !idHelperSvc()->mmIdHelper().is_mm(offId) ){ + ATH_MSG_WARNING("MM id is not a mm id! " << idHelperSvc()->mmIdHelper().print_to_string(offId)); + } + if( !idHelperSvc()->mmIdHelper().is_muon(offId) ){ + ATH_MSG_WARNING("MM id is not a muon id! " << idHelperSvc()->mmIdHelper().print_to_string(offId)); + } + if( idHelperSvc()->mmIdHelper().is_mdt(offId)||idHelperSvc()->mmIdHelper().is_rpc(offId)||idHelperSvc()->mmIdHelper().is_tgc(offId)||idHelperSvc()->mmIdHelper().is_csc(offId)||idHelperSvc()->mmIdHelper().is_stgc(offId) ){ + ATH_MSG_WARNING("MM id has wrong technology type! " << idHelperSvc()->mmIdHelper().is_mdt(offId) << " " << idHelperSvc()->mmIdHelper().is_rpc(offId) + << " " << idHelperSvc()->mmIdHelper().is_tgc(offId) << " " << idHelperSvc()->mmIdHelper().is_csc(offId) << " " << idHelperSvc()->mmIdHelper().is_stgc(offId) ); + } + if( idHelperSvc()->mmIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("MM id has bad layer field! " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + } + + int isSmall = stname[2] == 'S'; + ATH_MSG_DEBUG("MicroMegas geometry, retrieving detector element for: isSmall " << isSmall << " eta " << idHelperSvc()->mmIdHelper().stationEta(offId) + << " phi " << idHelperSvc()->mmIdHelper().stationPhi(offId) << " ml " << idHelperSvc()->mmIdHelper().multilayer(offId) ); + + const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(offId); + if (!detEl) { + ATH_MSG_ERROR("MMSimHitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<mmIdHelper().print_to_string(offId).c_str()); + return false; + } + + // surface + const Trk::PlaneSurface& surf = detEl->surface(offId); + // compute hit position within the detector element/surfaces + Amg::Transform3D gToL = detEl->absTransform().inverse(); + Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); + Amg::Vector3D dSurface_pos = gToL*hpos; + + // compute the hit position on the readout plane (same as in MuonFastDigitization) + Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; + + Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y()); + + // check where the readout plane is located and compute the local direction accordingly + Amg::Vector3D ldir(0., 0., 0.); + ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); + + double scale, scaletop; + double gasgap = 5.; + + scale = -rSurface_pos.z()/ldir.z(); + scaletop = (gasgap+rSurface_pos.z())/ldir.z(); + + Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; + Amg::Vector3D hitOnTopSurface = rSurface_pos + scaletop*ldir; + Amg::Vector2D posOnSurf (hitOnSurface.x(), hitOnSurface.y()); + Amg::Vector2D posOnTopSurf (hitOnTopSurface.x(),hitOnTopSurface.y()); + + + int stripNumber = detEl->stripNumber(posOnSurf,offId); + + // perform bound check (making the call from the detector element to consider edge passivation) + m_NSWMM_isInsideBounds.push_back( detEl->insideActiveBounds(offId, posOnSurf) ); + + if( stripNumber == -1 ){ + ATH_MSG_WARNING("MicroMegas validation: failed to obtain strip number " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); + stripNumber = 1; + } + + Identifier oldId = offId; + offId = idHelperSvc()->mmIdHelper().channelID(offId, idHelperSvc()->mmIdHelper().multilayer(offId), idHelperSvc()->mmIdHelper().gasGap(offId),stripNumber); + if( idHelperSvc()->mmIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("MicroMegas validation: MM id has bad layer field(2)! " << std::endl << " " << idHelperSvc()->mmIdHelper().print_to_string(offId) << std::endl + << " " << idHelperSvc()->mmIdHelper().print_to_string(oldId) << " stripN " << stripNumber ); + } + + Amg::Vector2D fastDigitPos(0.,0.); + if( !detEl->stripPosition(offId,fastDigitPos ) ){ + ATH_MSG_WARNING("MicroMegas validation: failed to obtain local position for identifier " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + } + + Amg::Vector3D detpos = detEl->globalPosition(); + ATH_MSG_DEBUG("Global hit : r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() + << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() + << "; surf z " << surf.center().z() << ", ml " << multilayer << ", l " << layer ); + ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); + ATH_MSG_DEBUG("MM Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() + << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); + + // Fill ntuple with the hit/surface/digit positions + m_NSWMM_detector_globalPosition.push_back(detpos); + m_NSWMM_hitToDsurfacePosition.push_back(dSurface_pos); + m_NSWMM_hitToRsurfacePosition.push_back(rSurface_pos); + + m_NSWMM_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); + m_NSWMM_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); + + ++n_hits; + } + m_NSWMM_nSimHits = n_hits; + + ATH_MSG_DEBUG("processed " << m_NSWMM_nSimHits << " MM hits"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx index 1f783e0dc08..c9f7d1c99f0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx @@ -16,13 +16,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle RpcDigitContainer{m_key, ctx}; if (!RpcDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved RPC Digit Container with size " << RpcDigitContainer->digit_size()); - if (RpcDigitContainer->size() == 0) ATH_MSG_DEBUG(" RPC Digit Continer empty "); + if (RpcDigitContainer->size() == 0) ATH_MSG_DEBUG(" RPC Digit Container empty "); unsigned int n_digits{0}; for (const RpcDigitCollection* coll : *RpcDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -33,7 +33,10 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("RPC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::RpcReadoutElement* rdoEl = MuonDetMgr->getRpcReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("RPCDigitVariables::fillVariables() - Failed to retrieve PRCReadoutElement for "<rpcIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx index d353d0a3fa8..2d45f310ffa 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx @@ -15,13 +15,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle TgcDigitContainer{m_key, ctx}; if (!TgcDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved TGC Digit Container with size " << TgcDigitContainer->digit_size()); - if (TgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" TGC Digit Continer empty "); + if (TgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" TGC Digit Container empty "); unsigned int n_digits{0}; for (const TgcDigitCollection* coll : *TgcDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -32,7 +32,10 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("TGC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("TGCDigitVariables::fillVariables() - Failed to retrieve TGCReadoutElement for "<tgcIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); @@ -55,8 +58,8 @@ namespace MuonPRDTest { ++n_digits; } - m_TGC_nDigits = n_digits; } + m_TGC_nDigits = n_digits; ATH_MSG_DEBUG(" finished fillTgcDigitVariables()"); return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx new file mode 100644 index 00000000000..520c04a5b56 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/TGCPRDVariables.h" + +#include "MuonReadoutGeometry/TgcReadoutElement.h" + +namespace MuonPRDTest { + TGCPRDVariables::TGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_TGC", true, msglvl), m_key{container_name} {} + bool TGCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool TGCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillTGCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle tgcprdContainer{m_key, ctx}; + if (!tgcprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved TGC PRD Container with size " << tgcprdContainer->size()); + + if (tgcprdContainer->size() == 0) ATH_MSG_DEBUG(" TGC PRD Container empty "); + unsigned int n_PRD{0}; + for(auto it : *tgcprdContainer ) { + const Muon::TgcPrepDataCollection*coll = it; + for (auto prd: *coll) { + Identifier Id = prd->identify(); + + const MuonGM::TgcReadoutElement* det = MuonDetMgr->getTgcReadoutElement(Id); + if (!det) { + ATH_MSG_ERROR("The TGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_TGC_PRD_id.push_back(Id); + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + m_TGC_PRD_globalPos.push_back(pos); + + m_TGC_PRD_localPosX.push_back(loc_pos[0]); + m_TGC_PRD_localPosY.push_back(loc_pos[1]); + + ++n_PRD; + } + } + m_TGC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillTGCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx new file mode 100644 index 00000000000..f3fe728bd51 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx @@ -0,0 +1,80 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/TGCRDOVariables.h" +#include "MuonSimData/MuonSimDataCollection.h" +#include "MuonReadoutGeometry/TgcReadoutElement.h" +#include "MuonRDO/TgcRdo.h" + +using namespace Muon; +namespace MuonPRDTest { + TGCRDOVariables::TGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const ITGCcablingSvc* cabling_svc) : + PrdTesterModule(tree, "RDO_TGC", true, msglvl), m_key{container_name}, m_tgcCabling{cabling_svc} {} + bool TGCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool TGCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillTGCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle tgcrdoContainer{m_key, ctx}; + if (!tgcrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve tgc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved TGC rdo Container with size " << tgcrdoContainer->size()); + + if (tgcrdoContainer->size() == 0) ATH_MSG_DEBUG(" TGC rdo Container empty "); + unsigned int n_rdo{0}; + for (const TgcRdo* coll : *tgcrdoContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (const TgcRawData* rdo: *coll) { + + bool orFlag = m_tgcCabling->isOredChannel(rdo->subDetectorId(), + rdo->rodId(), + rdo->sswId(), + rdo->slbId(), + rdo->bitpos()); + + Identifier Id; + bool e_found = m_tgcCabling->getElementIDfromReadoutID(Id, + rdo->subDetectorId(), + rdo->rodId(), + rdo->sswId(), + rdo->slbId(), + rdo->bitpos(), + orFlag); + if (!e_found) { + ATH_MSG_ERROR("could not find Identifier from TgcRawData"); + return false; + } + + const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The TGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_TGC_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_TGC_rdo_localPosX.push_back(localStripPos.x()); + m_TGC_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("TGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("TGC RDO: local Strip position not defined"); + } + + // asking the detector element to transform this local to the global position + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_TGC_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_TGC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillTGCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx new file mode 100644 index 00000000000..c1f4f28d945 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCDigitVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTgcDigitVariables::sTgcDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "Digits_sTGC", true, msglvl), m_key{container_name} {} + + bool sTgcDigitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + bool sTgcDigitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCDigitHitVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle sTgcDigitContainer{m_key, ctx}; + if (!sTgcDigitContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved sTGC Digit Container with size " << sTgcDigitContainer->digit_size()); + + if (sTgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" sTGC Digit Container empty "); + unsigned int n_digits{0}; + for (const sTgcDigitCollection* coll : *sTgcDigitContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const sTgcDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("sTGCDigitVariables::fillVariables() - Failed to retrieve sTGCReadoutElement for "<stgcIdHelper().print_to_string(Id).c_str()); + return false; + } + m_NSWsTGC_dig_id.push_back(Id); + Amg::Vector3D gpos{0., 0., 0.}; + Amg::Vector2D lpos(0., 0.); + + rdoEl->stripPosition(Id, lpos); + rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); + + m_NSWsTGC_dig_globalPos.push_back(gpos); + m_NSWsTGC_dig_localPosX.push_back(lpos.x()); + m_NSWsTGC_dig_localPosY.push_back(lpos.y()); + + m_NSWsTGC_dig_channelNumber.push_back(rdoEl->stripNumber(lpos, Id)); + + std::vector local_pad_corners; + rdoEl->padCorners(Id,local_pad_corners); + std::vector global_pad_corners; + + for(auto& local_corner : local_pad_corners) { + Amg::Vector3D global_corner; + rdoEl->surface(Id).localToGlobal(local_corner, global_corner, global_corner); + global_pad_corners.push_back(global_corner); + } + for(auto corner : global_pad_corners) { + if(idHelperSvc()->stgcIdHelper().channelType(Id) ==0 ) { + m_NSWsTGC_dig_PadglobalCornerPos.push_back(corner); + } + } + + m_NSWsTGC_dig_channelPosX.push_back( lpos.x() ); + m_NSWsTGC_dig_channelPosY.push_back( lpos.y() ); + + m_NSWsTGC_dig_bctag.push_back(digit->bcTag()); + m_NSWsTGC_dig_time.push_back(digit->time()); + m_NSWsTGC_dig_charge.push_back(digit->charge()); + m_NSWsTGC_dig_isDead.push_back(digit->isDead()); + m_NSWsTGC_dig_isPileup.push_back(digit->isPileup()); + + ++n_digits; + } + } + m_NSWsTGC_nDigits = n_digits; + ATH_MSG_DEBUG(" finished fillsTgcDigitVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx new file mode 100644 index 00000000000..029c4c1c20a --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCPRDVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTGCPRDVariables::sTGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_sTGC", true, msglvl), m_key{container_name} {} + bool sTGCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle stgcprdContainer{m_key, ctx}; + if (!stgcprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved sTGC PRD Container with size " << stgcprdContainer->size()); + + if (stgcprdContainer->size() == 0) ATH_MSG_DEBUG(" sTGC PRD Container empty "); + unsigned int n_PRD{0}; + for(const Muon::sTgcPrepDataCollection* coll : *stgcprdContainer ) { + for (unsigned int item=0; itemsize(); item++) { + const Muon::sTgcPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + m_NSWsTGC_PRD_id.push_back(Id); + m_NSWsTGC_PRD_charge.push_back(prd->charge()); + m_NSWsTGC_PRD_bcTag.push_back(prd->getBcBitMap()); + + const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); + if (!det) { + ATH_MSG_ERROR("The sTGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + double err_x = prd->localCovariance()(0,0); + double err_y = ( prd->localCovariance().rows()==2)? prd->localCovariance()(1,1) : 0.; + + ATH_MSG_DEBUG( "sTgc PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << err_x + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] + << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); + + m_NSWsTGC_PRD_globalPos.push_back(pos); + + m_NSWsTGC_PRD_localPosX.push_back(loc_pos[0]); + m_NSWsTGC_PRD_localPosY.push_back(loc_pos[1]); + m_NSWsTGC_PRD_covMatrix_1_1.push_back(err_x); + m_NSWsTGC_PRD_covMatrix_2_2.push_back(err_y); + + ++n_PRD; + } + } + m_NSWsTGC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillsTGCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx new file mode 100644 index 00000000000..7dd217f8838 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCRDOVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + sTGCRDOVariables::sTGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "RDO_sTGC", true, msglvl), m_key{container_name} {} + bool sTGCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle stgcrdoContainer{m_key, ctx}; + if (!stgcrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve stgc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved sTGC rdo Container with size " << stgcrdoContainer->size()); + + if (stgcrdoContainer->size() == 0) ATH_MSG_DEBUG(" sTGC rdo Container empty "); + unsigned int n_rdo{0}; + for (const STGC_RawDataCollection* coll : *stgcrdoContainer) { + for (unsigned int item=0; itemsize(); item++) { + const STGC_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + m_NSWsTGC_rdo_time.push_back(rdo->time()); + m_NSWsTGC_rdo_tdo.push_back(rdo->tdo()); + m_NSWsTGC_rdo_charge.push_back(rdo->charge()); + m_NSWsTGC_rdo_bcTag.push_back(rdo->bcTag()); + m_NSWsTGC_rdo_isDead.push_back(rdo->isDead()); + + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The sTGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWsTGC_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_NSWsTGC_rdo_localPosX.push_back(localStripPos.x()); + m_NSWsTGC_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("sTGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("sTGC RDO: local Strip position not defined"); + } + + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_NSWsTGC_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_NSWsTGC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillsTGCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx new file mode 100644 index 00000000000..20b104c5053 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCSDOVariables.h" +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTgcSDOVariables::sTgcSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "SDO_sTGC", false, msglvl), m_key{container_name} {} + + bool sTgcSDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTgcSDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill sTgcSDOVariables()"); + SG::ReadHandle stgcSdoContainer{m_key, ctx}; + if (!stgcSdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_sdo{0}; + for (const auto& coll : *stgcSdoContainer) { + const Identifier& id = coll.first; + const MuonSimData& stgc_sdo = coll.second; + + m_NSWsTGC_sdo_globaltime.push_back(stgc_sdo.getTime()); + m_NSWsTGC_sdo_word.push_back(stgc_sdo.word()); + + ATH_MSG_DEBUG("sTGC SDO: " << idHelperSvc()->toString(id)); + + ATH_MSG_DEBUG("Get the truth deposits from the SDO."); + std::vector deposits; + stgc_sdo.deposits(deposits); + + const Amg::Vector3D hit_gpos = stgc_sdo.globalPosition(); + m_NSWsTGC_dig_globalPos.push_back(hit_gpos); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("sTGC SDO barcode=" << barcode); + ATH_MSG_DEBUG("sTGC SDO energy=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", tof=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWsTGC_sdo_barcode.push_back(barcode); + m_NSWsTGC_sdo_E.push_back(MuonMCdata_firstentry); + m_NSWsTGC_sdo_tof.push_back(MuonMCdata_secondentry); + + // Retrieve the detector element and local SDO coordinates + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(id); + if (!rdoEl) { + ATH_MSG_ERROR("sTGCSDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for " << idHelperSvc()->toString(id)); + return false; + } + + m_NSWsTGC_sdo_id.push_back(id); + Amg::Vector2D loc_pos(0., 0.); + rdoEl->surface(id).globalToLocal(stgc_sdo.globalPosition(), Amg::Vector3D(0., 0., 0.), loc_pos); + ATH_MSG_DEBUG("sTGC SDO local position X=" << std::setw(9) << std::setprecision(2) << loc_pos[0] + << ", local position Y=" << std::setw(9) << std::setprecision(2) << loc_pos[1]); + m_NSWsTGC_sdo_localPosX.push_back( loc_pos[0] ); + m_NSWsTGC_sdo_localPosY.push_back( loc_pos[1] ); + + ++n_sdo; + } + m_NSWsTGC_nsdo = n_sdo; + + ATH_MSG_DEBUG("Processed " << n_sdo << " sTGC SDOs"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx new file mode 100644 index 00000000000..4bacb2f88ae --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx @@ -0,0 +1,186 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ +#include "MuonPRDTest/sTGCSimHitVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" +#include "MuonSimEvent/sTgcHitIdHelper.h" +namespace MuonPRDTest { + sTGCSimHitVariables::sTGCSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "sTGC_Sim", false, msglvl), m_key{container_name} {} + + bool sTGCSimHitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCSimHitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill sTGCSimHitVariables()"); + SG::ReadHandle stgcContainer{m_key, ctx}; + if (!stgcContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve SimHit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_hits{0}; + // Get the sTGC Id hit helper + sTgcHitIdHelper* stgchhelper = sTgcHitIdHelper::GetHelper(); + + if (!stgcContainer->size()) ATH_MSG_DEBUG("sTGC Sim container is empty"); + for (const sTGCSimHit& hit : *stgcContainer) { + if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. + + for( int type=0;type<=2;++type ){ + int simId = hit.sTGCId(); + std::string stname = stgchhelper->GetStationName(simId); + int steta = stgchhelper->GetZSector(simId); + int stphi = stgchhelper->GetPhiSector(simId); + int multilayer = stgchhelper->GetMultiLayer(simId); + int layer = stgchhelper->GetLayer(simId); + int side = stgchhelper->GetSide(simId); + + if ( stphi==0 ) { + ATH_MSG_ERROR("unexpected phi range: " << stphi); + return false; + } + + // Old [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] + // Current implementation of the Station Name is: Q[L/S][1-3][P/C] + int detNumber = -999, wedgeId = -999, wedgeType = -999; + if(stname.length()!=4) { + ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); + } + else { + detNumber = atoi(stname.substr(2,1).c_str()); + wedgeId = (stname.substr(1,1).compare("L")) ? 0 : 1; + wedgeType = (stname.substr(3,1).compare("P")) ? 0 : 1; + } + + Identifier offId = idHelperSvc()->stgcIdHelper().channelID(stname[1] == 'L' ? "STL" : "STS", + side == 1 ? steta+1 : -steta-1, + (stphi-1)/2+1,multilayer,layer,1,1 ); + m_NSWsTGC_Id.push_back(offId); + std::string stName = idHelperSvc()->stgcIdHelper().stationNameString(idHelperSvc()->stgcIdHelper().stationName(offId)); + int off_channel = idHelperSvc()->stgcIdHelper().channel(offId); + + int isSmall = stName[2] == 'S'; + + if( type == 2 && off_channel == 63) { + ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); + continue; + } + + const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(offId); + if (!detEl) { + ATH_MSG_ERROR("sTGCSimHitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for "<stgcIdHelper().print_to_string(offId).c_str()); + return false; + } + + if( !idHelperSvc()->stgcIdHelper().is_stgc(offId) ){ + ATH_MSG_WARNING("sTgc id is not a stgc id! " << idHelperSvc()->stgcIdHelper().print_to_string(offId)); + } + if( !idHelperSvc()->stgcIdHelper().is_muon(offId) ){ + ATH_MSG_WARNING("sTgc id is not a muon id! " << idHelperSvc()->stgcIdHelper().print_to_string(offId)); + } + if( idHelperSvc()->stgcIdHelper().is_mdt(offId)||idHelperSvc()->stgcIdHelper().is_rpc(offId)||idHelperSvc()->stgcIdHelper().is_tgc(offId)||idHelperSvc()->stgcIdHelper().is_csc(offId)||idHelperSvc()->stgcIdHelper().is_mm(offId) ){ + ATH_MSG_WARNING("sTgc id has wrong technology type! " << idHelperSvc()->stgcIdHelper().is_mdt(offId) << " " << idHelperSvc()->stgcIdHelper().is_rpc(offId) + << " " << idHelperSvc()->stgcIdHelper().is_tgc(offId) << " " << idHelperSvc()->stgcIdHelper().is_csc(offId) << " " << idHelperSvc()->stgcIdHelper().is_mm(offId) ); + } + if( idHelperSvc()->stgcIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("sTgc id has bad layer field! " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + } + + // connect the hit with the MC truth + int barcode = hit.particleLink().barcode(); + m_NSWsTGC_trackId.push_back(barcode); + m_NSWsTGC_wedgeId.push_back(wedgeId); + m_NSWsTGC_wedgeType.push_back(wedgeType); + m_NSWsTGC_detectorNumber.push_back(detNumber); + + m_NSWsTGC_globalTime.push_back(hit.globalTime()); + const Amg::Vector3D& globalPosition = hit.globalPosition(); + m_NSWsTGC_hitGlobalPosition.push_back(globalPosition); + + const Amg::Vector3D& globalDirection = hit.globalDirection(); + m_NSWsTGC_hitGlobalDirection.push_back(globalDirection); + + m_NSWsTGC_particleEncoding.push_back(hit.particleEncoding()); + m_NSWsTGC_depositEnergy.push_back(hit.depositEnergy()); + m_NSWsTGC_kineticEnergy.push_back(hit.kineticEnergy()); + + const Amg::Vector3D& globalPrePosition = hit.globalPrePosition(); + m_NSWsTGC_hitGlobalPrePosition.push_back(globalPrePosition); + if (hit.kineticEnergy() < 0.0) { + m_NSWsTGC_hitGlobalPrePosition.push_back(-9999.9); + } + + ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << idHelperSvc()->stgcIdHelper().stationEta(offId) + << " phi " << idHelperSvc()->stgcIdHelper().stationPhi(offId) << " ml " << idHelperSvc()->stgcIdHelper().multilayer(offId) ); + + Identifier newId = idHelperSvc()->stgcIdHelper().channelID(idHelperSvc()->stgcIdHelper().parentID(offId), idHelperSvc()->stgcIdHelper().multilayer(offId), idHelperSvc()->stgcIdHelper().gasGap(offId),type,1); + + // compute hit position within the detector element/surfaces + const Trk::PlaneSurface& surf = detEl->surface(newId); + Amg::Transform3D gToL = detEl->absTransform().inverse(); + Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); + Amg::Vector3D dSurface_pos = gToL*hpos; + + // compute the hit position on the readout plane (same as in MuonFastDigitization) + Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; + Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); + + ATH_MSG_DEBUG("sTGC channel type:" << type); + + double scale = -rSurface_pos.z()/ldir.z(); + Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; + + // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing + Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); + + // remember whether the given hit is inside the active volume (and produces a valid digit) + m_NSWsTGC_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); + + int stripNumber = detEl->stripNumber(posOnSurf,newId); + if( stripNumber == -1 ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); + //stripNumber = 1; + } + Identifier oldId = offId; + offId = idHelperSvc()->stgcIdHelper().channelID(offId, idHelperSvc()->stgcIdHelper().multilayer(offId), idHelperSvc()->stgcIdHelper().gasGap(offId),1,stripNumber); + if( idHelperSvc()->stgcIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << idHelperSvc()->stgcIdHelper().print_to_string(offId) << std::endl + << " " << idHelperSvc()->stgcIdHelper().print_to_string(oldId) << " stripN " << stripNumber ); + } + + Amg::Vector2D fastDigitPos(0,0); + if( !detEl->stripPosition(offId,fastDigitPos) ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + } + + Amg::Vector3D detpos = detEl->globalPosition(); + ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() + << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() + << "; surf z " << surf.center().z() << ", ml " << multilayer << ", l " << layer ); + + ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); + ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() + << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); + + // Fill ntuple with the hit/surface/digit positions + m_NSWsTGC_detector_globalPosition.push_back(detpos); + + m_NSWsTGC_hitToDsurfacePosition.push_back(dSurface_pos); + + m_NSWsTGC_hitToRsurfacePosition.push_back(rSurface_pos); + + m_NSWsTGC_FastDigitRsurfacePositionX.push_back(posOnSurf.x()); + m_NSWsTGC_FastDigitRsurfacePositionY.push_back(posOnSurf.y()); + m_NSWsTGC_stripNumber.push_back(stripNumber); + } + ++n_hits; + } + m_NSWsTGC_nSimHits = n_hits; + + ATH_MSG_DEBUG("processed " << m_NSWsTGC_nSimHits << " sTgc hits"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx deleted file mode 100644 index 892a6362310..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CSCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/CscPrepDataContainer.h" - -#include "MuonReadoutGeometry/CscReadoutElement.h" - -#include "TTree.h" - -StatusCode CSCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillCSCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::CscPrepDataContainer *Csc_PrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(Csc_PrepDataContainer, m_ContainerName.c_str()) ); - - if(Csc_PrepDataContainer->size()==0) ATH_MSG_WARNING(" CSC PRD Container empty "); - - for(auto it : *Csc_PrepDataContainer ) { - - const Muon::CscPrepDataCollection* coll = it; - - for (auto prd: *coll) { - - Identifier Id = prd->identify(); - - std::string stName = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(Id)); - int stationEta = m_CscIdHelper->stationEta(Id); - int stationPhi = m_CscIdHelper->stationPhi(Id); - int channel = m_CscIdHelper->channel(Id); - int chlayer = m_CscIdHelper->chamberLayer(Id); - int wlayer = m_CscIdHelper->wireLayer(Id); - int measuresPhi = m_CscIdHelper->measuresPhi(Id); - int strip = m_CscIdHelper->strip(Id); - int charge = prd->charge(); - int time = prd->time(); - - ATH_MSG_DEBUG( "CSC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " ChNr [" << channel << "]" - << " chamber layer [" << chlayer << "]" - << " wire layer [" << wlayer << "]" - << " measures phi [" << measuresPhi << "]" - << " strip [" << strip << "]" ); - - m_CSC_PRD_stationName.push_back(stName); - m_CSC_PRD_stationEta.push_back(stationEta); - m_CSC_PRD_stationPhi.push_back(stationPhi); - m_CSC_PRD_channel.push_back(channel); - m_CSC_PRD_chlayer.push_back(chlayer); - m_CSC_PRD_wlayer.push_back(wlayer); - m_CSC_PRD_measuresPhi.push_back(measuresPhi); - m_CSC_PRD_strip.push_back(strip); - m_CSC_PRD_charge.push_back(charge); - m_CSC_PRD_time.push_back(time); - - const MuonGM::CscReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nCSCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - m_CSC_PRD_globalPosX.push_back(pos.x()); - m_CSC_PRD_globalPosY.push_back(pos.y()); - m_CSC_PRD_globalPosZ.push_back(pos.z()); - - m_CSC_PRD_localPosX.push_back(loc_pos[0]); - m_CSC_PRD_localPosY.push_back(loc_pos[1]); - - m_CSC_PRD_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_CSC_PRD_nPRDs << " CSC PRD's"); - - return StatusCode::SUCCESS; -} - -StatusCode CSCPRDVariables::clearVariables() -{ - - m_CSC_PRD_nPRDs = 0; - - m_CSC_PRD_stationName.clear(); - m_CSC_PRD_stationEta.clear(); - m_CSC_PRD_stationPhi.clear(); - m_CSC_PRD_channel.clear(); - m_CSC_PRD_chlayer.clear(); - m_CSC_PRD_wlayer.clear(); - m_CSC_PRD_measuresPhi.clear(); - m_CSC_PRD_strip.clear(); - m_CSC_PRD_charge.clear(); - m_CSC_PRD_time.clear(); - - m_CSC_PRD_globalPosX.clear(); - m_CSC_PRD_globalPosY.clear(); - m_CSC_PRD_globalPosZ.clear(); - - m_CSC_PRD_localPosX.clear(); - m_CSC_PRD_localPosY.clear(); - - return StatusCode::SUCCESS; -} - -StatusCode CSCPRDVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("PRD_CSC", &m_CSC_PRD_nPRDs, "PRDs_CSC_n/i"); - m_tree->Branch("PRD_CSC_stationName", &m_CSC_PRD_stationName); - m_tree->Branch("PRD_CSC_stationEta", &m_CSC_PRD_stationEta); - m_tree->Branch("PRD_CSC_stationPhi", &m_CSC_PRD_stationPhi); - m_tree->Branch("PRD_CSC_channel", &m_CSC_PRD_channel); - m_tree->Branch("PRD_CSC_chlayer", &m_CSC_PRD_chlayer); - m_tree->Branch("PRD_CSC_wlayer", &m_CSC_PRD_wlayer); - m_tree->Branch("PRD_CSC_measuresPhi", &m_CSC_PRD_measuresPhi); - m_tree->Branch("PRD_CSC_strip", &m_CSC_PRD_strip); - m_tree->Branch("PRD_CSC_charge", &m_CSC_PRD_charge); - m_tree->Branch("PRD_CSC_time", &m_CSC_PRD_time); - - m_tree->Branch("PRD_CSC_globalPosX", &m_CSC_PRD_globalPosX); - m_tree->Branch("PRD_CSC_globalPosY", &m_CSC_PRD_globalPosY); - m_tree->Branch("PRD_CSC_globalPosZ", &m_CSC_PRD_globalPosZ); - - m_tree->Branch("PRD_CSC_localPosX", &m_CSC_PRD_localPosX); - m_tree->Branch("PRD_CSC_localPosY", &m_CSC_PRD_localPosY); - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h deleted file mode 100644 index 1b864fe77fa..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CSCPRDVARIABLES_H -#define CSCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class CSCPRDVariables : public ValAlgVariables -{ - public: - CSCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl) - { - setHelper(idhelper); - } - - ~CSCPRDVariables() = default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_CscIdHelper = dynamic_cast(idhelper); - if(!m_CscIdHelper) { - throw std::runtime_error("casting IdHelper to CscIdHelper failed"); - } - } - - void deleteVariables(){}; - StatusCode clearVariables(); - - const CscIdHelper* m_CscIdHelper{}; - - int m_CSC_PRD_nPRDs{}; - std::vector m_CSC_PRD_stationName; - std::vector m_CSC_PRD_stationEta; - std::vector m_CSC_PRD_stationPhi; - std::vector m_CSC_PRD_channel; - std::vector m_CSC_PRD_chlayer; - std::vector m_CSC_PRD_wlayer; - std::vector m_CSC_PRD_measuresPhi; - std::vector m_CSC_PRD_strip; - std::vector m_CSC_PRD_charge; - std::vector m_CSC_PRD_time; - - std::vector m_CSC_PRD_globalPosX; - std::vector m_CSC_PRD_globalPosY; - std::vector m_CSC_PRD_globalPosZ; - - std::vector m_CSC_PRD_localPosX; - std::vector m_CSC_PRD_localPosY; - -}; - -#endif // CSCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx deleted file mode 100644 index 13db0e4261e..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CSCRDOVariables.h" -#include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonRDO/CscRawDataContainer.h" -#include "MuonReadoutGeometry/CscReadoutElement.h" -#include "TTree.h" - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ - - -CSCRDOVariables::CSCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string& containername, - MSG::Level msglvl, - const Muon::ICSC_RDO_Decoder* rdo_decoder - ) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_rdo_decoder{rdo_decoder} - { - setHelper(idhelper); - - } - -StatusCode CSCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillCSCRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - const CscRawDataContainer* rdo_container = nullptr; - ATH_CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName) ); - - if(rdo_container->size()==0) ATH_MSG_DEBUG(" CSC RDO Container empty "); - - for(const CscRawDataCollection* coll : *rdo_container) { - int strip_num{0}; - for (const CscRawData* rdo: *coll) { - const Identifier Id { m_rdo_decoder->channelIdentifier(rdo, m_CscIdHelper,strip_num)}; - ++strip_num; - - std::string stName = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(Id)); - int stationEta = m_CscIdHelper->stationEta(Id); - int stationPhi = m_CscIdHelper->stationPhi(Id); - int channel = m_CscIdHelper->channel(Id); - int chamberLayer = m_CscIdHelper->chamberLayer(Id); - int wireLayer = m_CscIdHelper->wireLayer(Id); - int strip = m_CscIdHelper->strip(Id); - bool measuresPhi = m_CscIdHelper->measuresPhi(Id); - - - ATH_MSG_DEBUG( "CSC RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " channel [" << channel << "]" - << " chamberLayer [" << chamberLayer << "]" - << " wireLayer [" << wireLayer << "]" - << " strip [" << strip << "]" - << " measuresPhi [" << measuresPhi << "]" ); - - const MuonGM::CscReadoutElement* rdoEl = nullptr; - try{ - rdoEl = MuonDetMgr->getCscReadoutElement(Id); - } catch (const std::runtime_error&) { - ATH_MSG_WARNING("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ <<" "<< m_CscIdHelper->print_to_string(Id)); - continue; - } - if (!rdoEl) { - ATH_MSG_ERROR("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(Id)); - return StatusCode::FAILURE; - } - /// to be stored in the ntuple - m_Csc_rdo_stationName.push_back(stName); - m_Csc_rdo_stationEta.push_back(stationEta); - m_Csc_rdo_stationPhi.push_back(stationPhi); - m_Csc_rdo_channel.push_back(channel); - m_Csc_rdo_chamberLayer.push_back(chamberLayer); - m_Csc_rdo_wireLayer.push_back(wireLayer); - m_Csc_rdo_strip.push_back(strip); - m_Csc_rdo_measuresPhi.push_back(measuresPhi); - m_Csc_rdo_time.push_back(rdo->time()); - - Amg::Vector2D localPos(0.,0.); - Amg::Vector3D globalPos(0., 0., 0.); - - rdoEl->surface(Id).localToGlobal(localPos,globalPos,globalPos); - m_Csc_rdo_globalPosX.push_back(globalPos.x()); - m_Csc_rdo_globalPosY.push_back(globalPos.y()); - m_Csc_rdo_globalPosZ.push_back(globalPos.z()); - - - // rdo counter for the ntuple - m_Csc_nrdo++; - } - // Local RDO position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions - for (const CscRawData* rdo: *coll) { - const Identifier Id { m_rdo_decoder->channelIdentifier(rdo, m_CscIdHelper,strip_num)}; - ++strip_num; - - const MuonGM::CscReadoutElement* rdoEl = nullptr; - try{ - rdoEl = MuonDetMgr->getCscReadoutElement(Id); - } catch (const std::runtime_error&) { - ATH_MSG_WARNING("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ <<" "<< m_CscIdHelper->print_to_string(Id)); - continue; - } - if (!rdoEl) { - ATH_MSG_ERROR("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(Id)); - return StatusCode::FAILURE; - } - - Amg::Vector2D lPos(0.,0.); - Amg::Vector3D gPos(0., 0., 0.); - - rdoEl->surface(Id).globalToLocal(gPos,gPos,lPos); - m_Csc_rdo_localPosX.push_back(lPos.x()); - m_Csc_rdo_localPosY.push_back(lPos.y()); - } - - } - - ATH_MSG_DEBUG("processed " << m_Csc_nrdo << " csc rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode CSCRDOVariables::clearVariables() -{ - m_Csc_nrdo = 0; - - m_Csc_rdo_stationName.clear(); - m_Csc_rdo_stationEta.clear(); - m_Csc_rdo_stationPhi.clear(); - m_Csc_rdo_channel.clear(); - m_Csc_rdo_chamberLayer.clear(); - m_Csc_rdo_wireLayer.clear(); - m_Csc_rdo_strip.clear(); - m_Csc_rdo_measuresPhi.clear(); - m_Csc_rdo_time.clear(); - m_Csc_rdo_localPosX.clear(); - m_Csc_rdo_localPosY.clear(); - m_Csc_rdo_globalPosX.clear(); - m_Csc_rdo_globalPosY.clear(); - m_Csc_rdo_globalPosZ.clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode CSCRDOVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("RDO_CSC_n", &m_Csc_nrdo); - m_tree->Branch("RDO_CSC_stationName", &m_Csc_rdo_stationName); - m_tree->Branch("RDO_CSC_stationEta", &m_Csc_rdo_stationEta); - m_tree->Branch("RDO_CSC_stationPhi", &m_Csc_rdo_stationPhi); - m_tree->Branch("RDO_CSC_channel", &m_Csc_rdo_channel); - m_tree->Branch("RDO_CSC_chamberLayer", &m_Csc_rdo_chamberLayer); - m_tree->Branch("RDO_CSC_wireLayer", &m_Csc_rdo_wireLayer); - m_tree->Branch("RDO_CSC_strip", &m_Csc_rdo_strip); - m_tree->Branch("RDO_CSC_measuresPhi", &m_Csc_rdo_measuresPhi); - m_tree->Branch("RDO_CSC_time", &m_Csc_rdo_time); - m_tree->Branch("RDO_CSC_localPosX", &m_Csc_rdo_localPosX); - m_tree->Branch("RDO_CSC_localPosY", &m_Csc_rdo_localPosY); - m_tree->Branch("RDO_CSC_globalPosX", &m_Csc_rdo_globalPosX); - m_tree->Branch("RDO_CSC_globalPosY", &m_Csc_rdo_globalPosY); - m_tree->Branch("RDO_CSC_globalPosZ", &m_Csc_rdo_globalPosZ); - - } - return StatusCode::SUCCESS; -} - -void CSCRDOVariables::deleteVariables() -{ - return; -} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h deleted file mode 100644 index e8d10b678b8..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CSCRDOVARIABLES_H -#define CSCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" - -#include - -class CSCRDOVariables : public ValAlgVariables -{ - public: - CSCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string& containername, - MSG::Level msglvl, - const Muon::ICSC_RDO_Decoder* rdo_decoder); - - ~CSCRDOVariables() =default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_CscIdHelper = dynamic_cast(idhelper); - if(!m_CscIdHelper) { - throw std::runtime_error("casting IdHelper to CscIdHelper failed"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const CscIdHelper* m_CscIdHelper{nullptr}; - const Muon::ICSC_RDO_Decoder* m_rdo_decoder{nullptr}; - - - int m_Csc_nrdo{0}; - std::vector m_Csc_rdo_stationName; - std::vector m_Csc_rdo_stationEta; - std::vector m_Csc_rdo_stationPhi; - std::vector m_Csc_rdo_channel; - std::vector m_Csc_rdo_chamberLayer; - std::vector m_Csc_rdo_wireLayer; - std::vector m_Csc_rdo_strip; - std::vector m_Csc_rdo_measuresPhi; - std::vector m_Csc_rdo_time; - std::vector m_Csc_rdo_localPosX; - std::vector m_Csc_rdo_localPosY; - std::vector m_Csc_rdo_globalPosX; - std::vector m_Csc_rdo_globalPosY; - std::vector m_Csc_rdo_globalPosZ; - -}; - -#endif // CSCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx deleted file mode 100644 index fa46218e8cd..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx +++ /dev/null @@ -1,451 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMDigitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonDigitContainer/MmDigitContainer.h" -#include "MuonDigitContainer/MmDigit.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "TTree.h" -#include // for Form - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode MMDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWMMDigitVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - // get digit container (a container corresponds to a multilayer of a module) - const MmDigitContainer *nsw_MmDigitContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MmDigitContainer, m_ContainerName.c_str()) ); - - if(nsw_MmDigitContainer->size()==0) ATH_MSG_WARNING(" MM DigitContainer empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(auto it : *nsw_MmDigitContainer) { - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - const MmDigitCollection* coll = it; - - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const MmDigit* digit = coll->at(item); - Identifier Id = digit->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - // channel here seems to be sth like the channel/strip closest to the initial Geant4 hit - // that is entering the digitzation process (probably only of limited use) - int channel = m_MmIdHelper->channel(Id); - - ATH_MSG_DEBUG( "MicroMegas Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWMM_dig_stationName->push_back(stName); - m_NSWMM_dig_stationEta->push_back(stationEta); - m_NSWMM_dig_stationPhi->push_back(stationPhi); - m_NSWMM_dig_multiplet->push_back(multiplet); - m_NSWMM_dig_gas_gap->push_back(gas_gap); - m_NSWMM_dig_channel->push_back(channel); - - // get the readout element class where the digit is recorded - int isSmall = (stName[2] == 'S'); - const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nMMDigitVariables::fillVariables() - Failed to retrieve MMReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - // information from VMM chip - std::vector time = digit->chipResponseTime(); - std::vector charge = digit->chipResponseCharge(); - std::vector stripPosition = digit->chipResponsePosition(); - - std::vector localPosX; - std::vector localPosY; - std::vector globalPosX; - std::vector globalPosY; - std::vector globalPosZ; - - // information from strip - std::vector sr_time = digit->stripResponseTime(); - std::vector sr_charge = digit->stripResponseCharge(); - std::vector sr_stripPosition = digit->stripResponsePosition(); - - std::vector sr_localPosX; - std::vector sr_localPosY; - std::vector sr_globalPosX; - std::vector sr_globalPosY; - std::vector sr_globalPosZ; - - // information for trigger - std::vector time_trigger = digit->stripTimeForTrigger(); - std::vector charge_trigger = digit->stripChargeForTrigger(); - std::vector position_trigger = digit->stripPositionForTrigger(); - std::vector MMFE_VMM_id_trigger = digit->MMFE_VMM_idForTrigger(); - std::vector VMM_id_trigger = digit->VMM_idForTrigger(); - - // check if VMM chip and stirp agree - if ( stripPosition.size() != sr_stripPosition.size() ) - ATH_MSG_DEBUG("MicroMegas digitization: number of strip out from the strip response different from that out from the chip response"); - - bool isValid; - int stationName = m_MmIdHelper->stationName(Id); - - // Geant4 hit converted into digit might have fired more than one strip: - // iterating on all strips associated to that digit (from chip response) - for (unsigned int i=0;ichannelID(stationName, stationEta, stationPhi, multiplet, gas_gap, cr_strip, isValid); - if (!isValid) { - ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << cr_strip - << "; associated positions will be set to 0.0."); - } else { - // asking the detector element to get local position of strip - Amg::Vector2D cr_strip_pos(0., 0.); - if ( !rdoEl->stripPosition(cr_id,cr_strip_pos) ) { - ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << cr_strip - << "; associated positions will be set to 0.0."); - } else { - localPosX.at(i) = cr_strip_pos.x(); - localPosY.at(i) = cr_strip_pos.y(); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D cr_strip_gpos(0., 0., 0.); - rdoEl->surface(cr_id).localToGlobal(cr_strip_pos, Amg::Vector3D(0., 0., 0.), cr_strip_gpos); - globalPosX.at(i) = cr_strip_gpos[0]; - globalPosY.at(i) = cr_strip_gpos[1]; - globalPosZ.at(i) = cr_strip_gpos[2]; - - // check if local and global position are congruent with the transform - Amg::Vector3D lpos = rdoEl->transform(cr_id).inverse() * cr_strip_gpos; - double dx = cr_strip_pos.x() - lpos.x(); - double dy = cr_strip_pos.y() - lpos.y(); - - if ( fabs(dx)>0.1 || fabs(dy)>0.1 ) { - ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); - ATH_MSG_WARNING(" X from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.x() - << ", X from global*transform(id).inverse(): " << lpos.x() ); - ATH_MSG_WARNING(" Y from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.y() - << ", Y from global*transform(Id).inverse(): " << lpos.y() ); - } - } - } - - // Geant4 hit converted into digit might have fired more than one strip: - // iterating on all strips associated to that digit (from strip response) - for (unsigned int i=0;ichannelID(stationName, stationEta, stationPhi, multiplet, gas_gap, sr_strip, isValid); - if (!isValid) { - ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << sr_strip - << "; associated positions will be set to 0.0."); - } else { - // asking the detector element to transform this local to the global position - Amg::Vector2D sr_strip_pos(0., 0.); - if ( !rdoEl->stripPosition(sr_id,sr_strip_pos) ) { - ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << sr_strip - << "; associated positions will be set to 0.0."); - } else { - sr_localPosX.at(i) = sr_strip_pos.x(); - sr_localPosY.at(i) = sr_strip_pos.y(); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D sr_strip_gpos(0., 0., 0.); - rdoEl->surface(sr_id).localToGlobal(sr_strip_pos, Amg::Vector3D(0., 0., 0.), sr_strip_gpos); - sr_globalPosX.at(i) = sr_strip_gpos[0]; - sr_globalPosY.at(i) = sr_strip_gpos[1]; - sr_globalPosZ.at(i) = sr_strip_gpos[2]; - - // check if local and global position are congruent with the transform - Amg::Vector3D lpos = rdoEl->transform(sr_id).inverse() * sr_strip_gpos; - double dx = sr_strip_pos.x() - lpos.x(); - double dy = sr_strip_pos.y() - lpos.y(); - - if ( fabs(dx)>0.1 || fabs(dy)>0.1 ) { - ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); - ATH_MSG_WARNING(" X from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.x() - << ", X from local*transform: " << lpos.x() ); - ATH_MSG_WARNING(" Y from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.y() - << ", Y from local*transform: " << lpos.y() ); - } - - } - } - - unsigned int cl = (time.size()<=sr_time.size()) ? time.size() : sr_time.size(); - - for (unsigned int i=0;ipush_back(time); - m_NSWMM_dig_charge->push_back(charge); - m_NSWMM_dig_stripPosition->push_back(stripPosition); - m_NSWMM_dig_stripLposX->push_back(localPosX); - m_NSWMM_dig_stripLposY->push_back(localPosY); - m_NSWMM_dig_stripGposX->push_back(globalPosX); - m_NSWMM_dig_stripGposY->push_back(globalPosY); - m_NSWMM_dig_stripGposZ->push_back(globalPosZ); - - // local/global positions (+charge/time/strip index) of the strips from strip response - // to be stored in the ntuple - m_NSWMM_dig_sr_time->push_back(sr_time); - m_NSWMM_dig_sr_charge->push_back(sr_charge); - m_NSWMM_dig_sr_stripPosition->push_back(sr_stripPosition); - m_NSWMM_dig_sr_stripLposX->push_back(sr_localPosX); - m_NSWMM_dig_sr_stripLposY->push_back(sr_localPosY); - m_NSWMM_dig_sr_stripGposX->push_back(sr_globalPosX); - m_NSWMM_dig_sr_stripGposY->push_back(sr_globalPosY); - m_NSWMM_dig_sr_stripGposZ->push_back(sr_globalPosZ); - - // some more information of the digit to be stored in the ntuple - m_NSWMM_dig_time_trigger->push_back(time_trigger); - m_NSWMM_dig_charge_trigger->push_back(charge_trigger); - m_NSWMM_dig_position_trigger->push_back(position_trigger); - m_NSWMM_dig_MMFE_VMM_id_trigger->push_back(MMFE_VMM_id_trigger); - m_NSWMM_dig_VMM_id_trigger->push_back(VMM_id_trigger); - - // digit counter for the ntuple - m_NSWMM_nDigits++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nDigits << " MicroMegas hits"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode MMDigitVariables::clearVariables() -{ - m_NSWMM_nDigits = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWMM_nDigits - m_NSWMM_dig_stationName->clear(); - m_NSWMM_dig_stationEta->clear(); - m_NSWMM_dig_stationPhi->clear(); - m_NSWMM_dig_multiplet->clear(); - m_NSWMM_dig_gas_gap->clear(); - m_NSWMM_dig_channel->clear(); - - // vectors of size m_NSWMM_nDigits that hold vectors in which an entry - // corresponds to a strip that was decided to be fired by the digit - // (information from VMM chip response emulation) - m_NSWMM_dig_time->clear(); - m_NSWMM_dig_charge->clear(); - m_NSWMM_dig_stripPosition->clear(); - m_NSWMM_dig_stripLposX->clear(); - m_NSWMM_dig_stripLposY->clear(); - m_NSWMM_dig_stripGposX->clear(); - m_NSWMM_dig_stripGposY->clear(); - m_NSWMM_dig_stripGposZ->clear(); - - // vectors of size m_NSWMM_nDigits that hold vectors in which an entry - // corresponds to a strip that was decided to be fired by the digit - // (information from VMM chip strip emulation) - m_NSWMM_dig_sr_time->clear(); - m_NSWMM_dig_sr_charge->clear(); - m_NSWMM_dig_sr_stripPosition->clear(); - m_NSWMM_dig_sr_stripLposX->clear(); - m_NSWMM_dig_sr_stripLposY->clear(); - m_NSWMM_dig_sr_stripGposX->clear(); - m_NSWMM_dig_sr_stripGposY->clear(); - m_NSWMM_dig_sr_stripGposZ->clear(); - - // more information for trigger - m_NSWMM_dig_time_trigger->clear(); - m_NSWMM_dig_charge_trigger->clear(); - m_NSWMM_dig_position_trigger->clear(); - m_NSWMM_dig_MMFE_VMM_id_trigger->clear(); - m_NSWMM_dig_VMM_id_trigger->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode MMDigitVariables::initializeVariables() -{ - m_NSWMM_nDigits = 0; - m_NSWMM_dig_stationName = new std::vector(); - m_NSWMM_dig_stationEta = new std::vector(); - m_NSWMM_dig_stationPhi = new std::vector(); - m_NSWMM_dig_multiplet = new std::vector(); - m_NSWMM_dig_gas_gap = new std::vector(); - m_NSWMM_dig_channel = new std::vector(); - - m_NSWMM_dig_time = new std::vector< std::vector >; - m_NSWMM_dig_charge = new std::vector< std::vector >; - m_NSWMM_dig_stripPosition = new std::vector< std::vector >; - m_NSWMM_dig_stripLposX = new std::vector< std::vector >; - m_NSWMM_dig_stripLposY = new std::vector< std::vector >; - m_NSWMM_dig_stripGposX = new std::vector< std::vector >; - m_NSWMM_dig_stripGposY = new std::vector< std::vector >; - m_NSWMM_dig_stripGposZ = new std::vector< std::vector >; - - m_NSWMM_dig_sr_time = new std::vector< std::vector >; - m_NSWMM_dig_sr_charge = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripPosition = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripLposX = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripLposY = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposX = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposY = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposZ = new std::vector< std::vector >; - - m_NSWMM_dig_time_trigger = new std::vector< std::vector >; - m_NSWMM_dig_charge_trigger = new std::vector< std::vector >; - m_NSWMM_dig_position_trigger = new std::vector< std::vector >; - m_NSWMM_dig_MMFE_VMM_id_trigger = new std::vector< std::vector >; - m_NSWMM_dig_VMM_id_trigger = new std::vector< std::vector >; - - if(m_tree) { - m_tree->Branch("Digits_MM", &m_NSWMM_nDigits, "Digits_MM_n/i"); - m_tree->Branch("Digits_MM_stationName", &m_NSWMM_dig_stationName); - m_tree->Branch("Digits_MM_stationEta", &m_NSWMM_dig_stationEta); - m_tree->Branch("Digits_MM_stationPhi", &m_NSWMM_dig_stationPhi); - m_tree->Branch("Digits_MM_multiplet", &m_NSWMM_dig_multiplet); - m_tree->Branch("Digits_MM_gas_gap", &m_NSWMM_dig_gas_gap); - m_tree->Branch("Digits_MM_channel", &m_NSWMM_dig_channel); - - m_tree->Branch("Digits_MM_time", &m_NSWMM_dig_time); - m_tree->Branch("Digits_MM_charge", &m_NSWMM_dig_charge); - m_tree->Branch("Digits_MM_stripPosition", &m_NSWMM_dig_stripPosition); - m_tree->Branch("Digits_MM_stripLposX", &m_NSWMM_dig_stripLposX); - m_tree->Branch("Digits_MM_stripLposY", &m_NSWMM_dig_stripLposY); - m_tree->Branch("Digits_MM_stripGposX", &m_NSWMM_dig_stripGposX); - m_tree->Branch("Digits_MM_stripGposY", &m_NSWMM_dig_stripGposY); - m_tree->Branch("Digits_MM_stripGposZ", &m_NSWMM_dig_stripGposZ); - - m_tree->Branch("Digits_MM_stripResponse_time", &m_NSWMM_dig_sr_time); - m_tree->Branch("Digits_MM_stripResponse_charge", &m_NSWMM_dig_sr_charge); - m_tree->Branch("Digits_MM_stripResponse_stripPosition", &m_NSWMM_dig_sr_stripPosition); - m_tree->Branch("Digits_MM_stripResponse_stripLposX", &m_NSWMM_dig_sr_stripLposX); - m_tree->Branch("Digits_MM_stripResponse_stripLposY", &m_NSWMM_dig_sr_stripLposY); - m_tree->Branch("Digits_MM_stripresponse_stripGposX", &m_NSWMM_dig_sr_stripGposX); - m_tree->Branch("Digits_MM_stripResponse_stripGposY", &m_NSWMM_dig_sr_stripGposY); - m_tree->Branch("Digits_MM_stripResponse_stripGposZ", &m_NSWMM_dig_sr_stripGposZ); - - m_tree->Branch("Digits_MM_time_trigger", &m_NSWMM_dig_time_trigger); - m_tree->Branch("Digits_MM_charge_trigger", &m_NSWMM_dig_charge_trigger); - m_tree->Branch("Digits_MM_position_trigger", &m_NSWMM_dig_position_trigger); - m_tree->Branch("Digits_MM_MMFE_VMM_id_trigger", &m_NSWMM_dig_MMFE_VMM_id_trigger); - m_tree->Branch("Digits_MM_VMM_id_trigger", &m_NSWMM_dig_VMM_id_trigger); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void MMDigitVariables::deleteVariables() -{ - delete m_NSWMM_dig_stationName; - delete m_NSWMM_dig_stationEta; - delete m_NSWMM_dig_stationPhi; - delete m_NSWMM_dig_multiplet; - delete m_NSWMM_dig_gas_gap; - delete m_NSWMM_dig_channel; - - delete m_NSWMM_dig_time; - delete m_NSWMM_dig_charge; - delete m_NSWMM_dig_stripPosition; - delete m_NSWMM_dig_stripLposX; - delete m_NSWMM_dig_stripLposY; - delete m_NSWMM_dig_stripGposX; - delete m_NSWMM_dig_stripGposY; - delete m_NSWMM_dig_stripGposZ; - - delete m_NSWMM_dig_sr_time; - delete m_NSWMM_dig_sr_charge; - delete m_NSWMM_dig_sr_stripPosition; - delete m_NSWMM_dig_sr_stripLposX; - delete m_NSWMM_dig_sr_stripLposY; - delete m_NSWMM_dig_sr_stripGposX; - delete m_NSWMM_dig_sr_stripGposY; - delete m_NSWMM_dig_sr_stripGposZ; - - delete m_NSWMM_dig_time_trigger; - delete m_NSWMM_dig_charge_trigger; - delete m_NSWMM_dig_position_trigger; - delete m_NSWMM_dig_MMFE_VMM_id_trigger; - delete m_NSWMM_dig_VMM_id_trigger; - - m_NSWMM_nDigits = 0; - m_NSWMM_dig_stationName = nullptr; - m_NSWMM_dig_stationEta = nullptr; - m_NSWMM_dig_stationPhi = nullptr; - m_NSWMM_dig_multiplet = nullptr; - m_NSWMM_dig_gas_gap = nullptr; - m_NSWMM_dig_channel = nullptr; - - m_NSWMM_dig_time = nullptr; - m_NSWMM_dig_charge = nullptr; - m_NSWMM_dig_stripPosition = nullptr; - m_NSWMM_dig_stripLposX = nullptr; - m_NSWMM_dig_stripLposY = nullptr; - m_NSWMM_dig_stripGposX = nullptr; - m_NSWMM_dig_stripGposY = nullptr; - m_NSWMM_dig_stripGposZ = nullptr; - - m_NSWMM_dig_sr_time = nullptr; - m_NSWMM_dig_sr_charge = nullptr; - m_NSWMM_dig_sr_stripPosition = nullptr; - m_NSWMM_dig_sr_stripLposX = nullptr; - m_NSWMM_dig_sr_stripLposY = nullptr; - m_NSWMM_dig_sr_stripGposX = nullptr; - m_NSWMM_dig_sr_stripGposY = nullptr; - m_NSWMM_dig_sr_stripGposZ = nullptr; - - m_NSWMM_dig_time_trigger = nullptr; - m_NSWMM_dig_charge_trigger = nullptr; - m_NSWMM_dig_position_trigger = nullptr; - m_NSWMM_dig_MMFE_VMM_id_trigger = nullptr; - m_NSWMM_dig_VMM_id_trigger = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h deleted file mode 100644 index 197c7ca8e17..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMDIGITVARIABLES_H -#define MMDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMDigitVariables : public ValAlgVariables -{ - public: - MMDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nDigits(0), - m_NSWMM_dig_stationName(0), - m_NSWMM_dig_stationEta(0), - m_NSWMM_dig_stationPhi(0), - m_NSWMM_dig_multiplet(0), - m_NSWMM_dig_gas_gap(0), - m_NSWMM_dig_channel(0), - m_NSWMM_dig_time(0), - m_NSWMM_dig_charge(0), - m_NSWMM_dig_stripPosition(0), - m_NSWMM_dig_stripLposX(0), - m_NSWMM_dig_stripLposY(0), - m_NSWMM_dig_stripGposX(0), - m_NSWMM_dig_stripGposY(0), - m_NSWMM_dig_stripGposZ(0), - m_NSWMM_dig_sr_time(0), - m_NSWMM_dig_sr_charge(0), - m_NSWMM_dig_sr_stripPosition(0), - m_NSWMM_dig_sr_stripLposX(0), - m_NSWMM_dig_sr_stripLposY(0), - m_NSWMM_dig_sr_stripGposX(0), - m_NSWMM_dig_sr_stripGposY(0), - m_NSWMM_dig_sr_stripGposZ(0), - m_NSWMM_dig_time_trigger(0), - m_NSWMM_dig_charge_trigger(0), - m_NSWMM_dig_position_trigger(0), - m_NSWMM_dig_MMFE_VMM_id_trigger(0), - m_NSWMM_dig_VMM_id_trigger(0) - - { - setHelper(idhelper); - } - - ~MMDigitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMDigitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nDigits{}; - std::vector *m_NSWMM_dig_stationName; - std::vector *m_NSWMM_dig_stationEta; - std::vector *m_NSWMM_dig_stationPhi; - std::vector *m_NSWMM_dig_multiplet; - std::vector *m_NSWMM_dig_gas_gap; - std::vector *m_NSWMM_dig_channel; - - std::vector< std::vector > *m_NSWMM_dig_time; - std::vector< std::vector > *m_NSWMM_dig_charge; - std::vector< std::vector > *m_NSWMM_dig_stripPosition; - std::vector< std::vector > *m_NSWMM_dig_stripLposX; - std::vector< std::vector > *m_NSWMM_dig_stripLposY; - std::vector< std::vector > *m_NSWMM_dig_stripGposX; - std::vector< std::vector > *m_NSWMM_dig_stripGposY; - std::vector< std::vector > *m_NSWMM_dig_stripGposZ; - std::vector< std::vector > *m_NSWMM_dig_sr_time; - std::vector< std::vector > *m_NSWMM_dig_sr_charge; - std::vector< std::vector > *m_NSWMM_dig_sr_stripPosition; - std::vector< std::vector > *m_NSWMM_dig_sr_stripLposX; - std::vector< std::vector > *m_NSWMM_dig_sr_stripLposY; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposX; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposY; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposZ; - - std::vector< std::vector > *m_NSWMM_dig_time_trigger; - std::vector< std::vector > *m_NSWMM_dig_charge_trigger; - std::vector< std::vector > *m_NSWMM_dig_position_trigger; - std::vector< std::vector > *m_NSWMM_dig_MMFE_VMM_id_trigger; - std::vector< std::vector > *m_NSWMM_dig_VMM_id_trigger; - -}; - -#endif // MMDIGITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx deleted file mode 100644 index 29b7a3ab85d..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx +++ /dev/null @@ -1,290 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/MMPrepDataContainer.h" -#include "MuonPrepRawData/MMPrepData.h" - -#include "MuonRDO/MM_RawDataContainer.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MMRDOVariables.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" -#include // for Form - -#include "TTree.h" - - -StatusCode MMPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWMMPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - CHECK( this->clearVariables() ); - - const Muon::MMPrepDataContainer *nsw_MMPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MMPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_MMPrepDataContainer->size()==0) ATH_MSG_WARNING(" MM PRD Container empty "); - - const Muon::MM_RawDataContainer* rdo_container = nullptr; - CHECK( m_evtStore->retrieve(rdo_container, "MMRDO") ); // retrieve RDOs to get information per strip since PRDs only contain ids of strips - - if(rdo_container->size()==0) ATH_MSG_WARNING(" RDO Container empty "); - - for(const Muon::MMPrepDataCollection* coll : *nsw_MMPrepDataContainer) { - - const Muon::MM_RawDataCollection* rdo_coll = rdo_container->indexFindPtr(coll->identifyHash()); - if(rdo_coll==nullptr){ - ATH_MSG_ERROR("Did not find rdo collection " << coll->identifyHash()); - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG("Found rdo_coll at "<size(); item++) { - const Muon::MMPrepData* prd = coll->at(item); - Identifier Id = prd->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas PRD Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - ATH_MSG_DEBUG( " MM channel " << channel << " prd->time() " << prd->time() ); - - m_NSWMM_prd_stationName->push_back(stName); - m_NSWMM_prd_stationEta->push_back(stationEta); - m_NSWMM_prd_stationPhi->push_back(stationPhi); - m_NSWMM_prd_multiplet->push_back(multiplet); - m_NSWMM_prd_gas_gap->push_back(gas_gap); - m_NSWMM_prd_channel->push_back(channel); - m_NSWMM_prd_time->push_back(prd->time()); - - const MuonGM::MMReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nMMPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - const Amg::MatrixX & cov = prd->localCovariance(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - ATH_MSG_DEBUG( "MicroMegas PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); - - m_NSWMM_prd_globalPosX->push_back(pos.x()); - m_NSWMM_prd_globalPosY->push_back(pos.y()); - m_NSWMM_prd_globalPosZ->push_back(pos.z()); - - m_NSWMM_prd_localPosX->push_back(loc_pos[0]); - m_NSWMM_prd_localPosY->push_back(loc_pos[1]); - m_NSWMM_prd_covMatrix_1_1->push_back(cov(0,0)); - - m_NSWMM_prd_rdos_charge->push_back(std::vector()); - m_NSWMM_prd_rdos_time->push_back(std::vector()); - m_NSWMM_prd_rdos_channel->push_back(std::vector()); - m_NSWMM_prd_nRdos->push_back((prd->rdoList()).size()); - - for(const Identifier &id_rdo:prd->rdoList()){ - const Muon::MM_RawData* rdo=nullptr; - for(auto it :*rdo_coll){if(it->identify() == id_rdo) rdo=it;} - if(rdo==nullptr){ - ATH_MSG_ERROR("Did not find rdo for identifier in rdo list"); - return StatusCode::FAILURE; - } - m_NSWMM_prd_rdos_charge->back().push_back(rdo->charge()); - m_NSWMM_prd_rdos_time->back().push_back(rdo->time()); - m_NSWMM_prd_rdos_channel->back().push_back(m_MmIdHelper->channel(id_rdo)); - - } - - m_NSWMM_prd_uTPCAngle->push_back(prd->angle()); - m_nsw_prd_uTPCChiSqProb->push_back(prd->chisqProb()); - - - - - - m_NSWMM_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nPRDs << " MicroMegas PRD's"); - return StatusCode::SUCCESS; -} - -void MMPRDVariables::deleteVariables() -{ - ATH_MSG_DEBUG("begin of deleteVariables()"); - delete m_NSWMM_prd_stationName; - delete m_NSWMM_prd_stationEta; - delete m_NSWMM_prd_stationPhi; - delete m_NSWMM_prd_multiplet; - delete m_NSWMM_prd_gas_gap; - delete m_NSWMM_prd_channel; - delete m_NSWMM_prd_time; - - delete m_NSWMM_prd_globalPosX; - delete m_NSWMM_prd_globalPosY; - delete m_NSWMM_prd_globalPosZ; - - delete m_NSWMM_prd_localPosX; - delete m_NSWMM_prd_localPosY; - delete m_NSWMM_prd_covMatrix_1_1; - - delete m_NSWMM_prd_rdos_charge; - delete m_NSWMM_prd_rdos_time; - delete m_NSWMM_prd_rdos_channel; - delete m_NSWMM_prd_nRdos; - - delete m_NSWMM_prd_uTPCAngle; - delete m_nsw_prd_uTPCChiSqProb; - - - - m_NSWMM_nPRDs = 0; - - m_NSWMM_prd_stationName= nullptr; - m_NSWMM_prd_stationEta = nullptr; - m_NSWMM_prd_stationPhi = nullptr; - m_NSWMM_prd_multiplet = nullptr; - m_NSWMM_prd_gas_gap = nullptr; - m_NSWMM_prd_channel = nullptr; - m_NSWMM_prd_time = nullptr; - - m_NSWMM_prd_globalPosX = nullptr; - m_NSWMM_prd_globalPosY = nullptr; - m_NSWMM_prd_globalPosZ = nullptr; - - m_NSWMM_prd_localPosX = nullptr; - m_NSWMM_prd_localPosY = nullptr; - m_NSWMM_prd_covMatrix_1_1 = nullptr; - - m_NSWMM_prd_rdos_charge=nullptr; - m_NSWMM_prd_rdos_time=nullptr; - m_NSWMM_prd_rdos_channel=nullptr; - m_NSWMM_prd_nRdos=nullptr; - - m_NSWMM_prd_uTPCAngle=nullptr; - m_nsw_prd_uTPCChiSqProb=nullptr; - - ATH_MSG_DEBUG("end of deleteVariables()"); - - return; -} - - -StatusCode MMPRDVariables::clearVariables() -{ - ATH_MSG_DEBUG("beginninng of clearVariables()"); - m_NSWMM_nPRDs = 0; - m_NSWMM_prd_stationName->clear(); - m_NSWMM_prd_stationEta->clear(); - m_NSWMM_prd_stationPhi->clear(); - m_NSWMM_prd_multiplet->clear(); - m_NSWMM_prd_gas_gap->clear(); - m_NSWMM_prd_channel->clear(); - m_NSWMM_prd_time->clear(); - - m_NSWMM_prd_globalPosX->clear(); - m_NSWMM_prd_globalPosY->clear(); - m_NSWMM_prd_globalPosZ->clear(); - - m_NSWMM_prd_localPosX->clear(); - m_NSWMM_prd_localPosY->clear(); - m_NSWMM_prd_covMatrix_1_1->clear(); - - m_NSWMM_prd_rdos_charge->clear(); - m_NSWMM_prd_rdos_time->clear(); - m_NSWMM_prd_rdos_channel->clear(); - m_NSWMM_prd_nRdos->clear(); - m_NSWMM_prd_uTPCAngle->clear(); - m_nsw_prd_uTPCChiSqProb->clear(); - - - ATH_MSG_DEBUG("end of clearVariables()"); - - return StatusCode::SUCCESS; -} - - -StatusCode MMPRDVariables::initializeVariables() -{ - ATH_MSG_DEBUG("begin initializeVariables()"); - m_NSWMM_nPRDs = 0; - m_NSWMM_prd_stationName = new std::vector(); - m_NSWMM_prd_stationEta = new std::vector(); - m_NSWMM_prd_stationPhi = new std::vector(); - m_NSWMM_prd_multiplet = new std::vector(); - m_NSWMM_prd_gas_gap = new std::vector(); - m_NSWMM_prd_channel = new std::vector(); - m_NSWMM_prd_time = new std::vector(); - - m_NSWMM_prd_globalPosX = new std::vector(); - m_NSWMM_prd_globalPosY = new std::vector(); - m_NSWMM_prd_globalPosZ = new std::vector(); - - m_NSWMM_prd_localPosX = new std::vector(); - m_NSWMM_prd_localPosY = new std::vector(); - m_NSWMM_prd_covMatrix_1_1 = new std::vector(); - - m_NSWMM_prd_rdos_charge = new std::vector>(); - m_NSWMM_prd_rdos_time = new std::vector>(); - m_NSWMM_prd_rdos_channel = new std::vector>(); - m_NSWMM_prd_nRdos = new std::vector(); - - m_NSWMM_prd_uTPCAngle = new std::vector(); - m_nsw_prd_uTPCChiSqProb = new std::vector(); - - - ATH_MSG_DEBUG("did init of vars initializeVariables()"); - - if(m_tree) { - m_tree->Branch("PRD_MM", &m_NSWMM_nPRDs, "PRDs_MM_n/i"); - m_tree->Branch("PRD_MM_stationName", &m_NSWMM_prd_stationName); - m_tree->Branch("PRD_MM_stationEta", &m_NSWMM_prd_stationEta); - m_tree->Branch("PRD_MM_stationPhi", &m_NSWMM_prd_stationPhi); - m_tree->Branch("PRD_MM_multiplet", &m_NSWMM_prd_multiplet); - m_tree->Branch("PRD_MM_gas_gap", &m_NSWMM_prd_gas_gap); - m_tree->Branch("PRD_MM_channel", &m_NSWMM_prd_channel); - m_tree->Branch("PRD_MM_time", &m_NSWMM_prd_time); - - m_tree->Branch("PRD_MM_globalPosX", &m_NSWMM_prd_globalPosX); - m_tree->Branch("PRD_MM_globalPosY", &m_NSWMM_prd_globalPosY); - m_tree->Branch("PRD_MM_globalPosZ", &m_NSWMM_prd_globalPosZ); - - m_tree->Branch("PRD_MM_localPosX", &m_NSWMM_prd_localPosX); - m_tree->Branch("PRD_MM_localPosY", &m_NSWMM_prd_localPosY); - m_tree->Branch("PRD_MM_covMatrix_1_1", &m_NSWMM_prd_covMatrix_1_1); - - - m_tree->Branch("PRD_MM_rdos_charge", &m_NSWMM_prd_rdos_charge); - m_tree->Branch("PRD_MM_rdos_time", &m_NSWMM_prd_rdos_time); - m_tree->Branch("PRD_MM_rdos_channel", &m_NSWMM_prd_rdos_channel); - m_tree->Branch("PRD_MM_nRdos", &m_NSWMM_prd_nRdos); - - m_tree->Branch("PRD_MM_uTPCAngle",&m_NSWMM_prd_uTPCAngle); - m_tree->Branch("PRD_MM_uTPCChiSqProb",&m_nsw_prd_uTPCChiSqProb); - - - ATH_MSG_DEBUG("did init of tree initializeVariables()"); - - } - - ATH_MSG_DEBUG("after init of tree initializeVariables()"); - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h deleted file mode 100644 index 98c82dab4d5..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMPRDVARIABLES_H -#define MMPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMPRDVariables : public ValAlgVariables -{ - public: - MMPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nPRDs(0), - m_NSWMM_prd_stationName(0), - m_NSWMM_prd_stationEta(0), - m_NSWMM_prd_stationPhi(0), - m_NSWMM_prd_multiplet(0), - m_NSWMM_prd_gas_gap(0), - m_NSWMM_prd_channel(0), - m_NSWMM_prd_time(0), - m_NSWMM_prd_globalPosX(0), - m_NSWMM_prd_globalPosY(0), - m_NSWMM_prd_globalPosZ(0), - m_NSWMM_prd_localPosX(0), - m_NSWMM_prd_localPosY(0), - m_NSWMM_prd_covMatrix_1_1(0), - m_NSWMM_prd_rdos_charge(0), - m_NSWMM_prd_rdos_time(0), - m_NSWMM_prd_rdos_channel(0), - m_NSWMM_prd_nRdos(0), - m_NSWMM_prd_uTPCAngle(0), - m_nsw_prd_uTPCChiSqProb(0) - { - setHelper(idhelper); - } - - ~MMPRDVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting exception in MMPRDVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper; - - int m_NSWMM_nPRDs; - std::vector *m_NSWMM_prd_stationName; - std::vector *m_NSWMM_prd_stationEta; - std::vector *m_NSWMM_prd_stationPhi; - std::vector *m_NSWMM_prd_multiplet; - std::vector *m_NSWMM_prd_gas_gap; - std::vector *m_NSWMM_prd_channel; - std::vector *m_NSWMM_prd_time; - - std::vector *m_NSWMM_prd_globalPosX; - std::vector *m_NSWMM_prd_globalPosY; - std::vector *m_NSWMM_prd_globalPosZ; - - std::vector *m_NSWMM_prd_localPosX; - std::vector *m_NSWMM_prd_localPosY; - std::vector *m_NSWMM_prd_covMatrix_1_1; - - std::vector> *m_NSWMM_prd_rdos_charge; - std::vector> *m_NSWMM_prd_rdos_time; - std::vector> *m_NSWMM_prd_rdos_channel; - std::vector *m_NSWMM_prd_nRdos; - - std::vector* m_NSWMM_prd_uTPCAngle; - std::vector* m_nsw_prd_uTPCChiSqProb; - - - -}; - -#endif // MMPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx deleted file mode 100644 index d6c8a523d31..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx +++ /dev/null @@ -1,218 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMRDOVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/MM_RawDataContainer.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "TTree.h" -#include // for Form - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode MMRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWMMRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - // get the rdo (a container corresponds to a multilayer of a module) - const MM_RawDataContainer* rdo_container = nullptr; - CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" MM RDO Container empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(auto it : *rdo_container) { - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - const MM_RawDataCollection* coll = it; - - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const MM_RawData* rdo = coll->at(item); - Identifier Id = rdo->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - ATH_MSG_DEBUG( "MicroMegas RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWMM_rdo_stationName->push_back(stName); - m_NSWMM_rdo_stationEta->push_back(stationEta); - m_NSWMM_rdo_stationPhi->push_back(stationPhi); - m_NSWMM_rdo_multiplet->push_back(multiplet); - m_NSWMM_rdo_gas_gap->push_back(gas_gap); - m_NSWMM_rdo_channel->push_back(channel); - m_NSWMM_rdo_time->push_back(rdo->time()); - m_NSWMM_rdo_relBcid->push_back(rdo->relBcid()); - m_NSWMM_rdo_charge->push_back(rdo->charge()); - - // get the readout element class where the RDO is recorded - int isSmall = (stName[2] == 'S'); - const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nMMRDOVariables::fillVariables() - Failed to retrieve MMReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_NSWMM_rdo_localPosX->push_back(localStripPos.x()); - m_NSWMM_rdo_localPosY->push_back(localStripPos.y()); - ATH_MSG_DEBUG("MM RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("MM RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_NSWMM_rdo_globalPosX->push_back(globalStripPos.x()); - m_NSWMM_rdo_globalPosY->push_back(globalStripPos.y()); - m_NSWMM_rdo_globalPosZ->push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_NSWMM_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nrdo << " MicroMegas rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode MMRDOVariables::clearVariables() -{ - m_NSWMM_nrdo = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWMM_rdo - m_NSWMM_rdo_stationName->clear(); - m_NSWMM_rdo_stationEta->clear(); - m_NSWMM_rdo_stationPhi->clear(); - m_NSWMM_rdo_multiplet->clear(); - m_NSWMM_rdo_gas_gap->clear(); - m_NSWMM_rdo_channel->clear(); - m_NSWMM_rdo_time->clear(); - m_NSWMM_rdo_relBcid->clear(); - m_NSWMM_rdo_charge->clear(); - - m_NSWMM_rdo_globalPosX->clear(); - m_NSWMM_rdo_globalPosY->clear(); - m_NSWMM_rdo_globalPosZ->clear(); - - m_NSWMM_rdo_localPosX->clear(); - m_NSWMM_rdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode MMRDOVariables::initializeVariables() -{ - - m_NSWMM_nrdo = 0; - m_NSWMM_rdo_stationName = new std::vector(); - m_NSWMM_rdo_stationEta = new std::vector(); - m_NSWMM_rdo_stationPhi = new std::vector(); - m_NSWMM_rdo_multiplet = new std::vector(); - m_NSWMM_rdo_gas_gap = new std::vector(); - m_NSWMM_rdo_channel = new std::vector(); - m_NSWMM_rdo_time = new std::vector(); - m_NSWMM_rdo_relBcid = new std::vector(); - m_NSWMM_rdo_charge = new std::vector(); - - m_NSWMM_rdo_localPosX = new std::vector(); - m_NSWMM_rdo_localPosY = new std::vector(); - - m_NSWMM_rdo_globalPosX = new std::vector(); - m_NSWMM_rdo_globalPosY = new std::vector(); - m_NSWMM_rdo_globalPosZ = new std::vector(); - - - if(m_tree) { - m_tree->Branch("RDO_MM_n", &m_NSWMM_nrdo); - m_tree->Branch("RDO_MM_stationName", &m_NSWMM_rdo_stationName); - m_tree->Branch("RDO_MM_stationEta", &m_NSWMM_rdo_stationEta); - m_tree->Branch("RDO_MM_stationPhi", &m_NSWMM_rdo_stationPhi); - m_tree->Branch("RDO_MM_multiplet", &m_NSWMM_rdo_multiplet); - m_tree->Branch("RDO_MM_gas_gap", &m_NSWMM_rdo_gas_gap); - m_tree->Branch("RDO_MM_channel", &m_NSWMM_rdo_channel); - m_tree->Branch("RDO_MM_time", &m_NSWMM_rdo_time); - m_tree->Branch("RDO_MM_relBcid", &m_NSWMM_rdo_relBcid); - m_tree->Branch("RDO_MM_charge", &m_NSWMM_rdo_charge); - - m_tree->Branch("RDO_MM_localPosX", &m_NSWMM_rdo_localPosX); - m_tree->Branch("RDO_MM_localPosY", &m_NSWMM_rdo_localPosY); - - m_tree->Branch("RDO_MM_globalPosX", &m_NSWMM_rdo_globalPosX); - m_tree->Branch("RDO_MM_globalPosY", &m_NSWMM_rdo_globalPosY); - m_tree->Branch("RDO_MM_globalPosZ", &m_NSWMM_rdo_globalPosZ); - - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void MMRDOVariables::deleteVariables() -{ - delete m_NSWMM_rdo_stationName; - delete m_NSWMM_rdo_stationEta; - delete m_NSWMM_rdo_stationPhi; - delete m_NSWMM_rdo_multiplet; - delete m_NSWMM_rdo_gas_gap; - delete m_NSWMM_rdo_channel; - delete m_NSWMM_rdo_time; - delete m_NSWMM_rdo_relBcid; - delete m_NSWMM_rdo_charge; - delete m_NSWMM_rdo_localPosX; - delete m_NSWMM_rdo_localPosY; - delete m_NSWMM_rdo_globalPosX; - delete m_NSWMM_rdo_globalPosY; - delete m_NSWMM_rdo_globalPosZ; - - - m_NSWMM_nrdo = 0; - m_NSWMM_rdo_stationName = nullptr; - m_NSWMM_rdo_stationEta = nullptr; - m_NSWMM_rdo_stationPhi = nullptr; - m_NSWMM_rdo_multiplet = nullptr; - m_NSWMM_rdo_gas_gap = nullptr; - m_NSWMM_rdo_channel = nullptr; - m_NSWMM_rdo_time = nullptr; - m_NSWMM_rdo_relBcid = nullptr; - m_NSWMM_rdo_charge = nullptr; - m_NSWMM_rdo_localPosX = nullptr; - m_NSWMM_rdo_localPosY = nullptr; - m_NSWMM_rdo_globalPosX = nullptr; - m_NSWMM_rdo_globalPosY = nullptr; - m_NSWMM_rdo_globalPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h deleted file mode 100644 index 1ac7a1fbe2b..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMRDOVARIABLES_H -#define MMRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMRDOVariables : public ValAlgVariables -{ - public: - MMRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nrdo(0), - m_NSWMM_rdo_stationName(0), - m_NSWMM_rdo_stationEta(0), - m_NSWMM_rdo_stationPhi(0), - m_NSWMM_rdo_multiplet(0), - m_NSWMM_rdo_gas_gap(0), - m_NSWMM_rdo_channel(0), - m_NSWMM_rdo_time(0), - m_NSWMM_rdo_relBcid(0), - m_NSWMM_rdo_charge(0), - m_NSWMM_rdo_localPosX(0), - m_NSWMM_rdo_localPosY(0), - m_NSWMM_rdo_globalPosX(0), - m_NSWMM_rdo_globalPosY(0), - m_NSWMM_rdo_globalPosZ(0) - { - setHelper(idhelper); - } - - ~MMRDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMRDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper; - - int m_NSWMM_nrdo; - std::vector *m_NSWMM_rdo_stationName; - std::vector *m_NSWMM_rdo_stationEta; - std::vector *m_NSWMM_rdo_stationPhi; - std::vector *m_NSWMM_rdo_multiplet; - std::vector *m_NSWMM_rdo_gas_gap; - std::vector *m_NSWMM_rdo_channel; - std::vector *m_NSWMM_rdo_time; - std::vector *m_NSWMM_rdo_relBcid; - std::vector *m_NSWMM_rdo_charge; - - std::vector *m_NSWMM_rdo_localPosX; - std::vector *m_NSWMM_rdo_localPosY; - std::vector *m_NSWMM_rdo_globalPosX; - std::vector *m_NSWMM_rdo_globalPosY; - std::vector *m_NSWMM_rdo_globalPosZ; -}; - -#endif // MMRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx deleted file mode 100644 index 9bfbc8faa85..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMSDOVariables.h" - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "TTree.h" - - -StatusCode MMSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWMMSDOVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG( "Retrieve MM SDO container with name = " << m_ContainerName.c_str() ); - const MuonSimDataCollection* nsw_MmSdoContainer = nullptr; - ATH_CHECK( m_evtStore->retrieve(nsw_MmSdoContainer, m_ContainerName.c_str()) ); - - for ( const auto& coll : *nsw_MmSdoContainer ) { - - Identifier Id = coll.first; - const MuonSimData mm_sdo = coll.second; - - // Get information on the SDO - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas SDO: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - m_NSWMM_sdo_stationName->push_back(stName); - m_NSWMM_sdo_stationEta->push_back(stationEta); - m_NSWMM_sdo_stationPhi->push_back(stationPhi); - m_NSWMM_sdo_multiplet->push_back(multiplet); - m_NSWMM_sdo_gas_gap->push_back(gas_gap); - m_NSWMM_sdo_channel->push_back(channel); - - ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); - std::vector deposits; - mm_sdo.deposits(deposits); - - const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); - m_NSWMM_sdo_globalPosX->push_back( hit_gpos.x() ); - m_NSWMM_sdo_globalPosY->push_back( hit_gpos.y() ); - m_NSWMM_sdo_globalPosZ->push_back( hit_gpos.z() ); - - m_NSWMM_sdo_globaltime->push_back( mm_sdo.getTime() ); - m_NSWMM_sdo_word->push_back( mm_sdo.word() ); - - // use the information of the first deposit - int barcode = deposits[0].first.barcode(); - double MuonMCdata_firstentry = deposits[0].second.firstEntry(); - double MuonMCdata_secondentry = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("MicroMegas SDO barcode=" << barcode); - ATH_MSG_DEBUG("MicroMegas SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry - << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); - - m_NSWMM_sdo_barcode->push_back( barcode ); - m_NSWMM_sdo_localPosX->push_back( MuonMCdata_firstentry ); - m_NSWMM_sdo_localPosY->push_back( MuonMCdata_secondentry ); - - m_NSWMM_nsdo++; - } - - ATH_MSG_DEBUG("Processed " << m_NSWMM_nsdo << " MicroMegas SDOs"); - return StatusCode::SUCCESS; -} - - -void MMSDOVariables::deleteVariables() -{ - delete m_NSWMM_sdo_stationName; - delete m_NSWMM_sdo_stationEta; - delete m_NSWMM_sdo_stationPhi; - delete m_NSWMM_sdo_multiplet; - delete m_NSWMM_sdo_gas_gap; - delete m_NSWMM_sdo_channel; - - delete m_NSWMM_sdo_word; - delete m_NSWMM_sdo_barcode; - delete m_NSWMM_sdo_globalPosX; - delete m_NSWMM_sdo_globalPosY; - delete m_NSWMM_sdo_globalPosZ; - delete m_NSWMM_sdo_globaltime; - - delete m_NSWMM_sdo_localPosX; - delete m_NSWMM_sdo_localPosY; - - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName= nullptr; - m_NSWMM_sdo_stationEta = nullptr; - m_NSWMM_sdo_stationPhi = nullptr; - m_NSWMM_sdo_multiplet = nullptr; - m_NSWMM_sdo_gas_gap = nullptr; - m_NSWMM_sdo_channel = nullptr; - - m_NSWMM_sdo_word = nullptr; - m_NSWMM_sdo_barcode = nullptr; - m_NSWMM_sdo_globalPosX = nullptr; - m_NSWMM_sdo_globalPosY = nullptr; - m_NSWMM_sdo_globalPosZ = nullptr; - m_NSWMM_sdo_globaltime = nullptr; - - m_NSWMM_sdo_localPosX = nullptr; - m_NSWMM_sdo_localPosY = nullptr; - - return; -} - - -StatusCode MMSDOVariables::clearVariables() -{ - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName->clear(); - m_NSWMM_sdo_stationEta->clear(); - m_NSWMM_sdo_stationPhi->clear(); - m_NSWMM_sdo_multiplet->clear(); - m_NSWMM_sdo_gas_gap->clear(); - m_NSWMM_sdo_channel->clear(); - - m_NSWMM_sdo_word->clear(); - m_NSWMM_sdo_barcode->clear(); - m_NSWMM_sdo_globalPosX->clear(); - m_NSWMM_sdo_globalPosY->clear(); - m_NSWMM_sdo_globalPosZ->clear(); - m_NSWMM_sdo_globaltime->clear(); - m_NSWMM_sdo_localPosX->clear(); - m_NSWMM_sdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode MMSDOVariables::initializeVariables() -{ - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName = new std::vector(); - m_NSWMM_sdo_stationEta = new std::vector(); - m_NSWMM_sdo_stationPhi = new std::vector(); - m_NSWMM_sdo_multiplet = new std::vector(); - m_NSWMM_sdo_gas_gap = new std::vector(); - m_NSWMM_sdo_channel = new std::vector(); - - m_NSWMM_sdo_word = new std::vector(); - m_NSWMM_sdo_barcode = new std::vector(); - m_NSWMM_sdo_globalPosX = new std::vector(); - m_NSWMM_sdo_globalPosY = new std::vector(); - m_NSWMM_sdo_globalPosZ = new std::vector(); - m_NSWMM_sdo_globaltime = new std::vector(); - - m_NSWMM_sdo_localPosX = new std::vector(); - m_NSWMM_sdo_localPosY = new std::vector(); - - if(m_tree) { - m_tree->Branch("SDO_MM", &m_NSWMM_nsdo, "SDOs_MM_n/i"); - m_tree->Branch("SDO_MM_stationName", &m_NSWMM_sdo_stationName); - m_tree->Branch("SDO_MM_stationEta", &m_NSWMM_sdo_stationEta); - m_tree->Branch("SDO_MM_stationPhi", &m_NSWMM_sdo_stationPhi); - m_tree->Branch("SDO_MM_multiplet", &m_NSWMM_sdo_multiplet); - m_tree->Branch("SDO_MM_gas_gap", &m_NSWMM_sdo_gas_gap); - m_tree->Branch("SDO_MM_channel", &m_NSWMM_sdo_channel); - - m_tree->Branch("SDO_MM_word", &m_NSWMM_sdo_word); - m_tree->Branch("SDO_MM_barcode", &m_NSWMM_sdo_barcode); - m_tree->Branch("SDO_MM_globalPosX", &m_NSWMM_sdo_globalPosX); - m_tree->Branch("SDO_MM_globalPosY", &m_NSWMM_sdo_globalPosY); - m_tree->Branch("SDO_MM_globalPosZ", &m_NSWMM_sdo_globalPosZ); - m_tree->Branch("SDO_MM_global_time", &m_NSWMM_sdo_globaltime); - m_tree->Branch("SDO_MM_localPosX", &m_NSWMM_sdo_localPosX); - m_tree->Branch("SDO_MM_localPosY", &m_NSWMM_sdo_localPosY); - - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h deleted file mode 100644 index 240bea977d0..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMSDOVARIABLES_H -#define MMSDOVARIABLES_H - -#include - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" - -class MMSDOVariables : public ValAlgVariables -{ - public: - MMSDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nsdo(0), - m_NSWMM_sdo_stationName(0), - m_NSWMM_sdo_stationEta(0), - m_NSWMM_sdo_stationPhi(0), - m_NSWMM_sdo_multiplet(0), - m_NSWMM_sdo_gas_gap(0), - m_NSWMM_sdo_channel(0), - m_NSWMM_sdo_word(0), - m_NSWMM_sdo_barcode(0), - m_NSWMM_sdo_globalPosX(0), - m_NSWMM_sdo_globalPosY(0), - m_NSWMM_sdo_globalPosZ(0), - m_NSWMM_sdo_globaltime(0), - m_NSWMM_sdo_localPosX(0), - m_NSWMM_sdo_localPosY(0) - { - setHelper(idhelper); - } - - ~MMSDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Bad cast in MMSDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nsdo{}; - std::vector *m_NSWMM_sdo_stationName; - std::vector *m_NSWMM_sdo_stationEta; - std::vector *m_NSWMM_sdo_stationPhi; - std::vector *m_NSWMM_sdo_multiplet; - std::vector *m_NSWMM_sdo_gas_gap; - std::vector *m_NSWMM_sdo_channel; - - std::vector *m_NSWMM_sdo_word; - std::vector *m_NSWMM_sdo_barcode; - std::vector *m_NSWMM_sdo_globalPosX; - std::vector *m_NSWMM_sdo_globalPosY; - std::vector *m_NSWMM_sdo_globalPosZ; - std::vector *m_NSWMM_sdo_globaltime; - - std::vector *m_NSWMM_sdo_localPosX; - std::vector *m_NSWMM_sdo_localPosY; - -}; - -#endif // MMSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx deleted file mode 100644 index c9812093bdb..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx +++ /dev/null @@ -1,340 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMSimHitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimEvent/MMSimHitCollection.h" -#include "MuonSimEvent/MM_SimIdToOfflineId.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "MuonAGDDDescription/MMDetectorDescription.h" -#include "MuonAGDDDescription/MMDetectorHelper.h" - -#include "TTree.h" - -StatusCode MMSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - - ATH_MSG_DEBUG("do fillNSWMMHitVariables()"); - - CHECK( this->clearVariables() ); - - const MMSimHitCollection *nswContainer = nullptr; - CHECK( m_evtStore->retrieve(nswContainer, m_ContainerName.c_str()) ); - - // Get the MicroMegas Id hit helper - MicromegasHitIdHelper* hitHelper = MicromegasHitIdHelper::GetHelper(); - MM_SimIdToOfflineId simToOffline(m_MmIdHelper); - - if(!nswContainer->size()) ATH_MSG_DEBUG(m_ContainerName<<" container empty"); - for( const MMSimHit& hit : *nswContainer ) { - - if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - - // connect the hit with the MC truth - int barcode = hit.particleLink().barcode(); - m_NSWMM_trackId.push_back(barcode); - - m_NSWMM_globalTime.push_back(hit.globalTime()); - - const Amg::Vector3D& globalPosition = hit.globalPosition(); - m_NSWMM_hitGlobalPositionX.push_back(globalPosition.x()); - m_NSWMM_hitGlobalPositionY.push_back(globalPosition.y()); - m_NSWMM_hitGlobalPositionZ.push_back(globalPosition.z()); - m_NSWMM_hitGlobalPositionR.push_back(globalPosition.perp()); - m_NSWMM_hitGlobalPositionP.push_back(globalPosition.phi()); - const Amg::Vector3D& globalDirection = hit.globalDirection(); - m_NSWMM_hitGlobalDirectionX.push_back(globalDirection.x()); - m_NSWMM_hitGlobalDirectionY.push_back(globalDirection.y()); - m_NSWMM_hitGlobalDirectionZ.push_back(globalDirection.z()); - - m_NSWMM_particleEncoding.push_back(hit.particleEncoding()); - m_NSWMM_kineticEnergy.push_back(hit.kineticEnergy()); - m_NSWMM_depositEnergy.push_back(hit.depositEnergy()); - - - // Read the information about the Micro Megas hit - int simId = hit.MMId(); - std::string sim_stationName = hitHelper->GetStationName(simId); - int sim_stationEta = hitHelper->GetZSector(simId); - int sim_stationPhi = hitHelper->GetPhiSector(simId); - int sim_multilayer = hitHelper->GetMultiLayer(simId); - int sim_layer = hitHelper->GetLayer(simId); - int sim_side = hitHelper->GetSide(simId); - - ATH_MSG_DEBUG( "MicroMegas SimHit id: Station Name [" << sim_stationName << "]" - << " Station Eta [" << sim_stationEta << "]" - << " Station Phi [" << sim_stationPhi << "]" - << " MultiLayer [" << sim_multilayer << "]" - << " Layer [" << sim_layer << "]" - << " Side [" << sim_side << "]" ); - - if( sim_stationPhi == 0 ){ - ATH_MSG_ERROR("MicroMegas validation: unexpected phi range " << sim_stationPhi); - return StatusCode::FAILURE; - } - - // Fill Ntuple with SimId data - m_NSWMM_sim_stationName .push_back(sim_stationName); - m_NSWMM_sim_stationEta .push_back(sim_stationEta); - m_NSWMM_sim_stationPhi .push_back(sim_stationPhi); - m_NSWMM_sim_multilayer .push_back(sim_multilayer); - m_NSWMM_sim_layer .push_back(sim_layer); - m_NSWMM_sim_side .push_back(sim_side); - - - // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. - Identifier offId = simToOffline.convert(hit.MMId()); - - // sanity checks - if( !m_MmIdHelper->is_mm(offId) ){ - ATH_MSG_WARNING("MM id is not a mm id! " << m_MmIdHelper->print_to_string(offId)); - } - if( !m_MmIdHelper->is_muon(offId) ){ - ATH_MSG_WARNING("MM id is not a muon id! " << m_MmIdHelper->print_to_string(offId)); - } - if( m_MmIdHelper->is_mdt(offId)||m_MmIdHelper->is_rpc(offId)||m_MmIdHelper->is_tgc(offId)||m_MmIdHelper->is_csc(offId)||m_MmIdHelper->is_stgc(offId) ){ - ATH_MSG_WARNING("MM id has wrong technology type! " << m_MmIdHelper->is_mdt(offId) << " " << m_MmIdHelper->is_rpc(offId) - << " " << m_MmIdHelper->is_tgc(offId) << " " << m_MmIdHelper->is_csc(offId) << " " << m_MmIdHelper->is_stgc(offId) ); - } - if( m_MmIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("MM id has bad layer field! " << m_MmIdHelper->print_to_string(offId) ); - } - - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(offId)); - int off_stationEta = m_MmIdHelper->stationEta(offId); - int off_stationPhi = m_MmIdHelper->stationPhi(offId); - int off_multiplet = m_MmIdHelper->multilayer(offId); - int off_gas_gap = m_MmIdHelper->gasGap(offId); - int off_channel = m_MmIdHelper->channel(offId); - - // Get MM_READOUT from MMDetectorDescription - char side = off_stationEta < 0 ? 'C' : 'A'; - char sector_l = stName.substr(2,1)=="L" ? 'L' : 'S'; - MMDetectorHelper aHelper; - MMDetectorDescription* mm = aHelper.Get_MMDetector(sector_l, abs(off_stationEta), off_stationPhi, off_multiplet, side); - MMReadoutParameters roParam = mm->GetReadoutParameters(); - - ATH_MSG_DEBUG( "MicroMegas Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << off_stationEta << "]" - << " Station Phi [" << off_stationPhi << "]" - << " Multiplet [" << off_multiplet << "]" - << " GasGap [" << off_gas_gap << "]" - << " ChNr [" << off_channel << "]" ); - - - int isSmall = stName[2] == 'S'; - ATH_MSG_DEBUG("MicroMegas geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_MmIdHelper->stationEta(offId) - << " phi " << m_MmIdHelper->stationPhi(offId) << " ml " << m_MmIdHelper->multilayer(offId) ); - - const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(offId); - if (!detEl) { - ATH_MSG_ERROR("MMSimHitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<print_to_string(offId).c_str()); - return StatusCode::FAILURE; - } - - // surface - const Trk::PlaneSurface& surf = detEl->surface(offId); - // compute hit position within the detector element/surfaces - Amg::Transform3D gToL = detEl->absTransform().inverse(); - Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); - Amg::Vector3D dSurface_pos = gToL*hpos; - - // compute the hit position on the readout plane (same as in MuonFastDigitization) - Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; - - Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y()); - // double gasGapThickness = detEl->getDesign(offId)->gasGapThickness(); - - // check where the readout plane is located and compute the local direction accordingly - Amg::Vector3D ldir(0., 0., 0.); - ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); - - double scale, scaletop; - double gasgap = 5.; - - scale = -rSurface_pos.z()/ldir.z(); - scaletop = (gasgap+rSurface_pos.z())/ldir.z(); - // scaletop = (fabs(gasGapThickness) + slpos.z())/locdir.z(); - - Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; - Amg::Vector3D hitOnTopSurface = rSurface_pos + scaletop*ldir; - Amg::Vector2D posOnSurf (hitOnSurface.x(), hitOnSurface.y()); - Amg::Vector2D posOnTopSurf (hitOnTopSurface.x(),hitOnTopSurface.y()); - - - int stripNumber = detEl->stripNumber(posOnSurf,offId); - // int LastStripNumber = detEl->stripNumber(posOnTopSurf, offId); - - // perform bound check (making the call from the detector element to consider edge passivation) - //m_NSWMM_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); - m_NSWMM_isInsideBounds.push_back( detEl->insideActiveBounds(offId, posOnSurf) ); - - if( stripNumber == -1 ){ - ATH_MSG_WARNING("MicroMegas validation: failed to obtain strip number " << m_MmIdHelper->print_to_string(offId) ); - ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); - stripNumber = 1; - } - - Identifier oldId = offId; - offId = m_MmIdHelper->channelID(offId, m_MmIdHelper->multilayer(offId), m_MmIdHelper->gasGap(offId),stripNumber); - if( m_MmIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("MicroMegas validation: MM id has bad layer field(2)! " << std::endl << " " << m_MmIdHelper->print_to_string(offId) << std::endl - << " " << m_MmIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); - } - - Amg::Vector2D fastDigitPos(0.,0.); - if( !detEl->stripPosition(offId,fastDigitPos ) ){ - ATH_MSG_WARNING("MicroMegas validation: failed to obtain local position for identifier " << m_MmIdHelper->print_to_string(offId) ); - } - - Amg::Vector3D detpos = detEl->globalPosition(); - ATH_MSG_DEBUG("Global hit : r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() - << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() - << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); - ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); - ATH_MSG_DEBUG("MM Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() - << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); - - - - // Fill Ntuple with offline ID data - m_NSWMM_off_stationName .push_back(stName); - m_NSWMM_off_stationEta .push_back(off_stationEta); - m_NSWMM_off_stationPhi .push_back(off_stationPhi); - m_NSWMM_off_multiplet .push_back(off_multiplet); - m_NSWMM_off_gas_gap .push_back(off_gas_gap); - // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. - // As a temporary solution stripnumber is used directly (also in sTGC) - off_channel = stripNumber; - m_NSWMM_off_channel .push_back(off_channel); - - - // Fill ntuple with the hit/surface/digit positions - m_NSWMM_detector_globalPositionX.push_back( detpos.x() ); - m_NSWMM_detector_globalPositionY.push_back( detpos.y() ); - m_NSWMM_detector_globalPositionZ.push_back( detpos.z() ); - m_NSWMM_detector_globalPositionR.push_back( detpos.perp() ); - m_NSWMM_detector_globalPositionP.push_back( detpos.phi() ); - - m_NSWMM_hitToDsurfacePositionX.push_back( dSurface_pos.x() ); - m_NSWMM_hitToDsurfacePositionY.push_back( dSurface_pos.y() ); - m_NSWMM_hitToDsurfacePositionZ.push_back( dSurface_pos.z() ); - - m_NSWMM_hitToRsurfacePositionX.push_back( rSurface_pos.x() ); - m_NSWMM_hitToRsurfacePositionY.push_back( rSurface_pos.y() ); - m_NSWMM_hitToRsurfacePositionZ.push_back( rSurface_pos.z() ); - - m_NSWMM_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); - m_NSWMM_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); - - ATH_MSG_DEBUG("---------- Hit processing ends!"); - - m_NSWMM_nSimHits++; - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nSimHits << " MicroMegas hits"); - return StatusCode::SUCCESS; -} - - -StatusCode MMSimHitVariables::clearVariables() -{ - m_NSWMM_nSimHits = 0; - m_NSWMM_trackId.clear(); - m_NSWMM_globalTime.clear(); - m_NSWMM_isInsideBounds.clear(); - m_NSWMM_hitGlobalPositionX.clear(); - m_NSWMM_hitGlobalPositionY.clear(); - m_NSWMM_hitGlobalPositionZ.clear(); - m_NSWMM_hitGlobalPositionR.clear(); - m_NSWMM_hitGlobalPositionP.clear(); - m_NSWMM_hitGlobalDirectionX.clear(); - m_NSWMM_hitGlobalDirectionY.clear(); - m_NSWMM_hitGlobalDirectionZ.clear(); - m_NSWMM_detector_globalPositionX.clear(); - m_NSWMM_detector_globalPositionY.clear(); - m_NSWMM_detector_globalPositionZ.clear(); - m_NSWMM_detector_globalPositionR.clear(); - m_NSWMM_detector_globalPositionP.clear(); - m_NSWMM_hitToDsurfacePositionX.clear(); - m_NSWMM_hitToDsurfacePositionY.clear(); - m_NSWMM_hitToDsurfacePositionZ.clear(); - m_NSWMM_hitToRsurfacePositionX.clear(); - m_NSWMM_hitToRsurfacePositionY.clear(); - m_NSWMM_hitToRsurfacePositionZ.clear(); - m_NSWMM_FastDigitRsurfacePositionX.clear(); - m_NSWMM_FastDigitRsurfacePositionY.clear(); - m_NSWMM_particleEncoding.clear(); - m_NSWMM_kineticEnergy.clear(); - m_NSWMM_depositEnergy.clear(); - m_NSWMM_sim_stationName.clear(); - m_NSWMM_sim_stationEta.clear(); - m_NSWMM_sim_stationPhi.clear(); - m_NSWMM_sim_multilayer.clear(); - m_NSWMM_sim_layer.clear(); - m_NSWMM_sim_side.clear(); - m_NSWMM_off_stationName.clear(); - m_NSWMM_off_stationEta.clear(); - m_NSWMM_off_stationPhi.clear(); - m_NSWMM_off_multiplet.clear(); - m_NSWMM_off_gas_gap.clear(); - m_NSWMM_off_channel.clear(); - return StatusCode::SUCCESS; -} - -void MMSimHitVariables::deleteVariables() -{ - return; -} - -StatusCode MMSimHitVariables::initializeVariables() -{ - if(m_tree) { - m_tree->Branch("Hits_MM_n", &m_NSWMM_nSimHits, "Hits_MM_n/i"); - m_tree->Branch("Hits_MM_trackId", &m_NSWMM_trackId); - m_tree->Branch("Hits_MM_globalTime", &m_NSWMM_globalTime); - m_tree->Branch("Hits_MM_isInsideBounds", &m_NSWMM_isInsideBounds); - m_tree->Branch("Hits_MM_hitGlobalPositionX", &m_NSWMM_hitGlobalPositionX); - m_tree->Branch("Hits_MM_hitGlobalPositionY", &m_NSWMM_hitGlobalPositionY); - m_tree->Branch("Hits_MM_hitGlobalPositionZ", &m_NSWMM_hitGlobalPositionZ); - m_tree->Branch("Hits_MM_hitGlobalPositionR", &m_NSWMM_hitGlobalPositionR); - m_tree->Branch("Hits_MM_hitGlobalPositionP", &m_NSWMM_hitGlobalPositionP); - m_tree->Branch("Hits_MM_hitGlobalDirectionX", &m_NSWMM_hitGlobalDirectionX); - m_tree->Branch("Hits_MM_hitGlobalDirectionY", &m_NSWMM_hitGlobalDirectionY); - m_tree->Branch("Hits_MM_hitGlobalDirectionZ", &m_NSWMM_hitGlobalDirectionZ); - m_tree->Branch("Hits_MM_detector_globalPositionX", &m_NSWMM_detector_globalPositionX); - m_tree->Branch("Hits_MM_detector_globalPositionY", &m_NSWMM_detector_globalPositionY); - m_tree->Branch("Hits_MM_detector_globalPositionZ", &m_NSWMM_detector_globalPositionZ); - m_tree->Branch("Hits_MM_detector_globalPositionR", &m_NSWMM_detector_globalPositionR); - m_tree->Branch("Hits_MM_detector_globalPositionP", &m_NSWMM_detector_globalPositionP); - m_tree->Branch("Hits_MM_hitToDsurfacePositionX", &m_NSWMM_hitToDsurfacePositionX); - m_tree->Branch("Hits_MM_hitToDsurfacePositionY", &m_NSWMM_hitToDsurfacePositionY); - m_tree->Branch("Hits_MM_hitToDsurfacePositionZ", &m_NSWMM_hitToDsurfacePositionZ); - m_tree->Branch("Hits_MM_hitToRsurfacePositionX", &m_NSWMM_hitToRsurfacePositionX); - m_tree->Branch("Hits_MM_hitToRsurfacePositionY", &m_NSWMM_hitToRsurfacePositionY); - m_tree->Branch("Hits_MM_hitToRsurfacePositionZ", &m_NSWMM_hitToRsurfacePositionZ); - m_tree->Branch("Hits_MM_FastDigitRsurfacePositionX", &m_NSWMM_FastDigitRsurfacePositionX); - m_tree->Branch("Hits_MM_FastDigitRsurfacePositionY", &m_NSWMM_FastDigitRsurfacePositionY); - m_tree->Branch("Hits_MM_particleEncoding", &m_NSWMM_particleEncoding); - m_tree->Branch("Hits_MM_kineticEnergy", &m_NSWMM_kineticEnergy); - m_tree->Branch("Hits_MM_depositEnergy", &m_NSWMM_depositEnergy); - m_tree->Branch("Hits_MM_sim_stationName", &m_NSWMM_sim_stationName); - m_tree->Branch("Hits_MM_sim_stationEta", &m_NSWMM_sim_stationEta); - m_tree->Branch("Hits_MM_sim_stationPhi", &m_NSWMM_sim_stationPhi); - m_tree->Branch("Hits_MM_sim_multilayer", &m_NSWMM_sim_multilayer); - m_tree->Branch("Hits_MM_sim_layer", &m_NSWMM_sim_layer); - m_tree->Branch("Hits_MM_sim_side", &m_NSWMM_sim_side); - m_tree->Branch("Hits_MM_off_stationName", &m_NSWMM_off_stationName); - m_tree->Branch("Hits_MM_off_stationEta", &m_NSWMM_off_stationEta); - m_tree->Branch("Hits_MM_off_stationPhi", &m_NSWMM_off_stationPhi); - m_tree->Branch("Hits_MM_off_multiplet", &m_NSWMM_off_multiplet); - m_tree->Branch("Hits_MM_off_gas_gap", &m_NSWMM_off_gas_gap); - m_tree->Branch("Hits_MM_off_channel", &m_NSWMM_off_channel); - } - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h deleted file mode 100644 index b2c4ab2fa20..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMSIMHITVARIABLES_H -#define MMSIMHITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMSimHitVariables : public ValAlgVariables -{ - public: - MMSimHitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(nullptr), - m_NSWMM_nSimHits(0), - m_NSWMM_trackId(), - m_NSWMM_isInsideBounds(), - m_NSWMM_globalTime(), - m_NSWMM_hitGlobalPositionX(), - m_NSWMM_hitGlobalPositionY(), - m_NSWMM_hitGlobalPositionZ(), - m_NSWMM_hitGlobalPositionR(), - m_NSWMM_hitGlobalPositionP(), - m_NSWMM_hitGlobalDirectionX(), - m_NSWMM_hitGlobalDirectionY(), - m_NSWMM_hitGlobalDirectionZ(), - m_NSWMM_detector_globalPositionX(), - m_NSWMM_detector_globalPositionY(), - m_NSWMM_detector_globalPositionZ(), - m_NSWMM_detector_globalPositionR(), - m_NSWMM_detector_globalPositionP(), - m_NSWMM_hitToDsurfacePositionX(), - m_NSWMM_hitToDsurfacePositionY(), - m_NSWMM_hitToDsurfacePositionZ(), - m_NSWMM_hitToRsurfacePositionX(), - m_NSWMM_hitToRsurfacePositionY(), - m_NSWMM_hitToRsurfacePositionZ(), - m_NSWMM_FastDigitRsurfacePositionX(), - m_NSWMM_FastDigitRsurfacePositionY(), - m_NSWMM_particleEncoding(), - m_NSWMM_kineticEnergy(), - m_NSWMM_depositEnergy(), - m_NSWMM_sim_stationName(), - m_NSWMM_sim_stationEta(), - m_NSWMM_sim_stationPhi(), - m_NSWMM_sim_multilayer(), - m_NSWMM_sim_layer(), - m_NSWMM_sim_side(), - m_NSWMM_off_stationName(), - m_NSWMM_off_stationEta(), - m_NSWMM_off_stationPhi(), - m_NSWMM_off_multiplet(), - m_NSWMM_off_gas_gap(), - m_NSWMM_off_channel() - { - setHelper(idhelper); - } - - ~MMSimHitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(!m_MmIdHelper) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMSimHitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nSimHits{}; - std::vector m_NSWMM_trackId; - std::vector m_NSWMM_isInsideBounds; - std::vector m_NSWMM_globalTime; - std::vector m_NSWMM_hitGlobalPositionX; - std::vector m_NSWMM_hitGlobalPositionY; - std::vector m_NSWMM_hitGlobalPositionZ; - std::vector m_NSWMM_hitGlobalPositionR; - std::vector m_NSWMM_hitGlobalPositionP; - std::vector m_NSWMM_hitGlobalDirectionX; - std::vector m_NSWMM_hitGlobalDirectionY; - std::vector m_NSWMM_hitGlobalDirectionZ; - - std::vector m_NSWMM_detector_globalPositionX; - std::vector m_NSWMM_detector_globalPositionY; - std::vector m_NSWMM_detector_globalPositionZ; - std::vector m_NSWMM_detector_globalPositionR; - std::vector m_NSWMM_detector_globalPositionP; - - std::vector m_NSWMM_hitToDsurfacePositionX; - std::vector m_NSWMM_hitToDsurfacePositionY; - std::vector m_NSWMM_hitToDsurfacePositionZ; - - std::vector m_NSWMM_hitToRsurfacePositionX; - std::vector m_NSWMM_hitToRsurfacePositionY; - std::vector m_NSWMM_hitToRsurfacePositionZ; - - std::vector m_NSWMM_FastDigitRsurfacePositionX; - std::vector m_NSWMM_FastDigitRsurfacePositionY; - - std::vector m_NSWMM_particleEncoding; - std::vector m_NSWMM_kineticEnergy; - std::vector m_NSWMM_depositEnergy; - - std::vector m_NSWMM_sim_stationName; - std::vector m_NSWMM_sim_stationEta; - std::vector m_NSWMM_sim_stationPhi; - std::vector m_NSWMM_sim_multilayer; - std::vector m_NSWMM_sim_layer; - std::vector m_NSWMM_sim_side; - - std::vector m_NSWMM_off_stationName; - std::vector m_NSWMM_off_stationEta; - std::vector m_NSWMM_off_stationPhi; - std::vector m_NSWMM_off_multiplet; - std::vector m_NSWMM_off_gas_gap; - std::vector m_NSWMM_off_channel; - -}; - -#endif // MMSIMHITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx index eb9334efb3e..6a731e2d592 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx @@ -38,86 +38,43 @@ StatusCode NSWPRDValAlg::initialize() { std::make_unique(evtStore().get(), m_muonDetMgrDS, m_tree.tree(), m_MuEntry_ContainerName, msgLevel())); } - if (m_doSTGCHit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_ContainerName, msgLevel())); - } - + if (m_doSTGCHit) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_ContainerName.value(), msgLevel())); } if (m_doSTGCDigit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_DigitContainerName, msgLevel())); - + m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_DigitContainerName.value(), msgLevel())); // Take SDO conainer - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_SDOContainerName, msgLevel())); - } - - if (m_doSTGCFastDigit) { - // Take the "fast_SDO" instead of the SDOs from full sim - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), "sTGCfast_SDO", msgLevel())); - // Fast digits = PRD - } - - if (m_doSTGCRDO) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_RDOContainerName, msgLevel())); - } - - if (m_doSTGCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_PRDContainerName, msgLevel())); - } - - if (m_doMMHit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_ContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_SDOContainerName.value(), msgLevel())); } + if (m_doSTGCFastDigit) { m_tree.addBranch(std::make_unique(m_tree, "sTGCfast_SDO", msgLevel())); } + if (m_doSTGCRDO) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_RDOContainerName.value(), msgLevel())); } + if (m_doSTGCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_PRDContainerName.value(), msgLevel())); } + if (m_doMMHit) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_ContainerName.value(), msgLevel())); } if (m_doMMDigit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_DigitContainerName, msgLevel())); - + m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_DigitContainerName.value(), msgLevel())); // Take SDO conainer - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_SDOContainerName, msgLevel())); - } - - if (m_doMMFastDigit) { - // Take the "fast_SDO" instead of the SDOs from full sim - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), "MMfast_SDO", msgLevel())); - } - - if (m_doMMRDO) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_RDOContainerName, msgLevel())); - } - - if (m_doMMPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_SDOContainerName.value(), msgLevel())); } + if (m_doMMFastDigit) { m_tree.addBranch(std::make_unique(m_tree, "MMfast_SDO", msgLevel())); } + if (m_doMMRDO) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_RDOContainerName.value(), msgLevel())); } + if (m_doMMPRD) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_PRDContainerName.value(), msgLevel())); } if (m_doCSCHit) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_SimContainerName.value(), msgLevel())); } if (m_doCSCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_SDOContainerName.value(), msgLevel())); } if (m_doCSCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_DigitContainerName.value(), msgLevel())); } - if (m_doCSCRDO) { + if (m_doCSCRDO) { ATH_CHECK(m_csc_decoder.retrieve()); - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->cscIdHelper(), - m_tree.tree(), m_CSC_RDOContainerName, msgLevel(), m_csc_decoder.get())); - } - if (m_doCSCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->cscIdHelper(), - m_tree.tree(), m_CSC_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_CSC_RDOContainerName.value(), msgLevel(), &m_idHelperSvc->cscIdHelper(), m_csc_decoder.get())); } + if (m_doCSCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_PRDContainerName.value(), msgLevel())); } if (m_doMDTHit) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_SimContainerName.value(), msgLevel())); } if (m_doMDTSDO) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_SDOContainerName.value(), msgLevel())); } if (m_doMDTDigit) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_DigitContainerName.value(), msgLevel())); } + if (m_doRPCHit) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_SimContainerName, msgLevel())); } if (m_doRPCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_SDOContainerName, msgLevel())); } if (m_doRPCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_DigitContainerName, msgLevel())); } + if (m_doTGCHit) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_SimContainerName.value(), msgLevel())); } if (m_doTGCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_SDOContainerName.value(), msgLevel())); } if (m_doTGCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_DigitContainerName.value(), msgLevel())); } @@ -125,13 +82,10 @@ StatusCode NSWPRDValAlg::initialize() { const ITGCcablingServerSvc* TgcCabGet = nullptr; ATH_CHECK(service("TGCcablingServerSvc", TgcCabGet, true)); ATH_CHECK(TgcCabGet->giveCabling(m_tgcCabling)); - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->tgcIdHelper(), - m_tgcCabling, m_tree.tree(), m_TGC_RDOContainerName, msgLevel())); - } - if (m_doTGCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->tgcIdHelper(), - m_tree.tree(), m_TGC_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_TGC_RDOContainerName.value(), msgLevel(), m_tgcCabling)); } + if (m_doTGCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_PRDContainerName.value(), msgLevel())); } + for (std::unique_ptr& tester : m_testers) { ATH_CHECK(tester->initializeVariables()); } ATH_CHECK(m_tree.init(histSvc())); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h index d77c9ece4a7..f71125ddb35 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h @@ -9,28 +9,15 @@ #include #include "AthenaBaseComps/AthHistogramAlgorithm.h" -#include "CSCPRDVariables.h" -#include "CSCRDOVariables.h" #include "EDM_object.h" #include "GaudiKernel/ServiceHandle.h" -#include "MMDigitVariables.h" -#include "MMPRDVariables.h" -#include "MMRDOVariables.h" -#include "MMSDOVariables.h" -#include "MMSimHitVariables.h" #include "MuEntryVariables.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonTesterTree/MuonTesterTree.h" -#include "TGCPRDVariables.h" -#include "TGCRDOVariables.h" #include "TGCcablingInterface/ITGCcablingSvc.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" #include "TTree.h" -#include "sTGCDigitVariables.h" -#include "sTGCPRDVariables.h" -#include "sTGCRDOVariables.h" -#include "sTGCSDOVariables.h" -#include "sTGCSimHitVariables.h" class ITHistSvc; @@ -112,7 +99,7 @@ private: Gaudi::Property m_NSWMM_PRDContainerName{this, "NSWMM_PRDContainerName", "MM_Measurements"}; Gaudi::Property m_CSC_SimContainerName{this, "CSC_SimContainerName", "CSC_Hits"}; - Gaudi::Property m_CSC_SDOContainerName{this, "CSC_SDOContainerName", "CSCSDO"}; + Gaudi::Property m_CSC_SDOContainerName{this, "CSC_SDOContainerName", "CSC_SDO"}; Gaudi::Property m_CSC_DigitContainerName{this, "CSC_DigitContainerName", "CSC_DIGITS"}; Gaudi::Property m_CSC_RDOContainerName{this, "CSC_RDOContainerName", "CSCRDO"}; Gaudi::Property m_CSC_PRDContainerName{this, "CSC_PRDContainerName", "CSC_Clusters"}; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx deleted file mode 100644 index 187af1154a1..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TGCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/TgcPrepDataContainer.h" -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "TTree.h" - -StatusCode TGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillTGCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::TgcPrepDataContainer *Tgc_PrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(Tgc_PrepDataContainer, m_ContainerName.c_str()) ); - - if(Tgc_PrepDataContainer->size()==0){ - ATH_MSG_DEBUG(" TGC PRD Container empty "); - - } - for(const Muon::TgcPrepDataCollection* coll: *Tgc_PrepDataContainer ) { - - for (auto prd: *coll) { - - Identifier Id = prd->identify(); - - std::string stName = m_TgcIdHelper->stationNameString(m_TgcIdHelper->stationName(Id)); - int stationEta = m_TgcIdHelper->stationEta(Id); - int stationPhi = m_TgcIdHelper->stationPhi(Id); - int channel = m_TgcIdHelper->channel(Id); - int gasgap = m_TgcIdHelper->gasGap(Id); - int isStrip = m_TgcIdHelper->isStrip(Id); - - ATH_MSG_DEBUG( "TGC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " ChNr [" << channel << "]" - << " gasGap [" << gasgap << "]" - << " isStrip [" << isStrip << "]" ); - - m_TGC_PRD_stationName.push_back(stName); - m_TGC_PRD_stationEta.push_back(stationEta); - m_TGC_PRD_stationPhi.push_back(stationPhi); - m_TGC_PRD_channel.push_back(channel); - m_TGC_PRD_gasGap.push_back(gasgap); - m_TGC_PRD_isStrip.push_back(isStrip); - - const MuonGM::TgcReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nTGCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - m_TGC_PRD_globalPosX.push_back(pos.x()); - m_TGC_PRD_globalPosY.push_back(pos.y()); - m_TGC_PRD_globalPosZ.push_back(pos.z()); - - m_TGC_PRD_localPosX.push_back(loc_pos[0]); - m_TGC_PRD_localPosY.push_back(loc_pos[1]); - - m_TGC_PRD_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_TGC_PRD_nPRDs << " TGC PRD's"); - - return StatusCode::SUCCESS; -} - -StatusCode TGCPRDVariables::clearVariables() -{ - - m_TGC_PRD_nPRDs = 0; - - m_TGC_PRD_stationName.clear(); - m_TGC_PRD_stationEta.clear(); - m_TGC_PRD_stationPhi.clear(); - m_TGC_PRD_channel.clear(); - m_TGC_PRD_gasGap.clear(); - m_TGC_PRD_isStrip.clear(); - - m_TGC_PRD_globalPosX.clear(); - m_TGC_PRD_globalPosY.clear(); - m_TGC_PRD_globalPosZ.clear(); - - m_TGC_PRD_localPosX.clear(); - m_TGC_PRD_localPosY.clear(); - - return StatusCode::SUCCESS; -} - -StatusCode TGCPRDVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("PRD_TGC", &m_TGC_PRD_nPRDs, "PRDs_TGC_n/i"); - m_tree->Branch("PRD_TGC_stationName", &m_TGC_PRD_stationName); - m_tree->Branch("PRD_TGC_stationEta", &m_TGC_PRD_stationEta); - m_tree->Branch("PRD_TGC_stationPhi", &m_TGC_PRD_stationPhi); - m_tree->Branch("PRD_TGC_channel", &m_TGC_PRD_channel); - m_tree->Branch("PRD_TGC_gasGap", &m_TGC_PRD_gasGap); - m_tree->Branch("PRD_TGC_isStrip", &m_TGC_PRD_isStrip); - - m_tree->Branch("PRD_TGC_globalPosX", &m_TGC_PRD_globalPosX); - m_tree->Branch("PRD_TGC_globalPosY", &m_TGC_PRD_globalPosY); - m_tree->Branch("PRD_TGC_globalPosZ", &m_TGC_PRD_globalPosZ); - - m_tree->Branch("PRD_TGC_localPosX", &m_TGC_PRD_localPosX); - m_tree->Branch("PRD_TGC_localPosY", &m_TGC_PRD_localPosY); - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h deleted file mode 100644 index 0590544388b..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TGCPRDVARIABLES_H -#define TGCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class TGCPRDVariables : public ValAlgVariables -{ - public: - TGCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl) - { - setHelper(idhelper); - } - - ~TGCPRDVariables() = default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_TgcIdHelper = dynamic_cast(idhelper); - if(!m_TgcIdHelper) { - throw std::runtime_error("casting IdHelper to TgcIdHelper failed"); - } - } - - void deleteVariables(){}; - StatusCode clearVariables(); - - const TgcIdHelper* m_TgcIdHelper{}; - - int m_TGC_PRD_nPRDs{}; - std::vector m_TGC_PRD_stationName; - std::vector m_TGC_PRD_stationEta; - std::vector m_TGC_PRD_stationPhi; - std::vector m_TGC_PRD_channel; - std::vector m_TGC_PRD_gasGap; - std::vector m_TGC_PRD_isStrip; - - std::vector m_TGC_PRD_globalPosX; - std::vector m_TGC_PRD_globalPosY; - std::vector m_TGC_PRD_globalPosZ; - - std::vector m_TGC_PRD_localPosX; - std::vector m_TGC_PRD_localPosY; - -}; - -#endif // TGCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx deleted file mode 100644 index d681258e84f..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TGCRDOVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/TgcRdoContainer.h" - -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "TTree.h" - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode TGCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillTGCRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - const TgcRdoContainer* rdo_container = nullptr; - - CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" TGC RDO Container empty "); - - for(const TgcRdo* coll : *rdo_container) { - - for (const TgcRawData* rdo: *coll) { - - bool orFlag = m_tgcCabling->isOredChannel(rdo->subDetectorId(), - rdo->rodId(), - rdo->sswId(), - rdo->slbId(), - rdo->bitpos()); - - Identifier Id; - - bool e_found = m_tgcCabling->getElementIDfromReadoutID(Id, - rdo->subDetectorId(), - rdo->rodId(), - rdo->sswId(), - rdo->slbId(), - rdo->bitpos(), - orFlag); - - if (!e_found) { - ATH_MSG_ERROR("could not find Identifier from TgcRawData"); - return StatusCode::FAILURE; - } - - std::string stName = m_TgcIdHelper->stationNameString(m_TgcIdHelper->stationName(Id)); - int stationEta = m_TgcIdHelper->stationEta(Id); - int stationPhi = m_TgcIdHelper->stationPhi(Id); - int gas_gap = m_TgcIdHelper->gasGap(Id); - int isStrip = m_TgcIdHelper->isStrip(Id); - int channel = m_TgcIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " GasGap [" << gas_gap << "]" - << " isStrip [" << isStrip << "]" - << " ChNr [" << channel << "]" ); - - // to be stored in the ntuple - m_TGC_rdo_stationName.push_back(stName); - m_TGC_rdo_stationEta.push_back(stationEta); - m_TGC_rdo_stationPhi.push_back(stationPhi); - m_TGC_rdo_gas_gap.push_back(gas_gap); - m_TGC_rdo_isStrip.push_back(isStrip); - m_TGC_rdo_channel.push_back(channel); - - const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); - if (!rdoEl) { - ATH_MSG_ERROR("TGCRDOVariables::fillVariables() - Failed to retrieve TgcReadoutElement for" << __FILE__ << __LINE__ << m_TgcIdHelper->print_to_string(Id).c_str()); - return StatusCode::FAILURE; - } - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_TGC_rdo_localPosX.push_back(localStripPos.x()); - m_TGC_rdo_localPosY.push_back(localStripPos.y()); - ATH_MSG_DEBUG("TGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("TGC RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_TGC_rdo_globalPosX.push_back(globalStripPos.x()); - m_TGC_rdo_globalPosY.push_back(globalStripPos.y()); - m_TGC_rdo_globalPosZ.push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_TGC_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_TGC_nrdo << " MicroMegas rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode TGCRDOVariables::clearVariables() -{ - m_TGC_nrdo = 0; - - m_TGC_rdo_stationName.clear(); - m_TGC_rdo_stationEta.clear(); - m_TGC_rdo_stationPhi.clear(); - m_TGC_rdo_gas_gap.clear(); - m_TGC_rdo_isStrip.clear(); - m_TGC_rdo_channel.clear(); - m_TGC_rdo_localPosX.clear(); - m_TGC_rdo_localPosY.clear(); - m_TGC_rdo_globalPosX.clear(); - m_TGC_rdo_globalPosY.clear(); - m_TGC_rdo_globalPosZ.clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode TGCRDOVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("RDO_TGC_n", &m_TGC_nrdo); - m_tree->Branch("RDO_TGC_stationName", &m_TGC_rdo_stationName); - m_tree->Branch("RDO_TGC_stationEta", &m_TGC_rdo_stationEta); - m_tree->Branch("RDO_TGC_stationPhi", &m_TGC_rdo_stationPhi); - m_tree->Branch("RDO_TGC_gas_gap", &m_TGC_rdo_gas_gap); - m_tree->Branch("RDO_TGC_isStrip", &m_TGC_rdo_isStrip); - m_tree->Branch("RDO_TGC_channel", &m_TGC_rdo_channel); - m_tree->Branch("RDO_TGC_localPosX", &m_TGC_rdo_localPosX); - m_tree->Branch("RDO_TGC_localPosY", &m_TGC_rdo_localPosY); - m_tree->Branch("RDO_TGC_globalPosX", &m_TGC_rdo_globalPosX); - m_tree->Branch("RDO_TGC_globalPosY", &m_TGC_rdo_globalPosY); - m_tree->Branch("RDO_TGC_globalPosZ", &m_TGC_rdo_globalPosZ); - - } - return StatusCode::SUCCESS; -} - -TGCRDOVariables::TGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - const ITGCcablingSvc* cabling_svc, - TTree* tree, - const std::string& containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_tgcCabling{cabling_svc} { - setHelper(idhelper); - - } \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h deleted file mode 100644 index 9df4710f69d..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TGCRDOVARIABLES_H -#define TGCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "TGCcablingInterface/ITGCcablingSvc.h" - -#include - -class TGCRDOVariables : public ValAlgVariables -{ - public: - TGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - const ITGCcablingSvc* cabling_svc, - TTree* tree, - const std::string& containername, - MSG::Level msglvl); - - ~TGCRDOVariables() = default; - - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - void deleteVariables(){} - void setHelper(const MuonIdHelper* idhelper){ - m_TgcIdHelper = dynamic_cast(idhelper); - if(!m_TgcIdHelper) { - throw std::runtime_error("Casting IdHelper to TgcIdHelper failed"); - } - } - - - StatusCode clearVariables(); - - const TgcIdHelper* m_TgcIdHelper{nullptr}; - const ITGCcablingSvc* m_tgcCabling{nullptr}; - - int m_TGC_nrdo{0}; - std::vector m_TGC_rdo_stationName{}; - std::vector m_TGC_rdo_stationEta{}; - std::vector m_TGC_rdo_stationPhi{}; - std::vector m_TGC_rdo_gas_gap{}; - std::vector m_TGC_rdo_isStrip{}; - std::vector m_TGC_rdo_channel{}; - std::vector m_TGC_rdo_localPosX{}; - std::vector m_TGC_rdo_localPosY{}; - std::vector m_TGC_rdo_globalPosX{}; - std::vector m_TGC_rdo_globalPosY{}; - std::vector m_TGC_rdo_globalPosZ{}; - - -}; - -#endif // TGCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx deleted file mode 100644 index ea0e102be3c..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx +++ /dev/null @@ -1,386 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCDigitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonDigitContainer/sTgcDigitContainer.h" -#include "MuonDigitContainer/sTgcDigit.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "MuonDigitContainer/sTgcDigitCollection.h" - -#include "TTree.h" -#include // for Form - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode sTGCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWsTGCDigitVariables()"); - CHECK( this->clearVariables() ); - - const sTgcDigitContainer* nsw_sTgcDigitContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcDigitContainer, m_ContainerName.c_str()) ); - - sTgcDigitContainer::const_iterator it = nsw_sTgcDigitContainer->begin(); - sTgcDigitContainer::const_iterator it_e = nsw_sTgcDigitContainer->end(); - ATH_MSG_DEBUG("retrieved sTGC Digit Container with size "<digit_size()); - - if(nsw_sTgcDigitContainer->size()==0) ATH_MSG_WARNING(" sTGC Digit Continer empty "); - for(; it!=it_e; ++it) { - const sTgcDigitCollection* coll = *it; - ATH_MSG_DEBUG( "processing collection with size " << coll->size() ); - for (unsigned int digitNum=0; digitNumsize(); digitNum++) { - const sTgcDigit* digit = coll->at(digitNum); - Identifier Id = digit->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int stationEtaMin = m_sTgcIdHelper->stationEtaMin(Id); - int stationEtaMax = m_sTgcIdHelper->stationEtaMax(Id); - int stationPhiMin = m_sTgcIdHelper->stationPhiMin(Id); - int stationPhiMax = m_sTgcIdHelper->stationPhiMax(Id); - int gas_gapMin = m_sTgcIdHelper->gasGapMin(Id); - int gas_gapMax = m_sTgcIdHelper->gasGapMax(Id); - int padEta = m_sTgcIdHelper->padEta(Id); - int padPhi = m_sTgcIdHelper->padPhi(Id); - int NofMultilayers = m_sTgcIdHelper->numberOfMultilayers(Id); - int multilayerMin = m_sTgcIdHelper->multilayerMin(Id); - int multilayerMax = m_sTgcIdHelper->multilayerMax(Id); - int channelTypeMin = m_sTgcIdHelper->channelTypeMin(Id); - int channelTypeMax = m_sTgcIdHelper->channelTypeMax(Id); - int channelMin = m_sTgcIdHelper->channelMin(Id); - int channelMax = m_sTgcIdHelper->channelMax(Id); - int channelType = m_sTgcIdHelper->channelType(Id); - - ATH_MSG_DEBUG( "sTGC Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " Station EtaMin [" << stationEtaMin << "]" - << " Station EtaMax [" << stationEtaMax << "]" - << " Station PhiMin [" << stationPhiMin << "]" - << " Station PhiMax [" << stationPhiMax << "]"); - - int isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCDigitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - int channelNumber = 0; - Amg::Vector3D gpos(0.,0.,0.); - Amg::Vector2D lpos(0.,0.); - - rdoEl->stripPosition(Id,lpos); - rdoEl->surface(Id).localToGlobal(lpos, gpos,gpos); - - std::vector local_pad_corners; - rdoEl->padCorners(Id,local_pad_corners); - std::vector global_pad_corners; - - for(auto& local_corner : local_pad_corners) { - Amg::Vector3D global_corner; - rdoEl->surface(Id).localToGlobal(local_corner, global_corner, global_corner); - global_pad_corners.push_back(global_corner); - } - - - m_NSWsTGC_dig_globalPosX->push_back( gpos.x() ); - m_NSWsTGC_dig_globalPosY->push_back( gpos.y() ); - m_NSWsTGC_dig_globalPosZ->push_back( gpos.z() ); - m_NSWsTGC_dig_localPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_localPosY->push_back( lpos.y() ); - for(auto corner : global_pad_corners) { - if(channelType ==0 ) { - m_NSWsTGC_dig_PadglobalCornerPosX->push_back(corner.x()); - m_NSWsTGC_dig_PadglobalCornerPosY->push_back(corner.y()); - m_NSWsTGC_dig_PadglobalCornerPosZ->push_back(corner.z()); - } - } - channelNumber = rdoEl->stripNumber(lpos,Id); - m_NSWsTGC_dig_channelPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_channelPosY->push_back( lpos.y() ); - - m_NSWsTGC_dig_channel_type->push_back(channelType); - m_NSWsTGC_dig_stationName->push_back(stName); - m_NSWsTGC_dig_stationEta->push_back(stationEta); - m_NSWsTGC_dig_stationPhi->push_back(stationPhi); - m_NSWsTGC_dig_multiplet->push_back(multiplet); - m_NSWsTGC_dig_gas_gap->push_back(gas_gap); - m_NSWsTGC_dig_channel->push_back(channel); - m_NSWsTGC_dig_stationEtaMin->push_back(stationEtaMin); - m_NSWsTGC_dig_stationEtaMax->push_back(stationEtaMax); - m_NSWsTGC_dig_stationPhiMin->push_back(stationPhiMin); - m_NSWsTGC_dig_stationPhiMax->push_back(stationPhiMax); - m_NSWsTGC_dig_gas_gapMin->push_back(gas_gapMin); - m_NSWsTGC_dig_gas_gapMax->push_back(gas_gapMax); - m_NSWsTGC_dig_padEta->push_back(padEta); - m_NSWsTGC_dig_padPhi->push_back(padPhi); - m_NSWsTGC_dig_numberOfMultilayers->push_back(NofMultilayers); - m_NSWsTGC_dig_multilayerMin->push_back(multilayerMin); - m_NSWsTGC_dig_multilayerMax->push_back(multilayerMax); - m_NSWsTGC_dig_channelTypeMin->push_back(channelTypeMin); - m_NSWsTGC_dig_channelTypeMax->push_back(channelTypeMax); - m_NSWsTGC_dig_channelMin->push_back(channelMin); - m_NSWsTGC_dig_channelMax->push_back(channelMax); - m_NSWsTGC_dig_channelNumber->push_back(channelNumber); - - m_NSWsTGC_dig_bctag->push_back(digit->bcTag()); - m_NSWsTGC_dig_time->push_back(digit->time()); - m_NSWsTGC_dig_charge->push_back(digit->charge()); - m_NSWsTGC_dig_isDead->push_back(digit->isDead()); - m_NSWsTGC_dig_isPileup->push_back(digit->isPileup()); - - if(channelType == 0) m_NSWsTGC_nPadDigits++; - m_NSWsTGC_nDigits++; - } - } - ATH_MSG_DEBUG(" finished fillNSWsTGCDigitVariables()"); - return StatusCode::SUCCESS; -} - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode sTGCDigitVariables::clearVariables() -{ - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time->clear(); - m_NSWsTGC_dig_bctag->clear(); - m_NSWsTGC_dig_charge->clear(); - m_NSWsTGC_dig_isDead->clear(); - m_NSWsTGC_dig_isPileup->clear(); - m_NSWsTGC_dig_stationName->clear(); - m_NSWsTGC_dig_stationEta->clear(); - m_NSWsTGC_dig_stationPhi->clear(); - m_NSWsTGC_dig_multiplet->clear(); - m_NSWsTGC_dig_gas_gap->clear(); - m_NSWsTGC_dig_channel_type->clear(); - m_NSWsTGC_dig_channel->clear(); - m_NSWsTGC_dig_stationEtaMin->clear(); - m_NSWsTGC_dig_stationEtaMax->clear(); - m_NSWsTGC_dig_stationPhiMin->clear(); - m_NSWsTGC_dig_stationPhiMax->clear(); - m_NSWsTGC_dig_gas_gapMin->clear(); - m_NSWsTGC_dig_gas_gapMax->clear(); - m_NSWsTGC_dig_padEta->clear(); - m_NSWsTGC_dig_padPhi->clear(); - m_NSWsTGC_dig_numberOfMultilayers->clear(); - m_NSWsTGC_dig_multilayerMin->clear(); - m_NSWsTGC_dig_multilayerMax->clear(); - m_NSWsTGC_dig_channelTypeMin->clear(); - m_NSWsTGC_dig_channelTypeMax->clear(); - m_NSWsTGC_dig_channelMin->clear(); - m_NSWsTGC_dig_channelMax->clear(); - m_NSWsTGC_dig_channelNumber->clear(); - m_NSWsTGC_dig_channelPosX->clear(); - m_NSWsTGC_dig_channelPosY->clear(); - m_NSWsTGC_dig_localPosX->clear(); - m_NSWsTGC_dig_localPosY->clear(); - m_NSWsTGC_dig_globalPosX->clear(); - m_NSWsTGC_dig_globalPosY->clear(); - m_NSWsTGC_dig_globalPosZ->clear(); - m_NSWsTGC_dig_PadglobalCornerPosX->clear(); - m_NSWsTGC_dig_PadglobalCornerPosY->clear(); - m_NSWsTGC_dig_PadglobalCornerPosZ->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode sTGCDigitVariables::initializeVariables() -{ - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time = new std::vector(); - m_NSWsTGC_dig_bctag = new std::vector(); - m_NSWsTGC_dig_charge = new std::vector(); - m_NSWsTGC_dig_isDead = new std::vector(); - m_NSWsTGC_dig_isPileup = new std::vector(); - - m_NSWsTGC_dig_stationName = new std::vector(); - m_NSWsTGC_dig_stationEta = new std::vector(); - m_NSWsTGC_dig_stationPhi = new std::vector(); - m_NSWsTGC_dig_multiplet = new std::vector(); - m_NSWsTGC_dig_gas_gap = new std::vector(); - m_NSWsTGC_dig_channel_type = new std::vector(); - m_NSWsTGC_dig_channel = new std::vector(); - - m_NSWsTGC_dig_stationEtaMin = new std::vector(); - m_NSWsTGC_dig_stationEtaMax = new std::vector(); - m_NSWsTGC_dig_stationPhiMin = new std::vector(); - m_NSWsTGC_dig_stationPhiMax = new std::vector(); - m_NSWsTGC_dig_gas_gapMin = new std::vector(); - m_NSWsTGC_dig_gas_gapMax = new std::vector(); - m_NSWsTGC_dig_padEta = new std::vector(); - m_NSWsTGC_dig_padPhi = new std::vector(); - - m_NSWsTGC_dig_numberOfMultilayers = new std::vector(); - m_NSWsTGC_dig_multilayerMin = new std::vector(); - m_NSWsTGC_dig_multilayerMax = new std::vector(); - m_NSWsTGC_dig_channelTypeMin = new std::vector(); - m_NSWsTGC_dig_channelTypeMax = new std::vector(); - m_NSWsTGC_dig_channelMin = new std::vector(); - m_NSWsTGC_dig_channelMax = new std::vector(); - m_NSWsTGC_dig_channelNumber = new std::vector(); - - m_NSWsTGC_dig_channelPosX = new std::vector(); - m_NSWsTGC_dig_channelPosY = new std::vector(); - m_NSWsTGC_dig_localPosX = new std::vector(); - m_NSWsTGC_dig_localPosY = new std::vector(); - m_NSWsTGC_dig_globalPosX = new std::vector(); - m_NSWsTGC_dig_globalPosY = new std::vector(); - m_NSWsTGC_dig_globalPosZ = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosX = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosY = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosZ = new std::vector(); - - if(m_tree) { - ATH_MSG_DEBUG("sTGC digit: init m_tree "); - m_tree->Branch("Digits_sTGC", &m_NSWsTGC_nDigits, "Digits_sTGC_n/i"); - m_tree->Branch("Digits_sTGC_Pad_Digits", &m_NSWsTGC_nPadDigits, "Digits_sTGC_Pad_Digits_n/i"); - m_tree->Branch("Digits_sTGC_time", "std::vector< double >", &m_NSWsTGC_dig_time); - m_tree->Branch("Digits_sTGC_bctag", "std::vector< int >", &m_NSWsTGC_dig_bctag); - m_tree->Branch("Digits_sTGC_charge", "std::vector< double >", &m_NSWsTGC_dig_charge); - m_tree->Branch("Digits_sTGC_isDead", "std::vector< bool >", &m_NSWsTGC_dig_isDead); - m_tree->Branch("Digits_sTGC_isPileup", "std::vector< bool >", &m_NSWsTGC_dig_isPileup); - m_tree->Branch("Digits_sTGC_stationName", &m_NSWsTGC_dig_stationName); - m_tree->Branch("Digits_sTGC_stationEta", &m_NSWsTGC_dig_stationEta); - m_tree->Branch("Digits_sTGC_stationPhi", &m_NSWsTGC_dig_stationPhi); - m_tree->Branch("Digits_sTGC_multiplet", &m_NSWsTGC_dig_multiplet); - m_tree->Branch("Digits_sTGC_gas_gap", &m_NSWsTGC_dig_gas_gap); - m_tree->Branch("Digits_sTGC_channel_type",&m_NSWsTGC_dig_channel_type); - m_tree->Branch("Digits_sTGC_channel", &m_NSWsTGC_dig_channel); - m_tree->Branch("Digits_sTGC_stationEtaMin", &m_NSWsTGC_dig_stationEtaMin); - m_tree->Branch("Digits_sTGC_stationEtaMax", &m_NSWsTGC_dig_stationEtaMax); - m_tree->Branch("Digits_sTGC_stationPhiMin", &m_NSWsTGC_dig_stationPhiMin); - m_tree->Branch("Digits_sTGC_stationPhiMax", &m_NSWsTGC_dig_stationPhiMax); - m_tree->Branch("Digits_sTGC_gas_gapMin", &m_NSWsTGC_dig_gas_gapMin); - m_tree->Branch("Digits_sTGC_gas_gapMax", &m_NSWsTGC_dig_gas_gapMax); - m_tree->Branch("Digits_sTGC_padEta", &m_NSWsTGC_dig_padEta); - m_tree->Branch("Digits_sTGC_padPhi", &m_NSWsTGC_dig_padPhi); - m_tree->Branch("Digits_sTGC_numberOfMultilayers", &m_NSWsTGC_dig_numberOfMultilayers); - m_tree->Branch("Digits_sTGC_multilayerMin", &m_NSWsTGC_dig_multilayerMin); - m_tree->Branch("Digits_sTGC_multilayerMax", &m_NSWsTGC_dig_multilayerMax); - m_tree->Branch("Digits_sTGC_channelTypeMin", &m_NSWsTGC_dig_channelTypeMin); - m_tree->Branch("Digits_sTGC_channelTypeMax", &m_NSWsTGC_dig_channelTypeMax); - m_tree->Branch("Digits_sTGC_channelMin", &m_NSWsTGC_dig_channelMin); - m_tree->Branch("Digits_sTGC_channelMax", &m_NSWsTGC_dig_channelMax); - m_tree->Branch("Digits_sTGC_channelNumber", &m_NSWsTGC_dig_channelNumber); - - m_tree->Branch("Digits_sTGC_channelPosX", "std::vector< double >", &m_NSWsTGC_dig_channelPosX); - m_tree->Branch("Digits_sTGC_channelPosY", "std::vector< double >", &m_NSWsTGC_dig_channelPosY); - m_tree->Branch("Digits_sTGC_localPosX", "std::vector< double >", &m_NSWsTGC_dig_localPosX); - m_tree->Branch("Digits_sTGC_localPosY", "std::vector< double >", &m_NSWsTGC_dig_localPosY); - m_tree->Branch("Digits_sTGC_globalPosX", "std::vector< double >", &m_NSWsTGC_dig_globalPosX); - m_tree->Branch("Digits_sTGC_globalPosY", "std::vector< double >", &m_NSWsTGC_dig_globalPosY); - m_tree->Branch("Digits_sTGC_globalPosZ", "std::vector< double >", &m_NSWsTGC_dig_globalPosZ); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosX", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosX); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosY", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosY); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosZ", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosZ); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void sTGCDigitVariables::deleteVariables() -{ - - delete m_NSWsTGC_dig_stationName; - delete m_NSWsTGC_dig_stationEta; - delete m_NSWsTGC_dig_stationPhi; - delete m_NSWsTGC_dig_multiplet; - delete m_NSWsTGC_dig_gas_gap; - delete m_NSWsTGC_dig_channel_type; - delete m_NSWsTGC_dig_channel; - delete m_NSWsTGC_dig_stationEtaMin; - delete m_NSWsTGC_dig_stationEtaMax; - delete m_NSWsTGC_dig_stationPhiMin; - delete m_NSWsTGC_dig_stationPhiMax; - delete m_NSWsTGC_dig_gas_gapMin; - delete m_NSWsTGC_dig_gas_gapMax; - delete m_NSWsTGC_dig_padEta; - delete m_NSWsTGC_dig_padPhi; - delete m_NSWsTGC_dig_numberOfMultilayers; - delete m_NSWsTGC_dig_multilayerMin; - delete m_NSWsTGC_dig_multilayerMax; - delete m_NSWsTGC_dig_channelTypeMin; - delete m_NSWsTGC_dig_channelTypeMax; - delete m_NSWsTGC_dig_channelMin; - delete m_NSWsTGC_dig_channelMax; - delete m_NSWsTGC_dig_channelNumber; - delete m_NSWsTGC_dig_channelPosX; - delete m_NSWsTGC_dig_channelPosY; - delete m_NSWsTGC_dig_localPosX; - delete m_NSWsTGC_dig_localPosY; - delete m_NSWsTGC_dig_globalPosX; - delete m_NSWsTGC_dig_globalPosY; - delete m_NSWsTGC_dig_globalPosZ; - delete m_NSWsTGC_dig_PadglobalCornerPosX; - delete m_NSWsTGC_dig_PadglobalCornerPosY; - delete m_NSWsTGC_dig_PadglobalCornerPosZ; - - delete m_NSWsTGC_dig_time; - delete m_NSWsTGC_dig_bctag; - delete m_NSWsTGC_dig_charge; - delete m_NSWsTGC_dig_isDead; - delete m_NSWsTGC_dig_isPileup; - - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time = nullptr; - m_NSWsTGC_dig_bctag = nullptr; - m_NSWsTGC_dig_charge = nullptr; - m_NSWsTGC_dig_isDead = nullptr; - m_NSWsTGC_dig_isPileup = nullptr; - m_NSWsTGC_dig_stationName = nullptr; - m_NSWsTGC_dig_stationEta = nullptr; - m_NSWsTGC_dig_stationPhi = nullptr; - m_NSWsTGC_dig_multiplet = nullptr; - m_NSWsTGC_dig_gas_gap = nullptr; - m_NSWsTGC_dig_channel_type = nullptr; - m_NSWsTGC_dig_channel = nullptr; - m_NSWsTGC_dig_stationEtaMin = nullptr; - m_NSWsTGC_dig_stationEtaMax = nullptr; - m_NSWsTGC_dig_stationPhiMin = nullptr; - m_NSWsTGC_dig_stationPhiMax = nullptr; - m_NSWsTGC_dig_gas_gapMin = nullptr; - m_NSWsTGC_dig_gas_gapMax = nullptr; - m_NSWsTGC_dig_padEta = nullptr; - m_NSWsTGC_dig_padPhi = nullptr; - m_NSWsTGC_dig_numberOfMultilayers = nullptr; - m_NSWsTGC_dig_multilayerMin = nullptr; - m_NSWsTGC_dig_multilayerMax = nullptr; - m_NSWsTGC_dig_channelTypeMin = nullptr; - m_NSWsTGC_dig_channelTypeMax = nullptr; - m_NSWsTGC_dig_channelMin = nullptr; - m_NSWsTGC_dig_channelMax = nullptr; - m_NSWsTGC_dig_channelNumber = nullptr; - m_NSWsTGC_dig_channelPosX = nullptr; - m_NSWsTGC_dig_channelPosY = nullptr; - m_NSWsTGC_dig_localPosX = nullptr; - m_NSWsTGC_dig_localPosY = nullptr; - m_NSWsTGC_dig_globalPosX = nullptr; - m_NSWsTGC_dig_globalPosY = nullptr; - m_NSWsTGC_dig_globalPosZ = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosX = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosY = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h deleted file mode 100644 index 07dbab23a59..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCDIGITVARIABLES_H -#define STGCDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCDigitVariables : public ValAlgVariables -{ - public: - sTGCDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_NSWsTGC_nDigits(0), - m_NSWsTGC_nPadDigits(0), - m_NSWsTGC_dig_time(0), - m_NSWsTGC_dig_bctag(0), - m_NSWsTGC_dig_charge(0), - m_NSWsTGC_dig_isDead(0), - m_NSWsTGC_dig_isPileup(0), - m_NSWsTGC_dig_stationName(0), - m_NSWsTGC_dig_stationEta(0), - m_NSWsTGC_dig_stationPhi(0), - m_NSWsTGC_dig_multiplet(0), - m_NSWsTGC_dig_gas_gap(0), - m_NSWsTGC_dig_channel_type(0), - m_NSWsTGC_dig_channel(0), - m_NSWsTGC_dig_stationEtaMin(0), - m_NSWsTGC_dig_stationEtaMax(0), - m_NSWsTGC_dig_stationPhiMin(0), - m_NSWsTGC_dig_stationPhiMax(0), - m_NSWsTGC_dig_gas_gapMin(0), - m_NSWsTGC_dig_gas_gapMax(0), - m_NSWsTGC_dig_padEta(0), - m_NSWsTGC_dig_padPhi(0), - m_NSWsTGC_dig_numberOfMultilayers(0), - m_NSWsTGC_dig_multilayerMin(0), - m_NSWsTGC_dig_multilayerMax(0), - m_NSWsTGC_dig_channelTypeMin(0), - m_NSWsTGC_dig_channelTypeMax(0), - m_NSWsTGC_dig_channelMin(0), - m_NSWsTGC_dig_channelMax(0), - m_NSWsTGC_dig_channelNumber(0), - m_NSWsTGC_dig_channelPosX(0), - m_NSWsTGC_dig_channelPosY(0), - m_NSWsTGC_dig_localPosX(0), - m_NSWsTGC_dig_localPosY(0), - m_NSWsTGC_dig_globalPosX(0), - m_NSWsTGC_dig_globalPosY(0), - m_NSWsTGC_dig_globalPosZ(0), - m_NSWsTGC_dig_PadglobalCornerPosX(0), - m_NSWsTGC_dig_PadglobalCornerPosY(0), - m_NSWsTGC_dig_PadglobalCornerPosZ(0) - { - setHelper(idhelper); - } - - ~sTGCDigitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCDigitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nDigits{}; - int m_NSWsTGC_nPadDigits{}; - std::vector *m_NSWsTGC_dig_time; - std::vector *m_NSWsTGC_dig_bctag; - std::vector *m_NSWsTGC_dig_charge; - std::vector *m_NSWsTGC_dig_isDead; - std::vector *m_NSWsTGC_dig_isPileup; - std::vector *m_NSWsTGC_dig_stationName; - std::vector *m_NSWsTGC_dig_stationEta; - std::vector *m_NSWsTGC_dig_stationPhi; - std::vector *m_NSWsTGC_dig_multiplet; - std::vector *m_NSWsTGC_dig_gas_gap; - std::vector *m_NSWsTGC_dig_channel_type; - std::vector *m_NSWsTGC_dig_channel; - std::vector *m_NSWsTGC_dig_stationEtaMin; - std::vector *m_NSWsTGC_dig_stationEtaMax; - std::vector *m_NSWsTGC_dig_stationPhiMin; - std::vector *m_NSWsTGC_dig_stationPhiMax; - std::vector *m_NSWsTGC_dig_gas_gapMin; - std::vector *m_NSWsTGC_dig_gas_gapMax; - std::vector *m_NSWsTGC_dig_padEta; - std::vector *m_NSWsTGC_dig_padPhi; - std::vector *m_NSWsTGC_dig_numberOfMultilayers; - std::vector *m_NSWsTGC_dig_multilayerMin; - std::vector *m_NSWsTGC_dig_multilayerMax; - std::vector *m_NSWsTGC_dig_channelTypeMin; - std::vector *m_NSWsTGC_dig_channelTypeMax; - std::vector *m_NSWsTGC_dig_channelMin; - std::vector *m_NSWsTGC_dig_channelMax; - std::vector *m_NSWsTGC_dig_channelNumber; - - std::vector< double > *m_NSWsTGC_dig_channelPosX; - std::vector< double > *m_NSWsTGC_dig_channelPosY; - std::vector< double > *m_NSWsTGC_dig_localPosX; - std::vector< double > *m_NSWsTGC_dig_localPosY; - std::vector< double > *m_NSWsTGC_dig_globalPosX; - std::vector< double > *m_NSWsTGC_dig_globalPosY; - std::vector< double > *m_NSWsTGC_dig_globalPosZ; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosX; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosY; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosZ; - - -}; - -#endif // STGCDIGITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx deleted file mode 100644 index db22c4ab377..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx +++ /dev/null @@ -1,209 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonPrepRawData/sTgcPrepDataContainer.h" - -#include "TTree.h" -#include // for Form - -StatusCode sTGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::sTgcPrepDataContainer *nsw_sTgcPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_sTgcPrepDataContainer->size()==0) ATH_MSG_WARNING(" sTgc PRD Container empty "); - - for(const Muon::sTgcPrepDataCollection* coll : *nsw_sTgcPrepDataContainer ) { - - for (unsigned int item=0; itemsize(); item++) { - const Muon::sTgcPrepData* prd = coll->at(item); - Identifier Id = prd->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - int channel = m_sTgcIdHelper->channel(Id); - int charge = prd->charge(); - uint16_t bcTag = prd->getBcBitMap(); - - ATH_MSG_DEBUG( "sTGC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " Type [" << channel_type << "]" - << " ChNr [" << channel << "]" ); - - m_NSWsTGC_prd_stationName->push_back(stName); - m_NSWsTGC_prd_stationEta->push_back(stationEta); - m_NSWsTGC_prd_stationPhi->push_back(stationPhi); - m_NSWsTGC_prd_multiplet->push_back(multiplet); - m_NSWsTGC_prd_gas_gap->push_back(gas_gap); - m_NSWsTGC_prd_channel_type->push_back(channel_type); - m_NSWsTGC_prd_channel->push_back(channel); - m_NSWsTGC_prd_charge->push_back(charge); - m_NSWsTGC_prd_bcTag->push_back(bcTag); - - const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - double err_x = prd->localCovariance()(0,0); - double err_y = ( prd->localCovariance().rows()==2)? prd->localCovariance()(1,1) : 0.; - - ATH_MSG_DEBUG( "sTgc PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << err_x - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] - << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); - - m_NSWsTGC_prd_globalPosX->push_back(pos.x()); - m_NSWsTGC_prd_globalPosY->push_back(pos.y()); - m_NSWsTGC_prd_globalPosZ->push_back(pos.z()); - - m_NSWsTGC_prd_localPosX->push_back(loc_pos[0]); - m_NSWsTGC_prd_localPosY->push_back(loc_pos[1]); - m_NSWsTGC_prd_covMatrix_1_1->push_back(err_x); - m_NSWsTGC_prd_covMatrix_2_2->push_back(err_y); - - m_NSWsTGC_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nPRDs << " sTGC PRD's"); - - return StatusCode::SUCCESS; -} - -void sTGCPRDVariables::deleteVariables() -{ - delete m_NSWsTGC_prd_stationName; - delete m_NSWsTGC_prd_stationEta; - delete m_NSWsTGC_prd_stationPhi; - delete m_NSWsTGC_prd_multiplet; - delete m_NSWsTGC_prd_gas_gap; - delete m_NSWsTGC_prd_channel_type; - delete m_NSWsTGC_prd_channel; - delete m_NSWsTGC_prd_charge; - delete m_NSWsTGC_prd_bcTag; - - delete m_NSWsTGC_prd_globalPosX; - delete m_NSWsTGC_prd_globalPosY; - delete m_NSWsTGC_prd_globalPosZ; - - delete m_NSWsTGC_prd_localPosX; - delete m_NSWsTGC_prd_localPosY; - delete m_NSWsTGC_prd_covMatrix_1_1; - delete m_NSWsTGC_prd_covMatrix_2_2; - - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName = nullptr; - m_NSWsTGC_prd_stationEta = nullptr; - m_NSWsTGC_prd_stationPhi = nullptr; - m_NSWsTGC_prd_multiplet = nullptr; - m_NSWsTGC_prd_gas_gap = nullptr; - m_NSWsTGC_prd_channel_type = nullptr; - m_NSWsTGC_prd_channel = nullptr; - m_NSWsTGC_prd_charge = nullptr; - m_NSWsTGC_prd_bcTag = nullptr; - - m_NSWsTGC_prd_globalPosX = nullptr; - m_NSWsTGC_prd_globalPosY = nullptr; - m_NSWsTGC_prd_globalPosZ = nullptr; - - m_NSWsTGC_prd_localPosX = nullptr; - m_NSWsTGC_prd_localPosY = nullptr; - m_NSWsTGC_prd_covMatrix_1_1 = nullptr; - m_NSWsTGC_prd_covMatrix_2_2 = nullptr; - - return; -} - - -StatusCode sTGCPRDVariables::clearVariables() -{ - - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName->clear(); - m_NSWsTGC_prd_stationEta ->clear(); - m_NSWsTGC_prd_stationPhi ->clear(); - m_NSWsTGC_prd_multiplet ->clear(); - m_NSWsTGC_prd_gas_gap ->clear(); - m_NSWsTGC_prd_channel_type->clear(); - m_NSWsTGC_prd_channel ->clear(); - m_NSWsTGC_prd_charge ->clear(); - m_NSWsTGC_prd_bcTag ->clear(); - - m_NSWsTGC_prd_globalPosX ->clear(); - m_NSWsTGC_prd_globalPosY ->clear(); - m_NSWsTGC_prd_globalPosZ ->clear(); - - m_NSWsTGC_prd_localPosX ->clear(); - m_NSWsTGC_prd_localPosY ->clear(); - m_NSWsTGC_prd_covMatrix_1_1 ->clear(); - m_NSWsTGC_prd_covMatrix_2_2 ->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCPRDVariables::initializeVariables() -{ - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName = new std::vector; - m_NSWsTGC_prd_stationEta = new std::vector; - m_NSWsTGC_prd_stationPhi = new std::vector; - m_NSWsTGC_prd_multiplet = new std::vector; - m_NSWsTGC_prd_gas_gap = new std::vector; - m_NSWsTGC_prd_channel_type = new std::vector; - m_NSWsTGC_prd_channel = new std::vector; - m_NSWsTGC_prd_charge = new std::vector; - m_NSWsTGC_prd_bcTag = new std::vector; - - m_NSWsTGC_prd_globalPosX = new std::vector; - m_NSWsTGC_prd_globalPosY = new std::vector; - m_NSWsTGC_prd_globalPosZ = new std::vector; - - m_NSWsTGC_prd_localPosX = new std::vector; - m_NSWsTGC_prd_localPosY = new std::vector; - m_NSWsTGC_prd_covMatrix_1_1 = new std::vector; - m_NSWsTGC_prd_covMatrix_2_2 = new std::vector; - - if(m_tree) { - m_tree->Branch("PRD_sTGC", &m_NSWsTGC_nPRDs, "PRDs_sTGC_n/i"); - m_tree->Branch("PRD_sTGC_stationName", &m_NSWsTGC_prd_stationName); - m_tree->Branch("PRD_sTGC_stationEta", &m_NSWsTGC_prd_stationEta); - m_tree->Branch("PRD_sTGC_stationPhi", &m_NSWsTGC_prd_stationPhi); - m_tree->Branch("PRD_sTGC_multiplet", &m_NSWsTGC_prd_multiplet); - m_tree->Branch("PRD_sTGC_gas_gap", &m_NSWsTGC_prd_gas_gap); - m_tree->Branch("PRD_sTGC_channel_type",&m_NSWsTGC_prd_channel_type); - m_tree->Branch("PRD_sTGC_channel", &m_NSWsTGC_prd_channel); - m_tree->Branch("PRD_sTGC_charge", &m_NSWsTGC_prd_charge); - m_tree->Branch("PRD_sTGC_bcTag", &m_NSWsTGC_prd_bcTag); - - m_tree->Branch("PRD_sTGC_globalPosX", &m_NSWsTGC_prd_globalPosX); - m_tree->Branch("PRD_sTGC_globalPosY", &m_NSWsTGC_prd_globalPosY); - m_tree->Branch("PRD_sTGC_globalPosZ", &m_NSWsTGC_prd_globalPosZ); - - m_tree->Branch("PRD_sTGC_localPosX", &m_NSWsTGC_prd_localPosX); - m_tree->Branch("PRD_sTGC_localPosY", &m_NSWsTGC_prd_localPosY); - m_tree->Branch("PRD_sTGC_covMatrix_1_1", &m_NSWsTGC_prd_covMatrix_1_1); - m_tree->Branch("PRD_sTGC_covMatrix_2_2", &m_NSWsTGC_prd_covMatrix_2_2); - - } - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h deleted file mode 100644 index 5352cd701ce..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCPRDVARIABLES_H -#define STGCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCPRDVariables : public ValAlgVariables -{ - public: - sTGCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nPRDs(0), - m_NSWsTGC_prd_stationName(0), - m_NSWsTGC_prd_stationEta(0), - m_NSWsTGC_prd_stationPhi(0), - m_NSWsTGC_prd_multiplet(0), - m_NSWsTGC_prd_gas_gap(0), - m_NSWsTGC_prd_channel_type(0), - m_NSWsTGC_prd_channel(0), - m_NSWsTGC_prd_charge(0), - m_NSWsTGC_prd_bcTag(0), - m_NSWsTGC_prd_globalPosX(0), - m_NSWsTGC_prd_globalPosY(0), - m_NSWsTGC_prd_globalPosZ(0), - m_NSWsTGC_prd_localPosX(0), - m_NSWsTGC_prd_localPosY(0), - m_NSWsTGC_prd_covMatrix_1_1(0), - m_NSWsTGC_prd_covMatrix_2_2(0) - { - setHelper(idhelper); - } - - ~sTGCPRDVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCPRDVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nPRDs{}; - std::vector *m_NSWsTGC_prd_stationName; - std::vector *m_NSWsTGC_prd_stationEta; - std::vector *m_NSWsTGC_prd_stationPhi; - std::vector *m_NSWsTGC_prd_multiplet; - std::vector *m_NSWsTGC_prd_gas_gap; - std::vector *m_NSWsTGC_prd_channel_type; - std::vector *m_NSWsTGC_prd_channel; - std::vector *m_NSWsTGC_prd_charge; - std::vector *m_NSWsTGC_prd_bcTag; - - std::vector *m_NSWsTGC_prd_globalPosX; - std::vector *m_NSWsTGC_prd_globalPosY; - std::vector *m_NSWsTGC_prd_globalPosZ; - - std::vector *m_NSWsTGC_prd_localPosX; - std::vector *m_NSWsTGC_prd_localPosY; - std::vector *m_NSWsTGC_prd_covMatrix_1_1; - std::vector *m_NSWsTGC_prd_covMatrix_2_2; - -}; - -#endif // STGCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx deleted file mode 100644 index de25756d761..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCRDOVariables.h" -#include "AthenaBaseComps/AthAlgorithm.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/STGC_RawDataContainer.h" - -#include "TTree.h" -#include // for Form - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode sTGCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCRDOVariables()"); - - // clear variables - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG("Retrieve RDO container with name " << m_ContainerName); - // get the rdo (a container corresponds to a multilayer of a module) - const STGC_RawDataContainer* rdo_container = nullptr; - ATH_CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" sTGC RDO Container empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(const STGC_RawDataCollection* coll : *rdo_container) { - - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const STGC_RawData* rdo = coll->at(item); - Identifier Id = rdo->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - - ATH_MSG_DEBUG( "small TGC RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " ChType [" << channel_type << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWsTGC_rdo_stationName->push_back(stName); - m_NSWsTGC_rdo_stationEta->push_back(stationEta); - m_NSWsTGC_rdo_stationPhi->push_back(stationPhi); - m_NSWsTGC_rdo_multiplet->push_back(multiplet); - m_NSWsTGC_rdo_gas_gap->push_back(gas_gap); - m_NSWsTGC_rdo_channel->push_back(channel); - m_NSWsTGC_rdo_channel_type->push_back(channel_type); - m_NSWsTGC_rdo_time->push_back(rdo->time()); - m_NSWsTGC_rdo_tdo->push_back(rdo->tdo()); - m_NSWsTGC_rdo_charge->push_back(rdo->charge()); - m_NSWsTGC_rdo_bcTag->push_back(rdo->bcTag()); - m_NSWsTGC_rdo_isDead->push_back(rdo->isDead()); - - // get the readout element class where the RDO is recorded - int isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCRDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_NSWsTGC_rdo_localPosX->push_back(localStripPos.x()); - m_NSWsTGC_rdo_localPosY->push_back(localStripPos.y()); - ATH_MSG_DEBUG("sTGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("sTGC RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_NSWsTGC_rdo_globalPosX->push_back(globalStripPos.x()); - m_NSWsTGC_rdo_globalPosY->push_back(globalStripPos.y()); - m_NSWsTGC_rdo_globalPosZ->push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_NSWsTGC_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nrdo << " sTGC RDOs"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode sTGCRDOVariables::clearVariables() -{ - m_NSWsTGC_nrdo = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWsTGC_rdo - m_NSWsTGC_rdo_stationName->clear(); - m_NSWsTGC_rdo_stationEta->clear(); - m_NSWsTGC_rdo_stationPhi->clear(); - m_NSWsTGC_rdo_multiplet->clear(); - m_NSWsTGC_rdo_gas_gap->clear(); - m_NSWsTGC_rdo_channel->clear(); - m_NSWsTGC_rdo_channel_type->clear(); - m_NSWsTGC_rdo_time->clear(); - m_NSWsTGC_rdo_tdo->clear(); - m_NSWsTGC_rdo_charge->clear(); - m_NSWsTGC_rdo_bcTag->clear(); - m_NSWsTGC_rdo_isDead->clear(); - - m_NSWsTGC_rdo_globalPosX->clear(); - m_NSWsTGC_rdo_globalPosY->clear(); - m_NSWsTGC_rdo_globalPosZ->clear(); - - m_NSWsTGC_rdo_localPosX->clear(); - m_NSWsTGC_rdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode sTGCRDOVariables::initializeVariables() -{ - - m_NSWsTGC_nrdo = 0; - m_NSWsTGC_rdo_stationName = new std::vector(); - m_NSWsTGC_rdo_stationEta = new std::vector(); - m_NSWsTGC_rdo_stationPhi = new std::vector(); - m_NSWsTGC_rdo_multiplet = new std::vector(); - m_NSWsTGC_rdo_gas_gap = new std::vector(); - m_NSWsTGC_rdo_channel = new std::vector(); - m_NSWsTGC_rdo_channel_type= new std::vector(); - m_NSWsTGC_rdo_time = new std::vector(); - m_NSWsTGC_rdo_tdo = new std::vector(); - m_NSWsTGC_rdo_charge = new std::vector(); - m_NSWsTGC_rdo_bcTag = new std::vector(); - m_NSWsTGC_rdo_isDead = new std::vector(); - - m_NSWsTGC_rdo_localPosX = new std::vector(); - m_NSWsTGC_rdo_localPosY = new std::vector(); - - m_NSWsTGC_rdo_globalPosX = new std::vector(); - m_NSWsTGC_rdo_globalPosY = new std::vector(); - m_NSWsTGC_rdo_globalPosZ = new std::vector(); - - if(m_tree) { - m_tree->Branch("RDO_sTGC_n", &m_NSWsTGC_nrdo); - m_tree->Branch("RDO_sTGC_stationName", &m_NSWsTGC_rdo_stationName); - m_tree->Branch("RDO_sTGC_stationEta", &m_NSWsTGC_rdo_stationEta); - m_tree->Branch("RDO_sTGC_stationPhi", &m_NSWsTGC_rdo_stationPhi); - m_tree->Branch("RDO_sTGC_multiplet", &m_NSWsTGC_rdo_multiplet); - m_tree->Branch("RDO_sTGC_gas_gap", &m_NSWsTGC_rdo_gas_gap); - m_tree->Branch("RDO_sTGC_channel", &m_NSWsTGC_rdo_channel); - m_tree->Branch("RDO_sTGC_channel_type", &m_NSWsTGC_rdo_channel_type); - m_tree->Branch("RDO_sTGC_time", &m_NSWsTGC_rdo_time); - m_tree->Branch("RDO_sTGC_tdo", &m_NSWsTGC_rdo_tdo); - m_tree->Branch("RDO_sTGC_charge", &m_NSWsTGC_rdo_charge); - m_tree->Branch("RDO_sTGC_bcTag", &m_NSWsTGC_rdo_bcTag); - m_tree->Branch("RDO_sTGC_isDead", &m_NSWsTGC_rdo_isDead); - - m_tree->Branch("RDO_sTGC_localPosX", &m_NSWsTGC_rdo_localPosX); - m_tree->Branch("RDO_sTGC_localPosY", &m_NSWsTGC_rdo_localPosY); - - m_tree->Branch("RDO_sTGC_globalPosX", &m_NSWsTGC_rdo_globalPosX); - m_tree->Branch("RDO_sTGC_globalPosY", &m_NSWsTGC_rdo_globalPosY); - m_tree->Branch("RDO_sTGC_globalPosZ", &m_NSWsTGC_rdo_globalPosZ); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void sTGCRDOVariables::deleteVariables() -{ - delete m_NSWsTGC_rdo_stationName; - delete m_NSWsTGC_rdo_stationEta; - delete m_NSWsTGC_rdo_stationPhi; - delete m_NSWsTGC_rdo_multiplet; - delete m_NSWsTGC_rdo_gas_gap; - delete m_NSWsTGC_rdo_channel; - delete m_NSWsTGC_rdo_channel_type; - delete m_NSWsTGC_rdo_time; - delete m_NSWsTGC_rdo_tdo; - delete m_NSWsTGC_rdo_charge; - delete m_NSWsTGC_rdo_bcTag; - delete m_NSWsTGC_rdo_isDead; - delete m_NSWsTGC_rdo_localPosX; - delete m_NSWsTGC_rdo_localPosY; - delete m_NSWsTGC_rdo_globalPosX; - delete m_NSWsTGC_rdo_globalPosY; - delete m_NSWsTGC_rdo_globalPosZ; - - m_NSWsTGC_nrdo = 0; - m_NSWsTGC_rdo_stationName = nullptr; - m_NSWsTGC_rdo_stationEta = nullptr; - m_NSWsTGC_rdo_stationPhi = nullptr; - m_NSWsTGC_rdo_multiplet = nullptr; - m_NSWsTGC_rdo_gas_gap = nullptr; - m_NSWsTGC_rdo_channel = nullptr; - m_NSWsTGC_rdo_channel_type = nullptr; - m_NSWsTGC_rdo_time = nullptr; - m_NSWsTGC_rdo_tdo = nullptr; - m_NSWsTGC_rdo_charge = nullptr; - m_NSWsTGC_rdo_bcTag = nullptr; - m_NSWsTGC_rdo_isDead = nullptr; - m_NSWsTGC_rdo_localPosX = nullptr; - m_NSWsTGC_rdo_localPosY = nullptr; - m_NSWsTGC_rdo_globalPosX = nullptr; - m_NSWsTGC_rdo_globalPosY = nullptr; - m_NSWsTGC_rdo_globalPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h deleted file mode 100644 index fd520f9556f..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCRDOVARIABLES_H -#define STGCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCRDOVariables final : public ValAlgVariables -{ - public: - sTGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nrdo(0), - m_NSWsTGC_rdo_stationName(0), - m_NSWsTGC_rdo_stationEta(0), - m_NSWsTGC_rdo_stationPhi(0), - m_NSWsTGC_rdo_multiplet(0), - m_NSWsTGC_rdo_gas_gap(0), - m_NSWsTGC_rdo_channel(0), - m_NSWsTGC_rdo_channel_type(0), - m_NSWsTGC_rdo_time(0), - m_NSWsTGC_rdo_tdo(0), - m_NSWsTGC_rdo_charge(0), - m_NSWsTGC_rdo_bcTag(0), - m_NSWsTGC_rdo_isDead(0), - m_NSWsTGC_rdo_localPosX(0), - m_NSWsTGC_rdo_localPosY(0), - m_NSWsTGC_rdo_globalPosX(0), - m_NSWsTGC_rdo_globalPosY(0), - m_NSWsTGC_rdo_globalPosZ(0) - { - setHelper(idhelper); - } - - ~sTGCRDOVariables() override final { deleteVariables(); } - - StatusCode initializeVariables() override final; - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) override final; - - private: - - void setHelper(const MuonIdHelper* idhelper) override final{ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdHelper failed"); - throw std::runtime_error(" casting error in sTGCRDOVariables::setHelper"); - } - } - - void deleteVariables() override final; - StatusCode clearVariables() override final; - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nrdo{}; - std::vector *m_NSWsTGC_rdo_stationName; - std::vector *m_NSWsTGC_rdo_stationEta; - std::vector *m_NSWsTGC_rdo_stationPhi; - std::vector *m_NSWsTGC_rdo_multiplet; - std::vector *m_NSWsTGC_rdo_gas_gap; - std::vector *m_NSWsTGC_rdo_channel; - std::vector *m_NSWsTGC_rdo_channel_type; - std::vector *m_NSWsTGC_rdo_time; - std::vector *m_NSWsTGC_rdo_tdo; - std::vector *m_NSWsTGC_rdo_charge; - std::vector *m_NSWsTGC_rdo_bcTag; - std::vector *m_NSWsTGC_rdo_isDead; - - std::vector *m_NSWsTGC_rdo_localPosX; - std::vector *m_NSWsTGC_rdo_localPosY; - - std::vector *m_NSWsTGC_rdo_globalPosX; - std::vector *m_NSWsTGC_rdo_globalPosY; - std::vector *m_NSWsTGC_rdo_globalPosZ; -}; - -#endif // STGCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx deleted file mode 100644 index ed4860dab89..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx +++ /dev/null @@ -1,228 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCSDOVariables.h" - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "TTree.h" -#include // for Form - -StatusCode sTGCSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWsTGCSDOVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG( "Retrieve sTGC SDO container with name = " << m_ContainerName.c_str() ); - const MuonSimDataCollection* nsw_sTgcSdoContainer = nullptr; - ATH_CHECK( m_evtStore->retrieve(nsw_sTgcSdoContainer, m_ContainerName.c_str()) ); - - for ( const auto& coll : *nsw_sTgcSdoContainer ) { - - Identifier Id = coll.first; - const MuonSimData mm_sdo = coll.second; - - // Get information on the SDO - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - - - ATH_MSG_DEBUG( "sTGC SDO: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " ChType [" << channel_type << "]" ); - - m_NSWsTGC_sdo_stationName->push_back(stName); - m_NSWsTGC_sdo_stationEta->push_back(stationEta); - m_NSWsTGC_sdo_stationPhi->push_back(stationPhi); - m_NSWsTGC_sdo_multiplet->push_back(multiplet); - m_NSWsTGC_sdo_gas_gap->push_back(gas_gap); - m_NSWsTGC_sdo_channel->push_back(channel); - m_NSWsTGC_sdo_channel_type->push_back(channel_type); - - ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); - std::vector deposits; - mm_sdo.deposits(deposits); - - const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); - m_NSWsTGC_sdo_globalPosX->push_back( hit_gpos.x() ); - m_NSWsTGC_sdo_globalPosY->push_back( hit_gpos.y() ); - m_NSWsTGC_sdo_globalPosZ->push_back( hit_gpos.z() ); - - m_NSWsTGC_sdo_globaltime->push_back( mm_sdo.getTime() ); - m_NSWsTGC_sdo_word->push_back( mm_sdo.word() ); - - // use the information of the first deposit - int barcode = deposits[0].first.barcode(); - double MuonMCdata_firstentry = deposits[0].second.firstEntry(); - double MuonMCdata_secondentry = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("sTGC SDO barcode=" << barcode); - ATH_MSG_DEBUG("sTGC SDO energy=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry - << ", tof=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); - - m_NSWsTGC_sdo_barcode->push_back( barcode ); - m_NSWsTGC_sdo_E->push_back( MuonMCdata_firstentry ); - m_NSWsTGC_sdo_tof->push_back( MuonMCdata_secondentry ); - - // Retrive the detector element and local SDO coordinates - bool isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCSDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D loc_pos(0., 0.); - rdoEl->surface(Id).globalToLocal(hit_gpos, Amg::Vector3D(0., 0., 0.), loc_pos); - - ATH_MSG_DEBUG("sTGC SDO local position X=" << std::setw(9) << std::setprecision(2) << loc_pos[0] - << ", local position Y=" << std::setw(9) << std::setprecision(2) << loc_pos[1]); - - m_NSWsTGC_sdo_localPosX->push_back( loc_pos[0] ); - m_NSWsTGC_sdo_localPosY->push_back( loc_pos[1] ); - - m_NSWsTGC_nsdo++; - } - - ATH_MSG_DEBUG("Processed " << m_NSWsTGC_nsdo << " sTGC SDOs"); - return StatusCode::SUCCESS; -} - - -void sTGCSDOVariables::deleteVariables() -{ - delete m_NSWsTGC_sdo_stationName; - delete m_NSWsTGC_sdo_stationEta; - delete m_NSWsTGC_sdo_stationPhi; - delete m_NSWsTGC_sdo_multiplet; - delete m_NSWsTGC_sdo_gas_gap; - delete m_NSWsTGC_sdo_channel; - delete m_NSWsTGC_sdo_channel_type; - - delete m_NSWsTGC_sdo_word; - delete m_NSWsTGC_sdo_barcode; - delete m_NSWsTGC_sdo_globalPosX; - delete m_NSWsTGC_sdo_globalPosY; - delete m_NSWsTGC_sdo_globalPosZ; - delete m_NSWsTGC_sdo_globaltime; - - delete m_NSWsTGC_sdo_E; - delete m_NSWsTGC_sdo_tof; - - delete m_NSWsTGC_sdo_localPosX; - delete m_NSWsTGC_sdo_localPosY; - - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName = nullptr; - m_NSWsTGC_sdo_stationEta = nullptr; - m_NSWsTGC_sdo_stationPhi = nullptr; - m_NSWsTGC_sdo_multiplet = nullptr; - m_NSWsTGC_sdo_gas_gap = nullptr; - m_NSWsTGC_sdo_channel = nullptr; - m_NSWsTGC_sdo_channel_type = nullptr; - - m_NSWsTGC_sdo_word = nullptr; - m_NSWsTGC_sdo_barcode = nullptr; - m_NSWsTGC_sdo_globalPosX = nullptr; - m_NSWsTGC_sdo_globalPosY = nullptr; - m_NSWsTGC_sdo_globalPosZ = nullptr; - m_NSWsTGC_sdo_globaltime = nullptr; - - m_NSWsTGC_sdo_E = nullptr; - m_NSWsTGC_sdo_tof = nullptr; - - m_NSWsTGC_sdo_localPosX = nullptr; - m_NSWsTGC_sdo_localPosY = nullptr; - - return; -} - - -StatusCode sTGCSDOVariables::clearVariables() -{ - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName->clear(); - m_NSWsTGC_sdo_stationEta->clear(); - m_NSWsTGC_sdo_stationPhi->clear(); - m_NSWsTGC_sdo_multiplet->clear(); - m_NSWsTGC_sdo_gas_gap->clear(); - m_NSWsTGC_sdo_channel->clear(); - m_NSWsTGC_sdo_channel_type->clear(); - - m_NSWsTGC_sdo_word->clear(); - m_NSWsTGC_sdo_barcode->clear(); - m_NSWsTGC_sdo_globalPosX->clear(); - m_NSWsTGC_sdo_globalPosY->clear(); - m_NSWsTGC_sdo_globalPosZ->clear(); - m_NSWsTGC_sdo_globaltime->clear(); - m_NSWsTGC_sdo_E->clear(); - m_NSWsTGC_sdo_tof->clear(); - m_NSWsTGC_sdo_localPosX->clear(); - m_NSWsTGC_sdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCSDOVariables::initializeVariables() -{ - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName = new std::vector(); - m_NSWsTGC_sdo_stationEta = new std::vector(); - m_NSWsTGC_sdo_stationPhi = new std::vector(); - m_NSWsTGC_sdo_multiplet = new std::vector(); - m_NSWsTGC_sdo_gas_gap = new std::vector(); - m_NSWsTGC_sdo_channel = new std::vector(); - m_NSWsTGC_sdo_channel_type = new std::vector(); - - m_NSWsTGC_sdo_word = new std::vector(); - m_NSWsTGC_sdo_barcode = new std::vector(); - m_NSWsTGC_sdo_globalPosX = new std::vector(); - m_NSWsTGC_sdo_globalPosY = new std::vector(); - m_NSWsTGC_sdo_globalPosZ = new std::vector(); - m_NSWsTGC_sdo_globaltime = new std::vector(); - - m_NSWsTGC_sdo_E = new std::vector(); - m_NSWsTGC_sdo_tof = new std::vector(); - - m_NSWsTGC_sdo_localPosX = new std::vector; - m_NSWsTGC_sdo_localPosY = new std::vector; - - if(m_tree) { - - m_tree->Branch("SDO_sTGC", &m_NSWsTGC_nsdo, "SDOs_sTGC_n/i"); - m_tree->Branch("SDO_sTGC_stationName", &m_NSWsTGC_sdo_stationName); - m_tree->Branch("SDO_sTGC_stationEta", &m_NSWsTGC_sdo_stationEta); - m_tree->Branch("SDO_sTGC_stationPhi", &m_NSWsTGC_sdo_stationPhi); - m_tree->Branch("SDO_sTGC_multiplet", &m_NSWsTGC_sdo_multiplet); - m_tree->Branch("SDO_sTGC_gas_gap", &m_NSWsTGC_sdo_gas_gap); - m_tree->Branch("SDO_sTGC_channel", &m_NSWsTGC_sdo_channel); - m_tree->Branch("SDO_sTGC_channel_type", &m_NSWsTGC_sdo_channel_type); - - m_tree->Branch("SDO_sTGC_word", &m_NSWsTGC_sdo_word); - m_tree->Branch("SDO_sTGC_barcode", &m_NSWsTGC_sdo_barcode); - m_tree->Branch("SDO_sTGC_globalPosX", &m_NSWsTGC_sdo_globalPosX); - m_tree->Branch("SDO_sTGC_globalPosY", &m_NSWsTGC_sdo_globalPosY); - m_tree->Branch("SDO_sTGC_globalPosZ", &m_NSWsTGC_sdo_globalPosZ); - m_tree->Branch("SDO_sTGC_global_time", &m_NSWsTGC_sdo_globaltime); - m_tree->Branch("SDO_sTGC_Energy", &m_NSWsTGC_sdo_E); - m_tree->Branch("SDO_sTGC_tof", &m_NSWsTGC_sdo_tof); - - m_tree->Branch("SDO_sTGC_localPosX", &m_NSWsTGC_sdo_localPosX); - m_tree->Branch("SDO_sTGC_localPosY", &m_NSWsTGC_sdo_localPosY); - - } - - return StatusCode::SUCCESS; -} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h deleted file mode 100644 index b0faa4eaa90..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCSDOVARIABLES_H -#define STGCSDOVARIABLES_H - -#include - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" - -class sTGCSDOVariables : public ValAlgVariables -{ - public: - sTGCSDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nsdo(0), - m_NSWsTGC_sdo_stationName(0), - m_NSWsTGC_sdo_stationEta(0), - m_NSWsTGC_sdo_stationPhi(0), - m_NSWsTGC_sdo_multiplet(0), - m_NSWsTGC_sdo_gas_gap(0), - m_NSWsTGC_sdo_channel(0), - m_NSWsTGC_sdo_channel_type(0), - m_NSWsTGC_sdo_word(0), - m_NSWsTGC_sdo_barcode(0), - m_NSWsTGC_sdo_globalPosX(0), - m_NSWsTGC_sdo_globalPosY(0), - m_NSWsTGC_sdo_globalPosZ(0), - m_NSWsTGC_sdo_globaltime(0), - m_NSWsTGC_sdo_E(0), - m_NSWsTGC_sdo_tof(0), - m_NSWsTGC_sdo_localPosX(0), - m_NSWsTGC_sdo_localPosY(0) - { - setHelper(idhelper); - } - - ~sTGCSDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in sTGCSDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nsdo{}; - std::vector *m_NSWsTGC_sdo_stationName; - std::vector *m_NSWsTGC_sdo_stationEta; - std::vector *m_NSWsTGC_sdo_stationPhi; - std::vector *m_NSWsTGC_sdo_multiplet; - std::vector *m_NSWsTGC_sdo_gas_gap; - std::vector *m_NSWsTGC_sdo_channel; - std::vector *m_NSWsTGC_sdo_channel_type; - - std::vector *m_NSWsTGC_sdo_word; - std::vector *m_NSWsTGC_sdo_barcode; - std::vector *m_NSWsTGC_sdo_globalPosX; - std::vector *m_NSWsTGC_sdo_globalPosY; - std::vector *m_NSWsTGC_sdo_globalPosZ; - std::vector *m_NSWsTGC_sdo_globaltime; - - std::vector *m_NSWsTGC_sdo_E; - std::vector *m_NSWsTGC_sdo_tof; - - std::vector *m_NSWsTGC_sdo_localPosX; - std::vector *m_NSWsTGC_sdo_localPosY; - -}; - -#endif // STGCSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx deleted file mode 100644 index 28df0d2eb2b..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx +++ /dev/null @@ -1,390 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCSimHitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimEvent/sTGCSimHitCollection.h" -#include "MuonSimEvent/sTgcSimIdToOfflineId.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "TTree.h" - -StatusCode sTGCSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCHitVariables()"); - - CHECK( this->clearVariables() ); - - const sTGCSimHitCollection *nswContainer = nullptr; - CHECK( m_evtStore->retrieve(nswContainer, m_ContainerName.c_str()) ); - - ATH_MSG_DEBUG("ReadMuonSimHits: Retrieved " << nswContainer->size() << " sTGC hits!" ); - - // Get sTGC Helper - sTgcHitIdHelper* hitHelper = sTgcHitIdHelper::GetHelper(); - sTgcSimIdToOfflineId simToOffline(m_sTgcIdHelper); - - if(!nswContainer->size()) ATH_MSG_DEBUG(m_ContainerName<<" container empty"); - for(const sTGCSimHit& hit : *nswContainer) { - if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - - // SimHits do not have channel type. - // Compute channel type in Val Alg to be able to validate - for( int type=0;type<=2;++type ){ - - // Read information about the sTGC hits; make sanity checks and printout - int simId = hit.sTGCId(); - std::string sim_stationName = hitHelper->GetStationName(simId); - int sim_stationEta = hitHelper->GetZSector(simId); - int sim_stationPhi = hitHelper->GetPhiSector(simId); - int sim_multilayer = hitHelper->GetMultiLayer(simId); - int sim_layer = hitHelper->GetLayer(simId); - int sim_side = hitHelper->GetSide(simId); - - ATH_MSG_DEBUG( "sTGC SimHit id: Station Name [" << sim_stationName << " ]" - << " Station Eta [" << sim_stationEta << "]" - << " Station Phi [" << sim_stationPhi << "]" - << " MultiLayer [" << sim_multilayer << "]" - << " Layer [" << sim_layer << "]" - << " Side [" << sim_side << "]" ); - - if ( sim_stationPhi==0 ) { - ATH_MSG_ERROR("unexpected phi range: " << sim_stationPhi); - return StatusCode::FAILURE; - } - // Old [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] - // Current implementation of the Station Name is: Q[L/S][1-3][P/C] - int detNumber = -999, wedgeId = -999, wedgeType = -999; - if(sim_stationName.length()!=4) { - ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); - } - else { - detNumber = atoi(sim_stationName.substr(2,1).c_str()); - wedgeId = (sim_stationName.substr(1,1).compare("L")) ? 0 : 1; - wedgeType = (sim_stationName.substr(3,1).compare("P")) ? 0 : 1; - } - - - // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. - // For offline identifier, station Name is: STS or STL - Identifier offId = simToOffline.convert(hit.sTGCId()); - - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(offId)); - int off_stationEta = m_sTgcIdHelper->stationEta(offId); - int off_stationPhi = m_sTgcIdHelper->stationPhi(offId); - int off_multiplet = m_sTgcIdHelper->multilayer(offId); - int off_gas_gap = m_sTgcIdHelper->gasGap(offId); - int off_channel_type = m_sTgcIdHelper->channelType(offId); - int off_channel = m_sTgcIdHelper->channel(offId); - - int isSmall = stName[2] == 'S'; - - if( type == 2 && off_channel == 63) { - ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); - continue; - } - - const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(offId); - if (!detEl) { - ATH_MSG_ERROR("sTGCSimHitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for "<print_to_string(offId).c_str()); - return StatusCode::FAILURE; - } - - if( !m_sTgcIdHelper->is_stgc(offId) ){ - ATH_MSG_WARNING("sTgc id is not a stgc id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( !m_sTgcIdHelper->is_muon(offId) ){ - ATH_MSG_WARNING("sTgc id is not a muon id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( m_sTgcIdHelper->is_mdt(offId)||m_sTgcIdHelper->is_rpc(offId)||m_sTgcIdHelper->is_tgc(offId)||m_sTgcIdHelper->is_csc(offId)||m_sTgcIdHelper->is_mm(offId) ){ - ATH_MSG_WARNING("sTgc id has wrong technology type! " << m_sTgcIdHelper->is_mdt(offId) << " " << m_sTgcIdHelper->is_rpc(offId) - << " " << m_sTgcIdHelper->is_tgc(offId) << " " << m_sTgcIdHelper->is_csc(offId) << " " << m_sTgcIdHelper->is_mm(offId) ); - } - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTgc id has bad layer field! " << m_sTgcIdHelper->print_to_string(offId) ); - } - // connect the hit with the MC truth - int barcode = hit.particleLink().barcode(); - m_NSWsTGC_trackId.push_back(barcode); - - m_NSWsTGC_globalTime.push_back(hit.globalTime()); - const Amg::Vector3D& globalPosition = hit.globalPosition(); - m_NSWsTGC_hitGlobalPositionX.push_back(globalPosition.x()); - m_NSWsTGC_hitGlobalPositionY.push_back(globalPosition.y()); - m_NSWsTGC_hitGlobalPositionZ.push_back(globalPosition.z()); - m_NSWsTGC_hitGlobalPositionR.push_back(globalPosition.perp()); - m_NSWsTGC_hitGlobalPositionP.push_back(globalPosition.phi()); - const Amg::Vector3D& globalDirection = hit.globalDirection(); - m_NSWsTGC_hitGlobalDirectionX.push_back(globalDirection.x()); - m_NSWsTGC_hitGlobalDirectionY.push_back(globalDirection.y()); - m_NSWsTGC_hitGlobalDirectionZ.push_back(globalDirection.z()); - - m_NSWsTGC_particleEncoding.push_back(hit.particleEncoding()); - m_NSWsTGC_depositEnergy.push_back(hit.depositEnergy()); - m_NSWsTGC_kineticEnergy.push_back(hit.kineticEnergy()); - - const Amg::Vector3D& globalPrePosition = hit.globalPrePosition(); - m_NSWsTGC_hitGlobalPrePositionX.push_back(globalPrePosition.x()); - m_NSWsTGC_hitGlobalPrePositionY.push_back(globalPrePosition.y()); - m_NSWsTGC_hitGlobalPrePositionZ.push_back(globalPrePosition.z()); - m_NSWsTGC_hitGlobalPrePositionR.push_back(globalPrePosition.perp()); - m_NSWsTGC_hitGlobalPrePositionP.push_back(globalPrePosition.phi()); - if (hit.kineticEnergy() < 0.0) { - m_NSWsTGC_hitGlobalPrePositionX.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionY.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionZ.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionR.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionP.push_back(-9999.9); - } - - - // Fill Ntuple with SimId data - m_NSWsTGC_sim_stationName .push_back(sim_stationName); - m_NSWsTGC_sim_stationEta .push_back(sim_stationEta); - m_NSWsTGC_sim_stationPhi .push_back(sim_stationPhi); - m_NSWsTGC_wedgeId .push_back(wedgeId); - m_NSWsTGC_wedgeType .push_back(wedgeType); - m_NSWsTGC_detectorNumber .push_back(detNumber); - m_NSWsTGC_sim_multilayer .push_back(sim_multilayer); - m_NSWsTGC_sim_layer .push_back(sim_layer); - m_NSWsTGC_sim_side .push_back(sim_side); - - ATH_MSG_DEBUG( "sTGC Offline id: Station Name [" << stName << "]" - << " Station Eta [" << off_stationEta << "]" - << " Station Phi [" << off_stationPhi << "]" - << " Multiplet [" << off_multiplet << "]" - << " GasGap [" << off_gas_gap << "]" - << " Type [" << off_channel_type << "]" - << " ChNr [" << off_channel << "]" ); - - ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) - << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); - - - Identifier newId = m_sTgcIdHelper->channelID(m_sTgcIdHelper->parentID(offId), m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),type,1); - - // compute hit position within the detector element/surfaces - const Trk::PlaneSurface& surf = detEl->surface(newId); - Amg::Transform3D gToL = detEl->absTransform().inverse(); - Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); - Amg::Vector3D dSurface_pos = gToL*hpos; - - // compute the hit position on the readout plane (same as in MuonFastDigitization) - Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; - Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); - - ATH_MSG_DEBUG("sTGC channel type:" << type); - - double scale = -rSurface_pos.z()/ldir.z(); - Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; - - // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing - Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); - - // remember whether the given hit is inside the active volume (and produces a valid digit) - m_NSWsTGC_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); - - int stripNumber = detEl->stripNumber(posOnSurf,newId); - if( stripNumber == -1 ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << m_sTgcIdHelper->print_to_string(offId) ); - ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); - //stripNumber = 1; - } - Identifier oldId = offId; - offId = m_sTgcIdHelper->channelID(offId, m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),1,stripNumber); - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << m_sTgcIdHelper->print_to_string(offId) << std::endl - << " " << m_sTgcIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); - } - - Amg::Vector2D fastDigitPos(0,0); - if( !detEl->stripPosition(offId,fastDigitPos) ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << m_sTgcIdHelper->print_to_string(offId) ); - } - - Amg::Vector3D detpos = detEl->globalPosition(); - ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() - << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() - << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); - - ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); - ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() - << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); - - - - // Fill Ntuple with offline ID data - m_NSWsTGC_off_stationName .push_back(stName); - m_NSWsTGC_off_stationEta .push_back(off_stationEta); - m_NSWsTGC_off_stationPhi .push_back(off_stationPhi); - m_NSWsTGC_off_multiplet .push_back(off_multiplet); - m_NSWsTGC_off_gas_gap .push_back(off_gas_gap); - m_NSWsTGC_off_channel_type .push_back(type); - // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. - // As a temporary solution stripnumber is used directly (also in MM) - off_channel = stripNumber; - m_NSWsTGC_off_channel .push_back(off_channel); - - - // Fill ntuple with the hit/surface/digit positions - m_NSWsTGC_detector_globalPositionX.push_back( detpos.x() ); - m_NSWsTGC_detector_globalPositionY.push_back( detpos.y() ); - m_NSWsTGC_detector_globalPositionZ.push_back( detpos.z() ); - m_NSWsTGC_detector_globalPositionR.push_back( detpos.perp() ); - m_NSWsTGC_detector_globalPositionP.push_back( detpos.phi() ); - - m_NSWsTGC_hitToDsurfacePositionX.push_back( dSurface_pos.x() ); - m_NSWsTGC_hitToDsurfacePositionY.push_back( dSurface_pos.y() ); - m_NSWsTGC_hitToDsurfacePositionZ.push_back( dSurface_pos.z() ); - - m_NSWsTGC_hitToRsurfacePositionX.push_back( rSurface_pos.x() ); - m_NSWsTGC_hitToRsurfacePositionY.push_back( rSurface_pos.y() ); - m_NSWsTGC_hitToRsurfacePositionZ.push_back( rSurface_pos.z() ); - - m_NSWsTGC_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); - m_NSWsTGC_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); - - - - m_NSWsTGC_stripNumber.push_back(stripNumber); - m_NSWsTGC_wireNumber.push_back(-999); - - ATH_MSG_DEBUG("---------- Hit processing ends!"); - /* - ATH_MSG_DEBUG( " NSW Hits E = " << hit.depositEnergy() - << ", Global X sTGC = " << globalPosition.x() - << ", Global Y sTGC = " << globalPosition.y() - << ", Global Z sTGC = " << globalPosition.z() - << ", time = " << hit.globalTime() - */ - m_NSWsTGC_nSimHits++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nSimHits << " sTGC sim hits"); - return StatusCode::SUCCESS; -} - - -StatusCode sTGCSimHitVariables::clearVariables() -{ - m_NSWsTGC_nSimHits = 0; - m_NSWsTGC_trackId.clear(); - m_NSWsTGC_isInsideBounds.clear(); - m_NSWsTGC_globalTime.clear(); - m_NSWsTGC_hitGlobalPositionX.clear(); - m_NSWsTGC_hitGlobalPositionY.clear(); - m_NSWsTGC_hitGlobalPositionZ.clear(); - m_NSWsTGC_hitGlobalPositionR.clear(); - m_NSWsTGC_hitGlobalPositionP.clear(); - m_NSWsTGC_hitGlobalDirectionX.clear(); - m_NSWsTGC_hitGlobalDirectionY.clear(); - m_NSWsTGC_hitGlobalDirectionZ.clear(); - m_NSWsTGC_hitGlobalPrePositionX.clear(); - m_NSWsTGC_hitGlobalPrePositionY.clear(); - m_NSWsTGC_hitGlobalPrePositionZ.clear(); - m_NSWsTGC_hitGlobalPrePositionR.clear(); - m_NSWsTGC_hitGlobalPrePositionP.clear(); - m_NSWsTGC_detector_globalPositionX.clear(); - m_NSWsTGC_detector_globalPositionY.clear(); - m_NSWsTGC_detector_globalPositionZ.clear(); - m_NSWsTGC_detector_globalPositionR.clear(); - m_NSWsTGC_detector_globalPositionP.clear(); - m_NSWsTGC_hitToDsurfacePositionX.clear(); - m_NSWsTGC_hitToDsurfacePositionY.clear(); - m_NSWsTGC_hitToDsurfacePositionZ.clear(); - m_NSWsTGC_hitToRsurfacePositionX.clear(); - m_NSWsTGC_hitToRsurfacePositionY.clear(); - m_NSWsTGC_hitToRsurfacePositionZ.clear(); - m_NSWsTGC_FastDigitRsurfacePositionX.clear(); - m_NSWsTGC_FastDigitRsurfacePositionY.clear(); - m_NSWsTGC_particleEncoding.clear(); - m_NSWsTGC_depositEnergy.clear(); - m_NSWsTGC_kineticEnergy.clear(); - m_NSWsTGC_sim_stationName.clear(); - m_NSWsTGC_wedgeId.clear(); - m_NSWsTGC_wedgeType.clear(); - m_NSWsTGC_detectorNumber.clear(); - m_NSWsTGC_sim_stationEta.clear(); - m_NSWsTGC_sim_stationPhi.clear(); - m_NSWsTGC_sim_multilayer.clear(); - m_NSWsTGC_sim_layer.clear(); - m_NSWsTGC_sim_side.clear(); - m_NSWsTGC_stripNumber.clear(); - m_NSWsTGC_wireNumber.clear(); - m_NSWsTGC_off_stationName.clear(); - m_NSWsTGC_off_stationEta.clear(); - m_NSWsTGC_off_stationPhi.clear(); - m_NSWsTGC_off_multiplet.clear(); - m_NSWsTGC_off_gas_gap.clear(); - m_NSWsTGC_off_channel_type.clear(); - m_NSWsTGC_off_channel.clear(); - return StatusCode::SUCCESS; -} - -void sTGCSimHitVariables::deleteVariables() -{ - return; -} - -StatusCode sTGCSimHitVariables::initializeVariables() -{ - if(m_tree) { - m_tree->Branch("Hits_sTGC_n", &m_NSWsTGC_nSimHits, "Hits_sTGC_nSimHits/i"); - m_tree->Branch("Hits_sTGC_trackId", &m_NSWsTGC_trackId); - m_tree->Branch("Hits_sTGC_isInsideBounds", &m_NSWsTGC_isInsideBounds); - m_tree->Branch("Hits_sTGC_globalTime", &m_NSWsTGC_globalTime); - m_tree->Branch("Hits_sTGC_hitGlobalPositionX", &m_NSWsTGC_hitGlobalPositionX); - m_tree->Branch("Hits_sTGC_hitGlobalPositionY", &m_NSWsTGC_hitGlobalPositionY); - m_tree->Branch("Hits_sTGC_hitGlobalPositionZ", &m_NSWsTGC_hitGlobalPositionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPositionR", &m_NSWsTGC_hitGlobalPositionR); - m_tree->Branch("Hits_sTGC_hitGlobalPositionP", &m_NSWsTGC_hitGlobalPositionP); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionX", &m_NSWsTGC_hitGlobalDirectionX); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionY", &m_NSWsTGC_hitGlobalDirectionY); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionZ", &m_NSWsTGC_hitGlobalDirectionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionX", &m_NSWsTGC_hitGlobalPrePositionX); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionY", &m_NSWsTGC_hitGlobalPrePositionY); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionZ", &m_NSWsTGC_hitGlobalPrePositionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionR", &m_NSWsTGC_hitGlobalPrePositionR); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionP", &m_NSWsTGC_hitGlobalPrePositionP); - m_tree->Branch("Hits_sTGC_detector_globalPositionX", &m_NSWsTGC_detector_globalPositionX); - m_tree->Branch("Hits_sTGC_detector_globalPositionY", &m_NSWsTGC_detector_globalPositionY); - m_tree->Branch("Hits_sTGC_detector_globalPositionZ", &m_NSWsTGC_detector_globalPositionZ); - m_tree->Branch("Hits_sTGC_detector_globalPositionR", &m_NSWsTGC_detector_globalPositionR); - m_tree->Branch("Hits_sTGC_detector_globalPositionP", &m_NSWsTGC_detector_globalPositionP); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionX", &m_NSWsTGC_hitToDsurfacePositionX); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionY", &m_NSWsTGC_hitToDsurfacePositionY); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionZ", &m_NSWsTGC_hitToDsurfacePositionZ); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionX", &m_NSWsTGC_hitToRsurfacePositionX); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionY", &m_NSWsTGC_hitToRsurfacePositionY); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionZ", &m_NSWsTGC_hitToRsurfacePositionZ); - m_tree->Branch("Hits_sTGC_FastDigitRsurfacePositionX", &m_NSWsTGC_FastDigitRsurfacePositionX); - m_tree->Branch("Hits_sTGC_FastDigitRsurfacePositionY", &m_NSWsTGC_FastDigitRsurfacePositionY); - m_tree->Branch("Hits_sTGC_particleEncoding", &m_NSWsTGC_particleEncoding); - m_tree->Branch("Hits_sTGC_depositEnergy", &m_NSWsTGC_depositEnergy); - m_tree->Branch("Hits_sTGC_kineticEnergy", &m_NSWsTGC_kineticEnergy); - m_tree->Branch("Hits_sTGC_sim_stationName", &m_NSWsTGC_sim_stationName); - m_tree->Branch("Hits_sTGC_wedgeId", &m_NSWsTGC_wedgeId); - m_tree->Branch("Hits_sTGC_wedgeType", &m_NSWsTGC_wedgeType); - m_tree->Branch("Hits_sTGC_detectorNumber", &m_NSWsTGC_detectorNumber); - m_tree->Branch("Hits_sTGC_sim_stationEta", &m_NSWsTGC_sim_stationEta); - m_tree->Branch("Hits_sTGC_sim_stationPhi", &m_NSWsTGC_sim_stationPhi); - m_tree->Branch("Hits_sTGC_sim_multilayer", &m_NSWsTGC_sim_multilayer); - m_tree->Branch("Hits_sTGC_sim_layer", &m_NSWsTGC_sim_layer); - m_tree->Branch("Hits_sTGC_sim_side", &m_NSWsTGC_sim_side); - m_tree->Branch("Hits_sTGC_stripNumber", &m_NSWsTGC_stripNumber); - m_tree->Branch("Hits_sTGC_wireNumber", &m_NSWsTGC_wireNumber); - m_tree->Branch("Hits_sTGC_off_stationName", &m_NSWsTGC_off_stationName); - m_tree->Branch("Hits_sTGC_off_stationEta", &m_NSWsTGC_off_stationEta); - m_tree->Branch("Hits_sTGC_off_stationPhi", &m_NSWsTGC_off_stationPhi); - m_tree->Branch("Hits_sTGC_off_multiplet", &m_NSWsTGC_off_multiplet); - m_tree->Branch("Hits_sTGC_off_gas_gap", &m_NSWsTGC_off_gas_gap); - m_tree->Branch("Hits_sTGC_off_channel_type", &m_NSWsTGC_off_channel_type); - m_tree->Branch("Hits_sTGC_off_channel", &m_NSWsTGC_off_channel); - } - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h deleted file mode 100644 index f41fa1fc5e7..00000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCSIMHITVARIABLES_H -#define STGCSIMHITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCSimHitVariables : public ValAlgVariables -{ - public: - sTGCSimHitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(nullptr), - m_NSWsTGC_nSimHits(0), - m_NSWsTGC_trackId(), - m_NSWsTGC_isInsideBounds(), - m_NSWsTGC_globalTime(), - m_NSWsTGC_hitGlobalPositionX(), - m_NSWsTGC_hitGlobalPositionY(), - m_NSWsTGC_hitGlobalPositionZ(), - m_NSWsTGC_hitGlobalPositionR(), - m_NSWsTGC_hitGlobalPositionP(), - m_NSWsTGC_hitGlobalDirectionX(), - m_NSWsTGC_hitGlobalDirectionY(), - m_NSWsTGC_hitGlobalDirectionZ(), - m_NSWsTGC_hitGlobalPrePositionX(), - m_NSWsTGC_hitGlobalPrePositionY(), - m_NSWsTGC_hitGlobalPrePositionZ(), - m_NSWsTGC_hitGlobalPrePositionR(), - m_NSWsTGC_hitGlobalPrePositionP(), - m_NSWsTGC_detector_globalPositionX(), - m_NSWsTGC_detector_globalPositionY(), - m_NSWsTGC_detector_globalPositionZ(), - m_NSWsTGC_detector_globalPositionR(), - m_NSWsTGC_detector_globalPositionP(), - m_NSWsTGC_hitToDsurfacePositionX(), - m_NSWsTGC_hitToDsurfacePositionY(), - m_NSWsTGC_hitToDsurfacePositionZ(), - m_NSWsTGC_hitToRsurfacePositionX(), - m_NSWsTGC_hitToRsurfacePositionY(), - m_NSWsTGC_hitToRsurfacePositionZ(), - m_NSWsTGC_FastDigitRsurfacePositionX(), - m_NSWsTGC_FastDigitRsurfacePositionY(), - m_NSWsTGC_particleEncoding(), - m_NSWsTGC_depositEnergy(), - m_NSWsTGC_kineticEnergy(), - m_NSWsTGC_sim_stationName(), - m_NSWsTGC_wedgeId(), - m_NSWsTGC_wedgeType(), - m_NSWsTGC_detectorNumber(), - m_NSWsTGC_sim_stationEta(), - m_NSWsTGC_sim_stationPhi(), - m_NSWsTGC_sim_multilayer(), - m_NSWsTGC_sim_layer(), - m_NSWsTGC_sim_side(), - m_NSWsTGC_stripNumber(), - m_NSWsTGC_wireNumber(), - m_NSWsTGC_off_stationName(), - m_NSWsTGC_off_stationEta(), - m_NSWsTGC_off_stationPhi(), - m_NSWsTGC_off_multiplet(), - m_NSWsTGC_off_gas_gap(), - m_NSWsTGC_off_channel_type(), - m_NSWsTGC_off_channel() - { - setHelper(idhelper); - } - - ~sTGCSimHitVariables() - { - this->deleteVariables(); - } - - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(!m_sTgcIdHelper) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCSimHitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nSimHits{}; - std::vector m_NSWsTGC_trackId; - - std::vector m_NSWsTGC_isInsideBounds; - - std::vector m_NSWsTGC_globalTime; - std::vector m_NSWsTGC_hitGlobalPositionX; - std::vector m_NSWsTGC_hitGlobalPositionY; - std::vector m_NSWsTGC_hitGlobalPositionZ; - std::vector m_NSWsTGC_hitGlobalPositionR; - std::vector m_NSWsTGC_hitGlobalPositionP; - std::vector m_NSWsTGC_hitGlobalDirectionX; - std::vector m_NSWsTGC_hitGlobalDirectionY; - std::vector m_NSWsTGC_hitGlobalDirectionZ; - std::vector m_NSWsTGC_hitGlobalPrePositionX; - std::vector m_NSWsTGC_hitGlobalPrePositionY; - std::vector m_NSWsTGC_hitGlobalPrePositionZ; - std::vector m_NSWsTGC_hitGlobalPrePositionR; - std::vector m_NSWsTGC_hitGlobalPrePositionP; - - std::vector m_NSWsTGC_detector_globalPositionX; - std::vector m_NSWsTGC_detector_globalPositionY; - std::vector m_NSWsTGC_detector_globalPositionZ; - std::vector m_NSWsTGC_detector_globalPositionR; - std::vector m_NSWsTGC_detector_globalPositionP; - - std::vector m_NSWsTGC_hitToDsurfacePositionX; - std::vector m_NSWsTGC_hitToDsurfacePositionY; - std::vector m_NSWsTGC_hitToDsurfacePositionZ; - - std::vector m_NSWsTGC_hitToRsurfacePositionX; - std::vector m_NSWsTGC_hitToRsurfacePositionY; - std::vector m_NSWsTGC_hitToRsurfacePositionZ; - - std::vector m_NSWsTGC_FastDigitRsurfacePositionX; - std::vector m_NSWsTGC_FastDigitRsurfacePositionY; - - std::vector m_NSWsTGC_particleEncoding; - std::vector m_NSWsTGC_depositEnergy; - std::vector m_NSWsTGC_kineticEnergy; - - std::vector m_NSWsTGC_sim_stationName; - std::vector m_NSWsTGC_wedgeId; // large=0, small=1 - std::vector m_NSWsTGC_wedgeType; // pivot 0, confirmation 1 - std::vector m_NSWsTGC_detectorNumber; // quad [1-3] - std::vector m_NSWsTGC_sim_stationEta; - std::vector m_NSWsTGC_sim_stationPhi; // [1-16] - std::vector m_NSWsTGC_sim_multilayer; // [1-2] - std::vector m_NSWsTGC_sim_layer; // [1-4] - std::vector m_NSWsTGC_sim_side; // -1 or 1 - std::vector m_NSWsTGC_stripNumber; - std::vector m_NSWsTGC_wireNumber; // wire groups 0-31 in increasing phi - - std::vector m_NSWsTGC_off_stationName; - std::vector m_NSWsTGC_off_stationEta; - std::vector m_NSWsTGC_off_stationPhi; - std::vector m_NSWsTGC_off_multiplet; - std::vector m_NSWsTGC_off_gas_gap; - std::vector m_NSWsTGC_off_channel_type; - std::vector m_NSWsTGC_off_channel; - - -}; - -#endif // STGCSIMHITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h b/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h index edde97602cc..397de702928 100644 --- a/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h +++ b/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h @@ -88,4 +88,31 @@ private: VectorBranch& m_channel{parent().newVector(name() + "_channel")}; }; -#endif +/// Branch to store all information of the sTgcIdentifier +class sTgcIdentifierBranch : public MuonIdentifierBranch { +public: + sTgcIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name); + + void push_back(const Identifier& id) override final; + +private: + VectorBranch& m_gas_gap{parent().newVector(name() + "_gas_gap")}; + VectorBranch& m_multiplet{parent().newVector(name() + "_multiplet")}; + VectorBranch& m_channel_type{parent().newVector(name() + "_channel_type")}; + VectorBranch& m_channel{parent().newVector(name() + "_channel")}; +}; + +/// Branch to store all information of the MmIdentifier +class MmIdentifierBranch : public MuonIdentifierBranch { +public: + MmIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name); + + void push_back(const Identifier& id) override final; + +private: + VectorBranch& m_gas_gap{parent().newVector(name() + "_gas_gap")}; + VectorBranch& m_multiplet{parent().newVector(name() + "_multiplet")}; + VectorBranch& m_channel{parent().newVector(name() + "_channel")}; +}; + +#endif \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx b/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx index be4a9568037..4c9324114c6 100644 --- a/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx +++ b/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx @@ -79,4 +79,29 @@ void TgcIdentifierBranch::push_back(const Identifier& id) { m_gasgap.push_back(idHelperSvc()->tgcIdHelper().gasGap(id)); m_measuresPhi.push_back(idHelperSvc()->tgcIdHelper().measuresPhi(id)); m_channel.push_back(idHelperSvc()->tgcIdHelper().channel(id)); +} + +///############################################################### +/// sTgcIdentifierBranch +///############################################################### +sTgcIdentifierBranch::sTgcIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name) : MuonIdentifierBranch(tree, grp_name) {} + +void sTgcIdentifierBranch::push_back(const Identifier& id) { + MuonIdentifierBranch::push_back(id); + m_gas_gap.push_back(idHelperSvc()->stgcIdHelper().gasGap(id)); + m_multiplet.push_back(idHelperSvc()->stgcIdHelper().multilayer(id)); + m_channel_type.push_back(idHelperSvc()->stgcIdHelper().channelType(id)); + m_channel.push_back(idHelperSvc()->stgcIdHelper().channel(id)); +} + +///############################################################### +/// MmIdentifierBranch +///############################################################### +MmIdentifierBranch::MmIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name) : MuonIdentifierBranch(tree, grp_name) {} + +void MmIdentifierBranch::push_back(const Identifier& id) { + MuonIdentifierBranch::push_back(id); + m_gas_gap.push_back(idHelperSvc()->mmIdHelper().gasGap(id)); + m_multiplet.push_back(idHelperSvc()->mmIdHelper().multilayer(id)); + m_channel.push_back(idHelperSvc()->mmIdHelper().channel(id)); } \ No newline at end of file -- GitLab From 7ee67d04a14eae10f26d6812c17c3cafdc95c603 Mon Sep 17 00:00:00 2001 From: Tomasz Bold Date: Tue, 24 May 2022 10:50:45 +0200 Subject: [PATCH 22/56] Allow skipping regular properties when reading the config Allow skipping regular properties when reading the config --- .../python/iconfTool/models/loaders.py | 58 +++++++++++++++++++ Control/AthenaConfiguration/share/confTool.py | 35 ++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py index c4f31ce1b65..ff4de8f2ebe 100755 --- a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py +++ b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py @@ -88,6 +88,13 @@ baseParser.add_argument( action="store_true", ) +baseParser.add_argument( + "--skipProperties", + help="Do not load properties other than those referring to other components", + action="store_true", +) + + baseParser.add_argument( "--debug", help="Enable tool debugging messages", @@ -268,6 +275,54 @@ def shortenDefaultComponents(dic, args) -> Dict: conf[key] = shorten_defaults(value) return conf +def isReference(value, compname, conf) -> bool: + """Returns true if value stores reference to other components + value - the value to check + compname - full component name + conf - complete config dict + """ + try: + value = ast.literal_eval(str(value)) + except Exception: + pass + + if isinstance(value, str): + ctype_name = value.split('/') + instance = None + if len(ctype_name) == 2: + instance = ctype_name[1] + if len(ctype_name) == 1: + instance = ctype_name[0] + if instance: + if f"{compname}.{instance}" in conf: # private tool + return [f"{compname}.{instance}"] + if f"ToolSvc.{instance}" in conf: # public tool + return [f"ToolSvc.{instance}"] + if instance in conf: # service + return [instance] + if len(ctype_name) == 2: # in either case for 2 elements value we consider that as comp + return [ctype_name[1]] + + elif isinstance(value, list): + refs = [isReference(el, compname, conf) for el in value] + if any(refs): + flattened = [] + [flattened.extend(el) for el in refs if el] + return flattened + return [] + + +def skipProperties(conf, args) -> Dict: + updated = {} + for (name, properties) in conf.items(): + updated[name] = {} + if not isinstance(properties, dict): # keep it + updated[name] = properties + else: + for property_name, value in properties.items(): + if isReference( value, name, conf) or property_name == 'Members': # later for sequences structure + updated[name][property_name] = value + return updated def loadConfigFile(fname, args) -> Dict: """loads config file into a dictionary, supports several modifications of the input switched on via additional arguments @@ -349,6 +404,9 @@ def loadConfigFile(fname, args) -> Dict: if args.shortenDefaultComponents: conf = shortenDefaultComponents(conf, args) + + if args.skipProperties: + conf = skipProperties(conf, args) return conf class ComponentsFileLoader: diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py index 59f5625f861..838bdf6298d 100755 --- a/Control/AthenaConfiguration/share/confTool.py +++ b/Control/AthenaConfiguration/share/confTool.py @@ -10,7 +10,7 @@ import pickle import re import sys -from AthenaConfiguration.iconfTool.models.loaders import loadConfigFile, baseParser, componentRenamingDict, loadDifferencesFile +from AthenaConfiguration.iconfTool.models.loaders import loadConfigFile, baseParser, componentRenamingDict, loadDifferencesFile, isReference class fullColor: reset="\033[0m" difference="\033[91m" @@ -73,8 +73,11 @@ def parse_args(): help="Ignore differences enlisted in file (to be used only with diffing)") parser.add_argument("--color", - help="Use colored output even for file output (usefull when piping to less -R to to HTML conversion", + help="Use colored output even for file output (useful when piping to less -R to to HTML conversion", action="store_true") + + parser.add_argument("-s", "--structured", + help="Print only a single component, in a structured manner (reflecting components parent children)") args = parser.parse_args() main(args) @@ -97,6 +100,12 @@ def main(args): conf = loadConfigFile(fileName, args) _print(conf, color) + if args.structured: + for fileName in args.file: + conf = loadConfigFile(fileName, args) + _structuredPrint(conf, args.structured) + + if args.toJSON: if len(args.file) != 1: sys.exit( @@ -149,6 +158,28 @@ def _printComps(conf): if isinstance(item, dict): print(k) +def _structuredPrint(conf, start): + def _oneCompPrint(d, comp, indent = ""): + print(f"{indent}{comp}") + for prop,val in d.items(): + print(f"{indent} {prop} = {val}") + if prop == "Members" or prop == "TopAlg": + continue + refs = isReference(val, comp, conf) + for ref in refs: + if ref in conf: + _oneCompPrint(conf[ref], ref, indent + " - ") + + if start not in conf: + print(f"{start} is absent in the config, unfortunately the name has to be exact") + return + settings = conf.get(start) + if isinstance(settings, dict): + _oneCompPrint(settings, start) + else: + print(settings) + + def _compareConfig(configRef, configChk, args, color): # Find superset of all components: allComps = list(set(configRef.keys()) | set(configChk.keys())) -- GitLab From f33fc884ba23e08b692c18c2fb5166f61ca1757b Mon Sep 17 00:00:00 2001 From: Anthony Morley Date: Tue, 24 May 2022 10:52:04 +0200 Subject: [PATCH 23/56] Add Btagging and additional variable to HIGG1D1 Add Btagging and additional variable to HIGG1D1 --- .../python/DerivationFrameworkCaloConfig.py | 42 ++++ .../python/HIGG1D1.py | 200 +++++++++++++++--- .../python/HIGG1D1CustomJetsConfig.py | 24 ++- .../python/SkimmingToolHIGG1Config.py | 28 +++ .../JetCalibTools/JetCalibrationTool.h | 1 - .../JetCalibTools/Root/JetCalibrationTool.cxx | 5 +- .../python/JetMomentToolsConfig.py | 9 +- 7 files changed, 264 insertions(+), 45 deletions(-) create mode 100644 PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py create mode 100644 PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py new file mode 100644 index 00000000000..592080a4f27 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py @@ -0,0 +1,42 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +#!/usr/bin/env python + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + + +def MaxCellDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs)) + return acc + +def GainDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + kwargs.setdefault("name", "GainDecor") + acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs)) + return acc + +def CaloFillRectangularClusterCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("cells_name", ConfigFlags.Egamma.Keys.Input.CaloCells) + kwargs.setdefault("fill_cluster", True) + acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs)) + return acc + +def ClusterEnergyPerLayerDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + kwargs.setdefault("SGKey_caloCells", ConfigFlags.Egamma.Keys.Input.CaloCells) + kwargs.setdefault("neta", 5) + kwargs.setdefault("nphi", 5) + toolArgs = {} + toolArgs.update({"eta_size": kwargs["neta"]}) + toolArgs.update({"phi_size": kwargs["nphi"]}) + kwargs.setdefault("CaloFillRectangularClusterTool", acc.popToolsAndMerge(CaloFillRectangularClusterCfg(ConfigFlags,**toolArgs) ) ) + acc.setPrivateTools(CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)) + return acc \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py index 9f0b0f14cc0..cd70a39ab5e 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py @@ -18,7 +18,7 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): # Common augmentations from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg - acc.merge(PhysCommonAugmentationsCfg(ConfigFlags)) + acc.merge(PhysCommonAugmentationsCfg(ConfigFlags, TriggerListsHelper = kwargs['TriggerListsHelper'])) # Diphoton Vertex creation from DerivationFrameworkHiggs.HIGG1D1CustomVertexConfig import ZeeVertexRefitterCfg, DiPhotonVertexCfg @@ -28,13 +28,15 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): #CustomJetsConfig acc.merge(HIGG1D1CustomJetsCfg(ConfigFlags)) - - # MET and Btagging - #TODO + + from DerivationFrameworkFlavourTag.FtagRun3DerivationConfig import FtagJetCollectionsCfg + acc.merge(FtagJetCollectionsCfg(ConfigFlags,['AntiKt4EMPFlowCustomVtxJets'])) + # + #TODO MET # Thinning tools... - from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg - #from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg + from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg + from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg # Inner detector group recommendations for indet tracks in analysis # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations @@ -73,35 +75,97 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): InDetTrackParticlesKey = "InDetTrackParticles")) ## Low-pt di-tau thinning - #HIGG1D1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(name = "HIGG1D1DiTauLowPtThinningTool", - # StreamName = kwargs['StreamName'], - # ContainerName = "DiTauJetsLowPt", - # SelectionString = "DiTauJetsLowPt.nSubjets > 1")) - # - ## ID tracks associated with low-pt ditau - #HIGG1D1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(name = "HIGG1D1DiTauLowPtTPThinningTool", - # StreamName = kwargs['StreamName'], - # DiTauKey = "DiTauJetsLowPt", - # InDetTrackParticlesKey = "InDetTrackParticles", - # SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + HIGG1D1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(ConfigFlags, + name = "PHYSDiTauLowPtThinningTool", + StreamName = kwargs['StreamName'], + ContainerName = "DiTauJetsLowPt", + SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + + # ID tracks associated with low-pt ditau + HIGG1D1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(ConfigFlags, + name = "PHYSDiTauLowPtTPThinningTool", + StreamName = kwargs['StreamName'], + DiTauKey = "DiTauJetsLowPt", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + + + # SkimmingTool + from DerivationFrameworkHiggs.SkimmingToolHIGG1Config import SkimmingToolHIGG1Cfg + + # Requires something in this list of triggers + SkipTriggerRequirement= ConfigFlags.Input.isMC and ConfigFlags.Beam.Energy==4000000.0 + # 8 TeV MC does not have trigger information + print( "HIGG1D1.py SkipTriggerRequirement", SkipTriggerRequirement) + TriggerExp = [] + if not SkipTriggerRequirement: + if ConfigFlags.Beam.Energy==4000000.0: + # 8 TeV data + TriggerExp = ["EF_g35_loose_g25_loose"] + if ConfigFlags.Beam.Energy==6500000.0: + # 13 TeV MC + TriggerExp = ["HLT_2g50_loose_L12EM20VH","HLT_2g25_loose_g15_loose","HLT_g35_medium_g25_medium_L12EM20VH","HLT_2g25_tight_L12EM20VH","HLT_2g22_tight_L12EM15VHI","HLT_g35_loose_g25_loose","HLT_g35_medium_g25_medium","HLT_2g50_loose","HLT_2g20_tight","HLT_2g22_tight","HLT_2g20_tight_icalovloose_L12EM15VHI","HLT_2g20_tight_icalotight_L12EM15VHI","HLT_2g22_tight_L12EM15VHI","HLT_2g22_tight_icalovloose_L12EM15VHI","HLT_2g22_tight_icalotight_L12EM15VHI","HLT_2g22_tight_icalovloose","HLT_2g25_tight_L12EM20VH","HLT_2g20_loose","HLT_2g20_loose_L12EM15","HLT_g35_medium_g25_medium","HLT_g35_medium_g25_medium_L12EM15VH","HLT_g35_loose_g25_loose","HLT_g35_loose_g25_loose_L12EM15VH", "HLT_2g20_loose_g15_loose", "HLT_3g20_loose", "HLT_3g15_loose", "HLT_2g6_tight_icalotight_L1J100", "HLT_2g6_loose_L1J100", "HLT_2g6_tight_icalotight_L1J50", "HLT_2g6_loose_L1J50","HLT_g120_loose","HLT_g140_loose"] + + skimmingTool = acc.popToolsAndMerge( SkimmingToolHIGG1Cfg(ConfigFlags,RequireTrigger=not SkipTriggerRequirement,Triggers=TriggerExp) ) + acc.addPublicTool(skimmingTool) + # Finally the kernel itself thinningTools = [HIGG1D1TrackParticleThinningTool, HIGG1D1MuonTPThinningTool, HIGG1D1TauTPThinningTool, - HIGG1D1DiTauTPThinningTool] - #HIGG1D1DiTauLowPtThinningTool, - #HIGG1D1DiTauLowPtTPThinningTool ] + HIGG1D1DiTauTPThinningTool, + HIGG1D1DiTauLowPtThinningTool, + HIGG1D1DiTauLowPtTPThinningTool ] + + #==================================================================== + # Max Cell sum decoration tool + #==================================================================== + from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg + acc.merge(LArOnOffIdMappingCfg(ConfigFlags)) + + augmentationTools = [] + from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import MaxCellDecoratorCfg + MaxCellDecorator = acc.popToolsAndMerge(MaxCellDecoratorCfg(ConfigFlags)) + acc.addPublicTool(MaxCellDecorator) + augmentationTools.append(MaxCellDecorator) + #==================================================================== + # Gain and cluster energies per layer decoration tool + #==================================================================== + + from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import GainDecoratorCfg, ClusterEnergyPerLayerDecoratorCfg + GainDecoratorTool = acc.popToolsAndMerge(GainDecoratorCfg(ConfigFlags)) + acc.addPublicTool(GainDecoratorTool) + augmentationTools.append(GainDecoratorTool) + + + cluster_sizes = (3,5), (5,7), (7,7), (7,11) + for neta, nphi in cluster_sizes: + cename = "ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi) + ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge( ClusterEnergyPerLayerDecoratorCfg(ConfigFlags, neta = neta, nphi=nphi, name=cename )) + acc.addPublicTool(ClusterEnergyPerLayerDecorator) + augmentationTools.append(ClusterEnergyPerLayerDecorator) + + + DerivationKernel = CompFactory.DerivationFramework.DerivationKernel - acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools)) + acc.addEventAlgo(DerivationKernel(name, + SkimmingTools = [skimmingTool], + ThinningTools = thinningTools, + AugmentationTools = augmentationTools)) return acc def HIGG1D1Cfg(ConfigFlags): acc = ComponentAccumulator() - acc.merge(HIGG1D1KernelCfg(ConfigFlags, name="HIGG1D1Kernel", StreamName = 'StreamDAOD_HIGG1D1')) - + + from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper + HIGG1D1TriggerListsHelper = TriggerListsHelper() + + acc.merge(HIGG1D1KernelCfg(ConfigFlags, name="HIGG1D1Kernel", StreamName = 'StreamDAOD_HIGG1D1', TriggerListsHelper = HIGG1D1TriggerListsHelper)) + + # ============================ # Define contents of the format # ============================= @@ -191,17 +255,91 @@ def HIGG1D1Cfg(ConfigFlags): "TauJets.dRmax.etOverPtLeadTrk", "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey", "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey"] - - HIGG1D1SlimmingHelper.AppendToDictionary.update({ "AntiKt4EMPFlowJetsCustomVtx": "xAOD::JetContainer", "AntiKt4EMPFlowCustomVtxJetsAux":"xAOD::JetAuxContainer", + + # Additional content for HIGG1D1 + HIGG1D1SlimmingHelper.AppendToDictionary.update({ "AntiKt4EMPFlowCustomVtxJets": "xAOD::JetContainer", "AntiKt4EMPFlowCustomVtxJetsAux":"xAOD::JetAuxContainer", "HggPrimaryVertices":"xAOD::VertexContainer", "HggPrimaryVerticesAux":"xAOD::ShallowAuxContainer", "Kt4EMPFlowCustomVtxEventShape":"xAOD::EventShape", "Kt4EMPFlowCustomVtxEventShapeAux":"xAOD::EventShapeAuxInfo", "Kt4EMPFlowEventShape":"xAOD::EventShape", "Kt4EMPFlowEventShapeAux":"xAOD::EventShapeAuxInfo", - "ZeeRefittedPrimaryVertices":"xAOD::VertexContainer","ZeeRefittedPrimaryVerticesAux":"xAOD:VertexAuxContainer" + "ZeeRefittedPrimaryVertices":"xAOD::VertexContainer","ZeeRefittedPrimaryVerticesAux":"xAOD:VertexAuxContainer", + "AFPSiHitContainer":"xAOD::AFPSiHitContainer","AFPSiHitContainerAux":"xAOD::AFPSiHitAuxContainer", + "AFPToFHitContainer":"xAOD::AFPToFHitContainer","AFPToFHitContainerAux":"xAOD::AFPToFHitAuxContainer", + "BTagging_AntiKt4EMPFlowCustomVtx":"xAOD::BTaggingContainer","BTagging_AntiKt4EMPFlowCustomVtxAux":"xAOD:BTaggingAuxContainer" }) - HIGG1D1SlimmingHelper.AllVariables += ["HggPrimaryVertices","ZeeRefittedPrimaryVertices","AntiKt4EMPFlowCustomVtxJets","Kt4PFlowCustomVtxEventShape","Kt4EMPFlowEventShape"] + HIGG1D1SlimmingHelper.AllVariables += ["HggPrimaryVertices","ZeeRefittedPrimaryVertices","AntiKt4EMPFlowCustomVtxJets","Kt4EMPFlowCustomVtxEventShape","Kt4EMPFlowEventShape"] + + # Add AFP information + HIGG1D1SlimmingHelper.AllVariables += ["AFPSiHitContainer","AFPToFHitContainer"] + + # Add Btagging information + from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingStandardContent,BTaggingXbbContent + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingStandardContent("AntiKt4EMPFlowCustomVtxJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingStandardContent("AntiKt4EMPFlowJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingXbbContent("AntiKt4EMPFlowCustomVtxJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingXbbContent("AntiKt4EMPFlowJets") + + # is this really needed given Photons are in the AllVariables list ? + from DerivationFrameworkEGamma.PhotonsCPDetailedContent import PhotonsCPDetailedContent + HIGG1D1SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent + + + # Add the variables for Gain adn Cluster energy -- need to get the tools first to use existing functions + from DerivationFrameworkCalo.DerivationFrameworkCaloFactories import getGainDecorations, getClusterEnergyPerLayerDecorations + GainDecoratorTool = None + ClusterEnergyPerLayerDecorators = [] + for toolStr in acc.getEventAlgo("HIGG1D1Kernel").AugmentationTools: + toolStr = f"{toolStr}" + splitStr = toolStr.split('/') + tool = acc.getPublicTool(splitStr[1]) + if splitStr[0]== "DerivationFramework::GainDecorator": + GainDecoratorTool = tool + elif splitStr[0] == "DerivationFramework::ClusterEnergyPerLayerDecorator": + ClusterEnergyPerLayerDecorators.append( tool ) + if GainDecoratorTool : + HIGG1D1SlimmingHelper.ExtraVariables.extend( getGainDecorations(GainDecoratorTool) ) + for tool in ClusterEnergyPerLayerDecorators: + HIGG1D1SlimmingHelper.ExtraVariables.extend( getClusterEnergyPerLayerDecorations( tool ) ) + + + + # Trigger content + HIGG1D1SlimmingHelper.IncludeTriggerNavigation = False + HIGG1D1SlimmingHelper.IncludeJetTriggerContent = False + HIGG1D1SlimmingHelper.IncludeMuonTriggerContent = False + HIGG1D1SlimmingHelper.IncludeEGammaTriggerContent = False + HIGG1D1SlimmingHelper.IncludeJetTauEtMissTriggerContent = False + HIGG1D1SlimmingHelper.IncludeTauTriggerContent = False + HIGG1D1SlimmingHelper.IncludeEtMissTriggerContent = False + HIGG1D1SlimmingHelper.IncludeBJetTriggerContent = False + HIGG1D1SlimmingHelper.IncludeBPhysTriggerContent = False + HIGG1D1SlimmingHelper.IncludeMinBiasTriggerContent = False + + # Trigger matching + # Run 2 + if ConfigFlags.Trigger.EDMVersion == 2: + from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonTau", + TriggerList = HIGG1D1TriggerListsHelper.Run2TriggerNamesTau) + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonNoTau", + TriggerList = HIGG1D1TriggerListsHelper.Run2TriggerNamesNoTau) + # Run 3 + if ConfigFlags.Trigger.EDMVersion == 3: + from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper + AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(HIGG1D1SlimmingHelper) + # Run 2 is added here temporarily to allow testing/comparison/debugging + from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonTau", + TriggerList = HIGG1D1TriggerListsHelper.Run3TriggerNamesTau) + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonNoTau", + TriggerList = HIGG1D1TriggerListsHelper.Run3TriggerNamesNoTau) + # Output stream HIGG1D1ItemList = HIGG1D1SlimmingHelper.GetItemList() acc.merge(OutputStreamCfg(ConfigFlags, "DAOD_HIGG1D1", ItemList=HIGG1D1ItemList, AcceptAlgs=["HIGG1D1Kernel"])) @@ -209,10 +347,4 @@ def HIGG1D1Cfg(ConfigFlags): return acc -# Add trigger matching -# Run 2 -#PhysCommonTrigger.trigmatching_helper_notau.add_to_slimming(HIGG1D1SlimmingHelper) -#PhysCommonTrigger.trigmatching_helper_tau.add_to_slimming(HIGG1D1SlimmingHelper) -# Run 3 -#from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToEDM -#AddRun3TrigNavSlimmingCollectionsToEDM(HIGG1D1Stream) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py index 98215d2a4a0..0b6c5264a4b 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py @@ -51,11 +51,30 @@ def HIGG1D1CustomJetsCfg(ConfigFlags): return tuple(newList) print( "Failed to update ", orgName, " to ", newName ) return tuple(newList) - + + def updateCalibSequence(tup): + newList = list(tup) + for i, item in enumerate(newList): + if "Calib" in item: + calibspecs = item.split(":") + calib, calibcontext, data_type = calibspecs[:3] + calibseq="" + if len(calibspecs)>3: + calibseq = calibspecs[3] + rhoname = "Kt4EMPFlowCustomVtxEventShape" + pvname = HggVertexContainerName + finalCalibString = f"CalibCustomVtx:{calibcontext}:{data_type}:{calibseq}:{rhoname}:{pvname}" + if len(calibspecs)>6: finalCalibString = f"{finalCalibString}:{calibspecs[6]}" + newList[i] = finalCalibString + print(finalCalibString) + return tuple(newList) + print( "Failed to update calib sequence" ) + return tuple(newList) + # Create modifier list and JetDefinition modsCustomVtx = AntiKt4EMPFlow.modifiers - modsCustomVtx = replaceItems(modsCustomVtx,"Calib","CalibCustomVtx") + modsCustomVtx = updateCalibSequence(modsCustomVtx) modsCustomVtx = replaceItems(modsCustomVtx,"TrackMoments","TrackMomentsCustomVtx") modsCustomVtx = replaceItems(modsCustomVtx,"TrackSumMoments","TrackSumMomentsCustomVtx") modsCustomVtx = replaceItems(modsCustomVtx,"JVF","JVFCustomVtx") @@ -141,7 +160,6 @@ def HIGG1D1CustomJetsCfg(ConfigFlags): stdJetModifiers.update( - #TODO calibration is still picking up the wrong energy density as it set in a config file CalibCustomVtx = JetModifier("JetCalibrationTool","jetcalib_jetcoll_calibseqCustomVtx", createfn=JetCalibToolsConfig.getJetCalibToolFromString, prereqs=lambda mod,jetdef : JetCalibToolsConfig.getJetCalibToolPrereqs(mod,jetdef)+[f"input:{context['Vertices']}"]), diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py new file mode 100644 index 00000000000..d22844f1a9e --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py @@ -0,0 +1,28 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SkimmingToolHIGG1Cfg(ConfigFlags, **kwargs): + + """ Skimming Tool for HIGG1 derivations""" + + kwargs.setdefault("RequireGRL", True) + kwargs.setdefault("ReqireLArError", True) + kwargs.setdefault("RequireTrigger", False) + kwargs.setdefault("RequirePreselection",False) + kwargs.setdefault("RequireKinematic", False) + kwargs.setdefault("RequireQuality", False) + kwargs.setdefault("RequireIsolation", False) + kwargs.setdefault("RequireInvariantMass", False) + kwargs.setdefault("Triggers" , []) + kwargs.setdefault("IncludeSingleElectronPreselection", False) + kwargs.setdefault("IncludeDoubleElectronPreselection", False) + kwargs.setdefault("IncludeSingleMuonPreselection", False) + + acc = ComponentAccumulator() + + acc.setPrivateTools( CompFactory.DerivationFramework.SkimmingToolHIGG1(**kwargs) ) + + return acc \ No newline at end of file diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 18f0256bfb2..5d4106873cb 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -85,7 +85,6 @@ private: std::vector m_timeDependentInsituConfigs; std::vector m_runBins; bool m_doSetDetectorEta; - std::string m_vertexContainerName; bool m_insituCombMassCalib; std::vector m_insituCombMassConfig; diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index bc50eb30e7f..4c71bcc86be 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -98,10 +98,7 @@ StatusCode JetCalibrationTool::initialize() { // Rho key specified in the config file? std::string rhoKey_config = m_globalConfig->GetValue("RhoKey", "None"); - - // Get name of vertex container - m_vertexContainerName = m_globalConfig->GetValue("VertexContainerName","PrimaryVertices"); - + bool requireRhoInput = false; //Make sure the residual correction is turned on if requested diff --git a/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py b/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py index f3e4ab35764..8a0c95d934f 100644 --- a/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py +++ b/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py @@ -189,20 +189,23 @@ def getQGTaggingTool(jetdef, modspec): def getPFlowfJVTTool(jetdef, modspec): from JetCalibTools import JetCalibToolsConfig - jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, "AnalysisLatest:mc:JetArea_Residual_EtaJES") + calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES" + if( modspec and modspec == "CustomVtx" ) : + calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES:Kt4EMPFlowCustomVtxEventShape:HggPrimaryVertices" + jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, calibString) wPFOTool = CompFactory.getComp('CP::WeightPFOTool')("fJVT__wPFO") trackingKeys = jetContextDic[modspec or jetdef.context] - fJVTTool = CompFactory.JetForwardPFlowJvtTool('fJVT', + fJVTTool = CompFactory.JetForwardPFlowJvtTool("fJVT", verticesName = trackingKeys["Vertices"], TrackVertexAssociation = trackingKeys["TVA"], WeightPFOTool = wPFOTool, JetCalibrationTool = jetCalibrationTool, FEName = jetdef.inputdef.containername, ORName = "", - FjvtRawName = 'DFCommonJets_fJvt', + FjvtRawName = "DFCommonJets_fJvt", includePV = True) return fJVTTool -- GitLab From 3d4d331b0d5e3f16feaafe5cdfaaada99cadcf54 Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 11:32:00 +0200 Subject: [PATCH 24/56] TrkValHistUtils: Enable thread-safety checking. TrkValHistUtils: Enable thread-safety checking. Enable thread-safety checking and fix warnings. --- .../TrkValHistUtils/Root/DefParamPullPlots.cxx | 2 +- .../TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx | 2 +- Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx | 2 +- Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx | 2 +- .../TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx | 2 +- .../TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx | 2 +- .../TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx | 2 +- .../TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx | 6 +++--- .../TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/HitTypePlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/ImpactPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/ParamPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h | 2 +- .../TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h | 2 +- .../TrkValHistUtils/TruthTrkExtrapolationPlots.h | 6 +++--- .../TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx | 2 +- 19 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx index 8589621c746..da883ed6a9d 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx @@ -53,7 +53,7 @@ namespace Trk { } void - DefParamPullPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) const { + DefParamPullPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) { const double d0_trk = trkprt.d0(); const double z0_trk = trkprt.z0(); const double phi_trk = trkprt.phi0(); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx index 9d5a6f7647d..5f72d6a8100 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx @@ -29,7 +29,7 @@ namespace Trk { } void - HitTypePlots::fill(int iHits, float fEta, float fPhi, float weight) const { + HitTypePlots::fill(int iHits, float fEta, float fPhi, float weight) { Hits->Fill(iHits, weight); HitsVsEta->Fill(iHits, fEta, weight); HitsVsPhi->Fill(iHits, fPhi, weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx index 6eddeb900f8..225d8bcf25c 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx @@ -24,7 +24,7 @@ namespace Trk { } void - ImpactPlots::fill(const xAOD::TrackParticle &trkprt, float weight) const { + ImpactPlots::fill(const xAOD::TrackParticle &trkprt, float weight) { d0->Fill(trkprt.d0(),weight); d0_small->Fill(trkprt.d0(),weight); z0->Fill(trkprt.z0(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx index 933e7043b5c..bab67afc475 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx @@ -37,7 +37,7 @@ namespace Trk { } void - ParamPlots::fill(const xAOD::IParticle &prt, float weight) const { + ParamPlots::fill(const xAOD::IParticle &prt, float weight) { pt->Fill(prt.pt() * 0.001, weight); eta->Fill(prt.eta(),weight); phi->Fill(prt.phi(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx index e2a5cde0cad..6acaf50feb2 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx @@ -25,7 +25,7 @@ namespace Trk { } void - RecoInfoPlots::fill(const xAOD::TrackParticle &trkprt, float weight) const { + RecoInfoPlots::fill(const xAOD::TrackParticle &trkprt, float weight) { float chi2 = trkprt.chiSquared(); int ndf = trkprt.numberDoF(); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx index 83c0ccbcdbb..a861a00102e 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx @@ -20,7 +20,7 @@ namespace Trk { } void - ResolutionPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) const { + ResolutionPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) { Res_pT->Fill((trkprt.pt() - truthprt.pt()) / truthprt.pt(), weight); Res_eta->Fill(trkprt.eta() - truthprt.eta(),weight); Res_phi->Fill(trkprt.phi() - truthprt.phi(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx index 5e2f69af237..fab7e83b354 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx @@ -18,7 +18,7 @@ namespace Trk { } void - TruthInfoPlots::fill(const xAOD::TruthParticle &truthprt, float weight ) const { + TruthInfoPlots::fill(const xAOD::TruthParticle &truthprt, float weight ) { if (truthprt.isAvailable("truthType")) { truthType->Fill(truthprt.auxdata< int >("truthType"), weight); } diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx index 3e556a49fff..c0e5d22b10c 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx @@ -23,7 +23,7 @@ namespace Trk { } void - TruthTrkExtrapolationPlots::fill(const xAOD::TruthParticle &truthprt, float weight) const { + TruthTrkExtrapolationPlots::fill(const xAOD::TruthParticle &truthprt, float weight) { m_CaloEntry.fill(truthprt, "CaloEntryLayer", weight); m_MuonEntry.fill(truthprt, "MuonEntryLayer", weight); m_MuonExit.fill(truthprt, "MuonExitLayer", weight); @@ -75,7 +75,7 @@ namespace Trk { } void - ExtrLayerPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sNom, float weight) const { + ExtrLayerPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sNom, float weight) { if (!truthprt.isAvailable(sNom + "_px") || !truthprt.isAvailable(sNom + "_py") || !truthprt.isAvailable(sNom + "_pz")) { @@ -221,7 +221,7 @@ namespace Trk { } void - ExtrRegionPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sDetBegin, const std::string& sDetEnd, float weight) const { + ExtrRegionPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sDetBegin, const std::string& sDetEnd, float weight) { if (!truthprt.isAvailable(sDetBegin + "px") || !truthprt.isAvailable(sDetBegin + "py") || !truthprt.isAvailable(sDetBegin + "pz") || diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..1815604b646 --- /dev/null +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkValidation/TrkValHistUtils diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h index 337c6119a41..64b93edeab1 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h @@ -14,7 +14,7 @@ namespace Trk{ class DefParamPullPlots: public PlotBase { public: DefParamPullPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType){ init();} - void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* Pull_d0; TH1* Pull_z0; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h index ad5ea982a7f..069ee1c6e44 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h @@ -15,7 +15,7 @@ namespace Trk{ class HitResidualPlots: public PlotBase { public: HitResidualPlots(PlotBase *pParent, std::string sDir, std::string sType=""): PlotBase(pParent, sDir),m_sType(sType) { init(); } - void fill( const Trk::ResidualPull& resPull ) const; + void fill( const Trk::ResidualPull& resPull ); TH1* residuals; TH1* pulls; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h index f107257c56e..e893399005b 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h @@ -12,7 +12,7 @@ namespace Trk{ class HitTypePlots:public PlotBase { public: HitTypePlots(PlotBase* pParent, std::string sHitType, std::string sHitLabel, int iMin, int iMax); - void fill(int iHits, float fEta, float fPhi, float weight=1.0) const; + void fill(int iHits, float fEta, float fPhi, float weight=1.0); std::string m_sHitType; std::string m_sHitLabel; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h index 7819e1ad70f..04a625cf0b8 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class ImpactPlots: public PlotBase { public: ImpactPlots(PlotBase *pParent, std::string sDir):PlotBase(pParent, sDir){ init();} - void fill(const xAOD::TrackParticle& trkprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, float weight=1.0); TH1* z0; TH1* z0sig; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h index b206d15831e..7bca5d01328 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class ParamPlots:public PlotBase { public: ParamPlots(PlotBase *pParent, const std::string& sDir, std::string sParticleType); - void fill(const xAOD::IParticle& prt, float weight=1.0) const; + void fill(const xAOD::IParticle& prt, float weight=1.0); TH1* eta; TH1* phi; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h index 7ffd54dbac2..e009cd9e2ed 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class RecoInfoPlots: public PlotBase { public: RecoInfoPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType){ init();} - void fill(const xAOD::TrackParticle& trkprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, float weight=1.0); TH1* trackfitchi2; TH1* trackfitndof; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h index 6f9f3956ef7..52cf8a8540c 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h @@ -14,7 +14,7 @@ namespace Trk{ class ResolutionPlots: public PlotBase { public: ResolutionPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType) { init();} - void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* Res_pT; TH1* Res_eta; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h index 2cc157ff5d0..501ea52da11 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class TruthInfoPlots: public PlotBase { public: TruthInfoPlots(PlotBase *pParent, std::string sDir):PlotBase(pParent, sDir){ init();} - void fill(const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* truthType; TH1* origin; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h index f125f1b0a97..2b4e72ae950 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h @@ -15,7 +15,7 @@ namespace Trk{ public: ExtrLayerPlots(PlotBase *pParent, const std::string& sDir, std::string sLayerName); - void fill (const xAOD::TruthParticle& truthprt, const std::string& sLayerName, float weight=1.0) const; + void fill (const xAOD::TruthParticle& truthprt, const std::string& sLayerName, float weight=1.0); std::string m_sLayerName; TH1* p; @@ -43,7 +43,7 @@ namespace Trk{ public: ExtrRegionPlots(PlotBase *pParent, const std::string& sDir, std::string sRegionBegin, std::string sRegionEnd); - void fill (const xAOD::TruthParticle& truthprt, const std::string& sRegionBegin, const std::string& sRegionEnd, float weight=1.0) const; + void fill (const xAOD::TruthParticle& truthprt, const std::string& sRegionBegin, const std::string& sRegionEnd, float weight=1.0); std::string m_sRegionBegin; std::string m_sRegionEnd; @@ -87,7 +87,7 @@ namespace Trk{ class TruthTrkExtrapolationPlots: public PlotBase { public: TruthTrkExtrapolationPlots(PlotBase *pParent, const std::string& sDir); - void fill(const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TruthParticle& truthprt, float weight=1.0); ExtrLayerPlots m_CaloEntry; ExtrLayerPlots m_MuonEntry; diff --git a/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx index ef8466472af..a9d20a0d871 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx @@ -21,7 +21,7 @@ void HitResidualPlots::initializePlots(){ } -void HitResidualPlots::fill( const Trk::ResidualPull& resPull ) const { +void HitResidualPlots::fill( const Trk::ResidualPull& resPull ) { const float residual = resPull.residual().front(); const float pull = resPull.pull().front(); -- GitLab From f87c723e1082486da28d5b65554e91e59d938802 Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 11:32:49 +0200 Subject: [PATCH 25/56] TrigMissingEtEventTPCnv: Enable thread-safety checking. TrigMissingEtEventTPCnv: Enable thread-safety checking. Enable thread-safety checking and fix warnings in tests. --- Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt | 6 +++--- .../TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../test/TrigMissingETCnv_p2_test.cxx | 9 ++++----- .../test/TrigMissingETCnv_p3_test.cxx | 9 ++++----- Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt index 521addfa919..5a92e4ea55e 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigMissingEtEventTPCnv ) @@ -18,9 +18,9 @@ atlas_add_dictionary( TrigMissingEtEventTPCnvDict atlas_add_test( TrigMissingETCnv_p2_test SOURCES test/TrigMissingETCnv_p2_test.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv CxxUtils ) atlas_add_test( TrigMissingETCnv_p3_test SOURCES test/TrigMissingETCnv_p3_test.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv CxxUtils ) diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..28bcc933626 --- /dev/null +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMissingEtEventTPCnv diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx index a19b1390867..67b0191ee4d 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMissingEtEventTPCnv/TrigMissingETCnv_p2.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -60,7 +59,7 @@ void testit (const TrigMissingET& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx index de22dd7d7a5..d912f7072e5 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMissingEtEventTPCnv/TrigMissingETCnv_p3.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -60,7 +59,7 @@ void testit (const TrigMissingET& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt index 593120d405d..bb7bd0334ce 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigMuonEventTPCnv ) @@ -25,7 +25,7 @@ function( _add_test test ) atlas_add_test( ${test} SOURCES test/${test}.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMuonEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMuonEventTPCnv CxxUtils ) endfunction() _add_test( CombinedMuonFeatureCnv_p2_test ) -- GitLab From 31c51778752355c5a70cada1b30c49b2c2a4fb6b Mon Sep 17 00:00:00 2001 From: Shaun Roe Date: Tue, 24 May 2022 12:45:52 +0200 Subject: [PATCH 26/56] 22.0-cppcheck-InnerDetector 22.0-cppcheck-InnerDetector --- .../RadDamage/IBLLeakageCurrentData/plot.C | 2 +- .../TRT_Cabling/src/TRT_FillCablingData_TB04.cxx | 12 ++++++------ .../InDetPerformanceMonitoring/scripts/fit_EoverP.C | 2 +- .../src/TRT_Trajectory_xk.cxx | 13 +++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C index d1068c0ff71..93dc1726b22 100644 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C @@ -71,7 +71,7 @@ void from_ssv(string suffix){ string value; std::istringstream iss(line); - double vals[4]; + double vals[4]={}; int j = 0; while(getline(iss,value,',')){ vals[j] = stod(value); diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx index 37133b208d1..888068c854b 100644 --- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx +++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx @@ -128,12 +128,12 @@ void TRT_FillCablingData_TB04::defineParameters() int numberOfStrawsInLayersC[] = {23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 28}; - std::vector ncol0 (numberOfStrawsInLayersA, - numberOfStrawsInLayersA + sizeof(numberOfStrawsInLayersA) / sizeof(int)); - std::vector ncol1 (numberOfStrawsInLayersB, - numberOfStrawsInLayersB + sizeof(numberOfStrawsInLayersB) / sizeof(int)); - std::vector ncol2 (numberOfStrawsInLayersC, - numberOfStrawsInLayersC + sizeof(numberOfStrawsInLayersC) / sizeof(int)); + std::vector ncol0 (std::begin(numberOfStrawsInLayersA), + std::end(numberOfStrawsInLayersA)); + std::vector ncol1 (std::begin(numberOfStrawsInLayersB), + std::end(numberOfStrawsInLayersB)); + std::vector ncol2 (std::begin(numberOfStrawsInLayersC), + std::end(numberOfStrawsInLayersC)); m_ncol.push_back(ncol0); m_ncol.push_back(ncol1); diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C index 76f623a2de7..143b501d6f7 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C @@ -1486,7 +1486,7 @@ void MakeScaling(TString inputDir) 39274.9}; */ -double pt[100]; +double pt[100] = {}; TH2F* meanPtVsEta = (TH2F*) file0->Get("meanPtVsEta"); for(int i(1); i <= meanPtVsEta->GetNbinsX(); ++i){ diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx index 500e2fc44b0..90ec0b7322b 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx @@ -366,20 +366,21 @@ void InDet::TRT_Trajectory_xk::trackFindingWithoutDriftTimeBL(double DA) bool InDet::TRT_Trajectory_xk::searchStartStop() { + if (m_lastRoad<1) return false; + if (m_lastRoad>399){ + throw std::runtime_error("Too many roads in InDet::TRT_Trajectory_xk::searchStartStop"); + } const double rs = 2.00, rse = 1.85, sr = 40; - - int w[400], W = 0; + + int w[400]={}; + int W = 0; for(int e = m_firstRoad; e<=m_lastRoad; ++e) { - double D = m_elements[e].findCloseLink(m_A,m_B); int b = m_elements[e].bestlink(); - w[e] = 0; if( D < rs+std::abs(m_elements[e].link(b).sdistance()*sr)) { - if (m_elements[e].link(b).cluster()) w[e] = 1; else if( D < rse ) w[e] =-1; - } W+=w[e]; } -- GitLab From 5d95321098516f1df04e212a5480831c622b9cbb Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 12:47:05 +0200 Subject: [PATCH 27/56] TrigMuonEventTPCnv: Enable thread-safety checking. TrigMuonEventTPCnv: Enable thread-safety checking. Enable thread-safety checking and fix warnings. --- .../TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx | 4 ++-- .../TrigMuonEventTPCnv/src/TrigMuonEFIsolationCnv_p2.cxx | 4 ++-- .../test/CombinedMuonFeatureCnv_p2_test.cxx | 7 ++++--- .../test/CombinedMuonFeatureCnv_p3_test.cxx | 7 ++++--- .../test/CombinedMuonFeatureCnv_p4_test.cxx | 7 ++++--- .../test/IsoMuonFeatureCnv_p3_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx | 9 ++++----- .../test/MuonFeatureDetailsCnv_p1_test.cxx | 9 ++++----- .../test/MuonFeatureDetailsCnv_p2_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx | 9 ++++----- .../test/TileTrackMuFeatureCnv_p2_test.cxx | 7 ++++--- .../test/TileTrackMuFeatureCnv_p3_test.cxx | 7 ++++--- .../test/TrigMuonClusterFeatureCnv_p1_test.cxx | 9 ++++----- .../test/TrigMuonEFCbTrackCnv_p5_test.cxx | 9 ++++----- .../test/TrigMuonEFCbTrackCnv_p6_test.cxx | 9 ++++----- .../test/TrigMuonEFCbTrackCnv_p7_test.cxx | 7 ++++--- .../TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx | 9 ++++----- .../TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx | 9 ++++----- .../test/TrigMuonEFInfoCnv_p4_test.cxx | 7 ++++--- .../test/TrigMuonEFInfoCnv_p5_test.cxx | 7 ++++--- .../test/TrigMuonEFInfoTrackCnv_p1_test.cxx | 7 ++++--- .../test/TrigMuonEFIsolationCnv_p1_test.cxx | 9 ++++----- .../test/TrigMuonEFIsolationCnv_p2_test.cxx | 7 ++++--- .../test/TrigMuonEFTrackCnv_p5_test.cxx | 9 ++++----- .../test/TrigMuonEFTrackCnv_p6_test.cxx | 9 ++++----- 29 files changed, 109 insertions(+), 114 deletions(-) create mode 100644 Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..334651b7a29 --- /dev/null +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMuonEventTPCnv diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx index 7ec3ff33342..0111ca5fbe7 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEvent/TrigMuonEFCbTrack.h" @@ -9,7 +9,7 @@ typedef ElementLinkCnv_p3 > TrackLinkCnv_t; /// pre-allocate the track converter -static TrackLinkCnv_t trackCnv; +static const TrackLinkCnv_t trackCnv; void TrigMuonEFCbTrackCnv_p7::persToTrans(const TrigMuonEFCbTrack_p7* persObj, TrigMuonEFCbTrack* transObj, MsgStream &log){ // std::cout << "TrigMuonEFCbTrackCnv_p7::persToTrans called " < > InfoEleLinkCnv_t; -static InfoEleLinkCnv_t infoEleLinkCnv; +static const InfoEleLinkCnv_t infoEleLinkCnv; /** * Convert persistent representation of object to the transient one diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx index 8cedb1b16f9..222db90c44d 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -48,7 +49,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -65,7 +66,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx index a245e2a3503..fd04bd4f036 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -48,7 +49,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -65,7 +66,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx index 00b22805c2d..fb854675e6e 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p4.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -46,7 +47,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -63,7 +64,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx index 2cc6754f79e..e279df3eee5 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/IsoMuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -56,7 +55,7 @@ void testit (const IsoMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -70,7 +69,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx index 605e3e5028c..90468ec1513 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p1.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -81,7 +80,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -107,7 +106,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx index 02eef7ad3ab..0d79a439521 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -66,7 +65,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -92,7 +91,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx index 6ad064c113e..d2ba3845c50 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -66,7 +65,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -92,7 +91,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx index 0a74bb42d75..9f53a93e68f 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMuonEventTPCnv/MuonFeatureDetailsCnv_p1.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -216,7 +215,7 @@ void testit (const MuonFeatureDetails& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -372,7 +371,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p2_test.cxx index 7e626971f76..70a1904b9cd 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMuonEventTPCnv/MuonFeatureDetailsCnv_p2.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -216,7 +215,7 @@ void testit (const MuonFeatureDetails& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -372,7 +371,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx index f1085c729ec..373c64c8fc0 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TileMuFeatureCnv_p1_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/TileMuFeatureCnv_p1.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -44,7 +43,7 @@ void testit (const TileMuFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -57,7 +56,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx index 0d2037b795c..a8bb3d33ee4 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TileMuFeatureCnv_p2_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/TileMuFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -44,7 +43,7 @@ void testit (const TileMuFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -57,7 +56,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p2_test.cxx index 5e81e299515..71428298355 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/TileTrackMuFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -45,7 +46,7 @@ void testit (const TileTrackMuFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -62,7 +63,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p3_test.cxx index 332419dd7a0..9da70995016 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TileTrackMuFeatureCnv_p3_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/TileTrackMuFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -45,7 +46,7 @@ void testit (const TileTrackMuFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -62,7 +63,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonClusterFeatureCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonClusterFeatureCnv_p1_test.cxx index 6a72e737d00..29e20822267 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonClusterFeatureCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonClusterFeatureCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonClusterFeatureCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_p1.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -43,7 +42,7 @@ void testit (const TrigMuonClusterFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -54,7 +53,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p5_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p5_test.cxx index 225fcc460ac..c2f49732f57 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p5_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p5_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p5_test.cxx * @author scott snyder @@ -17,6 +15,7 @@ #include "TestTools/FLOATassert.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -86,7 +85,7 @@ void testit (const TrigMuonEFCbTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; // Get proxy created outside of leak checking. @@ -120,7 +119,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p6_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p6_test.cxx index d10aec256fa..53353bcfb77 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p6_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p6_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p6_test.cxx * @author scott snyder @@ -17,6 +15,7 @@ #include "TestTools/FLOATassert.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -86,7 +85,7 @@ void testit (const TrigMuonEFCbTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; // Get proxy created outside of leak checking. @@ -120,7 +119,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p7_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p7_test.cxx index d59eed7f049..26f8f480855 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p7_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p7_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFCbTrackCnv_p7_test.cxx @@ -15,6 +15,7 @@ #include "TestTools/FLOATassert.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -84,7 +85,7 @@ void testit (const TrigMuonEFCbTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -119,7 +120,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx index a248bda18f3..2a73a97c296 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigMuonEventTPCnv/TrigMuonEFInfoContainerCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -58,7 +57,7 @@ void testit (const TrigMuonEF& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -72,7 +71,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx index 8da60c5ab25..6f3b79f9167 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFCnv_p2_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/TrigMuonEFCnv_p2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -55,7 +54,7 @@ void testit (const TrigMuonEF& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -69,7 +68,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p4_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p4_test.cxx index 12e046cdaa7..06a504767c3 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p4_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p4_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p4_test.cxx @@ -15,6 +15,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -151,7 +152,7 @@ void testit (const TrigMuonEFInfo& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -247,7 +248,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p5_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p5_test.cxx index 31d6463e5e0..158b6c0e3b1 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p5_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p5_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFInfoCnv_p5_test.cxx @@ -15,6 +15,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -149,7 +150,7 @@ void testit (const TrigMuonEFInfo& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -245,7 +246,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoTrackCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoTrackCnv_p1_test.cxx index 305082f19ec..d97378e7985 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoTrackCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFInfoTrackCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFInfoTrackCnv_p1_test.cxx @@ -15,6 +15,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -106,7 +107,7 @@ void testit (const TrigMuonEFInfoTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -190,7 +191,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p1_test.cxx index d910d081ff3..f6f6742b0cf 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p1_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/TrigMuonEFIsolationCnv_p1.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -47,7 +46,7 @@ void testit (const TrigMuonEFIsolation& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; // Get proxy created outside of leak checking. @@ -68,7 +67,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p2_test.cxx index edeff5ecaa7..0fe9e5aaa20 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFIsolationCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/TrigMuonEFIsolationCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -46,7 +47,7 @@ void testit (const TrigMuonEFIsolation& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -68,7 +69,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p5_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p5_test.cxx index 86493fbb853..f4478813ba9 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p5_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p5_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p5_test.cxx * @author scott snyder @@ -17,6 +15,7 @@ #include "TestTools/FLOATassert.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -71,7 +70,7 @@ void testit (const TrigMuonEFTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -97,7 +96,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p6_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p6_test.cxx index 6b49ba163ed..d380eaf4d6d 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p6_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p6_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/TrigMuonEFTrackCnv_p6_test.cxx * @author scott snyder @@ -17,6 +15,7 @@ #include "TestTools/FLOATassert.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -71,7 +70,7 @@ void testit (const TrigMuonEFTrack& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -97,7 +96,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); -- GitLab From 6c620e949bfbc99990947b71e0241bbdc68ab8c0 Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Tue, 24 May 2022 12:48:09 +0200 Subject: [PATCH 28/56] TrigParticleTPCnv: Enable thread-safety checking. TrigParticleTPCnv: Enable thread-safety checking. Enable thread-safety checking and fix warnings. --- Trigger/TrigEvent/TrigParticleTPCnv/CMakeLists.txt | 4 ++-- .../TrigParticleTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../TrigParticleTPCnv/src/TrigEFBphysCnv_p2.cxx | 4 ++-- .../TrigParticleTPCnv/src/TrigEFBphysCnv_p3.cxx | 4 ++-- .../TrigParticleTPCnv/src/TrigElectronCnv_p2.cxx | 4 ++-- .../TrigParticleTPCnv/src/TrigElectronCnv_p3.cxx | 4 ++-- .../TrigParticleTPCnv/src/TrigL2BphysCnv_p2.cxx | 4 ++-- .../TrigParticleTPCnv/src/TrigL2BphysCnv_p3.cxx | 4 ++-- .../TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p2.cxx | 4 ++-- .../TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p3.cxx | 4 ++-- .../TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx | 7 ++++--- .../TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx | 9 ++++----- .../TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx | 9 ++++----- 28 files changed, 91 insertions(+), 92 deletions(-) create mode 100644 Trigger/TrigEvent/TrigParticleTPCnv/TrigParticleTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigParticleTPCnv/CMakeLists.txt index aab818e8182..c7ccda04aff 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigParticleTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigParticleTPCnv ) @@ -24,7 +24,7 @@ function( _add_test test ) atlas_add_test( ${test} SOURCES test/${test}.cxx - LINK_LIBRARIES TrigParticleTPCnv TestTools ) + LINK_LIBRARIES TrigParticleTPCnv TestTools CxxUtils ) endfunction() _add_test( TrigEFBjetCnv_p1_test ) diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/TrigParticleTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigParticleTPCnv/TrigParticleTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..4129911713b --- /dev/null +++ b/Trigger/TrigEvent/TrigParticleTPCnv/TrigParticleTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigParticleTPCnv diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p2.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p2.cxx index ef842ddfabd..6bf62cd505a 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigEFBphys.h" @@ -7,7 +7,7 @@ #include "TrigParticleTPCnv/TrigEFBphysCnv_p2.h" -static ElementLinkVectorCnv_p1 > trackELVCnv; +static const ElementLinkVectorCnv_p1 > trackELVCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p3.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p3.cxx index 1c86129747e..3bb8789c8af 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigEFBphysCnv_p3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigEFBphys.h" @@ -7,7 +7,7 @@ #include "TrigParticleTPCnv/TrigEFBphysCnv_p3.h" -static ElementLinkVectorCnv_p1 > trackELVCnv; +static const ElementLinkVectorCnv_p1 > trackELVCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p2.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p2.cxx index 017330a36db..0664d6e4d29 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigElectron.h" @@ -7,7 +7,7 @@ #include "TrigParticleTPCnv/TrigElectronCnv_p2.h" -static ElementLinkCnv_p1 > ELinkIDTrackCnv; +static const ElementLinkCnv_p1 > ELinkIDTrackCnv; // static ElementLinkCnv_p1 > m_ELinkEMclusterCnv; //----------------------------------------------------------------------------- diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p3.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p3.cxx index 60f38f394a8..718414d0b2c 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigElectronCnv_p3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigElectron.h" @@ -7,7 +7,7 @@ #include "TrigParticleTPCnv/TrigElectronCnv_p3.h" -static ElementLinkCnv_p3 > ELinkIDTrackCnv; +static const ElementLinkCnv_p3 > ELinkIDTrackCnv; // static ElementLinkCnv_p1 > m_ELinkEMclusterCnv; //----------------------------------------------------------------------------- diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p2.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p2.cxx index 25ce1da2813..fadaa4e2f91 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p2.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticleTPCnv/TrigL2Bphys_p2.h" #include "TrigParticle/TrigL2Bphys.h" #include "TrigParticleTPCnv/TrigL2BphysCnv_p2.h" -static ElementLinkVectorCnv_p1 > trackELVCnv; +static const ElementLinkVectorCnv_p1 > trackELVCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p3.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p3.cxx index a6b6d754e23..ee2f9bca427 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigL2BphysCnv_p3.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticleTPCnv/TrigL2Bphys_p3.h" #include "TrigParticle/TrigL2Bphys.h" #include "TrigParticleTPCnv/TrigL2BphysCnv_p3.h" -static ElementLinkVectorCnv_p1 > trackELVCnv; +static const ElementLinkVectorCnv_p1 > trackELVCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p2.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p2.cxx index 3c2913a2d01..691d2be6392 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p2.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigPhoton.h" #include "TrigParticleTPCnv/TrigPhoton_p2.h" #include "TrigParticleTPCnv/TrigPhotonCnv_p2.h" -static ElementLinkCnv_p1< ElementLink > eLinkEMClusterCnv; +static const ElementLinkCnv_p1< ElementLink > eLinkEMClusterCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p3.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p3.cxx index cd1051bcaba..0e7211966f5 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/src/TrigPhotonCnv_p3.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigParticle/TrigPhoton.h" #include "TrigParticleTPCnv/TrigPhoton_p3.h" #include "TrigParticleTPCnv/TrigPhotonCnv_p3.h" -static ElementLinkCnv_p3< ElementLink > eLinkEMClusterCnv; +static const ElementLinkCnv_p3< ElementLink > eLinkEMClusterCnv; //----------------------------------------------------------------------------- // Persistent to transient diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx index 2eea51e0750..55ffd264fed 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigEFBjetCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigEFBjetContainerCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -68,7 +67,7 @@ void testit (const TrigEFBjet& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -95,7 +94,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx index 00e71c687cf..171c444c818 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigEFBjetCnv_p2_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigEFBjetContainerCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -67,7 +66,7 @@ void testit (const TrigEFBjet& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx index dadcffd0d3f..25a446172b5 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigEFBphysCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticle/TrigEFBphysContainer.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -61,7 +60,7 @@ void testit (const TrigEFBphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; // Get proxies created outside of leak check. @@ -88,7 +87,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx index 043d0f98244..0649637e22f 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigParticleTPCnv/TrigEFBphysCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -51,7 +52,7 @@ void testit (const TrigEFBphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -79,7 +80,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx index 63d055a91a0..e8bd330aac0 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx @@ -13,6 +13,7 @@ #include "TrigParticleTPCnv/TrigEFBphysCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -51,7 +52,7 @@ void testit (const TrigEFBphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -79,7 +80,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx index 3ce04721e2a..eb0d088d4e3 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx @@ -15,6 +15,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -75,7 +76,7 @@ void testit (const TrigElectron& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -98,7 +99,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx index d8c99d29e66..358fafb0fb7 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx @@ -14,6 +14,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -72,7 +73,7 @@ void testit (const TrigElectron& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -95,7 +96,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx index 3c194ab98ed..dc430ed43d2 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigL2BjetCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -67,7 +66,7 @@ void testit (const TrigL2Bjet& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx index 7968393ed5a..04b29089e8c 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigL2BjetCnv_p2_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -67,7 +66,7 @@ void testit (const TrigL2Bjet& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx index 2657509c709..ce474745fef 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigL2BjetCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigParticleTPCnv/TrigL2BjetCnv_p3.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -64,7 +63,7 @@ void testit (const TrigL2Bjet& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -91,7 +90,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx index bff261b1136..baf98c1e09a 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigL2BphysCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticle/TrigL2BphysContainer.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -60,7 +59,7 @@ void testit (const TrigL2Bphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; // Get proxies created outside of leak check. @@ -87,7 +86,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx index 1948ef255ab..4216324b080 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigParticleTPCnv/TrigL2BphysCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -51,7 +52,7 @@ void testit (const TrigL2Bphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -79,7 +80,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx index 9f9ffddd113..adba114e5ba 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx @@ -13,6 +13,7 @@ #include "TrigParticleTPCnv/TrigL2BphysCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -51,7 +52,7 @@ void testit (const TrigL2Bphys& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -79,7 +80,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx index 7f6cda479cc..48d349d288f 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx @@ -15,6 +15,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -69,7 +70,7 @@ void testit (const TrigPhoton& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -88,7 +89,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx index cba8c1125e1..614e661543c 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx @@ -14,6 +14,7 @@ #include "SGTools/TestStore.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -66,7 +67,7 @@ void testit (const TrigPhoton& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -85,7 +86,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx index 32e62450dc7..15b84f2d96a 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigTauCnv_p1_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigTauCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -69,7 +68,7 @@ void testit (const TrigTau& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -85,7 +84,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx index b33c5321cf8..0e9eae37a56 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigTauCnv_p2_test.cxx * @author scott snyder @@ -16,6 +14,7 @@ #include "TrigParticleTPCnv/TrigTauCnv_tlp2.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -68,7 +67,7 @@ void testit (const TrigTau& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -84,7 +83,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx index 44589913fb3..5ebc159fedb 100644 --- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigParticleTPCnv/test/TrigTauCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigParticleTPCnv/TrigTauCnv_p3.h" #include "TestTools/FLOATassert.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -63,7 +62,7 @@ void testit (const TrigTau& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -79,7 +78,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; -- GitLab From ae4f8a6cc769cd4b30d4a139990887126447496c Mon Sep 17 00:00:00 2001 From: Peter Van Gemmeren Date: Tue, 24 May 2022 12:49:18 +0200 Subject: [PATCH 29/56] Add file ID to context label to handle multiple input files Add file ID to context label to handle multiple input files --- Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index 9abc201aba6..29d0f98efc4 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -188,7 +188,7 @@ StatusCode AthenaPoolCnvSvc::createObj(IOpaqueAddress* pAddress, DataObject*& re TokenAddress* tokAddr = dynamic_cast(pAddress); if (tokAddr != nullptr && tokAddr->getToken() != nullptr && (boost::starts_with(tokAddr->getToken()->contID(), m_persSvcPerInputType.value() + "(") || boost::starts_with(tokAddr->getToken()->contID(), m_persSvcPerInputType.value() + "_"))) { const unsigned int maxContext = m_poolSvc->getInputContextMap().size(); - const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString(), 1); + const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString() + tokAddr->getToken()->dbID().toString(), 1); char text[32]; ::sprintf(text, "[CTXT=%08X]", auxContext); if (m_poolSvc->getInputContextMap().size() > maxContext) { -- GitLab From eafd3533357434ddd84a4a94a45a8cb88e909958 Mon Sep 17 00:00:00 2001 From: Dan Guest Date: Tue, 24 May 2022 14:59:50 +0200 Subject: [PATCH 30/56] Cleanup for flavor tagging GNN tool Cleanup for flavor tagging GNN tool --- .../FlavorTagDiscriminants/CMakeLists.txt | 1 + .../FlavorTagDiscriminants/DL2HighLevel.h | 3 +- .../DataPrepUtilities.h | 1 - .../FlavorTagDiscriminants/GNN.h | 65 ++++++++ .../FlavorTagDiscriminants/GNNTool.h | 28 +--- .../FlavorTagDiscriminants/OnnxUtil.h | 4 +- .../Root/DL2HighLevel.cxx | 1 + .../Root/DataPrepUtilities.cxx | 1 + .../FlavorTagDiscriminants/Root/GNN.cxx | 152 ++++++++++++++++++ .../FlavorTagDiscriminants/Root/GNNTool.cxx | 138 +++------------- .../FlavorTagDiscriminants/Root/OnnxUtil.cxx | 22 +-- .../FlavorTagDiscriminants_entries.cxx | 2 +- .../util/get-onnx-metadata.cxx | 19 ++- 13 files changed, 274 insertions(+), 163 deletions(-) create mode 100644 PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h create mode 100644 PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt index 26eb7f42bde..7e185362669 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt @@ -27,6 +27,7 @@ atlas_add_library( FlavorTagDiscriminants Root/DL2Tool.cxx Root/DataPrepUtilities.cxx Root/OnnxUtil.cxx + Root/GNN.cxx Root/GNNTool.cxx Root/customGetter.cxx Root/FlipTagEnums.cxx diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h index 8724497ad21..06d49acb8f4 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h @@ -31,13 +31,14 @@ namespace FlavorTagDiscriminants { TrackLinkType = TrackLinkType::TRACK_PARTICLE, float default_output_value = NAN); DL2HighLevel(DL2HighLevel&&); + DL2HighLevel(const DL2HighLevel&); ~DL2HighLevel(); void decorate(const xAOD::BTagging& btag) const; void decorate(const xAOD::Jet& jet) const; void decorateWithDefaults(const xAOD::Jet& jet) const; FTagDataDependencyNames getDataDependencyNames() const; private: - std::unique_ptr m_dl2; + std::shared_ptr m_dl2; }; } diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h index b9d478da21c..6ad1693f9d8 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h @@ -6,7 +6,6 @@ #define DATA_PREP_UTILITIES_H // local includes -#include "FlavorTagDiscriminants/customGetter.h" #include "FlavorTagDiscriminants/FlipTagEnums.h" #include "FlavorTagDiscriminants/AssociationEnums.h" #include "FlavorTagDiscriminants/FTagDataDependencyNames.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h new file mode 100644 index 00000000000..ceb934e0b55 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef GNN_H +#define GNN_H + +// Tool includes +#include "FlavorTagDiscriminants/FlipTagEnums.h" +#include "FlavorTagDiscriminants/AssociationEnums.h" +#include "FlavorTagDiscriminants/FTagDataDependencyNames.h" + +#include "FlavorTagDiscriminants/DataPrepUtilities.h" + +// EDM includes +#include "xAODBTagging/BTaggingFwd.h" +#include "xAODJet/JetContainer.h" + +#include +#include +#include + +namespace FlavorTagDiscriminants { + + class OnnxUtil; + // + // Tool to to flavor tag jet/btagging object + // using GNN based taggers + class GNN + { + public: + GNN(const std::string& nnFile, + const FlipTagConfig& flip_config = FlipTagConfig::STANDARD, + const std::map& variableRemapping = {}, + const TrackLinkType trackLinkType = TrackLinkType::TRACK_PARTICLE, + float defaultOutputValue = NAN); + GNN(GNN&&); + GNN(const GNN&); + ~GNN(); + + virtual void decorate(const xAOD::BTagging& btag) const; + virtual void decorate(const xAOD::Jet& jet) const; + virtual void decorateWithDefaults(const xAOD::Jet& jet) const; + void decorate(const xAOD::Jet& jet, const SG::AuxElement& decorated) const; + + virtual std::set getDecoratorKeys() const; + virtual std::set getAuxInputKeys() const; + virtual std::set getConstituentAuxInputKeys() const; + + private: + + std::shared_ptr m_onnxUtil; + + SG::AuxElement::ConstAccessor> m_jetLink; + std::string m_input_node_name; + std::vector m_varsFromBTag; + std::vector m_varsFromJet; + std::vector m_trackSequenceBuilders; + std::map m_decorators; + float m_defaultValue; + + FTagDataDependencyNames m_dataDependencyNames; + }; +} +#endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h index 7b4684cf519..ae9f3562d29 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef GNN_TOOL_H @@ -15,19 +15,16 @@ // EDM includes #include "xAODBTagging/BTaggingFwd.h" -#include "xAODJet/Jet.h" -#include "xAODBTagging/BTagging.h" +#include "xAODJet/JetFwd.h" #include #include #include -#include "FlavorTagDiscriminants/DataPrepUtilities.h" -#include "FlavorTagDiscriminants/OnnxUtil.h" +namespace FlavorTagDiscriminants { + class GNN; -namespace FlavorTagDiscriminants { - struct GNNToolProperties { std::string nnFile; std::string flipTagConfig; @@ -56,27 +53,14 @@ namespace FlavorTagDiscriminants { virtual void decorateWithDefaults(const xAOD::Jet& jet) const override; void decorate(const xAOD::Jet& jet, const SG::AuxElement& decorated) const; - - virtual std::set getDecoratorKeys() const override; virtual std::set getAuxInputKeys() const override; virtual std::set getConstituentAuxInputKeys() const override; private: - GNNToolProperties m_props; //! - - std::unique_ptr m_onnxUtil; - lwt::GraphConfig m_config; - - SG::AuxElement::ConstAccessor> m_jetLink; - std::string m_input_node_name; - std::vector m_varsFromBTag; - std::vector m_varsFromJet; - std::vector m_trackSequenceBuilders; - std::map m_decorators; - - FTagDataDependencyNames m_dataDependencyNames; + GNNToolProperties m_props; + std::unique_ptr m_gnn; }; } #endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h index b020923e228..9e8cccb55ea 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h @@ -11,7 +11,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration namespace FlavorTagDiscriminants { typedef std::pair, std::vector> input_pair; - + // // Utility class that loads the onnx model from the given path // and runs inference based on the user given inputs @@ -30,7 +30,7 @@ namespace FlavorTagDiscriminants { std::map& output ) const; - std::string getMetaData(const std::string& key); + std::string getMetaData(const std::string& key) const; private: diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx index ebc1b7c1f87..20abbab7d0d 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx @@ -55,6 +55,7 @@ namespace FlavorTagDiscriminants { DL2HighLevel::~DL2HighLevel() = default; DL2HighLevel::DL2HighLevel(DL2HighLevel&&) = default; + DL2HighLevel::DL2HighLevel(const DL2HighLevel&) = default; void DL2HighLevel::decorate(const xAOD::BTagging& btag) const { m_dl2->decorate(btag); diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx index 0cb41f923df..f6576b560a3 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx @@ -4,6 +4,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #include "FlavorTagDiscriminants/DataPrepUtilities.h" #include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" +#include "FlavorTagDiscriminants/customGetter.h" #include "xAODBTagging/BTaggingUtilities.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx new file mode 100644 index 00000000000..7e668e4f5f5 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx @@ -0,0 +1,152 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "FlavorTagDiscriminants/GNN.h" +#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" +#include "FlavorTagDiscriminants/OnnxUtil.h" + +#include "xAODBTagging/BTagging.h" +#include "xAODJet/JetContainer.h" + +#include "PathResolver/PathResolver.h" +#include "lwtnn/parse_json.hh" + +#include + +namespace { + const std::string jetLinkName = "jetLink"; +} + +namespace FlavorTagDiscriminants { + + GNN::GNN(const std::string& nnFile, + const FlipTagConfig& flip_config, + const std::map& variableRemapping, + const TrackLinkType trackLinkType, + float defaultOutputValue): + m_onnxUtil(nullptr), + m_jetLink(jetLinkName), + m_defaultValue(defaultOutputValue) + { + std::string fullPathToOnnxFile = PathResolverFindCalibFile(nnFile); + m_onnxUtil = std::make_shared(fullPathToOnnxFile); + + std::string gnn_config_str = m_onnxUtil->getMetaData("gnn_config"); + std::stringstream gnn_config_stream; + gnn_config_stream << gnn_config_str; + + auto config = lwt::parse_json_graph(gnn_config_stream); + + auto [inputs, track_sequences, options] = dataprep::createGetterConfig( + config, flip_config, variableRemapping, trackLinkType); + + auto [vb, vj, ds] = dataprep::createBvarGetters(inputs); + m_varsFromBTag = vb; + m_varsFromJet = vj; + m_dataDependencyNames = ds; + + auto [tsb, td] = dataprep::createTrackGetters( + track_sequences, options); + m_trackSequenceBuilders = tsb; + m_dataDependencyNames += td; + + auto [decorators, dd] = dataprep::createDecorators( + config, options); + m_decorators = decorators; + m_dataDependencyNames += dd; + + } + GNN::GNN(GNN&&) = default; + GNN::GNN(const GNN&) = default; + GNN::~GNN() = default; + + void GNN::decorate(const xAOD::BTagging& btag) const { + auto jetLink = m_jetLink(btag); + if (!jetLink.isValid()) { + throw std::runtime_error("invalid jetLink"); + } + const xAOD::Jet& jet = **jetLink; + decorate(jet, btag); + } + void GNN::decorate(const xAOD::Jet& jet) const { + decorate(jet, jet); + } + void GNN::decorateWithDefaults(const xAOD::Jet& jet) const { + for (const auto& dec: m_decorators) { + for (const auto& node: dec.second) { + node.second(jet) = m_defaultValue; + } + } + } + + void GNN::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const { + + using namespace internal; + + std::map gnn_input; + + std::vector jet_feat; + for (const auto& getter: m_varsFromBTag) { + jet_feat.push_back(getter(btag).second); + } + for (const auto& getter: m_varsFromJet) { + jet_feat.push_back(getter(jet).second); + } + std::vector jet_feat_dim = {1, static_cast(jet_feat.size())}; + + input_pair jet_info (jet_feat, jet_feat_dim); + gnn_input.insert({"jet_features", jet_info}); + + for (const auto& builder: m_trackSequenceBuilders) { + std::vector track_feat; // (#tracks, #feats).flatten + int num_track_vars = static_cast(builder.sequencesFromTracks.size()); + int num_tracks = 0; + + Tracks sorted_tracks = builder.tracksFromJet(jet, btag); + Tracks flipped_tracks = builder.flipFilter(sorted_tracks, jet); + + int track_var_idx=0; + for (const auto& seq_builder: builder.sequencesFromTracks) { + auto double_vec = seq_builder(jet, flipped_tracks).second; + + if (track_var_idx==0){ + num_tracks = static_cast(double_vec.size()); + track_feat.resize(num_tracks * num_track_vars); + } + + // need to transpose + flatten + for (unsigned int track_idx=0; track_idx track_feat_dim = {num_tracks, num_track_vars}; + + input_pair track_info (track_feat, track_feat_dim); + gnn_input.insert({"track_features", track_info}); + } + + std::map outputs; + m_onnxUtil->runInference(gnn_input, outputs); + + for (const auto& dec: m_decorators) { + for (const auto& node: dec.second) { + node.second(btag) = outputs.at(node.first); + } + } + } // end of decorate() + + // Dependencies + std::set GNN::getDecoratorKeys() const { + return m_dataDependencyNames.bTagOutputs; + } + std::set GNN::getAuxInputKeys() const { + return m_dataDependencyNames.bTagInputs; + } + std::set GNN::getConstituentAuxInputKeys() const { + return m_dataDependencyNames.trackInputs; + } + +} diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx index 0736036aab1..c59f9e067d5 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx @@ -1,28 +1,15 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "FlavorTagDiscriminants/GNNTool.h" -#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" - -#include "xAODBTagging/BTaggingUtilities.h" -#include "PathResolver/PathResolver.h" - -#include "lwtnn/parse_json.hh" - -#include - - -namespace { - const std::string jetLinkName = "jetLink"; -} +#include "FlavorTagDiscriminants/GNN.h" namespace FlavorTagDiscriminants { GNNTool::GNNTool(const std::string& name): asg::AsgTool(name), - m_props(), - m_jetLink(jetLinkName) + m_props() { declareProperty("nnFile", m_props.nnFile, "the path to the netowrk file used to run inference"); @@ -49,126 +36,41 @@ namespace FlavorTagDiscriminants { if (m_props.trackLinkType.size() > 0) { trackLinkType = trackLinkTypeFromString(m_props.trackLinkType); } - - std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_props.nnFile); - - m_onnxUtil = std::make_unique (fullPathToOnnxFile); - m_onnxUtil->initialize(); - - std::string gnn_config_str = m_onnxUtil->getMetaData("gnn_config"); - - std::stringstream gnn_config_stream; - gnn_config_stream << gnn_config_str; - - m_config = lwt::parse_json_graph(gnn_config_stream); - - auto [inputs, track_sequences, options] = dataprep::createGetterConfig( - m_config, flip_config, m_props.variableRemapping, trackLinkType); - - auto [vb, vj, ds] = dataprep::createBvarGetters(inputs); - m_varsFromBTag = vb; - m_varsFromJet = vj; - m_dataDependencyNames = ds; - - auto [tsb, td] = dataprep::createTrackGetters( - track_sequences, options); - m_trackSequenceBuilders = tsb; - m_dataDependencyNames += td; - - auto [decorators, dd] = dataprep::createDecorators( - m_config, options); - m_decorators = decorators; - m_dataDependencyNames += dd; + m_gnn.reset( + new GNN( + m_props.nnFile, + flip_config, + m_props.variableRemapping, + trackLinkType, + m_props.default_output_value)); return StatusCode::SUCCESS; } void GNNTool::decorate(const xAOD::BTagging& btag) const { - auto jetLink = m_jetLink(btag); - if (!jetLink.isValid()) { - throw std::runtime_error("invalid jetLink"); - } - const xAOD::Jet& jet = **jetLink; - decorate(jet, btag); + m_gnn->decorate(btag); } void GNNTool::decorate(const xAOD::Jet& jet) const { - decorate(jet, jet); + m_gnn->decorate(jet, jet); } void GNNTool::decorateWithDefaults(const xAOD::Jet& jet) const { - for (const auto& dec: m_decorators) { - for (const auto& node: dec.second) { - node.second(jet) = m_props.default_output_value; - } - } + m_gnn->decorateWithDefaults(jet); } - void GNNTool::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const { - - using namespace internal; - - std::map gnn_input; - - std::vector jet_feat; - for (const auto& getter: m_varsFromBTag) { - jet_feat.push_back(getter(btag).second); - } - for (const auto& getter: m_varsFromJet) { - jet_feat.push_back(getter(jet).second); - } - std::vector jet_feat_dim = {1, static_cast(jet_feat.size())}; - - input_pair jet_info (jet_feat, jet_feat_dim); - gnn_input.insert({"jet_features", jet_info}); - - for (const auto& builder: m_trackSequenceBuilders) { - std::vector track_feat; // (#tracks, #feats).flatten - int num_track_vars = static_cast(builder.sequencesFromTracks.size()); - int num_tracks = 0; - - Tracks sorted_tracks = builder.tracksFromJet(jet, btag); - Tracks flipped_tracks = builder.flipFilter(sorted_tracks, jet); - - int track_var_idx=0; - for (const auto& seq_builder: builder.sequencesFromTracks) { - auto double_vec = seq_builder(jet, flipped_tracks).second; - - if (track_var_idx==0){ - num_tracks = static_cast(double_vec.size()); - track_feat.resize(num_tracks * num_track_vars); - } - - // need to transpose + flatten - for (unsigned int track_idx=0; track_idx track_feat_dim = {num_tracks, num_track_vars}; - - input_pair track_info (track_feat, track_feat_dim); - gnn_input.insert({"track_features", track_info}); - } - - std::map outputs; - m_onnxUtil->runInference(gnn_input, outputs); - - for (const auto& dec: m_decorators) { - for (const auto& node: dec.second) { - node.second(btag) = outputs.at(node.first); - } - } - } // end of decorate() + void GNNTool::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const + { + m_gnn->decorate(jet, btag); + } // Dependencies std::set GNNTool::getDecoratorKeys() const { - return m_dataDependencyNames.bTagOutputs; + return m_gnn->getDecoratorKeys(); } std::set GNNTool::getAuxInputKeys() const { - return m_dataDependencyNames.bTagInputs; + return m_gnn->getAuxInputKeys(); } std::set GNNTool::getConstituentAuxInputKeys() const { - return m_dataDependencyNames.trackInputs; + return m_gnn->getConstituentAuxInputKeys(); } } diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx index 8d21ec94255..0a69a1af920 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx @@ -13,17 +13,9 @@ namespace FlavorTagDiscriminants { // Constructor OnnxUtil::OnnxUtil(const std::string& path_to_onnx){ - m_path_to_onnx = path_to_onnx; - } - - // Destructor - OnnxUtil::~OnnxUtil(){ - } - - void OnnxUtil::initialize(){ //load the onnx model to memory using the path m_path_to_onnx - m_env = std::make_unique< Ort::Env >(ORT_LOGGING_LEVEL_ERROR, ""); + m_env = std::make_unique< Ort::Env >(ORT_LOGGING_LEVEL_FATAL, ""); // initialize session options if needed Ort::SessionOptions session_options; @@ -32,13 +24,13 @@ namespace FlavorTagDiscriminants { GraphOptimizationLevel::ORT_ENABLE_EXTENDED); // create session and load model into memory - m_session = std::make_unique< Ort::Session >(*m_env, m_path_to_onnx.c_str(), + m_session = std::make_unique< Ort::Session >(*m_env, path_to_onnx.c_str(), session_options); Ort::AllocatorWithDefaultOptions allocator; // get the input nodes size_t num_input_nodes = m_session->GetInputCount(); - + // iterate over all input nodes for (std::size_t i = 0; i < num_input_nodes; i++) { char* input_name = m_session->GetInputName(i, allocator); @@ -56,8 +48,10 @@ namespace FlavorTagDiscriminants { } } + // Destructor + OnnxUtil::~OnnxUtil() = default; - std::string OnnxUtil::getMetaData(const std::string& key){ + std::string OnnxUtil::getMetaData(const std::string& key) const { Ort::AllocatorWithDefaultOptions allocator; Ort::ModelMetadata metadata = m_session->GetModelMetadata(); @@ -71,8 +65,8 @@ namespace FlavorTagDiscriminants { std::map& output) const { // Args: - // gnn_inputs : {string: input_pair} - // outputs : {string: float} + // gnn_inputs : {string: input_pair} + // outputs : {string: float} std::vector input_tensor_values; diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx index 83ba50be460..6b1d9189add 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx @@ -38,4 +38,4 @@ DECLARE_COMPONENT(BTaggingBuilderAlg) DECLARE_COMPONENT(PoorMansIpAugmenterAlg) DECLARE_COMPONENT(TrackLeptonDecoratorAlg) DECLARE_COMPONENT(TrackTruthDecoratorAlg) -DECLARE_COMPONENT (TrackClassifier) +DECLARE_COMPONENT(TrackClassifier) diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx index 5ca33d97ecd..87bb64d1edc 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx @@ -2,8 +2,8 @@ #include int main(int narg, char* argv[]) { - if (narg != 3) { - std::cout << "usage: " << argv[0] << " " << std::endl; + if (narg != 3 && narg != 2) { + std::cout << "usage: " << argv[0] << " [key]" << std::endl; return 1; } @@ -14,7 +14,7 @@ int main(int narg, char* argv[]) { Ort::SessionOptions session_options; session_options.SetIntraOpNumThreads(1); session_options.SetGraphOptimizationLevel( - GraphOptimizationLevel::ORT_ENABLE_EXTENDED); + GraphOptimizationLevel::ORT_DISABLE_ALL); // create session and load model into memory auto session = std::make_unique< Ort::Session >(*env, argv[1], @@ -23,8 +23,19 @@ int main(int narg, char* argv[]) { // get metadata Ort::AllocatorWithDefaultOptions allocator; Ort::ModelMetadata metadata = session->GetModelMetadata(); + if (narg == 2) { + std::cout << "keys: "; + int64_t nkeys = 0; + char** keys = metadata.GetCustomMetadataMapKeys(allocator, nkeys); + for (int64_t i = 0; i < nkeys; i++) { + std::cout << keys[i]; + if (i+1 < nkeys) std::cout << ", "; + } + std::cout << std::endl; + return 2; + } std::string val = metadata.LookupCustomMetadataMap(argv[2], allocator); std::cout << val << std::endl; - + return 0; } -- GitLab From 73c781604740265ffb9bb48b6926d3feba451c02 Mon Sep 17 00:00:00 2001 From: Frank Winklmeier Date: Tue, 24 May 2022 15:28:06 +0200 Subject: [PATCH 31/56] CxxUtils: update thread-checker configuration - disable checking of auto-generated source files in `CMakeFiles` - add HighGranularityTimingDetector, LumiBlock and Trigger to the list of checked top-level directories --- Control/CxxUtils/share/checkergcc.config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Control/CxxUtils/share/checkergcc.config b/Control/CxxUtils/share/checkergcc.config index 07162ae4bd8..00391a327db 100644 --- a/Control/CxxUtils/share/checkergcc.config +++ b/Control/CxxUtils/share/checkergcc.config @@ -2,12 +2,22 @@ # # Configuration file for the checkergcc plugins. # see https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins +# +# Updates to this file only take effect after re-running the cmake configuration! +# [thread.check_paths] +# Hack: disable checking of auto-generated Cint dictionaries: +-CMakeFiles Calorimeter -Calorimeter/CaloRec -Calorimeter/CaloCnv/CaloJiveXML +HighGranularityTimingDetector HLT +LumiBlock MagneticField Tools -Tools/LWHists +Trigger +-Trigger/TrigAnalysis/TrigInDetAnalysisUser +-Trigger/TrigAnalysis/TrigInDetAnalysisExample -- GitLab From 8ec18cc04c9717439fd192290f30cb454ee9e015 Mon Sep 17 00:00:00 2001 From: Julien Maurer Date: Tue, 24 May 2022 15:42:13 +0200 Subject: [PATCH 32/56] Merge branch 'MC21FrozenShowers_master' into '22.0' Make MC21 standard configuration default for simulation See merge request atlas/athena!53194 (cherry picked from commit 3d0318cba3c119ca391d1b57c567bc5184fa3c3e) fbabfe42 Enable Frozen Showers by default for MC21 Full Simulation 75266059 Update the default Birks' law values to be the values tuned for G4 10.6.p03 aa92b6b5 Update Reference files after updating default values of Birks's constant and... --- LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx | 4 ++-- TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh | 6 +++--- Tools/Campaigns/python/MC21.py | 7 +++---- Tools/Campaigns/share/MC21Simulation.py | 5 ++--- Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py | 5 ++--- Tools/WorkflowTestRunner/python/References.py | 4 ++-- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx b/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx index d536ae84ebe..08c42bb75f3 100644 --- a/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx +++ b/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "LArG4Code/LArCalculatorSvcImp.h" @@ -9,7 +9,7 @@ LArCalculatorSvcImp::LArCalculatorSvcImp(const std::string& name, ISvcLocator *pSvcLocator) : base_class(name, pSvcLocator) , m_BirksLaw(true) - , m_Birksk(0.0486) + , m_Birksk(0.05832)// value updated for G4 10.6.p03 - 1.2 times the previous value of 0.0486 used in all campaigns before MC21. , m_OOTcut(300*CLHEP::ns) { declareProperty("BirksLaw",m_BirksLaw); diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh index 5c7b80f83c2..4270decfe2d 100644 --- a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh +++ b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ //************************************************************ @@ -109,8 +109,8 @@ private: TileSDOptions m_options{}; - Gaudi::Property m_birk1{this, "birk1",0.0130 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "exp. values from NIM 80 (1970) 239-244"}; - Gaudi::Property m_birk2{this, "birk2",9.6e-6 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2) * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "exp. values from NIM 80 (1970) 239-244"}; + Gaudi::Property m_birk1{this, "birk1",0.02002 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "value updated for G4 10.6.p03"}; + Gaudi::Property m_birk2{this, "birk2",0.0 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2) * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "value updated for G4 10.6.p03"}; /** @brief Keep hit time */ bool m_keepHitTime{}; diff --git a/Tools/Campaigns/python/MC21.py b/Tools/Campaigns/python/MC21.py index 4a44bf74bc0..87ce55015b1 100644 --- a/Tools/Campaigns/python/MC21.py +++ b/Tools/Campaigns/python/MC21.py @@ -73,12 +73,11 @@ def MC21SimulationBase(flags): flags.Sim.TRTRangeCut = 30.0 flags.Sim.TightMuonStepping = True - from SimuJobTransforms.SimulationHelpers import enableBeamPipeKill #, enableFrozenShowersFCalOnly + from SimuJobTransforms.SimulationHelpers import enableBeamPipeKill, enableFrozenShowersFCalOnly enableBeamPipeKill(flags) if flags.Sim.ISF.Simulator in [SimulationFlavour.FullG4MT, SimulationFlavour.FullG4MT_QS]: - # Not tuned yet for G4 10.6 - # enableFrozenShowersFCalOnly(flags) - pass + enableFrozenShowersFCalOnly(flags) + from SimuJobTransforms.G4Optimizations import enableG4Optimizations enableG4Optimizations(flags) diff --git a/Tools/Campaigns/share/MC21Simulation.py b/Tools/Campaigns/share/MC21Simulation.py index de04995bbf6..6a105f99864 100644 --- a/Tools/Campaigns/share/MC21Simulation.py +++ b/Tools/Campaigns/share/MC21Simulation.py @@ -17,8 +17,7 @@ if "ATLFAST" in ISF_Flags.Simulator() or "G4FastCalo" in ISF_Flags.Simulator(): from IOVDbSvc.CondDB import conddb conddb.addOverride("/TILE/OFL02/CALIB/SFR","TileOfl02CalibSfr-SIM-07") if "FullG4" in ISF_Flags.Simulator(): - # Not tuned yet for G4 10.6 - # protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") - pass + protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") + # enable G4 optimisations protectedInclude("SimulationJobOptions/preInclude.G4Optimizations.py") diff --git a/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py b/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py index 359e8b1309e..512a1fdf62d 100644 --- a/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py +++ b/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py @@ -18,8 +18,7 @@ if "ATLFAST" in ISF_Flags.Simulator() or "G4FastCalo" in ISF_Flags.Simulator(): from IOVDbSvc.CondDB import conddb conddb.addOverride("/TILE/OFL02/CALIB/SFR","TileOfl02CalibSfr-SIM-07") if "FullG4" in ISF_Flags.Simulator(): - # Not tuned yet for G4 10.6 - # protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") - pass + protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") + # enable G4 optimisations protectedInclude("SimulationJobOptions/preInclude.G4Optimizations.py") diff --git a/Tools/WorkflowTestRunner/python/References.py b/Tools/WorkflowTestRunner/python/References.py index 0336b7a3129..46ee631d29d 100644 --- a/Tools/WorkflowTestRunner/python/References.py +++ b/Tools/WorkflowTestRunner/python/References.py @@ -11,8 +11,8 @@ # Format is "test-branch" : "version" references_map = { # Simulation - "s3759": "v8", - "s3760": "v6", + "s3759": "v9", + "s3760": "v7", "s3779": "v4", # Overlay "d1590": "v9", -- GitLab From 2dcc84f85958d8f91b15762831c4089da9068c4f Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 19:07:36 +0200 Subject: [PATCH 33/56] Merge branch 'master_ATR-25576' into '22.0' Modification of ART grid configuration (ATR-25576) See merge request atlas/athena!53587 (cherry picked from commit f3f5a91619e2660b3de4271a87f8900509e0ec36) 98a25ba0 modifiction of ART grid configuration (ATR-25576) --- .../test/test_trigAna_RDOtoRun3DQ_v1Dev_grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRun3DQ_v1Dev_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRun3DQ_v1Dev_grid.py index abe790ef9d4..6f4d6aa1c10 100755 --- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRun3DQ_v1Dev_grid.py +++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_RDOtoRun3DQ_v1Dev_grid.py @@ -6,7 +6,7 @@ # art-include: master/Athena # art-include: 22.0/Athena # art-athena-mt: 4 -# art-memory: 7000 +# art-memory: 10000 # art-output: *.txt # art-output: *.log # art-output: log.* -- GitLab From baae9038671bddc96a72636618a2537425d47007 Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 16:20:17 +0200 Subject: [PATCH 34/56] Merge branch 'ma-hltjet-improve-hypo-timing-mon' into '22.0' HLTjet improvements to hypothesis timing monitoring plots See merge request atlas/athena!52914 (cherry picked from commit 89039eb0b06769b4753d2fd3ae15a1f8e5023418) ac762e7a exclude timing of extraneous calls in hypo timing histograms 23cd9f0d updated hypo timing histogram binning --- .../TrigHLTJetHypo/python/TrigJetHypoMonitoringConfig.py | 6 +++--- .../TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoTool.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoMonitoringConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoMonitoringConfig.py index 884019d159e..c09390ff752 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoMonitoringConfig.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoMonitoringConfig.py @@ -4,10 +4,10 @@ from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool def TrigJetHypoToolMonitoring(histPath, histFlags): montool = GenericMonitoringTool("MonTool", HistPath = histPath) - # Always make these. + # Always make these. Timing plots are 100 ms bins (expect everything in 0 bin) montool.defineHistogram('Et', title='Jet E_{T};E_{T} (GeV)', xbins=100, xmin=0, xmax=500, path='EXPERT', type='TH1F' ) - montool.defineHistogram('TIME_jetHypo,NJetsIn', title='JetHypo time vs input jets;time (ms) ;N(jets)', xbins=50, xmin=0, xmax=10, ybins=40, ymin=-0.5, ymax=39.5, path='EXPERT', type='TH2F' ) - montool.defineHistogram('TIME_jetHypo,NJetsOut', title='JetHypo time vs jets;time (ms) ;N(jets)', xbins=50, xmin=0, xmax=10, ybins=30, ymin=-0.5, ymax=29.5, path='EXPERT', type='TH2F' ) + montool.defineHistogram('TIME_jetHypo,NJetsIn', title='JetHypo time vs input jets;time (ms) ;N(jets)', xbins=50, xmin=0, xmax=5000, ybins=60, ymin=0, ymax=120, path='EXPERT', type='TH2F' ) + montool.defineHistogram('TIME_jetHypo,NJetsOut', title='JetHypo time vs jets;time (ms) ;N(jets)', xbins=50, xmin=0, xmax=5000, ybins=30, ymin=-0.5, ymax=29.5, path='EXPERT', type='TH2F' ) # Conditional histograms: monitor the mass for largeR jets (anything but a4), and etaphi for simple smallR if 'a4' not in histFlags: montool.defineHistogram('Mass', title='Jet mass;m (GeV)', xbins=100, xmin=0, xmax=200, path='EXPERT', type='TH1F' ) if ('simple' in histFlags) and ('a4' in histFlags) and all("HT" not in flag for flag in histFlags): diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoTool.cxx index 6a0a3b6e3d7..24aaa702a1f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoTool.cxx @@ -134,9 +134,9 @@ TrigJetHypoTool::decide(const xAOD::JetContainer* jets, // steady_clock::time_point t = steady_clock::now(); // monitoring -- timing plots (filled for every call) - auto tHypo = Monitored::Timer("TIME_jetHypo"); auto mon_NInputs = Monitored::Scalar("NJetsIn",jets->size()); auto mon_NOutputs = Monitored::Scalar("NJetsOut",-1); + auto tHypo = Monitored::Timer("TIME_jetHypo"); auto monitor_group_multTime = Monitored::Group( m_monTool, tHypo, mon_NOutputs, mon_NInputs); xAODJetCollector jetCollector; @@ -148,6 +148,7 @@ TrigJetHypoTool::decide(const xAOD::JetContainer* jets, << e.what()); return StatusCode::FAILURE; } + tHypo.stop(); if (!pass) { @@ -185,7 +186,6 @@ TrigJetHypoTool::decide(const xAOD::JetContainer* jets, ss << jetCollector.hypoJets(); jetdumper->collect("passed", ss.str()); } - tHypo.stop(); //monitoring -- filled in passing events HypoJetVector hjv = jetCollector.hypoJets(); -- GitLab From 0897b429f0d16151c41c538691fabceb1ccb8dbd Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 19:13:22 +0200 Subject: [PATCH 35/56] Merge branch 'tagnprobe_update' into '22.0' Upgrading the offline to use the new TagNProbe method + TagNProbe chains/art job update See merge request atlas/athena!53555 (cherry picked from commit aa4741265425986b0d65cae272c77e1b1aadcd45) 55fa9372 Upgrade offline code to use new TagNProbe class + updating TnP chains / art tests eaa2dea7 Renaming new Tag and Probe class 4083e5c2 Removing old unused Tag and Probe config files e2a72993 Removing reference to deleted TagNProbe2 class aaae1ac4 Resolving issues --- .../T_AnalysisConfigMT_Tier0.h | 6 +- .../T_AnalysisConfigR3_Tier0.h | 8 +- .../src/TrigR3Mon.cxx | 10 +- .../src/TrigTestBase.cxx | 7 +- .../Analysis/src/ConfAnalysis.cxx | 24 +- .../Analysis/src/ConfAnalysis.h | 31 +- .../Analysis/src/rmain.cxx | 170 ++++---- .../share/TIDAdata-chains-run3.dat | 9 + .../share/TIDAdata-run3-TnP.dat | 42 -- .../share/TIDAdata-run3-offline-TnP.dat | 38 -- .../share/TIDAhisto-panel-TnP.dat | 12 +- .../TrigInDetAnalysisUtils/TagNProbe.h | 277 +++++------- .../TrigInDetAnalysisUtils/TagNProbe2.h | 183 -------- .../TrigInDetAnalysisUtils/src/TagNProbe.cxx | 405 ++---------------- .../TrigInDetAnalysisUtils/src/TagNProbe2.cxx | 51 --- .../python/TrigInDetArtSteps.py | 4 +- .../TrigInDetValidation_AODtoTrkNtuple.py | 11 +- .../TrigInDetValidation/share/comparitor.json | 8 +- .../test/test_trigID_el_zee_pu40_TnP.py | 12 +- .../test/test_trigID_el_zee_tier0_pu40_TnP.py | 4 +- 20 files changed, 309 insertions(+), 1003 deletions(-) delete mode 100755 Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat delete mode 100755 Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat delete mode 100644 Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h delete mode 100644 Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h index 42fa8239f33..cd4dd0361af 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/Analysis_Tier0.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" @@ -106,7 +106,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -1362,7 +1362,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool; + TagNProbe* m_TnP_tool; TH1F* m_invmass; TH1F* m_invmass_obj; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h index f52eceb263b..0976472eead 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" #include "TrigInDetAnalysisExample/VtxAnalysis.h" @@ -110,7 +110,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -229,7 +229,7 @@ protected: virtual void loop() { - const TagNProbe2* pTnP_tool = m_TnP_tool; + const TagNProbe* pTnP_tool = m_TnP_tool; if( m_provider->msg().level() <= MSG::VERBOSE) { m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::loop() for " << T_AnalysisConfig::m_analysisInstanceName << endmsg; @@ -1256,7 +1256,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool ; + TagNProbe* m_TnP_tool ; bool m_tnp_flag; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx index c48e38d30d7..c3c85f7ab2b 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx @@ -13,7 +13,7 @@ #include "TrigInDetAnalysisUtils/Filters.h" #include "TrigInDetAnalysisUtils/Filter_Track.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" // #include "AthenaMonitoring/AthenaMonManager.h" // #include "AthenaMonitoring/ManagedMonitorToolTest.h" @@ -385,7 +385,7 @@ StatusCode TrigR3Mon::bookHistograms() { ChainString probe = m_chainNames[i] ; - TagNProbe2* tnp = 0; + TagNProbe* tnp = 0; if ( probe.extra().find("probe")!=std::string::npos ) { @@ -407,8 +407,8 @@ StatusCode TrigR3Mon::bookHistograms() { double massMin = 40; double massMax = 150; - if ( m_mcTruth ) tnp = new TagNProbe2( "Truth", massMin, massMax ); - else tnp = new TagNProbe2( "Offline", massMin, massMax ); + if ( m_mcTruth ) tnp = new TagNProbe( "Truth", massMin, massMax ); + else tnp = new TagNProbe( "Offline", massMin, massMax ); tnp->tag(tag) ; tnp->probe(probe) ; @@ -423,7 +423,7 @@ StatusCode TrigR3Mon::bookHistograms() { /// can only iuse R3 navigation now - if ( m_tdt->getNavigationFormat() != "TriggerElement" ) { + { ATH_MSG_INFO( "configure analysis: " << m_chainNames[i] ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx index 142170f760d..661c22cd89b 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx @@ -380,7 +380,7 @@ StatusCode TrigTestBase::book(bool newEventsBlock, bool newLumiBlock, bool newRu // tag and probe object creation for (unsigned i=0; itag(tag); tnp->probe(probe); ATH_MSG_DEBUG( "Tag and probe pair found: " + tag + " : " + probe ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx index 6581db1df25..b473a1ff664 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx @@ -65,6 +65,8 @@ void ConfAnalysis::initialise() { void ConfAnalysis::initialiseInternal() { + if ( m_initialised ) return; + m_initialised = true; // std::cout << "ConfAnalysis::initialise() " << name() << std::endl; @@ -314,6 +316,14 @@ void ConfAnalysis::initialiseInternal() { addHistogram( new TH1F( "roi_dphi", "roi_dphi", 50, -1, 1 ) ); addHistogram( new TH1F( "roi_dR", "roi_dR", 50, 0, 1 ) ); + // tag and probe invariant mass histograms + if ( m_TnP_tool ) { + m_invmass = new TH1F( "invmass", "invariant mass;mass [GeV]", 320, 0, 200 ); + m_invmassObj = new TH1F( "invmassObj", "invariant mass;mass [GeV]", 320, 0, 200 ); + addHistogram( m_invmass ); + addHistogram( m_invmassObj ); + } + // efficiencies and purities eff_pt = new Efficiency( find("pT"), "pT_eff" ); eff_pt->Hist()->GetXaxis()->SetTitle("P_{T} [GeV]"); @@ -891,7 +901,6 @@ void ConfAnalysis::finalise() { if ( !m_initialised ) return; - std::cout << "ConfAnalysis::finalise() " << name(); if ( name().size()<19 ) std::cout << "\t"; @@ -899,6 +908,7 @@ void ConfAnalysis::finalise() { if ( name().size()<41 ) std::cout << "\t"; if ( name().size()<52 ) std::cout << "\t"; + std::cout << "\tNreco " << Nreco << "\tNref " << Nref << "\tNmatched " << Nmatched; @@ -918,7 +928,6 @@ void ConfAnalysis::finalise() { std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) hitr->second->Write(); - // std::cout << "DBG >" << eff_pt->Hist()->GetName() << "< DBG" << std::endl; // std::vector heff = { eff_pt, @@ -935,7 +944,7 @@ void ConfAnalysis::finalise() { eff_roi_deta, eff_roi_dphi, eff_roi_dR }; - + for ( unsigned i=0 ; ifinalise(); heff[i]->Bayes()->Write( ( heff[i]->name()+"_tg" ).c_str() ); @@ -943,7 +952,6 @@ void ConfAnalysis::finalise() { // std::cout << "DBG >" << purity_pt->Hist()->GetName() << "< DBG" << std::endl; - eff_vs_mult->finalise(); // Normalise(n_vtx_tracks); @@ -989,8 +997,6 @@ void ConfAnalysis::finalise() { mdeltaR_v_eta->Finalise(); mdeltaR_v_eta->Write(); mdeltaR_v_pt->Finalise(); mdeltaR_v_pt->Write(); - - for ( unsigned i=rDd0res.size() ; i-- ; ) { rDd0res[i]->Finalise(Resplot::FitNull95); rDd0res[i]->Write(); @@ -1174,10 +1180,10 @@ void ConfAnalysis::execute(const std::vector& reftracks, TrigObjectMatcher* objects ) { // leave this commented code in for debug purposes ... - // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; + // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; - if ( !m_initialised ) initialiseInternal(); - + if ( !m_initialised ) initialiseInternal(); + if ( m_print ) { std::cout << "ConfAnalysis::execute() \t " << name() << "\tref " << reftracks.size() diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h index 761d2178cb2..93a0daffea7 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h @@ -24,6 +24,7 @@ #include "TrigInDetAnalysis/TrigObjectMatcher.h" #include "TrigInDetAnalysisExample/ChainString.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "Resplot.h" @@ -50,23 +51,26 @@ class ConfAnalysis : public TrackAnalysis { public: - ConfAnalysis( const std::string& name, const ChainString& config ) : + ConfAnalysis( const std::string& name, const ChainString& config, TagNProbe* TnP_tool=0 ) : TrackAnalysis( clean(name) ), mconfig(config), Nreco(0), Nref(0), Nmatched(0), m_print(false), m_roi(0), m_initialised(false), m_initialiseFirstEvent(false) { // , m_lfirst(true) { std::cout << "ConfAnalysis::ConfAnalysis() " << TrackAnalysis::name() << " ..." << std::endl; - } - + setTnPtool( TnP_tool ); + } + ~ConfAnalysis() { // std::cout << "ConfAnalysis::~ConfAnalysis() " << name() << std::endl; std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) delete hitr->second; - //2D histograms + //2D histograms std::map::iterator hitr2D=m_histos2D.begin(); - std::map::iterator hend2D=m_histos2D.end(); + std::map::iterator hend2D=m_histos2D.end(); for ( ; hitr2D!=hend2D ; hitr2D++ ) delete hitr2D->second; + // tag and probe object + if ( m_TnP_tool ) delete m_TnP_tool; } virtual void initialise(); @@ -108,6 +112,16 @@ public: const ChainString& config() const { return mconfig; } + // methods for tag and probe invariant mass plots + + void setTnPtool(TagNProbe* TnP_tool) { m_TnP_tool = TnP_tool; } + + virtual TagNProbe* getTnPtool() { return m_TnP_tool; } + + virtual TH1F* getHist_invmass() { return m_invmass; } + + virtual TH1F* getHist_invmassObj() { return m_invmassObj; } + private: void addHistogram( TH1F* h ) { @@ -140,6 +154,13 @@ private: std::map m_histos; std::map m_histos2D; + // tag and probe invariant mass histograms + TH1F* m_invmass = 0; + TH1F* m_invmassObj = 0; + + // tag and probe object + TagNProbe* m_TnP_tool; + Efficiency* eff_pt = 0; Efficiency* eff_ptp = 0; Efficiency* eff_ptm = 0; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx index ce84ce93cc4..b982ecb95b5 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx @@ -427,8 +427,6 @@ int main(int argc, char** argv) bool useoldrms = true; bool nofit = false; - bool doTnP = false; // added for tagNprobe - bool doTnP_histos = false; // added for tagNprobe std::string vertexSelection = ""; std::string vertexSelection_rec = ""; @@ -448,8 +446,6 @@ int main(int argc, char** argv) refChain = argv[i]; } else if ( std::string(argv[i])=="--rms" ) useoldrms = false; - else if ( std::string(argv[i])=="--tnp" ) doTnP = true; - else if ( std::string(argv[i])=="--tnph" ) doTnP_histos = true; else if ( std::string(argv[i])=="-n" || std::string(argv[i])=="--nofit" ) nofit = true; else if ( std::string(argv[i])=="-t" || std::string(argv[i])=="--testChain" ) { if ( ++i>=argc ) return usage(argv[0], -1); @@ -570,10 +566,6 @@ int main(int argc, char** argv) int ntracks = 0; - /// Zmass window cuts for Tag&Probe analysis - double ZmassMax = 110.; // GeV - double ZmassMin = 70.; // GeV - //bool printflag = false; // JK removed (unused) bool rotate_testtracks = false; @@ -646,12 +638,6 @@ int main(int argc, char** argv) if ( inputdata.isTagDefined("Rmatch") ) Rmatch = inputdata.GetValue("Rmatch"); - /// set upper and lower Zmass window cuts from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("ZmassMax") ) ZmassMax = inputdata.GetValue("ZmassMax"); - if ( inputdata.isTagDefined("ZmassMin") ) ZmassMin = inputdata.GetValue("ZmassMin"); - /// set doTnP_histos flag from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("doTnPHistos") ) doTnP_histos = ( inputdata.GetValue("doTnPHistos")==0 ? false : true ); - std::string useMatcher = "DeltaR"; if ( inputdata.isTagDefined("UseMatcher") ) useMatcher = inputdata.GetString("UseMatcher"); @@ -672,32 +658,6 @@ int main(int argc, char** argv) else if ( inputdata.isTagDefined("testChain") ) testChains.push_back( inputdata.GetString("testChain") ); } - /// get the tag and probe chains for Tag&Probe analysis - - TagNProbe* TnP_tool = 0; // declare T&P tool as null pointer - - if ( inputdata.isTagDefined("TagnProbe") ) { - - /// The TagnProbe chain name vector is stuctured in pairs - /// Each pair has the strucure: tag chain - probe chain - - TnP_tool = new TagNProbe(); // initialise T&P tool - - testChains.clear(); // delete the old testChain vector - - /// get the Tag&Probe chain name vector - std::vector tnpChains = inputdata.GetStringVector("TagnProbe"); - - TnP_tool->FillMap( tnpChains ); // fill tag/probe chains map for bookkeeping - - doTnP = TnP_tool->isTnP(); // set the T&P flag - if ( !doTnP ) doTnP_histos = false; // set this flag to false if doTnP is false - - testChains = TnP_tool->GetProbeChainNames(); // replace testChains - - } - - /// new code - can extract vtx name, pt, any extra options that we want, /// but also chop off everythiung after :post @@ -1128,10 +1088,52 @@ int main(int argc, char** argv) // std::cout << "chain name " << chainname << "\t:" << chainnames.back() << " : " << chainnames.size() << std::endl; + // tag and probe object creation and configuration + + TagNProbe* TnP_tool = 0; + ChainString probe = chainConfig[i]; + + if ( probe.extra().find("_tag")!=std::string::npos ) continue; + + // probe can be the .head() so convert m_chainNames to a ChainString and search the .extra() specifically + size_t p = probe.extra().find("_probe"); + + if ( p!=std::string::npos ) { + + std::string probe_key = probe.extra().erase( p, 6) ; + + for ( unsigned j=0 ; jtag(tag); + TnP_tool->probe(probe); + std::cout << "Tag and probe pair found! \nTag : " << tag << "\nProbe: " << probe <initialiseFirstEvent(initialiseFirstEvent); analy_conf->initialise(); @@ -1170,9 +1172,19 @@ int main(int argc, char** argv) // for (unsigned int ic=0 ; ic::value_type( chainname, analy_conf ) ); + analyses.push_back(analy_conf); + } + else { + std::cerr << "WARNING: Duplicated chain" + << "\n" + << "---------------------------------" + << "---------------------------------" + << "---------------------------------" << std::endl; + continue; + } std::cout << "analysis: " << chainname << "\t" << analy_conf << "\n" @@ -1190,9 +1202,6 @@ int main(int argc, char** argv) analyses.push_back(analp); } - /// filling map for Tag&Probe invariant mass histograms - if ( doTnP_histos ) TnP_tool->BookMinvHisto( chainname ); - } std::cout << "main() finished looping" << std::endl; @@ -1773,18 +1782,6 @@ int main(int argc, char** argv) std::cout << "reference chain:\n" << *refchain << std::endl; } - /// configure the T&P tool for this event, if doTnP = true - if ( doTnP ) { - TnP_tool->ResetEventConfiguration(); /// reset the TnP_tool for this event - - /// do the event-by-event configuration - TnP_tool->SetEventConfiguration( - &refTracks, refFilter, // offline tracks and filter - refChain, // offline chain name - &tom, // trigger object matcher - ZmassMin, ZmassMax ); // set the Zmass range - } - for ( unsigned ic=0 ; icchains().size() ; ic++ ) { TIDA::Chain& chain = track_ev->chains()[ic]; @@ -1798,27 +1795,29 @@ int main(int argc, char** argv) if ( analitr==analysis.end() ) continue; - - if ( debugPrintout ) { - std::cout << "test chain:\n" << chain << std::endl; + if ( debugPrintout ) { + std::cout << "test chain:\n" << chain << std::endl; } - - std::vector rois; /// these are the rois to process - - if ( doTnP ) { - /// if doTnP = true, do the T&P selection and get the vector of RoIs - rois = TnP_tool->GetRois( &chain, track_ev->chains() ); - /// now the TnP_tool object contains all the info on the good probes that have been found - /// including, for each one of them, the invariant mass(es) calculated with the - /// corresponding tag(s). One can access to these info at any time in the following lines + ConfAnalysis* cf = dynamic_cast(analitr->second); + + std::vector rois; /// these are the rois to process + + // tag and probe object retreival and filling of the roi vector + TagNProbe* TnP_tool = cf->getTnPtool(); + if ( TnP_tool ) { + foutdir->cd(); + cf->initialiseInternal(); + // changes to output directory and books the invariant mass histograms + TH1F* m_invmass = cf->getHist_invmass(); + TH1F* m_invmass_obj = cf->getHist_invmassObj(); + rois = TnP_tool->GetRois( track_ev->chains(), &refTracks, refFilter, m_invmass, m_invmass_obj ); } else { - /// if doTnP==false, do std analysis and fill the rois vector from chain - rois.reserve( chain.size() ); - for ( size_t ir=0 ; irFillMinvHisto( chain.name(), ir ); - } - testTracks.clear(); testTracks.selectTracks( troi.tracks() ); @@ -2029,8 +2020,6 @@ int main(int argc, char** argv) /// remove any tracks below the pt threshold if one is specifed for the analysis - ConfAnalysis* cf = dynamic_cast( analitr->second ); - if ( cf ) { std::string ptconfig = cf->config().postvalue("pt"); if ( ptconfig!="" ) { @@ -2293,13 +2282,6 @@ int main(int argc, char** argv) delete analyses[i]; } - /// write out the histograms - if ( doTnP ) { - // saving Minv histos for Tag&Probe analysis if doTnP_histos = true - if ( doTnP_histos ) TnP_tool->WriteMinvHisto( foutdir ); - delete TnP_tool; // deleting T&P tool - } - foutput.Write(); foutput.Close(); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat index 9c15bd454c6..862bdb0204a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat @@ -58,6 +58,15 @@ testChains = { "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_FTF:HLT_Roi_FastElectron_LRT:0", "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_IDTrig:HLT_Roi_FastElectron_LRT:0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1", + "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso", diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat deleted file mode 100755 index 747a00e6958..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat +++ /dev/null @@ -1,42 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - - -refChain = "Truth"; -//refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - - -MinVertices = 0; - - -// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - - -InitialiseFirstEvent = 1; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"./"} - - -#include "TIDAbeam.dat" - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat deleted file mode 100755 index 64ce7e2cdd4..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat +++ /dev/null @@ -1,38 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts-offline.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - -//refChain = "Truth"; -refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - -MinVertices = 0; - -/// do not loadthe chains for the TnP analyses -/// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00363979.physics_Main.merge.AOD.f1002_m2037-20191004-141732_EXT0"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00358395.physics_Main.merge.AOD.f961_m2015-20191004-141716_EXT0"}; - -#include "TIDAbeam.dat" - - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat index 612d89ee58a..33c3049d418 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat @@ -1,6 +1,6 @@ // emacs: this is -*- c++ -*- -panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel, tnp_panel }; +panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel }; panel_columns = { eff_panel, 3 }; @@ -63,7 +63,10 @@ dist_panel = { "a0_rec", "a0 rec", "xaxis:lin:autosym:-3:3", "Trigger a_{0} [mm]", "yaxis:log:auton", "Normalised entries", "z0", "z0", "xaxis:lin:-200:200", "Reference z_{0} [mm]", "yaxis:log:auton", "Normalised entries", - "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries" + "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries", + + "invmass", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "Entries" , + "invmass_obj", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "Entries", }; @@ -96,8 +99,3 @@ trt_panel = { }; -tnp_panel = { - "Minv_TnP", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "" , - "Minv_obj_TnP", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h index 51f53e9eff6..d54e99c8fd9 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h @@ -2,221 +2,182 @@ /** ** @file TagNProbe.h ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #ifndef TIDAUTILS_TAGNPROBE_H #define TIDAUTILS_TAGNPROBE_H -#include +#include -#include "TLorentzVector.h" +#include "TrigInDetAnalysis/TIDAChain.h" +#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TrigInDetAnalysis/TrigObjectMatcher.h" +#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDAEvent.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/Filters.h" -#include "TrigInDetAnalysisUtils/Filter_Offline2017.h" -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TH1D.h" -#include -#include -#include - -#include "TrigInDetAnalysis/TrackAnalysis.h" -#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDDirectory.h" -#include "TrigInDetAnalysis/Efficiency.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TLorentzVector.h" class TagNProbe { public: - TagNProbe() { } - + TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); + virtual ~TagNProbe() { } + /// getters and setters - /// configuration methods - - void SetEventConfiguration( - TrackSelector * refTracks, // reference tracks - TrackFilter* refFilter, // reference filter - std::string refName, // reference objects name - TrigObjectMatcher* tom, // trigger object matcher - double ZmassMin, // ZmassMin - double ZmassMax, // ZmassMax - bool unique_flag=true ) { // unique flag (default=true) - m_refTracks = refTracks; - m_refFilter = refFilter; - m_particleType = refName; - m_tom = tom; - m_ZmassMin = ZmassMin; - m_ZmassMax = ZmassMax; - m_unique = unique_flag; - } - - void ResetEventConfiguration() { - m_refTracks = 0; - m_refFilter = 0; - m_particleType = ""; - m_tom = 0; - m_ZmassMin = 0.; - m_ZmassMax = 999.; - m_unique = false; - } - - void SetUniqueFlag( bool flag ) { m_unique = flag; } - - void SetParticleType( std::string type ) { m_particleType = type; } - - void SetZmassWindow( double ZmassMin, double ZmassMax ) { m_ZmassMin = ZmassMin; m_ZmassMax = ZmassMax; } - - void SetObjMatcher( TrigObjectMatcher* tom ) { m_tom = tom; } - - void SetOfflineTracks( TrackSelector * refTracks, TrackFilter* refFilter ) { - m_refTracks = refTracks; - m_refFilter = refFilter; - } - - void SetChains( TIDA::Chain * chain, TIDA::Chain * chain_tnp ) { - m_chain = chain; - m_chain_tnp = chain_tnp; - } - - template - void Fill( T* h, T* h1, int i ) { - /// don't need to check both these, we can just call this as many times as we like, - /// could pass in the vector even so that - // we leave the old code in, but commented, since we are still developing, so once - // we know everything is working we can delete all the older code - // if ( m_masses[i].size() == m_masses_obj[i].size() && m_masses[i].size() > 0 ) { - - /// don't understand this - why is this method filling lots of masses - /// from an vector of masses from 0 up to the input index ? - /// isn't this index just the index of the roi ? Why the loop ? - for ( size_t im=0 ; imFill( m_masses[i].at(im) ); - } - for ( size_t im=0 ; imFill( m_masses_obj[i].at(im) ); - } - } - - - /// probe searching method - - bool FindProbes(); - - void FindTIDAChains( std::vector& chains ) ; - - /// getter methods + /// could be moved to the constructor now ... + void tag( const std::string& chainName ) { m_tagChainName = chainName; } + void probe( const std::string& chainName ) { m_probeChainName = chainName; } - std::vector GetProbes() { return m_probes; } + const std::string& tag() const { return m_tagChainName; } + const std::string& probe() const { return m_probeChainName; } - std::vector GetTags( unsigned int probe_index=0 ) { return m_tags[ probe_index ]; } - - std::vector GetInvMasses( unsigned int probe_index=0 ) { return m_masses[ probe_index ]; } - - std::vector GetInvMasses_obj( unsigned int probe_index=0 ) { return m_masses_obj[ probe_index ]; } - - std::vector GetRois( TIDA::Chain * chain, std::vector& chains ); - - std::vector GetRois( std::vector& chains ); - - void tag( const std::string& chainName ) { m_tagChainName = chainName ; } - - const std::string& tag() { return m_tagChainName ; } - - void probe( const std::string& chainName ) { m_probeChainName = chainName ; } - - const std::string& probe() { return m_probeChainName ; } +public: - TIDA::Chain* GetTIDAProbe() { return m_chain_tnp ; } + template + std::vector GetRois( std::vector& chains, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0 ) const { - TIDA::Chain* GetTIDATag() { return m_chain ; } + std::vector probes; - TH1D* GetMinvHisto() { return m_hMinv ; } + TIDA::Chain* chain_tag = findChain( tag(), chains ); + TIDA::Chain* chain_probe = findChain( probe(), chains ); - TH1D* GetMinvObjHisto() { return m_hMinv_obj ; } + if ( chain_tag==0 || chain_probe==0 ) return probes; + // loop for possible probes + for ( size_t ip=0 ; ipsize() ; ip++ ) { + + TIDA::Roi& proi = chain_probe->rois()[ip]; + + TIDARoiDescriptor roi_probe( proi.roi() ); + + bool found_tnp = false; + + // loop for possible tags + for ( size_t it=0 ; itsize() ; it++ ) { + + TIDA::Roi& troi = chain_tag->rois()[it]; + TIDARoiDescriptor roi_tag( troi.roi() ); + + /// tag and probe are the same: skip this tag + if ( roi_probe == roi_tag ) continue; + + if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { + found_tnp = true; + if ( m_unique ) break; + } + + } // end loop on tags + + if ( found_tnp ) probes.push_back( &proi ); + + } // end loop on probes + + return probes; + + } - /// utility methods +protected: - void FillMap( std::vector& tnpChains ); + double pt( const TIDA::Track* t ) const { return t->pT(); } + double pt( const TrackTrigObject* t ) const { return t->pt(); } - std::vector GetProbeChainNames() { return m_probe_chain_names; } - - bool isTnP() { return m_tnp_map.size()>0; } - - TIDA::Chain* GetTagChain( std::string probe_name, std::vector& chains ); + template + double mass( const T* t1, const T* t2 ) const { + TLorentzVector v1; + v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); + TLorentzVector v2; + v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); + return (v1+v2).M(); + } - void BookMinvHisto( std::string chain_name ); - void BookMinvHisto(); + template + bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0) const { + + /// get reference tracks from the tag roi + TIDARoiDescriptor roi_tag( troi.roi() ); - void FillMinvHisto( std::string chain_name, unsigned int probe_index ); + dynamic_cast(refFilter)->setRoi( &roi_tag ); - void FillMinvHisto( unsigned int probe_index ); + std::vector refp_tag = refTracks->tracks( refFilter ); - void WriteMinvHisto( TDirectory* foutdir ); + /// get reference tracks from the probe roi + TIDARoiDescriptor roi_probe( proi.roi() ); + dynamic_cast( refFilter )->setRoi( &roi_probe ); - /// internal methods for computation (protected) + std::vector refp_probe = refTracks->tracks( refFilter ); -protected: + /// loop over tag ref tracks + bool found = false; - std::pair selection( TIDA::Roi & troi, TIDA::Roi & proi ); + for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); + + if ( invmass_obj>m_massMin && invmass_objFill( invmass ); + hmass_obj->Fill( invmass_obj ); + found = true; + } + } + } - /// internally used variables + return found; -private: + } - TrackSelector * m_refTracks; - TrackFilter * m_refFilter; - TIDA::Chain * m_chain; - TIDA::Chain * m_chain_tnp; + double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - std::string m_probeChainName ; - std::string m_tagChainName ; + TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - std::vector m_probes; - std::vector< std::vector > m_masses; - std::vector< std::vector > m_masses_obj; - std::vector< std::vector > m_tags; - bool m_unique; +private: std::string m_particleType; - double m_ZmassMin, m_ZmassMax; + double m_mass; - TrigObjectMatcher* m_tom; + double m_massMin; + double m_massMax; - /// supporting variables for utility methods + bool m_unique; - std::map m_tnp_map; - std::vector m_probe_chain_names; + std::string m_probeChainName ; + std::string m_tagChainName ; - std::map m_hMinv_map; - std::map m_hMinv_obj_map; +}; - TH1D* m_hMinv ; - TH1D* m_hMinv_obj ; -}; +#endif /// TIDAUTILS_TAGNPROBE_H + -#endif // TIDAUTILS_TAGNPROBE_H diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h deleted file mode 100644 index 73f74c10550..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h +++ /dev/null @@ -1,183 +0,0 @@ -/// emacs: this is -*- c++ -*- -/** - ** @file TagNProbe2.h - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#ifndef TIDAUTILS_TAGNPROBE2_H -#define TIDAUTILS_TAGNPROBE2_H - -#include - -#include "TrigInDetAnalysis/TIDAChain.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TrigInDetAnalysis/Track.h" - -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysisUtils/Filters.h" - -#include "TLorentzVector.h" - - -class TagNProbe2 { - -public: - - TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); - - virtual ~TagNProbe2() { } - - /// getters and setters - - /// could be moved to the constructor now ... - void tag( const std::string& chainName ) { m_tagChainName = chainName; } - void probe( const std::string& chainName ) { m_probeChainName = chainName; } - - const std::string& tag() const { return m_tagChainName; } - const std::string& probe() const { return m_probeChainName; } - -public: - - template - std::vector GetRois( std::vector& chains, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0 ) const { - - std::vector probes; - - TIDA::Chain* chain_tag = findChain( tag(), chains ); - TIDA::Chain* chain_probe = findChain( probe(), chains ); - - if ( chain_tag==0 || chain_probe==0 ) return probes; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = chain_probe->rois()[ip]; - - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = chain_tag->rois()[it]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { - found_tnp = true; - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) probes.push_back( &proi ); - - } // end loop on probes - - return probes; - - } - -protected: - - double pt( const TIDA::Track* t ) const { return t->pT(); } - double pt( const TrackTrigObject* t ) const { return t->pt(); } - - template - double mass( const T* t1, const T* t2 ) const { - TLorentzVector v1; - v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); - TLorentzVector v2; - v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); - return (v1+v2).M(); - } - - - template - bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0) const { - - /// get reference tracks from the tag roi - TIDARoiDescriptor roi_tag( troi.roi() ); - - dynamic_cast(refFilter)->setRoi( &roi_tag ); - - std::vector refp_tag = refTracks->tracks( refFilter ); - - /// get reference tracks from the probe roi - TIDARoiDescriptor roi_probe( proi.roi() ); - - dynamic_cast( refFilter )->setRoi( &roi_probe ); - - std::vector refp_probe = refTracks->tracks( refFilter ); - - /// loop over tag ref tracks - bool found = false; - - for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); - - if ( invmass_obj>m_massMin && invmass_objFill( invmass ); - hmass_obj->Fill( invmass_obj ); - found = true; - } - - } - } - - return found; - - } - - - double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - - TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - - -private: - - std::string m_particleType; - - double m_mass; - - double m_massMin; - double m_massMax; - - bool m_unique; - - std::string m_probeChainName ; - std::string m_tagChainName ; - -}; - - -#endif /// TIDAUTILS_TAGNPROBE2_H - - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx index c85753f5dc7..49140186e09 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx @@ -1,408 +1,51 @@ /** ** @file TagNProbe.cxx ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #include "TrigInDetAnalysisUtils/TagNProbe.h" -double TagNProbe::computeZ_obj( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1, v2; - double z0_1, z0_2; - if ( tnpType.Contains("Electron") ) { - - if ( m_tom != 0 && !m_tom->status() ) - return -1.0; - - const TrackTrigObject* tobj1 = m_tom->object( t1->id() ); - const TrackTrigObject* tobj2 = m_tom->object( t2->id() ); - - v1.SetPtEtaPhiM( (tobj1->pt())/1000., tobj1->eta(), tobj1->phi(), mass ); - v2.SetPtEtaPhiM( (tobj2->pt())/1000., tobj2->eta(), tobj2->phi(), mass ); - z0_1 = (double)(tobj1->z0()); - z0_2 = (double)(tobj2->z0()); - } - else { - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - z0_1 = (double)(t1->z0()); - z0_2 = (double)(t2->z0()); - } - - double invMass = (double)( v1 + v2 ).M(); - double z0diff = std::fabs( z0_1 - z0_2 ); - - if ( invMass > m_ZmassMin && invMass < m_ZmassMax && z0diff < 5 ) return invMass; - - return -1.0; - -} - - - - -// ------------------------------------------------------------------ - -double TagNProbe::computeZ( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1; - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - - TLorentzVector v2; - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - - double invMass = (double)( v1 + v2 ).M(); - - /// this cut is performed on the object-based inv. mass - return invMass; - -} - - - - -// ------------------------------------------------------------------ - -std::pair TagNProbe::selection( TIDA::Roi& troi, TIDA::Roi& proi ) +TagNProbe::TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag ) : + m_particleType(refName), + m_mass(0), + m_massMin(massMin), + m_massMax(massMax), + m_unique(unique_flag) { + const double muonMass = 0.10565; // GeV + const double electronMass = 0.000510; // GeV + const double tauMass = 1.77686; // GeV - TIDARoiDescriptor roi_tag( troi.roi() ); - TIDARoiDescriptor roi_probe( proi.roi() ); - - /// getting reference tracks from the tag roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_tag ); - std::vector< TIDA::Track* > refp_tag = m_refTracks->tracks( m_refFilter ); - - /// getting reference tracks from the probe roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_probe ); - std::vector< TIDA::Track* > refp_probe = m_refTracks->tracks( m_refFilter ); - - /// loop on tag ref tracks - for ( size_t it=0; it InvMass = std::make_pair( pair_mass, pair_mass_obj ); - if ( pair_mass_obj > 0 ) - return InvMass; - - } - - } - - std::pair pNull = std::make_pair( 0., 0. ); - - return pNull; - -} - - - - -// ------------------------------------------------------------------ - -bool TagNProbe::FindProbes() -{ - - m_probes.clear(); - m_tags.clear(); - m_masses.clear(); - m_masses_obj.clear(); - - if ( m_chain==0 || m_chain_tnp==0 ) - return false; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = m_chain_tnp->rois()[ ip ]; - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - std::vector tags; - std::vector masses; - std::vector masses_obj; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = m_chain->rois()[ it ]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - std::pair InvMasses = selection( troi, proi ); - double mass = InvMasses.first; - double mass_obj = InvMasses.second; - - if ( !found_tnp && mass>0 ) found_tnp = true; - - if ( mass>0 ) { - tags.push_back( &troi ); - masses.push_back( mass ); - masses_obj.push_back( mass_obj ); - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) { - m_probes.push_back( &proi ); - m_tags.push_back( tags ); - m_masses.push_back( masses ); - m_masses_obj.push_back( masses_obj ); - } - - } // end loop on probes - - return true; - + if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; + else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; + else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; } -// ------------------------------------------------------------------ -void TagNProbe::FillMap( std::vector& tnpChains ) { - /// first clear the map - m_tnp_map.clear(); +double TagNProbe::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - for ( size_t i=0 ; i::value_type( chain_probe_name, chain_tag_name ) ); - - /// new testChain vector is filled only with probe chain names - m_probe_chain_names.push_back( tnpChains[i+1] ); + if ( tom!=0 && tom->status() ) { + return mass( tom->object(t1->id()), tom->object(t2->id()) ); } - -} - -// ------------------------------------------------------------------ - -TIDA::Chain* TagNProbe::GetTagChain( std::string probe_name, std::vector& chains ) { - - TIDA::Chain* chain_tag = 0; - - std::map::const_iterator tnpitr = m_tnp_map.find( probe_name ); - - if ( tnpitr != m_tnp_map.end() ) { - - for ( size_t icp=0 ; icpsecond ) { - chain_tag = &( chains[icp] ); - break; - } - } + else { + return mass( t1, t2 ); } - - return chain_tag; - -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( TIDA::Chain * chain, std::vector& chains ) { - - std::vector rois; - TIDA::Chain* chain_tag = 0; - - /// for each configured probe chain find the correspondig tag chain in the event - chain_tag = GetTagChain( chain->name(), chains ); - if ( chain_tag == 0 ) return rois; - - /// resetting the chains - m_chain = 0; - m_chain_tnp = 0; - - /// setting the chains - SetChains( chain, chain_tag ); - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( std::vector& chains ) { - - std::vector rois; - FindTIDAChains(chains) ; - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( std::string chain_name ) { - - std::string hname_base = chain_name; - std::replace( hname_base.begin(), hname_base.end(), '/', '_' ); - std::replace( hname_base.begin(), hname_base.end(), ':', '_' ); - - std::string hname_1 = hname_base + "_Minv_TnP"; - std::string hname_2 = hname_base + "_Minv_obj_TnP"; - - m_hMinv_map[ chain_name ] = new TH1D( hname_1.c_str(), hname_1.c_str(), 320, 0, 200 ); - m_hMinv_obj_map[ chain_name ] = new TH1D( hname_2.c_str(), hname_2.c_str(), 320, 0, 200 ); - } -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( ) { - - m_hMinv = new TH1D( "Minv_TnP", "Tag&Probe invariant mass", 320, 0, 200 ); - m_hMinv_obj = new TH1D( "Minv_obj_TnP", "Tag&Probe invariant mass (object-based)", 320, 0, 200 ); - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FillMinvHisto( std::string chain_name, unsigned int probe_index ) { - - /// find the histogram for chain_name - std::map::iterator hMinv_itr = m_hMinv_map.find( chain_name ); - std::map::iterator hMinv_obj_itr = m_hMinv_obj_map.find( chain_name ); - - /// check if histod exist, if yes fill them - if ( hMinv_itr != m_hMinv_map.end() && - hMinv_obj_itr != m_hMinv_obj_map.end() && - m_masses[probe_index].size() == m_masses_obj[probe_index].size() ) { - // for ( size_t im=0 ; imsecond->Fill( m_masses[probe_index].at(im) ); - // hMinv_obj_itr->second->Fill( m_masses_obj[probe_index].at(im) ); - // } +TIDA::Chain* TagNProbe::findChain( const std::string& chainname, std::vector& chains ) const { + for ( size_t i=chains.size() ; i-- ; ) { + if ( chains[i].name() == chainname ) return &chains[i]; } + return 0; } -// ------------------------------------------------------------------ - -void TagNProbe::FillMinvHisto( unsigned int probe_index ) { - - if ( m_masses[probe_index].size() == m_masses_obj[probe_index].size() && - m_masses[probe_index].size() > 0 ) { - - // for ( size_t im=0 ; imFill( m_masses[probe_index].at(im) ); - // m_hMinv_obj->Fill( m_masses_obj[probe_index].at(im) ); - // } - } -} - -// ------------------------------------------------------------------ - -void TagNProbe::WriteMinvHisto( TDirectory* foutdir ) { - - foutdir->cd(); - - std::map::iterator hMinv_itr; - for ( hMinv_itr=m_hMinv_map.begin() ; hMinv_itr!=m_hMinv_map.end() ; hMinv_itr++ ) { - - std::string dirname = hMinv_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_itr->second->SetTitle( "Tag&Probe invariant mass" ); - hMinv_itr->second->SetName( "Minv_TnP" ); - hMinv_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - - std::map::iterator hMinv_obj_itr; - for ( hMinv_obj_itr=m_hMinv_obj_map.begin() ; hMinv_obj_itr!=m_hMinv_obj_map.end() ; hMinv_obj_itr++ ) { - - std::string dirname = hMinv_obj_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos and - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_obj_itr->second->SetTitle( "Tag&Probe invariant mass (object-based)" ); - hMinv_obj_itr->second->SetName( "Minv_obj_TnP" ); - hMinv_obj_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FindTIDAChains( std::vector& chains ) { - - for ( int ic=0 ; ic<(int)(chains.size()) ; ++ic ){ - std::string chainConfig = chains[ic].name() ; - if ( (chainConfig) == m_probeChainName ) m_chain_tnp = &( chains[ic] ) ; - if ( (chainConfig) == m_tagChainName ) m_chain = &( chains[ic] ) ; - } -} diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx deleted file mode 100644 index beec1a880b7..00000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx +++ /dev/null @@ -1,51 +0,0 @@ -/** - ** @file TagNProbe2.cxx - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#include "TrigInDetAnalysisUtils/TagNProbe2.h" - - -TagNProbe2::TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag ) : - m_particleType(refName), - m_mass(0), - m_massMin(massMin), - m_massMax(massMax), - m_unique(unique_flag) -{ - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; - else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; - else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; -} - - - -double TagNProbe2::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - - if ( tom!=0 && tom->status() ) { - return mass( tom->object(t1->id()), tom->object(t2->id()) ); - } - else { - return mass( t1, t2 ); - } - -} - - -TIDA::Chain* TagNProbe2::findChain( const std::string& chainname, std::vector& chains ) const { - for ( size_t i=chains.size() ; i-- ; ) { - if ( chains[i].name() == chainname ) return &chains[i]; - } - return 0; -} - - diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py index 427c0c0d503..41a96ec62ec 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py +++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py @@ -106,7 +106,7 @@ class TrigInDetReco(ExecStep): flags += 'doEgammaSlice=True;' if (i=='electron-tnp') : chains += "'HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI'," - chains += "'HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI'," + chains += "'HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI'," flags += 'doEgammaSlice=True;' if (i=='tau') : chains += "'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM'," @@ -300,7 +300,6 @@ class TrigInDetRdictStep(Step): os.system( 'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-fslrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' ) - os.system( 'get_files -data TIDAdata-run3-TnP.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata_cuts.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-rzMatcher.dat &> /dev/null' ) @@ -311,7 +310,6 @@ class TrigInDetRdictStep(Step): os.system( 'get_files -data TIDAdata-run3-offline-fslrt.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-vtx.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-minbias-offline.dat &> /dev/null' ) - os.system( 'get_files -data TIDAdata-run3-offline-TnP.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-run3-offline-cosmic.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata_cuts-offline.dat &> /dev/null' ) os.system( 'get_files -data TIDAdata-chains-run3.dat &> /dev/null' ) diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py index 3ea0291acd6..565c265f339 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py @@ -222,11 +222,14 @@ if ( True ) : "HLT_e30_lhloose_nopix_lrtmedium_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_IDTrig:roi=HLT_Roi_FastElectron_LRT:te=0", # double electron chains for tag and probe analysis - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=1", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:te=0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:te=1", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1", # two stage tau FTF "HLT_tau.*_idperf.*tracktwo.*:HLT_IDTrack_TauCore_FTF:roi=HLT_Roi_TauCore", diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json index 153b5cedeeb..21bc11467d3 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json +++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json @@ -85,16 +85,16 @@ "chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig" }, "L2electronTnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_FTF_HLT_Roi_FastElectron_1_el_probe" }, "EFelectronTnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_FTF_HLT_Roi_FastElectron_1_el_probe HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_IDTrig_1_el_probe HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI_HLT_IDTrack_Electron_GSF_1_el_probe" }, "L2electronTier0TnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el2_probe:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el_probe:HLT_Roi_FastElectron:1" }, "EFelectronTier0TnP":{ - "chains" : "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el1_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_gsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el2_probe:HLT_Roi_FastElectron:1" + "chains" : "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:el_probe:HLT_Roi_FastElectron:1 HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:el_probe:1 HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_GSF:el_probe:1" }, "EFcosmic":{ "chains" : "HLT_mu4_cosmic_L1MU3V_EMPTY:HLT_IDTrack_Cosmic_IDTrig" diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py index 49e0b903bd1..7b62769a2dd 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py @@ -37,13 +37,13 @@ Release = "current" GridFiles = True preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for ATR-23982. In future find a more recent RDO -Jobs = [( "Truth", " TIDAdata-run3-TnP.dat -o data-hists.root -p 11" ), - ( "Offline", " TIDAdata-run3-offline-TnP.dat -r Offline -o data-hists-offline.root" )] +Jobs = [( "Truth", " TIDAdata-run3.dat -o data-hists.root -p 11" ), + ( "Offline", " TIDAdata-run3-offline.dat -r Offline -o data-hists-offline.root" )] -Comp = [( "L2ele", "L2electronTnP", "data-hists.root", " -c TIDAhisto-panel.dat -d HLTL2-plots " ), - ( "L2eleoffline", "L2electronTnP", "data-hists-offline.root", " -c TIDAhisto-panel.dat -d HLTL2-plots-offline " ), - ( "EFele", "EFelectronTnP", "data-hists.root", " -c TIDAhisto-panel.dat -d HLTEF-plots " ), - ( "EFeleoffline", "EFelectronTnP", "data-hists-offline.root", " -c TIDAhisto-panel.dat -d HLTEF-plots-offline " ) ] +Comp = [( "L2ele", "L2electronTnP", "data-hists.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_1 -d HLTL2-plots " ), + ( "L2eleoffline", "L2electronTnP", "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_1 -d HLTL2-plots-offline " ), + ( "EFele", "EFelectronTnP", "data-hists.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_nogsf_idperf_50invmAB130_FTF_FE_1 e26_e14_etcut_nogsf_idperf_50invmAB130_IDTrig_1 e26_e14_etcut_idperf_50invmAB130_GSF_1 -d HLTEF-plots " ), + ( "EFeleoffline", "EFelectronTnP", "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat -l e26_e14_etcut_nogsf_idperf_50invmAB130_FTF_FE_1 e26_e14_etcut_nogsf_idperf_50invmAB130_IDTrig_1 e26_e14_etcut_idperf_50invmAB130_GSF_1 -d HLTEF-plots-offline " ) ] diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py index 235c6974640..e6447ce8133 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_tier0_pu40_TnP.py @@ -39,8 +39,8 @@ preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for Jobs = [] -Comp = [ ( "L2electron", "L2electronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el1_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_FTF_FE_el2_probe_1 --ncols 3 -d HLTL2-plots-electron " ), - ( "EFelectron", "EFelectronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el1_probe_1 e26_e14_etcut_idperf_50invmAB130_IDTrig_FE_el1_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_IDTrig_FE_el2_probe_1 --ncols 3 -d HLTEF-plots-electron " ) ] +Comp = [ ( "L2electron", "L2electronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el_probe_1 --ncols 3 -d HLTL2-plots-electron " ), + ( "EFelectron", "EFelectronTier0TnP", "data-hists-tier0.root", " -b HLT/TRIDT/Egamma/Expert -s '_HLT_IDTrack' '/HLT_IDTrack' -c TIDAhisto-tier0-TnP.dat -l e26_e14_etcut_idperf_50invmAB130_FTF_FE_el_probe_1 e26_e14_etcut_idperf_50invmAB130_IDTrig_el_probe_1 e26_e14_etcut_idperf_gsf_50invmAB130_GSF_el_probe_1 --ncols 3 -d HLTEF-plots-electron " ) ] from AthenaCommon.Include import include include("TrigInDetValidation/TrigInDetValidation_Base.py") -- GitLab From cd9259be3e1a65f6c1d92ddb7889c15d44ea8fe2 Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 20:01:57 +0200 Subject: [PATCH 36/56] Merge branch 'rates-fix-eb-cleanup' into '22.0' EnhancedBiasWeighter: Interface cleanup See merge request atlas/athena!53590 (cherry picked from commit 4b87929941e3708f61e9bfd170df6f9ba7c876c7) 0739310e Fix default threshold behaviour 8ee85368 Remove CalculateWeightingData flag --- .../EnhancedBiasWeighter.h | 1 - .../Root/EnhancedBiasWeighter.cxx | 478 +++++++----------- .../RatesAnalysis/RatesAnalysisAlg.h | 2 +- 3 files changed, 186 insertions(+), 295 deletions(-) diff --git a/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h b/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h index fb7bb5c7913..58796306308 100644 --- a/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h +++ b/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h @@ -184,7 +184,6 @@ class EnhancedBiasWeighter: public asg::AsgTool, public virtual IEnhancedBiasWei Gaudi::Property m_runNumber{this, "RunNumber", 0, "Run we're processing (if data), needed at initialize to locate and read in extra configuration."}; Gaudi::Property m_errorOnMissingEBWeights{this, "ErrorOnMissingEBWeights", false, "If true, Throws error if EB weights are missing."}; - Gaudi::Property m_calculateWeightingData{this, "CalculateWeightingData", true, "If true, read from COOL, CONDBR2 and XMLs. If false, read directly from decorated TRIG1 dAOD."}; Gaudi::Property m_enforceEBGRL{this, "EnforceEBGRL", true, "Each Enhanced Bias run has a 'good run list' style veto on some LB. If this flag is true, events in these LB get weight 0"}; Gaudi::Property m_useBunchCrossingData{this, "UseBunchCrossingData", true, "BunchCrossing data requires CONDBR2 access. Can be disabled here if this is a problem."}; Gaudi::Property m_isMC{this, "IsMC", false, "MC mode? If so we need a cross section and filter efficiency"}; diff --git a/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx b/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx index 2003930b199..49aa47b9dd3 100644 --- a/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx +++ b/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx @@ -35,37 +35,32 @@ EnhancedBiasWeighter::EnhancedBiasWeighter( const std::string& name ) StatusCode EnhancedBiasWeighter::initialize() { ATH_MSG_INFO ("Initializing " << name() << "..."); - ATH_CHECK( m_bunchCrossingKey.initialize( m_calculateWeightingData && m_useBunchCrossingData ) ); + ATH_CHECK( m_bunchCrossingKey.initialize( m_useBunchCrossingData ) ); - if (m_calculateWeightingData == true) { + if (m_isMC) { - if (m_isMC) { - - if (m_mcCrossSection == 0 || m_mcFilterEfficiency == 0) { - ATH_MSG_FATAL("For MC rates, a cross section and filter efficiency must be supplied."); - return StatusCode::FAILURE; - } - m_deadtime = 1.; // No deadtime for MC - m_pairedBunches = FULL_RING; // Assume full-ring - const float mcCrossSectionInSqCm = 1e-33 * m_mcCrossSection; // Convert nb -> cm^2 - m_mcModifiedCrossSection = mcCrossSectionInSqCm * m_mcFilterEfficiency * m_mcKFactor; - ATH_MSG_INFO ("Running over MC with xsec:" << m_mcCrossSection << " nb, filter efficiency:" << m_mcFilterEfficiency << ", k-factor:" << m_mcKFactor); + if (m_mcCrossSection == 0 || m_mcFilterEfficiency == 0) { + ATH_MSG_FATAL("For MC rates, a cross section and filter efficiency must be supplied."); + return StatusCode::FAILURE; + } + m_deadtime = 1.; // No deadtime for MC + m_pairedBunches = FULL_RING; // Assume full-ring + const float mcCrossSectionInSqCm = 1e-33 * m_mcCrossSection; // Convert nb -> cm^2 + m_mcModifiedCrossSection = mcCrossSectionInSqCm * m_mcFilterEfficiency * m_mcKFactor; + ATH_MSG_INFO ("Running over MC with xsec:" << m_mcCrossSection << " nb, filter efficiency:" << m_mcFilterEfficiency << ", k-factor:" << m_mcKFactor); - } else { // isData + } else { // isData - if (m_runNumber == 0u) { - ATH_MSG_FATAL("calculateWeightingData is TRUE, but the RunNumber property has not been set. This must be set such that we can read in the correct data."); - return StatusCode::FAILURE; - } - ATH_MSG_INFO ("calculateWeightingData is TRUE. This job will read in EnhancedBias weighting data from CVMFS and COOL."); - ATH_CHECK( loadWeights() ); - ATH_CHECK( loadLumi() ); + if (m_runNumber == 0u) { + ATH_MSG_FATAL("calculateWeightingData is TRUE, but the RunNumber property has not been set. This must be set such that we can read in the correct data."); + return StatusCode::FAILURE; + } + ATH_MSG_INFO ("calculateWeightingData is TRUE. This job will read in EnhancedBias weighting data from CVMFS and COOL."); + ATH_CHECK( loadWeights() ); + ATH_CHECK( loadLumi() ); - } // end isData + } // end isData - } else { - ATH_MSG_INFO ("calculateWeightingData is FALSE. This job must be running over an EnhancedBias TRIG1 dAOD which has already been decorated with weighting data."); - } return StatusCode::SUCCESS; } @@ -386,44 +381,35 @@ int32_t EnhancedBiasWeighter::getEventEBID(const EventContext& context) const double EnhancedBiasWeighter::getEBWeight(const xAOD::EventInfo* eventInfo) const { - if (m_enforceEBGRL && !isGoodLB(eventInfo)) { return 0; } ATH_CHECK( trackAverages(eventInfo), 0 ); - if (m_calculateWeightingData) { + if (m_isMC) { - if (m_isMC) { - - if (m_mcIgnoreGeneratorWeights) { - return 1.; - } - - const std::vector weights = eventInfo->mcEventWeights(); - if (weights.size() > 0) { - return weights[0]; - } + if (m_mcIgnoreGeneratorWeights) { return 1.; + } - } else { // isData - - int32_t ebID = getEventEBID(eventInfo); - const auto mapIterator = m_idToWeightMap.find(ebID); - if (mapIterator == m_idToWeightMap.end() ) { - ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); - return 0; - } - return mapIterator->second; - - } // isData + const std::vector weights = eventInfo->mcEventWeights(); + if (weights.size() > 0) { + return weights[0]; + } + return 1.; - } else { + } else { // isData - return eventInfo->auxdata("EnhancedBiasWeight"); + int32_t ebID = getEventEBID(eventInfo); + const auto mapIterator = m_idToWeightMap.find(ebID); + if (mapIterator == m_idToWeightMap.end() ) { + ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); + return 0; + } + return mapIterator->second; - } + } // isData } @@ -436,31 +422,22 @@ double EnhancedBiasWeighter::getEBWeight(const EventContext& context) const ATH_CHECK( trackAverages(context), 0 ); - if (m_calculateWeightingData) { - - if (m_isMC) { - - ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight with MC. Needs full EventInfo."); - return 0.; - - } else { // isData + if (m_isMC) { - int32_t ebID = getEventEBID(context); - const auto mapIterator = m_idToWeightMap.find(ebID); - if (mapIterator == m_idToWeightMap.end() ) { - ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); - return 0; - } - return mapIterator->second; - - } // isData + ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight with MC. Needs full EventInfo."); + return 0.; - } else { + } else { // isData - ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight unless calculating it. Needs full EventInfo."); - return 0.; + int32_t ebID = getEventEBID(context); + const auto mapIterator = m_idToWeightMap.find(ebID); + if (mapIterator == m_idToWeightMap.end() ) { + ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); + return 0; + } + return mapIterator->second; - } + } // isData } @@ -480,220 +457,165 @@ StatusCode EnhancedBiasWeighter::trackAverages(const xAOD::EventInfo* eventInfo) double EnhancedBiasWeighter::getEBLiveTime(const xAOD::EventInfo* eventInfo) const { + if (m_isMC) { + // Probability that a single pp interaction yields this MC process (ratio of xsec) + const double probOfProcess = m_mcModifiedCrossSection / m_inelasticCrossSection; + // Probability that a single bunch-crossing yeild this MC process. Binomial statistics (1 - Prob(exactly 0 interactions, given mu interactions)). + const double probOfBunchCrossing = 1. - std::pow( 1. - probOfProcess, std::ceil(eventInfo->actualInteractionsPerCrossing()) ); + const double bunchCrossingRate = m_pairedBunches * LHC_FREQUENCY; + // How much wall-time does this event represent? This is the reciprocal of the rate, which is the % per crossing scaled by the crossing rate. + ATH_MSG_DEBUG("MC livetime debug: probOfProcess:" << probOfProcess << " probOfBunchCrossing:" << probOfBunchCrossing << " bunchCrossingRate:" << bunchCrossingRate << " time:" << (1. / (probOfBunchCrossing * bunchCrossingRate))); + return 1. / (probOfBunchCrossing * bunchCrossingRate); - if (m_calculateWeightingData) { - - if (m_isMC) { - - // Probability that a single pp interaction yields this MC process (ratio of xsec) - const double probOfProcess = m_mcModifiedCrossSection / m_inelasticCrossSection; - // Probability that a single bunch-crossing yeild this MC process. Binomial statistics (1 - Prob(exactly 0 interactions, given mu interactions)). - const double probOfBunchCrossing = 1. - std::pow( 1. - probOfProcess, std::ceil(eventInfo->actualInteractionsPerCrossing()) ); - const double bunchCrossingRate = m_pairedBunches * LHC_FREQUENCY; - // How much wall-time does this event represent? This is the reciprocal of the rate, which is the % per crossing scaled by the crossing rate. - ATH_MSG_DEBUG("MC livetime debug: probOfProcess:" << probOfProcess << " probOfBunchCrossing:" << probOfBunchCrossing << " bunchCrossingRate:" << bunchCrossingRate << " time:" << (1. / (probOfBunchCrossing * bunchCrossingRate))); - return 1. / (probOfBunchCrossing * bunchCrossingRate); - - } else { - - uint32_t lumiBlock = eventInfo->lumiBlock(); - std::lock_guard scopeLock(m_mutex); - - // Check the cache - const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); - if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - - // Else calculate - const auto mapIterator = m_eventsPerLB.find(lumiBlock); - if (mapIterator == m_eventsPerLB.end() ) { - if (m_errorOnMissingEBWeights) { - ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); - } - return 0; - } - const int32_t eventsInThisLB = mapIterator->second; - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - // This event is one in eventsInThisLB, so has an effective temporal contribution of: - double eventLivetime = 0; - if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; - // Cache this (mutable) - m_eventLivetime[lumiBlock] = eventLivetime; - return eventLivetime; + } else { - } // isData + uint32_t lumiBlock = eventInfo->lumiBlock(); + std::lock_guard scopeLock(m_mutex); - } else { + // Check the cache + const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); + if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - return eventInfo->auxdata("EnhancedBiasLivetime"); + // Else calculate + const auto mapIterator = m_eventsPerLB.find(lumiBlock); + if (mapIterator == m_eventsPerLB.end() ) { + if (m_errorOnMissingEBWeights) { + ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); + } + return 0; + } + const int32_t eventsInThisLB = mapIterator->second; + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + // This event is one in eventsInThisLB, so has an effective temporal contribution of: + double eventLivetime = 0; + if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; + // Cache this (mutable) + m_eventLivetime[lumiBlock] = eventLivetime; + return eventLivetime; - } + } // isData } double EnhancedBiasWeighter::getEBLiveTime(const EventContext& context) const { + if (m_isMC) { + ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime with MC. Needs full EventInfo."); + return 0.; - if (m_calculateWeightingData) { - - if (m_isMC) { + } else { - ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime with MC. Needs full EventInfo."); - return 0.; + uint32_t lumiBlock = context.eventID().lumi_block(); + std::lock_guard scopeLock(m_mutex); - } else { - - uint32_t lumiBlock = context.eventID().lumi_block(); - std::lock_guard scopeLock(m_mutex); - - // Check the cache - const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); - if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - - // Else calculate - const auto mapIterator = m_eventsPerLB.find(lumiBlock); - if (mapIterator == m_eventsPerLB.end() ) { - if (m_errorOnMissingEBWeights) { - ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); - } - return 0.; - } - const int32_t eventsInThisLB = mapIterator->second; - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - // This event is one in eventsInThisLB, so has an effective temporal contribution of: - double eventLivetime = 0; - if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; - // Cache this (mutable) - m_eventLivetime[lumiBlock] = eventLivetime; - return eventLivetime; - - } // isData + // Check the cache + const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); + if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - } else { + // Else calculate + const auto mapIterator = m_eventsPerLB.find(lumiBlock); + if (mapIterator == m_eventsPerLB.end() ) { + if (m_errorOnMissingEBWeights) { + ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); + } + return 0.; + } + const int32_t eventsInThisLB = mapIterator->second; + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + // This event is one in eventsInThisLB, so has an effective temporal contribution of: + double eventLivetime = 0; + if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; + // Cache this (mutable) + m_eventLivetime[lumiBlock] = eventLivetime; + return eventLivetime; - ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime unless calculating it. Needs full EventInfo."); - return 0.; + } // isData - } } double EnhancedBiasWeighter::getLBLength(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - if (m_isMC) { - ATH_MSG_ERROR( "getLBLength Does not work for MC."); - return 0.; - } else { - uint32_t lumiBlock = eventInfo->lumiBlock(); - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - return lbLength; - } // isData - } else { - ATH_MSG_ERROR( "getLBLength Requires CalculateWeightingData=True"); + if (m_isMC) { + ATH_MSG_ERROR( "getLBLength Does not work for MC."); return 0.; - } + } else { + uint32_t lumiBlock = eventInfo->lumiBlock(); + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + return lbLength; + } // isData } double EnhancedBiasWeighter::getLBLength(const EventContext& context) const { - if (m_calculateWeightingData) { - if (m_isMC) { - ATH_MSG_ERROR( "getLBLength Does not work for MC."); - return 0.; - } else { - uint32_t lumiBlock = context.eventID().lumi_block(); - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - return lbLength; - } // isData - } else { - ATH_MSG_ERROR( "getLBLength Requires CalculateWeightingData=True"); + if (m_isMC) { + ATH_MSG_ERROR( "getLBLength Does not work for MC."); return 0.; - } + } else { + uint32_t lumiBlock = context.eventID().lumi_block(); + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + return lbLength; + } // isData } bool EnhancedBiasWeighter::isUnbiasedEvent(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { + if (m_isMC) { - return true; + return true; - } else { //isData + } else { //isData - int32_t ebID = getEventEBID(eventInfo); - const auto mapIterator = m_idToUnbiasedMap.find(ebID); - if (mapIterator == m_idToUnbiasedMap.end() ) { - ATH_MSG_ERROR("Couldn't find isUnbiased information for event with ID " << ebID); - return false; - } - return mapIterator->second; - - } // isData + int32_t ebID = getEventEBID(eventInfo); + const auto mapIterator = m_idToUnbiasedMap.find(ebID); + if (mapIterator == m_idToUnbiasedMap.end() ) { + ATH_MSG_ERROR("Couldn't find isUnbiased information for event with ID " << ebID); + return false; + } + return mapIterator->second; - } else { - - return static_cast( eventInfo->auxdata("IsUnbiasedEventFlag") ); - - } + } // isData } bool EnhancedBiasWeighter::isGoodLB(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - return true; - - } else { // isData - - uint32_t lumiBlock = eventInfo->lumiBlock(); - - const auto mapIterator = m_goodLB.find(lumiBlock); - if (mapIterator == m_goodLB.end() ) { - ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); - return false; - } - return static_cast(mapIterator->second); + if (m_isMC) { + + return true; - } // isData + } else { // isData - } else { + uint32_t lumiBlock = eventInfo->lumiBlock(); - return static_cast( eventInfo->auxdata("IsGoodLBFlag") ); + const auto mapIterator = m_goodLB.find(lumiBlock); + if (mapIterator == m_goodLB.end() ) { + ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); + return false; + } + return static_cast(mapIterator->second); - } + } // isData } bool EnhancedBiasWeighter::isGoodLB(const EventContext& context) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - return true; - - } else { // isData - - uint32_t lumiBlock = context.eventID().lumi_block(); - - const auto mapIterator = m_goodLB.find(lumiBlock); - if (mapIterator == m_goodLB.end() ) { - ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); - return false; - } - return static_cast(mapIterator->second); + if (m_isMC) { + + return true; - } // isData + } else { // isData - } else { + uint32_t lumiBlock = context.eventID().lumi_block(); - ATH_MSG_ERROR( "Cannot use EventContext based isGoodLB unless calculating it. Needs full EventInfo."); - return false; + const auto mapIterator = m_goodLB.find(lumiBlock); + if (mapIterator == m_goodLB.end() ) { + ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); + return false; + } + return static_cast(mapIterator->second); - } + } // isData } bool EnhancedBiasWeighter::isMC() const { @@ -706,59 +628,42 @@ uint32_t EnhancedBiasWeighter::getRunNumber() const { double EnhancedBiasWeighter::getLBLumi(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { + if (m_isMC) { - const double mu = std::ceil( eventInfo->actualInteractionsPerCrossing() ); - return (mu * LHC_FREQUENCY * m_pairedBunches) / m_inelasticCrossSection; + const double mu = std::ceil( eventInfo->actualInteractionsPerCrossing() ); + return (mu * LHC_FREQUENCY * m_pairedBunches) / m_inelasticCrossSection; - } else { // isData - - uint32_t lumiBlock = eventInfo->lumiBlock(); - const auto mapIterator = m_lumiPerLB.find(lumiBlock); - if (mapIterator == m_lumiPerLB.end() ) { - ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); - return 0.; - } - return mapIterator->second; - - } // isData - - } else { + } else { // isData - return eventInfo->auxdata("LBLumi"); + uint32_t lumiBlock = eventInfo->lumiBlock(); + const auto mapIterator = m_lumiPerLB.find(lumiBlock); + if (mapIterator == m_lumiPerLB.end() ) { + ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); + return 0.; + } + return mapIterator->second; - } + } // isData } double EnhancedBiasWeighter::getLBLumi(const EventContext& context) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi with MC. Needs full EventInfo."); - return 0.; + if (m_isMC) { - } else { // isData - - uint32_t lumiBlock = context.eventID().lumi_block(); - const auto mapIterator = m_lumiPerLB.find(lumiBlock); - if (mapIterator == m_lumiPerLB.end() ) { - ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); - return 0.; - } - return mapIterator->second; - - } // isData + ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi with MC. Needs full EventInfo."); + return 0.; - } else { + } else { // isData - ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi unless calculating it. Needs full EventInfo."); - return 0; + uint32_t lumiBlock = context.eventID().lumi_block(); + const auto mapIterator = m_lumiPerLB.find(lumiBlock); + if (mapIterator == m_lumiPerLB.end() ) { + ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); + return 0.; + } + return mapIterator->second; - } + } // isData } double EnhancedBiasWeighter::getDeadtime() const @@ -773,20 +678,13 @@ uint32_t EnhancedBiasWeighter::getPairedBunches() const StatusCode EnhancedBiasWeighter::getDistanceIntoTrain(const xAOD::EventInfo* eventInfo, uint32_t& distance) const { - if (m_calculateWeightingData) { - - if (!m_useBunchCrossingData) return StatusCode::SUCCESS; - - const EventContext& context = Gaudi::Hive::currentContext(); - SG::ReadCondHandle bunchCrossingTool (m_bunchCrossingKey, context); - ATH_CHECK( bunchCrossingTool.isValid() ); - distance = bunchCrossingTool->distanceFromFront( eventInfo->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings ); - - } else { + if (!m_useBunchCrossingData) return StatusCode::SUCCESS; - distance = eventInfo->auxdata("BCIDDistanceFromFront"); + const EventContext& context = Gaudi::Hive::currentContext(); + SG::ReadCondHandle bunchCrossingTool (m_bunchCrossingKey, context); + ATH_CHECK( bunchCrossingTool.isValid() ); + distance = bunchCrossingTool->distanceFromFront( eventInfo->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings ); - } return StatusCode::SUCCESS; } @@ -803,12 +701,6 @@ double EnhancedBiasWeighter::getAverageMu() const StatusCode EnhancedBiasWeighter::addBranches() const { - - if (m_calculateWeightingData == false) { - ATH_MSG_FATAL( "Cannot decorate AOD with EnhancedBias data if loadEnhancedBiasData is FALSE "); - return StatusCode::FAILURE; - } - // Set up the decorator SG::AuxElement::Decorator< double > decoratorEBWeight("EnhancedBiasWeight"); SG::AuxElement::Decorator< double > decoratorEBLivetime("EnhancedBiasLivetime"); diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h index b475b27c1ef..33c15c1941a 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h @@ -103,7 +103,7 @@ class RatesAnalysisAlg: public ::AthAnalysisAlgorithm { const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins = 100, - const RatesScanTrigger::TriggerBehaviour_t behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerAboveThreshold, + const RatesScanTrigger::TriggerBehaviour_t behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold, const double prescale = 1., const std::string& seedName = "", const double seedPrecale = 1., -- GitLab From 1d40f0b2e3b38a260fdaf1e16ce72ca73d17d166 Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 17:17:05 +0200 Subject: [PATCH 37/56] Merge branch '22-enableMonGroups' into '22.0' Enable HLTMonitoringAccess in python now MonGroup access is implemented See merge request atlas/athena!53593 (cherry picked from commit 21e9d084827617cd84b1c8f2d7bd6f8ed9dc4817) c471bd98 Enable HLTMonitoringAccess in python now MonGroup access is implemented --- .../TrigConfIO/python/HLTTriggerConfigAccess.py | 4 ++-- .../TrigConfigSvc/python/TriggerConfigAccess.py | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py b/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py index 079356f8abb..12438e2dc0b 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py +++ b/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py @@ -118,12 +118,12 @@ class HLTMonitoringAccess(TriggerConfigAccess): """ this class provides access to the HLT monitoring json """ - def __init__(self, filename = None, jsonString=None, dbalias = None, monikey = None ): + def __init__(self, filename = None, jsonString=None, dbalias = None, smkey = None ): """ accessor needs to be initialized with either a filename or the dbalias and hlpskey """ super(HLTMonitoringAccess,self).__init__( ConfigType.HLTMON, mainkey = "signatures", - jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = monikey ) + jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = smkey ) self.loader.setQuery({ 1: "SELECT HMG_DATA FROM( SELECT * FROM (SELECT SMT.SMT_HLT_MENU_ID FROM {schema}.SUPER_MASTER_TABLE SMT WHERE SMT.SMT_ID={dbkey}) lhs JOIN (SELECT HMG.HMG_HLT_MENU_ID,HMG.HMG_DATA FROM {schema}.HLT_MONITORING_GROUPS HMG WHERE HMG.HMG_IN_USE = 1) rhs ON lhs.SMT_HLT_MENU_ID = rhs.HMG_HLT_MENU_ID);" #for schema v7 (first implementation of monitoring groups) diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py index 6c32ee42e90..bcbfa338b8f 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py @@ -182,9 +182,9 @@ def getHLTPrescalesSetAccess( flags = None ): """This is the case when reconstructing the data.""" from RecExConfig.InputFilePeeker import inpSum keysFromCool = getKeysFromCool( inpSum["run_number"] ) - cfg = HLTPrescalesSetAccess( dbalias = keysFromCool["DB"], l1pskey = keysFromCool['HLTPSK'] ) + cfg = HLTPrescalesSetAccess( dbalias = keysFromCool["DB"], hltpskey = keysFromCool['HLTPSK'] ) elif tc["SOURCE"] == "DB": - cfg = HLTPrescalesSetAccess( dbalias = tc["DBCONN"], l1pskey = tc["HLTPSK"] ) + cfg = HLTPrescalesSetAccess( dbalias = tc["DBCONN"], hltpskey = tc["HLTPSK"] ) elif tc["SOURCE"] == "INFILE": cfg = HLTPrescalesSetAccess(jsonString=_getJSONFromMetadata(flags, key='TriggerMenuJson_HLTPS')) else: @@ -214,11 +214,12 @@ def getHLTMonitoringAccess( flags = None ): if tc["SOURCE"] == "FILE": cfg = HLTMonitoringAccess( filename = getHLTMonitoringFileName( flags ) ) elif tc["SOURCE"] == "COOL": - # TODO when database will be ready - raise NotImplementedError("Python COOL access to the HLT monitoring not yet implemented") + """This is the case when reconstructing the data.""" + from RecExConfig.InputFilePeeker import inpSum + keysFromCool = getKeysFromCool( inpSum["run_number"] ) + cfg = HLTMonitoringAccess( dbalias = keysFromCool["DB"], smkey = keysFromCool['SMK'] ) elif tc["SOURCE"] == "DB": - # TODO when database will be ready - raise NotImplementedError("Python DB access to the HLT monitoring not yet implemented") + cfg = HLTMonitoringAccess( dbalias = tc["DBCONN"], smkey = tc["SMK"] ) elif tc["SOURCE"] == "INFILE": cfg = HLTMonitoringAccess(jsonString=_getJSONFromMetadata(flags, key='TriggerMenuJson_HLTMonitoring')) else: -- GitLab From b11e1eb5082397f15c49777be324f54a79f35896 Mon Sep 17 00:00:00 2001 From: Sara Alderweireldt Date: Tue, 24 May 2022 20:59:47 +0200 Subject: [PATCH 38/56] Merge branch 'L1Topo-BW3' into '22.0' L1Topo Phase1 BW Simulation Fix See merge request atlas/athena!53511 (cherry picked from commit 475af4d42e7a8edb743b999cf04bd1d5d634a4bb) ab63d0d8 L1Topo BW Fix III --- .../python/L1TopoSimulationConfig.py | 7 ++--- .../L1TopoSimulationUtils/L1TopoDataTypes.h | 26 +++++++++---------- .../L1TopoSimulationUtils/Root/Kinematics.cxx | 8 +++--- .../Root/L1TopoDataTypes.cxx | 20 +++++++------- .../python/TriggerConfigFlags.py | 3 +++ .../TriggerJobOpts/share/runHLT_standalone.py | 2 ++ 6 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py index 8c15f7aab2c..ae5ec71082d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py @@ -31,7 +31,8 @@ def L1LegacyTopoSimulationCfg(flags): EMTAUInputProvider = emtauProvider, IsLegacyTopo = True, InputDumpFile = "inputdump_legacy.txt", - EnableInputDump = flags.Trigger.enableL1TopoDump, + EnableInputDump = flags.Trigger.enableL1TopoDump, + UseBitwise = flags.Trigger.enableL1TopoBWSimulation, MonHistBaseDir = "L1/L1LegacyTopoAlgorithms") # No muon inputs to legacy Topo @@ -83,8 +84,8 @@ def L1TopoSimulationCfg(flags): JetInputProvider = jetProvider, EnergyInputProvider = energyProvider, IsLegacyTopo = False, - EnableInputDump = flags.Trigger.enableL1TopoDump - #UseBitwise = True + EnableInputDump = flags.Trigger.enableL1TopoDump, + UseBitwise = flags.Trigger.enableL1TopoBWSimulation ) acc.addEventAlgo(topoSimAlg) diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/L1TopoDataTypes.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/L1TopoDataTypes.h index 8d061747b03..a864f6302b4 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/L1TopoDataTypes.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/L1TopoDataTypes.h @@ -27,7 +27,7 @@ T ones (unsigned int n) { if (n >= sizeof(T) * 8) return ~static_cast(0); - return (static_cast(1) << n) - 1ul; + return (static_cast(1) << n) - 1ull; } namespace TSU { @@ -61,7 +61,7 @@ namespace TSU { } L1TopoDataTypes(double d) : m_tvalue(d) { - m_tvalue = d*(1ul<> (PREC-1ul); + T mask = m_tvalue >> (PREC-1ull); T res = ((mask ^ m_tvalue) - mask) & ones(PREC); return res; } @@ -112,7 +112,7 @@ namespace TSU { T res=0; T v = m_tvalue; for(unsigned j=0;j> (PREC-1ul)) ? 1 : 0; + short int neg = (m_tvalue >> (PREC-1ull)) ? 1 : 0; if(neg && factor<0){ neg = 0; m_tvalue = this->complement() * ::abs(factor); @@ -183,7 +183,7 @@ namespace TSU { friend std::ostream& operator<<(std::ostream& os, const L1TopoDataTypes& d){ std::string out; for(int j=PREC-1;j>=0;--j){ - out += ((d.m_tvalue>>j)&1ul) ? "1" : "0"; + out += ((d.m_tvalue>>j)&1ull) ? "1" : "0"; } os << "integer value " << d.m_tvalue << " binary " << out << " float " << d.to_float(); return os; @@ -192,14 +192,14 @@ namespace TSU { // return float representation float to_float() const { // Find sign - float res = ((m_tvalue>>(PREC-1ul))&1ul) ? -(1ul<<(PREC-F)) : 0.; + float res = ((m_tvalue>>(PREC-1ull))&1ull) ? -(1ll<<(PREC-F)) : 0.; // Get integer part - res += (m_tvalue>>F)&((1ul<<(PREC-F))-1ul) ? float((m_tvalue>>F)&((1ul<<(PREC-F))-1ul)) : 0; + res += (m_tvalue>>F)&((1ull<<(PREC-F))-1ull) ? float((m_tvalue>>F)&((1ull<<(PREC-F))-1ull)) : 0; // Do the fractional part if (F > 0) { - unsigned frac = m_tvalue & ( (1ul<(frac) / (2ul<<(F-1ul)); + res += static_cast(frac) / (2ull<<(F-1ull)); } return res; } @@ -289,10 +289,10 @@ namespace TSU { T lhsconvert = lhs.m_tvalue; T rhsconvert = rhs.m_tvalue; // check if either value is negative and work with the absolute value - if((lhs.m_tvalue >> (P1-1ul)) & 1ul){ + if((lhs.m_tvalue >> (P1-1ull)) & 1ull){ lhsconvert = complement(lhsconvert,P1); } - if((rhs.m_tvalue >> (P2-1ul)) & 1ul){ + if((rhs.m_tvalue >> (P2-1ull)) & 1ull){ rhsconvert = complement(rhsconvert,P2); } // map numbers into Q1+digit.frac @@ -308,7 +308,7 @@ namespace TSU { result += (prod_frac>>(F1+F2-frac)); result += (prod_mix1>>((F2>frac ? F2 - frac : 0))); result += (prod_mix2>>((F1>frac ? F1 - frac : 0))); - if(!(((lhs.m_tvalue >> (P1-1ul)) & 1ul) ^ ((rhs.m_tvalue >> (P2-1ul)) & 1ul))){ + if(!(((lhs.m_tvalue >> (P1-1ull)) & 1ull) ^ ((rhs.m_tvalue >> (P2-1ull)) & 1ull))){ return result; } else return -result; diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx index 663cfb6e146..79914354bf5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx @@ -174,8 +174,8 @@ unsigned long TSU::Kinematics::quadraticSumBW(int i1, int i2){ unsigned int TSU::Kinematics::calcXi1(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { double scale = 1.4; // this will be converted MeV and unsigned when unit is right double shift = 20; // this will be converted MeV and unsigned when unit is right - TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast(scale*tob1->Et()+shift)); - TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast(scale*tob2->Et()+shift)); + TSU::L1TopoDataTypes<15,0> bit_Et1(static_cast(scale*tob1->Et()+shift)); + TSU::L1TopoDataTypes<15,0> bit_Et2(static_cast(scale*tob2->Et()+shift)); auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(tob1->eta())); auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(tob2->eta())); @@ -187,8 +187,8 @@ unsigned int TSU::Kinematics::calcXi1(const TCS::GenericTOB* tob1, const TCS::Ge unsigned int TSU::Kinematics::calcXi2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { double scale = 1.4; // this will be converted MeV and unsigned when unit is right double shift = 20; // this will be converted MeV and unsigned when unit is right - TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast(scale*tob1->Et()+shift)); - TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast(scale*tob2->Et()+shift)); + TSU::L1TopoDataTypes<15,0> bit_Et1(static_cast(scale*tob1->Et()+shift)); + TSU::L1TopoDataTypes<15,0> bit_Et2(static_cast(scale*tob2->Et()+shift)); auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-tob1->eta())); auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-tob2->eta())); diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/L1TopoDataTypes.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/L1TopoDataTypes.cxx index 60d1596c3bd..23391404be9 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/L1TopoDataTypes.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/L1TopoDataTypes.cxx @@ -18,7 +18,7 @@ using namespace TSU; TSU::T TSU::complement(const T& v, const unsigned int& p) { T res=0; for(unsigned int j=0;j> (in_p-1ul)) & 1ul){ origval = complement(v,in_p); } - T valint = ((origval >> in_f) & ~(1ul<<(in_p-in_f-1ul))) & ((1ul<<(in_p-in_f-1))-1ul); - T mantissa = (new_f > in_f) ? ((origval & ((1ul<>(in_f-new_f)); + if((v >> (in_p-1ull)) & 1ull){ origval = complement(v,in_p); } + T valint = ((origval >> in_f) & ~(1ull<<(in_p-in_f-1ull))) & ((1ull<<(in_p-in_f-1))-1ull); + T mantissa = (new_f > in_f) ? ((origval & ((1ull<>(in_f-new_f)); if(!new_f) {mantissa = 0;} T out_val = ((valint << new_f) | mantissa); if(new_f+1==new_p) out_val = mantissa; - if((v >> (in_p-1ul)) & 1ul){ // Check if original m_tvalue had sign bit set + if((v >> (in_p-1ull)) & 1ull){ // Check if original m_tvalue had sign bit set out_val = complement(out_val,new_f+(new_p-new_f-1)+1); } return out_val; @@ -43,8 +43,8 @@ std::string TSU::to_binary(T b, const unsigned int& p){ std::string pat(p,'0'); unsigned int idx = p-1; while(b){ - pat[idx] = (b & 1ul) ? '1' : '0'; - b = b >> 1ul; + pat[idx] = (b & 1ull) ? '1' : '0'; + b = b >> 1ull; --idx; } return pat; @@ -52,12 +52,12 @@ std::string TSU::to_binary(T b, const unsigned int& p){ float TSU::to_float(const T& value, const unsigned int& m, const unsigned int& n){ // Find sign - float res = ((value>>(m-1ul))&1ul) ? -(1ul<<(m-n)) : 0.; + float res = ((value>>(m-1ull))&1ull) ? -(1ll<<(m-n)) : 0.; // Get integer part - res += (value>>n)&((1ul<<(m-n))-1ul) ? float((value>>n)&((1ul<<(m-n))-1ul)) : 0; + res += (value>>n)&((1ull<<(m-n))-1ull) ? float((value>>n)&((1ull<<(m-n))-1ull)) : 0; // Do the fractional part for(unsigned int j=0;j Date: Tue, 24 May 2022 20:31:59 +0200 Subject: [PATCH 39/56] Merge branch 'fcs' into '22.0' ISF_FastCaloSimEvent: replace MsgStreamMember with MsgStream See merge request atlas/athena!53607 (cherry picked from commit 23f6e3671dfac047d0064732c62854c7cd46230d) 28dae16d Revert "ISF_FastCaloSimEvent: migrate to AthMessagin" 2b4b4a6c ISF_FastCaloSimEvent: replace MsgStreamMember with MsgStream --- .../TFCSParametrizationBase.h | 35 +++++++++++++++---- ...SLateralShapeParametrizationFluctChain.cxx | 4 +-- ...FCSLateralShapeParametrizationHitChain.cxx | 4 +-- .../src/TFCSParametrizationBase.cxx | 10 ++++-- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h index 1934837fcc3..f481deb6ba5 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h @@ -59,7 +59,8 @@ class TFCSExtrapolationState; if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl) << std::setw(45) << std::left << this->GetName() << " " << MSG::LevelNames[MSG::lvl] << " " #else - #include "AthenaBaseComps/AthMessaging.h" + #include "GaudiKernel/MsgStream.h" + #include "AthenaBaseComps/AthMsgStreamMacros.h" #endif /** Base class for all FastCaloSim parametrizations @@ -82,11 +83,7 @@ enum FCSReturnCode { #define FCS_RETRY_COUNT 3 -class TFCSParametrizationBase : public TNamed -#if !defined(__FastCaloSimStandAlone__) - , public AthMessaging -#endif -{ +class TFCSParametrizationBase:public TNamed { public: TFCSParametrizationBase(const char* name=nullptr, const char* title=nullptr); @@ -204,7 +201,31 @@ private: MSG::Level m_level;//! Do not persistify! MsgStream* m_msg;//! Do not persistify! -#endif +#else +public: + /// Update outputlevel + void setLevel(int level) {s_msg->setLevel(level);} + + /// Retrieve output level + MSG::Level level() const {return s_msg->level();} + + /// Log a message using the Athena controlled logging system + MsgStream& msg() const { return *s_msg; } + + /// Log a message using the Athena controlled logging system + MsgStream& msg( MSG::Level lvl ) const { return *s_msg << lvl; } + + /// Check whether the logging system is active at the provided verbosity level + bool msgLvl( MSG::Level lvl ) const { return s_msg->level() <= lvl; } + +private: + /** Static private message stream member. + We don't want this to take memory for every instance of this object created. + Note that we also cannot use AthMessaging as a base class as this creates problems + when storing these objects in ROOT files (ATLASSIM-5854). + */ + inline static std::unique_ptr s_msg;//! Do not persistify! +#endif private: static std::set< int > s_no_pdgid; diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx index c259c940d0b..c200bfe7735 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ISF_FastCaloSimEvent/TFCSLateralShapeParametrizationFluctChain.h" @@ -35,7 +35,7 @@ float TFCSLateralShapeParametrizationFluctChain::get_E_hit(TFCSSimulationState& FCSReturnCode TFCSLateralShapeParametrizationFluctChain::simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) const { - MSG::Level old_level=msg().level(); + MSG::Level old_level=level(); const bool debug = msgLvl(MSG::DEBUG); //Execute the first get_nr_of_init() simulate calls only once. Used for example to initialize the center position diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx index 5face6ce8ee..1603245d9fc 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ISF_FastCaloSimEvent/TFCSLateralShapeParametrizationHitChain.h" @@ -196,7 +196,7 @@ FCSReturnCode TFCSLateralShapeParametrizationHitChain::init_hit(TFCSLateralShape FCSReturnCode TFCSLateralShapeParametrizationHitChain::simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) const { - MSG::Level old_level=msg().level(); + MSG::Level old_level=level(); const bool debug = msgLvl(MSG::DEBUG); const bool verbose = msgLvl(MSG::VERBOSE); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx index 085b84c3a79..8292cef189a 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx @@ -13,6 +13,10 @@ #include "TString.h" #endif +#ifndef __FastCaloSimStandAlone__ +#include "AthenaKernel/getMessageSvc.h" +#endif + //============================================= //======= TFCSParametrizationBase ========= //============================================= @@ -28,10 +32,12 @@ TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* t { } #else + TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* title) - : TNamed(name,title), - AthMessaging("FastCaloSimParametrization") + : TNamed(name,title) { + // Initialize only in constructor to make sure the needed services are ready + if (!s_msg) s_msg = std::make_unique(Athena::getMessageSvc(), "FastCaloSimParametrization"); } #endif -- GitLab From ee27eb3e9812988d5468b505b62bbe7889f373a9 Mon Sep 17 00:00:00 2001 From: Scott Snyder Date: Wed, 25 May 2022 09:20:25 +0200 Subject: [PATCH 40/56] MuonCondCabling: Fix cppcheck warnings. MuonCondCabling: Fix cppcheck warnings. Pass instances by const reference, not by value. Prefer to initialize members in an initializer list. Potential out-of-bounds array access. --- .../RPC_CondCabling/CMAidentity.h | 4 +-- .../RPC_CondCabling/CMAparameters.h | 2 +- .../RPC_CondCabling/RPC_CondCabling/EtaCMA.h | 4 +-- .../RPC_CondCabling/EvenPhiCMA.h | 4 +-- .../RPC_CondCabling/RDOindex.h | 2 +- .../RPC_CondCabling/RpcCablingCondData.h | 7 ++-- .../RPC_CondCabling/SectorLogicSetup.h | 24 ++++++++----- .../RPC_CondCabling/src/CMAcablingdata.cxx | 4 +-- .../RPC_CondCabling/src/CMAidentity.cxx | 4 +-- .../RPC_CondCabling/src/CMAparameters.cxx | 16 +++++---- .../RPC_CondCabling/src/CMApivotdata.cxx | 10 +++--- .../RPC_CondCabling/src/EtaCMA.cxx | 18 ++++++---- .../RPC_CondCabling/src/EvenPhiCMA.cxx | 16 +++++---- .../RPC_CondCabling/src/OddPhiCMA.cxx | 14 ++++---- .../RPC_CondCabling/src/RDOindex.cxx | 6 ++-- .../RPC_CondCabling/src/RPCchamberdata.cxx | 4 +-- .../src/RpcCablingCondData.cxx | 4 +-- .../RPC_CondCabling/src/SectorLogicSetup.cxx | 36 ++++++++++++------- .../RPC_CondCabling/src/WiredORdata.cxx | 4 +-- 19 files changed, 110 insertions(+), 73 deletions(-) diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h index 9851dd358eb..31360b02fb4 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef CMAIDENTITY_H @@ -44,7 +44,7 @@ private: CMAcoverage which_sector(PhiCoverage); public: - CMAidentity(defineParams pars); + CMAidentity(const defineParams& pars); CMAidentity(ViewType, CMAcoverage, int, int, int, int, int); CMAidentity(ViewType, CMAcoverage, int); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h index 5651451b4e9..c6fab473b43 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h @@ -117,7 +117,7 @@ protected: [[nodiscard]] std::string error(const std::string&); public: - CMAparameters(parseParams parse); + CMAparameters(const parseParams& parse); CMAparameters(const CMAparameters&); virtual ~CMAparameters(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h index fff29eff401..31dacb54166 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef ETACMA_H @@ -35,7 +35,7 @@ namespace RPC_CondCabling { bool begin_at_RPC_Z_boundary(void) const; public: - EtaCMA(parseParams parse); + EtaCMA(const parseParams& parse); EtaCMA(const EtaCMA&); virtual ~EtaCMA(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h index 051ddae7ea8..2dfb1566682 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef EVENPHICMA_H @@ -34,7 +34,7 @@ namespace RPC_CondCabling { int get_max_strip_readout(int); public: - EvenPhiCMA(parseParams parse); + EvenPhiCMA(const parseParams& parse); EvenPhiCMA(const EvenPhiCMA&); virtual ~EvenPhiCMA(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h index 86bbefc8260..7876f20d723 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h @@ -150,7 +150,7 @@ public: void pad_identifier(Identifier& id) const; private: - const RpcIdHelper& m_rpcIdHelper; + const RpcIdHelper* m_rpcIdHelper; friend std::ostream& operator<<(std::ostream&, const RDOindex&); }; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h index 6d6ead9b0f9..c9e458e17c3 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RPCCABLINGCONDDATA_H @@ -163,7 +163,10 @@ private: int m_MaxType; // list of RPCPadParameters - RPCPadParameters m_RPCPadParameters_array[64][8]; + // max PADId was 8 in Run2, increased to 10 for Run3 to allow BIS78 + static constexpr unsigned MAX_PADID = 10; + static constexpr unsigned MAX_LOGICSECTOR = 64; + RPCPadParameters m_RPCPadParameters_array[MAX_LOGICSECTOR][MAX_PADID]; Identifier m_offline_id[2][32][10]; }; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h index 58b0589d032..a6485bd59ea 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h @@ -109,31 +109,39 @@ namespace RPC_CondCabling { const CMAparameters::CMAlist give_CMAs(const int, const ViewType, const int, const int) const; - bool give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_RoI_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_LowPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_HighPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_LowPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, + bool give_LowPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const; - bool give_HighPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, + bool give_HighPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const; - const CMAparameters* give_CMA(CMAidentity CMA) const; + const CMAparameters* give_CMA(const CMAidentity& CMA) const; - bool correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1, + bool correct(const CMAidentity& CMA, + L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1, unsigned short int Channel2, short int num) const; - std::list give_strip_code(CMAidentity CMA, int logic_sector, unsigned short int lh, unsigned short int ijk, + std::list give_strip_code(const CMAidentity& CMA, + int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel) const; bool operator+=(RPCchamberdata&); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx index 74b82430f8d..7f1afc3291a 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMAcablingdata.h" @@ -16,7 +16,7 @@ CMAcablingdata::CMAcablingdata(DBline& data, int type) : BaseObject(Logic, "CMA if (get_data(data, parser)) { if (m_view == ViewType::Eta) { m_etaCMA.emplace_back(parser); } } - data++; + ++data; } while (!data("}")); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx index 2a5d5d98403..2002d6cf139 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMAidentity.h" @@ -26,7 +26,7 @@ const std::string CMAidentity::name(const ViewType view, const CMAcoverage cover std::string v_name = cover + side + "CMA"; return v_name; } -CMAidentity::CMAidentity(defineParams pars) : m_params{pars} {} +CMAidentity::CMAidentity(const defineParams& pars) : m_params{pars} {} CMAidentity::CMAidentity(ViewType view, CMAcoverage side, int number, int eta_index, int phi_index, int PAD_index, int Ixx_index) { m_params.view = view; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx index 1dfe2a047e1..39f4928b77a 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx @@ -62,14 +62,18 @@ unsigned int CMAparameters::last_highPt_code() const { return m_last_highPt_code CMAparameters::CMAconfiguration CMAparameters::conf_type() const { return m_conf_type; } -CMAparameters::CMAparameters(CMAparameters::parseParams parse) : - CablingObject(parse, CMAidentity::name(parse.view, parse.coverage)), m_params{parse} { - m_id = std::make_unique(parse); +CMAparameters::CMAparameters(const CMAparameters::parseParams& parse) : + CablingObject(parse, CMAidentity::name(parse.view, parse.coverage)), + m_params{parse}, + m_id (std::make_unique(parse)) +{ } -CMAparameters::CMAparameters(const CMAparameters& cma) : CablingObject(cma), m_params{cma.m_params} { - m_id = std::make_unique(cma.id()); - +CMAparameters::CMAparameters(const CMAparameters& cma) + : CablingObject(cma), + m_params{cma.m_params}, + m_id (std::make_unique(cma.id())) +{ const CMAprogram* proglow = cma.lowPt_program(); const CMAprogram* proghigh = cma.highPt_program(); if (proglow) { m_lowPt_program = std ::make_unique(*proglow); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx index eafc2382b17..fbb3429faa0 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMApivotdata.h" @@ -8,8 +8,10 @@ using namespace RPC_CondCabling; -CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) : BaseObject(Logic, "CMA Data") { - m_layout = layout; +CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) + : BaseObject(Logic, "CMA Data"), + m_layout (layout) +{ (++data)("{"); do { CMAparameters::parseParams parser; @@ -26,7 +28,7 @@ CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) : } } } - data++; + ++data; } while (!data("}")); } void CMApivotdata::reset_data() { diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx index f786b4462d6..f936e6c04b7 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -15,7 +15,9 @@ using namespace RPC_CondCabling; -EtaCMA::EtaCMA(CMAparameters::parseParams parse) : CMAparameters(parse) { +EtaCMA::EtaCMA(const CMAparameters::parseParams& parse) + : CMAparameters(parse) +{ m_pivot_rpc_read = 1; m_lowPt_rpc_read = 1; m_highPt_rpc_read = 1; @@ -26,11 +28,13 @@ EtaCMA::EtaCMA(CMAparameters::parseParams parse) : CMAparameters(parse) { create_highPt_map(m_highPt_rpc_read); } -EtaCMA::EtaCMA(const EtaCMA& cma) : CMAparameters(cma) { - m_pivot_RPCs = cma.pivot_RPCs(); - m_lowPt_RPCs = cma.lowPt_RPCs(); - m_highPt_RPCs = cma.highPt_RPCs(); - m_inversion = cma.inversion(); +EtaCMA::EtaCMA(const EtaCMA& cma) + : CMAparameters(cma), + m_pivot_RPCs (cma.pivot_RPCs()), + m_lowPt_RPCs (cma.lowPt_RPCs()), + m_highPt_RPCs (cma.highPt_RPCs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx index 2f59bf3faa0..5533c4126df 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -20,7 +20,7 @@ const EvenPhiCMA::WORlink& EvenPhiCMA::highPt_WORs() const { return m_highPt_WOR bool EvenPhiCMA::inversion() const { return m_inversion; } -EvenPhiCMA::EvenPhiCMA(EvenPhiCMA::parseParams pars) : CMAparameters(pars) { +EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA::parseParams& pars) : CMAparameters(pars) { m_inversion = false; m_conf_type = CMAparameters::Atlas; @@ -39,11 +39,13 @@ EvenPhiCMA::EvenPhiCMA(EvenPhiCMA::parseParams pars) : CMAparameters(pars) { } } -EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA& cma) : CMAparameters(cma) { - m_pivot_WORs = cma.pivot_WORs(); - m_lowPt_WORs = cma.lowPt_WORs(); - m_highPt_WORs = cma.highPt_WORs(); - m_inversion = cma.inversion(); +EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA& cma) + : CMAparameters(cma), + m_pivot_WORs (cma.pivot_WORs()), + m_lowPt_WORs (cma.lowPt_WORs()), + m_highPt_WORs (cma.highPt_WORs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx index 462661de41f..b82a525574a 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -38,11 +38,13 @@ OddPhiCMA::OddPhiCMA(parseParams parse) : CMAparameters(parse) { } } -OddPhiCMA::OddPhiCMA(const OddPhiCMA& cma) : CMAparameters(cma) { - m_pivot_WORs = cma.pivot_WORs(); - m_lowPt_WORs = cma.lowPt_WORs(); - m_highPt_WORs = cma.highPt_WORs(); - m_inversion = cma.inversion(); +OddPhiCMA::OddPhiCMA(const OddPhiCMA& cma) + : CMAparameters(cma), + m_pivot_WORs (cma.pivot_WORs()), + m_lowPt_WORs (cma.lowPt_WORs()), + m_highPt_WORs (cma.highPt_WORs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx index a6b72c2e757..353b8e451b7 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx @@ -11,7 +11,7 @@ RDOindex::RDOindex(unsigned int PAD, unsigned int code, const RpcIdHelper& helper) : m_PADid{static_cast(PAD)}, m_lvl1_code{code}, - m_rpcIdHelper (helper) + m_rpcIdHelper (&helper) { set_indexes(); } @@ -26,7 +26,7 @@ RDOindex::RDOindex(unsigned int PAD, unsigned int code, const std::string& Name, m_doubletR{dR}, m_doubletZ{dZ}, m_doubletPhi{dP}, - m_rpcIdHelper (helper) + m_rpcIdHelper (&helper) { set_indexes(); } @@ -84,7 +84,7 @@ void RDOindex::pad_identifier(Identifier& id) const { doublet_phi = m_doubletPhi; } - id = m_rpcIdHelper.padID(name, eta, phi, doublet_r, doublet_z, doublet_phi); + id = m_rpcIdHelper->padID(name, eta, phi, doublet_r, doublet_z, doublet_phi); } } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx index f1afe45b850..6fbb3af7f4e 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/RPCchamberdata.h" @@ -30,7 +30,7 @@ RPCchamberdata::RPCchamberdata(DBline& data, int type) : BaseObject(Logic, "RPC params.stripsInPhiCon = stripsInPhiCon; if (get_data(data, params)) { m_rpc.emplace_back(params); } - data++; + ++data; } while (!data("}")); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx index 48ff6d705ad..022e1974c36 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/RpcCablingCondData.h" @@ -404,7 +404,7 @@ StatusCode RpcCablingCondData::giveROB_fromPRD(const IdentifierHash prdHashId, s bool RpcCablingCondData::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 { - if (logic_sector >= 64 || PADId >= 10) return false; // max PADId was 8 in Run2, increased to 10 for Run3 to allow BIS78 + if (logic_sector >= MAX_LOGICSECTOR || PADId >= MAX_PADID) return false; feet = m_RPCPadParameters_array[logic_sector][PADId].feet_on(); eta_and_phi = m_RPCPadParameters_array[logic_sector][PADId].eta_and_phi(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx index b6a54afa4f7..8433bec96df 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx @@ -11,10 +11,14 @@ using namespace RPC_CondCabling; SectorLogicSetup::SectorLogicSetup(int type, const std::string& database, const std::string& layout, bool conf) : - BaseObject(Logic, "Sector Logic Map"), m_positive_sector(""), m_negative_sector(""), m_sector_type(type) { - m_online_database = database; - m_layout = layout; - m_cosmic = conf; + BaseObject(Logic, "Sector Logic Map"), + m_positive_sector(""), + m_negative_sector(""), + m_sector_type(type), + m_online_database (database), + m_layout (layout), + m_cosmic (conf) +{ } std::string SectorLogicSetup::no_elements(const std::string& tech, int stat) { @@ -322,7 +326,9 @@ const CMAparameters::CMAlist SectorLogicSetup::give_CMAs(const int sector, const return list; } -bool SectorLogicSetup::give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_RoI_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -346,7 +352,9 @@ bool SectorLogicSetup::give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsign return firstEtaCode != lastEtaCode; } -bool SectorLogicSetup::give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_LowPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -370,7 +378,9 @@ bool SectorLogicSetup::give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsi return true; } -bool SectorLogicSetup::give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_HighPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -394,7 +404,7 @@ bool SectorLogicSetup::give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, uns return true; } -bool SectorLogicSetup::give_LowPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, +bool SectorLogicSetup::give_LowPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const { @@ -443,7 +453,7 @@ bool SectorLogicSetup::give_LowPt_layout(CMAidentity ID, unsigned short int& sta return !(start_confirm_ch == 999 || stop_confirm_ch == 999); } -bool SectorLogicSetup::give_HighPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, +bool SectorLogicSetup::give_HighPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const { @@ -492,7 +502,7 @@ bool SectorLogicSetup::give_HighPt_layout(CMAidentity ID, unsigned short int& st return !(start_confirm_ch == 999 || stop_confirm_ch == 999); } -const CMAparameters* SectorLogicSetup::give_CMA(CMAidentity CMA) const { +const CMAparameters* SectorLogicSetup::give_CMA(const CMAidentity& CMA) const { if (CMA.type() == Eta) { EtaCMAmap::const_iterator etaCMA = find_etaCMA(CMA.PAD_index(), CMA.Ixx_index()); return (etaCMA != m_etaCMAs.end()) ? &((*etaCMA).second) : nullptr; @@ -511,7 +521,8 @@ const CMAparameters* SectorLogicSetup::give_CMA(CMAidentity CMA) const { return nullptr; } -bool SectorLogicSetup::correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinput it, unsigned int ly, unsigned short int Channel1, +bool SectorLogicSetup::correct(const CMAidentity& CMA, + L1RPCcabCorrection type, CMAinput it, unsigned int ly, unsigned short int Channel1, unsigned short int Channel2, short int number) const { if (CMA.type() == Eta) { EtaCMAmap::const_iterator etaCMA = find_etaCMA(CMA.PAD_index(), CMA.Ixx_index()); @@ -530,7 +541,8 @@ bool SectorLogicSetup::correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinpu return false; } -std::list SectorLogicSetup::give_strip_code(CMAidentity CMA, int logic_sector, unsigned short int lh, unsigned short int ijk, +std::list SectorLogicSetup::give_strip_code(const CMAidentity& CMA, + int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel) const { std::list StripCodes; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx index 48bf37f3380..dc37490ae5c 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/WiredORdata.h" @@ -23,7 +23,7 @@ WiredORdata::WiredORdata(DBline& data, int type) : BaseObject{Logic, "Wired OR D parse_params.station = m_station; parse_params.number = -1; if (get_data(data, parse_params)) { m_wor.emplace_back(parse_params); } - data++; + ++data; } while (!data("}")); } WiredORdata::~WiredORdata() = default; -- GitLab From c1b04e8efba7c3a3212f95c834e4f9347ebbf91b Mon Sep 17 00:00:00 2001 From: Walter Lampl Date: Wed, 25 May 2022 09:20:54 +0200 Subject: [PATCH 41/56] CondCont.cxx: Remove spurious cout CondCont.cxx: Remove spurious cout --- Control/AthenaKernel/src/CondCont.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Control/AthenaKernel/src/CondCont.cxx b/Control/AthenaKernel/src/CondCont.cxx index bce3cf440b1..d9e83b84338 100644 --- a/Control/AthenaKernel/src/CondCont.cxx +++ b/Control/AthenaKernel/src/CondCont.cxx @@ -1044,9 +1044,7 @@ CondContMixedBase::insertMixed (const EventIDRange& r, if (r.start().isTimeStamp() ) { start_key = keyFromTimestamp (r.start()); } - else { - std::cout << "WLDEBUG: no TimeStamp in r.start(), assume inifinte range" << std::endl; - } + key_type stop_key = keyFromTimestamp (r.stop()); StatusCode sc = StatusCode::SUCCESS; -- GitLab From 9d8daf7393215172a10049602f4c179b06be5cd3 Mon Sep 17 00:00:00 2001 From: Christos Anastopoulos Date: Wed, 25 May 2022 09:21:29 +0200 Subject: [PATCH 42/56] TrigT1CaloFexPerf, TrigT1MuctpiPhase1, unitialized variables TrigT1CaloFexPerf, TrigT1MuctpiPhase1, unitialized variables --- Trigger/TrigT1/TrigT1CaloFexPerf/src/EFexEMClusterTool.h | 2 +- Trigger/TrigT1/TrigT1CaloFexPerf/src/JGTowerBuilder.h | 2 +- Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.h | 2 +- Trigger/TrigT1/TrigT1MuctpiPhase1/src/MuonSectorProcessor.h | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Trigger/TrigT1/TrigT1CaloFexPerf/src/EFexEMClusterTool.h b/Trigger/TrigT1/TrigT1CaloFexPerf/src/EFexEMClusterTool.h index 0a0b5b00177..2e7204213ff 100644 --- a/Trigger/TrigT1/TrigT1CaloFexPerf/src/EFexEMClusterTool.h +++ b/Trigger/TrigT1/TrigT1CaloFexPerf/src/EFexEMClusterTool.h @@ -213,7 +213,7 @@ namespace LVL1 float m_eta_dropL1Width; ///< max eta for applying cut on L1Width (baseline selection) // loose selection properties - bool m_use_REtaL12; ///< boolean for caluclating REta using Layer 1 in addition to Layer 2 + bool m_use_REtaL12 = false; ///< boolean for caluclating REta using Layer 1 in addition to Layer 2 bool m_use_tileCells; ///< boolean for using Tile cells instead of Tile TT float m_nominalDigitization; ///< value of nominal digitisation float m_nominalNoise_thresh; ///< noise threshold diff --git a/Trigger/TrigT1/TrigT1CaloFexPerf/src/JGTowerBuilder.h b/Trigger/TrigT1/TrigT1CaloFexPerf/src/JGTowerBuilder.h index 34b0b866f49..6c2e9cc2133 100644 --- a/Trigger/TrigT1/TrigT1CaloFexPerf/src/JGTowerBuilder.h +++ b/Trigger/TrigT1/TrigT1CaloFexPerf/src/JGTowerBuilder.h @@ -43,7 +43,7 @@ namespace LVL1 float m_minTowerEt; // Internals - const CaloCell_SuperCell_ID *m_scid; + const CaloCell_SuperCell_ID *m_scid = nullptr; }; //> end class JGTowerBuilder } // namespace LVL1 diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.h b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.h index 3837ba439bf..8b028ae38db 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.h +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.h @@ -127,7 +127,7 @@ namespace LVL1MUCTPIPHASE1 { ToolHandle m_trigThresholdDecisionTool{this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool", "Tool to get pass/fail of each trigger threshold"}; /// Function pointer to the execute function we want to use: - StatusCode ( LVL1MUCTPIPHASE1::MUCTPI_AthTool::*m_executeFunction )( void ) const; + StatusCode ( LVL1MUCTPIPHASE1::MUCTPI_AthTool::*m_executeFunction )( void ) const{}; }; } diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MuonSectorProcessor.h b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MuonSectorProcessor.h index febd67bf52d..edd1cd68751 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MuonSectorProcessor.h +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MuonSectorProcessor.h @@ -56,9 +56,9 @@ namespace LVL1MUCTPIPHASE1 { private: std::unique_ptr m_overlapHelper; - const TrigConf::L1Menu* m_l1menu; - const L1TopoLUT* m_l1topoLUT; - bool m_side; + const TrigConf::L1Menu* m_l1menu = nullptr; + const L1TopoLUT* m_l1topoLUT = nullptr; + bool m_side = false; //encoding between threshold index and pt value in barrel, endcap, and forward regions std::vector > m_ptEncoding; -- GitLab From 79f9cd5c4bc82eb25427999360198fadef93d673 Mon Sep 17 00:00:00 2001 From: Christos Anastopoulos Date: Wed, 25 May 2022 09:24:49 +0200 Subject: [PATCH 43/56] TrkVKalVrtCore pass by const , and remove stray ^M TrkVKalVrtCore pass by const , and remove stray ^M --- .../TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h | 4 +- .../TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h | 4 +- .../TrkVKalVrtCore/Propagator.h | 10 +- .../TrkVKalVrtCore/TrkVKalVrtCoreBase.h | 8 +- .../TrkVKalVrtCore/src/CFit.cxx | 6 +- .../TrkVKalVrtCore/src/CFitCascade.cxx | 16 +- .../TrkVKalVrtCore/src/CFitCascadeScale.cxx | 2 +- .../TrkVKalVrtCore/src/CascadeDefinition.cxx | 6 +- .../TrkVKalVrtCore/src/CascadeUtils.cxx | 10 +- .../TrkVKalVrtCore/src/Matrix.cxx | 22 +- .../TrkVKalVrtCore/src/PrCFit.cxx | 4 +- .../TrkVKalVrtCore/src/Propagate.cxx | 12 +- .../TrkVKalVrtCore/src/RobTest.cxx | 232 +++--- .../TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx | 6 +- .../TrkVKalVrtCore/src/Utilities.cxx | 12 +- .../TrkVKalVrtCore/src/VKgrkuta.cxx | 2 +- .../TrkVKalVrtCore/src/VKvFast.cxx | 12 +- .../TrkVKalVrtCore/src/VtCFit.cxx | 8 +- .../TrkVKalVrtCore/src/VtCFitE.cxx | 746 +++++++++--------- .../TrkVKalVrtCore/src/VtDeriv.cxx | 4 +- .../TrkVKalVrtCore/src/XYZtrp.cxx | 412 +++++----- .../TrkVKalVrtCore/src/cfClstPnt.cxx | 4 +- .../TrkVKalVrtCore/src/cfErPr.cxx | 168 ++-- .../TrkVKalVrtCore/src/cfImp.cxx | 370 ++++----- .../TrkVKalVrtCore/src/cfMassErr.cxx | 6 +- .../TrkVKalVrtCore/src/cfNewP.cxx | 4 +- .../TrkVKalVrtCore/src/cfNewPm.cxx | 238 +++--- .../TrkVKalVrtCore/src/cfTotCov.cxx | 4 +- .../TrkVKalVrtCore/src/stCnst.cxx | 4 +- .../TrkVKalVrtFitter/src/TrkCascadeFitter.cxx | 8 +- .../TrkVKalVrtFitter/src/VKalGetImpact.cxx | 2 +- .../src/VKalVrtFitFastSvc.cxx | 2 +- .../TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx | 2 +- 33 files changed, 1175 insertions(+), 1175 deletions(-) diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h index edb7a54913f..1e2bdf42066 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCore_Derivt_H @@ -89,7 +89,7 @@ namespace Trk { class VKPointConstraint : public VKConstraintBase { public: - VKPointConstraint(int,double[3], VKVertex*, bool ); + VKPointConstraint(int,const double[3], VKVertex*, bool ); ~VKPointConstraint(); friend std::ostream& operator<<( std::ostream& out, const VKPointConstraint& ); bool onlyZ() const {return m_onlyZ; }; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h index 53a607c2923..9bfaa53b525 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCore_ForCFT_H @@ -47,7 +47,7 @@ namespace Trk { int IterationNumber; double IterationPrecision; - void prcfit( long int ntrk, double *wm, double *wmfit, double bmag, double *vrt, double *vrte) noexcept; + void prcfit( long int ntrk, double *wm, double *wmfit, double bmag, const double *vrt, const double *vrte) noexcept; void vksetIterationNum(long int Iter) noexcept; void vksetIterationPrec(double Prec) noexcept; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h index 4d7bb6df49f..3912f63abab 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h @@ -57,14 +57,14 @@ class IVKalState; ~vkalPropagator() = default; - void Propagate(long int TrkID, long int Charge, + static void Propagate(long int TrkID, long int Charge, double *ParOld, double *CovOld, double *RefStart, double *RefEnd, double *ParNew, double *CovNew, - VKalVrtControlBase* FitControl = 0) const; - bool checkTarget(double *RefEnd) const; - void Propagate(VKTrack *trk, double *RefStart, + VKalVrtControlBase* FitControl = 0) ; + static bool checkTarget(double *RefEnd) ; + static void Propagate(VKTrack *trk, double *RefStart, double *RefEnd, double *ParNew, double *CovNew, - VKalVrtControlBase* FitControl = 0) const; + VKalVrtControlBase* FitControl = 0) ; }; } diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h index 69268318a4e..7b4d6ac8c53 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCoreBase_VKalVrtCore_H @@ -63,7 +63,7 @@ namespace Trk { class VKTrack { public: - VKTrack(long int, double[], double[], VKVertex *, double); + VKTrack(long int, const double[], const double[], VKVertex *, double); ~VKTrack() = default; //default destructor allows compiler to optimize out method. // VKTrack(const VKTrack & src); //copy friend std::ostream& operator<<( std::ostream& out, const VKTrack& track ); @@ -111,8 +111,8 @@ namespace Trk { double r_invR() const { return refPerig[4];} public: - void setCurrent ( double[], double[]); // set iteration (current) track parameters - void setReference( double[], double[]); // set reference track parameters + void setCurrent ( const double[], const double[]); // set iteration (current) track parameters + void setReference( const double[], const double[]); // set reference track parameters void restoreCurrentWgt(); // restore track WGT from saved copy private: diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx index 02cdea6f7e5..1b7e8a9df61 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx @@ -95,7 +95,7 @@ extern double cfSmallEigenvalue( double*, long int ); -void fillVertex(VKVertex *vk, int NTRK, long int *ich, double xyz0[3], double (*par0)[3], +void fillVertex(VKVertex *vk, int NTRK, const long int *ich, double xyz0[3], double (*par0)[3], double (*inp_Trk5)[5], double (*inp_CovTrk5)[15]) { @@ -146,8 +146,8 @@ bool checkPosition(VKVertex * vk, double vertex[3]){ extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase* = nullptr); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); -extern void cfmasserr(VKVertex* , int*, double, double*, double*); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); +extern void cfmasserr(VKVertex* , const int*, double, double*, double*); extern std::array getFitParticleMom( const VKTrack *, double); int fitVertex(VKVertex * vk) diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx index 192d9dd0c2e..8f2436d172f 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx @@ -29,22 +29,22 @@ extern void FullMTXfill(VKVertex * , double * ); extern int FullMCNSTfill(VKVertex * , double * , double * ); extern int vkMSolve(double *, double*, long int, double* =nullptr); -extern void copyFullMtx(double *Input, long int IPar, long int IDIM, - double *Target, long int TStart, long int TDIM); +extern void copyFullMtx(const double *Input, long int IPar, long int IDIM, + double *Target, long int TStart, long int TDIM); extern void addCrossVertexDeriv(CascadeEvent &, double * , long int , const std::vector & ); -extern void setFittedParameters(double * , std::vector &, CascadeEvent &); +extern void setFittedParameters(const double * , std::vector &, CascadeEvent &); extern int getCascadeNPar(CascadeEvent &, int Type=0); extern VKTrack * getCombinedVTrack(VKVertex *); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); extern std::array getFitParticleMom( const VKTrack *, double); -extern void setFittedMatrices(double * , long int , std::vector &, std::vector< std::vector > &, CascadeEvent& ); +extern void setFittedMatrices(const double * , long int , std::vector &, std::vector< std::vector > &, CascadeEvent& ); extern std::vector transformCovar(int , double **, const std::vector& ); extern double cfVrtDstSig( VKVertex * , bool ); extern void robtest(VKVertex * , long int ); extern int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEvent&); -extern void getNewCov(double *OldCov, double* Der, double* Cov, long int DIM) noexcept; +extern void getNewCov(const double *OldCov, const double* Der, double* Cov, long int DIM) noexcept; //-------------------------------------------------------------------- // @@ -511,7 +511,7 @@ int processCascade(CascadeEvent & cascadeEvent_ ) // // Iteration over complete cascade with first cascade vertex in Primary Vertex // - int processCascadePV(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov ) + int processCascadePV(CascadeEvent & cascadeEvent_, const double *primVrt, const double *primVrtCov ) { double aermd[6],tmpd[6]; // temporary arrays VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex @@ -539,7 +539,7 @@ int processCascade(CascadeEvent & cascadeEvent_ ) // // Iteration over complete cascade with "close to primary vertex" Chi2 term // - int processCascade(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov ) + int processCascade(CascadeEvent & cascadeEvent_, const double *primVrt, const double *primVrtCov ) { cascadeEvent_.nearPrmVertex=1; //setting up additional Chi2 term VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx index dcbac8cc4e8..b1ec05956e9 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx @@ -31,7 +31,7 @@ extern int FullMCNSTfill(VKVertex * , double * , double * ); extern int getCascadeNPar(CascadeEvent &, int Type=0); extern VKTrack * getCombinedVTrack(VKVertex *); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *,VKalVrtControl * =nullptr); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *,VKalVrtControl * =nullptr); extern std::vector transformCovar(int , double **, const std::vector& ); extern double cfVrtDstSig( VKVertex * , bool ); extern long int getVertexCharge( VKVertex *); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx index a0d355be5ac..1a41d303ed8 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/Derivt.h" @@ -15,7 +15,7 @@ extern const vkalMagFld myMagFld; extern int cfdinv(double *, double *, long int ); extern int cfInv5(double *cov, double *wgt ); extern int translateToFittedPos(CascadeEvent &,double Step=1.); -extern double vkvFastV( double* , double* , double*, double , double*); +extern double vkvFastV( double* , double* , const double*, double , double*); extern long int vtcfit( VKVertex * vk); extern void cfdcopy(double *source, double *target, int); @@ -69,7 +69,7 @@ VKVertex* addCascadeEntry( std::unique_ptr vk, const std::vector // vertexDefinition[iv][it] - list of real track to vertex associacion // cascadeDefinition[iv][ipv] - for given vertex IV the list of previous vertices pointing to it. // -int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, +int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, const long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, const std::vector< std::vector > &vertexDefinition, const std::vector< std::vector > &cascadeDefinition, double definedCnstAccuracy=1.e-4) diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx index d29673ebcdc..633cb346590 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx @@ -152,9 +152,9 @@ int getCascadeNPar(CascadeEvent & cascadeEvent_, int Type=0) // // Track parameters are translated at each iteration so iniV==(0,0,0) // -void setFittedParameters(double * result, std::vector & matrixPnt, CascadeEvent & cascadeEvent_) +void setFittedParameters(const double * result, std::vector & matrixPnt, CascadeEvent & cascadeEvent_) { - extern double cfchi2(double *, double *, VKTrack *); + extern double cfchi2(const double *, const double *, VKTrack *); int iv,it,Pnt; for( iv=0; iv & matrixPnt, CascadeE } } -void setFittedMatrices(double * COVFIT, long int MATRIXSIZE, +void setFittedMatrices(const double * COVFIT, long int MATRIXSIZE, std::vector & matrixPnt, std::vector< std::vector > & covarCascade, CascadeEvent & cascadeEvent_) @@ -248,7 +248,7 @@ void addCrossVertexDeriv(CascadeEvent & cascadeEvent_, double * ader, long int M // Copy matrix Input with dimension IDIM to predefined place(TStart) // into matrix Target with dimension TDIM // -void copyFullMtx(double *Input, long int IPar, long int IDIM, +void copyFullMtx(const double *Input, long int IPar, long int IDIM, double *Target, long int TStart, long int TDIM) { int i,j,it,jt; @@ -263,7 +263,7 @@ void copyFullMtx(double *Input, long int IPar, long int IDIM, //-------------------------------------------------------------------- // Make the convolution Cov=D*OldCov*Dt // -void getNewCov(double *OldCov, double* Der, double* Cov, long int DIM) noexcept +void getNewCov(const double *OldCov, const double* Der, double* Cov, long int DIM) noexcept { int i,j,it,jt; for( i=0; i a (DIM+1); @@ -564,7 +564,7 @@ return 0; //Invert packed symmetric matrix using SVD // -int vkSInvSVD(double *ci,long int DIM, double *co, double Chk) +int vkSInvSVD(const double *ci,long int DIM, double *co, double Chk) { int i,j,k; noinit_vector a (DIM+1); @@ -688,7 +688,7 @@ int vkjacobi(double **a, int n, double d[], double **v) //------------------------------------------- // ci - symmetric matrix in compact form //------------------------------------------- -void vkGetEigVal(double ci[], double d[], int n) +void vkGetEigVal(const double ci[], double d[], int n) { int i,j,k; d--; noinit_vector a (n+1); @@ -707,7 +707,7 @@ void vkGetEigVal(double ci[], double d[], int n) } } -void vkGetEigVect(double ci[], double d[], double vect[], int n) +void vkGetEigVect(const double ci[], double d[], double vect[], int n) { int i,j,k; d--; noinit_vector a (n+1); @@ -733,7 +733,7 @@ void vkGetEigVect(double ci[], double d[], double vect[], int n) k=0; for (i=1;i<=n;i++) for(j=1;j<=n;j++) vect[k++]=v[j][i]; } -int vkcholInv(double ci[], double co[], long int DIM) +int vkcholInv(const double ci[], double co[], long int DIM) { int i,j,k; std::vector p(DIM,0); @@ -775,7 +775,7 @@ int vkcholInv(double ci[], double co[], long int DIM) return 0; } -double checkMatrixInversion(double mtx[], double invmtx[], int DIM) +double checkMatrixInversion(const double mtx[], const double invmtx[], int DIM) { //std::vector> r; r.resize(DIM,std::vector(DIM,0.)); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx index 1b5eca15e1e..573bd3b6710 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/CommonPars.h" @@ -40,7 +40,7 @@ namespace Trk { /* STPCNV : track momentum from track (theta,phi,1/r) at vertex */ /*------------------------------------------------------------------------------*/ -void ForCFT::prcfit( long int ntrk, double *wm, double *wmfit, double bmag, double *vrt, double *vrte) noexcept +void ForCFT::prcfit( long int ntrk, double *wm, double *wmfit, double bmag, const double *vrt, const double *vrte) noexcept { long int i__1; double summ; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx index d5effa6781a..c688bf7f323 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx @@ -20,9 +20,9 @@ namespace Trk { extern const vkalMagFld myMagFld; -extern void cfnewp(long int*, double*, double*, double*, double*, double*); -extern void cferpr(long int*, double*, double*, double*, double*, double*); -extern void cfnewpm (double*, double*, double*, double*, double*, double*, VKalVrtControlBase * =nullptr); +extern void cfnewp(const long int*, double*, double*, double*, double*, double*); +extern void cferpr(const long int*, double*, double*, const double*, double*, double*); +extern void cfnewpm (double*, const double*, double*, const double*, double*, double*, VKalVrtControlBase * =nullptr); //------------------------------------------------------------------------ // Old propagator functions: @@ -137,14 +137,14 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*, VKalV basePropagator::~basePropagator() = default; - bool vkalPropagator::checkTarget(double *) const + bool vkalPropagator::checkTarget(double *) { //if ( m_typePropagator == 3 ) return vk_objectProp->checkTarget(RefNew); return true; } void vkalPropagator::Propagate(long int TrkID, long int Charge, double *ParOld, double *CovOld, double *RefOld, - double *RefNew, double *ParNew, double *CovNew, VKalVrtControlBase * FitControl) const + double *RefNew, double *ParNew, double *CovNew, VKalVrtControlBase * FitControl) { //std::cout<<"Core: propagator control="<refPerig[i]; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx index fb2f22786b0..e7bb9533102 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" @@ -10,120 +10,120 @@ namespace Trk { -//extern void digx(double*, double*, double*, long int , long int ); +//extern void digx(double*, double*, double*, long int , long int ); -extern void vkGetEigVect(double ci[], double d[], double vect[], int n); +extern void vkGetEigVect(const double ci[], double d[], double vect[], int n); + +void robtest(VKVertex * vk, long int ifl) +{ + long int i, j, k, kk, it; + double rob, res, c[5], darg, absX, roba[5]; + +/* ------------------------------------------------------------ */ +/* Robustification procedure for weight matrix */ +/* IROB = 0 - Standard chi^2 */ +/* = 1 - Geman-McClure function */ +/* = 2 - Welch function */ +/* = 3 - Cauchy function */ +/* = 4 - L1-L2 function */ +/* = 5 - Fair function */ +/* = 6 - Huber function */ +/* = 7 - Modified Huber function */ +/* (1,2,3) - Zero outliers */ +/* (4,5,6,7) - Downweight outliers */ +/* Author: V.Kostyukhin */ +/* ------------------------------------------------------------ */ + + int NTRK = vk->TrackList.size(); + + long int irob = vk->vk_fitterControl->vk_forcft.irob; + double Scl = vk->vk_fitterControl->vk_forcft.RobustScale; //Tuning constant + double C; // Breakdown constant + + if ( ifl == 0) { /* FILLING OF EIGENVALUES AND VECTORS */ + for (it = 0; it < NTRK ; ++it) { /* RESTORE MATRIX */ + VKTrack *trk=vk->TrackList[it].get(); + if(trk->Id < 0) continue; // Not a real track + //k = 0; double dest[5][5]; + //for (i = 0; i < 5; ++i) { + //for (j = 0; j <= i; ++j) { + // dest[i][j] = trk->WgtM[k]; + // dest[j][i] = trk->WgtM[k]; + // ++k; + // } + //} + //digx(&dest[0][0], &(vk->TrackList[it]->e[0]), &(vk->TrackList[it]->v[0][0]), 5, 1); + vkGetEigVect(trk->WgtM, trk->e ,&(trk->v[0][0]), 5); + } +//std::cout.precision(9); std::cout<<"Rob="<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] +// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] +// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; + return; + } +/* -- */ + double halfPi=M_PI/2.; + for (it = 0; it < NTRK; ++it) { + VKTrack *trk=vk->TrackList[it].get(); + if(trk->Id < 0) continue; // Not a real track + c[0]=c[1]=c[2]=c[3]=c[4]=0.; + for( k = 0; k < 5; k++){ + c[0] += trk->rmnd[k] * trk->v[0][k]; + c[1] += trk->rmnd[k] * trk->v[1][k]; + c[2] += trk->rmnd[k] * trk->v[2][k]; + c[3] += trk->rmnd[k] * trk->v[3][k]; + c[4] += trk->rmnd[k] * trk->v[4][k]; + } +//std::cout<<"rm="<rmnd[0]<<", "<rmnd[1]<<", "<rmnd[2]<< +// ", "<rmnd[3]<<", "<rmnd[4]<<", "<<'\n'; +//std::cout<<" c="<e[k]; + if(darg < 1.e-10) darg = 1.e-10; + absX = sqrt(darg); /* Abs(X) == sqrt(X)*/ + rob = 1.; C=1; + if(irob == 1)C = 1.58*Scl; /* Geman-McClure Standard =1 but c^2=2.5 is better(Gem.McC) */ + if(irob == 2)C = 2.9846*Scl; /* Welch def c^2=2.9846^2 */ + if(irob == 3)C = 2.3849*Scl; /* Cauchy def 2.385^2=5.7 */ + if(irob == 4)C = 1.; /* L1-L2 no tuning*/ + if(irob == 5)C = 1.3998*Scl; /* Fair (def=1.3998)*/ + if(irob == 6)C = 1.345 *Scl; /* Huber (def=1.345)*/ + if(irob == 7)C = 1.2107 *Scl; /* Modified Huber (def=1.2107)*/ +/* Functionals here are divided by (X^2/2)!!!*/ + double C2=C*C; + if(irob == 1)rob = 1. / (darg/C2 + 1.); /* Geman-McClure */ + if(irob == 2)rob = C2*(1. - exp(-darg/C2) )/darg; /* Welch */ + if(irob == 3)rob = C2*log(darg/C2 + 1.)/darg; /* Cauchy */ + if(irob == 4)rob = 4.*(sqrt(darg / 2. + 1.) - 1.)/darg; /* L1-L2 */ + if(irob == 5)rob = 2.*C2*(absX/C - log(absX/C + 1.))/darg; /* Fair */ + if(irob == 6)rob = C>absX ? 1. : (2*C/absX - C*C/darg) ; /* Huber */ + if(irob == 7)rob = halfPi>(absX/C) ? 2*C*C*(1-cos(absX/C))/darg : + 2*(C*absX+C*C*(1.-halfPi))/darg; /* Modified Huber */ + roba[k] = rob; + if(rob>0.99)roba[k] = 1.; //To improve precision + } +//std::cout<<"robn="<v[k][i] * trk->e[k] * trk->v[k][j]*roba[k]; + } + trk->WgtM[kk]=res; + kk++; + } + } + vk->vk_fitterControl->vk_forcft.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4]; + if(vk->vk_fitterControl->vk_forcft.robres[it]>1.)vk->vk_fitterControl->vk_forcft.robres[it]=1.; + } +//std::cout<<" Fin="<TrackList[0]->WgtM[0]<<", "<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] +// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] +// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; +} + + +} /* End of namespace */ + -void robtest(VKVertex * vk, long int ifl) -{ - long int i, j, k, kk, it; - double rob, res, c[5], darg, absX, roba[5]; - -/* ------------------------------------------------------------ */ -/* Robustification procedure for weight matrix */ -/* IROB = 0 - Standard chi^2 */ -/* = 1 - Geman-McClure function */ -/* = 2 - Welch function */ -/* = 3 - Cauchy function */ -/* = 4 - L1-L2 function */ -/* = 5 - Fair function */ -/* = 6 - Huber function */ -/* = 7 - Modified Huber function */ -/* (1,2,3) - Zero outliers */ -/* (4,5,6,7) - Downweight outliers */ -/* Author: V.Kostyukhin */ -/* ------------------------------------------------------------ */ - - int NTRK = vk->TrackList.size(); - - long int irob = vk->vk_fitterControl->vk_forcft.irob; - double Scl = vk->vk_fitterControl->vk_forcft.RobustScale; //Tuning constant - double C; // Breakdown constant - - if ( ifl == 0) { /* FILLING OF EIGENVALUES AND VECTORS */ - for (it = 0; it < NTRK ; ++it) { /* RESTORE MATRIX */ - VKTrack *trk=vk->TrackList[it].get(); - if(trk->Id < 0) continue; // Not a real track - //k = 0; double dest[5][5]; - //for (i = 0; i < 5; ++i) { - //for (j = 0; j <= i; ++j) { - // dest[i][j] = trk->WgtM[k]; - // dest[j][i] = trk->WgtM[k]; - // ++k; - // } - //} - //digx(&dest[0][0], &(vk->TrackList[it]->e[0]), &(vk->TrackList[it]->v[0][0]), 5, 1); - vkGetEigVect(trk->WgtM, trk->e ,&(trk->v[0][0]), 5); - } -//std::cout.precision(9); std::cout<<"Rob="<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] -// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] -// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; - return; - } -/* -- */ - double halfPi=M_PI/2.; - for (it = 0; it < NTRK; ++it) { - VKTrack *trk=vk->TrackList[it].get(); - if(trk->Id < 0) continue; // Not a real track - c[0]=c[1]=c[2]=c[3]=c[4]=0.; - for( k = 0; k < 5; k++){ - c[0] += trk->rmnd[k] * trk->v[0][k]; - c[1] += trk->rmnd[k] * trk->v[1][k]; - c[2] += trk->rmnd[k] * trk->v[2][k]; - c[3] += trk->rmnd[k] * trk->v[3][k]; - c[4] += trk->rmnd[k] * trk->v[4][k]; - } -//std::cout<<"rm="<rmnd[0]<<", "<rmnd[1]<<", "<rmnd[2]<< -// ", "<rmnd[3]<<", "<rmnd[4]<<", "<<'\n'; -//std::cout<<" c="<e[k]; - if(darg < 1.e-10) darg = 1.e-10; - absX = sqrt(darg); /* Abs(X) == sqrt(X)*/ - rob = 1.; C=1; - if(irob == 1)C = 1.58*Scl; /* Geman-McClure Standard =1 but c^2=2.5 is better(Gem.McC) */ - if(irob == 2)C = 2.9846*Scl; /* Welch def c^2=2.9846^2 */ - if(irob == 3)C = 2.3849*Scl; /* Cauchy def 2.385^2=5.7 */ - if(irob == 4)C = 1.; /* L1-L2 no tuning*/ - if(irob == 5)C = 1.3998*Scl; /* Fair (def=1.3998)*/ - if(irob == 6)C = 1.345 *Scl; /* Huber (def=1.345)*/ - if(irob == 7)C = 1.2107 *Scl; /* Modified Huber (def=1.2107)*/ -/* Functionals here are divided by (X^2/2)!!!*/ - double C2=C*C; - if(irob == 1)rob = 1. / (darg/C2 + 1.); /* Geman-McClure */ - if(irob == 2)rob = C2*(1. - exp(-darg/C2) )/darg; /* Welch */ - if(irob == 3)rob = C2*log(darg/C2 + 1.)/darg; /* Cauchy */ - if(irob == 4)rob = 4.*(sqrt(darg / 2. + 1.) - 1.)/darg; /* L1-L2 */ - if(irob == 5)rob = 2.*C2*(absX/C - log(absX/C + 1.))/darg; /* Fair */ - if(irob == 6)rob = C>absX ? 1. : (2*C/absX - C*C/darg) ; /* Huber */ - if(irob == 7)rob = halfPi>(absX/C) ? 2*C*C*(1-cos(absX/C))/darg : - 2*(C*absX+C*C*(1.-halfPi))/darg; /* Modified Huber */ - roba[k] = rob; - if(rob>0.99)roba[k] = 1.; //To improve precision - } -//std::cout<<"robn="<v[k][i] * trk->e[k] * trk->v[k][j]*roba[k]; - } - trk->WgtM[kk]=res; - kk++; - } - } - vk->vk_fitterControl->vk_forcft.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4]; - if(vk->vk_fitterControl->vk_forcft.robres[it]>1.)vk->vk_fitterControl->vk_forcft.robres[it]=1.; - } -//std::cout<<" Fin="<TrackList[0]->WgtM[0]<<", "<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] -// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] -// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; -} - - -} /* End of namespace */ - - diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx index f3d7b026ec8..d75e9e57799 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx @@ -41,7 +41,7 @@ namespace Trk { { } - VKTrack::VKTrack(long int iniId, double Perigee[], double Covariance[], VKVertex * vk, double m): + VKTrack::VKTrack(long int iniId, const double Perigee[], const double Covariance[], VKVertex * vk, double m): Chi2(0), m_mass(m) { Id = iniId; Charge=1; if(Perigee[4]<0)Charge=-1; @@ -51,10 +51,10 @@ namespace Trk { m_originVertex = vk; } - void VKTrack::setCurrent(double Perigee[], double Weight[]) + void VKTrack::setCurrent(const double Perigee[], const double Weight[]) { for(int i=0; i<5; i++) Perig[i]=Perigee[i]; for(int i=0; i<15; i++) WgtM[i]=WgtM_save[i]=Weight[i]; } - void VKTrack::setReference(double Perigee[], double Covariance[]) + void VKTrack::setReference(const double Perigee[], const double Covariance[]) { for(int i=0; i<5; i++) refPerig[i]=Perigee[i]; for(int i=0; i<15; i++) refCovar[i]=Covariance[i]; } void VKTrack::restoreCurrentWgt() diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx index f9fe4240997..e2aa55ecf27 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" @@ -16,11 +16,11 @@ namespace Trk { // PAR0(5) - fitted track // ------------------------------------------------------------ -double cfchi2(double *xyzt, long int *ich, double *part, - double *par0, double *wgt, double *rmnd) +double cfchi2(double *xyzt, const long int *ich, double *part, + const double *par0, double *wgt, double *rmnd) { - extern void cfnewp(long int*, double*, double*, double*, double*, double*); + extern void cfnewp(const long int*, double*, double*, double*, double*, double*); double phif, epsf, d1, d2, d3, d4, d5, sr, uu, vv, res, zpf; /* Parameter adjustments */ @@ -71,7 +71,7 @@ double cfchi2(double *xyzt, long int *ich, double *part, // So it transfers fitted parameters to (0,0,0) and compares with reference track parameters // ------------------------------------------------------------ -double cfchi2(double *vrtt, double * part, VKTrack * trk) +double cfchi2(const double *vrtt, const double * part, VKTrack * trk) { double d1, d2, d3, d4, d5; @@ -210,7 +210,7 @@ inline int sIndexVK(int i, int j){ return i>j ? i*(i+1)/2+j : j*(j+1)/2+i;} // // Dimensions input: CovI(N,N), output: CovF(M,M), input: Der(N,M)-first index runs first // -void tdasatVK(double *Der, double *CovI, double *CovF, long int M, long int N) +void tdasatVK(const double *Der, const double *CovI, double *CovF, long int M, long int N) { int i,j,k,f; for( k=0; k -#include - -namespace Trk { - -/* ---------------------------------------------------------- */ -/* Entry for error matrix calculation after successful fit */ -/* Error matrix has a form V(X,Y,Z,PX,PY,PZ) */ -/* ADER - full covariance matrix after fit in form */ -/* (x,y,z,track1(1:3),track2(1:3),......) */ - -#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)] -#define dcv_ref(a_1,a_2) dcv[(a_2)*6 + (a_1) - 7] - - -#define useWeightScheme 1 - -int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double verr[6][6]) -{ - - int i,j,ic1,ic2; - - long int ic, jc, it, jt; - double cnt = 1e8; - - - extern void dsinv(long int, double *, long int , long int *) noexcept; - extern void FullMTXfill( VKVertex* , double *); - extern void vkSVDCmp(double**, int, int, double*, double**); - - TWRK * t_trk=nullptr; - long int NTRK = vk->TrackList.size(); - long int IERR=0; - long int NVar = (NTRK + 1) * 3; - if(vk->passNearVertex && vk->ConstraintList.empty()) { - /* Fit is with "pass near" constraint and then */ - /* matrix is already present */ - } else if ( !vk->ConstraintList.empty() && useWeightScheme ) { -/* Full matrix inversion i */ -// - FullMTXfill( vk, ader); - if ( vk->passNearVertex ) { - double drdpy[2][3]; - double dpipj[3][3]; - for (it = 1; it <= NTRK; ++it) { - drdpy[0][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[1]; - drdpy[1][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[2]; - drdpy[0][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[1]; - drdpy[1][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[2]; - drdpy[0][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[1]; - drdpy[1][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[2]; - for (jt = 1; jt <= NTRK; ++jt) { /* Matrix */ - for (int k = 0; k < 3; ++k) { - for (int l = 0; l < 3; ++l) { - dpipj[k][l] = 0.; - for (int j = 0; j < 2; ++j) { - dpipj[k][l] += vk->tmpArr[jt-1]->drdp[j][k] * drdpy[j][l]; - } - } - } - for (int k = 1; k <= 3; ++k) { - for (int l = 1; l <= 3; ++l) { - ader_ref(it * 3 + k, jt * 3 + l) += dpipj[l-1][k-1]; - } - } - } - } - } - Vect3DF th0t,tf0t; - for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ - for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ - th0t = vk->ConstraintList[ic1]->h0t[ic2]; - ader_ref(1, 1) += cnt * th0t.X * th0t.X; - ader_ref(2, 1) += cnt * th0t.Y * th0t.X; - ader_ref(3, 1) += cnt * th0t.Z * th0t.X; - ader_ref(1, 2) += cnt * th0t.X * th0t.Y; - ader_ref(2, 2) += cnt * th0t.Y * th0t.Y; - ader_ref(3, 2) += cnt * th0t.Z * th0t.Y; - ader_ref(1, 3) += cnt * th0t.X * th0t.Z; - ader_ref(2, 3) += cnt * th0t.Y * th0t.Z; - ader_ref(3, 3) += cnt * th0t.Z * th0t.Z; - for (it = 1; it <= NTRK; ++it) { - tf0t = vk->ConstraintList[ic1]->f0t[it-1][ic2]; - ader_ref(1, it * 3 + 1) += cnt * th0t.X * tf0t.X; - ader_ref(2, it * 3 + 1) += cnt * th0t.Y * tf0t.X; - ader_ref(3, it * 3 + 1) += cnt * th0t.Z * tf0t.X; - ader_ref(1, it * 3 + 2) += cnt * th0t.X * tf0t.Y; - ader_ref(2, it * 3 + 2) += cnt * th0t.Y * tf0t.Y; - ader_ref(3, it * 3 + 2) += cnt * th0t.Z * tf0t.Y; - ader_ref(1, it * 3 + 3) += cnt * th0t.X * tf0t.Z; - ader_ref(2, it * 3 + 3) += cnt * th0t.Y * tf0t.Z; - ader_ref(3, it * 3 + 3) += cnt * th0t.Z * tf0t.Z; - } - } - } - - - for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ - for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ - for (it = 1; it <= NTRK; ++it) { - for (jt = it; jt <= NTRK; ++jt) { - Vect3DF tf0ti = vk->ConstraintList[ic1]->f0t[it-1][ic2]; - Vect3DF tf0tj = vk->ConstraintList[ic1]->f0t[jt-1][ic2]; - ader_ref(it*3 + 1, jt*3 + 1) += cnt * tf0ti.X * tf0tj.X; - ader_ref(it*3 + 2, jt*3 + 1) += cnt * tf0ti.Y * tf0tj.X; - ader_ref(it*3 + 3, jt*3 + 1) += cnt * tf0ti.Z * tf0tj.X; - ader_ref(it*3 + 1, jt*3 + 2) += cnt * tf0ti.X * tf0tj.Y; - ader_ref(it*3 + 2, jt*3 + 2) += cnt * tf0ti.Y * tf0tj.Y; - ader_ref(it*3 + 3, jt*3 + 2) += cnt * tf0ti.Z * tf0tj.Y; - ader_ref(it*3 + 1, jt*3 + 3) += cnt * tf0ti.X * tf0tj.Z; - ader_ref(it*3 + 2, jt*3 + 3) += cnt * tf0ti.Y * tf0tj.Z; - ader_ref(it*3 + 3, jt*3 + 3) += cnt * tf0ti.Z * tf0tj.Z; - } - } - } - } -/* symmetrisation */ - for (i=1; i<=NVar-1; ++i) { - for (j = i+1; j<=NVar; ++j) { - ader_ref(j,i) = ader_ref(i,j); - } - } -//------------------------------------------------------------------------- -/* several checks for debugging */ -//std::cout.precision(12); -// for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ -// for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ -// th0t = vk->ConstraintList[ic1]->h0t[ic2]; -//std::cout<<"h0t="<ConstraintList[ic1]->f0t[it-1][ic2]; -//std::cout<<"f0t="< ta (NVar+1); - noinit_vector tab ((NVar+1)*(NVar+1)); - for(i=0; i tv (NVar+1); - noinit_vector tvb ((NVar+1)*(NVar+1)); - noinit_vector tr (NVar+1); - noinit_vector trb ((NVar+1)*(NVar+1)); - noinit_vector tw (NVar+1); - for(i=0; itmax)tmax=fabs(tw[i]); - for(i=1; i std::abs(mcheck)) ? maxDiff : std::abs(mcheck); - if(i==j) maxDiff = (maxDiff > std::abs(1.-mcheck)) ? maxDiff : std::abs(1.-mcheck); - } } - //--------------------------------------------------------------------------------------- - if(maxDiff>0.1)return -1; -/* ---------------------------------------- */ - } else { -/* ---------------------------------------- */ -/* Simple and fast without constraints */ - for (i=1; i<=NVar; i++) { - for (j=1; j<=NVar; j++) { - ader_ref(i,j)=0.; - } - } - double vcov[6]={vk->fitVcov[0],vk->fitVcov[1],vk->fitVcov[2],vk->fitVcov[3],vk->fitVcov[4],vk->fitVcov[5]}; - ader_ref(1,1) = vcov[0]; - ader_ref(1,2) = vcov[1]; - ader_ref(2,2) = vcov[2]; - ader_ref(1,3) = vcov[3]; - ader_ref(2,3) = vcov[4]; - ader_ref(3,3) = vcov[5]; - ader_ref(2,1) = ader_ref(1,2); - ader_ref(3,1) = ader_ref(1,3); - ader_ref(3,2) = ader_ref(2,3); - - for (it=1; it<=NTRK; it++) { - t_trk=vk->tmpArr[it-1].get(); - ader_ref(1, it*3 + 1) = -vcov[0] * t_trk->wbci[0] - - vcov[1] * t_trk->wbci[1] - - vcov[3] * t_trk->wbci[2]; - ader_ref(2, it*3 + 1) = -vcov[1] * t_trk->wbci[0] - - vcov[2] * t_trk->wbci[1] - - vcov[4] * t_trk->wbci[2]; - ader_ref(3, it*3 + 1) = -vcov[3] * t_trk->wbci[0] - - vcov[4] * t_trk->wbci[1] - - vcov[5] * t_trk->wbci[2]; - ader_ref(1, it*3 + 2) = -vcov[0] * t_trk->wbci[3] - - vcov[1] * t_trk->wbci[4] - - vcov[3] * t_trk->wbci[5]; - ader_ref(2, it*3 + 2) = -vcov[1] * t_trk->wbci[3] - - vcov[2] * t_trk->wbci[4] - - vcov[4] * t_trk->wbci[5]; - ader_ref(3, it*3 + 2) = -vcov[3] * t_trk->wbci[3] - - vcov[4] * t_trk->wbci[4] - - vcov[5] * t_trk->wbci[5]; - ader_ref(1, it*3 + 3) = -vcov[0] * t_trk->wbci[6] - - vcov[1] * t_trk->wbci[7] - - vcov[3] * t_trk->wbci[8]; - ader_ref(2, it*3 + 3) = -vcov[1] * t_trk->wbci[6] - - vcov[2] * t_trk->wbci[7] - - vcov[4] * t_trk->wbci[8]; - ader_ref(3, it*3 + 3) = -vcov[3] * t_trk->wbci[6] - - vcov[4] * t_trk->wbci[7] - - vcov[5] * t_trk->wbci[8]; - ader_ref(it*3 + 1, 1) = ader_ref(1, it*3 + 1); - ader_ref(it*3 + 1, 2) = ader_ref(2, it*3 + 1); - ader_ref(it*3 + 1, 3) = ader_ref(3, it*3 + 1); - ader_ref(it*3 + 2, 1) = ader_ref(1, it*3 + 2); - ader_ref(it*3 + 2, 2) = ader_ref(2, it*3 + 2); - ader_ref(it*3 + 2, 3) = ader_ref(3, it*3 + 2); - ader_ref(it*3 + 3, 1) = ader_ref(1, it*3 + 3); - ader_ref(it*3 + 3, 2) = ader_ref(2, it*3 + 3); - ader_ref(it*3 + 3, 3) = ader_ref(3, it*3 + 3); - } - - - for (it = 1; it<=NTRK; ++it) { - t_trk=vk->tmpArr[it-1].get(); - for (jt=1; jt<=NTRK; ++jt) { - int j3 = jt*3; - int i3 = it*3; - ader_ref( i3+1, j3+1) = -t_trk->wbci[0]*ader_ref(1, j3+1) - t_trk->wbci[1]*ader_ref(2, j3+1) - t_trk->wbci[2]*ader_ref(3, j3+1); - ader_ref( i3+2, j3+1) = -t_trk->wbci[3]*ader_ref(1, j3+1) - t_trk->wbci[4]*ader_ref(2, j3+1) - t_trk->wbci[5]*ader_ref(3, j3+1); - ader_ref( i3+3, j3+1) = -t_trk->wbci[6]*ader_ref(1, j3+1) - t_trk->wbci[7]*ader_ref(2, j3+1) - t_trk->wbci[8]*ader_ref(3, j3+1); - ader_ref( i3+1, j3+2) = -t_trk->wbci[0]*ader_ref(1, j3+2) - t_trk->wbci[1]*ader_ref(2, j3+2) - t_trk->wbci[2]*ader_ref(3, j3+2); - ader_ref( i3+2, j3+2) = -t_trk->wbci[3]*ader_ref(1, j3+2) - t_trk->wbci[4]*ader_ref(2, j3+2) - t_trk->wbci[5]*ader_ref(3, j3+2); - ader_ref( i3+3, j3+2) = -t_trk->wbci[6]*ader_ref(1, j3+2) - t_trk->wbci[7]*ader_ref(2, j3+2) - t_trk->wbci[8]*ader_ref(3, j3+2); - ader_ref( i3+1, j3+3) = -t_trk->wbci[0]*ader_ref(1, j3+3) - t_trk->wbci[1]*ader_ref(2, j3+3) - t_trk->wbci[2]*ader_ref(3, j3+3); - ader_ref( i3+2, j3+3) = -t_trk->wbci[3]*ader_ref(1, j3+3) - t_trk->wbci[4]*ader_ref(2, j3+3) - t_trk->wbci[5]*ader_ref(3, j3+3); - ader_ref( i3+3, j3+3) = -t_trk->wbci[6]*ader_ref(1, j3+3) - t_trk->wbci[7]*ader_ref(2, j3+3) - t_trk->wbci[8]*ader_ref(3, j3+3); - if (it == jt) { - ader_ref( i3+1, i3+1) += t_trk->wci[0]; - ader_ref( i3+1, i3+2) += t_trk->wci[1]; - ader_ref( i3+2, i3+1) += t_trk->wci[1]; - ader_ref( i3+2, i3+2) += t_trk->wci[2]; - ader_ref( i3+1, i3+3) += t_trk->wci[3]; - ader_ref( i3+3, i3+1) += t_trk->wci[3]; - ader_ref( i3+2, i3+3) += t_trk->wci[4]; - ader_ref( i3+3, i3+2) += t_trk->wci[4]; - ader_ref( i3+3, i3+3) += t_trk->wci[5]; - } - } - } -//for(int ii=1; ii<=9; ii++)std::cout<ConstraintList.empty() && !useWeightScheme ){ -//--------------------------------------------------------------------- -// Covariance matrix with constraints a la Avery. -// ader_ref() should contain nonconstraint covariance matrix -//--------------------------------------------------------------------- - long int totNC=0; //total number of constraints - std::vector > tf0t; // derivative collectors - std::vector< Vect3DF > th0t; // derivative collectors - std::vector< double > taa; // derivative collectors - std::vector< Vect3DF > tmpVec; - for(int ii=0; ii<(int)vk->ConstraintList.size();ii++){ - totNC += vk->ConstraintList[ii]->NCDim; - for(ic=0; ic<(int)vk->ConstraintList[ii]->NCDim; ic++){ - taa.push_back( vk->ConstraintList[ii]->aa[ic] ); - th0t.push_back( vk->ConstraintList[ii]->h0t[ic] ); - tmpVec.clear(); - for(it=0; it<(int)vk->ConstraintList[ii]->f0t.size(); it++){ - tmpVec.push_back( vk->ConstraintList[ii]->f0t[it][ic] ); - } - tf0t.push_back( tmpVec ); - } - } -// R,RC[ic][i] - double **R =new double*[totNC]; for(ic=0; icexistFullCov = 1; - return 0; -} -#undef dcv_ref -#undef ader_ref - -#undef useWeightScheme - -} /* End of VKalVrtCore namespace*/ - +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrkVKalVrtCore/CommonPars.h" +#include "TrkVKalVrtCore/Derivt.h" +#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" +#include +#include + +namespace Trk { + +/* ---------------------------------------------------------- */ +/* Entry for error matrix calculation after successful fit */ +/* Error matrix has a form V(X,Y,Z,PX,PY,PZ) */ +/* ADER - full covariance matrix after fit in form */ +/* (x,y,z,track1(1:3),track2(1:3),......) */ + +#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)] +#define dcv_ref(a_1,a_2) dcv[(a_2)*6 + (a_1) - 7] + + +#define useWeightScheme 1 + +int getFullVrtCov(VKVertex * vk, double *ader, const double *dcv, double verr[6][6]) +{ + + int i,j,ic1,ic2; + + long int ic, jc, it, jt; + double cnt = 1e8; + + + extern void dsinv(long int, double *, long int , long int *) noexcept; + extern void FullMTXfill( VKVertex* , double *); + extern void vkSVDCmp(double**, int, int, double*, double**); + + TWRK * t_trk=nullptr; + long int NTRK = vk->TrackList.size(); + long int IERR=0; + long int NVar = (NTRK + 1) * 3; + if(vk->passNearVertex && vk->ConstraintList.empty()) { + /* Fit is with "pass near" constraint and then */ + /* matrix is already present */ + } else if ( !vk->ConstraintList.empty() && useWeightScheme ) { +/* Full matrix inversion i */ +// + FullMTXfill( vk, ader); + if ( vk->passNearVertex ) { + double drdpy[2][3]; + double dpipj[3][3]; + for (it = 1; it <= NTRK; ++it) { + drdpy[0][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[1]; + drdpy[1][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[2]; + drdpy[0][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[1]; + drdpy[1][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[2]; + drdpy[0][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[1]; + drdpy[1][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[2]; + for (jt = 1; jt <= NTRK; ++jt) { /* Matrix */ + for (int k = 0; k < 3; ++k) { + for (int l = 0; l < 3; ++l) { + dpipj[k][l] = 0.; + for (int j = 0; j < 2; ++j) { + dpipj[k][l] += vk->tmpArr[jt-1]->drdp[j][k] * drdpy[j][l]; + } + } + } + for (int k = 1; k <= 3; ++k) { + for (int l = 1; l <= 3; ++l) { + ader_ref(it * 3 + k, jt * 3 + l) += dpipj[l-1][k-1]; + } + } + } + } + } + Vect3DF th0t,tf0t; + for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ + for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ + th0t = vk->ConstraintList[ic1]->h0t[ic2]; + ader_ref(1, 1) += cnt * th0t.X * th0t.X; + ader_ref(2, 1) += cnt * th0t.Y * th0t.X; + ader_ref(3, 1) += cnt * th0t.Z * th0t.X; + ader_ref(1, 2) += cnt * th0t.X * th0t.Y; + ader_ref(2, 2) += cnt * th0t.Y * th0t.Y; + ader_ref(3, 2) += cnt * th0t.Z * th0t.Y; + ader_ref(1, 3) += cnt * th0t.X * th0t.Z; + ader_ref(2, 3) += cnt * th0t.Y * th0t.Z; + ader_ref(3, 3) += cnt * th0t.Z * th0t.Z; + for (it = 1; it <= NTRK; ++it) { + tf0t = vk->ConstraintList[ic1]->f0t[it-1][ic2]; + ader_ref(1, it * 3 + 1) += cnt * th0t.X * tf0t.X; + ader_ref(2, it * 3 + 1) += cnt * th0t.Y * tf0t.X; + ader_ref(3, it * 3 + 1) += cnt * th0t.Z * tf0t.X; + ader_ref(1, it * 3 + 2) += cnt * th0t.X * tf0t.Y; + ader_ref(2, it * 3 + 2) += cnt * th0t.Y * tf0t.Y; + ader_ref(3, it * 3 + 2) += cnt * th0t.Z * tf0t.Y; + ader_ref(1, it * 3 + 3) += cnt * th0t.X * tf0t.Z; + ader_ref(2, it * 3 + 3) += cnt * th0t.Y * tf0t.Z; + ader_ref(3, it * 3 + 3) += cnt * th0t.Z * tf0t.Z; + } + } + } + + + for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ + for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ + for (it = 1; it <= NTRK; ++it) { + for (jt = it; jt <= NTRK; ++jt) { + Vect3DF tf0ti = vk->ConstraintList[ic1]->f0t[it-1][ic2]; + Vect3DF tf0tj = vk->ConstraintList[ic1]->f0t[jt-1][ic2]; + ader_ref(it*3 + 1, jt*3 + 1) += cnt * tf0ti.X * tf0tj.X; + ader_ref(it*3 + 2, jt*3 + 1) += cnt * tf0ti.Y * tf0tj.X; + ader_ref(it*3 + 3, jt*3 + 1) += cnt * tf0ti.Z * tf0tj.X; + ader_ref(it*3 + 1, jt*3 + 2) += cnt * tf0ti.X * tf0tj.Y; + ader_ref(it*3 + 2, jt*3 + 2) += cnt * tf0ti.Y * tf0tj.Y; + ader_ref(it*3 + 3, jt*3 + 2) += cnt * tf0ti.Z * tf0tj.Y; + ader_ref(it*3 + 1, jt*3 + 3) += cnt * tf0ti.X * tf0tj.Z; + ader_ref(it*3 + 2, jt*3 + 3) += cnt * tf0ti.Y * tf0tj.Z; + ader_ref(it*3 + 3, jt*3 + 3) += cnt * tf0ti.Z * tf0tj.Z; + } + } + } + } +/* symmetrisation */ + for (i=1; i<=NVar-1; ++i) { + for (j = i+1; j<=NVar; ++j) { + ader_ref(j,i) = ader_ref(i,j); + } + } +//------------------------------------------------------------------------- +/* several checks for debugging */ +//std::cout.precision(12); +// for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ +// for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ +// th0t = vk->ConstraintList[ic1]->h0t[ic2]; +//std::cout<<"h0t="<ConstraintList[ic1]->f0t[it-1][ic2]; +//std::cout<<"f0t="< ta (NVar+1); + noinit_vector tab ((NVar+1)*(NVar+1)); + for(i=0; i tv (NVar+1); + noinit_vector tvb ((NVar+1)*(NVar+1)); + noinit_vector tr (NVar+1); + noinit_vector trb ((NVar+1)*(NVar+1)); + noinit_vector tw (NVar+1); + for(i=0; itmax)tmax=fabs(tw[i]); + for(i=1; i std::abs(mcheck)) ? maxDiff : std::abs(mcheck); + if(i==j) maxDiff = (maxDiff > std::abs(1.-mcheck)) ? maxDiff : std::abs(1.-mcheck); + } } + //--------------------------------------------------------------------------------------- + if(maxDiff>0.1)return -1; +/* ---------------------------------------- */ + } else { +/* ---------------------------------------- */ +/* Simple and fast without constraints */ + for (i=1; i<=NVar; i++) { + for (j=1; j<=NVar; j++) { + ader_ref(i,j)=0.; + } + } + double vcov[6]={vk->fitVcov[0],vk->fitVcov[1],vk->fitVcov[2],vk->fitVcov[3],vk->fitVcov[4],vk->fitVcov[5]}; + ader_ref(1,1) = vcov[0]; + ader_ref(1,2) = vcov[1]; + ader_ref(2,2) = vcov[2]; + ader_ref(1,3) = vcov[3]; + ader_ref(2,3) = vcov[4]; + ader_ref(3,3) = vcov[5]; + ader_ref(2,1) = ader_ref(1,2); + ader_ref(3,1) = ader_ref(1,3); + ader_ref(3,2) = ader_ref(2,3); + + for (it=1; it<=NTRK; it++) { + t_trk=vk->tmpArr[it-1].get(); + ader_ref(1, it*3 + 1) = -vcov[0] * t_trk->wbci[0] + - vcov[1] * t_trk->wbci[1] + - vcov[3] * t_trk->wbci[2]; + ader_ref(2, it*3 + 1) = -vcov[1] * t_trk->wbci[0] + - vcov[2] * t_trk->wbci[1] + - vcov[4] * t_trk->wbci[2]; + ader_ref(3, it*3 + 1) = -vcov[3] * t_trk->wbci[0] + - vcov[4] * t_trk->wbci[1] + - vcov[5] * t_trk->wbci[2]; + ader_ref(1, it*3 + 2